mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-24 17:12:53 +08:00
添加错误处理
This commit is contained in:
@@ -88,24 +88,32 @@ export default {
|
||||
async init() {
|
||||
let currMonth = dateUtil.formatDate(new Date(), 'yyyy-MM-dd')
|
||||
let data = await getCongratulationList({ date: currMonth, queryType: 'm' })
|
||||
let result = data.content
|
||||
let topList = result.list.splice(0, 30)
|
||||
topList.map(value => {
|
||||
value.comName = value.comName.substr(12)
|
||||
return value
|
||||
})
|
||||
this.showData.topList.push(...topList)
|
||||
this.showData.achievement.selfAdvanceStand = result.ysbb
|
||||
this.showData.achievement.selfAcceptStand = result.bzbf
|
||||
this.showData.achievement.ranking = result.top
|
||||
this.showData.achievement.previousGap = result.xcbf
|
||||
this.showData.achievement.rankingBb = result.topBB
|
||||
// 后端精度处理有问题, 让前端先直接截取处理
|
||||
if (result.xccbbb.includes('.')) {
|
||||
let nums = result.xccbbb.split('.')
|
||||
this.showData.achievement.previousCbbbGap = `${nums[0]}.${nums[1].substring(0, 2)}`
|
||||
if (data.result === '0') {
|
||||
let result = data.content
|
||||
if (result.list && result.list.length) {
|
||||
let topList = result.list.splice(0, 30)
|
||||
topList.map(value => {
|
||||
value.comName = value.comName.substr(12)
|
||||
return value
|
||||
})
|
||||
this.showData.topList.push(...topList)
|
||||
this.showData.achievement.selfAdvanceStand = result.ysbb
|
||||
this.showData.achievement.selfAcceptStand = result.bzbf
|
||||
this.showData.achievement.ranking = result.top
|
||||
this.showData.achievement.previousGap = result.xcbf
|
||||
this.showData.achievement.rankingBb = result.topBB
|
||||
// 后端精度处理有问题, 让前端先直接截取处理
|
||||
if (result.xccbbb.includes('.')) {
|
||||
let nums = result.xccbbb.split('.')
|
||||
this.showData.achievement.previousCbbbGap = `${nums[0]}.${nums[1].substring(0, 2)}`
|
||||
} else {
|
||||
this.showData.achievement.previousCbbbGap = result.xccbbb
|
||||
}
|
||||
} else {
|
||||
this.$toast('暂无数据')
|
||||
}
|
||||
} else {
|
||||
this.showData.achievement.previousCbbbGap = result.xccbbb
|
||||
this.$toast(data.resultMessage)
|
||||
}
|
||||
this.$toast.clear()
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user