feat(cp排行榜): 补充错误提示
This commit is contained in:
parent
2ab9b610ff
commit
8e5f075030
@ -12,11 +12,11 @@ export const formatRewardDisplay = (type, reward) => {
|
||||
const showAmountTypes = ['GOLD', 'DIAMOND', 'GIFT', 'FRAGMENTS', 'TICKET']
|
||||
|
||||
if (showAmountTypes.includes(type)) {
|
||||
return reward.content || ''
|
||||
return reward?.content || ''
|
||||
} else if (type === 'DOLLARS') {
|
||||
return `$${reward.content}`
|
||||
return `$${reward?.content}`
|
||||
} else {
|
||||
// 默认返回数量加天数格式
|
||||
return `${reward.quantity}Days`
|
||||
return `${reward?.quantity}Days`
|
||||
}
|
||||
}
|
||||
|
||||
@ -204,7 +204,7 @@ const getMyLotteryTicketCount = async () => {
|
||||
crystal.value = response.body || 0
|
||||
}
|
||||
} catch (error) {
|
||||
showError(error.message)
|
||||
showError(error.errorMsg)
|
||||
}
|
||||
}
|
||||
|
||||
@ -220,7 +220,7 @@ const getUserFragmentBackpack = async () => {
|
||||
debris.value = response.body?.[0]?.quantity || 0
|
||||
}
|
||||
} catch (error) {
|
||||
showError(error.message)
|
||||
showError(error.errorMsg)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -34,8 +34,8 @@
|
||||
<div style="font-size: 0.8em; font-weight: 600; color: #fff" @click="exchangeGoods(item)">
|
||||
*{{
|
||||
formatRewardDisplay(
|
||||
item.propsGroup.activityRewardProps[0].type,
|
||||
item.propsGroup.activityRewardProps[0],
|
||||
item.propsGroup?.activityRewardProps?.[0]?.type,
|
||||
item.propsGroup?.activityRewardProps?.[0],
|
||||
)
|
||||
}}/ {{ JSON.parse(item.rule.jsonData).need_fragments }}Star
|
||||
</div>
|
||||
@ -107,7 +107,7 @@ const getActivityResource = async () => {
|
||||
goodsList.value = response.body || []
|
||||
}
|
||||
} catch (error) {
|
||||
showError(error.message)
|
||||
showError(error.errorMsg)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -376,6 +376,7 @@ const sweepstakes = async (consecutive = 1) => {
|
||||
openPopup('result') //打开中奖结果弹窗
|
||||
isRolling.value = false
|
||||
} catch (error) {
|
||||
showError(error.errorMsg)
|
||||
isRolling.value = false
|
||||
}
|
||||
}
|
||||
@ -407,7 +408,7 @@ const getMyLotteryTicketCount = async () => {
|
||||
crystal.value = response.body || 0
|
||||
}
|
||||
} catch (error) {
|
||||
showError(error.message)
|
||||
showError(error.errorMsg)
|
||||
}
|
||||
}
|
||||
|
||||
@ -423,7 +424,7 @@ const getUserFragmentBackpack = async () => {
|
||||
debris.value = response.body?.[0]?.quantity || 0
|
||||
}
|
||||
} catch (error) {
|
||||
showError(error.message)
|
||||
showError(error.errorMsg)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -283,7 +283,7 @@ const getMyLotteryTicketCount = async () => {
|
||||
crystal.value = response.body || 0
|
||||
}
|
||||
} catch (error) {
|
||||
showError(error.message)
|
||||
showError(error.errorMsg)
|
||||
}
|
||||
}
|
||||
|
||||
@ -299,7 +299,7 @@ const getUserFragmentBackpack = async () => {
|
||||
debris.value = response.body?.[0]?.quantity || 0
|
||||
}
|
||||
} catch (error) {
|
||||
showError(error.message)
|
||||
showError(error.errorMsg)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -313,7 +313,7 @@ const apiGetRanking = async () => {
|
||||
myRanking.value = response.body.thisUser || {} // 我的排名
|
||||
}
|
||||
} catch (error) {
|
||||
showError(error.message)
|
||||
showError(error.errorMsg)
|
||||
}
|
||||
}
|
||||
|
||||
@ -351,7 +351,7 @@ const apiGetTop3Rewards = async () => {
|
||||
rewardsTop3.value = response.body || [] // 前三名奖励
|
||||
}
|
||||
} catch (error) {
|
||||
showError(error.message)
|
||||
showError(error.errorMsg)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1529,7 +1529,7 @@ const getMyLotteryTicketCount = async () => {
|
||||
crystal.value = response.body || 0
|
||||
}
|
||||
} catch (error) {
|
||||
showError(error.message)
|
||||
showError(error.errorMsg)
|
||||
}
|
||||
}
|
||||
|
||||
@ -1545,7 +1545,7 @@ const getUserFragmentBackpack = async () => {
|
||||
debris.value = response.body?.[0]?.quantity || 0
|
||||
}
|
||||
} catch (error) {
|
||||
showError(error.message)
|
||||
showError(error.errorMsg)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user