Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
x-learn
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
x-learn
Commits
f63bcf66
提交
f63bcf66
authored
11月 03, 2020
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
整体调整
上级
9cfd4f3c
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
32 个修改的文件
包含
289 行增加
和
511 行删除
+289
-511
.config.pro.js
.config.pro.js
+1
-2
.config.test.js
.config.test.js
+1
-2
package-lock.json
package-lock.json
+3
-54
account.js
src/api/account.js
+9
-9
course.js
src/api/course.js
+10
-10
courseExam.js
src/api/courseExam.js
+5
-5
my.js
src/api/my.js
+8
-8
pay.js
src/api/pay.js
+3
-3
app.vue
src/app.vue
+1
-1
AppCard.vue
src/components/AppCard.vue
+0
-41
CountdownButton.vue
src/components/CountdownButton.vue
+0
-60
CourseChapter.vue
src/components/CourseChapter.vue
+21
-42
CourseList.vue
src/components/CourseList.vue
+3
-9
CourseListFreeItem.vue
src/components/CourseListFreeItem.vue
+0
-81
CourseListItem.vue
src/components/CourseListItem.vue
+27
-65
CourseTag.vue
src/components/CourseTag.vue
+88
-0
index.js
src/components/beforeEnter/index.js
+0
-5
aside.vue
src/components/layout/aside.vue
+10
-0
header.vue
src/components/layout/header.vue
+1
-0
main.js
src/main.js
+9
-9
exam_api.js
src/modules/exam-module/api/exam_api.js
+4
-2
api.js
src/pages/buy/api.js
+4
-4
api.js
src/pages/course/learn/api.js
+0
-0
index.vue
src/pages/course/learn/index.vue
+2
-22
item.vue
src/pages/course/learn/item.vue
+64
-56
api.js
src/pages/course/tag/api.js
+1
-1
layout.vue
src/pages/my/layout.vue
+0
-1
index.vue
src/pages/my/order/index.vue
+0
-10
api.js
src/pages/search/api.js
+4
-4
routes.js
src/router/routes.js
+0
-0
style.scss
src/style.scss
+7
-0
beforeEnter.js
src/utils/beforeEnter.js
+3
-5
没有找到文件。
.config.pro.js
浏览文件 @
f63bcf66
module
.
exports
=
{
url
:
'/
api
'
,
url
:
'/'
,
DesDir
:
'./client-dist'
,
apiBaseURL
:
'/api'
,
isUploadStatic
:
false
,
webpack
:
{
externals
:
{
...
...
.config.test.js
浏览文件 @
f63bcf66
module
.
exports
=
{
url
:
'
https://transport2.ezijing.com/api
'
,
url
:
'
/
'
,
DesDir
:
'./client-dist'
,
apiBaseURL
:
'https://transport2.ezijing.com/api'
,
isUploadStatic
:
false
,
webpack
:
{
externals
:
{
...
...
package-lock.json
浏览文件 @
f63bcf66
...
...
@@ -2603,6 +2603,7 @@
"version"
:
"7.10.2"
,
"resolved"
:
"https://registry.npmjs.org/@babel/runtime/-/runtime-7.10.2.tgz"
,
"integrity"
:
"sha512-6sF3uQw2ivImfVIl62RZ7MXhO2tap69WeWK57vAaimT6AZbE4FbqjdEJIN1UqoD6wI6B+1n9UiagafH1sxjOtg=="
,
"dev"
:
true
,
"requires"
:
{
"regenerator-runtime"
:
"^0.13.4"
},
...
...
@@ -2610,7 +2611,8 @@
"regenerator-runtime"
:
{
"version"
:
"0.13.5"
,
"resolved"
:
"https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz"
,
"integrity"
:
"sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA=="
"integrity"
:
"sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA=="
,
"dev"
:
true
}
}
},
...
...
@@ -2810,16 +2812,6 @@
}
}
},
"@vant/icons"
:
{
"version"
:
"1.2.5"
,
"resolved"
:
"https://registry.npm.taobao.org/@vant/icons/download/@vant/icons-1.2.5.tgz"
,
"integrity"
:
"sha1-89tDxLMAMAgp48TpCb6qM9HL54Y="
},
"@vue/babel-helper-vue-jsx-merge-props"
:
{
"version"
:
"1.0.0"
,
"resolved"
:
"https://registry.npm.taobao.org/@vue/babel-helper-vue-jsx-merge-props/download/@vue/babel-helper-vue-jsx-merge-props-1.0.0.tgz"
,
"integrity"
:
"sha1-BI/leZWNpAj7eosqPsBQtQpmEEA="
},
"@vue/component-compiler-utils"
:
{
"version"
:
"3.2.0"
,
"resolved"
:
"https://registry.npm.taobao.org/@vue/component-compiler-utils/download/@vue/component-compiler-utils-3.2.0.tgz?cache=0&sync_timestamp=1595427694165&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40vue%2Fcomponent-compiler-utils%2Fdownload%2F%40vue%2Fcomponent-compiler-utils-3.2.0.tgz"
,
...
...
@@ -5211,14 +5203,6 @@
"entities"
:
"^2.0.0"
}
},
"dom7"
:
{
"version"
:
"2.1.5"
,
"resolved"
:
"https://registry.npmjs.org/dom7/-/dom7-2.1.5.tgz"
,
"integrity"
:
"sha512-xnhwVgyOh3eD++/XGtH+5qBwYTgCm0aW91GFgPJ3XG+jlsRLyJivnbP0QmUBFhI+Oaz9FV0s7cxgXHezwOEBYA=="
,
"requires"
:
{
"ssr-window"
:
"^2.0.0"
}
},
"domain-browser"
:
{
"version"
:
"1.2.0"
,
"resolved"
:
"https://registry.npm.taobao.org/domain-browser/download/domain-browser-1.2.0.tgz?cache=0&sync_timestamp=1604239910191&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdomain-browser%2Fdownload%2Fdomain-browser-1.2.0.tgz"
,
...
...
@@ -11074,11 +11058,6 @@
"tweetnacl"
:
"~0.14.0"
}
},
"ssr-window"
:
{
"version"
:
"2.0.0"
,
"resolved"
:
"https://registry.npmjs.org/ssr-window/-/ssr-window-2.0.0.tgz"
,
"integrity"
:
"sha512-NXzN+/HPObKAx191H3zKlYomE5WrVIkoCB5IaSdvKokxTpjBdWfr0RaP+1Z5KOfDT0ZVz+2tdtiBkhsEQ9p+0A=="
},
"ssri"
:
{
"version"
:
"6.0.1"
,
"resolved"
:
"https://registry.npm.taobao.org/ssri/download/ssri-6.0.1.tgz"
,
...
...
@@ -11315,15 +11294,6 @@
"has-flag"
:
"^3.0.0"
}
},
"swiper"
:
{
"version"
:
"5.4.5"
,
"resolved"
:
"https://registry.npmjs.org/swiper/-/swiper-5.4.5.tgz"
,
"integrity"
:
"sha512-7QjA0XpdOmiMoClfaZ2lYN6ICHcMm72LXiY+NF4fQLFidigameaofvpjEEiTQuw3xm5eksG5hzkaRsjQX57vtA=="
,
"requires"
:
{
"dom7"
:
"^2.1.5"
,
"ssr-window"
:
"^2.0.0"
}
},
"table"
:
{
"version"
:
"5.4.6"
,
"resolved"
:
"https://registry.npmjs.org/table/-/table-5.4.6.tgz"
,
...
...
@@ -12040,17 +12010,6 @@
"spdx-expression-parse"
:
"^3.0.0"
}
},
"vant"
:
{
"version"
:
"2.10.3"
,
"resolved"
:
"https://registry.npm.taobao.org/vant/download/vant-2.10.3.tgz"
,
"integrity"
:
"sha1-+LejKpH17mgEVKwRW1vkaD/SA9E="
,
"requires"
:
{
"@babel/runtime"
:
"7.x"
,
"@vant/icons"
:
"1.2.5"
,
"@vue/babel-helper-vue-jsx-merge-props"
:
"^1.0.0"
,
"vue-lazyload"
:
"1.2.3"
}
},
"vary"
:
{
"version"
:
"1.1.2"
,
"resolved"
:
"https://registry.npmjs.org/vary/-/vary-1.1.2.tgz"
,
...
...
@@ -12099,11 +12058,6 @@
"resolved"
:
"https://registry.npm.taobao.org/vue/download/vue-2.6.12.tgz?cache=0&sync_timestamp=1598480719140&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue%2Fdownload%2Fvue-2.6.12.tgz"
,
"integrity"
:
"sha1-9evU+mvShpQD4pqJau1JBEVskSM="
},
"vue-awesome-swiper"
:
{
"version"
:
"4.1.1"
,
"resolved"
:
"https://registry.npmjs.org/vue-awesome-swiper/-/vue-awesome-swiper-4.1.1.tgz"
,
"integrity"
:
"sha512-50um10t6N+lJaORkpwSi1wWuMmBI1sgFc9Znsi5oUykw2cO5DzLaBHcO2JNX21R+Ue4TGoIJDhhxjBHtkFrTEQ=="
},
"vue-eslint-parser"
:
{
"version"
:
"7.1.0"
,
"resolved"
:
"https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-7.1.0.tgz"
,
...
...
@@ -12145,11 +12099,6 @@
"resolved"
:
"https://registry.npmjs.org/vue-i18n/-/vue-i18n-8.18.2.tgz"
,
"integrity"
:
"sha512-0X5nBTCZAVjlwcrPaYJwNs3iipBBTv0AUHwQUOa8yP3XbQGWKbRHqBb3OhCYtum/IHDD21d/df5Xd2VgyxbxfA=="
},
"vue-lazyload"
:
{
"version"
:
"1.2.3"
,
"resolved"
:
"https://registry.npm.taobao.org/vue-lazyload/download/vue-lazyload-1.2.3.tgz"
,
"integrity"
:
"sha1-kB+ewVx+bKeHgaK65KNDaGve2yw="
},
"vue-loader"
:
{
"version"
:
"15.9.3"
,
"resolved"
:
"https://registry.npm.taobao.org/vue-loader/download/vue-loader-15.9.3.tgz"
,
...
...
src/api/account.js
浏览文件 @
f63bcf66
...
...
@@ -2,37 +2,37 @@ import httpRequest from '@/utils/axios'
// 登录
export
function
login
(
data
)
{
return
httpRequest
.
post
(
'/passport/rest/login'
,
data
)
return
httpRequest
.
post
(
'/
api/
passport/rest/login'
,
data
)
}
// 绑定微信
export
function
bindWechat
(
data
)
{
return
httpRequest
.
post
(
'/passport/rest/wechat/bind-unionid'
,
data
)
return
httpRequest
.
post
(
'/
api/
passport/rest/wechat/bind-unionid'
,
data
)
}
// 重置密码
export
function
resetPassword
(
data
)
{
return
httpRequest
.
post
(
'/usercenter/user/update-pwd'
,
data
)
return
httpRequest
.
post
(
'/
api/
usercenter/user/update-pwd'
,
data
)
}
// 发送重置验证码
export
function
sendResetPasswordCode
(
data
)
{
return
httpRequest
.
post
(
'/usercenter/user/send-code'
,
data
)
return
httpRequest
.
post
(
'/
api/
usercenter/user/send-code'
,
data
)
}
// 登出
export
function
logout
()
{
return
httpRequest
.
get
(
'/passport/rest/logout'
)
return
httpRequest
.
get
(
'/
api/
passport/rest/logout'
)
}
// 获取用户信息
export
function
getUser
()
{
return
httpRequest
.
get
(
'/zy/user/getinfo'
)
return
httpRequest
.
get
(
'/
api/
zy/user/getinfo'
)
}
// 绑定游客
export
function
bindVisitor
(
data
)
{
return
httpRequest
.
post
(
'/zy/user/bind-account'
,
data
)
return
httpRequest
.
post
(
'/
api/
zy/user/bind-account'
,
data
)
}
// 获取是否VIP
export
function
getIsVip
()
{
return
httpRequest
.
get
(
'/zy/user/is-vip'
)
return
httpRequest
.
get
(
'/
api/
zy/user/is-vip'
)
}
// 创建游客用户
export
function
createGuestUser
()
{
return
httpRequest
.
get
(
'/zy/user/create-guest-user'
)
return
httpRequest
.
get
(
'/
api/
zy/user/create-guest-user'
)
}
src/api/course.js
浏览文件 @
f63bcf66
...
...
@@ -3,20 +3,20 @@ import httpRequest from '@/utils/axios'
* 获取免费课程列表
*/
export
function
getFreeCourseList
()
{
return
httpRequest
.
get
(
'/zy/v2/education/freecourse'
)
return
httpRequest
.
get
(
'/
api/
zy/v2/education/freecourse'
)
}
/**
* 获取课程列表
*/
export
function
getCourseModule
()
{
return
httpRequest
.
get
(
'/zy/v2/education/mokuai'
)
return
httpRequest
.
get
(
'/
api/
zy/v2/education/mokuai'
)
}
/**
* 获取课程列表
*/
export
function
getCourseList
()
{
return
httpRequest
.
get
(
'/zy/v2/education/courses/list'
)
return
httpRequest
.
get
(
'/
api/
zy/v2/education/courses/list'
)
}
/**
...
...
@@ -24,7 +24,7 @@ export function getCourseList() {
* @param {string} courseId 课程ID
*/
export
function
getCourse
(
courseId
)
{
return
httpRequest
.
get
(
`/zy/v2/education/courses/
${
courseId
}
`
)
return
httpRequest
.
get
(
`/
api/
zy/v2/education/courses/
${
courseId
}
`
)
}
/**
...
...
@@ -32,7 +32,7 @@ export function getCourse(courseId) {
* @param {string} courseId 课程ID
*/
export
function
getCourseTagList
(
courseId
)
{
return
httpRequest
.
get
(
`/zy/v2/education/tag/tree/
${
courseId
}
`
)
return
httpRequest
.
get
(
`/
api/
zy/v2/education/tag/tree/
${
courseId
}
`
)
}
/**
...
...
@@ -40,33 +40,33 @@ export function getCourseTagList(courseId) {
* @param {string} tagId 知识点ID
*/
export
function
getCourseTag
(
tagId
)
{
return
httpRequest
.
get
(
`/zy/v2/education/tag/
${
tagId
}
`
)
return
httpRequest
.
get
(
`/
api/
zy/v2/education/tag/
${
tagId
}
`
)
}
/**
* 获取搜索记录
*/
export
function
getSearchTips
()
{
return
httpRequest
.
get
(
'/zy/v2/education/search/tips'
)
return
httpRequest
.
get
(
'/
api/
zy/v2/education/search/tips'
)
}
/**
* 知识点搜索
*/
export
function
getSearchTagList
(
data
)
{
return
httpRequest
.
post
(
'/zy/v2/education/search/tag'
,
data
)
return
httpRequest
.
post
(
'/
api/
zy/v2/education/search/tag'
,
data
)
}
/**
* 视频课程搜索
*/
export
function
getSearchCourseVideoList
(
data
)
{
return
httpRequest
.
post
(
'/zy/v2/education/search/chapter1'
,
data
)
return
httpRequest
.
post
(
'/
api/
zy/v2/education/search/chapter1'
,
data
)
}
/**
* 课程搜索
*/
export
function
getSearchCourseList
(
data
)
{
return
httpRequest
.
post
(
'/zy/v2/education/search/chapter2'
,
data
)
return
httpRequest
.
post
(
'/
api/
zy/v2/education/search/chapter2'
,
data
)
}
src/api/courseExam.js
浏览文件 @
f63bcf66
...
...
@@ -4,31 +4,31 @@ import httpRequest from '@/utils/axios'
* 随堂测试课程章节列表
*/
export
function
getCourseChapterList
()
{
return
httpRequest
.
get
(
'/zy/v2/education/courses/my'
)
return
httpRequest
.
get
(
'/
api/
zy/v2/education/courses/my'
)
}
/* 模拟考试设置角色 */
export
function
setRole
(
data
)
{
return
httpRequest
.
post
(
'/zy/v2/examination/role'
,
data
,
{
return
httpRequest
.
post
(
'/
api/
zy/v2/examination/role'
,
data
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data'
}
})
}
/* 获取考试状态 */
export
function
getExamStatus
(
data
)
{
return
httpRequest
.
get
(
'/zy/v2/examination/examination-papers-status'
,
data
,
{
return
httpRequest
.
get
(
'/
api/
zy/v2/examination/examination-papers-status'
,
data
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data'
}
})
}
/* 知识点考题获取 */
export
function
getExam
(
data
)
{
return
httpRequest
.
get
(
'/zy/v2/examination/course-papers'
,
data
)
return
httpRequest
.
get
(
'/
api/
zy/v2/examination/course-papers'
,
data
)
}
/* 知识点考题缓存 */
export
function
cacheExam
(
data
)
{
return
httpRequest
.
post
(
'/zy/v2/examination/course-papers'
,
data
,
{
return
httpRequest
.
post
(
'/
api/
zy/v2/examination/course-papers'
,
data
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data'
}
})
}
src/api/my.js
浏览文件 @
f63bcf66
...
...
@@ -4,7 +4,7 @@ import httpRequest from '@/utils/axios'
* 获取我的已做试题
*/
export
function
getMyQuestion
(
data
)
{
return
httpRequest
.
get
(
'/zy/v2/examination/my-question'
,
data
,
{
return
httpRequest
.
get
(
'/
api/
zy/v2/examination/my-question'
,
data
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data'
}
})
}
...
...
@@ -13,47 +13,47 @@ export function getMyQuestion(data) {
* 获取我的试题详情
*/
export
function
getMyQuestionDetail
(
data
)
{
return
httpRequest
.
get
(
'/zy/v2/examination/question/detail'
,
data
)
return
httpRequest
.
get
(
'/
api/
zy/v2/examination/question/detail'
,
data
)
}
/**
* 获取我的所有试题
*/
export
function
getAllQuestion
(
data
)
{
return
httpRequest
.
get
(
'/zy/v2/examination/my-question-all'
,
data
)
return
httpRequest
.
get
(
'/
api/
zy/v2/examination/my-question-all'
,
data
)
}
/* 删除试题 */
export
function
deleteQuestion
(
data
)
{
return
httpRequest
.
post
(
'/zy/v2/examination/delete-my-question'
,
data
,
{
return
httpRequest
.
post
(
'/
api/
zy/v2/examination/delete-my-question'
,
data
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data'
}
})
}
/* 收藏试题 */
export
function
collectQuestion
(
data
)
{
return
httpRequest
.
post
(
'/zy/v2/examination/add-collection'
,
data
,
{
return
httpRequest
.
post
(
'/
api/
zy/v2/examination/add-collection'
,
data
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data'
}
})
}
/* 缓存试题 */
export
function
cacheQuestion
(
data
)
{
return
httpRequest
.
post
(
'/zy/v2/examination/cache-question'
,
data
,
{
return
httpRequest
.
post
(
'/
api/
zy/v2/examination/cache-question'
,
data
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data'
}
})
}
/* 意见反馈 */
export
function
submitFeedback
(
data
)
{
return
httpRequest
.
post
(
'/zy/v2/feedback/commit'
,
data
,
{
return
httpRequest
.
post
(
'/
api/
zy/v2/feedback/commit'
,
data
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data'
}
})
}
// /* 获取考试状态 */
// export function getExamStatus(data) {
// return httpRequest.get('/zy/v2/examination/examination-papers-status', data, {
// return httpRequest.get('/
api/
zy/v2/examination/examination-papers-status', data, {
// headers: { 'Content-Type': 'multipart/form-data' }
// })
// }
src/api/pay.js
浏览文件 @
f63bcf66
...
...
@@ -4,14 +4,14 @@ import httpRequest from '@/utils/axios'
* 获取商品详情
*/
export
function
getGoodsDetails
(
id
)
{
return
httpRequest
.
get
(
`/zy/v2/mall/product/
${
id
}
`
)
return
httpRequest
.
get
(
`/
api/
zy/v2/mall/product/
${
id
}
`
)
}
/**
* 获取我的购买订单
*/
export
function
getMyOrder
()
{
return
httpRequest
.
get
(
'/zy/v2/mall/order/my'
)
return
httpRequest
.
get
(
'/
api/
zy/v2/mall/order/my'
)
}
/* 获取openid */
...
...
@@ -21,5 +21,5 @@ export function getOpenid(data) {
/* 监听支付状态 */
export
function
getOrderStatus
()
{
return
httpRequest
.
get
(
'/zy/v2/mall/order/status'
)
return
httpRequest
.
get
(
'/
api/
zy/v2/mall/order/status'
)
}
src/app.vue
浏览文件 @
f63bcf66
<
template
>
<div
id=
"app"
>
<router-view
:key=
"$route.fullPath"
/>
<router-view
/>
</div>
</
template
>
src/components/AppCard.vue
deleted
100644 → 0
浏览文件 @
9cfd4f3c
<
template
>
<div
class=
"card"
>
<div
class=
"card-hd"
>
<h3
class=
"card-hd__title"
>
{{
title
}}
</h3>
<div
class=
"card-hd__aside"
>
<slot
name=
"aside"
></slot>
</div>
</div>
<div
class=
"card-bd"
>
<slot></slot>
</div>
</div>
</
template
>
<
script
>
export
default
{
name
:
'Card'
,
props
:
{
title
:
String
}
}
</
script
>
<
style
lang=
"scss"
>
.card-hd
{
display
:
flex
;
justify-content
:
space-between
;
}
.card-hd__title
{
margin
:
0
;
padding-bottom
:
0
.1rem
;
font-size
:
0
.3rem
;
font-weight
:
bold
;
line-height
:
1
;
color
:
#333
;
border-bottom
:
0
.06rem
solid
#c62245
;
}
.card-bd
{
padding
:
0
.2rem
0
;
}
</
style
>
src/components/CountdownButton.vue
deleted
100644 → 0
浏览文件 @
9cfd4f3c
<
template
>
<van-button
native-type=
"button"
:disabled=
"currentDisabled"
:loading=
"loading"
>
{{
curretnValue
}}
</van-button>
</
template
>
<
script
>
export
default
{
name
:
'CountdownButton'
,
props
:
{
step
:
{
type
:
Number
,
default
:
1000
},
disabled
:
{
type
:
Boolean
,
default
:
false
},
seconds
:
{
type
:
Number
,
default
:
60
},
defaultValue
:
{
type
:
String
,
default
:
'获取验证码'
}
},
data
()
{
return
{
currentDisabled
:
false
,
currentSeconds
:
0
,
loading
:
false
,
timer
:
null
}
},
computed
:
{
curretnValue
()
{
const
longTime
=
this
.
seconds
-
this
.
currentSeconds
return
longTime
<
this
.
seconds
?
`
${
longTime
}
秒后重发`
:
this
.
defaultValue
}
},
methods
:
{
genTimer
()
{
this
.
timer
&&
clearInterval
(
this
.
timer
)
this
.
timer
=
setInterval
(()
=>
{
this
.
currentSeconds
++
if
(
this
.
currentSeconds
===
this
.
seconds
)
{
this
.
stop
()
}
},
this
.
step
)
},
start
()
{
this
.
loading
=
false
this
.
currentDisabled
=
true
this
.
genTimer
()
},
stop
()
{
this
.
timer
&&
clearInterval
(
this
.
timer
)
this
.
currentSeconds
=
0
this
.
currentDisabled
=
false
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.van-button
{
height
:
40px
;
line-height
:
38px
;
}
.van-button--default
{
border-color
:
#ccc
;
}
</
style
>
src/components/CourseChapter.vue
浏览文件 @
f63bcf66
<
template
>
<van-collapse
v-model=
"activeNames"
>
<van-collapse-item
:title=
"item.name"
:name=
"item.id"
v-for=
"item in data"
:key=
"item.id"
>
<template
#
right-icon
>
<van-icon
name=
"arrow"
/>
<van-icon
name=
"arrow-down"
/>
</
template
>
<el-collapse
v-model=
"activeNames"
>
<el-collapse-item
:title=
"item.name"
:name=
"item.id"
v-for=
"item in data"
:key=
"item.id"
>
<ul>
<li
v-for=
"subItem in item.children"
:key=
"subItem.id"
@
click=
"$emit('on-click', subItem)"
>
<div
class=
"name"
>
{{subItem.name}}
<
template
v-if=
"subItem.free"
>
(免费)
</
template
>
</div>
<div
class=
"progress"
v-if=
"showProgress"
>
{{ progressText(subItem.video_progress, subItem.free) }}
</div>
<div
class=
"name"
>
{{
subItem
.
name
}}
</div>
<div
class=
"progress"
v-if=
"showProgress"
>
{{
progressText
(
subItem
.
video_progress
)
}}
</div>
</li>
</ul>
</
van
-collapse-item>
</
van
-collapse>
</
el
-collapse-item>
</
el
-collapse>
</
template
>
<
script
>
...
...
@@ -33,16 +23,11 @@ export default {
activeNames
:
[]
}
},
computed
:
{
isVip
()
{
return
this
.
$store
.
state
.
isVip
}
},
methods
:
{
progressText
(
value
,
isFree
)
{
progressText
(
value
)
{
value
=
parseInt
(
value
)
if
(
value
===
0
)
{
return
isFree
||
this
.
isVip
?
'未开始'
:
'未开通
'
return
'未开始
'
}
if
(
value
===
100
)
{
return
'已学完'
...
...
@@ -54,37 +39,31 @@ export default {
</
script
>
<
style
lang=
"scss"
scoped
>
::v-deep
.van-cell
{
padding-left
:
0
;
padding-right
:
0
;
.el-collapse
{
border
:
0
;
}
::v-deep
.van-collapse-item__content
{
padding
:
0
;
::v-deep
.el-collapse-item__header
{
font-size
:
14px
;
font-weight
:
600
;
color
:
#222
;
}
::v-deep
.van-collapse-item--border
::after
{
left
:
0
;
right
:
0
;
}
::v-deep
.van-collapse-item__title--expanded
::after
{
display
:
none
;
::v-deep
.el-collapse-item__content
{
padding-bottom
:
10px
;
}
li
{
display
:
flex
;
padding
:
10px
0
;
&
:first-child
{
padding-top
:
0
;
}
&
:last-child
{
padding-bottom
:
20px
;
padding
:
5px
0
;
cursor
:
pointer
;
color
:
#666
;
&
:hover
{
color
:
#c01540
;
}
.name
{
flex
:
1
;
font-size
:
13px
;
overflow
:
hidden
;
}
.progress
{
margin-left
:
20px
;
font-size
:
12px
;
color
:
#999
;
}
}
...
...
src/components/CourseList.vue
浏览文件 @
f63bcf66
<
template
>
<div
class=
"
list"
v-show=
"
loaded"
>
<div
class=
"
course-list"
v-loading=
"!
loaded"
>
<template
v-if=
"list.length"
>
<course-list-item
v-for=
"item in list"
:data=
"item"
:key=
"item.id"
v-bind=
"$attrs"
v-on=
"$listeners"
/>
<course-list-item
v-for=
"item in list"
:data=
"item"
:key=
"item.id"
v-bind=
"$attrs"
v-on=
"$listeners"
/>
</
template
>
<
template
v-else
>
<slot
name=
"empty"
>
<
van-empty
description=
"暂无内容"
/
>
<
p
class=
"empty-tips"
>
暂无内容
</p
>
</slot>
</
template
>
</div>
...
...
src/components/CourseListFreeItem.vue
deleted
100644 → 0
浏览文件 @
9cfd4f3c
<
template
>
<div
class=
"course-item"
@
click=
"onClick(data)"
>
<div
class=
"course-item-content"
>
<h3
class=
"course-item__title"
>
{{
data
.
course_name
}}
</h3>
<p
class=
"course-item__text"
v-if=
"data.describe"
>
{{
data
.
describe
}}
</p>
</div>
<div
class=
"course-item-pic"
v-if=
"data.picture"
>
<img
:src=
"data.picture"
/>
</div>
</div>
</
template
>
<
script
>
export
default
{
name
:
'CourseItem'
,
props
:
{
data
:
{
type
:
Object
,
required
:
true
}
},
computed
:
{
isWeapp
()
{
return
this
.
$store
.
state
.
isWeapp
}
},
methods
:
{
onClick
(
data
)
{
if
(
this
.
isWeapp
)
{
wx
.
miniProgram
.
navigateTo
({
url
:
`/pages/course/free?id=
${
data
.
course_id
}
`
})
}
else
{
window
.
alert
(
'请在微信小程序中打开'
)
}
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.course-item
{
display
:
flex
;
padding
:
0
.2rem
0
;
border-bottom
:
1px
solid
#f1f1f1
;
}
.course-item-content
{
flex
:
1
;
display
:
flex
;
flex-direction
:
column
;
justify-content
:
space-between
;
overflow
:
hidden
;
}
.course-item-pic
{
width
:
2
.4rem
;
height
:
1
.35rem
;
margin-left
:
10px
;
border-radius
:
6px
;
overflow
:
hidden
;
img
{
width
:
100%
;
height
:
100%
;
object-fit
:
cover
;
}
}
.course-item__title
{
margin
:
0
;
font-size
:
0
.3rem
;
font-weight
:
400
;
color
:
#222
;
display
:
-
webkit-box
;
-webkit-box-orient
:
vertical
;
-webkit-line-clamp
:
2
;
overflow
:
hidden
;
}
.course-item__text
{
font-size
:
0
.26rem
;
line-height
:
0
.42rem
;
color
:
#999
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
overflow
:
hidden
;
}
</
style
>
src/components/CourseListItem.vue
浏览文件 @
f63bcf66
<
template
>
<div
class=
"course-item custom-class"
:style=
"isOpen ? 'padding-bottom:0;' : ''"
>
<div
class=
"course-item-top"
@
click=
"toggleChild"
>
<div
class=
"course-arrow"
:class=
"isOpen ? 'course-arrow__up' : 'course-arrow__down'"
></div>
<div
class=
"course-item"
>
<div
class=
"course-item-top"
>
<img
class=
"course-item-pic"
:src=
"data.photo"
v-if=
"data.photo"
/>
<div
class=
"course-item-content"
>
<div
class=
"course-item__title"
>
{{
data
.
title
}}
</div>
<div
class=
"course-item__tools"
>
<div>
<div
class=
"course-item__text course-item__text__freevideo"
>
{{
data
.
free_video_num
}}
个免费视频
</div>
</div>
<div
class=
"course-item__text course-item__text__freevideo"
>
{{
data
.
free_video_num
}}
个免费视频
</div>
<div
class=
"course-item__text course-item__text__video"
>
{{
data
.
video_num
}}
节视频课
</div>
<div
class=
"course-item__text course-item__text__course"
>
含
{{
data
.
course_num
}}
节课
</div>
</div>
</div>
</div>
<div
class=
"course-item-bottom"
v-show=
"isOpen"
>
<div
class=
"course-child"
v-for=
"item in data.child"
:key=
"item.id"
@
click=
"
on
Click(item)"
>
<div
class=
"name"
>
{{
item
.
course_name
}}
</div>
<div
class=
"progress"
v-if=
"showProgress"
>
{{
item
.
video_progress
|
progressText
}}
</div>
<div
class=
"course-item-bottom"
>
<div
class=
"course-child"
v-for=
"item in data.child"
:key=
"item.id"
@
click=
"
handle
Click(item)"
>
<div
class=
"name"
>
{{
item
.
course_name
}}
</div>
<div
class=
"progress"
v-if=
"showProgress"
>
{{
item
.
video_progress
|
progressText
}}
</div>
</div>
</div>
</div>
...
...
@@ -33,9 +28,7 @@ export default {
showProgress
:
{
type
:
Boolean
,
default
:
false
}
},
data
()
{
return
{
isOpen
:
false
}
return
{}
},
filters
:
{
progressText
(
value
)
{
...
...
@@ -50,11 +43,8 @@ export default {
}
},
methods
:
{
toggleChild
()
{
this
.
isOpen
=
!
this
.
isOpen
},
onClick
(
data
)
{
this
.
$emit
(
'on-click'
,
data
)
handleClick
(
data
)
{
this
.
$router
.
push
({
name
:
'courseLearnItem'
,
params
:
{
id
:
data
.
id
}
})
}
}
}
...
...
@@ -62,31 +52,19 @@ export default {
<
style
lang=
"scss"
scoped
>
.course-item
{
padding
:
0
.3rem
0
;
border-bottom
:
1px
solid
#ccc
;
}
.course-arrow
{
width
:
0
.6rem
;
height
:
2rem
;
}
.course-arrow__up
{
background
:
url('https://zws-imgs-pub.ezijing.com/transport/weapp/icon_arrow_up.png')
no-repeat
left
center
;
background-size
:
0
.3rem
0
.3rem
;
}
.course-arrow__down
{
background
:
url('https://zws-imgs-pub.ezijing.com/transport/weapp/icon_arrow_down.png')
no-repeat
left
center
;
background-size
:
0
.3rem
0
.3rem
;
background
:
#ffffff
;
border-radius
:
8px
;
padding
:
30px
;
margin-bottom
:
20px
;
}
.course-item-top
{
display
:
flex
;
}
.course-item-bottom
{
padding-left
:
0
.6rem
;
}
.course-item-pic
{
width
:
3
.15rem
;
height
:
2rem
;
margin-right
:
0
.15rem
;
width
:
160px
;
height
:
90px
;
margin-right
:
20px
;
border-radius
:
2px
;
overflow
:
hidden
;
}
.course-item-content
{
...
...
@@ -97,8 +75,8 @@ export default {
overflow
:
hidden
;
}
.course-item__title
{
font-size
:
0
.26rem
;
color
:
#
666
;
font-size
:
18px
;
color
:
#
222
;
display
:
-
webkit-box
;
-webkit-box-orient
:
vertical
;
-webkit-line-clamp
:
2
;
...
...
@@ -106,43 +84,30 @@ export default {
}
.course-item__text
{
display
:
inline-block
;
height
:
0
.48rem
;
padding
:
0
0
.2rem
;
font-size
:
0
.24rem
;
line-height
:
0
.48rem
;
text-align
:
center
;
box-sizing
:
border-box
;
font-size
:
14px
;
}
.course-item__text
+
.course-item__text
{
margin-left
:
0
.1rem
;
}
.course-item__text__course
{
color
:
#fff
;
background-color
:
#75b0ff
;
color
:
#88bbff
;
}
.course-item__text__video
{
min-width
:
1
.8rem
;
color
:
#fff
;
background-color
:
#5ad0b2
;
color
:
#5ad0b2
;
}
.course-item__text__freevideo
{
min-width
:
1
.8rem
;
margin-bottom
:
0
.1rem
;
color
:
#fff
;
background-color
:
#d05a5a
;
color
:
#d05a5a
;
}
.course-child
{
display
:
flex
;
align-items
:
center
;
padding
:
15px
15px
15
px
0
;
padding
:
20
px
0
;
border-bottom
:
1px
solid
#eee
;
background
:
url('https://zws-imgs-pub.ezijing.com/transport/weapp/icon_arrow.png')
no-repeat
right
center
;
background-size
:
5px
10px
;
cursor
:
pointer
;
.name
{
flex
:
1
;
font-size
:
13px
;
color
:
#666
;
font-size
:
18px
;
}
.progress
{
margin-left
:
20px
;
...
...
@@ -150,7 +115,4 @@ export default {
color
:
#999
;
}
}
.course-child
:last-child
{
border-bottom
:
0
;
}
</
style
>
src/components/CourseTag.vue
0 → 100644
浏览文件 @
f63bcf66
<
template
>
<el-collapse
v-model=
"activeNames"
>
<el-collapse-item
:title=
"item.name"
:name=
"item.id"
v-for=
"item in data"
:key=
"item.id"
>
<template
#
right-icon
>
<van-icon
name=
"arrow"
/>
<van-icon
name=
"arrow-down"
/>
</
template
>
<ul>
<li
v-for=
"subItem in item.children"
:key=
"subItem.id"
@
click=
"$emit('on-click', subItem)"
>
<div
class=
"name"
>
{{ subItem.name }}
<
template
v-if=
"subItem.free"
>
(免费)
</
template
>
</div>
<div
class=
"progress"
v-if=
"showProgress"
>
{{ progressText(subItem.video_progress, subItem.free) }}
</div>
</li>
</ul>
</el-collapse-item>
</el-collapse>
</template>
<
script
>
export
default
{
props
:
{
courseId
:
{
type
:
String
},
data
:
{
type
:
Array
,
required
:
true
,
default
:
()
=>
[]
},
showProgress
:
{
type
:
Boolean
,
default
:
false
}
},
data
()
{
return
{
activeNames
:
[]
}
},
computed
:
{
isVip
()
{
return
this
.
$store
.
state
.
isVip
}
},
methods
:
{
progressText
(
value
,
isFree
)
{
value
=
parseInt
(
value
)
if
(
value
===
0
)
{
return
isFree
||
this
.
isVip
?
'未开始'
:
'未开通'
}
if
(
value
===
100
)
{
return
'已学完'
}
return
`已学
${
value
}
%`
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
::v-deep
.van-cell
{
padding-left
:
0
;
padding-right
:
0
;
}
::v-deep
.el-collapse-item__content
{
padding
:
0
;
}
::v-deep
.el-collapse-item--border
::after
{
left
:
0
;
right
:
0
;
}
::v-deep
.el-collapse-item__title--expanded
::after
{
display
:
none
;
}
li
{
display
:
flex
;
padding
:
10px
0
;
&
:first-child
{
padding-top
:
0
;
}
&
:last-child
{
padding-bottom
:
20px
;
}
.name
{
flex
:
1
;
font-size
:
13px
;
overflow
:
hidden
;
}
.progress
{
margin-left
:
20px
;
font-size
:
12px
;
color
:
#999
;
}
}
</
style
>
src/components/beforeEnter/index.js
deleted
100644 → 0
浏览文件 @
9cfd4f3c
import
Before
from
'./Before'
export
default
()
=>
{
return
new
Before
()
}
src/components/layout/aside.vue
浏览文件 @
f63bcf66
...
...
@@ -72,6 +72,9 @@ export default {
flex-direction
:
column
;
align-items
:
center
;
padding-top
:
20px
;
&
:hover
{
background-color
:
#fff4f7
;
}
}
.user-avatar
{
width
:
60px
;
...
...
@@ -79,6 +82,11 @@ export default {
background-color
:
#999
;
border-radius
:
50%
;
overflow
:
hidden
;
img
{
width
:
100%
;
height
:
100%
;
object-fit
:
contain
;
}
}
.user-tools
{
padding
:
10px
0
;
...
...
@@ -94,11 +102,13 @@ export default {
li
{
text-align
:
center
;
font-size
:
16px
;
font-weight
:
600
;
color
:
#666
;
a
{
display
:
block
;
padding
:
16px
0
;
}
&
:hover
,
&
.is-active
{
color
:
#c01540
;
background-color
:
#fff4f7
;
...
...
src/components/layout/header.vue
浏览文件 @
f63bcf66
...
...
@@ -33,6 +33,7 @@ export default {
.title
{
font-size
:
24px
;
font-weight
:
600
;
color
:
#222
;
}
...
...
src/main.js
浏览文件 @
f63bcf66
import
Vue
from
'vue'
// 引入vue框架
import
router
from
'./router'
// router定义
import
Vue
from
'vue'
import
router
from
'./router'
import
store
from
'./store'
import
App
from
'./app.vue'
// 初始化 vue页面
import
'./style.scss'
// 公共样式
// import createBefore from './components/beforeEnter'
import
App
from
'./app.vue'
import
ElementUI
from
'element-ui'
import
'element-ui/lib/theme-chalk/index.css'
import
'./style.scss'
import
BeforeEnter
from
'./utils/beforeEnter'
const
before
=
new
BeforeEnter
()
Vue
.
use
(
ElementUI
)
/* 创建实例之前,通过导航守卫,处理部分逻辑,如:是否直接进入系统 */
// const before = createBefore()
/* 导航守卫 */
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
//
before.update(to, from, next)
before
.
update
(
to
,
from
,
next
)
next
()
})
...
...
src/modules/exam-module/api/exam_api.js
浏览文件 @
f63bcf66
...
...
@@ -3,6 +3,8 @@ export default class Exam extends BaseAPI {
getExam
=
(
obj
,
url
)
=>
this
.
get
(
url
,
obj
)
getPower
=
(
obj
,
url
)
=>
this
.
post
(
url
,
obj
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data'
}
})
examSubmit
=
(
obj
,
url
)
=>
this
.
post
(
url
,
obj
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data'
}
})
deleteCollect
=
(
obj
)
=>
this
.
post
(
'/zy/v2/examination/delete-my-question'
,
obj
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data'
}
})
collectQuestion
=
(
obj
)
=>
this
.
post
(
'/zy/v2/examination/add-collection'
,
obj
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data'
}
})
deleteCollect
=
obj
=>
this
.
post
(
'/api/zy/v2/examination/delete-my-question'
,
obj
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data'
}
})
collectQuestion
=
obj
=>
this
.
post
(
'/api/zy/v2/examination/add-collection'
,
obj
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data'
}
})
}
src/pages/buy/api.js
浏览文件 @
f63bcf66
...
...
@@ -11,14 +11,14 @@ export function getOpenId(params) {
* 获取商品
*/
export
function
getProduct
(
productId
)
{
return
httpRequest
.
get
(
`/zy/v2/mall/product/
${
productId
}
`
)
return
httpRequest
.
get
(
`/
api/
zy/v2/mall/product/
${
productId
}
`
)
}
/**
* 生成订单
*/
export
function
genOrder
(
data
)
{
return
httpRequest
.
post
(
'/zy/v2/mall/order/pre'
,
data
,
{
return
httpRequest
.
post
(
'/
api/
zy/v2/mall/order/pre'
,
data
,
{
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
}
})
}
...
...
@@ -27,12 +27,12 @@ export function genOrder(data) {
* 获取订单
*/
export
function
getOrder
(
orderId
)
{
return
httpRequest
.
get
(
`/zy/v2/mall/order/
${
orderId
}
`
)
return
httpRequest
.
get
(
`/
api/
zy/v2/mall/order/
${
orderId
}
`
)
}
/**
* 获取订单状态
*/
export
function
getOrderStatus
()
{
return
httpRequest
.
get
(
'/zy/v2/mall/order/status'
)
return
httpRequest
.
get
(
'/
api/
zy/v2/mall/order/status'
)
}
src/pages/course/learn/api.js
deleted
100644 → 0
浏览文件 @
9cfd4f3c
src/pages/course/learn/index.vue
浏览文件 @
f63bcf66
<
template
>
<div
class=
"main-container"
style=
"margin:0 0.15rem"
>
<course-list
@
on-click=
"handleClick"
/>
</div>
<course-list
/>
</
template
>
<
script
>
...
...
@@ -9,24 +7,6 @@ import CourseList from '@/components/CourseList.vue'
export
default
{
name
:
'CourseLearn'
,
components
:
{
CourseList
},
metaInfo
:
{
title
:
'考证课程'
},
computed
:
{
isWeapp
()
{
return
this
.
$store
.
state
.
isWeapp
}
},
methods
:
{
handleClick
(
data
)
{
if
(
this
.
isWeapp
)
{
const
url
=
`/pages/web/index?src=
${
window
.
location
.
origin
}
/course/learn/
${
data
.
id
}
`
wx
.
miniProgram
.
navigateTo
({
url
})
}
else
{
this
.
$router
.
push
({
name
:
'courseLearnItem'
,
params
:
{
id
:
data
.
id
}
})
}
}
}
components
:
{
CourseList
}
}
</
script
>
src/pages/course/learn/item.vue
浏览文件 @
f63bcf66
<
template
>
<div
class=
"main-container"
v-if=
"loaded"
>
<div
class=
"course-title"
>
{{
detail
.
course_name
}}
</div>
<van-tabs
class=
"main-tabs"
v-model=
"tabActive"
color=
"#c62245"
:line-width=
"80"
:line-height=
"2"
:border=
"true"
:swipeable=
"true"
>
<van-tab
title=
"按章节学习"
>
<template
v-if=
"detail.chapters && detail.chapters.length"
>
<course-chapter
:courseId=
"courseId"
:data=
"detail.chapters"
@
on-click=
"handleClick"
></course-chapter>
</
template
>
<van-empty
description=
"暂无内容"
v-else
/>
</van-tab>
<van-tab
title=
"按考点学习"
>
<div
class=
"tab-content"
>
<course-tag
:courseId=
"courseId"
></course-tag>
</div>
</van-tab>
</van-tabs>
<div
class=
"main-container"
v-loading=
"!loaded"
>
<div
class=
"course-top"
v-if=
"detail.curriculum"
>
<div
class=
"course-top-hd"
>
<div
class=
"course-top__title"
>
{{
detail
.
curriculum
.
curriculum_name
}}
</div>
</div>
<div
class=
"course-top-bd"
>
<div
class=
"course-top__pic"
><img
:src=
"detail.curriculum.curriculum_picture"
/></div>
<div
class=
"course-top__content"
v-html=
"detail.curriculum.curriculum_represent"
></div>
</div>
</div>
<el-tabs
v-model=
"tabActive"
>
<el-tab-pane
label=
"按章节学习"
>
<course-chapter
:courseId=
"courseId"
:data=
"detail.chapters"
@
on-click=
"handleClick"
></course-chapter>
</el-tab-pane>
<el-tab-pane
label=
"按考点学习"
>
<course-tag
:courseId=
"courseId"
></course-tag>
</el-tab-pane>
</el-tabs>
</div>
</
template
>
...
...
@@ -47,36 +42,22 @@ export default {
computed
:
{
courseId
()
{
return
this
.
$route
.
params
.
id
},
isWeapp
()
{
return
this
.
$store
.
state
.
isWeapp
},
isVip
()
{
return
this
.
$store
.
state
.
isVip
}
},
methods
:
{
// 课程学习
getCourse
()
{
this
.
loaded
=
false
api
.
getCourse
(
this
.
courseId
).
then
(
response
=>
{
this
.
loaded
=
true
response
.
chapters
=
response
.
chapters
.
filter
(
item
=>
{
item
.
children
=
item
.
children
.
filter
(
child
=>
child
.
type
===
2
&&
child
.
resource_id
&&
child
.
resource_id
!==
'6684350363920760832'
)
return
item
.
children
.
length
api
.
getCourse
(
this
.
courseId
)
.
then
(
response
=>
{
this
.
detail
=
response
})
.
finally
(()
=>
{
this
.
loaded
=
true
})
this
.
detail
=
response
})
},
handleClick
(
data
)
{
if
(
this
.
isWeapp
)
{
wx
.
miniProgram
.
navigateTo
({
url
:
`/pages/course/item?id=
${
this
.
courseId
}
&chapter_id=
${
data
.
id
}
`
})
}
else
{
window
.
alert
(
'请在微信小程序中打开'
)
}
}
handleClick
(
data
)
{}
},
beforeMount
()
{
this
.
getCourse
()
...
...
@@ -85,17 +66,44 @@ export default {
</
script
>
<
style
lang=
"scss"
scoped
>
.course-title
{
font-size
:
15px
;
font-weight
:
600
;
color
:
#222
;
padding
:
20px
0
10px
;
.main-container
{
height
:
100%
;
padding
:
30px
;
background-color
:
#fff
;
border-radius
:
8px
;
box-sizing
:
border-box
;
}
.course-top
{
padding-bottom
:
20px
;
}
.course-top-hd
{
padding-bottom
:
8px
;
margin-bottom
:
10px
;
border-bottom
:
1px
solid
#ccc
;
}
.course-top__title
{
font-size
:
18px
;
font-weight
:
bold
;
line-height
:
1
;
}
.course-top-bd
{
display
:
flex
;
}
.course-top__pic
{
width
:
160px
;
height
:
90px
;
margin-right
:
20px
;
border-radius
:
2px
;
overflow
:
hidden
;
img
{
width
:
100%
;
height
:
100%
;
object-fit
:
cover
;
}
}
.tab-content
{
margin-left
:
-0
.4rem
;
margin-right
:
-0
.4rem
;
min-height
:
100vh
;
background
:
#eee
;
padding
:
0
.4rem
;
.course-top__content
{
flex
:
1
;
line-height
:
24px
;
overflow
:
hidden
;
}
</
style
>
src/pages/course/tag/api.js
浏览文件 @
f63bcf66
...
...
@@ -6,5 +6,5 @@ const httpRequest = new BaseAPI(webConf)
* 获取课程列表
*/
export
function
getCourseList
()
{
return
httpRequest
.
get
(
'/zy/v2/education/mokuai'
)
return
httpRequest
.
get
(
'/
api/
zy/v2/education/mokuai'
)
}
src/pages/my/layout.vue
浏览文件 @
f63bcf66
...
...
@@ -10,7 +10,6 @@ export default {
data
()
{
return
{
navList
:
[
{
title
:
'我的已购课程'
,
path
:
'/my/order'
},
{
title
:
'我的已学课程'
,
path
:
'/my/course'
},
{
title
:
'我的已做试题'
,
path
:
'/my/test'
}
]
...
...
src/pages/my/order/index.vue
deleted
100644 → 0
浏览文件 @
9cfd4f3c
<
template
>
<app-container>
</app-container>
</
template
>
<
script
>
import
AppContainer
from
'@/components/AppContainer'
export
default
{
components
:
{
AppContainer
}
}
</
script
>
src/pages/search/api.js
浏览文件 @
f63bcf66
...
...
@@ -4,26 +4,26 @@ import httpRequest from '@/utils/axios'
* 获取搜索记录
*/
export
function
getSearchTips
()
{
return
httpRequest
.
get
(
'/zy/v2/education/search/tips'
)
return
httpRequest
.
get
(
'/
api/
zy/v2/education/search/tips'
)
}
/**
* 知识点搜索
*/
export
function
getSearchTagList
(
data
)
{
return
httpRequest
.
post
(
'/zy/v2/education/search/tag'
,
data
)
return
httpRequest
.
post
(
'/
api/
zy/v2/education/search/tag'
,
data
)
}
/**
* 视频课程搜索
*/
export
function
getSearchCourseVideoList
(
data
)
{
return
httpRequest
.
post
(
'/zy/v2/education/search/chapter1'
,
data
)
return
httpRequest
.
post
(
'/
api/
zy/v2/education/search/chapter1'
,
data
)
}
/**
* 课程搜索
*/
export
function
getSearchCourseList
(
data
)
{
return
httpRequest
.
post
(
'/zy/v2/education/search/chapter2'
,
data
)
return
httpRequest
.
post
(
'/
api/
zy/v2/education/search/chapter2'
,
data
)
}
src/router/routes.js
浏览文件 @
f63bcf66
差异被折叠。
点击展开。
src/style.scss
浏览文件 @
f63bcf66
...
...
@@ -89,3 +89,10 @@ body {
'Hiragino Sans GB'
,
'Wenquanyi Micro Hei'
,
sans-serif
;
background-color
:
#f9f9f9
;
}
.empty-tips
{
padding
:
120px
;
text-align
:
center
;
font-size
:
18px
;
color
:
#999
;
}
src/
components/beforeEnter/Before
.js
→
src/
utils/beforeEnter
.js
浏览文件 @
f63bcf66
import
store
from
'@/store'
export
default
class
Before
{
export
default
class
BeforeEnter
{
constructor
(
opt
)
{
this
.
opt
=
opt
||
{}
}
...
...
@@ -14,12 +15,9 @@ export default class Before {
// await store.dispatch('createGuestUser')
const
isLogin
=
store
.
state
.
isLogin
||
(
await
store
.
dispatch
(
'checkLogin'
))
isLogin
&&
wx
.
miniProgram
.
postMessage
({
data
:
{
token
:
store
.
state
.
token
}
})
if
(
to
.
meta
.
requiredLogin
&&
!
isLogin
)
{
store
.
state
.
isWeapp
?
wx
.
miniProgram
.
redirectTo
({
url
:
'/pages/login/index'
})
:
next
(
`/login?redirect_uri=
${
encodeURIComponent
(
window
.
location
.
href
)}
`
)
next
(
`/login?redirect_uri=
${
encodeURIComponent
(
window
.
location
.
href
)}
`
)
return
}
next
()
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论