Fix:5286 【商城小程序】奖品收货地址页,未读取后台配置
This commit is contained in:
@@ -78,7 +78,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="tips">*请仔细核对收货信息,提交后不可修改,奖品将在7个工作日内寄出</view>
|
<view class="tips">*请仔细核对收货信息,提交后不可修改,奖品将在{{ shipDayText }}个工作日内寄出</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
|
|
||||||
<view class="submit-wrap">
|
<view class="submit-wrap">
|
||||||
@@ -152,6 +152,7 @@ export default {
|
|||||||
showRealnamePopup: false,
|
showRealnamePopup: false,
|
||||||
showSubmitSuccessPopup: false,
|
showSubmitSuccessPopup: false,
|
||||||
shipDay: 7,
|
shipDay: 7,
|
||||||
|
prizeInfo: {},
|
||||||
prizeOrderId: '',
|
prizeOrderId: '',
|
||||||
userInfo: {},
|
userInfo: {},
|
||||||
realnameStatus: 0,
|
realnameStatus: 0,
|
||||||
@@ -170,14 +171,21 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
|
const routeParams = this.decodeRouteParams(options)
|
||||||
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight || 20
|
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight || 20
|
||||||
this.form.lotteryRecordId = options.lotteryRecordId || ''
|
this.prizeInfo = routeParams
|
||||||
this.form.prizeName = decodeURIComponent(options.prizeName || '')
|
this.form = {
|
||||||
this.form.prizeAttrName = decodeURIComponent(options.prizeAttrName || '')
|
...this.form,
|
||||||
this.form.prizeType = decodeURIComponent(options.prizeType || '')
|
...routeParams,
|
||||||
this.form.prizeTypeName = decodeURIComponent(options.prizeTypeName || '')
|
lotteryRecordId: routeParams.lotteryRecordId || routeParams.id || '',
|
||||||
this.form.prizeImage = decodeURIComponent(options.prizeImage || '')
|
prizeName: routeParams.prizeName || '',
|
||||||
this.form.ticketCode = decodeURIComponent(options.ticketCode || '')
|
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.getCityList()
|
||||||
this.fetchRealnameStatus()
|
this.fetchRealnameStatus()
|
||||||
},
|
},
|
||||||
@@ -193,6 +201,18 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
goBack() {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
},
|
},
|
||||||
@@ -282,7 +302,7 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
await claimCoupon(ticketId)
|
await claimCoupon(ticketId)
|
||||||
this.shipDay = 7
|
this.shipDay = Number(this.prizeInfo.shipDay || 0) || 7
|
||||||
this.prizeOrderId = ''
|
this.prizeOrderId = ''
|
||||||
this.showSubmitSuccessPopup = true
|
this.showSubmitSuccessPopup = true
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -363,15 +363,14 @@ export default {
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const query = [
|
const queryParams = {
|
||||||
`lotteryRecordId=${item.id}`,
|
...item,
|
||||||
`ticketCode=${encodeURIComponent(item.ticketCode || '')}`,
|
lotteryRecordId: item.lotteryRecordId || item.id || ''
|
||||||
`prizeName=${encodeURIComponent(item.prizeName || '')}`,
|
}
|
||||||
`prizeAttrName=${encodeURIComponent(item.prizeAttrName || '')}`,
|
const query = Object.keys(queryParams)
|
||||||
`prizeType=${encodeURIComponent(item.prizeType || '')}`,
|
.filter((key) => queryParams[key] !== undefined && queryParams[key] !== null && typeof queryParams[key] !== 'object')
|
||||||
`prizeTypeName=${encodeURIComponent(item.prizeTypeName || '')}`,
|
.map((key) => `${key}=${encodeURIComponent(queryParams[key])}`)
|
||||||
`prizeImage=${encodeURIComponent(item.prizeImage || '')}`
|
.join('&')
|
||||||
].join('&')
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pkg-video/views/county-claim-address?${query}`
|
url: `/pkg-video/views/county-claim-address?${query}`
|
||||||
})
|
})
|
||||||
@@ -753,11 +752,12 @@ export default {
|
|||||||
height: 40rpx;
|
height: 40rpx;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
border: 2rpx solid #333;
|
border: 2rpx solid #333;
|
||||||
font-size: 40rpx;
|
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
color: #333;
|
color: #333;
|
||||||
line-height: 40rpx;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.popup-icon-wrap {
|
.popup-icon-wrap {
|
||||||
|
|||||||
@@ -293,16 +293,14 @@ export default {
|
|||||||
return prizeType === 3 || prize.prizeType === "coupon" || /券/.test(prizeName)
|
return prizeType === 3 || prize.prizeType === "coupon" || /券/.test(prizeName)
|
||||||
},
|
},
|
||||||
navToReceiveInfo(prize = {}) {
|
navToReceiveInfo(prize = {}) {
|
||||||
const query = [
|
const queryParams = { source: "lottery", ...prize }
|
||||||
`source=lottery`,
|
const query = Object.keys(queryParams)
|
||||||
`lotteryRecordId=${encodeURIComponent(prize.lotteryRecordId || "")}`,
|
.filter((key) => {
|
||||||
`ticketCode=${encodeURIComponent(prize.ticketCode || "")}`,
|
const value = queryParams[key]
|
||||||
`prizeName=${encodeURIComponent(prize.prizeName || "")}`,
|
return value !== undefined && value !== null && typeof value !== "object"
|
||||||
`prizeAttrName=${encodeURIComponent(prize.prizeAttrName || "")}`,
|
})
|
||||||
`prizeType=${encodeURIComponent(prize.prizeType || "")}`,
|
.map((key) => `${key}=${encodeURIComponent(queryParams[key])}`)
|
||||||
`prizeTypeName=${encodeURIComponent(prize.prizeTypeName || "")}`,
|
.join("&")
|
||||||
`prizeImage=${encodeURIComponent(prize.prizeImage || "")}`
|
|
||||||
].join("&")
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pkg-video/views/county-claim-address?${query}`
|
url: `/pkg-video/views/county-claim-address?${query}`
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user