From 33d5d98002a254b2b3e064bc6b968e26ea1d12fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E5=8F=B6?= Date: Tue, 30 Nov 2021 13:37:19 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=BC=80=E7=A5=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commons/css/base/imgSize.wxss | 3 +- pages/order/detail/index.js | 163 ++++++++++++++++++++++------------ pages/order/detail/index.wxml | 11 ++- 3 files changed, 118 insertions(+), 59 deletions(-) diff --git a/commons/css/base/imgSize.wxss b/commons/css/base/imgSize.wxss index 2142116..7813606 100644 --- a/commons/css/base/imgSize.wxss +++ b/commons/css/base/imgSize.wxss @@ -24,4 +24,5 @@ .img-h-200{height:200rpx;box-sizing:border-box;} .img-w-260{width:260rpx;box-sizing:border-box;} -.img-w-280{width:280rpx;box-sizing:border-box;} \ No newline at end of file +.img-w-280{width:280rpx;box-sizing:border-box;} +.img-h-400{height:400rpx;box-sizing:border-box;} \ No newline at end of file diff --git a/pages/order/detail/index.js b/pages/order/detail/index.js index c3289f4..0e5c67c 100644 --- a/pages/order/detail/index.js +++ b/pages/order/detail/index.js @@ -22,6 +22,7 @@ Page({ submitFlag:false, frontUrl:{}, backUrl:{}, + businessUrl:{}, isShowCode:false, isShowOrderCode:false, caridErr:[ @@ -31,6 +32,12 @@ Page({ { caridB:true, }, + + ], + businessErr:[ + { + business_licence:true, + }, ], isChangePayway:false,//合同付款方式是否修改 remark:'',//补充说明 @@ -481,6 +488,12 @@ Page({ 'caridErr[1].caridB':true, }) } + if(e.currentTarget.dataset.face == 'business'){ + that.setData({ + businessUrl:resp.data.data, + 'businessErr[0].business_licence':true, + }) + } } }, @@ -501,86 +514,122 @@ Page({ //创建申请开票信息 postAppIdcard(){ let that = this - if (!that.data.frontUrl.url || !that.data.caridErr[0].caridA){ - wx.showToast({ - title: '请上传身份证正面照', - icon: 'none' - }) - }else if(!that.data.backUrl.url || !that.data.caridErr[1].caridB){ - wx.showToast({ - title: '请上传身份证背面照', - icon: 'none' - }) - }else{ - that.setData({ - submitFlag: true, - }) - let params = {}; - params['oid'] = that.data.id; + let params = {}; + params['oid'] = that.data.id; + if(that.data.info.main_type == 0){ + if (!that.data.frontUrl.url || !that.data.caridErr[0].caridA){ + wx.showToast({ + title: '请上传身份证正面照', + icon: 'none' + }) + return + }else if(!that.data.backUrl.url || !that.data.caridErr[1].caridB){ + wx.showToast({ + title: '请上传身份证背面照', + icon: 'none' + }) + return + } params['cardidA'] = that.data.frontUrl.url; params['cardidB'] = that.data.backUrl.url; - _.apiQuery.postAppIdcard(params).then(res => { - this.setData({ - submitFlag: false, - }) - this.getAppCusorderDetails() - + } else if(that.data.info.main_type == 1){ + if (!that.data.businessUrl.url || !that.data.businessErr[0].business_licence){ wx.showToast({ - title: '已提交申请', - icon: 'success' + title: '请上传营业执照', + icon: 'none' }) + return + } + params['business_licence'] = that.data.businessUrl.url; + } + that.setData({ + submitFlag: true, + }) + _.apiQuery.postAppIdcard(params).then(res => { + this.setData({ + submitFlag: false, + }) + this.getAppCusorderDetails() - }).catch(res=>{ - if(res.code==418){ + wx.showToast({ + title: '已提交申请', + icon: 'success' + }) + + }).catch(res=>{ + if(res.code==418){ + if(this.data.info.main_type == 0){ this.setData({ caridErr:res.data, }) + }else if(this.data.info.main_type == 1){ + this.setData({ + businessErr:res.data, + }) } - this.setData({ - submitFlag: false, - }) - }); - } + } + this.setData({ + submitFlag: false, + }) + }); }, //修改申请开票信息 putAppIdcard() { let that = this - if (!that.data.frontUrl.url&&!that.data.backUrl.url) { - wx.showToast({ - title: '请上传新照片', - icon: 'none' - }) - }else{ - that.setData({ - submitFlag: true, - }) - let params = {}; - params['id'] = that.data.info.bill_data.id; + let params = {}; + params['id'] = that.data.info.bill_data.id; + if(that.data.info.main_type == 0){ + if (!that.data.frontUrl.url&&!that.data.backUrl.url) { + wx.showToast({ + title: '请上传新照片', + icon: 'none' + }) + return + } params['cardidA'] = that.data.frontUrl.url || that.data.info.bill_data.carid_a_path; params['cardidB'] = that.data.backUrl.url || that.data.info.bill_data.carid_b_path; - _.apiQuery.putAppIdcard(params).then(res => { - this.setData({ - submitFlag: false, - }) - this.getAppCusorderDetails() - + } else if(that.data.info.main_type == 1){ + if (!that.data.businessUrl.url) { wx.showToast({ - title: '已提交修改', - icon: 'success' + title: '请上传新照片', + icon: 'none' }) + return + } + params['business_licence'] = that.data.businessUrl.url || that.data.info.bill_data.business_licence_path; + } - }).catch(res=>{ - if(res.code==418){ + that.setData({ + submitFlag: true, + }) + _.apiQuery.putAppIdcard(params).then(res => { + this.setData({ + submitFlag: false, + }) + this.getAppCusorderDetails() + + wx.showToast({ + title: '已提交修改', + icon: 'success' + }) + + }).catch(res=>{ + if(res.code==418){ + if(this.data.info.main_type == 0){ this.setData({ caridErr:res.data, }) + }else if(this.data.info.main_type == 1){ + this.setData({ + businessErr:res.data, + }) } - this.setData({ - submitFlag: false, - }) - }); - } + } + this.setData({ + submitFlag: false, + }) + }); }, //确认交付 diff --git a/pages/order/detail/index.wxml b/pages/order/detail/index.wxml index 10a36ab..7246649 100644 --- a/pages/order/detail/index.wxml +++ b/pages/order/detail/index.wxml @@ -134,7 +134,8 @@ 开票信息 - + + {{caridErr[0].errmsg}} @@ -148,6 +149,14 @@ + + + + {{businessErr[0].errmsg}} + + + +