From 2d809cdf6cd57a862c24281fcd3e3adfafabd026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E5=8F=B6?= Date: Tue, 31 Aug 2021 16:48:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A0=B8=E5=AF=B9=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/order/register/index.js | 212 ++++++++++++-------------------- pages/order/register/index.wxml | 17 ++- 2 files changed, 95 insertions(+), 134 deletions(-) diff --git a/pages/order/register/index.js b/pages/order/register/index.js index 752975d..2b0bcf8 100644 --- a/pages/order/register/index.js +++ b/pages/order/register/index.js @@ -47,6 +47,9 @@ Page({ entrust_idcard:'',//委托人身份证 isPreview:false,//是否预览 + isShowcheck:false,//是否显示预览核对弹框 + checkCount: 4, + checktext: '5s', }, //生命周期函数--监听页面加载 @@ -432,148 +435,90 @@ Page({ wx.pageScrollTo({ scrollTop: 0 }) + + that.setData({ + isShowcheck:true, + checkCount:4, + checktext: 5 + 's' + }) + let interval = setInterval(res => { + if (that.data.checkCount > 0) { + that.setData({ + checkCount: that.data.checkCount - 1, + checktext: that.data.checkCount + 's' + }) + } else { + clearInterval(interval) + that.setData({ + checkCount: 5, + checktext: '知道了' + }) + } + }, 1000) + } }, //新建订单 postAppCusorder() { let that = this - if (that.data.customerIndex == -1 ) { - wx.showToast({ - title: '请选择客户', - icon: 'none' - }) - }else if (that.data.name == '' ) { - wx.showToast({ - title: '请输入客户姓名', - icon: 'none' - }) - }else if (!/^1[3456789]\d{9}$/.test(that.data.mobile)){ - wx.showToast({ - title: '请输入客户手机号', - icon: 'none' - }) - }else if(that.data.cardid == ''|| !/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|[xX])$/.test(that.data.cardid)){ - wx.showToast({ - title: '请填写正确客户身份证', - icon: 'none' - }) - }else if (that.data.address == '' ) { - wx.showToast({ - title: '请输入客户地址', - icon: 'none' - }) - }else if(that.data.car_id == '' ){ - wx.showToast({ - title: '请选择车型车系', - icon: 'none' - }) - }else if(that.data.v_id == '' ){ - wx.showToast({ - title: '请选择车型级别', - icon: 'none' - }) - }else if(that.data.color_id == '' ){ - wx.showToast({ - title: '请选择车型颜色', - icon: 'none' - }) - }else if(that.data.incolor_id == '' ){ - wx.showToast({ - title: '请选择内饰颜色', - icon: 'none' - }) - }else if(that.data.paymentIndex == -1 ){ - wx.showToast({ - title: '请选择付款方式', - icon: 'none' - }) - }else if(that.data.packIndex == -1 ){ - wx.showToast({ - title: '请选择代办包', - icon: 'none' - }) + that.setData({ + submitFlag: true, + }) + let params = {}; + params['cus_id'] = that.data.customer[that.data.customerIndex].id; + params['name'] = that.data.name; + params['mobile'] = that.data.mobile; + params['cardid'] = that.data.cardid; + params['address'] = that.data.address; + params['car_id'] = that.data.car_id; + params['v_id'] = that.data.v_id; + params['color_id'] = that.data.color_id; + params['incolor_id'] = that.data.incolor_id; + params['price'] = that.data.priceinfo.price; + params['deposit'] = that.data.priceinfo.deposit; + params['payway'] = that.data.paymentIndex==0?'1':'0'; + params['pack_id'] = that.data.pack_id; + //params['main_type'] = that.data.mainIndex==0?'0':'1'; + params['ifentrust'] = that.data.entrustIndex==0?'1':'0'; + if(this.data.entrust_name != ''){ + params['entrust_name'] = this.data.entrust_name; } - // else if(that.data.mainIndex == -1 ){ - // wx.showToast({ - // title: '请选择购车主体', - // icon: 'none' - // }) - // } - else if(that.data.entrustIndex == -1 ){ - wx.showToast({ - title: '请选择是否委托', - icon: 'none' - }) - }else if(that.data.entrustIndex == 0 && that.data.entrust_name == ''){ - wx.showToast({ - title: '请填写委托人姓名', - icon: 'none' - }) - }else if(that.data.entrustIndex == 0 && (that.data.entrust_idcard == ''|| !/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|[xX])$/.test(that.data.entrust_idcard))){ - wx.showToast({ - title: '请填写正确委托人身份证', - icon: 'none' - }) - }else{ - that.setData({ - submitFlag: true, - }) - let params = {}; - params['cus_id'] = that.data.customer[that.data.customerIndex].id; - params['name'] = that.data.name; - params['mobile'] = that.data.mobile; - params['cardid'] = that.data.cardid; - params['address'] = that.data.address; - params['car_id'] = that.data.car_id; - params['v_id'] = that.data.v_id; - params['color_id'] = that.data.color_id; - params['incolor_id'] = that.data.incolor_id; - params['price'] = that.data.priceinfo.price; - params['deposit'] = that.data.priceinfo.deposit; - params['payway'] = that.data.paymentIndex==0?'1':'0'; - params['pack_id'] = that.data.pack_id; - //params['main_type'] = that.data.mainIndex==0?'0':'1'; - params['ifentrust'] = that.data.entrustIndex==0?'1':'0'; - if(this.data.entrust_name != ''){ - params['entrust_name'] = this.data.entrust_name; - } - if(this.data.entrust_idcard != ''){ - params['entrust_idcard'] = this.data.entrust_idcard; - } - _.apiQuery.postAppCusorder(params).then(res => { + if(this.data.entrust_idcard != ''){ + params['entrust_idcard'] = this.data.entrust_idcard; + } + _.apiQuery.postAppCusorder(params).then(res => { - //刷新列表页 - let pages = getCurrentPages(); - let prevPage = null; //上一个页面 - if (pages.length >= 2) { - prevPage = pages[pages.length - 2]; //上一个页面 - if(prevPage.route == 'pages/order/index'){ - prevPage.onPullDownRefresh() - } + //刷新列表页 + let pages = getCurrentPages(); + let prevPage = null; //上一个页面 + if (pages.length >= 2) { + prevPage = pages[pages.length - 2]; //上一个页面 + if(prevPage.route == 'pages/order/index'){ + prevPage.onPullDownRefresh() } + } - wx.showModal({ - title: '登记成功', - content: '', - confirmText: "查看详情", - confirmColor: "#36afa2", - showCancel:false, - success() { - wx.redirectTo({ - url: '/pages/order/detail/index?id=' + res.data.id - }) - } - }) - }).catch(res=>{ - that.setData({ - submitFlag: false, - }) - }); - } + wx.showModal({ + title: '登记成功', + content: '', + confirmText: "查看详情", + confirmColor: "#36afa2", + showCancel:false, + success() { + wx.redirectTo({ + url: '/pages/order/detail/index?id=' + res.data.id + }) + } + }) + }).catch(res=>{ + that.setData({ + submitFlag: false, + }) + }); }, - //输入 + //显示隐藏预览 optPreview(e) { this.setData({ isPreview:!this.data.isPreview, @@ -583,6 +528,13 @@ Page({ }) }, + //显示隐藏预览提示 + optShowcheck(){ + this.setData({ + isShowcheck:!this.data.isShowcheck, + }) + }, + //输入 inputTx(e) { this.setData({ diff --git a/pages/order/register/index.wxml b/pages/order/register/index.wxml index a99d5ee..a836ad7 100644 --- a/pages/order/register/index.wxml +++ b/pages/order/register/index.wxml @@ -1,5 +1,5 @@ - + 用户信息 销售顾问:{{userInfo.uname}} @@ -156,12 +156,12 @@ - + - + 信息预览 用户信息 @@ -243,7 +243,7 @@ - + @@ -270,4 +270,13 @@ 确定 + + + + + 请核对客户姓名,手机号,身份证,地址等信息是否填写正确! + + {{checktext}} + + \ No newline at end of file