From 8dc9047a3ba20560b641cb0f2de181f79e7ba92f Mon Sep 17 00:00:00 2001 From: chen <2659004835@qq.com> Date: Fri, 8 Apr 2022 18:43:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=85=AC=E5=85=B1=E5=B8=B8?= =?UTF-8?q?=E7=94=A8=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jsFile/public-api.js | 5 ++ pages/tabbar/my/my.vue | 7 +++ pages/tabbar/pagehome/pagehome.vue | 70 +++++++++++---------- pagesB/plan-fault-product-detail/detail.vue | 3 +- pagesB/plan-fault/plan-fault.vue | 21 ++++--- 5 files changed, 63 insertions(+), 43 deletions(-) diff --git a/jsFile/public-api.js b/jsFile/public-api.js index 71f6d4c..09b0e87 100644 --- a/jsFile/public-api.js +++ b/jsFile/public-api.js @@ -1,4 +1,9 @@ import request from './requst.js'; +// 共用图片上传接口 export function uploadImg(data) { return request.upload("/universal/api.upload/upload", data); +} +// 解决方案列表接口 +export function getPlanType(data) { + return request.get("/universal/api.solution/solution_list", data); } \ No newline at end of file diff --git a/pages/tabbar/my/my.vue b/pages/tabbar/my/my.vue index 8dda8df..865bbf5 100644 --- a/pages/tabbar/my/my.vue +++ b/pages/tabbar/my/my.vue @@ -92,6 +92,7 @@ // 底部组件 import footTabOne from '@/components/foot-tabs/foot-tab-one.vue'; import arprogress from '@/components/ar-circle-progress/index.vue' + import { uploadImg } from '@/jsFile/public-api.js'; export default { components: { statusNavSlot, @@ -186,6 +187,12 @@ sourceType:['album','camera'], success: (res) => { this.userInfo.avatar = res.tempFilePaths[0]; + // this.$requst.upload('/universal/api.user/avatar',{path:this.userInfo.avatar}).then(res=>{ + // if(res.code) { + // // 查询用户信息 + // this.checkInfo(); + // } + // }) } }) }, diff --git a/pages/tabbar/pagehome/pagehome.vue b/pages/tabbar/pagehome/pagehome.vue index 0b3444d..5d32fff 100644 --- a/pages/tabbar/pagehome/pagehome.vue +++ b/pages/tabbar/pagehome/pagehome.vue @@ -233,6 +233,7 @@ import noticeOne from '@/components/notices/notice-one/notice-one.vue'; import footTabOne from '@/components/foot-tabs/foot-tab-one.vue'; import containerSubgroupTwo from '@/components/containers/container-subgroup-two.vue'; + import {getPlanType} from '@/jsFile/public-api.js'; const app = getApp(); export default { components:{ @@ -322,7 +323,7 @@ // 获取当前页面url this.$toolAll.tools.obtainUrl(); // 调用解决方案类型事件 - this.getPlanType(); + this.getPlanTypeEv(); // 调用增值服务类型 this.getIncrementServiceType(); // 调用获取常见故障列表事件 @@ -365,23 +366,6 @@ 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){ if(index!=2) { @@ -396,6 +380,27 @@ 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(){ this.$requst.post('/universal/api.question/question').then(res=>{ @@ -404,7 +409,7 @@ let obj = { id:item.id, title:item.title, - imgsrc: app.globalData.hostapi + '/' + item.cover_img, + imgsrc: item.cover_img, content:item.summary, 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) { let otherUrls = [ @@ -424,21 +441,6 @@ 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(){ uni.navigateTo({ diff --git a/pagesB/plan-fault-product-detail/detail.vue b/pagesB/plan-fault-product-detail/detail.vue index 55abdbd..1409e22 100644 --- a/pagesB/plan-fault-product-detail/detail.vue +++ b/pagesB/plan-fault-product-detail/detail.vue @@ -21,7 +21,6 @@