fix(activity): 优化福利活动未开始提示
福利活动详情页在开始前显示未开始状态与开始时间提示,避免用户误以为当前可参与。
This commit is contained in:
parent
fb520a6895
commit
8a3676eb9f
@ -174,6 +174,10 @@ export default {
|
|||||||
progressHint() {
|
progressHint() {
|
||||||
if (this.detail?.joined) return '您已成功参加本期活动'
|
if (this.detail?.joined) return '您已成功参加本期活动'
|
||||||
if (this.detail?.can_join) return '已达参与门槛,可立即参加活动'
|
if (this.detail?.can_join) return '已达参与门槛,可立即参加活动'
|
||||||
|
const startTime = this.detail?.start_time ? new Date(this.detail.start_time).getTime() : 0
|
||||||
|
if (startTime && startTime > Date.now()) {
|
||||||
|
return `活动将于 ${this.formatTime(this.detail.start_time)} 开始`
|
||||||
|
}
|
||||||
const target = Number(this.detail?.threshold_amount || 0)
|
const target = Number(this.detail?.threshold_amount || 0)
|
||||||
const current = Number(this.detail?.current_paid || 0)
|
const current = Number(this.detail?.current_paid || 0)
|
||||||
if (target > current) {
|
if (target > current) {
|
||||||
@ -183,6 +187,8 @@ export default {
|
|||||||
},
|
},
|
||||||
joinButtonText() {
|
joinButtonText() {
|
||||||
if (this.detail?.joined) return '已参加'
|
if (this.detail?.joined) return '已参加'
|
||||||
|
const startTime = this.detail?.start_time ? new Date(this.detail.start_time).getTime() : 0
|
||||||
|
if (startTime && startTime > Date.now()) return '未开始'
|
||||||
if (this.detail?.can_join) return '参加活动'
|
if (this.detail?.can_join) return '参加活动'
|
||||||
return '未达门槛'
|
return '未达门槛'
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user