Commit e79541c0 by 李伟康

commit

1 parent 73b006b0
...@@ -84,10 +84,10 @@ ...@@ -84,10 +84,10 @@
class="radio-name flex" class="radio-name flex"
@click="changeRadio(index)" @click="changeRadio(index)"
> >
<div :class="['radio',{'radio-active':i.active}]"></div> <div :class="['radio',{'radio-active':obj.receiveWay == i.value}]"></div>
{{i.name}} {{i.name}}
</div> </div>
<template v-if="i.active"> <template v-if="obj.receiveWay == i.value">
<div class="radio-input"> <div class="radio-input">
<van-field <van-field
v-model="obj[i.key]" v-model="obj[i.key]"
...@@ -143,8 +143,8 @@ export default { ...@@ -143,8 +143,8 @@ export default {
couponList: [] couponList: []
}, },
radioObj: [ radioObj: [
{ name: '指定手机号', type: 'tel', placeholder: '客户需输入指定的手机号,才能成功领取礼包', maxlength: 11, active: true, key: 'phone' }, { name: '指定手机号', type: 'tel', placeholder: '客户需输入指定的手机号,才能成功领取礼包', maxlength: 11, active: true, key: 'phone', value: 1 },
{ name: '指定车架号后6位', placeholder: '客户需输入指定的车架号,才能成功领取礼包', maxlength: 6, key: 'vin' }, { name: '指定车架号后6位', placeholder: '客户需输入指定的车架号,才能成功领取礼包', maxlength: 6, key: 'vin', value: 2 },
], ],
total: 0, total: 0,
id: '', id: '',
...@@ -172,15 +172,9 @@ export default { ...@@ -172,15 +172,9 @@ export default {
res.couponList.length && res.couponList.map(e => total += e.couponAnticipatedCost * e.couponAmount) res.couponList.length && res.couponList.map(e => total += e.couponAnticipatedCost * e.couponAmount)
this.flag = true this.flag = true
radioObj.map(e => e.active = false) radioObj.map(e => e.active = false)
if (res.receiveWay == 1) { if (res.receiveWay == 1) res.phone = res.receiveDetails
res.phone = res.receiveDetails else res.vin = res.receiveDetails
radioObj[0].active = true
} else {
radioObj[1].active = true
res.vin = res.receiveDetails
}
this.obj = res this.obj = res
console.log(res)
this.total = total this.total = total
this.checkData() this.checkData()
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!