Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tea_resources_pc
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张伯涛
tea_resources_pc
Commits
f56dd47f
Commit
f56dd47f
authored
Jul 23, 2024
by
张伯涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug修改
parent
ce7e8fbf
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
64 additions
and
29 deletions
+64
-29
App.vue
src/App.vue
+15
-3
getters.js
src/store/getters.js
+2
-1
app.js
src/store/modules/app.js
+8
-1
index.vue
src/views/courseResources/courseDetails/index.vue
+16
-4
index.vue
src/views/courseResources/courseMall/index.vue
+23
-20
No files found.
src/App.vue
View file @
f56dd47f
...
...
@@ -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
()
{
...
...
src/store/getters.js
View file @
f56dd47f
...
...
@@ -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
src/store/modules/app.js
View file @
f56dd47f
...
...
@@ -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
)
}
}
...
...
src/views/courseResources/courseDetails/index.vue
View file @
f56dd47f
...
...
@@ -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
:
32
px
auto
auto
;
margin
:
20
px
auto
auto
;
position
:
relative
;
.guoqiPathClass
{
width
:
52px
;
...
...
@@ -1313,7 +1325,7 @@ export default {
.lecturerCard
{
//cursor: pointer;
width
:
389px
;
height
:
256
px
;
height
:
325
px
;
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
;
/* 强制在任意字符处换行 */
...
...
src/views/courseResources/courseMall/index.vue
View file @
f56dd47f
...
...
@@ -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'
)
}
})
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment