Commit 431f726c authored by 张伯涛's avatar 张伯涛

课程列表记住筛选项并且从详情也面返回滚动到跳转前的位置

parent a992452f
......@@ -49,23 +49,27 @@ export default {
},
scroll(newValue, oldValue) {
// 监听myVar变量的变化
console.log('scrollscrollscrollscrollscrollscroll scroll:', newValue)
if (newValue === '1') {
// console.log('scrollscrollscrollscrollscrollscroll scroll:', newValue)
if (newValue === '1' && this.$route.path === '/courseResources/courseMall/index') {
setTimeout(() => {
console.log('22222222222222222222222222222222222', this.$route)
window.scrollTo(0, 1000)
this.$store.dispatch('app/scroll', null)
this.$refs['scrollContainer'].scrollTo({ top: this.$route.query.params.height || 0, behavior: 'smooth' })
}, 1500)
}
// 这里可以执行一些操作,比如根据变化的值进行一些逻辑处理
}
},
mounted() {
// setTimeout(() => {
// this.$refs['scrollContainer'].scrollTo({ top: 1000 || 0, behavior: 'smooth' })
// }, 1500)
this.setupAutoLogoutTimer() // 页面加载时启动监控用户操作
},
methods: {
parentScroll(event) {
// 获取滚动高度
const scrollHeight = event.target.scrollTop
// console.log('scrollHeight', scrollHeight)
if (this.routerPath === '/courseResources/courseMall/index') {
this.$store.dispatch('app/setTopE', scrollHeight)
}
......
......@@ -993,6 +993,7 @@ export default {
}
.subTitle {
line-height: 28px;
height: 95px;
font-size: 14px;
font-weight: 400;
......
......@@ -395,9 +395,8 @@ export default {
next()
},
created() {
console.log('createdcreatedcreatedcreatedcreatedcreated', this.queryParams)
this.getCoursePlanOptions() // 获取企业和院校的课程方案
this.handleToTop() // 一进入页面自动滚动到最顶部
// this.handleToTop() // 一进入页面自动滚动到最顶部
this.mallIdentityType = this.$route.query.mallIdentityType || ''
if (this.mallIdentityType) {
this.getDicts(dictCons['TEC_CLASSIFY']).then(response => {
......
......@@ -16,8 +16,13 @@
<!-- <div class="text">{{ item.classHour }}课时</div>-->
</div>
<div class="price">
<div v-if="item.lessonPrice>0" class="money"><span style="font-size:14px "></span>{{ item.lessonPrice }}</div>
<div v-else class="free">免费</div>
<div class="teacherRow">
<img class="teacherImg" :src="teacherImg">
<div>讲师:</div>
<div>{{ item.teacherName }}</div>
</div>
<!-- <div v-if="item.lessonPrice>0" class="money"><span style="font-size:14px "></span>{{ item.lessonPrice }}</div>-->
<!-- <div v-else class="free">免费</div>-->
</div>
</div>
</div>
......@@ -47,6 +52,7 @@ export default {
name: 'BrowsingHistory',
data() {
return {
teacherImg: require('@/assets/image/teacherImg.png'),
baseUrl: process.env.VUE_APP_BASE_API,
queryParams: {
userId: store.getters.businessId,
......@@ -185,6 +191,15 @@ export default {
}
.bottom{
padding: 16px;
.teacherRow{
display: flex;
align-items: center;
.teacherImg{
width: 16px;
height: 16px;
margin-right: 8px;
}
}
.price{
margin-top: 20px;
.money{
......
......@@ -17,7 +17,12 @@
<div class="text">{{ item.classHour }}课时</div>
</div>
<div class="price">
<div class="money"><span style="font-size:14px "></span>{{ item.lessonPrice }}</div>
<div class="teacherRow">
<img class="teacherImg" :src="teacherImg">
<div>讲师:</div>
<div>{{ item.teacherName }}</div>
</div>
<!-- <div class="money"><span style="font-size:14px "></span>{{ item.lessonPrice }}</div>-->
<div class="favoriteLogo" @click="cancelFavorite(item.businessId)"></div>
</div>
</div>
......@@ -53,6 +58,7 @@ export default {
name: 'MyFavoritePer',
data() {
return {
teacherImg: require('@/assets/image/teacherImg.png'),
baseUrl: process.env.VUE_APP_BASE_API,
isfree: true,
queryParams: {
......@@ -211,6 +217,15 @@ export default {
}
.bottom{
padding: 16px;
.teacherRow{
display: flex;
align-items: center;
.teacherImg{
width: 16px;
height: 16px;
margin-right: 8px;
}
}
.price{
display:flex;
justify-content: space-between;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment