feat(cp排行榜): 补充错误提示

This commit is contained in:
hzj 2026-01-19 20:46:13 +08:00
parent 2ab9b610ff
commit 8e5f075030
7 changed files with 17 additions and 16 deletions

View File

@ -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`
}
}

View File

@ -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)
}
}

View File

@ -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)
}
}

View File

@ -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)
}
}

View File

@ -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)
}
}

View File

@ -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)
}
}

View File

@ -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)
}
}