diff --git a/src/views/portal/case/Detail.vue b/src/views/portal/case/Detail.vue index bf733d64..99361d83 100644 --- a/src/views/portal/case/Detail.vue +++ b/src/views/portal/case/Detail.vue @@ -112,7 +112,18 @@
-

好评榜

+
+

好评榜

+ + + {{favorableName}} + + + + 季度 + + +
  • @@ -131,12 +142,23 @@ - {{ item.title }} + {{ item.caseTitle }}
-

人气榜

+
+

人气榜

+ + + {{popularityName}} + + + + 季度 + + +
  • @@ -155,7 +177,27 @@ - {{ item.title }} + {{ item.caseTitle }} +
  • +
+
+
+

推荐榜

+
    +
  • + + + + + + + + + + + {{ item.caseTitle }} +
@@ -199,6 +241,12 @@ export default { }, data() { return { + switch: { + 'total': '总', + 'quarter': '季度', + }, + favorableName: '季度', + popularityName: '季度', fileBaseUrl: process.env.VUE_APP_FILE_BASE_URL, resonimg: {}, Internet: 3,//1是成功 2是是失败 3是检测中 @@ -210,6 +258,7 @@ export default { ankingList: [], Popularity: [], Positive: [], + recommendRank: [], resolveId: '', basePath: process.env.VUE_APP_FILE_BASE_URL, pdfPath: '', @@ -271,6 +320,14 @@ export default { this.cumulativeDuration = 0; }, methods: { + positiveReview(e){ + this.favorableName = this.switch[e] + this.getPositive() + }, + popularityReview(e){ + this.popularityName = this.switch[e] + this.getPopularity() + }, endTimeRequst(caseId, recordEndTime) { console.log(this.dataTime); let time = (recordEndTime - this.dataTime) / 1000 / 60 @@ -297,6 +354,7 @@ export default { this.getAnkingData(); this.getPopularity(); this.getPositive(); + this.getQueryRecommendRank(); this.couresreso(); this.retest(); window.addEventListener( @@ -442,13 +500,13 @@ export default { // location.href =`${this.webBaseUrl}/case/detail?id=${item.id}` // this.$router.push(`/case/detail?id=${item.id}`); const currentRoute = this.$router.currentRoute; - if (currentRoute.query.id !== item.id) { - this.$router.push('/case/detail?id=' + item.id); + if (currentRoute.query.id !== item.caseId) { + this.$router.push('/case/detail?id=' + item.caseId); } else { // 结束时间 let recordEndTime = new Date().getTime() this.endTimeRequst(item.id, recordEndTime) - location.href = `${this.webBaseUrl}/case/detail?id=${item.id}` + location.href = `${this.webBaseUrl}/case/detail?id=${item.caseId}` } }, goTop() { @@ -489,9 +547,9 @@ export default { if (pdfTopBox.getBoundingClientRect().top < 1000) { document.querySelector('#pdfTopBox').style.cssText = "position:static"; } - if (scrollTop > 630) { + if (scrollTop > 800) { this.isTopBoxShow = true; - document.querySelector('#fixd-box').style.cssText = "position: fixed;top: -400px;width:" + outerWidth + "px"; + document.querySelector('#fixd-box').style.cssText = "position: fixed;top: -624px;width:" + outerWidth + "px"; } else { document.querySelector('#fixd-box').style.cssText = "position: static"; } @@ -505,40 +563,53 @@ export default { }) }, getPopularity() { - apiCase.queryPraises(5).then(res => { - if (res.status == 200) { - this.Popularity = res.result; - if (res.result.length < 5) { - for (let i = 0; i = (5 - res.result.length); i++) { - this.Popularity.push({ - authorName: '', - count: 1, - id: '', - title: '', - }) - } - } + // apiCase.queryPraises(5).then(res => { + // if (res.status == 200) { + // this.Popularity = res.result; + // if (res.result.length < 5) { + // for (let i = 0; i = (5 - res.result.length); i++) { + // this.Popularity.push({ + // authorName: '', + // count: 1, + // id: '', + // title: '', + // }) + // } + // } + // } + // }) + apiCase.queryPraisesNew(3,this.popularityName == '季度' ? 1 : 2).then(res => { + if(res.status == 200) { + this.Popularity = res.result + } + }) + }, + getQueryRecommendRank(){ + apiCase.queryRecommendRank(3).then(res => { + if(res.status == 200) { + this.recommendRank = res.result } }) }, getPositive() { - apiCase.queryComments(5).then(res => { - if (res.status == 200) { - this.Positive = res.result; - if (res.result.length < 5) { - for (let i = 0; i = (5 - res.result.length); i++) { - this.Positive.push({ - authorName: '', - count: 1, - id: '', - title: '', - }) - } - - } - // console.log(this.Positive); - - + // apiCase.queryComments(5).then(res => { + // if (res.status == 200) { + // this.Positive = res.result; + // if (res.result.length < 5) { + // for (let i = 0; i = (5 - res.result.length); i++) { + // this.Positive.push({ + // authorName: '', + // count: 1, + // id: '', + // title: '', + // }) + // } + // } + // } + // }) + apiCase.queryCommentsNew(3,this.favorableName == '季度' ? 3 : 4).then(res => { + if(res.status == 200) { + this.Positive = res.result } }) },