diff --git a/commons/flying-monkey.css b/commons/flying-monkey.css index c545c6f..38e248e 100644 --- a/commons/flying-monkey.css +++ b/commons/flying-monkey.css @@ -196,7 +196,7 @@ uni-radio .uni-radio-input {border: 1rpx solid #444444;} background-color: #FFFFFF; } .solution-title { - bottom: 6rpx; + bottom: 0rpx; left: -40rpx; right: -40rpx; padding: 6rpx; diff --git a/jsFile/requst.js b/jsFile/requst.js index b53b3dd..3441928 100644 --- a/jsFile/requst.js +++ b/jsFile/requst.js @@ -123,21 +123,21 @@ const uploadFile = (url, options) => { return new Promise((resolve, reject) => { uni.uploadFile({ url: `${hostapi}${url}`, - filePath: tempData.form, - name: 'image', + filePath: tempData.path, + name: 'file', fileType:'image', formData: tempData, // sslVerify:false,//验证 ssl 证书 仅App安卓端支持 // withCredentials:true,//跨域请求时是否携带凭证(cookies)仅H5支持 header: { - 'Content-Type': 'multipart/form-data;charset=UTF-8', - 'Authorization': 'Bearer '+uni.getStorageSync('token') || '', - 'token':uni.getStorageSync('token') || '' + // 'Content-Type': 'multipart/form-data;charset=UTF-8', + // 'Authorization': 'Bearer '+uni.getStorageSync('token') || '', + token:uni.getStorageSync('token') || '' }, success: res => { if (res.statusCode == 200) { let temp = JSON.parse(res.data) - if (temp.code == 0) { + if (temp.code == 1) { resolve(temp) } } diff --git a/jsFile/tools.js b/jsFile/tools.js index 5d3f3e7..f807396 100644 --- a/jsFile/tools.js +++ b/jsFile/tools.js @@ -84,6 +84,22 @@ const tools = { hideMPhone(phone){ return `${phone.substr(0, 3)}****${phone.substr(7)}` }, + // 手机号中间加字符 + phoneAddChat(phone,startNum=3,endNum=7,character=' '){ + let phoneStr = phone; + phoneStr = phoneStr.replace(/\s*/g, ""); + var phoneArr = []; + for(var i = 0; i < phoneStr.length; i++){ + if (i==startNum||i==endNum){ + phoneArr.push(`${character}` + phoneStr.charAt(i)); + console.log(phoneArr); + } else { + phoneArr.push(phoneStr.charAt(i)); + } + } + phone = phoneArr.join(""); + return phone; + }, // 昵称从第一个字开始,后面的都用"*"代替 hideName(name,num){ return `${name.substr(0, 1)}****${name.substr(name.length-1)}` diff --git a/pages/feedback/feedback.vue b/pages/feedback/feedback.vue index cf92e16..83043df 100644 --- a/pages/feedback/feedback.vue +++ b/pages/feedback/feedback.vue @@ -28,14 +28,15 @@ 服务监督电话: - 156 1566 0510 + + {{feedbackPhone}} 反馈受理时间: - 9:00 - 18:00 + {{feedbackTime}} @@ -50,6 +51,7 @@ import statusNav from '../../components/status-nav.vue'; import footTabOne from "../../components/foot-tabs/foot-tab-one.vue" import containerSubgroupTwo from '@/components/containers/container-subgroup-two.vue'; + import { uploadImg } from '@/jsFile/public-api.js'; const app = getApp(); export default { components: { @@ -60,37 +62,17 @@ data() { return { isReturn: false, - typeData: [{ - title: "未解决问题", - state: false - }, - { - title: "处理不及时", - state: false - }, - { - title: "软件问题", - state: false - }, - { - title: "报修问题", - state: false - }, - { - title: "服务投诉", - state: false - }, - { - title: "其他问题反馈", - state: false - }, - ], + // 已经类型数组 + typeData: [], typeNum: 0, opinion: '', name: '', phone: '', imgSrc: '', - flag: true + flag: true, + feedbackPhone:'',//服务监督电话 + feedbackTime:'',//反馈受理时间 + type_id:''//意见类型id } }, onLoad() { @@ -103,20 +85,23 @@ if (this.flag) { this.flag = false; let params = { - a: this.typeData[this.typeNum].title, - b: this.opinion, - c: this.name, - d: this.phone, - e: this.imgSrc + type_id: this.type_id, + picture: this.imgSrc, + contact_name: this.name, + contact_phone: this.phone, + content: this.opinion } - console.log(params, 107); - // this.$requst.post('',params).then(res=>{ - // if(res.code) { - // uni.navigateBack({delta:1}) - // } else { - // this.flag = true; - // } - // }) + this.$requst.post('/universal/api.feedback/feedback',params).then(res=>{ + if(res.code) { + this.$toolAll.tools.showToast('反馈成功'); + this.imgSrc = ''; + this.name = ''; + this.phone = ''; + this.opinion = ''; + } else { + this.flag = true; + } + }) } } }, @@ -139,23 +124,13 @@ console.log( uni.getStorageSync("token")) uni.chooseImage({ success: (chooseImageRes) => { - const tempFilePaths = chooseImageRes.tempFilePaths; - this.imgSrc = chooseImageRes.tempFilePaths[0] - uni.uploadFile({ - url: app.globalData.hostapi+'/universal/api.upload/upload', //仅为示例,非真实的接口地址 - filePath: tempFilePaths[0], - name: 'image', - header:{ - token: uni.getStorageSync("token") - }, - formData: { - dir:"images" - }, - success: (uploadFileRes) => { - console.log(uploadFileRes) - - } - }); + const tempFilePaths = chooseImageRes.tempFilePaths[0]; + this.imgSrc = tempFilePaths; + uploadImg({path:tempFilePaths}).then(res=>{ + if(res.code) { + this.$toolAll.tools.showToast('上传成功'); + } + }) } }); @@ -164,17 +139,32 @@ checkFeedback() { this.$requst.get('/universal/api.feedback/feedback_type', { page: 1, - list_rows: 20 + list_rows: 200 }).then(res => { - + let newData = res.data; + if(res.code){ + this.typeData = []; + // 反馈受理时间 + this.feedbackTime = `${newData.start_time} - ${newData.end_time}`; + // 服务监督电话 + this.feedbackPhone = this.$toolAll.tools.phoneAddChat(newData.phone); + if(newData.type_list.length) { + newData.type_list.forEach(item=>{ + let obj = { + title:item.name, + id:item.type_id + } + this.typeData.push(obj); + }) + // 初始化意见类型id + this.type_id = this.typeData[0].id; + } + } }) }, opinionType(index) { this.typeNum = index; - // for (var i = 0; i < this.typeData.length; i++) { - // this.typeData[i].state = false - // } - // this.typeData[index].state = true + this.type_id = this.typeData[index].id; } } } @@ -230,7 +220,7 @@ font-size: 30rpx; border-radius: 10rpx; background-color: #FFFFFF; - color: #9f9898; + color: #000000; display: flex; margin-bottom: 16rpx; align-items: center; diff --git a/pages/tabbar/pagehome/pagehome.vue b/pages/tabbar/pagehome/pagehome.vue index 77fa933..e0dac9d 100644 --- a/pages/tabbar/pagehome/pagehome.vue +++ b/pages/tabbar/pagehome/pagehome.vue @@ -195,7 +195,7 @@ - + {{item.title}} @@ -363,9 +363,10 @@ }, // 查询解决方案类型 getPlanType(){ - this.$requst.post('/universal/api.solution/solution_type').then(res=>{ + this.$requst.get('/universal/api.solution/solution',{page:1,list_rows:20}).then(res=>{ if(res.code) { - res.data.forEach(item=>{ + this.solutionList = []; + res.data.data.forEach(item=>{ let obj = { id:item.id, title:item.name, @@ -373,7 +374,7 @@ } this.solutionList.push(obj); }) - console.log(this.solutionList,340); + // console.log(this.solutionList,340); } }) }, @@ -427,8 +428,11 @@ }, // 前往解决方案详情、常见故障详情 goDetail(index,id) { + // uni.navigateTo({ + // url:`/pagesB/plan-fault-product-detail/detail?index=${index}&id=${id}` + // }) uni.navigateTo({ - url:`/pagesB/plan-fault-product-detail/detail?index=${index}&id=${id}` + url:`/pagesB/plan-fault/plan-fault?index=${index}&type_id=${id}` }) }, // 前往消息列表页面 diff --git a/pagesB/message-center/message-center.vue b/pagesB/message-center/message-center.vue index 693d138..e6942ed 100644 --- a/pagesB/message-center/message-center.vue +++ b/pagesB/message-center/message-center.vue @@ -33,7 +33,7 @@ methods: { // 查询消息列表 getMessageList(){ - this.$requst.get('/universal/api.message/message_list').then(res=>{ + this.$requst.get('/universal/api.message/message_list',{page: 1,list_rows: 200}).then(res=>{ }) } diff --git a/pagesB/personal-information/personal-information.vue b/pagesB/personal-information/personal-information.vue index adcfd1d..91aa03a 100644 --- a/pagesB/personal-information/personal-information.vue +++ b/pagesB/personal-information/personal-information.vue @@ -106,27 +106,22 @@ }, methods: { // 获取个人信息 - getData(){ this.$requst.get('/universal/api.user/user_info').then(res => { - if (res.code == 1 && res.data.length != 1) { - console.log(res.data) - this.nickname=res.data.nickname - this.full_name=res.data.name - if(res.data.sex==0){ - this.genderNum=1 - }else{ - this.genderNum=res.data.sex - } - this.contact_number=res.data.phone - this.e_mail=res.data.email - this.id_card_no=res.data.idcard - - - } + if (res.code == 1 && res.data.length != 1) { + this.nickname=res.data.nickname + this.full_name=res.data.name + if(res.data.sex==0){ + this.genderNum=1 + }else{ + this.genderNum=res.data.sex + } + this.contact_number=res.data.phone + this.e_mail=res.data.email + this.id_card_no=res.data.idcard + } }) }, - // 提交保存事件 sumbmitData(){ if(this.checkEmpty()){ @@ -199,27 +194,13 @@ count:1, sourceType:['album'], success: (res) => { - let tempImg = res.tempFilePaths; - this.imgList[index] = tempImg[0]; - let params = { - token: uni.getStorageSync('token'), - dir: 'images', - from:tempImg[0] - } - console.log(params,104); - uploadImg(params).then(res=>{ - console.log(res); + let tempImg = res.tempFilePaths[0]; + this.imgList[index] = tempImg; + uploadImg({path:tempImg}).then(res=>{ + if(res.code) { + this.$toolAll.tools.showToast('上传成功'); + } }) - // this.$requst.upload('file/upload/image',{file:tempImg[i]}).then(res=>{ - // if(this.imgArr.length!=9){ - // // this.imgArr.push(this.$http + res.data.src); - // } - // if(num==tempImg.length){ - // this.$toolAll.tools.showToast('上传成功(*^▽^*)') - // } else { - // this.$toolAll.tools.showToast('上传中...') - // } - // },error=>{}) } }) }, diff --git a/pagesB/plan-fault/plan-fault.vue b/pagesB/plan-fault/plan-fault.vue index 9e968d5..f5a6711 100644 --- a/pagesB/plan-fault/plan-fault.vue +++ b/pagesB/plan-fault/plan-fault.vue @@ -24,6 +24,7 @@ + @@ -42,12 +43,14 @@ size:10, page:1, total:0, + type_id:'',//解决方案类型id dataList:[] } }, onLoad(op) { this.ifPlanFault = `${['解决方案','常见故障'][op.index*1]}`; this.current = op.index*1; + if(op.type_id!=undefined) this.type_id = op.type_id; this.getPlanFault(); }, methods: { @@ -65,7 +68,7 @@ ]; let params = [ { - type_id:1, + type_id:this.type_id, list_rows:this.size, page:this.page }, diff --git a/pagesB/set-up/set-up.vue b/pagesB/set-up/set-up.vue index f339a3b..048d74a 100644 --- a/pagesB/set-up/set-up.vue +++ b/pagesB/set-up/set-up.vue @@ -116,7 +116,7 @@ // 设置 getSettings(){ this.$requst.post('/universal/api.settings/settings').then(res=>{ - if(res.code==1){ + if(res.code){ // uni.navigateBack({delta:1})