Fix:5288 【商城小程序】从抽奖名单页面直接领取奖品,输入收货地址并提交,页面会提示“缺少奖券ID”
This commit is contained in:
@@ -177,7 +177,7 @@ export default {
|
||||
this.form = {
|
||||
...this.form,
|
||||
...routeParams,
|
||||
lotteryRecordId: routeParams.lotteryRecordId || routeParams.id || '',
|
||||
lotteryRecordId: this.resolveLotteryRecordId(routeParams),
|
||||
prizeName: routeParams.prizeName || '',
|
||||
prizeAttrName: routeParams.prizeAttrName || '',
|
||||
prizeType: routeParams.prizeType || '',
|
||||
@@ -213,6 +213,9 @@ export default {
|
||||
return result
|
||||
}, {})
|
||||
},
|
||||
resolveLotteryRecordId(data = {}) {
|
||||
return data.lotteryRecordId || data.id || data.ticketId || data.recordId || ''
|
||||
},
|
||||
goBack() {
|
||||
uni.navigateBack()
|
||||
},
|
||||
@@ -296,7 +299,7 @@ export default {
|
||||
return true
|
||||
},
|
||||
async submitCouponClaim() {
|
||||
const ticketId = Number(this.form.lotteryRecordId)
|
||||
const ticketId = Number(this.resolveLotteryRecordId(this.form))
|
||||
if (!ticketId) {
|
||||
uni.showToast({ title: '缺少抽奖券ID', icon: 'none' })
|
||||
return
|
||||
@@ -309,7 +312,7 @@ export default {
|
||||
async submitPhysicalClaim() {
|
||||
if (this.submitting) return
|
||||
if (!this.validatePhysicalForm()) return
|
||||
const ticketId = Number(this.form.lotteryRecordId)
|
||||
const ticketId = Number(this.resolveLotteryRecordId(this.form))
|
||||
if (!ticketId) {
|
||||
uni.showToast({ title: '缺少抽奖券ID', icon: 'none' })
|
||||
return
|
||||
|
||||
@@ -347,6 +347,7 @@ export default {
|
||||
},
|
||||
mapUserWinList(ticketList = []) {
|
||||
return ticketList.map(item => ({
|
||||
id: item.id || item.lotteryRecordId || item.ticketId || item.recordId || "",
|
||||
lotteryRecordId: item.id || item.lotteryRecordId || item.ticketId || item.recordId || "",
|
||||
levelName: item.levelName || item.prizeLevelName || "中奖奖品",
|
||||
prizeName: item.prizeName || item.awardName || "神秘奖品",
|
||||
@@ -377,6 +378,7 @@ export default {
|
||||
const activityData = (activityRes && activityRes.data) || {}
|
||||
const winnerData = (winnerRes && winnerRes.data) || {}
|
||||
const winnerList = winnerData.activityWinnerList || []
|
||||
const userWinList = this.mapUserWinList(winnerData.userWinList || [])
|
||||
const myTicketList = this.normalizeListData(myTicketsRes)
|
||||
|
||||
const filteredMyTicketList = targetActivityId
|
||||
@@ -385,7 +387,7 @@ export default {
|
||||
|
||||
this.drawTime = this.formatDrawTime(activityData.drawTime || activityData.openTime || "")
|
||||
this.activityWinnerList = winnerList
|
||||
this.userWinList = winnerData.userWinList || []
|
||||
this.userWinList = userWinList
|
||||
this.hasWon = this.userWinList.length > 0 ? 1 : 0
|
||||
this.periodLabel = winnerData.periodNo || "01"
|
||||
this.remainingClaimDays = winnerData.remainingClaimDays || 7
|
||||
|
||||
Reference in New Issue
Block a user