diff --git a/src/api/modules/cases.js b/src/api/modules/cases.js index 2bb8c58e..c0adadcc 100644 --- a/src/api/modules/cases.js +++ b/src/api/modules/cases.js @@ -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, diff --git a/src/views/portal/case/Charts.vue b/src/views/portal/case/Charts.vue index 46c547e0..f55d3df3 100644 --- a/src/views/portal/case/Charts.vue +++ b/src/views/portal/case/Charts.vue @@ -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; diff --git a/src/views/portal/case/Detail.vue b/src/views/portal/case/Detail.vue index 99361d83..fa7b97b3 100644 --- a/src/views/portal/case/Detail.vue +++ b/src/views/portal/case/Detail.vue @@ -109,9 +109,13 @@
-
-
-
+
+ +
排行榜
+
>
+
+
+

好评榜

@@ -126,7 +130,7 @@
  • + style="cursor: pointer;margin-top:15px;line-height: 22px;" @click="jumpRouter(item)"> @@ -146,7 +150,7 @@
-
+

人气榜

@@ -161,7 +165,7 @@
  • + style="cursor: pointer;margin-top:15px;line-height: 22px;" @click="jumpRouter(item)"> @@ -181,11 +185,11 @@
-
+

推荐榜

  • + style="cursor: pointer;margin-top:15px;line-height: 22px;"> @@ -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; diff --git a/src/views/portal/case/Excellent.vue b/src/views/portal/case/Excellent.vue index e2bb980b..49606908 100644 --- a/src/views/portal/case/Excellent.vue +++ b/src/views/portal/case/Excellent.vue @@ -13,7 +13,7 @@
    @@ -44,7 +44,7 @@
    -
    +
    @@ -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 @@ - + {{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%;