Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
transport-show-h5
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
transport-show-h5
Commits
598ad6ef
提交
598ad6ef
authored
9月 04, 2020
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bug fixes
上级
d0a345bd
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
46 行增加
和
24 行删除
+46
-24
CourseChapter.vue
src/components/CourseChapter.vue
+6
-3
CourseList.vue
src/components/CourseList.vue
+5
-1
login.vue
src/pages/login/login.vue
+13
-10
index.vue
src/pages/my/learn/index.vue
+10
-1
courseList.vue
src/pages/search/components/courseList.vue
+4
-4
videoList.vue
src/pages/search/components/videoList.vue
+4
-4
index.vue
src/pages/search/index.vue
+4
-1
没有找到文件。
src/components/CourseChapter.vue
浏览文件 @
598ad6ef
...
@@ -11,7 +11,10 @@
...
@@ -11,7 +11,10 @@
{{subItem.name}}
{{subItem.name}}
<
template
v-if=
"subItem.free"
>
(免费)
</
template
>
<
template
v-if=
"subItem.free"
>
(免费)
</
template
>
</div>
</div>
<div
class=
"progress"
v-if=
"showProgress"
>
{{ progressText(subItem.video_progress) }}
</div>
<div
class=
"progress"
v-if=
"showProgress"
>
{{ progressText(subItem.video_progress, subItem.free) }}
</div>
</li>
</li>
</ul>
</ul>
</van-collapse-item>
</van-collapse-item>
...
@@ -36,10 +39,10 @@ export default {
...
@@ -36,10 +39,10 @@ export default {
}
}
},
},
methods
:
{
methods
:
{
progressText
(
value
)
{
progressText
(
value
,
isFree
)
{
value
=
parseInt
(
value
)
value
=
parseInt
(
value
)
if
(
value
===
0
)
{
if
(
value
===
0
)
{
return
this
.
isVip
?
'未开始'
:
'未开通'
return
isFree
||
this
.
isVip
?
'未开始'
:
'未开通'
}
}
if
(
value
===
100
)
{
if
(
value
===
100
)
{
return
'已学完'
return
'已学完'
...
...
src/components/CourseList.vue
浏览文件 @
598ad6ef
...
@@ -24,6 +24,9 @@ import CourseListItem from './CourseListItem.vue'
...
@@ -24,6 +24,9 @@ import CourseListItem from './CourseListItem.vue'
export
default
{
export
default
{
name
:
'CourseList'
,
name
:
'CourseList'
,
components
:
{
CourseListItem
},
components
:
{
CourseListItem
},
props
:
{
requestCallback
:
Function
},
data
()
{
data
()
{
return
{
return
{
loaded
:
false
,
loaded
:
false
,
...
@@ -35,7 +38,8 @@ export default {
...
@@ -35,7 +38,8 @@ export default {
api
api
.
getCourseModule
()
.
getCourseModule
()
.
then
(
response
=>
{
.
then
(
response
=>
{
this
.
list
=
response
this
.
list
=
this
.
requestCallback
?
this
.
requestCallback
(
response
)
:
response
this
.
$emit
(
'request-success'
,
response
)
})
})
.
finally
(()
=>
{
.
finally
(()
=>
{
this
.
loaded
=
true
this
.
loaded
=
true
...
...
src/pages/login/login.vue
浏览文件 @
598ad6ef
...
@@ -139,16 +139,19 @@ export default {
...
@@ -139,16 +139,19 @@ export default {
domain
:
'.ezijing.com'
domain
:
'.ezijing.com'
})
})
this
.
$store
.
commit
(
'setToken'
,
response
.
data
.
TGC
)
this
.
$store
.
commit
(
'setToken'
,
response
.
data
.
TGC
)
if
(
this
.
isWeapp
)
{
// 延迟1秒,要看提示语
wx
.
miniProgram
.
postMessage
({
data
:
{
token
:
response
.
data
.
TGC
}
})
setTimeout
(()
=>
{
wx
.
miniProgram
.
navigateBack
()
if
(
this
.
isWeapp
)
{
return
wx
.
miniProgram
.
postMessage
({
data
:
{
token
:
response
.
data
.
TGC
}
})
}
wx
.
miniProgram
.
navigateBack
()
if
(
this
.
redirectURI
)
{
return
window
.
location
.
href
=
this
.
redirectURI
}
}
else
{
if
(
this
.
redirectURI
)
{
this
.
$router
.
replace
(
'/'
)
window
.
location
.
href
=
this
.
redirectURI
}
}
else
{
this
.
$router
.
replace
(
'/'
)
}
},
1000
)
}
else
{
}
else
{
this
.
$toast
(
response
.
msg
)
this
.
$toast
(
response
.
msg
)
}
}
...
...
src/pages/my/learn/index.vue
浏览文件 @
598ad6ef
<
template
>
<
template
>
<div
class=
"main-container"
style=
"margin:0 0.15rem"
>
<div
class=
"main-container"
style=
"margin:0 0.15rem"
>
<course-list
:show-progress=
"true"
@
on-click=
"handleClick"
>
<course-list
:show-progress=
"true"
:requestCallback=
"requestCallback"
@
on-click=
"handleClick"
>
<template
#
empty
>
<template
#
empty
>
<van-empty
description=
"您还没有学习课程,快快开始学习吧!"
/>
<van-empty
description=
"您还没有学习课程,快快开始学习吧!"
/>
</
template
>
</
template
>
...
@@ -26,6 +26,15 @@ export default {
...
@@ -26,6 +26,15 @@ export default {
}
}
},
},
methods
:
{
methods
:
{
requestCallback
(
response
)
{
// 扁平数据
const
flattenList
=
response
.
reduce
((
result
,
item
)
=>
{
return
result
.
concat
(
item
.
child
)
},
[])
// 查找有没有进度,没有进度返回空数组
const
found
=
flattenList
.
find
(
item
=>
item
.
video_progress
)
return
found
?
response
:
[]
},
handleClick
(
data
)
{
handleClick
(
data
)
{
if
(
this
.
isWeapp
)
{
if
(
this
.
isWeapp
)
{
const
url
=
`/pages/web/index?src=
${
window
.
location
.
origin
}
/my/learn/
${
data
.
id
}
`
const
url
=
`/pages/web/index?src=
${
window
.
location
.
origin
}
/my/learn/
${
data
.
id
}
`
...
...
src/pages/search/components/courseList.vue
浏览文件 @
598ad6ef
...
@@ -57,10 +57,10 @@ export default {
...
@@ -57,10 +57,10 @@ export default {
},
},
onClick
(
data
)
{
onClick
(
data
)
{
if
(
this
.
isWeapp
)
{
if
(
this
.
isWeapp
)
{
const
url
=
data
.
free
//
const url = data.free
?
`/pages/course/free?id=
${
data
.
id
}
`
//
? `/pages/course/free?id=${data.id}`
:
`/pages/web/index?src=
${
window
.
location
.
origin
}
/course/learn/
${
data
.
id
}
`
//
: `/pages/web/index?src=${window.location.origin}/course/learn/${data.id}`
wx
.
miniProgram
.
navigateTo
({
url
})
wx
.
miniProgram
.
navigateTo
({
url
:
`/pages/web/index?src=
${
window
.
location
.
origin
}
/course/learn/
${
data
.
id
}
`
})
}
else
{
}
else
{
this
.
$router
.
push
({
name
:
'courseLearnItem'
,
params
:
{
id
:
data
.
id
}
})
this
.
$router
.
push
({
name
:
'courseLearnItem'
,
params
:
{
id
:
data
.
id
}
})
}
}
...
...
src/pages/search/components/videoList.vue
浏览文件 @
598ad6ef
...
@@ -69,10 +69,10 @@ export default {
...
@@ -69,10 +69,10 @@ export default {
},
},
onClick
(
data
)
{
onClick
(
data
)
{
if
(
this
.
isWeapp
)
{
if
(
this
.
isWeapp
)
{
const
url
=
data
.
free
//
const url = data.free
?
`/pages/course/free?id=
${
data
.
course_id
}
&chapter_id=
${
data
.
id
}
`
//
? `/pages/course/free?id=${data.course_id}&chapter_id=${data.id}`
:
`/pages/course/item?id=
${
data
.
course_id
}
&chapter_id=
${
data
.
id
}
`
//
: `/pages/course/item?id=${data.course_id}&chapter_id=${data.id}`
wx
.
miniProgram
.
navigateTo
({
url
})
wx
.
miniProgram
.
navigateTo
({
url
:
`/pages/course/item?id=
${
data
.
course_id
}
&chapter_id=
${
data
.
id
}
`
})
}
else
{
}
else
{
window
.
alert
(
'请在微信小程序中打开'
)
window
.
alert
(
'请在微信小程序中打开'
)
}
}
...
...
src/pages/search/index.vue
浏览文件 @
598ad6ef
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<div
class=
"main-container"
>
<div
class=
"main-container"
>
<app-search-bar
v-model=
"searchValue"
@
search=
"onSearch"
/>
<app-search-bar
v-model=
"searchValue"
@
search=
"onSearch"
/>
<div
class=
"search-tips"
v-if=
"!searchValue"
>
<div
class=
"search-tips"
v-if=
"!searchValue"
>
<div
class=
"search-tips-item"
v-if=
"historyList.length"
>
<div
class=
"search-tips-item"
v-if=
"historyList.length
&& isLogin
"
>
<h3
class=
"search-tips__title"
>
搜索历史
</h3>
<h3
class=
"search-tips__title"
>
搜索历史
</h3>
<ul
class=
"search-tips__list"
>
<ul
class=
"search-tips__list"
>
<li
<li
...
@@ -82,6 +82,9 @@ export default {
...
@@ -82,6 +82,9 @@ export default {
}
}
},
},
computed
:
{
computed
:
{
isLogin
()
{
return
this
.
$store
.
state
.
isLogin
},
// 搜索发现
// 搜索发现
featureList
()
{
featureList
()
{
// 最多显示10条
// 最多显示10条
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论