mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-09 02:46:44 +08:00
案例565修改
This commit is contained in:
@@ -621,6 +621,7 @@ export default {
|
|||||||
}
|
}
|
||||||
dataList(allData[random])
|
dataList(allData[random])
|
||||||
})()
|
})()
|
||||||
|
this.pageScroll = JSON.parse(sessionStorage.getItem("pagesScroll"))
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
let $this = this;
|
let $this = this;
|
||||||
@@ -699,7 +700,10 @@ export default {
|
|||||||
// window.addEventListener("scroll", this.handleScroll);
|
// window.addEventListener("scroll", this.handleScroll);
|
||||||
// 获取年
|
// 获取年
|
||||||
this.getYears();
|
this.getYears();
|
||||||
|
if(this.pageScroll){
|
||||||
|
this.queryCondition.pageIndex = parseInt(this.pageScroll.pages)
|
||||||
|
this.queryCondition.type = this.pageScroll.type
|
||||||
|
}
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
// window.removeEventListener("scroll", this.handleScroll);
|
// window.removeEventListener("scroll", this.handleScroll);
|
||||||
@@ -789,6 +793,12 @@ export default {
|
|||||||
apiCase.startReadTimer(refId)
|
apiCase.startReadTimer(refId)
|
||||||
}
|
}
|
||||||
this.$router.push({ path: '/case/detail', query: { id } });
|
this.$router.push({ path: '/case/detail', query: { id } });
|
||||||
|
this.pageScroll = {
|
||||||
|
pages: this.queryCondition.pageIndex,
|
||||||
|
scrollTop: window.pageYOffset,
|
||||||
|
type: this.queryCondition.type
|
||||||
|
}
|
||||||
|
sessionStorage.setItem('pagesScroll', JSON.stringify(this.pageScroll))
|
||||||
},
|
},
|
||||||
tylClick() {
|
tylClick() {
|
||||||
window.open("https://m.qingxuetang.com/x/?appId=qxtcorp306130");
|
window.open("https://m.qingxuetang.com/x/?appId=qxtcorp306130");
|
||||||
@@ -1290,6 +1300,16 @@ export default {
|
|||||||
// 给所有的赋值
|
// 给所有的赋值
|
||||||
this.caseList.count = res.result.count;
|
this.caseList.count = res.result.count;
|
||||||
this.caseList.showPagCount = res.result.count;
|
this.caseList.showPagCount = res.result.count;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if(JSON.parse(sessionStorage.getItem("pagesScroll"))){
|
||||||
|
window.scrollTo({
|
||||||
|
left: 0,
|
||||||
|
top: JSON.parse(sessionStorage.getItem("pagesScroll")).scrollTop,
|
||||||
|
behavior: 'smooth'
|
||||||
|
})
|
||||||
|
sessionStorage.removeItem("pagesScroll")
|
||||||
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(res.message);
|
this.$message.error(res.message);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user