Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
transport-show-h5
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
transport-show-h5
Commits
4c9f707b
提交
4c9f707b
authored
8月 06, 2020
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bug fixes
上级
9f017995
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
83 行增加
和
16 行删除
+83
-16
buyCourseList.vue
src/pages/my/learn/components/buyCourseList.vue
+1
-1
index.vue
src/pages/my/learn/index.vue
+37
-1
index.js
src/store/index.js
+10
-11
style.scss
src/style.scss
+35
-3
没有找到文件。
src/pages/my/learn/components/buyCourseList.vue
浏览文件 @
4c9f707b
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<div
class=
"progress"
>
{{
item
.
video_progress
|
progressText
}}
</div>
<div
class=
"progress"
>
{{
item
.
video_progress
|
progressText
}}
</div>
</li>
</li>
</ul>
</ul>
<van-empty
description=
"
暂无内容
"
v-else
/>
<van-empty
description=
"
您还没有学习课程,快快开始学习吧!
"
v-else
/>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
...
...
src/pages/my/learn/index.vue
浏览文件 @
4c9f707b
...
@@ -3,7 +3,23 @@
...
@@ -3,7 +3,23 @@
<div
class=
"learn-choose"
>
<div
class=
"learn-choose"
>
<van-cell
title=
"选择已学课程:"
:value=
"selectedItem.name"
is-link
@
click=
"popupVisible = true"
/>
<van-cell
title=
"选择已学课程:"
:value=
"selectedItem.name"
is-link
@
click=
"popupVisible = true"
/>
</div>
</div>
<buy-course-list
v-if=
"selectedItem.type === 1"
/>
<!-- 已学课程 -->
<template
v-if=
"selectedItem.type === 1"
>
<buy-course-list
v-if=
"isVip"
/>
<template
v-else
>
<van-empty
image=
"https://zws-imgs-pub.ezijing.com/transport/weapp/empty.png"
description=
"快去开启课程学习,一起加油考证吧!"
class=
"custom-empty"
/>
<div
class=
"fixed-box"
>
<div
class=
"fixed-inner"
>
<div
class=
"fixed-button"
@
click=
"toCourse"
>
学更多课程
</div>
</div>
</div>
</
template
>
</template>
<!-- 试题课程 -->
<free-course-list
v-else
/>
<free-course-list
v-else
/>
<van-popup
<van-popup
v-model=
"popupVisible"
v-model=
"popupVisible"
...
@@ -44,6 +60,14 @@ export default {
...
@@ -44,6 +60,14 @@ export default {
selectedItem
:
{
type
:
1
,
name
:
'课程学习'
}
selectedItem
:
{
type
:
1
,
name
:
'课程学习'
}
}
}
},
},
computed
:
{
isWeapp
()
{
return
this
.
$store
.
state
.
isWeapp
},
isVip
()
{
return
this
.
$store
.
state
.
isVip
}
},
methods
:
{
methods
:
{
popupOpen
()
{
popupOpen
()
{
this
.
changeSelected
(
this
.
selectedItem
)
this
.
changeSelected
(
this
.
selectedItem
)
...
@@ -59,8 +83,20 @@ export default {
...
@@ -59,8 +83,20 @@ export default {
const
found
=
this
.
chooseList
.
find
(
item
=>
item
.
selected
)
const
found
=
this
.
chooseList
.
find
(
item
=>
item
.
selected
)
this
.
selectedItem
=
found
this
.
selectedItem
=
found
this
.
popupVisible
=
false
this
.
popupVisible
=
false
},
toCourse
(
data
)
{
if
(
this
.
isWeapp
)
{
const
url
=
`/pages/web/index?src=
${
window
.
location
.
origin
}
/course/learn`
wx
.
miniProgram
.
navigateTo
({
url
})
}
else
{
this
.
$router
.
push
({
name
:
'courseLearn'
})
}
}
}
}
},
beforeMount
()
{
// 检测是否是付费用户
this
.
$store
.
dispatch
(
'checkIsVip'
)
}
}
}
</
script
>
</
script
>
...
...
src/store/index.js
浏览文件 @
4c9f707b
...
@@ -6,11 +6,11 @@ import { getUser, logout, getIsVip } from '@/api/account'
...
@@ -6,11 +6,11 @@ import { getUser, logout, getIsVip } from '@/api/account'
Vue
.
use
(
Vuex
)
Vue
.
use
(
Vuex
)
export
default
new
Vuex
.
Store
({
export
default
new
Vuex
.
Store
({
state
:
{
state
:
{
isWeapp
:
/miniProgram/
.
test
(
navigator
.
userAgent
),
isLogin
:
false
,
token
:
''
,
user
:
{},
user
:
{},
isVip
:
false
token
:
''
,
isVip
:
false
,
isLogin
:
false
,
isWeapp
:
/miniProgram/
.
test
(
navigator
.
userAgent
)
},
},
mutations
:
{
mutations
:
{
setToken
(
state
,
token
)
{
setToken
(
state
,
token
)
{
...
@@ -62,14 +62,13 @@ export default new Vuex.Store({
...
@@ -62,14 +62,13 @@ export default new Vuex.Store({
return
response
return
response
})
})
},
},
async
checkIsVip
({
commit
})
{
async
checkIsVip
({
commit
,
state
})
{
if
(
state
.
isVip
)
{
return
state
.
isVip
}
const
isVip
=
await
getIsVip
()
const
isVip
=
await
getIsVip
()
.
then
(
response
=>
{
.
then
(
response
=>
response
.
is_vip
)
return
response
.
is_vip
.
catch
(()
=>
false
)
})
.
catch
(()
=>
{
return
false
})
commit
(
'setIsVip'
,
isVip
)
commit
(
'setIsVip'
,
isVip
)
return
isVip
return
isVip
}
}
...
...
src/style.scss
浏览文件 @
4c9f707b
...
@@ -85,9 +85,8 @@ body {
...
@@ -85,9 +85,8 @@ body {
font-size
:
14px
;
font-size
:
14px
;
line-height
:
1
.4
;
line-height
:
1
.4
;
color
:
#222
;
color
:
#222
;
font-family
:
'PingFang SC'
,
'Source Han Sans CN'
,
-
apple-system
,
font-family
:
'PingFang SC'
,
'Source Han Sans CN'
,
-
apple-system
,
'Microsoft YaHei'
,
'Helvetica'
,
'Arial'
,
Verdana
,
'Microsoft YaHei'
,
'Helvetica'
,
'Arial'
,
Verdana
,
'Hiragino Sans GB'
,
'Hiragino Sans GB'
,
'Wenquanyi Micro Hei'
,
sans-serif
;
'Wenquanyi Micro Hei'
,
sans-serif
;
background-color
:
#f7f7f7
;
background-color
:
#f7f7f7
;
}
}
.main-container
{
.main-container
{
...
@@ -138,3 +137,36 @@ body {
...
@@ -138,3 +137,36 @@ body {
.van-swipe
.van-swipe__indicators
{
.van-swipe
.van-swipe__indicators
{
bottom
:
5px
;
bottom
:
5px
;
}
}
.fixed-box
{
height
:
55px
;
box-sizing
:
content-box
;
padding-bottom
:
env
(
safe-area-inset-bottom
);
}
.fixed-inner
{
position
:
fixed
;
left
:
0
;
right
:
0
;
bottom
:
0
;
max-width
:
750px
;
margin
:
0
auto
;
padding-bottom
:
env
(
safe-area-inset-bottom
);
}
.fixed-button
{
margin
:
10px
20px
;
height
:
35px
;
font-size
:
15px
;
line-height
:
35px
;
text-align
:
center
;
color
:
#fff
;
background
:
#c62245
;
border-radius
:
6px
;
}
.custom-empty
.van-empty__image
{
width
:
250px
;
height
:
205px
;
}
.custom-empty
.van-empty__description
{
padding
:
0
20px
;
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论