调整公共常用方法
parent
6629e9b4d5
commit
8dc9047a3b
|
@ -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);
|
||||
}
|
|
@ -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();
|
||||
// }
|
||||
// })
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
@ -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({
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
const app = getApp();
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -55,7 +54,7 @@
|
|||
// 日期转换
|
||||
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);
|
||||
}
|
||||
})
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<status-nav :navBarTitle="ifPlanFault" returnColor="#c2c2c2"></status-nav>
|
||||
<container-subgroup>
|
||||
<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">
|
||||
<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">
|
||||
|
@ -22,6 +22,7 @@
|
|||
</view>
|
||||
<view class="bbot mar-s20"></view>
|
||||
</view>
|
||||
<pitera v-if="total==dataList.length && dataList.length" textStr="暂无更多列表数据"></pitera>
|
||||
</view>
|
||||
</container-subgroup>
|
||||
<nothing-page v-if="dataList.length==0" content="暂无更多列表数据"></nothing-page>
|
||||
|
@ -30,23 +31,30 @@
|
|||
|
||||
<script>
|
||||
import rate from '@/components/rate.vue';
|
||||
const app = getApp();
|
||||
import pitera from '@/components/nothing/pitera.vue';
|
||||
export default {
|
||||
components:{
|
||||
rate
|
||||
rate,
|
||||
pitera
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
rateNum:5,
|
||||
ifPlanFault:'',
|
||||
current:'',
|
||||
size:10,
|
||||
size:20,
|
||||
page:1,
|
||||
total:0,
|
||||
type_id:'',//解决方案类型id
|
||||
dataList:[]
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
if(this.total != this.dataList.length) {
|
||||
this.page++;
|
||||
this.getPlanFault();
|
||||
}
|
||||
},
|
||||
onLoad(op) {
|
||||
this.ifPlanFault = `${['解决方案','常见故障'][op.index*1]}`;
|
||||
this.current = op.index*1;
|
||||
|
@ -68,7 +76,7 @@
|
|||
];
|
||||
let params = [
|
||||
{
|
||||
type_id:this.type_id,
|
||||
is_recommend:0,
|
||||
list_rows:this.size,
|
||||
page:this.page
|
||||
},
|
||||
|
@ -84,7 +92,7 @@
|
|||
res.data.data.forEach(item=>{
|
||||
let obj = {
|
||||
id:item.id,
|
||||
cover_img: app.globalData.hostapi + '/' + item.cover_img,
|
||||
cover_img: item.cover_img,
|
||||
title:item.title,//标题
|
||||
summary:item.summary,//描述
|
||||
hot:item.hot,//热度
|
||||
|
@ -92,7 +100,6 @@
|
|||
}
|
||||
this.dataList.push(obj);
|
||||
})
|
||||
console.log(this.dataList);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue