Commit 9e75ffde by chenwq

车架号复核

1 parent acefcac6
...@@ -46,7 +46,12 @@ Page({ ...@@ -46,7 +46,12 @@ Page({
dialogObj: {}, dialogObj: {},
scrollTop: 0, scrollTop: 0,
cardSetting: true, cardSetting: true,
isAsk: false isAsk: false,
// vin二次确认弹窗
showVinDialog: false,
secFormData: {},
tempVin: '',
e: {}
}, },
getPickerObj(obj) { getPickerObj(obj) {
let data = [] let data = []
...@@ -325,12 +330,38 @@ Page({ ...@@ -325,12 +330,38 @@ Page({
scrollTop: height // 滚动到的位置(距离顶部 px) scrollTop: height // 滚动到的位置(距离顶部 px)
}) })
}, },
handleSecondConfirm(e) { secondChange() {
let { serviceInfo, conSecondObj, isAsk } = this.data let { showVinDialog } = this.data
if (isAsk) { this.setData({
return true showVinDialog: !showVinDialog
})
},
handleSecClose() {
let { tempVin } = this.data
this.setData({
secFormData: {
carVin: ''
},
isAsk: false
})
if (tempVin) {
this.setData({
['serviceInfo.vin']: tempVin,
tempVin: ''
})
} }
if (e.detail?.type == 'confirm') { this.secondChange()
},
handleSecConfirm(e) {
let { detail } = e
this.setData({
['serviceInfo.vin']: detail.carVin,
tempVin: detail.carVin
})
this.api()
},
api() {
let { serviceInfo, conSecondObj, isAsk, e } = this.data
this.setData({ this.setData({
isAsk: true isAsk: true
}) })
...@@ -348,25 +379,43 @@ Page({ ...@@ -348,25 +379,43 @@ Page({
if (conSecondObj.vin == serviceInfo.vin) { if (conSecondObj.vin == serviceInfo.vin) {
this.confirm(e) this.confirm(e)
this.setData({ this.setData({
['conSecondObj.vin']: '' ['conSecondObj.vin']: '',
e: {}
}) })
} else { } else {
this.setData({ this.setData({
['conSecondObj.vin']: serviceInfo.vin, ['conSecondObj.vin']: serviceInfo.vin,
dialogObj: JSON.parse(JSON.stringify(errorObj)), dialogObj: JSON.parse(JSON.stringify(errorObj)),
['dialogObj.tipTxt']: res.message, ['dialogObj.tipTxt']: res.message,
isDialogShow: true isDialogShow: true,
e: {}
}) })
} }
} else { } else {
this.setData({ this.setData({
dialogObj: JSON.parse(JSON.stringify(errorObj)), dialogObj: JSON.parse(JSON.stringify(errorObj)),
['dialogObj.tipTxt']: res.message, ['dialogObj.tipTxt']: res.message,
isDialogShow: true isDialogShow: true,
e: {}
}) })
wx.$util.showToast(res.message || '接口异常') wx.$util.showToast(res.message || '接口异常')
} }
}) })
},
handleSecondConfirm(e) {
console.log(e)
let { serviceInfo, conSecondObj, isAsk } = this.data
if (isAsk) {
return true
}
if (e.detail?.type == 'confirm') {
this.setData({
secFormData: {
carVin: serviceInfo.vin
},
e: e
})
this.secondChange()
} else { } else {
this.confirm(e) this.confirm(e)
} }
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
"usingComponents": { "usingComponents": {
"first-step": "../components/FirstStep/FirstStep", "first-step": "../components/FirstStep/FirstStep",
"second-step": "../components/SecondStep/SecondStep", "second-step": "../components/SecondStep/SecondStep",
"shade-tip": "../components/ShadeTip/ShadeTip" "shade-tip": "../components/ShadeTip/ShadeTip",
"vin-sec-dialog": "../../carQuotation/components/VinSecDialog/VinSecDialog"
} }
} }
...@@ -4,3 +4,5 @@ ...@@ -4,3 +4,5 @@
<second-step wx:if="{{step == 'second'}}" cardSetting="{{cardSetting}}" id="SecondStep" serviceInfo="{{serviceInfo}}" dataAttrName="{{dataAttrName}}" bindvaliderror="handleErrorJump" bindconfirm="handleSecondConfirm" binddraft="handleSecondConfirm"></second-step> <second-step wx:if="{{step == 'second'}}" cardSetting="{{cardSetting}}" id="SecondStep" serviceInfo="{{serviceInfo}}" dataAttrName="{{dataAttrName}}" bindvaliderror="handleErrorJump" bindconfirm="handleSecondConfirm" binddraft="handleSecondConfirm"></second-step>
<shade-tip isShow="{{isDialogShow}}" type="{{dialogObj.type}}" title="{{dialogObj.title}}" tipTxt="{{dialogObj.tipTxt}}" btnTxt="{{dialogObj.btnTxt}}" bindclick="handleTipClick" bindclose="handleTipClose" data-type="{{dialogObj.type}}"></shade-tip> <shade-tip isShow="{{isDialogShow}}" type="{{dialogObj.type}}" title="{{dialogObj.title}}" tipTxt="{{dialogObj.tipTxt}}" btnTxt="{{dialogObj.btnTxt}}" bindclick="handleTipClick" bindclose="handleTipClose" data-type="{{dialogObj.type}}"></shade-tip>
</view> </view>
<!-- vin二次复核 -->
<vin-sec-dialog wx:if="{{showVinDialog}}" showVinDialog="{{showVinDialog}}" secFormData="{{secFormData}}" bindonClose="handleSecClose" bindonConfirm="handleSecConfirm"></vin-sec-dialog>
\ No newline at end of file \ No newline at end of file
// packageEquity/pages/carQuotation/components/VinSecDialog/VinSecDialog.js
Component({
/**
* 组件的属性列表
*/
properties: {
showVinDialog: Boolean,
secFormData: Object
},
/**
* 组件的初始数据
*/
data: {
vinFormat: '',
formData: {
carVin: ''
},
disable: true,
that: this,
beforeClose: null,
// (action, done) => {
// console.log('?????')
// if (action === "confirm") {
// let { carVin } = this.data.formData
// if (!carVin) {
// wx.$util.showToast('车架号不能为空')
// return done(false)
// }
// if (!/^[a-zA-Z0-9]{17}$/.test(carVin)) {
// wx.$util.showToast('车架号请输入17位数字和字母')
// return done(false)
// }
// done(true)
// }
// }
},
lifetimes: {
attached() {
let { carVin } = this.data.secFormData
this.setData({
'formData.carVin': carVin || '',
vinFormat: carVin.replace(/(.{4})/g, "$1 ")
})
}
},
/**
* 组件的方法列表
*/
methods: {
handleInput(e) {
let inputValue = e.detail
this.setData({
'formData.carVin': inputValue
})
},
changeVal(e) {
let { attr, val } = e.target.dataset
this.setData({
[attr]: false
})
},
dialogClost(type) {
this.setData({
beforeClose: (action) =>
new Promise((resolve) => {
if (action === 'confirm') {
// 点击确定,根据传入的状态判断是否取消
resolve(type)
} else if (action === 'cancel') {
// 取消则直接关闭
resolve(true)
}
}),
})
},
onClose() {
this.triggerEvent('onClose')
},
onConfirm(e) {
let { carVin } = this.data.formData
if (!carVin) {
wx.$util.showToast('车架号不能为空')
return this.dialogClost(false) // 表单校验不通过
}
if (!(/^[a-zA-Z0-9]{17}$/.test(carVin))) {
wx.$util.showToast('车架号请输入17位数字和字母')
return this.dialogClost(false) // 表单校验不通过
}
this.triggerEvent('onConfirm', { carVin: carVin })
this.dialogClost(true) // 表单校验通过
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/carQuotation/components/VinSecDialog/VinSecDialog.wxss */
.dialog-class {
font-size: var(--fontSize28);
font-weight: 400;
}
.title_text {
font-family: PingFangSC-Medium;
color: #222222;
font-size: var(--fontSize32);
font-weight: 600;
text-align: center;
}
.message-box {
font-size: var(--fontSize28);
color: #000000a6;
padding: 40rpx 40rpx 50rpx;
}
.label {
padding: 32rpx 0 8rpx;
}
.vin-row {
display: flex;
align-items: center;
}
.vin-txt {
background: #F4F5F7;
border: 2rpx solid #EFF0F2;
border-radius: 12rpx;
font-size: var(--fontSize28);
color: #999999;
flex: 1;
padding: 30rpx 24rpx;
}
.vin-input {
font-size: var(--fontSize28);
padding: 24rpx 24rpx !important;
border: 2rpx solid #EFF0F2;
border-radius: 12rpx;
}
.pictureIcon {
display: inline-block;
width: var(--fontSize36);
height: var(--fontSize36);
margin: 0 24rpx;
flex-shrink: 0;
}
\ No newline at end of file \ No newline at end of file
<!--packageEquity/pages/carQuotation/components/VinSecDialog/VinSecDialog.wxml-->
<van-dialog use-slot title="车架号复核" show="{{ showVinDialog }}" class="dialog-class" width="var(--fontSize622)" show-cancel-button confirmButtonText="确认提交" confirm-button-color="#3582EE" use-title-slot="{{ true }}" bind:confirm="onConfirm" bind:close="onClose" before-close="{{beforeClose}}">
<view slot="title">
<view class="title_text">车架号复核</view>
</view>
<view class="message-box">
<view>请核对车架号是否正确,如信息有误后期将无法申请补偿服务!</view>
<view class="label">车架号:</view>
<view class="vin-row">
<view style="flex: 1;">
<view class="vin-txt" wx:if="{{disable}}">{{vinFormat}}</view>
<van-field wx:else custom-class="vin-input" custom-style="width: 100%; font-size: var(--fontSize28); background: #F4F5F7;" value="{{formData.carVin}}" autosize hold-keyboard placeholder="请输入车架号" maxlength="17" data-attr="carVin" bindinput="handleInput" />
</view>
<image wx:if="{{disable}}" class="pictureIcon" src="/packageEquity/images/icon-edit.png" data-attr="disable" data-val="false" bindtap="changeVal" />
</view>
</view>
</van-dialog>
\ No newline at end of file \ No newline at end of file
...@@ -56,12 +56,48 @@ Page({ ...@@ -56,12 +56,48 @@ Page({
dataAttrName: 'owner', dataAttrName: 'owner',
step: 'first', step: 'first',
// step: 'second', // step: 'second',
needChangeList: ['price', 'base', 'threePremium', 'carInsidePremium', 'passengerPremium', 'payPrice'] needChangeList: ['price', 'base', 'threePremium', 'carInsidePremium', 'passengerPremium', 'payPrice'],
// vin二次确认弹窗
showVinDialog: false,
secFormData: {},
tempVin: ''
},
secondChange() {
let { showVinDialog } = this.data
this.setData({
showVinDialog: !showVinDialog
})
},
handleSecClose() {
let { tempVin } = this.data
this.setData({
secFormData: {
carVin: ''
},
})
if (tempVin) {
console.log(tempVin, 'tempVin----')
this.setData({
'owner.carVin': tempVin,
tempVin: ''
})
}
this.secondChange()
},
handleSecConfirm(e) {
let { detail } = e
this.setData({
['owner.carVin']: detail.carVin,
tempVin: detail.carVin
})
}, },
reWrite(type, data) { reWrite(type, data) {
console.log(type, data) console.log(type, data)
let { owner } = this.data let { owner } = this.data
if (type == 'vehicleCertificate') { if (type == 'vehicleCertificate') {
this.setData({
tempVin: this.data.owner.carVin
})
let { vinNo: carVin, seatingCapacity: seat, engineNo: engineNumber, carColor } = data let { vinNo: carVin, seatingCapacity: seat, engineNo: engineNumber, carColor } = data
owner = Object.assign(owner, { owner = Object.assign(owner, {
carVin, carVin,
...@@ -69,6 +105,15 @@ Page({ ...@@ -69,6 +105,15 @@ Page({
engineNumber, engineNumber,
carColor carColor
}) })
owner.carVin = ''
if (carVin) {
this.setData({
secFormData: {
carVin: carVin
}
})
this.secondChange(carVin)
}
} }
if (type == 'idCard') { if (type == 'idCard') {
// debugger // debugger
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
"navigationBarTitleText": "服务信息", "navigationBarTitleText": "服务信息",
"usingComponents": { "usingComponents": {
"first-step": "../components/FirstStep/FirstStep", "first-step": "../components/FirstStep/FirstStep",
"second-step": "../components/SecondStep/SecondStep" "second-step": "../components/SecondStep/SecondStep",
"vin-sec-dialog": "../components/VinSecDialog/VinSecDialog"
}, },
"navigationStyle": "custom" "navigationStyle": "custom"
} }
...@@ -17,3 +17,5 @@ ...@@ -17,3 +17,5 @@
<first-step wx:if="{{step == 'first'}}" id="FirstStep" serviceInfo="{{owner}}" dataAttrName="{{dataAttrName}}" orderInfo="{{orderInfo}}" bindconfirm="handleFirstConfirm" bindeditSave="handleEditSave" mode="{{0}}" /> <first-step wx:if="{{step == 'first'}}" id="FirstStep" serviceInfo="{{owner}}" dataAttrName="{{dataAttrName}}" orderInfo="{{orderInfo}}" bindconfirm="handleFirstConfirm" bindeditSave="handleEditSave" mode="{{0}}" />
<second-step wx:if="{{step == 'second'}}" id="SecondStep" orderInfo="{{orderInfo}}" quotationGoodsList="{{quotationGoodsList}}" bindconfirm="handleSecondConfirm" bindeditSave="handleEditSave" /> <second-step wx:if="{{step == 'second'}}" id="SecondStep" orderInfo="{{orderInfo}}" quotationGoodsList="{{quotationGoodsList}}" bindconfirm="handleSecondConfirm" bindeditSave="handleEditSave" />
</view> </view>
<!-- vin二次复核 -->
<vin-sec-dialog wx:if="{{showVinDialog}}" showVinDialog="{{showVinDialog}}" secFormData="{{secFormData}}" bindonClose="handleSecClose" bindonConfirm="handleSecConfirm"></vin-sec-dialog>
\ No newline at end of file \ No newline at end of file
...@@ -96,17 +96,52 @@ Page({ ...@@ -96,17 +96,52 @@ Page({
"quotedPriceUpdate", "quotedPriceUpdate",
"minEquityPrice", "minEquityPrice",
], ],
firstEnter: true firstEnter: true,
// vin二次确认弹窗
showVinDialog: false,
secFormData: {},
tempVin: ''
}, },
closeTips() { closeTips() {
this.setData({ this.setData({
showTips: false, showTips: false,
}); });
}, },
secondChange() {
let { showVinDialog } = this.data
this.setData({
showVinDialog: !showVinDialog
})
},
handleSecClose() {
let { tempVin } = this.data
this.setData({
secFormData: {
carVin: ''
},
})
if (tempVin) {
this.setData({
'owner.carVin': tempVin,
tempVin: ''
})
}
this.secondChange()
},
handleSecConfirm(e) {
let { detail } = e
this.setData({
['owner.carVin']: detail.carVin,
tempVin: detail.carVin
})
},
reWrite(type, data) { reWrite(type, data) {
console.log(type, data); console.log(type, data);
let { owner } = this.data; let { owner } = this.data;
if (type == "vehicleCertificate") { if (type == "vehicleCertificate") {
this.setData({
tempVin: this.data.owner.carVin
})
let { let {
vinNo: carVin, vinNo: carVin,
seatingCapacity: seat, seatingCapacity: seat,
...@@ -119,6 +154,15 @@ Page({ ...@@ -119,6 +154,15 @@ Page({
engineNumber, engineNumber,
carColor, carColor,
}); });
owner.carVin = ''
if (carVin) {
this.setData({
secFormData: {
carVin: carVin
}
})
this.secondChange(carVin)
}
} }
if (type == "idCard") { if (type == "idCard") {
let { let {
...@@ -318,6 +362,7 @@ Page({ ...@@ -318,6 +362,7 @@ Page({
orderInfo.paymentDocList = _tempMap orderInfo.paymentDocList = _tempMap
} }
// -------
wx.showLoading("报价中..."); wx.showLoading("报价中...");
let result = await this.handleSecondConfirmCheck(true); let result = await this.handleSecondConfirmCheck(true);
let { code, data: id, message } = result; let { code, data: id, message } = result;
......
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
"usingComponents": { "usingComponents": {
"first-step": "../components/FirstStep/FirstStep", "first-step": "../components/FirstStep/FirstStep",
"second-step": "../components/SecondStepSimple/SecondStep", "second-step": "../components/SecondStepSimple/SecondStep",
"order-popup": "../components/OrderPopup/OrderPopup" "order-popup": "../components/OrderPopup/OrderPopup",
"vin-sec-dialog": "../components/VinSecDialog/VinSecDialog"
}, },
"navigationStyle": "custom" "navigationStyle": "custom"
} }
...@@ -26,3 +26,5 @@ ...@@ -26,3 +26,5 @@
</view> --> </view> -->
</view> </view>
<order-popup orderType="{{orderInfo.payType }}" resetTransNo="{{orderInfo.transactionNo || orderInfo.outTradeNo}}" resetOrder="{{orderInfo.resetOrder}}" wx:if="{{showPopup}}" show="{{showPopup}}" /> <order-popup orderType="{{orderInfo.payType }}" resetTransNo="{{orderInfo.transactionNo || orderInfo.outTradeNo}}" resetOrder="{{orderInfo.resetOrder}}" wx:if="{{showPopup}}" show="{{showPopup}}" />
<!-- vin二次复核 -->
<vin-sec-dialog wx:if="{{showVinDialog}}" showVinDialog="{{showVinDialog}}" secFormData="{{secFormData}}" bindonClose="handleSecClose" bindonConfirm="handleSecConfirm"></vin-sec-dialog>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!