Fix:5286 【商城小程序】奖品收货地址页,未读取后台配置

This commit is contained in:
linxi
2026-05-15 11:52:59 +08:00
parent 45b98c7bf1
commit 4c84a96e07
3 changed files with 48 additions and 30 deletions
+29 -9
View File
@@ -78,7 +78,7 @@
</view>
</view>
<view class="tips">*请仔细核对收货信息,提交后不可修改,奖品将在7个工作日内寄出</view>
<view class="tips">*请仔细核对收货信息,提交后不可修改,奖品将在{{ shipDayText }}个工作日内寄出</view>
</scroll-view>
<view class="submit-wrap">
@@ -152,6 +152,7 @@ export default {
showRealnamePopup: false,
showSubmitSuccessPopup: false,
shipDay: 7,
prizeInfo: {},
prizeOrderId: '',
userInfo: {},
realnameStatus: 0,
@@ -170,14 +171,21 @@ export default {
}
},
onLoad(options) {
const routeParams = this.decodeRouteParams(options)
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight || 20
this.form.lotteryRecordId = options.lotteryRecordId || ''
this.form.prizeName = decodeURIComponent(options.prizeName || '')
this.form.prizeAttrName = decodeURIComponent(options.prizeAttrName || '')
this.form.prizeType = decodeURIComponent(options.prizeType || '')
this.form.prizeTypeName = decodeURIComponent(options.prizeTypeName || '')
this.form.prizeImage = decodeURIComponent(options.prizeImage || '')
this.form.ticketCode = decodeURIComponent(options.ticketCode || '')
this.prizeInfo = routeParams
this.form = {
...this.form,
...routeParams,
lotteryRecordId: routeParams.lotteryRecordId || routeParams.id || '',
prizeName: routeParams.prizeName || '',
prizeAttrName: routeParams.prizeAttrName || '',
prizeType: routeParams.prizeType || '',
prizeTypeName: routeParams.prizeTypeName || '',
prizeImage: routeParams.prizeImage || '',
ticketCode: routeParams.ticketCode || ''
}
this.shipDay = Number(routeParams.shipDay || 0) || 7
this.getCityList()
this.fetchRealnameStatus()
},
@@ -193,6 +201,18 @@ export default {
}
},
methods: {
decodeRouteParams(options = {}) {
return Object.keys(options).reduce((result, key) => {
const value = options[key]
if (value === undefined || value === null) return result
try {
result[key] = decodeURIComponent(value)
} catch (e) {
result[key] = value
}
return result
}, {})
},
goBack() {
uni.navigateBack()
},
@@ -282,7 +302,7 @@ export default {
return
}
await claimCoupon(ticketId)
this.shipDay = 7
this.shipDay = Number(this.prizeInfo.shipDay || 0) || 7
this.prizeOrderId = ''
this.showSubmitSuccessPopup = true
},