From 8a33d55ba5136e9268f080332fc9dc8cb33e444b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E5=8F=B6?= Date: Thu, 11 Nov 2021 15:04:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A1=AE=E5=AE=9A=E9=9A=8F=E8=BD=A6=E7=89=A9?= =?UTF-8?q?=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commons/js/config.js | 2 + commons/js/utils/apiQuery.js | 7 ++ pages/order/detail/index.js | 169 ++++++++++++++++++++++++++++------ pages/order/detail/index.wxml | 61 +++++++++++- pages/order/detail/index.wxss | 20 +++- pages/order/edit/index.wxml | 2 +- pages/order/edit/index.wxss | 20 +++- 7 files changed, 249 insertions(+), 32 deletions(-) diff --git a/commons/js/config.js b/commons/js/config.js index e17e090..f4e2e9c 100644 --- a/commons/js/config.js +++ b/commons/js/config.js @@ -87,6 +87,8 @@ api = { materialHomeBiz:'material/home/biz', //店铺海报 materialHomePosters:'material/home/posters', //保存店铺海报 + appDelivery:'app/delivery', //获取车辆确定随车资料 + } //远程图片存储地址 diff --git a/commons/js/utils/apiQuery.js b/commons/js/utils/apiQuery.js index 1852952..d554ca0 100644 --- a/commons/js/utils/apiQuery.js +++ b/commons/js/utils/apiQuery.js @@ -558,4 +558,11 @@ apiQuery.putMaterialHomePosters = function (params) { }) } +//获取车辆确定随车资料 +apiQuery.getAppDelivery = function (params) { + return new Promise(function (resolve, reject) { + HttpRequest(false, Config.api.appDelivery, 2, params, "GET", resolve, reject) + }) +} + export default apiQuery; \ No newline at end of file diff --git a/pages/order/detail/index.js b/pages/order/detail/index.js index ea322c7..0c23772 100644 --- a/pages/order/detail/index.js +++ b/pages/order/detail/index.js @@ -33,6 +33,11 @@ Page({ }, ], isChangePayway:false,//合同付款方式是否修改 + remark:'',//补充说明 + carInfoList:[],//随车资料选项 + ckcarInfo:[],//随车资料选中内容 + carToolList:[],//随车随车工具选项 + ckcarTool:[],//随车工具选中内容 }, onLoad: function (options) { for (let key in options) { @@ -67,6 +72,9 @@ Page({ info:res.data, payway:res.data.payway, pack_id:res.data.pack_id, + remark:res.data.ckcar_data.remark,//补充说明 + ckcarInfo:res.data.ckcar_data.info,//随车资料选中内容 + ckcarTool:res.data.ckcar_data.tool,//随车工具选中内容 }) this.getAppLoan() @@ -74,11 +82,62 @@ Page({ this.getAppServicesPackage() } + if(res.data.ckcar_status==1){ + this.getAppDelivery() + } + wx.stopPullDownRefresh() }) }, + //获取车辆确定随车资料 + getAppDelivery(){ + _.apiQuery.getAppDelivery().then(res=>{ + + let delivery = res.data + let carInfoList = [] + let ckcar_data = this.data.info.ckcar_data + delivery.info.forEach(item => { + carInfoList.push({ + title:item, + checked:false, + }) + }) + if(ckcar_data.info.length>0){ + carInfoList.forEach(item1 => { + ckcar_data.info.forEach(item2 => { + if(item1.title == item2){ + item1.checked = true + } + }) + }) + } + let carToolList = [] + delivery.tool.forEach(item => { + carToolList.push({ + title:item, + checked:false, + }) + }) + if(ckcar_data.tool.length>0){ + carToolList.forEach(item1 => { + ckcar_data.tool.forEach(item2 => { + if(item1.title == item2){ + item1.checked = true + } + }) + }) + } + + this.setData({ + carInfoList, + carToolList, + }) + + }) + }, + //获取贷款产品信息 getAppLoan(){ let params = {}; @@ -525,36 +584,54 @@ Page({ //确认交付 putAppCusorderCkcar(){ - let that = this - wx.showModal({ - title:'确认交付?', - content:'', - success: function (res) { - if (res.confirm) { - that.setData({ - submitFlag: true, - }) - let params = {}; - params['id'] = that.data.id; - _.apiQuery.putAppCusorderCkcar(params).then(res => { + + if(this.data.ckcarInfo.length == 0){ + wx.showToast({ + title: '请选择随车资料', + icon: 'none' + }) + } + else if(this.data.ckcarTool.length == 0){ + wx.showToast({ + title: '请选择随车工具', + icon: 'none' + }) + } + else{ + let that = this + wx.showModal({ + title:'确认随车物品?', + content:'', + success: function (res) { + if (res.confirm) { that.setData({ - submitFlag: false, + submitFlag: true, }) - that.getAppCusorderDetails() - - wx.showToast({ - title: '交付成功', - icon: 'success' - }) - - }).catch(res=>{ - that.setData({ - submitFlag: false, - }) - }); + let params = {}; + params['id'] = that.data.id; + params['info'] = that.data.ckcarInfo; + params['tool'] = that.data.ckcarTool; + params['remark'] = that.data.remark; + _.apiQuery.putAppCusorderCkcar(params).then(res => { + that.setData({ + submitFlag: false, + }) + that.getAppCusorderDetails() + + wx.showToast({ + title: '交付成功', + icon: 'success' + }) + + }).catch(res=>{ + that.setData({ + submitFlag: false, + }) + }); + } } - } - }) + }) + } }, //客服微信码 @@ -598,6 +675,44 @@ Page({ } }, + //随车资料 + changeMaterial(e) { + let carInfoList = this.data.carInfoList + let values = e.detail.value + carInfoList.forEach(item1 => { + item1.checked = false + values.forEach(item2 => { + if(item1.title == item2){ + item1.checked = true + } + }) + }) + + this.setData({ + ckcarInfo:e.detail.value, + carInfoList, + }) + }, + + //随车工具 + changeTool(e) { + let carToolList = this.data.carToolList + let values = e.detail.value + carToolList.forEach(item1 => { + item1.checked = false + values.forEach(item2 => { + if(item1.title == item2){ + item1.checked = true + } + }) + }) + + this.setData({ + ckcarTool:e.detail.value, + carToolList, + }) + }, + //页面相关事件处理函数--监听用户下拉动作 onPullDownRefresh(){ this.getAppCusorderDetails() diff --git a/pages/order/detail/index.wxml b/pages/order/detail/index.wxml index dbafd5d..2937741 100644 --- a/pages/order/detail/index.wxml +++ b/pages/order/detail/index.wxml @@ -30,7 +30,7 @@ {{value}}{{key == '车辆合同售价' || key == '定金'?'元':'' }} - 已缴意向金{{info.inten_money}} + 已缴意向金{{info.inten_money}} + + + 随车资料 + + + + + + + + + + 随车工具 + + + + + + + + + + 补充说明 +