提交 f63bcf66 authored 作者: 王鹏飞's avatar 王鹏飞

整体调整

上级 9cfd4f3c
module.exports = { module.exports = {
url: '/api', url: '/',
DesDir: './client-dist', DesDir: './client-dist',
apiBaseURL: '/api',
isUploadStatic: false, isUploadStatic: false,
webpack: { webpack: {
externals: { externals: {
......
module.exports = { module.exports = {
url: 'https://transport2.ezijing.com/api', url: '/',
DesDir: './client-dist', DesDir: './client-dist',
apiBaseURL: 'https://transport2.ezijing.com/api',
isUploadStatic: false, isUploadStatic: false,
webpack: { webpack: {
externals: { externals: {
......
...@@ -2603,6 +2603,7 @@ ...@@ -2603,6 +2603,7 @@
"version": "7.10.2", "version": "7.10.2",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.10.2.tgz", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.10.2.tgz",
"integrity": "sha512-6sF3uQw2ivImfVIl62RZ7MXhO2tap69WeWK57vAaimT6AZbE4FbqjdEJIN1UqoD6wI6B+1n9UiagafH1sxjOtg==", "integrity": "sha512-6sF3uQw2ivImfVIl62RZ7MXhO2tap69WeWK57vAaimT6AZbE4FbqjdEJIN1UqoD6wI6B+1n9UiagafH1sxjOtg==",
"dev": true,
"requires": { "requires": {
"regenerator-runtime": "^0.13.4" "regenerator-runtime": "^0.13.4"
}, },
...@@ -2610,7 +2611,8 @@ ...@@ -2610,7 +2611,8 @@
"regenerator-runtime": { "regenerator-runtime": {
"version": "0.13.5", "version": "0.13.5",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz", "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 @@ ...@@ -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": { "@vue/component-compiler-utils": {
"version": "3.2.0", "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", "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 @@ ...@@ -5211,14 +5203,6 @@
"entities": "^2.0.0" "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": { "domain-browser": {
"version": "1.2.0", "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", "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 @@ ...@@ -11074,11 +11058,6 @@
"tweetnacl": "~0.14.0" "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": { "ssri": {
"version": "6.0.1", "version": "6.0.1",
"resolved": "https://registry.npm.taobao.org/ssri/download/ssri-6.0.1.tgz", "resolved": "https://registry.npm.taobao.org/ssri/download/ssri-6.0.1.tgz",
...@@ -11315,15 +11294,6 @@ ...@@ -11315,15 +11294,6 @@
"has-flag": "^3.0.0" "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": { "table": {
"version": "5.4.6", "version": "5.4.6",
"resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz",
...@@ -12040,17 +12010,6 @@ ...@@ -12040,17 +12010,6 @@
"spdx-expression-parse": "^3.0.0" "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": { "vary": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
...@@ -12099,11 +12058,6 @@ ...@@ -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", "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=" "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": { "vue-eslint-parser": {
"version": "7.1.0", "version": "7.1.0",
"resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-7.1.0.tgz", "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-7.1.0.tgz",
...@@ -12145,11 +12099,6 @@ ...@@ -12145,11 +12099,6 @@
"resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-8.18.2.tgz", "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-8.18.2.tgz",
"integrity": "sha512-0X5nBTCZAVjlwcrPaYJwNs3iipBBTv0AUHwQUOa8yP3XbQGWKbRHqBb3OhCYtum/IHDD21d/df5Xd2VgyxbxfA==" "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": { "vue-loader": {
"version": "15.9.3", "version": "15.9.3",
"resolved": "https://registry.npm.taobao.org/vue-loader/download/vue-loader-15.9.3.tgz", "resolved": "https://registry.npm.taobao.org/vue-loader/download/vue-loader-15.9.3.tgz",
......
...@@ -2,37 +2,37 @@ import httpRequest from '@/utils/axios' ...@@ -2,37 +2,37 @@ import httpRequest from '@/utils/axios'
// 登录 // 登录
export function login(data) { export function login(data) {
return httpRequest.post('/passport/rest/login', data) return httpRequest.post('/api/passport/rest/login', data)
} }
// 绑定微信 // 绑定微信
export function bindWechat(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) { 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) { export function sendResetPasswordCode(data) {
return httpRequest.post('/usercenter/user/send-code', data) return httpRequest.post('/api/usercenter/user/send-code', data)
} }
// 登出 // 登出
export function logout() { export function logout() {
return httpRequest.get('/passport/rest/logout') return httpRequest.get('/api/passport/rest/logout')
} }
// 获取用户信息 // 获取用户信息
export function getUser() { export function getUser() {
return httpRequest.get('/zy/user/getinfo') return httpRequest.get('/api/zy/user/getinfo')
} }
// 绑定游客 // 绑定游客
export function bindVisitor(data) { export function bindVisitor(data) {
return httpRequest.post('/zy/user/bind-account', data) return httpRequest.post('/api/zy/user/bind-account', data)
} }
// 获取是否VIP // 获取是否VIP
export function getIsVip() { export function getIsVip() {
return httpRequest.get('/zy/user/is-vip') return httpRequest.get('/api/zy/user/is-vip')
} }
// 创建游客用户 // 创建游客用户
export function createGuestUser() { export function createGuestUser() {
return httpRequest.get('/zy/user/create-guest-user') return httpRequest.get('/api/zy/user/create-guest-user')
} }
...@@ -3,20 +3,20 @@ import httpRequest from '@/utils/axios' ...@@ -3,20 +3,20 @@ import httpRequest from '@/utils/axios'
* 获取免费课程列表 * 获取免费课程列表
*/ */
export function getFreeCourseList() { export function getFreeCourseList() {
return httpRequest.get('/zy/v2/education/freecourse') return httpRequest.get('/api/zy/v2/education/freecourse')
} }
/** /**
* 获取课程列表 * 获取课程列表
*/ */
export function getCourseModule() { export function getCourseModule() {
return httpRequest.get('/zy/v2/education/mokuai') return httpRequest.get('/api/zy/v2/education/mokuai')
} }
/** /**
* 获取课程列表 * 获取课程列表
*/ */
export function getCourseList() { 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() { ...@@ -24,7 +24,7 @@ export function getCourseList() {
* @param {string} courseId 课程ID * @param {string} courseId 课程ID
*/ */
export function getCourse(courseId) { 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) { ...@@ -32,7 +32,7 @@ export function getCourse(courseId) {
* @param {string} courseId 课程ID * @param {string} courseId 课程ID
*/ */
export function getCourseTagList(courseId) { 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) { ...@@ -40,33 +40,33 @@ export function getCourseTagList(courseId) {
* @param {string} tagId 知识点ID * @param {string} tagId 知识点ID
*/ */
export function getCourseTag(tagId) { export function getCourseTag(tagId) {
return httpRequest.get(`/zy/v2/education/tag/${tagId}`) return httpRequest.get(`/api/zy/v2/education/tag/${tagId}`)
} }
/** /**
* 获取搜索记录 * 获取搜索记录
*/ */
export function getSearchTips() { export function getSearchTips() {
return httpRequest.get('/zy/v2/education/search/tips') return httpRequest.get('/api/zy/v2/education/search/tips')
} }
/** /**
* 知识点搜索 * 知识点搜索
*/ */
export function getSearchTagList(data) { 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) { 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) { export function getSearchCourseList(data) {
return httpRequest.post('/zy/v2/education/search/chapter2', data) return httpRequest.post('/api/zy/v2/education/search/chapter2', data)
} }
...@@ -4,31 +4,31 @@ import httpRequest from '@/utils/axios' ...@@ -4,31 +4,31 @@ import httpRequest from '@/utils/axios'
* 随堂测试课程章节列表 * 随堂测试课程章节列表
*/ */
export function getCourseChapterList() { export function getCourseChapterList() {
return httpRequest.get('/zy/v2/education/courses/my') return httpRequest.get('/api/zy/v2/education/courses/my')
} }
/* 模拟考试设置角色 */ /* 模拟考试设置角色 */
export function setRole(data) { 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' } headers: { 'Content-Type': 'multipart/form-data' }
}) })
} }
/* 获取考试状态 */ /* 获取考试状态 */
export function getExamStatus(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' } headers: { 'Content-Type': 'multipart/form-data' }
}) })
} }
/* 知识点考题获取 */ /* 知识点考题获取 */
export function getExam(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) { 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' } headers: { 'Content-Type': 'multipart/form-data' }
}) })
} }
...@@ -4,7 +4,7 @@ import httpRequest from '@/utils/axios' ...@@ -4,7 +4,7 @@ import httpRequest from '@/utils/axios'
* 获取我的已做试题 * 获取我的已做试题
*/ */
export function getMyQuestion(data) { 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' } headers: { 'Content-Type': 'multipart/form-data' }
}) })
} }
...@@ -13,47 +13,47 @@ export function getMyQuestion(data) { ...@@ -13,47 +13,47 @@ export function getMyQuestion(data) {
* 获取我的试题详情 * 获取我的试题详情
*/ */
export function getMyQuestionDetail(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) { 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) { 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' } headers: { 'Content-Type': 'multipart/form-data' }
}) })
} }
/* 收藏试题 */ /* 收藏试题 */
export function collectQuestion(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' } headers: { 'Content-Type': 'multipart/form-data' }
}) })
} }
/* 缓存试题 */ /* 缓存试题 */
export function cacheQuestion(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' } headers: { 'Content-Type': 'multipart/form-data' }
}) })
} }
/* 意见反馈 */ /* 意见反馈 */
export function submitFeedback(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' } headers: { 'Content-Type': 'multipart/form-data' }
}) })
} }
// /* 获取考试状态 */ // /* 获取考试状态 */
// export function getExamStatus(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' } // headers: { 'Content-Type': 'multipart/form-data' }
// }) // })
// } // }
...@@ -4,14 +4,14 @@ import httpRequest from '@/utils/axios' ...@@ -4,14 +4,14 @@ import httpRequest from '@/utils/axios'
* 获取商品详情 * 获取商品详情
*/ */
export function getGoodsDetails(id) { export function getGoodsDetails(id) {
return httpRequest.get(`/zy/v2/mall/product/${id}`) return httpRequest.get(`/api/zy/v2/mall/product/${id}`)
} }
/** /**
* 获取我的购买订单 * 获取我的购买订单
*/ */
export function getMyOrder() { export function getMyOrder() {
return httpRequest.get('/zy/v2/mall/order/my') return httpRequest.get('/api/zy/v2/mall/order/my')
} }
/* 获取openid */ /* 获取openid */
...@@ -21,5 +21,5 @@ export function getOpenid(data) { ...@@ -21,5 +21,5 @@ export function getOpenid(data) {
/* 监听支付状态 */ /* 监听支付状态 */
export function getOrderStatus() { export function getOrderStatus() {
return httpRequest.get('/zy/v2/mall/order/status') return httpRequest.get('/api/zy/v2/mall/order/status')
} }
<template> <template>
<div id="app"> <div id="app">
<router-view :key="$route.fullPath" /> <router-view />
</div> </div>
</template> </template>
<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>
<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>
<template> <template>
<van-collapse v-model="activeNames"> <el-collapse v-model="activeNames">
<van-collapse-item :title="item.name" :name="item.id" v-for="item in data" :key="item.id"> <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> <ul>
<li v-for="subItem in item.children" :key="subItem.id" @click="$emit('on-click', subItem)"> <li v-for="subItem in item.children" :key="subItem.id" @click="$emit('on-click', subItem)">
<div class="name"> <div class="name">{{ subItem.name }}</div>
{{subItem.name}} <div class="progress" v-if="showProgress">{{ progressText(subItem.video_progress) }}</div>
<template v-if="subItem.free">(免费)</template>
</div>
<div
class="progress"
v-if="showProgress"
>{{ progressText(subItem.video_progress, subItem.free) }}</div>
</li> </li>
</ul> </ul>
</van-collapse-item> </el-collapse-item>
</van-collapse> </el-collapse>
</template> </template>
<script> <script>
...@@ -33,16 +23,11 @@ export default { ...@@ -33,16 +23,11 @@ export default {
activeNames: [] activeNames: []
} }
}, },
computed: {
isVip() {
return this.$store.state.isVip
}
},
methods: { methods: {
progressText(value, isFree) { progressText(value) {
value = parseInt(value) value = parseInt(value)
if (value === 0) { if (value === 0) {
return isFree || this.isVip ? '未开始' : '未开通' return '未开始'
} }
if (value === 100) { if (value === 100) {
return '已学完' return '已学完'
...@@ -54,37 +39,31 @@ export default { ...@@ -54,37 +39,31 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep .van-cell { .el-collapse {
padding-left: 0; border: 0;
padding-right: 0;
} }
::v-deep .van-collapse-item__content { ::v-deep .el-collapse-item__header {
padding: 0; font-size: 14px;
font-weight: 600;
color: #222;
} }
::v-deep .van-collapse-item--border::after { ::v-deep .el-collapse-item__content {
left: 0; padding-bottom: 10px;
right: 0;
}
::v-deep .van-collapse-item__title--expanded::after {
display: none;
} }
li { li {
display: flex; display: flex;
padding: 10px 0; padding: 5px 0;
&:first-child { cursor: pointer;
padding-top: 0; color: #666;
} &:hover {
&:last-child { color: #c01540;
padding-bottom: 20px;
} }
.name { .name {
flex: 1; flex: 1;
font-size: 13px;
overflow: hidden; overflow: hidden;
} }
.progress { .progress {
margin-left: 20px; margin-left: 20px;
font-size: 12px;
color: #999; color: #999;
} }
} }
......
<template> <template>
<div class="list" v-show="loaded"> <div class="course-list" v-loading="!loaded">
<template v-if="list.length"> <template v-if="list.length">
<course-list-item <course-list-item v-for="item in list" :data="item" :key="item.id" v-bind="$attrs" v-on="$listeners" />
v-for="item in list"
:data="item"
:key="item.id"
v-bind="$attrs"
v-on="$listeners"
/>
</template> </template>
<template v-else> <template v-else>
<slot name="empty"> <slot name="empty">
<van-empty description="暂无内容" /> <p class="empty-tips">暂无内容</p>
</slot> </slot>
</template> </template>
</div> </div>
......
<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>
<template> <template>
<div class="course-item custom-class" :style="isOpen ? 'padding-bottom:0;' : ''"> <div class="course-item">
<div class="course-item-top" @click="toggleChild"> <div class="course-item-top">
<div class="course-arrow" :class="isOpen ? 'course-arrow__up' : 'course-arrow__down'"></div>
<img class="course-item-pic" :src="data.photo" v-if="data.photo" /> <img class="course-item-pic" :src="data.photo" v-if="data.photo" />
<div class="course-item-content"> <div class="course-item-content">
<div class="course-item__title">{{ data.title }}</div> <div class="course-item__title">{{ data.title }}</div>
<div class="course-item__tools"> <div class="course-item__tools">
<div> <div class="course-item__text course-item__text__freevideo">{{ data.free_video_num }}个免费视频</div>
<div
class="course-item__text course-item__text__freevideo"
>{{ data.free_video_num }}个免费视频</div>
</div>
<div class="course-item__text course-item__text__video">{{ data.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 class="course-item__text course-item__text__course">{{ data.course_num }}节课</div>
</div> </div>
</div> </div>
</div> </div>
<div class="course-item-bottom" v-show="isOpen"> <div class="course-item-bottom">
<div class="course-child" v-for="item in data.child" :key="item.id" @click="onClick(item)"> <div class="course-child" v-for="item in data.child" :key="item.id" @click="handleClick(item)">
<div class="name">{{item.course_name}}</div> <div class="name">{{ item.course_name }}</div>
<div class="progress" v-if="showProgress">{{item.video_progress | progressText}}</div> <div class="progress" v-if="showProgress">{{ item.video_progress | progressText }}</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -33,9 +28,7 @@ export default { ...@@ -33,9 +28,7 @@ export default {
showProgress: { type: Boolean, default: false } showProgress: { type: Boolean, default: false }
}, },
data() { data() {
return { return {}
isOpen: false
}
}, },
filters: { filters: {
progressText(value) { progressText(value) {
...@@ -50,11 +43,8 @@ export default { ...@@ -50,11 +43,8 @@ export default {
} }
}, },
methods: { methods: {
toggleChild() { handleClick(data) {
this.isOpen = !this.isOpen this.$router.push({ name: 'courseLearnItem', params: { id: data.id } })
},
onClick(data) {
this.$emit('on-click', data)
} }
} }
} }
...@@ -62,31 +52,19 @@ export default { ...@@ -62,31 +52,19 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.course-item { .course-item {
padding: 0.3rem 0; background: #ffffff;
border-bottom: 1px solid #ccc; border-radius: 8px;
} padding: 30px;
.course-arrow { margin-bottom: 20px;
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;
} }
.course-item-top { .course-item-top {
display: flex; display: flex;
} }
.course-item-bottom {
padding-left: 0.6rem;
}
.course-item-pic { .course-item-pic {
width: 3.15rem; width: 160px;
height: 2rem; height: 90px;
margin-right: 0.15rem; margin-right: 20px;
border-radius: 2px;
overflow: hidden; overflow: hidden;
} }
.course-item-content { .course-item-content {
...@@ -97,8 +75,8 @@ export default { ...@@ -97,8 +75,8 @@ export default {
overflow: hidden; overflow: hidden;
} }
.course-item__title { .course-item__title {
font-size: 0.26rem; font-size: 18px;
color: #666; color: #222;
display: -webkit-box; display: -webkit-box;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
...@@ -106,43 +84,30 @@ export default { ...@@ -106,43 +84,30 @@ export default {
} }
.course-item__text { .course-item__text {
display: inline-block; display: inline-block;
height: 0.48rem; font-size: 14px;
padding: 0 0.2rem;
font-size: 0.24rem;
line-height: 0.48rem;
text-align: center;
box-sizing: border-box;
} }
.course-item__text + .course-item__text { .course-item__text + .course-item__text {
margin-left: 0.1rem; margin-left: 0.1rem;
} }
.course-item__text__course { .course-item__text__course {
color: #fff; color: #88bbff;
background-color: #75b0ff;
} }
.course-item__text__video { .course-item__text__video {
min-width: 1.8rem; color: #5ad0b2;
color: #fff;
background-color: #5ad0b2;
} }
.course-item__text__freevideo { .course-item__text__freevideo {
min-width: 1.8rem; color: #d05a5a;
margin-bottom: 0.1rem;
color: #fff;
background-color: #d05a5a;
} }
.course-child { .course-child {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 15px 15px 15px 0; padding: 20px 0;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
background: url('https://zws-imgs-pub.ezijing.com/transport/weapp/icon_arrow.png') no-repeat right center; cursor: pointer;
background-size: 5px 10px;
.name { .name {
flex: 1; flex: 1;
font-size: 13px; font-size: 18px;
color: #666;
} }
.progress { .progress {
margin-left: 20px; margin-left: 20px;
...@@ -150,7 +115,4 @@ export default { ...@@ -150,7 +115,4 @@ export default {
color: #999; color: #999;
} }
} }
.course-child:last-child {
border-bottom: 0;
}
</style> </style>
<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>
import Before from './Before'
export default () => {
return new Before()
}
...@@ -72,6 +72,9 @@ export default { ...@@ -72,6 +72,9 @@ export default {
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
padding-top: 20px; padding-top: 20px;
&:hover {
background-color: #fff4f7;
}
} }
.user-avatar { .user-avatar {
width: 60px; width: 60px;
...@@ -79,6 +82,11 @@ export default { ...@@ -79,6 +82,11 @@ export default {
background-color: #999; background-color: #999;
border-radius: 50%; border-radius: 50%;
overflow: hidden; overflow: hidden;
img {
width: 100%;
height: 100%;
object-fit: contain;
}
} }
.user-tools { .user-tools {
padding: 10px 0; padding: 10px 0;
...@@ -94,11 +102,13 @@ export default { ...@@ -94,11 +102,13 @@ export default {
li { li {
text-align: center; text-align: center;
font-size: 16px; font-size: 16px;
font-weight: 600;
color: #666; color: #666;
a { a {
display: block; display: block;
padding: 16px 0; padding: 16px 0;
} }
&:hover,
&.is-active { &.is-active {
color: #c01540; color: #c01540;
background-color: #fff4f7; background-color: #fff4f7;
......
...@@ -33,6 +33,7 @@ export default { ...@@ -33,6 +33,7 @@ export default {
.title { .title {
font-size: 24px; font-size: 24px;
font-weight: 600;
color: #222; color: #222;
} }
......
import Vue from 'vue' // 引入vue框架 import Vue from 'vue'
import router from './router' // router定义 import router from './router'
import store from './store' import store from './store'
import App from './app.vue' // 初始化 vue页面 import App from './app.vue'
import './style.scss' // 公共样式
// import createBefore from './components/beforeEnter'
import ElementUI from 'element-ui' import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css' import 'element-ui/lib/theme-chalk/index.css'
import './style.scss'
import BeforeEnter from './utils/beforeEnter'
const before = new BeforeEnter()
Vue.use(ElementUI) Vue.use(ElementUI)
/* 创建实例之前,通过导航守卫,处理部分逻辑,如:是否直接进入系统 */
// const before = createBefore()
/* 导航守卫 */ /* 导航守卫 */
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
// before.update(to, from, next) before.update(to, from, next)
next() next()
}) })
......
...@@ -3,6 +3,8 @@ export default class Exam extends BaseAPI { ...@@ -3,6 +3,8 @@ export default class Exam extends BaseAPI {
getExam = (obj, url) => this.get(url, obj) getExam = (obj, url) => this.get(url, obj)
getPower = (obj, url) => this.post(url, obj, { headers: { 'Content-Type': 'multipart/form-data' } }) 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' } }) 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' } }) deleteCollect = obj =>
collectQuestion = (obj) => this.post('/zy/v2/examination/add-collection', obj, { headers: { 'Content-Type': 'multipart/form-data' } }) 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' } })
} }
...@@ -11,14 +11,14 @@ export function getOpenId(params) { ...@@ -11,14 +11,14 @@ export function getOpenId(params) {
* 获取商品 * 获取商品
*/ */
export function getProduct(productId) { 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) { 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' } headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
}) })
} }
...@@ -27,12 +27,12 @@ export function genOrder(data) { ...@@ -27,12 +27,12 @@ export function genOrder(data) {
* 获取订单 * 获取订单
*/ */
export function getOrder(orderId) { export function getOrder(orderId) {
return httpRequest.get(`/zy/v2/mall/order/${orderId}`) return httpRequest.get(`/api/zy/v2/mall/order/${orderId}`)
} }
/** /**
* 获取订单状态 * 获取订单状态
*/ */
export function getOrderStatus() { export function getOrderStatus() {
return httpRequest.get('/zy/v2/mall/order/status') return httpRequest.get('/api/zy/v2/mall/order/status')
} }
<template> <template>
<div class="main-container" style="margin:0 0.15rem"> <course-list />
<course-list @on-click="handleClick" />
</div>
</template> </template>
<script> <script>
...@@ -9,24 +7,6 @@ import CourseList from '@/components/CourseList.vue' ...@@ -9,24 +7,6 @@ import CourseList from '@/components/CourseList.vue'
export default { export default {
name: 'CourseLearn', name: 'CourseLearn',
components: { CourseList }, 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 } })
}
}
}
} }
</script> </script>
<template> <template>
<div class="main-container" v-if="loaded"> <div class="main-container" v-loading="!loaded">
<div class="course-title">{{detail.course_name}}</div> <div class="course-top" v-if="detail.curriculum">
<van-tabs <div class="course-top-hd">
class="main-tabs" <div class="course-top__title">{{ detail.curriculum.curriculum_name }}</div>
v-model="tabActive" </div>
color="#c62245" <div class="course-top-bd">
:line-width="80" <div class="course-top__pic"><img :src="detail.curriculum.curriculum_picture" /></div>
:line-height="2" <div class="course-top__content" v-html="detail.curriculum.curriculum_represent"></div>
:border="true" </div>
:swipeable="true" </div>
> <el-tabs v-model="tabActive">
<van-tab title="按章节学习"> <el-tab-pane label="按章节学习">
<template v-if="detail.chapters && detail.chapters.length"> <course-chapter :courseId="courseId" :data="detail.chapters" @on-click="handleClick"></course-chapter>
<course-chapter :courseId="courseId" :data="detail.chapters" @on-click="handleClick"></course-chapter> </el-tab-pane>
</template> <el-tab-pane label="按考点学习">
<van-empty description="暂无内容" v-else /> <course-tag :courseId="courseId"></course-tag>
</van-tab> </el-tab-pane>
<van-tab title="按考点学习"> </el-tabs>
<div class="tab-content">
<course-tag :courseId="courseId"></course-tag>
</div>
</van-tab>
</van-tabs>
</div> </div>
</template> </template>
...@@ -47,36 +42,22 @@ export default { ...@@ -47,36 +42,22 @@ export default {
computed: { computed: {
courseId() { courseId() {
return this.$route.params.id return this.$route.params.id
},
isWeapp() {
return this.$store.state.isWeapp
},
isVip() {
return this.$store.state.isVip
} }
}, },
methods: { methods: {
// 课程学习 // 课程学习
getCourse() { getCourse() {
this.loaded = false this.loaded = false
api.getCourse(this.courseId).then(response => { api
this.loaded = true .getCourse(this.courseId)
response.chapters = response.chapters.filter(item => { .then(response => {
item.children = item.children.filter( this.detail = response
child => child.type === 2 && child.resource_id && child.resource_id !== '6684350363920760832' })
) .finally(() => {
return item.children.length this.loaded = true
}) })
this.detail = response
})
}, },
handleClick(data) { handleClick(data) {}
if (this.isWeapp) {
wx.miniProgram.navigateTo({ url: `/pages/course/item?id=${this.courseId}&chapter_id=${data.id}` })
} else {
window.alert('请在微信小程序中打开')
}
}
}, },
beforeMount() { beforeMount() {
this.getCourse() this.getCourse()
...@@ -85,17 +66,44 @@ export default { ...@@ -85,17 +66,44 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.course-title { .main-container {
font-size: 15px; height: 100%;
font-weight: 600; padding: 30px;
color: #222; background-color: #fff;
padding: 20px 0 10px; 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 { .course-top__content {
margin-left: -0.4rem; flex: 1;
margin-right: -0.4rem; line-height: 24px;
min-height: 100vh; overflow: hidden;
background: #eee;
padding: 0.4rem;
} }
</style> </style>
...@@ -6,5 +6,5 @@ const httpRequest = new BaseAPI(webConf) ...@@ -6,5 +6,5 @@ const httpRequest = new BaseAPI(webConf)
* 获取课程列表 * 获取课程列表
*/ */
export function getCourseList() { export function getCourseList() {
return httpRequest.get('/zy/v2/education/mokuai') return httpRequest.get('/api/zy/v2/education/mokuai')
} }
...@@ -10,7 +10,6 @@ export default { ...@@ -10,7 +10,6 @@ export default {
data() { data() {
return { return {
navList: [ navList: [
{ title: '我的已购课程', path: '/my/order' },
{ title: '我的已学课程', path: '/my/course' }, { title: '我的已学课程', path: '/my/course' },
{ title: '我的已做试题', path: '/my/test' } { title: '我的已做试题', path: '/my/test' }
] ]
......
<template>
<app-container> </app-container>
</template>
<script>
import AppContainer from '@/components/AppContainer'
export default {
components: { AppContainer }
}
</script>
...@@ -4,26 +4,26 @@ import httpRequest from '@/utils/axios' ...@@ -4,26 +4,26 @@ import httpRequest from '@/utils/axios'
* 获取搜索记录 * 获取搜索记录
*/ */
export function getSearchTips() { export function getSearchTips() {
return httpRequest.get('/zy/v2/education/search/tips') return httpRequest.get('/api/zy/v2/education/search/tips')
} }
/** /**
* 知识点搜索 * 知识点搜索
*/ */
export function getSearchTagList(data) { 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) { 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) { export function getSearchCourseList(data) {
return httpRequest.post('/zy/v2/education/search/chapter2', data) return httpRequest.post('/api/zy/v2/education/search/chapter2', data)
} }
差异被折叠。
...@@ -89,3 +89,10 @@ body { ...@@ -89,3 +89,10 @@ body {
'Hiragino Sans GB', 'Wenquanyi Micro Hei', sans-serif; 'Hiragino Sans GB', 'Wenquanyi Micro Hei', sans-serif;
background-color: #f9f9f9; background-color: #f9f9f9;
} }
.empty-tips {
padding: 120px;
text-align: center;
font-size: 18px;
color: #999;
}
import store from '@/store' import store from '@/store'
export default class Before {
export default class BeforeEnter {
constructor(opt) { constructor(opt) {
this.opt = opt || {} this.opt = opt || {}
} }
...@@ -14,12 +15,9 @@ export default class Before { ...@@ -14,12 +15,9 @@ export default class Before {
// await store.dispatch('createGuestUser') // await store.dispatch('createGuestUser')
const isLogin = store.state.isLogin || (await store.dispatch('checkLogin')) const isLogin = store.state.isLogin || (await store.dispatch('checkLogin'))
isLogin && wx.miniProgram.postMessage({ data: { token: store.state.token } })
if (to.meta.requiredLogin && !isLogin) { if (to.meta.requiredLogin && !isLogin) {
store.state.isWeapp next(`/login?redirect_uri=${encodeURIComponent(window.location.href)}`)
? wx.miniProgram.redirectTo({ url: '/pages/login/index' })
: next(`/login?redirect_uri=${encodeURIComponent(window.location.href)}`)
return return
} }
next() next()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论