Commit b66f6d14 by 胡悦

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

修复对象属性更新不使用响应式方法的问题,确保视图同步更新
初始化时从storage获取用户信息和配置数据
1 parent 6ba572f6
......@@ -157,6 +157,8 @@ export default {
console.log(this.orderObj, 'orderObj')
handleTransactionData(newVal)
} else {
this.userInfo = uni.$storage.get('userInfo') || {}
this.baseConfigData = uni.$storage.get('mock_data') || {}
this.orderCreateType = 'createWithPay'
this.orderObj = {
customer: {},
......@@ -314,7 +316,7 @@ export default {
// 单选框change事件
radioChange(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') {
this.changePayee()
}
......@@ -687,7 +689,8 @@ export default {
cell.radioList = this.orderObj.payeeType == 1 ? this.merchantPayList : this.djPayList
if (!this.orderObj.id && cell.radioList && cell.radioList.length > 0) {
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!