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

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

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