+
{}">
@@ -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) { // 组织领域翻译
diff --git a/src/views/portal/case/Index.vue b/src/views/portal/case/Index.vue
index 83fdaefe..c3e1f0f7 100644
--- a/src/views/portal/case/Index.vue
+++ b/src/views/portal/case/Index.vue
@@ -207,7 +207,7 @@
-
+ {}" 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}}
@@ -292,104 +292,106 @@
-
- 排行榜
- >
-
-
-
-
好评榜
-
-
- {{favorableName}}
-
-
- 总
- 季度
-
-
+
+ 排行榜
+ >
+
+
+
+
+
好评榜
+
+
+ {{favorableName}}
+
+
+ 总
+ 季度
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.caseTitle }}
+
+
+
-
- -
-
-
-
+
+
+
人气榜
+
+
+ {{popularityName}}
-
-
-
-
-
-
-
- {{ item.caseTitle }}
-
-
-
-
-
-
-
人气榜
-
-
- {{popularityName}}
-
-
- 总
- 季度
-
-
+
+ 总
+ 季度
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.caseTitle }}
+
+
+
+
+
+
推荐榜
+
+ -
+
+
+
+
+
+
+
+
+
+
+ {{ item.caseTitle }}
+
+
+
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.caseTitle }}
-
-
-
-
-
-
推荐榜
-
- -
-
-
-
-
-
-
-
-
-
-
- {{ item.caseTitle }}
-
-
-
@@ -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%;