diff --git a/src/layouts/footer/index.vue b/src/layouts/footer/index.vue index facef6b..274a401 100644 --- a/src/layouts/footer/index.vue +++ b/src/layouts/footer/index.vue @@ -15,7 +15,6 @@ export default { }, methods: { setBg(name){ - console.log(1111,name) if(name == 'backstage'){ this.isWhite = true }else{ diff --git a/src/layouts/home/index.vue b/src/layouts/home/index.vue index c6fb066..fa6da0a 100644 --- a/src/layouts/home/index.vue +++ b/src/layouts/home/index.vue @@ -45,6 +45,7 @@ export default { this.collapse = msg; }); + // 每个页面用的背景图和头部这些会不一样,需要分别设置 bus.$on('setBg', name => { this.curModule = name this.$refs.header.setLogo(name) diff --git a/src/pages/information.vue b/src/pages/information.vue index 3854b02..7ea3d61 100644 --- a/src/pages/information.vue +++ b/src/pages/information.vue @@ -122,10 +122,12 @@ export default { this.loadIns = Loading.service() this.$get(this.api.queryAllColumns,data).then(res => { this.menuList = res.data.columnTree + // 从文章页返回的情况,需要回到之前进文章页的那个分类 if(this.historyId){ this.defaultIndex = this.historyId this.getContent(this.historyId) }else{ + // 正常情况默认展示第一个分类下的文章列表 if(this.menuList[0].secondColumn.length){ this.getContent(this.menuList[0].secondColumn[0].id) this.defaultIndex = this.menuList[0].secondColumn[0].id diff --git a/src/pages/match.vue b/src/pages/match.vue index 25253ba..3413790 100644 --- a/src/pages/match.vue +++ b/src/pages/match.vue @@ -138,12 +138,13 @@ export default { let minute = second * 60 let hour = minute * 60 let now = new Date().getTime() - let signUpStartTime = new Date(that.core.dateCompatible(item.signUpStartTime)).getTime() - let signUpEndTime = new Date(that.core.dateCompatible(item.signUpEndTime)).getTime() - let playStartTime = new Date(that.core.dateCompatible(item.playStartTime)).getTime() - let playEndTime = new Date(that.core.dateCompatible(item.playEndTime)).getTime() + let signUpStartTime = new Date(that.core.dateCompatible(item.signUpStartTime)).getTime() // 报名开始时间 + let signUpEndTime = new Date(that.core.dateCompatible(item.signUpEndTime)).getTime() // 报名结束时间 + let playStartTime = new Date(that.core.dateCompatible(item.playStartTime)).getTime() // 比赛开始时间 + let playEndTime = new Date(that.core.dateCompatible(item.playEndTime)).getTime() // 比赛结束时间 switch(item.status){ - case 0: + // status每个值的解释请看getData方法 + case 0: if(now > signUpStartTime){ item.status = 1 }else{ @@ -233,29 +234,30 @@ export default { let covers = [] this.listData.forEach((n,k) => { let now = new Date().getTime() - let signUpStartTime = new Date(this.core.dateCompatible(n.signUpStartTime)).getTime() - let signUpEndTime = new Date(this.core.dateCompatible(n.signUpEndTime)).getTime() - let playStartTime = new Date(this.core.dateCompatible(n.playStartTime)).getTime() - let playEndTime = new Date(this.core.dateCompatible(n.playEndTime)).getTime() + let signUpStartTime = new Date(this.core.dateCompatible(n.signUpStartTime)).getTime() // 报名开始时间 + let signUpEndTime = new Date(this.core.dateCompatible(n.signUpEndTime)).getTime() // 报名结束时间 + let playStartTime = new Date(this.core.dateCompatible(n.playStartTime)).getTime() // 比赛开始时间 + let playEndTime = new Date(this.core.dateCompatible(n.playEndTime)).getTime() // 比赛结束时间 - if(now < signUpStartTime){ + if(now < signUpStartTime){ // 报名没开始 n.status = 0 n.end = Math.floor((signUpStartTime - now) / time) - }else if(now > signUpStartTime && now < signUpEndTime){ + }else if(now > signUpStartTime && now < signUpEndTime){ // 报名进行中 n.status = 1 n.end = Math.floor((signUpEndTime - now) / time) - }else if(now > signUpEndTime && now < playStartTime){ + }else if(now > signUpEndTime && now < playStartTime){ // 报名结束了,但比赛没开始 n.status = 3 n.end = Math.floor((playStartTime - now) / time) - }else if(now > playStartTime && now < playEndTime){ + }else if(now > playStartTime && now < playEndTime){ // 比赛进行中 n.status = 4 n.end = Math.floor((playEndTime - now) / time) - }else if(now > playEndTime){ + }else if(now > playEndTime){ // 比赛结束 n.status = 5 } + // 判断该用户已报名的比赛id集合中有没有该比赛id let isInclude = contestIds.includes(n.id) - if(n.status == 1 && !isInclude){ + if(n.status == 1 && !isInclude){ // 如果报名在进行中,而且该用户没报名,则显示报名按钮,必须status为2,并且signup为true才能报名,下面报名的方法中有做判断 n.status = 2 n.signup = true }else{ diff --git a/src/pages/matchDetail.vue b/src/pages/matchDetail.vue index ae63de7..cf994c8 100644 --- a/src/pages/matchDetail.vue +++ b/src/pages/matchDetail.vue @@ -102,6 +102,7 @@ export default { let time = 60 * 60 * 1000 * 24 let now = new Date().getTime() + // 每个字段的含义请看match.vue let signUpStartTime = new Date(data.signUpStartTime).getTime() let signUpEndTime = new Date(data.signUpEndTime).getTime() let playStartTime = new Date(data.playStartTime).getTime()