diff --git a/src/views/ebiz/congratulation/CongratulationTop.vue b/src/views/ebiz/congratulation/CongratulationTop.vue index 0e729732b..ed4e478f8 100644 --- a/src/views/ebiz/congratulation/CongratulationTop.vue +++ b/src/views/ebiz/congratulation/CongratulationTop.vue @@ -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() },