diff --git a/commons/css/base/layout.wxss b/commons/css/base/layout.wxss index 1e43d83..af5725b 100644 --- a/commons/css/base/layout.wxss +++ b/commons/css/base/layout.wxss @@ -114,9 +114,10 @@ .line-height-20{line-height:2;} .rich-text-img{display:bolck;max-width:100% !important;height:auto !important;margin:40rpx 0 20rpx 0 !important;} -.height-100{height:100rpx;} -.height-190{height:190rpx;} -.height-240{height:240rpx;} +.height-100{height:100rpx;box-sizing:border-box;} +.height-120{height:120rpx;box-sizing:border-box;} +.height-190{height:190rpx;box-sizing:border-box;} +.height-240{height:240rpx;box-sizing:border-box;} .tabmenu{line-height:80rpx;} .tabmenu.active::before{display:block;position:absolute;bottom:0;left:50%;width:30rpx;height:4rpx;margin-left:-15rpx;content:"";background-color:#36afa2;} diff --git a/pages/order/register/index.js b/pages/order/register/index.js index ae17c98..b2a3d9a 100644 --- a/pages/order/register/index.js +++ b/pages/order/register/index.js @@ -2,6 +2,21 @@ import _ from '../../../commons/js/commons' const app = getApp() Page({ data: { + tab:[ + { + title:'客户信息', + step:1, + }, + { + title:'车辆信息', + step:2, + }, + { + title:'其他信息', + step:3, + }, + ], + step:1, name:'',//姓名 mobile:'',//手机号 address:'',//地址 @@ -13,7 +28,7 @@ Page({ color_id:'',//车型颜色id incolor_id:'',//内饰颜色id b_s_id:'',//备选车型id - finance_id:'',//金融产品id + finance_id:'',//金融机构id fin_nums_id:'',//金融分期期数id buy_time:'',//预计购车时间 brandIndex:-1,//车辆品牌索引 @@ -27,8 +42,8 @@ Page({ colorIndex:-1,//车型颜色索引 levelIndex:-1,//车型级别索引 interiorIndex:-1,//内饰颜色索引 - financeArray:[],//金融产品 - financeIndex:-1,//金融产品索引 + financeArray:[],//金融机构 + financeIndex:-1,//金融机构索引 financeNumsArray:[],//金融分期期数 financeNumsIndex:-1,//金融分期期数索引 priceinfo:'',//车辆价格 @@ -73,6 +88,164 @@ Page({ }, + //修改步骤 + optstep(e){ + this.setData({ + step:e.currentTarget.dataset.step, + }) + }, + + //下一步 + nextstep(){ + switch (this.data.step) { + case 1: + if (this.data.customerIndex == -1 ) { + wx.showToast({ + title: '请选择客户', + icon: 'none' + }) + }else if (this.data.name == '' ) { + wx.showToast({ + title: '请输入客户姓名', + icon: 'none' + }) + }else if (!/^1[3456789]\d{9}$/.test(this.data.mobile)){ + wx.showToast({ + title: '请输入客户手机号', + icon: 'none' + }) + }if(this.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(this.data.cardid)){ + wx.showToast({ + title: '请填写正确客户身份证', + icon: 'none' + }) + }else if (this.data.address == '' ) { + wx.showToast({ + title: '请输入客户地址', + icon: 'none' + }) + }else{ + this.setData({ + step:2, + }) + } + break; + case 2: + if(this.data.car_id == '' ){ + wx.showToast({ + title: '请选择车型车系', + icon: 'none' + }) + }else if(this.data.v_id == '' ){ + wx.showToast({ + title: '请选择车型级别', + icon: 'none' + }) + }else if(this.data.color_id == '' ){ + wx.showToast({ + title: '请选择车型颜色', + icon: 'none' + }) + }else if(this.data.incolor_id == '' ){ + wx.showToast({ + title: '请选择内饰颜色', + icon: 'none' + }) + }else{ + this.setData({ + step:3, + }) + } + break; + case 3: + if(this.data.paymentIndex == -1 ){ + wx.showToast({ + title: '请选择付款方式', + icon: 'none' + }) + } + else if(this.data.paymentIndex == 1 && this.data.finance_id == ''){ + wx.showToast({ + title: '请选择金融机构', + icon: 'none' + }) + } + else if(this.data.paymentIndex == 1 && this.data.finance_id != ''&& this.data.fin_nums_id == ''){ + wx.showToast({ + title: '请选择分期期数', + icon: 'none' + }) + } + else if(this.data.packIndex == -1 ){ + wx.showToast({ + title: '请选择代办包', + icon: 'none' + }) + } + // else if(this.data.mainIndex == -1 ){ + // wx.showToast({ + // title: '请选择购车主体', + // icon: 'none' + // }) + // } + else if(this.data.entrustIndex == -1 ){ + wx.showToast({ + title: '请选择是否委托', + icon: 'none' + }) + } + else if(this.data.delry_time == ''){ + wx.showToast({ + title: '请输入期望交付时间', + icon: 'none' + }) + } + else if(this.data.entrustIndex == 0 && this.data.entrust_name == ''){ + wx.showToast({ + title: '请填写受托人姓名', + icon: 'none' + }) + }else if(this.data.entrustIndex == 0 && (this.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(this.data.entrust_idcard))){ + wx.showToast({ + title: '请填写正确受托人身份证', + icon: 'none' + }) + }else{ + + let that = this + that.setData({ + isPreview: true, + }) + wx.pageScrollTo({ + scrollTop: 0 + }) + + that.setData({ + isShowcheck:true, + checkCount:2, + checktext: 3 + '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) + + } + break; + + } + }, + //获取用户信息 getUserInfo(){ _.apiQuery.getUserInfo().then(res => { @@ -349,7 +522,7 @@ Page({ } }, - //获取金融产品列表 + //获取金融机构列表 changeFinance(e) { if(this.data.financeIndex != e.detail.value && e.detail.value >= 0){ let finance_id = '' @@ -364,7 +537,7 @@ Page({ } }, - //获取金融产品列表 + //获取金融机构列表 changeFinanceNums(e) { let fin_nums_id = '' if(e.detail.value >= 0){ @@ -415,7 +588,7 @@ Page({ }) }, - //获取金融产品列表 + //获取金融机构列表 getAppFinance(){ let params = {}; params['page'] = 1; @@ -470,137 +643,6 @@ Page({ } }, - //新建订单预览 - previewCusorder(){ - 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.paymentIndex == 1 && that.data.finance_id == ''){ - wx.showToast({ - title: '请选择金融产品', - icon: 'none' - }) - } - else if(that.data.paymentIndex == 1 && that.data.finance_id != ''&& that.data.fin_nums_id == ''){ - wx.showToast({ - title: '请选择分期期数', - icon: 'none' - }) - } - else if(that.data.packIndex == -1 ){ - wx.showToast({ - title: '请选择代办包', - icon: 'none' - }) - } - // 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.delry_time == ''){ - 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({ - isPreview: true, - }) - wx.pageScrollTo({ - scrollTop: 0 - }) - - that.setData({ - isShowcheck:true, - checkCount:2, - checktext: 3 + '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 diff --git a/pages/order/register/index.wxml b/pages/order/register/index.wxml index e58a381..08567c2 100644 --- a/pages/order/register/index.wxml +++ b/pages/order/register/index.wxml @@ -1,209 +1,224 @@ - - 用户信息 - 销售顾问:{{userInfo.uname}} - - - {{customer.length>0?'请选择客户':'暂无可选客户'}} - - {{customer[customerIndex].name}} - 手机号:{{customer[customerIndex].mobile}} - - - - - - 客户姓名 - - + + + + + {{item.title}} + - - 客户手机号码 - - - - - - - 客户身份证 - - - - - 客户地址 - - - - - 车辆信息 - - 车辆品牌 - - - 请选择 - {{brandArray[brandIndex]}} - - - - - - 车型车系 - - - 请选择 - {{modelArray[modelIndex]}} - - - - - - 车型级别 - - - 请选择 - {{levelArray[levelIndex]}} - - - - - - 车型颜色 - - - 请选择 - {{colorArray[colorIndex]}} - - - - - - 内饰颜色 - - - 请选择 - {{interiorArray[interiorIndex]}} - - - - - - 车辆合同售价 - - {{priceinfo.price}}元 - - - - 定金 - - {{priceinfo.deposit}}元 - - - - 付款方式 - - - 请选择 - {{payment[paymentIndex]}} - - - - - - 金融产品 - - - 请选择 - {{financeArray[financeIndex]}} - - - - - - 分期期数 - - - 请选择 - {{financeNumsArray[financeNumsIndex]}} - - - - - - 贷款金额 - - {{financeNumsList[financeNumsIndex].loan_money}}元 - - - - 月供 - - {{financeNumsList[financeNumsIndex].month_pay}}元 - - - - 代办包 - - - 请选择 - {{packArray[packIndex]}} - - - - - - - 是否委托 - - - 请选择 - {{entrust[entrustIndex]}} - - - - - - - 受托人姓名 - - - - - - 受托人身份证 - - - - - - - 期望交付时间 - - - 请选择 - {{delry_time}} - - + + + + {{customer.length>0?'请选择客户':'暂无可选客户'}} + + {{customer[customerIndex].name}} + 手机号:{{customer[customerIndex].mobile}} + + + + + + 客户姓名 + + + + + + 客户手机号码 + + + + + + 客户身份证 + + + + + + 客户地址 + + + + + + + + 车辆品牌 + + + 请选择 + {{brandArray[brandIndex]}} + + + + + + 车型车系 + + + 请选择 + {{modelArray[modelIndex]}} + + + + + + 车型级别 + + + 请选择 + {{levelArray[levelIndex]}} + + + + + + 车型颜色 + + + 请选择 + {{colorArray[colorIndex]}} + + + + + + 内饰颜色 + + + 请选择 + {{interiorArray[interiorIndex]}} + + + + + + 车辆合同售价 + + {{priceinfo.price}}元 + + + + 定金 + + {{priceinfo.deposit}}元 + + + + + + + 付款方式 + + + 请选择 + {{payment[paymentIndex]}} + + + + + + 金融机构 + + + 请选择 + {{financeArray[financeIndex]}} + + + + + + 分期期数 + + + 请选择 + {{financeNumsArray[financeNumsIndex]}} + + + + + + 贷款金额 + + {{financeNumsList[financeNumsIndex].loan_money}}元 + + + + 月供 + + {{financeNumsList[financeNumsIndex].month_pay}}元 + + + + 代办包 + + + 请选择 + {{packArray[packIndex]}} + + + + + + + 是否委托 + + + 请选择 + {{entrust[entrustIndex]}} + + + + + + + 受托人姓名 + + + + + + 受托人身份证 + + + + + + + + 期望交付时间 + + + 请选择 + {{delry_time}} + + + + + + - + - + 信息预览 @@ -264,7 +279,7 @@ {{payment[paymentIndex]}} - 金融产品 + 金融机构 {{financeArray[financeIndex]}} @@ -316,8 +331,9 @@ + - +