Merge branch 'zcwy_0822_case' into dev0515

This commit is contained in:
zhangsir
2024-09-12 14:57:46 +08:00

View File

@@ -112,7 +112,18 @@
<div> <div>
<div id="fixd-box"> <div id="fixd-box">
<div class="portal-ranking ranking-bg"> <div class="portal-ranking ranking-bg">
<div style="display: flex;justify-content: space-between;">
<p class="ranking-title">好评榜</p> <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"> <ul class="ranking-data">
<li v-for="(item, index) in Positive" :key="index" class="title-line-ellipsis" <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)"> 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"> <span class="portal-right-text" v-if="index == 4">
<img :src="`${webBaseUrl}/images/list05.png`" alt=""> <img :src="`${webBaseUrl}/images/list05.png`" alt="">
</span> </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> </li>
</ul> </ul>
</div> </div>
<div style="margin-top:26px" class="portal-ranking ranking-bg1"> <div style="margin-top:26px" class="portal-ranking ranking-bg1">
<div style="display: flex;justify-content: space-between;">
<p class="ranking-title">人气榜</p> <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"> <ul class="ranking-data">
<li v-for="(item, index) in Popularity" :key="index" class="title-line-ellipsis" <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)"> 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"> <span class="portal-right-text" v-if="index == 4">
<img :src="`${webBaseUrl}/images/list05.png`" alt=""> <img :src="`${webBaseUrl}/images/list05.png`" alt="">
</span> </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> </li>
</ul> </ul>
</div> </div>
@@ -199,6 +241,12 @@ export default {
}, },
data() { data() {
return { return {
switch: {
'total': '总',
'quarter': '季度',
},
favorableName: '季度',
popularityName: '季度',
fileBaseUrl: process.env.VUE_APP_FILE_BASE_URL, fileBaseUrl: process.env.VUE_APP_FILE_BASE_URL,
resonimg: {}, resonimg: {},
Internet: 3,//1是成功 2是是失败 3是检测中 Internet: 3,//1是成功 2是是失败 3是检测中
@@ -210,6 +258,7 @@ export default {
ankingList: [], ankingList: [],
Popularity: [], Popularity: [],
Positive: [], Positive: [],
recommendRank: [],
resolveId: '', resolveId: '',
basePath: process.env.VUE_APP_FILE_BASE_URL, basePath: process.env.VUE_APP_FILE_BASE_URL,
pdfPath: '', pdfPath: '',
@@ -271,6 +320,14 @@ export default {
this.cumulativeDuration = 0; this.cumulativeDuration = 0;
}, },
methods: { methods: {
positiveReview(e){
this.favorableName = this.switch[e]
this.getPositive()
},
popularityReview(e){
this.popularityName = this.switch[e]
this.getPopularity()
},
endTimeRequst(caseId, recordEndTime) { endTimeRequst(caseId, recordEndTime) {
console.log(this.dataTime); console.log(this.dataTime);
let time = (recordEndTime - this.dataTime) / 1000 / 60 let time = (recordEndTime - this.dataTime) / 1000 / 60
@@ -297,6 +354,7 @@ export default {
this.getAnkingData(); this.getAnkingData();
this.getPopularity(); this.getPopularity();
this.getPositive(); this.getPositive();
this.getQueryRecommendRank();
this.couresreso(); this.couresreso();
this.retest(); this.retest();
window.addEventListener( window.addEventListener(
@@ -442,13 +500,13 @@ export default {
// location.href =`${this.webBaseUrl}/case/detail?id=${item.id}` // location.href =`${this.webBaseUrl}/case/detail?id=${item.id}`
// this.$router.push(`/case/detail?id=${item.id}`); // this.$router.push(`/case/detail?id=${item.id}`);
const currentRoute = this.$router.currentRoute; const currentRoute = this.$router.currentRoute;
if (currentRoute.query.id !== item.id) { if (currentRoute.query.id !== item.caseId) {
this.$router.push('/case/detail?id=' + item.id); this.$router.push('/case/detail?id=' + item.caseId);
} else { } else {
// 结束时间 // 结束时间
let recordEndTime = new Date().getTime() let recordEndTime = new Date().getTime()
this.endTimeRequst(item.id, recordEndTime) this.endTimeRequst(item.id, recordEndTime)
location.href = `${this.webBaseUrl}/case/detail?id=${item.id}` location.href = `${this.webBaseUrl}/case/detail?id=${item.caseId}`
} }
}, },
goTop() { goTop() {
@@ -489,9 +547,9 @@ export default {
if (pdfTopBox.getBoundingClientRect().top < 1000) { if (pdfTopBox.getBoundingClientRect().top < 1000) {
document.querySelector('#pdfTopBox').style.cssText = "position:static"; document.querySelector('#pdfTopBox').style.cssText = "position:static";
} }
if (scrollTop > 630) { if (scrollTop > 800) {
this.isTopBoxShow = true; 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 { } else {
document.querySelector('#fixd-box').style.cssText = "position: static"; document.querySelector('#fixd-box').style.cssText = "position: static";
} }
@@ -505,40 +563,53 @@ export default {
}) })
}, },
getPopularity() { getPopularity() {
apiCase.queryPraises(5).then(res => { // 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) { if(res.status == 200) {
this.Popularity = res.result; 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: '',
}) })
} },
} getQueryRecommendRank(){
apiCase.queryRecommendRank(3).then(res => {
if(res.status == 200) {
this.recommendRank = res.result
} }
}) })
}, },
getPositive() { getPositive() {
apiCase.queryComments(5).then(res => { // 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) { if(res.status == 200) {
this.Positive = res.result; 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);
} }
}) })
}, },