diff --git a/App.vue b/App.vue index f58eaf9..9b2f058 100644 --- a/App.vue +++ b/App.vue @@ -31,21 +31,7 @@ }, methods:{ - // uniapp设置消息提醒(调用手机系统静音或铃声) - openSettings() { - uni.getSystemInfo({ - success(res) { - if(res.platform == 'ios'){ - plus.runtime.openURL("app-settings://"); - } else if (res.platform == 'android'){ - var main = plus.android.runtimeMainActivity(); - var Intent = plus.android.importClass("android.content.Intent"); - var mIntent = new Intent('android.settings.SOUND_SETTINGS'); - main.startActivity(mIntent); - } - } - }); - }, + } }; diff --git a/pages/login/login.vue b/pages/login/login.vue index a23de15..63d76cf 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -62,13 +62,13 @@ return { windowHeight: uni.getSystemInfoSync().windowHeight, ifPhone:false, - login_phone:'',//登录手机号 + login_phone:'17366921088',//登录手机号 ifCode:false, login_code:'',//登录验证码 ifunitName:false, - login_unitName:'',//登录单位名称 + login_unitName:'1',//登录单位名称 ifPassword:false, - login_password:'',//登录密码 + login_password:'123456',//登录密码 codeText:'获取验证码' ,// 获取验证码按钮文字 flagCode:true ,// 允许点击获取验证码 countDown:null, diff --git a/pages/tabbar/my/my.vue b/pages/tabbar/my/my.vue index c69b9c2..c3f5f8a 100644 --- a/pages/tabbar/my/my.vue +++ b/pages/tabbar/my/my.vue @@ -248,7 +248,7 @@ '/pagesB/personal-information/personal-information', '/pagesB/electronic-certificate/electronic-certificate', '/pagesB/service-range/service-range', - '/pagesA/workOrder/workOrderLlsit?is_evaluate=1', + '/pagesA/workOrder/workOrderLlsit?status=待评价&statusId=9', '/pagesB/my-account/my-account?index=0', '/pagesB/set-up/set-up', ]; diff --git a/pages/tabbar/pagehome/pagehome.vue b/pages/tabbar/pagehome/pagehome.vue index ae2e255..a43cf66 100644 --- a/pages/tabbar/pagehome/pagehome.vue +++ b/pages/tabbar/pagehome/pagehome.vue @@ -426,11 +426,30 @@ // uni.showToast({ // title:'您有新消息!' // }) - this.bofang(msg); + // this.bofang(msg); + this.openSettings(); } }); } }, + // uniapp设置消息提醒(调用手机系统静音或铃声) + openSettings() { + // #ifdef APP-PLUS + uni.getSystemInfo({ + success(res) { + if(res.platform == 'ios'){ + plus.runtime.openURL("app-settings://"); + } else if (res.platform == 'android'){ + var main = plus.android.runtimeMainActivity(); + var Intent = plus.android.importClass("android.content.Intent"); + var mIntent = new Intent('android.settings.SOUND_SETTINGS'); + main.startActivity(mIntent); + } + } + }); + // #endif + }, + // 播放音乐 bofang(msg){ this.bgmMusic.autoplay = true;//自动播放 // this.bgmMusic.loop = true;//循环播放 diff --git a/pagesA/workOrder/details.vue b/pagesA/workOrder/details.vue index c2b9f8b..18ff668 100644 --- a/pagesA/workOrder/details.vue +++ b/pagesA/workOrder/details.vue @@ -294,12 +294,12 @@ if (op.orderId != undefined) { this.orderId = op.orderId; // 调取获取工单详情事件 - this.getDetail(1); + this.getDetail(1,op.statusText,op.statusColor); } }, methods: { // 获取工单详情事件 - getDetail(type) { + getDetail(type,text,color) { let params = { order_id: this.orderId, type:type @@ -307,8 +307,8 @@ this.$requst.get('/universal/api.order/order_info', params).then(res => { console.log(res.data,'工单详情') if (res.code) { - this.statusText = res.data.btn.attributes.text; - this.statusColor = res.data.btn.attributes.color; + this.statusText = res.data.btn?res.data.btn.attributes.text:text; + this.statusColor = res.data.btn?res.data.btn.attributes.color:color; switch (type) { case 1: this.detailObj = res.data; @@ -371,7 +371,7 @@ // 工单详情切换事件 detailSwitch(index) { let type = [1, 2, 3, 4][index]; - this.getDetail(type); + this.getDetail(type,this.statusText,this.statusColor); }, // 前往评价页面 goEvaluate() { diff --git a/pagesA/workOrder/payReturnVisit.vue b/pagesA/workOrder/payReturnVisit.vue index 9f855dc..96fec0d 100644 --- a/pagesA/workOrder/payReturnVisit.vue +++ b/pagesA/workOrder/payReturnVisit.vue @@ -13,13 +13,13 @@ - + 联系电话 - + @@ -27,7 +27,7 @@ - + @@ -77,14 +77,36 @@ custmerphone:'400-765-9876',//客服电话 custmertime:'',//回访时间 workId:'',//工单id - flag:true + flag:true, + visitTypeList:[] } }, onLoad(op) { - if(op.id) {this.workId = op.id} + this.getVisitType(); + if(op.order_id) {this.workId = op.order_id} + this.getVisitInfo(this.workId); this.custmertime = this.$toolAll.tools.returnCurrentTime('/',1); }, methods: { + // 获取回访方式 + getVisitType(){ + this.$requst.get('/universal/api.order/visit_type').then(res=>{ + if(res.code) { + this.visitTypeList = res.data; + } + }) + }, + // 获取回访信息 + getVisitInfo(id){ + this.$requst.get('/universal/api.order/visit',{order_id:id}).then(res=>{ + if(res.code) { + this.name = res.data.order_contact; + this.phone = res.data.order_contact_phone; + this.wxcode = res.data.order_contact_wechat; + this.custmerphone = res.data.consumer_hotline; + } + }) + }, // 工单回访提交事件 setVisit() { if(this.checkEmpty() && this.flag) { @@ -94,32 +116,30 @@ mask:true }) let parmas = { - id:this.workId, - a:this.name, - b:this.phone, - c:this.wxcode, - d:this.custmerphone, - e:this.custmertime, - f:this.content + order_id:this.workId, + return_visit:this.content, + type_id:this.visitTypeList[0].type_id } - this.$request.post('',parmas).then(res=>{ + this.$requst.post('/universal/api.order/visit',parmas).then(res=>{ if(res.code) { - // 接口调用成功,自动返回上一级 - this.$toolAll.tools.automaticBack(); + this.$toolAll.tools.showToast('回访成功'); + setTimeout(()=>{ + // 接口调用成功,自动返回上一级 + this.$toolAll.tools.automaticBack(); + },1000) + } else { + this.$toolAll.tools.showToast(res.msg); } - uni.hideLoading(); - this.flag = true; }) + setTimeout(()=>{ + this.flag = true; + },2000) } }, // 判空 checkEmpty() { let result = false; - if(!this.name) { - this.$toolAll.tools.showToast('请填写联系人称呼'); - } else if(this.$toolAll.tools.isPhone(this.phone)) { - this.$toolAll.tools.showToast('请正确填写手机号码'); - } else if(!this.content) { + if(!this.content) { this.$toolAll.tools.showToast('请输入回访内容'); } else { result = true; diff --git a/pagesA/workOrder/workOrderLlsit.vue b/pagesA/workOrder/workOrderLlsit.vue index 769adcc..c17587c 100644 --- a/pagesA/workOrder/workOrderLlsit.vue +++ b/pagesA/workOrder/workOrderLlsit.vue @@ -32,14 +32,15 @@ - + 工单编号:{{item.order_number}} {{item.project_name}} - {{item.btn.attributes.text}} + {{item.btn.attributes.text}} + {{item.order_status_view}} @@ -61,7 +62,7 @@ - + 催一催 @@ -211,30 +212,32 @@ }, // 查看工单详情和进入接单页面 projectDetailsFun(status,id,statusText,statusColor) { - if (uni.getStorageSync('type_id')==4 && status == 2) { - // 工程师点击待接单工单 - uni.showModal({ - cancelText:'取消', - cancelColor:'#999999', - confirmColor:'#03affb', - confirmText:'确认', - content:'确认接单', - success: (res) => { - if(res.confirm){ - this.$requst.post('/universal/api.order/accept_order',{order_id:id,is_order:1}).then(res=>{ - if(res.code){ - this.$toolAll.tools.showToast('接单成功'); - setTimeout(()=>{ - uni.navigateTo({ - url: `/pagesA/workOrder/workOrder?id=${id}` - }) - },1000) - } - }) + if (uni.getStorageSync('type_id')==4) { + // 工程师 + if(status == 2) { + // 待接单 + uni.showModal({ + cancelText:'取消', + cancelColor:'#999999', + confirmColor:'#03affb', + confirmText:'确认', + content:'确认接单', + success: (res) => { + if(res.confirm){ + this.$requst.post('/universal/api.order/accept_order',{order_id:id,is_order:1}).then(res=>{ + if(res.code){ + this.$toolAll.tools.showToast('接单成功'); + setTimeout(()=>{ + uni.navigateTo({ + url: `/pagesA/workOrder/workOrder?id=${id}` + }) + },1000) + } + }) + } } - } - }) - }else if(uni.getStorageSync('type_id')==4) { + }) + } if(status==3){ // 待维修 uni.navigateTo({ @@ -248,8 +251,9 @@ }) } } else if(uni.getStorageSync('type_id')==5){ + // 财务 if(status==6){ - // 财务点击审核工单 + // 审核工单 uni.navigateTo({ url: `/pagesA/workOrder/workOrderAudit?orderId=${id}&status=${status}&statusText=${statusText}&statusColor=${statusColor}` }) @@ -260,18 +264,26 @@ }) } } else if(uni.getStorageSync('type_id')==3){ + // 客服 if(status==1){ - // 客服点击待指派工单 + // 待指派工单 uni.navigateTo({ url: `/pagesA/peopleManagement/peopleManagement?orderId=${id}` }) } if(status==8){ - // 客服点击待指派工单 + // 工单回访 uni.navigateTo({ url: `/pagesA/workOrder/payReturnVisit?order_id=${id}` }) } + } else if(uni.getStorageSync('type_id')==1 || uni.getStorageSync('type_id')==2){ + // 客户、业务员待评价 + if(status == 9){ + uni.navigateTo({ + url: `/pagesB/i-want-evaluate/i-want-evaluate?orderId=${id}` + }) + } } else { // 客户、客服、业务员、工程师点击查看详情 uni.navigateTo({ diff --git a/pagesB/set-up/set-up.vue b/pagesB/set-up/set-up.vue index e7e6da1..a7e0c4b 100644 --- a/pagesB/set-up/set-up.vue +++ b/pagesB/set-up/set-up.vue @@ -140,8 +140,6 @@ this.agreementArr.push(obj) } } - console.log(this.agreementArr,77777); - // uni.navigateBack({delta:1}) } }) },