活动bug

This commit is contained in:
lf 2024-07-04 18:23:12 +08:00
parent 8d5e030157
commit bd3266779c
3 changed files with 24 additions and 6 deletions

View File

@ -316,6 +316,13 @@ const flip = debounce(function (index) {
}) })
return return
} }
if (status.value !== 2) {
uni.showToast({
title: '活动异常',
icon: 'error',
})
return
}
if ( if (
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
receive_num.value > 0 || receive_num.value > 0 ||
@ -364,7 +371,7 @@ function getAccountInfo() {
} }
Api.getCode(params).then((res: any) => { Api.getCode(params).then((res: any) => {
if (res.code === 200) { if (res.code === 200) {
status.value = res.data.status status.value = res.data.activity_info?.status || 0
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
receive_num.value = res.data.lottery_count - res.data.use_lottery_count receive_num.value = res.data.lottery_count - res.data.use_lottery_count
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase

View File

@ -237,9 +237,9 @@ export default {
}, },
// //
getConfig() { getConfig() {
uni.showLoading({ // uni.showLoading({
title: '加载中...', // title: '...',
}) // })
const params = { const params = {
activity_code: this.activity_code, activity_code: this.activity_code,
} }
@ -250,7 +250,8 @@ export default {
const { activity_info, status, lottery_code, lottery_count, use_lottery_count } = res.data const { activity_info, status, lottery_code, lottery_count, use_lottery_count } = res.data
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
this.freeNum = lottery_count - use_lottery_count this.freeNum = lottery_count - use_lottery_count
this.status = status // eslint-disable-next-line camelcase
this.status = activity_info?.status || 0
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
this.lottery_code = lottery_code this.lottery_code = lottery_code
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
@ -330,6 +331,7 @@ export default {
lottery_code: this.lottery_code, lottery_code: this.lottery_code,
} }
if (this.status === 1 || this.status === 5) { if (this.status === 1 || this.status === 5) {
this.prizeing = false
uni.showToast({ uni.showToast({
title: '活动未开始', title: '活动未开始',
icon: 'error', icon: 'error',
@ -337,12 +339,21 @@ export default {
return return
} }
if (this.status === 3 || this.status === 4) { if (this.status === 3 || this.status === 4) {
this.prizeing = false
uni.showToast({ uni.showToast({
title: '活动已结束', title: '活动已结束',
icon: 'error', icon: 'error',
}) })
return return
} }
if (this.status !== 2) {
this.prizeing = false
uni.showToast({
title: '活动异常',
icon: 'error',
})
return
}
Api.lottery(params) Api.lottery(params)
.then((res) => { .then((res) => {
this.freeNum = res.data.lottery_count this.freeNum = res.data.lottery_count

View File

@ -46,7 +46,7 @@
</view> </view>
<view class="flex_start flex_items mr20" style="color: #eb5e42"> <view class="flex_start flex_items mr20" style="color: #eb5e42">
<view class="f24"></view> <view class="f24"></view>
<text class="f48 bolder one">{{ item.show_price }}</text> <text class="f48 bolder one">{{ item.product_amount }}</text>
</view> </view>
</view> </view>
<view class="mt40 flex_between flex_items"> <view class="mt40 flex_between flex_items">