Commit f56dd47f authored by 张伯涛's avatar 张伯涛

bug修改

parent ce7e8fbf
......@@ -7,6 +7,7 @@
<script>
import { handleLogout, openApiLoginApi } from '@/api/login'
import { getToken } from '@/utils/auth'
import { mapGetters } from 'vuex'
export default {
name: 'App',
data() {
......@@ -15,6 +16,9 @@ export default {
routerPath: ''
}
},
computed: {
...mapGetters(['scroll'])
},
// 监听,当路由发生变化的时候执行
watch: {
$route: {
......@@ -23,9 +27,6 @@ export default {
handler(val) {
this.routerPath = val.path
console.log('val', val)
// if (this.routerPath === '/courseResources/courseMall/index') {
// this.$refs.scrollContainer.scrollTop = 1400
// }
if (!getToken()) {
if (val.query.uc) {
const params = {
......@@ -45,6 +46,17 @@ export default {
},
// 深度观察监听
deep: true
},
scroll(newValue, oldValue) {
// 监听myVar变量的变化
console.log('scrollscrollscrollscrollscrollscroll scroll:', newValue)
if (newValue === '1') {
setTimeout(() => {
console.log('22222222222222222222222222222222222', this.$route)
window.scrollTo(0, 1000)
}, 1500)
}
// 这里可以执行一些操作,比如根据变化的值进行一些逻辑处理
}
},
mounted() {
......
......@@ -22,6 +22,7 @@ const getters = {
groups: state => state.props.groups,
businessId: state => state.user.businessId,
unitUser: state => state.props.unitUser,
topE: state => state.app.topE
topE: state => state.app.topE,
scroll: state => state.app.scroll
}
export default getters
......@@ -7,7 +7,8 @@ const state = {
},
device: 'desktop',
loadingCount: 0,
topE: null
topE: null,
scroll: null
}
const mutations = {
......@@ -33,6 +34,9 @@ const mutations = {
},
SET_TOP_E: (state, e) => {
state.topE = e
},
SCROLL: (state, e) => {
state.scroll = e
}
}
......@@ -51,6 +55,9 @@ const actions = {
},
setTopE({ commit }, e) {
commit('SET_TOP_E', e)
},
scroll({ commit }, e) {
commit('SCROLL', e)
}
}
......
......@@ -3,7 +3,11 @@
<div>
<nav-list :list="navList" :current-menu="'/courseResources/index'" />
<div v-loading="loading" class="courseDetails-content">
<el-button type="primary" @click="handleGoBack">返回</el-button>
<div class="backBtnFather">
<div class=backBtn>
<i class="el-icon-d-arrow-left" @click="handleGoBack">返回</i>
</div>
</div>
<div class="courseCard">
<img v-if="courseDetails.availableTrialTime === 0" class="guoqiPathClass" :src="guoqiPath" alt="">
<div class="coursePicture">
......@@ -829,6 +833,14 @@ export default {
width: 1920px;
margin: auto;
padding-top: 72px;
.backBtnFather{
margin: 20px auto auto;
width: 1200px;
.backBtn{
width: 55px;
cursor: pointer;
}
}
.lessonIsFavoriteClass{
margin-left: 6px;
}
......@@ -840,7 +852,7 @@ export default {
background: #ffffff;
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.05);
border-radius: 4px;
margin: 32px auto auto;
margin: 20px auto auto;
position: relative;
.guoqiPathClass{
width: 52px;
......@@ -1313,7 +1325,7 @@ export default {
.lecturerCard {
//cursor: pointer;
width: 389px;
height: 256px;
height: 325px;
background: #ffffff;
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.05);
border-radius: 4px;
......@@ -1372,7 +1384,7 @@ export default {
margin-top: 24px;
text-overflow: ellipsis;
display: -webkit-box; /* 适用于 WebKit 浏览器,如 Chrome 和 Safari */
-webkit-line-clamp: 5; /* 限制显示的行数,此处设置为 5 行 */
-webkit-line-clamp: 10; /* 限制显示的行数,此处设置为 5 行 */
-webkit-box-orient: vertical; /* 使内容按垂直方向排列 */
overflow: hidden; /* 隐藏超出部分 */
word-break: break-all; /* 强制在任意字符处换行 */
......
......@@ -167,9 +167,9 @@
fit="cover"
/>
</div>
<!-- <div v-if="course.lessonPrice !== 0" :class="'status status-' + (course.lessonIsPay === 1 ? 'purchased' : 'unPurchased')">-->
<!-- {{ course.lessonIsPay === 1 ? '已购' : '未购' }}-->
<!-- </div>-->
<!-- <div v-if="course.lessonPrice !== 0" :class="'status status-' + (course.lessonIsPay === 1 ? 'purchased' : 'unPurchased')">-->
<!-- {{ course.lessonIsPay === 1 ? '已购' : '未购' }}-->
<!-- </div>-->
</div>
<div class="card-bottom">
<div :title="course.lessonName" class="title">{{ course.lessonName }}</div>
......@@ -177,23 +177,23 @@
<div class="teacherRow">
<img class="teacherImg" :src="teacherImg">
<div>讲师:</div>
<div>{{course.teacherName}}</div>
<div>{{ course.teacherName }}</div>
</div>
<!-- <div :class="'price price-' + (course.lessonPrice ? 'charge' : 'free')">-->
<!-- {{-->
<!-- formatPrice(course.lessonPrice)-->
<!-- }}-->
<!-- </div>-->
<!-- <div class="follow">-->
<!-- <div class="icon">-->
<!-- <el-image-->
<!-- class="img"-->
<!-- :src="require('@/assets/image/people.png')"-->
<!-- fit="cover"-->
<!-- />-->
<!-- </div>-->
<!-- {{ formattedNumber(course.lessonViews) }}-->
<!-- </div>-->
<!-- <div :class="'price price-' + (course.lessonPrice ? 'charge' : 'free')">-->
<!-- {{-->
<!-- formatPrice(course.lessonPrice)-->
<!-- }}-->
<!-- </div>-->
<!-- <div class="follow">-->
<!-- <div class="icon">-->
<!-- <el-image-->
<!-- class="img"-->
<!-- :src="require('@/assets/image/people.png')"-->
<!-- fit="cover"-->
<!-- />-->
<!-- </div>-->
<!-- {{ formattedNumber(course.lessonViews) }}-->
<!-- </div>-->
</div>
</div>
</div>
......@@ -395,7 +395,7 @@ export default {
next()
},
created() {
console.log('createdcreatedcreatedcreatedcreatedcreated',this.queryParams)
console.log('createdcreatedcreatedcreatedcreatedcreated', this.queryParams)
this.getCoursePlanOptions() // 获取企业和院校的课程方案
this.handleToTop() // 一进入页面自动滚动到最顶部
this.mallIdentityType = this.$route.query.mallIdentityType || ''
......@@ -428,8 +428,11 @@ export default {
if (from.path === '/courseResources/courseDetails/index') {
setTimeout(() => {
vm.queryParams = JSON.parse(from.query.params)
vm.$store.dispatch('app/scroll', '1')
vm.getCourseByPagination()
}, 1000)
} else {
vm.$store.dispatch('app/scroll', '2')
}
})
},
......
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