mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-09 02:46:44 +08:00
案例
This commit is contained in:
@@ -213,7 +213,10 @@ const queryViewRecord = (data) => ajaxs.post(`/statApi/xboe/m/stat/userdynamic/l
|
||||
const queryPopularityOfMajor = (params) => ajax.get(`/xboe/m/boe/cases/queryPopularityOfMajor?pageSize=${params.pageSize}&rankMonth=${params.rankMonth}&majorId=${params.majorId}`)
|
||||
//浏览记录新
|
||||
const browsingHistory = (params) => ajax.get(`/xboe/m/boe/cases/browsingHistory?pageIndex=${params.pageIndex}&pageSize=5`)
|
||||
//获取所有的专业月份
|
||||
const queryAllTimePopularityOfMajor = () => ajax.get('/xboe/m/boe/cases/queryAllTimePopularityOfMajor')
|
||||
export default {
|
||||
queryAllTimePopularityOfMajor,
|
||||
getQueryRecommendRank,
|
||||
queryPopularityOfMajor,
|
||||
browsingHistory,
|
||||
|
||||
@@ -185,7 +185,7 @@ import portalHeader from '@/components/PortalHeader.vue'
|
||||
padding: 30px;
|
||||
background-color: #fff;
|
||||
width: 30%;
|
||||
min-height: 500px;
|
||||
min-height: 716px;
|
||||
margin-right: 30px;
|
||||
.charts_text{
|
||||
display: flex;
|
||||
|
||||
@@ -109,9 +109,13 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="xcontent2-minor" :style="{ display: zoomShow ? '' : 'none' }">
|
||||
<div>
|
||||
<div id="fixd-box">
|
||||
<div class="portal-ranking ranking-bg">
|
||||
<div id="fixd-box">
|
||||
<router-link class="the_charts" to="/case/charts">
|
||||
<div class="text">排行榜</div>
|
||||
<div class="icon">></div>
|
||||
</router-link>
|
||||
<div>
|
||||
<div class="portal-ranking ranking-bg" style="padding: 20px 15px;max-height: 222px;">
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<p class="ranking-title">好评榜</p>
|
||||
<el-dropdown trigger="click" @command="positiveReview">
|
||||
@@ -126,7 +130,7 @@
|
||||
</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)">
|
||||
style="cursor: pointer;margin-top:15px;line-height: 22px;" @click="jumpRouter(item)">
|
||||
<span class="portal-right-text blue-one" v-if="index == 0">
|
||||
<img :src="`${webBaseUrl}/images/listblue01.png`" alt="">
|
||||
</span>
|
||||
@@ -146,7 +150,7 @@
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div style="margin-top:26px" class="portal-ranking ranking-bg1">
|
||||
<div style="padding: 20px 15px;max-height: 222px;margin-top: 20px;" class="portal-ranking ranking-bg1">
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<p class="ranking-title">人气榜</p>
|
||||
<el-dropdown trigger="click" @command="popularityReview">
|
||||
@@ -161,7 +165,7 @@
|
||||
</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)">
|
||||
style="cursor: pointer;margin-top:15px;line-height: 22px;" @click="jumpRouter(item)">
|
||||
<span class="portal-right-text orange-one" v-if="index == 0">
|
||||
<img :src="`${webBaseUrl}/images/list-01.png`" alt="">
|
||||
</span>
|
||||
@@ -181,11 +185,11 @@
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div v-if="recommendRank.length > 0" class="portal-ranking ranking-bg2" style="margin-top:26px">
|
||||
<div v-if="recommendRank.length > 0" class="portal-ranking ranking-bg2" style="padding: 20px 15px;max-height: 222px;margin-top: 20px;">
|
||||
<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;">
|
||||
style="cursor: pointer;margin-top:15px;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="">
|
||||
@@ -547,9 +551,9 @@ export default {
|
||||
if (pdfTopBox.getBoundingClientRect().top < 1000) {
|
||||
document.querySelector('#pdfTopBox').style.cssText = "position:static";
|
||||
}
|
||||
if (scrollTop > 800) {
|
||||
if (scrollTop > 240) {
|
||||
this.isTopBoxShow = true;
|
||||
document.querySelector('#fixd-box').style.cssText = "position: fixed;top: -624px;width:" + outerWidth + "px";
|
||||
document.querySelector('#fixd-box').style.cssText = "position: fixed;top: 10px;width:" + outerWidth + "px";
|
||||
} else {
|
||||
document.querySelector('#fixd-box').style.cssText = "position: static";
|
||||
}
|
||||
@@ -730,7 +734,32 @@ export default {
|
||||
border-radius: 8px;
|
||||
}
|
||||
}
|
||||
.the_charts{
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-bottom: 10px;
|
||||
font-size: 18px;
|
||||
max-width: 400px;
|
||||
min-width: 260px;
|
||||
height: 47px;
|
||||
background: #DDEDFF;
|
||||
border-radius: 8px;
|
||||
.text{
|
||||
font-size: 18px;
|
||||
color: #387DF7;
|
||||
}
|
||||
.icon{
|
||||
position: absolute;
|
||||
font-size: 18px;
|
||||
color: #387DF7;
|
||||
right: 25px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
}
|
||||
.pdftext {
|
||||
|
||||
// padding: 0 20px;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<div style="margin-right: 12px;">
|
||||
<el-select v-model="majorValue" @change="majorChange" placeholder="请选择专业">
|
||||
<el-option
|
||||
v-for="item in speciData"
|
||||
v-for="item in speciDataNew"
|
||||
:key="item.name"
|
||||
:label="item.name"
|
||||
:value="item.code">
|
||||
@@ -44,7 +44,7 @@
|
||||
<div class="case-tittext">
|
||||
<span class="title-line-ellipsis" v-html="item.title"></span>
|
||||
</div>
|
||||
<div class="case-activeText" @click.stop="toExcellent(item)">
|
||||
<div class="case-activeText" @click.stop="()=>{}">
|
||||
<!-- <span v-if="item.breCommend" class="comWords"
|
||||
style="background-color:rgba(232, 139, 72);">荐</span>
|
||||
<span v-if="item.excellent" class="comWords" style="background-color:red;">最佳</span> -->
|
||||
@@ -146,14 +146,7 @@ import apiPlace from "@/api/phase2/place.js"
|
||||
return {
|
||||
majorId: '',
|
||||
rankMonth: '',
|
||||
optionsMonth:
|
||||
[...Array(12)].map((item,i)=>{
|
||||
return{
|
||||
value: i+1 + '',
|
||||
label: (i+1)+'月'
|
||||
}
|
||||
})
|
||||
,
|
||||
optionsMonth: [],
|
||||
majorValue: '',
|
||||
monthValue: '',
|
||||
caseList: {
|
||||
@@ -164,6 +157,8 @@ import apiPlace from "@/api/phase2/place.js"
|
||||
isSeach: false,
|
||||
domain: [],//组织领域
|
||||
speciData: [],//专业分类
|
||||
speciDataNew: [],
|
||||
monthsObject: {},
|
||||
treeList:[],
|
||||
queryCondition: {
|
||||
pageIndex: 1,
|
||||
@@ -193,9 +188,12 @@ import apiPlace from "@/api/phase2/place.js"
|
||||
},
|
||||
mounted() {
|
||||
this.majorValue = this.$route.query.majorName
|
||||
this.monthValue = parseInt(this.$route.query.riseRankTime.split('-')[1], 10) + '月'
|
||||
const dateStr = this.$route.query.riseRankTime;
|
||||
const year = dateStr.substring(2, 4) + '年';
|
||||
const month = dateStr.substring(5, 7) + '月';
|
||||
this.monthValue = year + month;
|
||||
this.getCaseData()
|
||||
Promise.all([apiType.treeList(1,Number(this.caseType ?? 155),1), apiCase.majorTypes()]).then(rs => {
|
||||
Promise.all([apiType.treeList(1,Number(this.caseType ?? 155),1), apiCase.majorTypes(),apiCase.queryAllTimePopularityOfMajor()]).then(rs => {
|
||||
if (rs[0].code == 200) {
|
||||
const {records} = rs[0].data
|
||||
records.forEach(item => {
|
||||
@@ -224,6 +222,18 @@ import apiPlace from "@/api/phase2/place.js"
|
||||
})
|
||||
this.speciData = rs[1].result;
|
||||
}
|
||||
if(rs[2].status == 200){
|
||||
const months = Object.keys(rs[2].result)
|
||||
this.monthsObject = rs[2].result
|
||||
months.forEach(item=>{
|
||||
rs[1].result.forEach(sub=>{
|
||||
if(item == sub.code){
|
||||
this.speciDataNew.push(sub)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
this.selectMonth(this.$route.query.majorId)
|
||||
});
|
||||
this.loadTypeData();//加载分类
|
||||
},
|
||||
@@ -285,14 +295,23 @@ import apiPlace from "@/api/phase2/place.js"
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
selectMonth(e){
|
||||
this.optionsMonth = this.monthsObject[e].map(item=>{
|
||||
return {
|
||||
value: item,
|
||||
label: item.split('-')[0]+'年'+item.split('-')[1]+'月'
|
||||
}
|
||||
})
|
||||
},
|
||||
majorChange(e){
|
||||
this.selectMonth(e)
|
||||
this.majorId = e
|
||||
this.rankMonth = '20' + this.optionsMonth[0].value + '-' + '20'
|
||||
this.monthValue = this.optionsMonth[0].label
|
||||
this.getCaseData()
|
||||
},
|
||||
monthChange(e){
|
||||
const mon = e.length == 1 ? '0'+e : e
|
||||
const arr = this.$route.query.riseRankTime.split('-')
|
||||
this.rankMonth = arr[0] + '-' + mon + '-' + arr[2]
|
||||
this.rankMonth ='20' + e + '-' + '20'
|
||||
this.getCaseData()
|
||||
},
|
||||
orgDomainTranslate(code) { // 组织领域翻译
|
||||
|
||||
@@ -207,7 +207,7 @@
|
||||
<!-- <span v-if="item.breCommend" class="comWords"
|
||||
style="background-color:rgba(232, 139, 72);">荐</span>
|
||||
<span v-if="item.excellent" class="comWords" style="background-color:red;">最佳</span> -->
|
||||
<span v-if="item.excellentTag" class="comWords" style="width: 98px;height: 24px;background: #F99000;border-radius: 2px;font-weight: 400;font-size: 12px;color: #FFFFFF;padding: 4px 10px;">
|
||||
<span @click.stop="()=>{}" v-if="item.excellentTag" class="comWords" style="width: 98px;height: 24px;background: #F99000;border-radius: 2px;font-weight: 400;font-size: 12px;color: #FFFFFF;padding: 4px 10px;">
|
||||
{{item.excellentTag}}
|
||||
</span>
|
||||
<span @click.stop="toExcellent(tag)" v-if="item.viewRankTags.length != 0" v-for="tag in item.viewRankTags" class="comWords" style="width: 98px;height: 24px;background: #F99000;border-radius: 2px;font-weight: 400;font-size: 12px;color: #FFFFFF;padding: 4px 10px;">
|
||||
@@ -292,104 +292,106 @@
|
||||
</div>
|
||||
<!-- 打开排行榜 -->
|
||||
<div class="xcontent2-minor">
|
||||
<router-link class="the_charts" to="/case/charts">
|
||||
<div class="text">排行榜</div>
|
||||
<div class="icon">></div>
|
||||
</router-link>
|
||||
<div id="fixd-box">
|
||||
<div class="portal-ranking ranking-bg">
|
||||
<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>
|
||||
<router-link class="the_charts" to="/case/charts">
|
||||
<div class="text">排行榜</div>
|
||||
<div class="icon">></div>
|
||||
</router-link>
|
||||
<div>
|
||||
<div class="portal-ranking ranking-bg" style="padding: 20px 15px;max-height: 222px;">
|
||||
<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:15px;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/listblue01.png`" alt="">
|
||||
</span>
|
||||
<span class="portal-right-text blue-tow" v-if="index == 1">
|
||||
<img :src="`${webBaseUrl}/images/listblue02.png`" alt="">
|
||||
</span>
|
||||
<span class="portal-right-text blue-three" v-if="index == 2">
|
||||
<img :src="`${webBaseUrl}/images/listblue03.png`" alt="">
|
||||
</span>
|
||||
<!-- <span class="portal-right-text" v-if="index == 3">
|
||||
<img :src="`${webBaseUrl}/images/list04.png`" alt="">
|
||||
</span>
|
||||
<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.caseTitle }}</span>
|
||||
</router-link>
|
||||
</li>
|
||||
</ul>
|
||||
</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;">
|
||||
<router-link :to="'/case/detail?id=' + item.caseId">
|
||||
<span class="portal-right-text blue-one" v-if="index == 0">
|
||||
<img :src="`${webBaseUrl}/images/listblue01.png`" alt="">
|
||||
<div class="portal-ranking ranking-bg1" style="padding: 20px 15px;max-height: 222px;margin-top: 20px;">
|
||||
<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>
|
||||
<span class="portal-right-text blue-tow" v-if="index == 1">
|
||||
<img :src="`${webBaseUrl}/images/listblue02.png`" alt="">
|
||||
</span>
|
||||
<span class="portal-right-text blue-three" v-if="index == 2">
|
||||
<img :src="`${webBaseUrl}/images/listblue03.png`" alt="">
|
||||
</span>
|
||||
<!-- <span class="portal-right-text" v-if="index == 3">
|
||||
<img :src="`${webBaseUrl}/images/list04.png`" alt="">
|
||||
</span>
|
||||
<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.caseTitle }}</span>
|
||||
</router-link>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="portal-ranking ranking-bg1" style="margin-top:26px">
|
||||
<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>
|
||||
<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:15px;line-height: 22px;">
|
||||
<router-link :to="'/case/detail?id=' + item.caseId">
|
||||
<span class="portal-right-text orange-one" v-if="index == 0">
|
||||
<img :src="`${webBaseUrl}/images/list-01.png`" alt="">
|
||||
</span>
|
||||
<span class="portal-right-text orange-tow" v-if="index == 1">
|
||||
<img :src="`${webBaseUrl}/images/list02.png`" alt="">
|
||||
</span>
|
||||
<span class="portal-right-text orange-three" v-if="index == 2">
|
||||
<img :src="`${webBaseUrl}/images/list03.png`" alt="">
|
||||
</span>
|
||||
<span class="portal-right-text" v-if="index == 3">
|
||||
<img :src="`${webBaseUrl}/images/list04.png`" alt="">
|
||||
</span>
|
||||
<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.caseTitle }}</span>
|
||||
</router-link>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div v-if="recommendRank.length > 0" class="portal-ranking ranking-bg2" style="margin-top:20px;padding: 20px 15px;max-height: 222px;">
|
||||
<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:15px;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>
|
||||
<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;">
|
||||
<router-link :to="'/case/detail?id=' + item.caseId">
|
||||
<span class="portal-right-text orange-one" v-if="index == 0">
|
||||
<img :src="`${webBaseUrl}/images/list-01.png`" alt="">
|
||||
</span>
|
||||
<span class="portal-right-text orange-tow" v-if="index == 1">
|
||||
<img :src="`${webBaseUrl}/images/list02.png`" alt="">
|
||||
</span>
|
||||
<span class="portal-right-text orange-three" v-if="index == 2">
|
||||
<img :src="`${webBaseUrl}/images/list03.png`" alt="">
|
||||
</span>
|
||||
<span class="portal-right-text" v-if="index == 3">
|
||||
<img :src="`${webBaseUrl}/images/list04.png`" alt="">
|
||||
</span>
|
||||
<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.caseTitle }}</span>
|
||||
</router-link>
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
@@ -663,7 +665,7 @@ export default {
|
||||
}
|
||||
},
|
||||
beforeRouteLeave (to, from, next) {
|
||||
if(to.name !== 'caseDetail'){
|
||||
if(to.name !== 'caseDetail'&&to.name !=='caseCharts'&&to.name !=='caseExcellent'){
|
||||
// console.log('我是外')
|
||||
this.queryCondition.pageIndex = 1
|
||||
this.search()
|
||||
@@ -672,6 +674,7 @@ export default {
|
||||
}else{
|
||||
sessionStorage.setItem('pagesScroll', JSON.stringify(window.pageYOffset))
|
||||
}
|
||||
window.removeEventListener("scroll", this.handleScroll);
|
||||
next()
|
||||
},
|
||||
beforeRouteEnter(to, from, next) {
|
||||
@@ -832,13 +835,20 @@ export default {
|
||||
// window.addEventListener("scroll", this.handleScroll);
|
||||
// 获取年
|
||||
this.getYears();
|
||||
this.allRequests()
|
||||
},
|
||||
beforeDestroy() {
|
||||
// window.removeEventListener("scroll", this.handleScroll);
|
||||
// console.log('销毁了');/
|
||||
// console.log('销毁了');
|
||||
|
||||
},
|
||||
methods: {
|
||||
allRequests(){
|
||||
window.addEventListener(
|
||||
"scroll",
|
||||
this.handleScroll
|
||||
);
|
||||
},
|
||||
deleteFavorite(e){
|
||||
this.search()
|
||||
},
|
||||
@@ -932,10 +942,16 @@ export default {
|
||||
this.$message.error('该案例已被删除')
|
||||
return
|
||||
}
|
||||
if (refId) {
|
||||
apiCase.startReadTimer(refId)
|
||||
}
|
||||
this.$router.push({ path: '/case/detail', query: { id } });
|
||||
apiCase.details(id,true).then(res=>{
|
||||
if (res.status == 200) {
|
||||
if (refId) {
|
||||
apiCase.startReadTimer(refId)
|
||||
}
|
||||
this.$router.push({ path: '/case/detail', query: { id } });
|
||||
}else{
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
})
|
||||
},
|
||||
toExcellent(item){
|
||||
this.$router.push({path:'/case/excellent',query:{majorId:item.majorId,majorName:item.majorName,riseRankTime:item.riseRankTime.split(' ')[0]}})
|
||||
@@ -1319,25 +1335,25 @@ export default {
|
||||
// this.getCaseData();
|
||||
// },
|
||||
// 滚动请求
|
||||
// handleScroll() {
|
||||
// let innerw = document.querySelector("#fixd-box");
|
||||
handleScroll() {
|
||||
let innerw = document.querySelector("#fixd-box");
|
||||
// let innerHeight = document.querySelector("#case-list-content")
|
||||
// .clientHeight;
|
||||
// let outerHeight = document.documentElement.clientHeight;
|
||||
// let outerWidth = innerw.clientWidth;
|
||||
// let scrollTop = document.documentElement.scrollTop;
|
||||
let outerWidth = innerw.clientWidth;
|
||||
let scrollTop = document.documentElement.scrollTop;
|
||||
// if (outerHeight + scrollTop + 350 >= innerHeight) {
|
||||
// if (this.moreState == 1) {
|
||||
// this.debounce(this.loadMore(), 5000);
|
||||
// }
|
||||
// }
|
||||
// if (scrollTop > 630) {
|
||||
// document.querySelector("#fixd-box").style.cssText =
|
||||
// "position: fixed;top: -400px;width:" + outerWidth + "px";
|
||||
// } else {
|
||||
// document.querySelector("#fixd-box").style.cssText = "position: static";
|
||||
// }
|
||||
// },
|
||||
if (scrollTop > 260) {
|
||||
document.querySelector("#fixd-box").style.cssText =
|
||||
"position: fixed;top: 10px;width:" + outerWidth + "px";
|
||||
} else {
|
||||
document.querySelector("#fixd-box").style.cssText = "position: static";
|
||||
}
|
||||
},
|
||||
useHotword(item) {
|
||||
this.keyWord = item.keyword;
|
||||
this.search();
|
||||
@@ -1853,19 +1869,19 @@ export default {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-bottom: 10px;
|
||||
font-size: 18px;
|
||||
font-size: 17px;
|
||||
max-width: 400px;
|
||||
min-width: 260px;
|
||||
height: 67px;
|
||||
height: 47px;
|
||||
background: #DDEDFF;
|
||||
border-radius: 8px;
|
||||
.text{
|
||||
font-size: 18px;
|
||||
font-size: 17px;
|
||||
color: #387DF7;
|
||||
}
|
||||
.icon{
|
||||
position: absolute;
|
||||
font-size: 18px;
|
||||
font-size: 17px;
|
||||
color: #387DF7;
|
||||
right: 25px;
|
||||
top: 50%;
|
||||
|
||||
Reference in New Issue
Block a user