调整公共常用方法
parent
6629e9b4d5
commit
8dc9047a3b
|
@ -1,4 +1,9 @@
|
||||||
import request from './requst.js';
|
import request from './requst.js';
|
||||||
|
// 共用图片上传接口
|
||||||
export function uploadImg(data) {
|
export function uploadImg(data) {
|
||||||
return request.upload("/universal/api.upload/upload", data);
|
return request.upload("/universal/api.upload/upload", data);
|
||||||
|
}
|
||||||
|
// 解决方案列表接口
|
||||||
|
export function getPlanType(data) {
|
||||||
|
return request.get("/universal/api.solution/solution_list", data);
|
||||||
}
|
}
|
|
@ -92,6 +92,7 @@
|
||||||
// 底部组件
|
// 底部组件
|
||||||
import footTabOne from '@/components/foot-tabs/foot-tab-one.vue';
|
import footTabOne from '@/components/foot-tabs/foot-tab-one.vue';
|
||||||
import arprogress from '@/components/ar-circle-progress/index.vue'
|
import arprogress from '@/components/ar-circle-progress/index.vue'
|
||||||
|
import { uploadImg } from '@/jsFile/public-api.js';
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
statusNavSlot,
|
statusNavSlot,
|
||||||
|
@ -186,6 +187,12 @@
|
||||||
sourceType:['album','camera'],
|
sourceType:['album','camera'],
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
this.userInfo.avatar = res.tempFilePaths[0];
|
this.userInfo.avatar = res.tempFilePaths[0];
|
||||||
|
// this.$requst.upload('/universal/api.user/avatar',{path:this.userInfo.avatar}).then(res=>{
|
||||||
|
// if(res.code) {
|
||||||
|
// // 查询用户信息
|
||||||
|
// this.checkInfo();
|
||||||
|
// }
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
|
@ -233,6 +233,7 @@
|
||||||
import noticeOne from '@/components/notices/notice-one/notice-one.vue';
|
import noticeOne from '@/components/notices/notice-one/notice-one.vue';
|
||||||
import footTabOne from '@/components/foot-tabs/foot-tab-one.vue';
|
import footTabOne from '@/components/foot-tabs/foot-tab-one.vue';
|
||||||
import containerSubgroupTwo from '@/components/containers/container-subgroup-two.vue';
|
import containerSubgroupTwo from '@/components/containers/container-subgroup-two.vue';
|
||||||
|
import {getPlanType} from '@/jsFile/public-api.js';
|
||||||
const app = getApp();
|
const app = getApp();
|
||||||
export default {
|
export default {
|
||||||
components:{
|
components:{
|
||||||
|
@ -322,7 +323,7 @@
|
||||||
// 获取当前页面url
|
// 获取当前页面url
|
||||||
this.$toolAll.tools.obtainUrl();
|
this.$toolAll.tools.obtainUrl();
|
||||||
// 调用解决方案类型事件
|
// 调用解决方案类型事件
|
||||||
this.getPlanType();
|
this.getPlanTypeEv();
|
||||||
// 调用增值服务类型
|
// 调用增值服务类型
|
||||||
this.getIncrementServiceType();
|
this.getIncrementServiceType();
|
||||||
// 调用获取常见故障列表事件
|
// 调用获取常见故障列表事件
|
||||||
|
@ -365,23 +366,6 @@
|
||||||
url:`/pages/dataQuery/queryFunction?index=${index}`
|
url:`/pages/dataQuery/queryFunction?index=${index}`
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 查询解决方案类型
|
|
||||||
getPlanType(){
|
|
||||||
this.$requst.get('/universal/api.solution/solution',{page:1,list_rows:20}).then(res=>{
|
|
||||||
if(res.code) {
|
|
||||||
this.solutionList = [];
|
|
||||||
res.data.data.forEach(item=>{
|
|
||||||
let obj = {
|
|
||||||
id:item.id,
|
|
||||||
title:item.name,
|
|
||||||
imgsrc: app.globalData.hostapi + '/' + item.cover_img,
|
|
||||||
}
|
|
||||||
this.solutionList.push(obj);
|
|
||||||
})
|
|
||||||
// console.log(this.solutionList,340);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 故障报修分类下的点击事件
|
// 故障报修分类下的点击事件
|
||||||
goFaultRepair(index){
|
goFaultRepair(index){
|
||||||
if(index!=2) {
|
if(index!=2) {
|
||||||
|
@ -396,6 +380,27 @@
|
||||||
this.$toolAll.tools.showToast('已催单成功')
|
this.$toolAll.tools.showToast('已催单成功')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 查询解决方案的推荐方案
|
||||||
|
getPlanTypeEv(){
|
||||||
|
let params = {
|
||||||
|
is_recommend:1,
|
||||||
|
list_rows:200,
|
||||||
|
page:1
|
||||||
|
}
|
||||||
|
getPlanType(params).then(res=>{
|
||||||
|
if(res.code) {
|
||||||
|
this.solutionList = [];
|
||||||
|
res.data.data.forEach(item=>{
|
||||||
|
let obj = {
|
||||||
|
id:item.id,
|
||||||
|
title:item.title,
|
||||||
|
imgsrc: item.cover_img,
|
||||||
|
}
|
||||||
|
this.solutionList.push(obj);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
// 获取常见故障推荐列表
|
// 获取常见故障推荐列表
|
||||||
getFaultsList(){
|
getFaultsList(){
|
||||||
this.$requst.post('/universal/api.question/question').then(res=>{
|
this.$requst.post('/universal/api.question/question').then(res=>{
|
||||||
|
@ -404,7 +409,7 @@
|
||||||
let obj = {
|
let obj = {
|
||||||
id:item.id,
|
id:item.id,
|
||||||
title:item.title,
|
title:item.title,
|
||||||
imgsrc: app.globalData.hostapi + '/' + item.cover_img,
|
imgsrc: item.cover_img,
|
||||||
content:item.summary,
|
content:item.summary,
|
||||||
views:item.reading
|
views:item.reading
|
||||||
}
|
}
|
||||||
|
@ -413,6 +418,18 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 前往解决方案、常见故障列表
|
||||||
|
goPlant(index){
|
||||||
|
uni.navigateTo({
|
||||||
|
url:`/pagesB/plan-fault/plan-fault?index=${index}`
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 前往解决方案详情、常见故障详情
|
||||||
|
goDetail(index,id) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url:`/pagesB/plan-fault-product-detail/detail?index=${index}&id=${id}`
|
||||||
|
})
|
||||||
|
},
|
||||||
// 其他分类下的点击事件
|
// 其他分类下的点击事件
|
||||||
otherEv(index) {
|
otherEv(index) {
|
||||||
let otherUrls = [
|
let otherUrls = [
|
||||||
|
@ -424,21 +441,6 @@
|
||||||
url:otherUrls[index]
|
url:otherUrls[index]
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 前往解决方案、常见故障列表
|
|
||||||
goPlant(index){
|
|
||||||
uni.navigateTo({
|
|
||||||
url:`/pagesB/plan-fault/plan-fault?index=${index}`
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 前往解决方案详情、常见故障详情
|
|
||||||
goDetail(index,id) {
|
|
||||||
// uni.navigateTo({
|
|
||||||
// url:`/pagesB/plan-fault-product-detail/detail?index=${index}&id=${id}`
|
|
||||||
// })
|
|
||||||
uni.navigateTo({
|
|
||||||
url:`/pagesB/plan-fault/plan-fault?index=${index}&type_id=${id}`
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 前往消息列表页面
|
// 前往消息列表页面
|
||||||
goMessage(){
|
goMessage(){
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const app = getApp();
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -55,7 +54,7 @@
|
||||||
// 日期转换
|
// 日期转换
|
||||||
this.dataObj.create_time = this.$toolAll.tools.timestampToTime(this.dataObj.create_time);
|
this.dataObj.create_time = this.$toolAll.tools.timestampToTime(this.dataObj.create_time);
|
||||||
// 封面图
|
// 封面图
|
||||||
this.dataObj.cover_img = app.globalData.hostapi + '/' + this.dataObj.cover_img,
|
this.dataObj.cover_img = this.dataObj.cover_img,
|
||||||
this.rich_text = this.$toolAll.tools.escape2Html(this.dataObj.content);
|
this.rich_text = this.$toolAll.tools.escape2Html(this.dataObj.content);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<status-nav :navBarTitle="ifPlanFault" returnColor="#c2c2c2"></status-nav>
|
<status-nav :navBarTitle="ifPlanFault" returnColor="#c2c2c2"></status-nav>
|
||||||
<container-subgroup>
|
<container-subgroup>
|
||||||
<view slot="content" style="margin: 0 -16rpx;" class="fon28">
|
<view slot="content" style="margin: 0 -16rpx;" class="fon28">
|
||||||
<view @tap="goDetail(item.id)" class="bacf radius10 pad-s30 mar-x10 pad-x10" v-for="(item,index) in dataList" :key="index">
|
<view @tap="goDetail(item.id)" class="bacf radius10 pad-s30 mar-x10 pad-x10 animated fadeIn" v-for="(item,index) in dataList" :key="index">
|
||||||
<view class=" pad-zy10 disjbac">
|
<view class=" pad-zy10 disjbac">
|
||||||
<image :src="item.cover_img" mode="aspectFill" lazy-load class="flexs mar-y20" style="width: 240rpx;height: 174rpx;border-radius: 6rpx;"></image>
|
<image :src="item.cover_img" mode="aspectFill" lazy-load class="flexs mar-y20" style="width: 240rpx;height: 174rpx;border-radius: 6rpx;"></image>
|
||||||
<view style="height: 174rpx;" class="width100 disjb fc fon24 posir">
|
<view style="height: 174rpx;" class="width100 disjb fc fon24 posir">
|
||||||
|
@ -22,6 +22,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="bbot mar-s20"></view>
|
<view class="bbot mar-s20"></view>
|
||||||
</view>
|
</view>
|
||||||
|
<pitera v-if="total==dataList.length && dataList.length" textStr="暂无更多列表数据"></pitera>
|
||||||
</view>
|
</view>
|
||||||
</container-subgroup>
|
</container-subgroup>
|
||||||
<nothing-page v-if="dataList.length==0" content="暂无更多列表数据"></nothing-page>
|
<nothing-page v-if="dataList.length==0" content="暂无更多列表数据"></nothing-page>
|
||||||
|
@ -30,23 +31,30 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import rate from '@/components/rate.vue';
|
import rate from '@/components/rate.vue';
|
||||||
const app = getApp();
|
import pitera from '@/components/nothing/pitera.vue';
|
||||||
export default {
|
export default {
|
||||||
components:{
|
components:{
|
||||||
rate
|
rate,
|
||||||
|
pitera
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
rateNum:5,
|
rateNum:5,
|
||||||
ifPlanFault:'',
|
ifPlanFault:'',
|
||||||
current:'',
|
current:'',
|
||||||
size:10,
|
size:20,
|
||||||
page:1,
|
page:1,
|
||||||
total:0,
|
total:0,
|
||||||
type_id:'',//解决方案类型id
|
type_id:'',//解决方案类型id
|
||||||
dataList:[]
|
dataList:[]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
if(this.total != this.dataList.length) {
|
||||||
|
this.page++;
|
||||||
|
this.getPlanFault();
|
||||||
|
}
|
||||||
|
},
|
||||||
onLoad(op) {
|
onLoad(op) {
|
||||||
this.ifPlanFault = `${['解决方案','常见故障'][op.index*1]}`;
|
this.ifPlanFault = `${['解决方案','常见故障'][op.index*1]}`;
|
||||||
this.current = op.index*1;
|
this.current = op.index*1;
|
||||||
|
@ -68,7 +76,7 @@
|
||||||
];
|
];
|
||||||
let params = [
|
let params = [
|
||||||
{
|
{
|
||||||
type_id:this.type_id,
|
is_recommend:0,
|
||||||
list_rows:this.size,
|
list_rows:this.size,
|
||||||
page:this.page
|
page:this.page
|
||||||
},
|
},
|
||||||
|
@ -84,7 +92,7 @@
|
||||||
res.data.data.forEach(item=>{
|
res.data.data.forEach(item=>{
|
||||||
let obj = {
|
let obj = {
|
||||||
id:item.id,
|
id:item.id,
|
||||||
cover_img: app.globalData.hostapi + '/' + item.cover_img,
|
cover_img: item.cover_img,
|
||||||
title:item.title,//标题
|
title:item.title,//标题
|
||||||
summary:item.summary,//描述
|
summary:item.summary,//描述
|
||||||
hot:item.hot,//热度
|
hot:item.hot,//热度
|
||||||
|
@ -92,7 +100,6 @@
|
||||||
}
|
}
|
||||||
this.dataList.push(obj);
|
this.dataList.push(obj);
|
||||||
})
|
})
|
||||||
console.log(this.dataList);
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue