Commit b66f6d14 by 胡悦

fix(CreateOrder): 使用$set确保响应式更新并初始化用户数据

修复对象属性更新不使用响应式方法的问题,确保视图同步更新
初始化时从storage获取用户信息和配置数据
1 parent 6ba572f6
...@@ -157,6 +157,8 @@ export default { ...@@ -157,6 +157,8 @@ export default {
console.log(this.orderObj, 'orderObj') console.log(this.orderObj, 'orderObj')
handleTransactionData(newVal) handleTransactionData(newVal)
} else { } else {
this.userInfo = uni.$storage.get('userInfo') || {}
this.baseConfigData = uni.$storage.get('mock_data') || {}
this.orderCreateType = 'createWithPay' this.orderCreateType = 'createWithPay'
this.orderObj = { this.orderObj = {
customer: {}, customer: {},
...@@ -314,7 +316,7 @@ export default { ...@@ -314,7 +316,7 @@ export default {
// 单选框change事件 // 单选框change事件
radioChange(e, val) { radioChange(e, val) {
console.log(e, val) console.log(e, val)
this.orderObj[val.value] = e.detail.value this.$set(this.orderObj, val.value, e.detail.value)
if (val.value == 'payeeType') { if (val.value == 'payeeType') {
this.changePayee() this.changePayee()
} }
...@@ -687,7 +689,8 @@ export default { ...@@ -687,7 +689,8 @@ export default {
cell.radioList = this.orderObj.payeeType == 1 ? this.merchantPayList : this.djPayList cell.radioList = this.orderObj.payeeType == 1 ? this.merchantPayList : this.djPayList
if (!this.orderObj.id && cell.radioList && cell.radioList.length > 0) { if (!this.orderObj.id && cell.radioList && cell.radioList.length > 0) {
cell.current = cell.radioList[0].value cell.current = cell.radioList[0].value
this.orderObj.selectPayType = cell.radioList[0].value // 使用 $set 确保响应式更新
this.$set(this.orderObj, 'selectPayType', cell.radioList[0].value)
} }
} }
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!