Commit 5e26af77 by 李伟康

增加key刷新页面

1 parent 04848d8a
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
<view <view
:class="['select', `${formData[i.key] ? '' : 'placeholder'}`]" :class="['select', `${formData[i.key] ? '' : 'placeholder'}`]"
@click="showPopup(i)" @click="showPopup(i)"
:key="selectKey"
> >
{{ formData[i.key] || i.placeholder }} {{ formData[i.key] || i.placeholder }}
<uni-icons <uni-icons
...@@ -216,7 +217,8 @@ export default { ...@@ -216,7 +217,8 @@ export default {
], ],
errorTip: false, errorTip: false,
receptionStatus: -1, receptionStatus: -1,
updateViewKey: Date.now() updateViewKey: Date.now(),
selectKey: Date.now(),
} }
}, },
computed: { computed: {
...@@ -325,11 +327,11 @@ export default { ...@@ -325,11 +327,11 @@ export default {
this.formData.carModelId = item.id this.formData.carModelId = item.id
} }
this.$store.dispatch("setCustomerInfo", this.formData); this.$store.dispatch("setCustomerInfo", this.formData);
this.selectKey = Date.now()
}, },
open () { open () {
this.$store.dispatch('getCustomerInfo').then((customerInfo) => { this.$store.dispatch('getCustomerInfo').then((customerInfo) => {
this.formData = customerInfo this.formData = customerInfo
this.updateViewKey = Date.now()
let { sceneType, customerType } = this, let { sceneType, customerType } = this,
step = Object.values(customerInfo).every((value) => !!value) ? 2 : 1 step = Object.values(customerInfo).every((value) => !!value) ? 2 : 1
this.errorTip = false this.errorTip = false
...@@ -347,6 +349,7 @@ export default { ...@@ -347,6 +349,7 @@ export default {
} }
this.step = step this.step = step
this.$refs.formRef.open() this.$refs.formRef.open()
this.updateViewKey = Date.now()
}) })
}, },
chooseResult (val) { chooseResult (val) {
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
<view <view
:class="['select', `${customerInfo[i.key]? '' : 'placeholder'}`]" :class="['select', `${customerInfo[i.key]? '' : 'placeholder'}`]"
@click="showPopup(i.popKey)" @click="showPopup(i.popKey)"
:key="selectKey"
> >
{{ customerInfo[i.key] || i.placeholder }} {{ customerInfo[i.key] || i.placeholder }}
<uni-icons <uni-icons
...@@ -293,7 +294,8 @@ export default { ...@@ -293,7 +294,8 @@ export default {
customerQr: '' customerQr: ''
}, },
isCheck: false, isCheck: false,
customerType: 1 customerType: 1,
selectKey:Date.now()
} }
}, },
mounted () { mounted () {
...@@ -382,6 +384,7 @@ export default { ...@@ -382,6 +384,7 @@ export default {
this.customerInfo.carModel = item.name; this.customerInfo.carModel = item.name;
} }
this.$store.dispatch("setCustomerInfo", this.customerInfo); this.$store.dispatch("setCustomerInfo", this.customerInfo);
this.selectKey = Date.now()
const { customerName, phoneNumber, staffName } = this.customerInfo const { customerName, phoneNumber, staffName } = this.customerInfo
this.isCheck = customerName && phoneNumber && staffName this.isCheck = customerName && phoneNumber && staffName
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!