|
|
|
@ -194,6 +194,17 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view v-if="rankTopRewardModal.show" class="win-mask" @tap.stop> |
|
|
|
<view class="win-card rank-reward-card" @tap.stop> |
|
|
|
<view class="win-burst"></view> |
|
|
|
<view class="win-medal rank-reward-medal">TOP</view> |
|
|
|
<view class="win-title">学院排位赛获奖啦</view> |
|
|
|
<view class="win-sub">{{rankTopRewardModal.data.title || '学院排位赛荣耀榜奖励'}}</view> |
|
|
|
<view class="win-tip">奖励已发放到账户余额,继续为学院冲榜吧</view> |
|
|
|
<view class="win-btn" @tap.stop="closeRankTopReward">知道了</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view v-if="taskDrawerVisible" class="task-drawer-mask" @tap="taskDrawerVisible=false"> |
|
|
|
<view class="task-drawer" @tap.stop> |
|
|
|
<view class="drawer-handle"></view> |
|
|
|
@ -349,6 +360,13 @@ |
|
|
|
data: {}, |
|
|
|
receiving: false |
|
|
|
}, |
|
|
|
rankTopRewardModal: { |
|
|
|
show: false, |
|
|
|
data: {} |
|
|
|
}, |
|
|
|
winningFallbackLoading: false, |
|
|
|
winningReadMarked: {}, |
|
|
|
rankTopReminderReadMarked: false, |
|
|
|
poolRuleVisible: false, |
|
|
|
guideVisible: false, |
|
|
|
taskDrawerVisible: false, |
|
|
|
@ -624,7 +642,10 @@ |
|
|
|
if (res.code == 200 && res.result) { |
|
|
|
this.home = res.result |
|
|
|
this.loadedOnce = true |
|
|
|
this.showUnreadWinning() |
|
|
|
if (!this.showUnreadWinning()) { |
|
|
|
this.loadUnreadWinningFallback() |
|
|
|
} |
|
|
|
this.showRankTopRewardIfNeeded() |
|
|
|
this.showGuideTaskIfNeeded() |
|
|
|
} else if (res.message) { |
|
|
|
this.tui.toast(res.message) |
|
|
|
@ -674,14 +695,88 @@ |
|
|
|
}, |
|
|
|
showUnreadWinning() { |
|
|
|
const win = this.home && this.home.unreadWinning |
|
|
|
return this.showWinningModal(win) |
|
|
|
}, |
|
|
|
showWinningModal(win) { |
|
|
|
const winnerId = this.getWinnerId(win) |
|
|
|
if (!win || !winnerId) return |
|
|
|
if (this.winningModal.show && this.getWinnerId(this.winningModal.data) === winnerId) return |
|
|
|
if (!win || !winnerId) return false |
|
|
|
if (this.winningModal.show && this.getWinnerId(this.winningModal.data) === winnerId) return true |
|
|
|
this.winningModal = { |
|
|
|
show: true, |
|
|
|
data: win, |
|
|
|
receiving: false |
|
|
|
} |
|
|
|
this.markWinningRead(win) |
|
|
|
return true |
|
|
|
}, |
|
|
|
loadUnreadWinningFallback() { |
|
|
|
if (this.winningFallbackLoading || this.winningModal.show) return |
|
|
|
this.winningFallbackLoading = true |
|
|
|
this.tui.request('/app/planet/draw/myWinning', 'POST', { |
|
|
|
userId: this.userId, |
|
|
|
regionId: this.regionId |
|
|
|
}, false, false, true).then((res) => { |
|
|
|
this.winningFallbackLoading = false |
|
|
|
if (res.code != 200) return |
|
|
|
const list = Array.isArray(res.result) ? res.result : [] |
|
|
|
for (let i = 0; i < list.length; i++) { |
|
|
|
const item = list[i] |
|
|
|
if (this.getWinnerId(item) && Number(item.isRead || 0) !== 1) { |
|
|
|
this.showWinningModal(item) |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.winningFallbackLoading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
markWinningRead(win) { |
|
|
|
const winnerId = this.getWinnerId(win) |
|
|
|
if (!winnerId || Number((win && win.isRead) || 0) === 1 || this.winningReadMarked[winnerId]) return |
|
|
|
this.winningReadMarked[winnerId] = true |
|
|
|
this.tui.request('/app/planet/draw/read', 'POST', { |
|
|
|
userId: this.userId, |
|
|
|
regionId: this.regionId, |
|
|
|
winnerId |
|
|
|
}, false, false, true).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
win.isRead = 1 |
|
|
|
if (this.home && this.home.unreadWinning && this.getWinnerId(this.home.unreadWinning) === winnerId) { |
|
|
|
this.home.unreadWinning.isRead = 1 |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.winningReadMarked[winnerId] = false |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.winningReadMarked[winnerId] = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
showRankTopRewardIfNeeded() { |
|
|
|
const reminders = (this.home && this.home.homeReminders) || {} |
|
|
|
const reward = reminders.planetRankTop |
|
|
|
if (!reward || this.rankTopRewardModal.show || this.rankTopReminderReadMarked) return false |
|
|
|
if (this.winningModal.show) return false |
|
|
|
this.rankTopRewardModal = { |
|
|
|
show: true, |
|
|
|
data: reward |
|
|
|
} |
|
|
|
this.markRankTopRewardRead() |
|
|
|
return true |
|
|
|
}, |
|
|
|
closeRankTopReward() { |
|
|
|
this.rankTopRewardModal.show = false |
|
|
|
}, |
|
|
|
markRankTopRewardRead() { |
|
|
|
if (this.rankTopReminderReadMarked) return |
|
|
|
this.rankTopReminderReadMarked = true |
|
|
|
this.tui.request('/app/planet/rankTop/read', 'POST', { |
|
|
|
userId: this.userId, |
|
|
|
regionId: this.regionId |
|
|
|
}, false, false, true).then((res) => { |
|
|
|
if (res.code != 200) this.rankTopReminderReadMarked = false |
|
|
|
}).catch(() => { |
|
|
|
this.rankTopReminderReadMarked = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
getWinnerId(win) { |
|
|
|
if (!win) return '' |
|
|
|
@ -697,6 +792,7 @@ |
|
|
|
} |
|
|
|
if (win.isReceived === 1) { |
|
|
|
this.winningModal.show = false |
|
|
|
this.showRankTopRewardIfNeeded() |
|
|
|
return |
|
|
|
} |
|
|
|
this.winningModal.receiving = true |
|
|
|
@ -709,6 +805,7 @@ |
|
|
|
this.tui.toast(res.message, 1500, res.code == 200) |
|
|
|
if (res.code == 200) { |
|
|
|
this.winningModal.show = false |
|
|
|
this.showRankTopRewardIfNeeded() |
|
|
|
this.loadHome(true) |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
@ -2420,6 +2517,17 @@ |
|
|
|
animation: bounce 1s ease infinite; |
|
|
|
} |
|
|
|
|
|
|
|
.rank-reward-card { |
|
|
|
background: linear-gradient(155deg, rgba(255,255,255,0.96), rgba(232,246,255,0.9) 54%, rgba(244,255,250,0.9)); |
|
|
|
box-shadow: 0 38rpx 90rpx rgba(79,183,255,0.22); |
|
|
|
} |
|
|
|
|
|
|
|
.rank-reward-medal { |
|
|
|
background: linear-gradient(145deg, #E8F6FF, #4FB7FF); |
|
|
|
color: #0B6D9F; |
|
|
|
box-shadow: inset -12rpx -16rpx 28rpx rgba(11,109,159,0.12), 0 22rpx 48rpx rgba(79,183,255,0.26); |
|
|
|
} |
|
|
|
|
|
|
|
.win-title { |
|
|
|
position: relative; |
|
|
|
margin-top: 24rpx; |
|
|
|
|