案例详情页

This commit is contained in:
zhangsir
2024-09-12 14:55:44 +08:00
parent 7f581272d5
commit eb6c845d00

View File

@@ -112,7 +112,18 @@
<div>
<div id="fixd-box">
<div class="portal-ranking ranking-bg">
<p class="ranking-title">好评榜</p>
<div style="display: flex;justify-content: space-between;">
<p class="ranking-title">好评榜</p>
<el-dropdown trigger="click" @command="positiveReview">
<span class="el-dropdown-link">
{{favorableName}}<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="total"></el-dropdown-item>
<el-dropdown-item command="quarter">季度</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<ul class="ranking-data">
<li v-for="(item, index) in Positive" :key="index" class="title-line-ellipsis"
style="cursor: pointer;margin-top:30px;line-height: 22px;" @click="jumpRouter(item)">
@@ -131,12 +142,23 @@
<span class="portal-right-text" v-if="index == 4">
<img :src="`${webBaseUrl}/images/list05.png`" alt="">
</span>
<span class="portal-title-desc" style="font-size: 14px;">{{ item.title }}</span>
<span class="portal-title-desc" style="font-size: 14px;">{{ item.caseTitle }}</span>
</li>
</ul>
</div>
<div style="margin-top:26px" class="portal-ranking ranking-bg1">
<p class="ranking-title">人气榜</p>
<div style="display: flex;justify-content: space-between;">
<p class="ranking-title">人气榜</p>
<el-dropdown trigger="click" @command="popularityReview">
<span class="el-dropdown-link">
{{popularityName}}<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="total"></el-dropdown-item>
<el-dropdown-item command="quarter">季度</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<ul class="ranking-data">
<li v-for="(item, index) in Popularity" :key="index" class="title-line-ellipsis"
style="cursor: pointer;margin-top:30px;line-height: 22px;" @click="jumpRouter(item)">
@@ -155,7 +177,27 @@
<span class="portal-right-text" v-if="index == 4">
<img :src="`${webBaseUrl}/images/list05.png`" alt="">
</span>
<span class="portal-title-desc" style="font-size: 14px;">{{ item.title }}</span>
<span class="portal-title-desc" style="font-size: 14px;">{{ item.caseTitle }}</span>
</li>
</ul>
</div>
<div v-if="recommendRank.length > 0" class="portal-ranking ranking-bg2" style="margin-top:26px">
<p class="ranking-title">推荐榜</p>
<ul class="ranking-data">
<li v-for="(item, index) in recommendRank" :key="index" class="title-line-ellipsis"
style="cursor: pointer;margin-top:30px;line-height: 22px;">
<router-link :to="'/case/detail?id=' + item.caseId">
<span class="portal-right-text blue-one" v-if="index == 0">
<img :src="`${webBaseUrl}/images/listred01 .png`" alt="">
</span>
<span class="portal-right-text blue-tow" v-if="index == 1">
<img :src="`${webBaseUrl}/images/listred02.png`" alt="">
</span>
<span class="portal-right-text blue-three" v-if="index == 2">
<img :src="`${webBaseUrl}/images/listred03.png`" alt="">
</span>
<span class="portal-title-desc" style="font-size: 14px;">{{ item.caseTitle }}</span>
</router-link>
</li>
</ul>
</div>
@@ -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
}
})
},