提交 1dbbca2f authored 作者: lihuihui's avatar lihuihui
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
node_modules node_modules
npm-debug.log npm-debug.log
upload_tmp upload_tmp
node_modules/ *
# code protect - prevent submit code below # code protect - prevent submit code below
/dist
/client-dist
const fs = require('fs') const fs = require('fs')
const path = require('path') const path = require('path')
...@@ -18,10 +17,10 @@ const PREFIX_PATH = conf.CDN_DIR ...@@ -18,10 +17,10 @@ const PREFIX_PATH = conf.CDN_DIR
const isUploadStatic = conf.isUploadStatic const isUploadStatic = conf.isUploadStatic
let fileCount = 1 let fileCount = 1
async function uploadFile (prefixPath, dirFileName) { async function uploadFile(prefixPath, dirFileName) {
try {
const upFilePath = prefixPath.replace(new RegExp(DIR_PATH, 'gi'), '') + path.basename(dirFileName) const upFilePath = prefixPath.replace(new RegExp(DIR_PATH, 'gi'), '') + path.basename(dirFileName)
let result = await client.put(prefixPath + path.basename(dirFileName), dirFileName) try {
const result = await client.put(prefixPath + path.basename(dirFileName), dirFileName)
if (result.res.status === 200) { if (result.res.status === 200) {
console.log('第' + fileCount++ + '个文件,已上传:' + conf.CDN_BASE + upFilePath) console.log('第' + fileCount++ + '个文件,已上传:' + conf.CDN_BASE + upFilePath)
return { status: 200 } return { status: 200 }
...@@ -32,15 +31,17 @@ async function uploadFile (prefixPath, dirFileName) { ...@@ -32,15 +31,17 @@ async function uploadFile (prefixPath, dirFileName) {
} }
} }
function uploadfiles (dirPath, callback) { function uploadfiles(dirPath, callback) {
const files = fs.readdirSync(dirPath) const files = fs.readdirSync(dirPath)
files.forEach(function (filename, i) { files.forEach(function(filename, i) {
const filedir = path.join(dirPath, filename) const filedir = path.join(dirPath, filename)
const info = fs.statSync(filedir) const info = fs.statSync(filedir)
if (info.isDirectory()) { if (info.isDirectory()) {
if (!(isUploadStatic ? true : filename !== 'static')) { return } if (!(isUploadStatic ? true : filename !== 'static')) {
return
}
const morePath = filedir.replace(new RegExp(DIR_PATH, 'gi'), '') + '/' const morePath = filedir.replace(new RegExp(DIR_PATH, 'gi'), '') + '/'
uploadfiles(filedir, function (filedir) { uploadfiles(filedir, function(filedir) {
uploadFile(path.join(PREFIX_PATH, morePath), filedir) uploadFile(path.join(PREFIX_PATH, morePath), filedir)
}) })
} else { } else {
......
...@@ -33,7 +33,7 @@ export default { ...@@ -33,7 +33,7 @@ export default {
font-weight: bold; font-weight: bold;
line-height: 1; line-height: 1;
color: #333; color: #333;
border-bottom: 0.06rem solid #2b7ce9; border-bottom: 0.06rem solid #c62245;
} }
.card-bd { .card-bd {
padding: 0.2rem 0; padding: 0.2rem 0;
......
<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>
<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 class="course-item__text course-item__text__course">{{ data.course_num }}节课</div>
<div class="course-item__text course-item__text__video">{{ data.video_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="onClick(item)"
>{{ item.course_name }}</div>
</div>
</div>
</template>
<script>
export default {
name: 'CourseItem',
props: { data: Object },
data() {
return {
isOpen: false
}
},
methods: {
toggleChild() {
this.isOpen = !this.isOpen
},
onClick(data) {
this.$emit('on-click', data)
}
}
}
</script>
<style lang="scss" scoped>
.course-item {
padding: 15px 0;
border-bottom: 1px solid #ccc;
}
.course-arrow {
width: 30px;
height: 100px;
}
.course-arrow__up {
background: url('https://zws-imgs-pub.ezijing.com/transport/weapp/icon_arrow_up.png') no-repeat left center;
background-size: 15px 15px;
}
.course-arrow__down {
background: url('https://zws-imgs-pub.ezijing.com/transport/weapp/icon_arrow_down.png') no-repeat left center;
background-size: 15px 15px;
}
.course-item-top {
display: flex;
}
.course-item-bottom {
padding-left: 30px;
}
.course-item-pic {
width: 108px;
height: 100px;
margin-right: 10px;
overflow: hidden;
}
.course-item-content {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
overflow: hidden;
}
.course-item__title {
font-size: 13px;
color: #666;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.course-item__text {
display: inline-block;
height: 24px;
margin-left: 10px;
padding: 0 10px;
font-size: 10px;
line-height: 24px;
}
.course-item__text:first-child {
margin-left: 0;
}
.course-item__text__course {
color: #88bbff;
background-color: #edf5ff;
}
.course-item__text__video {
color: #54d0b0;
background-color: #edfaf7;
}
.course-child {
font-size: 13px;
color: #666;
padding: 15px 15px 15px 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;
}
.course-child:last-child {
border-bottom: 0;
}
</style>
import BaseAPI from '@/api/base_api'
const httpRequest = new BaseAPI(webConf)
/**
* 获取课程列表
*/
export function getCourseList() {
return httpRequest.get('/zy/v2/education/mokuai')
}
<template> <template>
<div class="main-container" v-show="loaded"> <div class="main-container" v-show="loaded">
<template v-if="list.length"> <template v-if="list.length">
<course-item v-for="item in list" :data="item" :key="item.course_id" /> <course-item v-for="item in list" :data="item" :key="item.course_id" @on-click="handleClick" />
</template> </template>
<van-empty description="暂无内容" v-else /> <van-empty description="暂无内容" v-else />
</div> </div>
</template> </template>
<script> <script>
import * as api from '@/api/course.js' import * as api from './api'
import CourseItem from '@/components/CourseItem.vue' import CourseItem from '@/components/CourseItem2.vue'
export default { export default {
name: 'Course', name: 'Course',
components: { CourseItem }, components: { CourseItem },
metaInfo: { metaInfo: {
title: '课程学习' title: 'VIP课程'
}, },
data() { data() {
return { return {
...@@ -23,6 +23,11 @@ export default { ...@@ -23,6 +23,11 @@ export default {
list: [] list: []
} }
}, },
computed: {
isWeapp() {
return this.$store.state.isWeapp
}
},
methods: { methods: {
getCourseList() { getCourseList() {
api api
...@@ -33,6 +38,17 @@ export default { ...@@ -33,6 +38,17 @@ export default {
.finally(() => { .finally(() => {
this.loaded = true this.loaded = true
}) })
},
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 }
})
}
} }
}, },
beforeMount() { beforeMount() {
......
<template> <template>
<div class="main-container" v-if="loaded"> <div class="main-container" v-if="loaded">
<div class="course-title">{{detail.course_name}}</div> <template v-if="detail.chapters && detail.chapters.length">
<van-tabs
class="main-tabs"
v-model="tabActive"
color="#2b7ce9"
:line-height="2"
:swipeable="true"
>
<van-tab title="课程学习">
<course-chapter :courseId="courseId" :data="detail.chapters"></course-chapter> <course-chapter :courseId="courseId" :data="detail.chapters"></course-chapter>
</van-tab> </template>
<van-tab title="知识点速学"> <van-empty description="暂无内容" v-else />
<div class="tab-content">
<course-tag :courseId="courseId"></course-tag>
</div>
</van-tab>
</van-tabs>
</div> </div>
</template> </template>
<script> <script>
import CourseChapter from './courseChapter.vue' import CourseChapter from './components/courseChapter.vue'
import CourseTag from '../tag/index.vue'
import * as api from '@/api/course.js' import * as api from '@/api/course.js'
export default { export default {
name: 'CourseLearnItem', name: 'CourseLearnItem',
components: { CourseChapter, CourseTag }, components: { CourseChapter },
metaInfo: { metaInfo: {
title: '课程内容' title: '课程内容'
}, },
data() { data() {
return { return {
tabActive: 0,
loaded: false, loaded: false,
detail: {} detail: {}
} }
...@@ -50,10 +35,7 @@ export default { ...@@ -50,10 +35,7 @@ export default {
this.loaded = true this.loaded = true
response.chapters = response.chapters.filter(item => { response.chapters = response.chapters.filter(item => {
item.children = item.children.filter( item.children = item.children.filter(
child => child => child.type === 2 && child.resource_id && child.resource_id !== '6684350363920760832'
child.type === 2 &&
child.resource_id &&
child.resource_id !== '6684350363920760832'
) )
return item.children.length return item.children.length
}) })
...@@ -66,19 +48,3 @@ export default { ...@@ -66,19 +48,3 @@ export default {
} }
} }
</script> </script>
<style lang="scss" scoped>
.course-title {
font-size: 15px;
font-weight: 600;
color: #222;
padding: 20px 0 10px;
}
.tab-content {
margin-left: -0.4rem;
margin-right: -0.4rem;
min-height: 100vh;
background: #eee;
padding: 0.4rem;
}
</style>
import BaseAPI from '@/api/base_api'
const httpRequest = new BaseAPI(webConf)
/**
* 获取课程列表
*/
export function getCourseList() {
return httpRequest.get('/zy/v2/education/mokuai')
}
<template>
<div class="main-container" v-show="loaded">
<template v-if="list.length">
<course-item v-for="item in list" :data="item" :key="item.course_id" @on-click="handleClick" />
</template>
<van-empty description="暂无内容" v-else />
</div>
</template>
<script>
import * as api from './api'
import CourseItem from '@/components/CourseItem2.vue'
export default {
name: 'Course',
components: { CourseItem },
metaInfo: {
title: '考点突击'
},
data() {
return {
loaded: false,
list: []
}
},
computed: {
isWeapp() {
return this.$store.state.isWeapp
}
},
methods: {
getCourseList() {
api
.getCourseList()
.then(response => {
this.list = response
})
.finally(() => {
this.loaded = true
})
},
handleClick(data) {
if (this.isWeapp) {
const url = `/pages/web/index?src=${window.location.origin}/course/learn/${data.id}/tag`
wx.miniProgram.navigateTo({ url })
} else {
this.$router.push({ name: 'courseLearnTag', params: { id: data.id } })
}
}
},
beforeMount() {
this.getCourseList()
}
}
</script>
<style lang="scss">
.course-item:last-child {
border-bottom: 0;
}
</style>
...@@ -40,7 +40,13 @@ import MessageCard from './messageCard.vue' ...@@ -40,7 +40,13 @@ import MessageCard from './messageCard.vue'
import * as api from '@/api/course.js' import * as api from '@/api/course.js'
export default { export default {
props: { props: {
courseId: { type: String, required: true }, courseId: {
type: String,
default() {
console.log(this)
return this.$route.params.id
}
},
isTest: { type: Boolean, default: false } isTest: { type: Boolean, default: false }
}, },
components: { MessageCard }, components: { MessageCard },
...@@ -101,9 +107,7 @@ export default { ...@@ -101,9 +107,7 @@ export default {
this.searchTag(data.name) this.searchTag(data.name)
}, },
searchTag(keywords) { searchTag(keywords) {
api api.getSearchTagList({ keywords, course_id: this.courseId }).then(response => {
.getSearchTagList({ keywords, course_id: this.courseId })
.then(response => {
if (response.length) { if (response.length) {
this.messageList.push({ this.messageList.push({
id: this.genId(), id: this.genId(),
...@@ -157,10 +161,7 @@ export default { ...@@ -157,10 +161,7 @@ export default {
window.scrollTo(0, 0) window.scrollTo(0, 0)
}, },
handleScroll() { handleScroll() {
const scrollTop = const scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
window.pageYOffset ||
document.documentElement.scrollTop ||
document.body.scrollTop
this.showBacktop = scrollTop >= 10 this.showBacktop = scrollTop >= 10
} }
}, },
......
...@@ -160,7 +160,7 @@ export default { ...@@ -160,7 +160,7 @@ export default {
font-size: 13px; font-size: 13px;
color: #fff; color: #fff;
line-height: 35px; line-height: 35px;
background: #2b7ce9; background: #c62245;
border-radius: 6px; border-radius: 6px;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
......
...@@ -90,7 +90,7 @@ export default { ...@@ -90,7 +90,7 @@ export default {
min-width: 24px; min-width: 24px;
} }
.text { .text {
border-bottom: 1px solid #2b7ce9; border-bottom: 1px solid #c62245;
cursor: pointer; cursor: pointer;
} }
} }
......
...@@ -8,9 +8,7 @@ ...@@ -8,9 +8,7 @@
:key="index" :key="index"
@click="tab(index)" @click="tab(index)"
v-for="(item, index) in tabNav.navText" v-for="(item, index) in tabNav.navText"
> >{{ item }}</li>
{{ item }}
</li>
</ul> </ul>
</div> </div>
<div class="tab-con" id="bottom-view"> <div class="tab-con" id="bottom-view">
...@@ -28,7 +26,7 @@ ...@@ -28,7 +26,7 @@
<div class="comp"> <div class="comp">
<div class="btn" @click="abilityExam">开始测试</div> <div class="btn" @click="abilityExam">开始测试</div>
</div> </div>
</div> --> </div>-->
<div v-show="tabNav.navIndex == 0" class="tab2"> <div v-show="tabNav.navIndex == 0" class="tab2">
<ul class="ul"> <ul class="ul">
<template v-for="(item, index) in CourseChapter"> <template v-for="(item, index) in CourseChapter">
...@@ -36,11 +34,11 @@ ...@@ -36,11 +34,11 @@
<div class="parent"> <div class="parent">
<div class="title">{{ item.course_name }}</div> <div class="title">{{ item.course_name }}</div>
<template v-if="item.isShow"> <template v-if="item.isShow">
<van-icon v-if="item.isShow === false" name="arrow" class="arrow"/> <van-icon v-if="item.isShow === false" name="arrow" class="arrow" />
<van-icon v-else name="arrow-down" class="arrow"/> <van-icon v-else name="arrow-down" class="arrow" />
</template> </template>
<template v-else> <template v-else>
<van-icon name="arrow" class="arrow"/> <van-icon name="arrow" class="arrow" />
</template> </template>
</div> </div>
<div :class="item.isShow === undefined ? 'hide' : item.isShow ? 'show' : 'hide'"> <div :class="item.isShow === undefined ? 'hide' : item.isShow ? 'show' : 'hide'">
...@@ -49,11 +47,27 @@ ...@@ -49,11 +47,27 @@
<li> <li>
<div class="txt">{{ cItem.children[0].name }}</div> <div class="txt">{{ cItem.children[0].name }}</div>
<div class="btn-box"> <div class="btn-box">
<div v-if="cItem.children[0].status == 100" @click="startExam($event, cItem.children[0].id, item.course_id, 1)" class="tag">测试</div> <div
<div v-if="cItem.children[0].status == 0 || cItem.children[0].status == 3" @click="startExam($event, cItem.children[0].id, item.course_id, 0)" class="tag">继续测试</div> v-if="cItem.children[0].status == 100"
<template v-if="cItem.children[0].status == 1 || cItem.children[0].status == 2"> @click="startExam($event, cItem.children[0].id, item.course_id, 1)"
<div @click="startExam($event, cItem.children[0].id, item.course_id, 1)" class="tag">重新测试</div> class="tag"
<div @click="viewReport($event, cItem.children[0].id, item.course_id, 0)" class="tag">报告</div> >测试</div>
<div
v-if="cItem.children[0].status == 0 || cItem.children[0].status == 3"
@click="startExam($event, cItem.children[0].id, item.course_id, 0)"
class="tag"
>继续测试</div>
<template
v-if="cItem.children[0].status == 1 || cItem.children[0].status == 2"
>
<div
@click="startExam($event, cItem.children[0].id, item.course_id, 1)"
class="tag"
>重新测试</div>
<div
@click="viewReport($event, cItem.children[0].id, item.course_id, 0)"
class="tag"
>报告</div>
</template> </template>
</div> </div>
</li> </li>
...@@ -69,7 +83,7 @@ ...@@ -69,7 +83,7 @@
<template v-for="(item, index) in courseList"> <template v-for="(item, index) in courseList">
<li :key="index" @click="courseNodeDetail(item.course_id)"> <li :key="index" @click="courseNodeDetail(item.course_id)">
<div class="tit">{{ item.course_name }}</div> <div class="tit">{{ item.course_name }}</div>
<van-icon name="arrow" class="arr"/> <van-icon name="arrow" class="arr" />
</li> </li>
</template> </template>
</ul> </ul>
...@@ -125,7 +139,7 @@ export default { ...@@ -125,7 +139,7 @@ export default {
return this.$store.state.isWeapp return this.$store.state.isWeapp
} }
}, },
metaInfo () { metaInfo() {
return { return {
title: '课程测验', title: '课程测验',
meta: [ meta: [
...@@ -320,11 +334,11 @@ export default { ...@@ -320,11 +334,11 @@ export default {
const topViewH = document.getElementById('top-view').offsetHeight const topViewH = document.getElementById('top-view').offsetHeight
const clientHeight = document.documentElement.clientHeight const clientHeight = document.documentElement.clientHeight
const bottomView = document.getElementById('bottom-view') const bottomView = document.getElementById('bottom-view')
bottomView.style.height = (clientHeight - topViewH) + 'px' bottomView.style.height = clientHeight - topViewH + 'px'
}, },
listFold(e) { listFold(e) {
if (e.isShow !== undefined) { if (e.isShow !== undefined) {
e.isShow ? e.isShow = false : e.isShow = true e.isShow ? (e.isShow = false) : (e.isShow = true)
} else { } else {
e.isShow = true e.isShow = true
} }
...@@ -340,136 +354,136 @@ export default { ...@@ -340,136 +354,136 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.course-box{ .course-box {
// padding: 0 .4rem; // padding: 0 .4rem;
.tab-nav{ .tab-nav {
height: 1.1rem; height: 1.1rem;
padding: 0 .4rem; padding: 0 0.4rem;
ul{ ul {
border-bottom: .01rem solid #EEEEEE; border-bottom: 0.01rem solid #eeeeee;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
li{ li {
line-height: 1.1rem; line-height: 1.1rem;
font-size: .3rem; font-size: 0.3rem;
color:#999999; color: #999999;
flex: 1; flex: 1;
text-align: center; text-align: center;
} }
li.active{ li.active {
color: #222; color: #222;
font-weight: bold; font-weight: bold;
border-bottom: .02rem solid #2B7CE9; border-bottom: 0.02rem solid #c62245;
} }
} }
} }
.tab-con{ .tab-con {
overflow-y: scroll; overflow-y: scroll;
// padding-bottom: 1rem; // padding-bottom: 1rem;
.tab1{ .tab1 {
// padding-top: .2rem; // padding-top: .2rem;
padding: .2rem .4rem 1rem .4rem; padding: 0.2rem 0.4rem 1rem 0.4rem;
.txt{ .txt {
font-size: .26rem; font-size: 0.26rem;
color: #222; color: #222;
line-height: .26ren; line-height: 0.26ren;
} }
.comp{ .comp {
position: fixed; position: fixed;
bottom: .15rem; bottom: 0.15rem;
left: 50%; left: 50%;
-webkit-transform: translateX(-50%); -webkit-transform: translateX(-50%);
padding-bottom: env(safe-area-inset-bottom); padding-bottom: env(safe-area-inset-bottom);
} }
.btn{ .btn {
width:6.7rem; width: 6.7rem;
height:.7rem; height: 0.7rem;
background:rgba(255,103,103,1); background: rgba(255, 103, 103, 1);
border-radius:.12rem; border-radius: 0.12rem;
text-align: center; text-align: center;
line-height: .7rem; line-height: 0.7rem;
color: #fff; color: #fff;
font-size: .3rem; font-size: 0.3rem;
} }
.title{ .title {
font-size:.4rem; font-size: 0.4rem;
font-weight:bold; font-weight: bold;
color:rgba(255,103,103,1); color: rgba(255, 103, 103, 1);
line-height: 100%; line-height: 100%;
padding-top: .2rem; padding-top: 0.2rem;
text-align: center; text-align: center;
} }
img{ img {
width: 5.01rem; width: 5.01rem;
height: 3.98rem; height: 3.98rem;
display: block; display: block;
margin: 0.2rem auto 0 auto; margin: 0.2rem auto 0 auto;
} }
p{ p {
line-height: 100%; line-height: 100%;
font-size: .26rem; font-size: 0.26rem;
color: #222; color: #222;
text-align: center; text-align: center;
} }
.tx{ .tx {
margin-top: .2rem; margin-top: 0.2rem;
} }
.ti{ .ti {
font-size: .3rem; font-size: 0.3rem;
margin: .4rem 0 .2rem 0; margin: 0.4rem 0 0.2rem 0;
font-weight: bold; font-weight: bold;
} }
.ti2{ .ti2 {
font-size: .3rem; font-size: 0.3rem;
font-weight: bold; font-weight: bold;
margin-top: .4rem; margin-top: 0.4rem;
} }
} }
.tab2{ .tab2 {
.ul{ .ul {
padding: 0 .4rem; padding: 0 0.4rem;
li{ li {
.parent{ .parent {
display: flex; display: flex;
border-bottom: .01rem solid #EEEEEE; border-bottom: 0.01rem solid #eeeeee;
padding: 0.4rem 0; padding: 0.4rem 0;
align-items: center; align-items: center;
.title{ .title {
font-size: .3rem; font-size: 0.3rem;
color: #222222; color: #222222;
font-weight: bold; font-weight: bold;
} }
.arrow{ .arrow {
margin-left: auto; margin-left: auto;
} }
} }
.hide{ .hide {
display: none; display: none;
} }
.show{ .show {
display: block; display: block;
} }
ul{ ul {
li{ li {
display: flex; display: flex;
border-bottom: .01rem solid #EEEEEE; border-bottom: 0.01rem solid #eeeeee;
padding: 0.4rem 0; padding: 0.4rem 0;
.txt{ .txt {
font-size: .26rem; font-size: 0.26rem;
color: #999999; color: #999999;
} }
.btn-box{ .btn-box {
margin-left: auto; margin-left: auto;
display: flex; display: flex;
.tag{ .tag {
line-height: .46rem; line-height: 0.46rem;
height: .46rem; height: 0.46rem;
font-size: .26rem; font-size: 0.26rem;
color: #fff; color: #fff;
padding: 0 .3rem; padding: 0 0.3rem;
margin-left: .2rem; margin-left: 0.2rem;
background: #67A8FF; background: #67a8ff;
border-radius: .25rem; border-radius: 0.25rem;
white-space: nowrap; white-space: nowrap;
} }
} }
...@@ -478,21 +492,21 @@ export default { ...@@ -478,21 +492,21 @@ export default {
} }
} }
} }
.tab3{ .tab3 {
ul{ ul {
padding:0 .4rem; padding: 0 0.4rem;
li{ li {
display: flex; display: flex;
padding: .4rem 0; padding: 0.4rem 0;
border-bottom: .01rem solid #eee; border-bottom: 0.01rem solid #eee;
align-items: center; align-items: center;
.tit{ .tit {
width: 6.15rem; width: 6.15rem;
color: rgba(34,34,34,1); color: rgba(34, 34, 34, 1);
font-size: .3rem; font-size: 0.3rem;
font-weight: bold; font-weight: bold;
} }
.arr{ .arr {
margin-left: auto; margin-left: auto;
} }
} }
...@@ -500,52 +514,52 @@ export default { ...@@ -500,52 +514,52 @@ export default {
} }
} }
} }
.exam_submit{ .exam_submit {
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
z-index: 999999; z-index: 999999;
width: 100%; width: 100%;
height: 100%; height: 100%;
background: rgba(0,0,0,0.6); background: rgba(0, 0, 0, 0.6);
.pop{ .pop {
width: 5.9rem; width: 5.9rem;
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 50%;
-webkit-transform: translate(-50%,-50%); -webkit-transform: translate(-50%, -50%);
background:rgba(255,255,255,1); background: rgba(255, 255, 255, 1);
border-radius:.12rem; border-radius: 0.12rem;
padding: 0.4rem 0; padding: 0.4rem 0;
.tit{ .tit {
font-weight:bold; font-weight: bold;
color:rgba(34,34,34,1); color: rgba(34, 34, 34, 1);
font-size:.3rem; font-size: 0.3rem;
text-align: center; text-align: center;
line-height: 100%; line-height: 100%;
} }
.txt{ .txt {
color:rgba(34,34,34,1); color: rgba(34, 34, 34, 1);
font-size:.3rem; font-size: 0.3rem;
text-align: center; text-align: center;
line-height: 100%; line-height: 100%;
margin-top: .8rem; margin-top: 0.8rem;
} }
.btn_box{ .btn_box {
padding:0 0.2rem; padding: 0 0.2rem;
display: flex; display: flex;
margin-top: .8rem; margin-top: 0.8rem;
.btn{ .btn {
width:2.6rem; width: 2.6rem;
height:.7rem; height: 0.7rem;
background:rgba(43,124,233,1); background: rgba(43, 124, 233, 1);
border-radius:.12rem; border-radius: 0.12rem;
text-align: center; text-align: center;
line-height: .7rem; line-height: 0.7rem;
color: #fff; color: #fff;
font-size: .3rem; font-size: 0.3rem;
} }
.btn2{ .btn2 {
margin-left: auto; margin-left: auto;
} }
} }
......
...@@ -176,7 +176,7 @@ export default { ...@@ -176,7 +176,7 @@ export default {
display: inline-block; display: inline-block;
padding: 0 0.05rem; padding: 0 0.05rem;
font-size: 0.2rem; font-size: 0.2rem;
color: #2b7ce9; color: #c62245;
line-height: 0.28rem; line-height: 0.28rem;
background-color: #e9f1fc; background-color: #e9f1fc;
border-radius: 0.06rem; border-radius: 0.06rem;
......
import BaseAPI from '@/api/base_api'
const httpRequest = new BaseAPI(webConf)
// 登录
export function login(data) {
return httpRequest.post('/passport/rest/login', data, {
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
})
}
// 绑定微信
export function bindWechat(data) {
return httpRequest.post('/passport/rest/wechat/bind-unionid', data, {
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
})
}
// 重置密码
export function resetPassword(data) {
return httpRequest.post('/usercenter/user/update-pwd', data, {
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
})
}
// 发送重置验证码
export function sendResetPasswordCode(data) {
return httpRequest.post('/usercenter/user/send-code', data, {
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
})
}
// 登出
export function logout() {
return httpRequest.get('/passport/rest/logout')
}
// 获取用户信息
export function getUser() {
return httpRequest.get('/zy/user/getinfo')
}
// 绑定游客
export function bindVisitor(data) {
return httpRequest.post('/zy/user/bind-account', data, {
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
})
}
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</template> </template>
<script> <script>
import * as api from '@/api/account' import * as api from '../api'
import CountdownButton from '@/components/CountdownButton.vue' import CountdownButton from '@/components/CountdownButton.vue'
export default { export default {
......
...@@ -30,9 +30,9 @@ ...@@ -30,9 +30,9 @@
<script> <script>
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
import * as api from '@/api/account' import * as api from './api'
import AccountLogin from './accountLogin.vue' import AccountLogin from './components/accountLogin.vue'
import CodeLogin from './codeLogin.vue' import CodeLogin from './components/codeLogin.vue'
export default { export default {
components: { AccountLogin, CodeLogin }, components: { AccountLogin, CodeLogin },
...@@ -229,8 +229,8 @@ export default { ...@@ -229,8 +229,8 @@ export default {
.login-title { .login-title {
display: inline-block; display: inline-block;
font-size: 24px; font-size: 24px;
color: #2b7ce9; color: #c62245;
border-bottom: 5px solid #2b7ce9; border-bottom: 5px solid #c62245;
} }
.login-bd { .login-bd {
margin-top: 20px; margin-top: 20px;
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
</template> </template>
<script> <script>
import * as api from '@/api/account' import * as api from './api'
import CountdownButton from '@/components/CountdownButton.vue' import CountdownButton from '@/components/CountdownButton.vue'
export default { export default {
...@@ -180,11 +180,7 @@ export default { ...@@ -180,11 +180,7 @@ export default {
background-color: transparent; background-color: transparent;
} }
.password-button { .password-button {
background: linear-gradient( background: linear-gradient(180deg, rgba(255, 155, 150, 1) 0%, rgba(206, 62, 58, 1) 100%);
180deg,
rgba(255, 155, 150, 1) 0%,
rgba(206, 62, 58, 1) 100%
);
color: #fff; color: #fff;
border: 0; border: 0;
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<van-switch <van-switch
v-model="checked" v-model="checked"
size="18px" size="18px"
active-color="#2B7CE9" active-color="#C62245"
:loading="switchLoading" :loading="switchLoading"
@change="onChange" @change="onChange"
/> />
...@@ -51,9 +51,7 @@ export default { ...@@ -51,9 +51,7 @@ export default {
} else if (type === 3) { } else if (type === 3) {
return '工作日' return '工作日'
} else { } else {
return this.selectedWeek.length return this.selectedWeek.length ? '每周' + this.selectedWeek.join('、') : '永不'
? '每周' + this.selectedWeek.join('、')
: '永不'
} }
}, },
selectedWeek() { selectedWeek() {
......
...@@ -61,9 +61,7 @@ export default { ...@@ -61,9 +61,7 @@ export default {
return return
} }
const weeks = data.week_json ? JSON.parse(data.week_json) : [] const weeks = data.week_json ? JSON.parse(data.week_json) : []
this.defaultIndex = this.timeColumns.findIndex( this.defaultIndex = this.timeColumns.findIndex(item => item === data.time)
item => item === data.time
)
this.ruleForm = Object.assign({}, this.ruleForm, data, { this.ruleForm = Object.assign({}, this.ruleForm, data, {
week_json: weeks week_json: weeks
}) })
...@@ -96,9 +94,7 @@ export default { ...@@ -96,9 +94,7 @@ export default {
} else if (this.selectedResultType === 3) { } else if (this.selectedResultType === 3) {
return '工作日' return '工作日'
} else { } else {
return this.selectedWeek.length return this.selectedWeek.length ? '每周' + this.selectedWeek.join('、') : '永不'
? '每周' + this.selectedWeek.join('、')
: '永不'
} }
}, },
selectedWeek() { selectedWeek() {
...@@ -224,7 +220,7 @@ export default { ...@@ -224,7 +220,7 @@ export default {
} }
} }
::v-deep .van-checkbox[aria-checked='true'] { ::v-deep .van-checkbox[aria-checked='true'] {
background-color: #2b7ce9; background-color: #c62245;
border: 0; border: 0;
.van-checkbox__label { .van-checkbox__label {
color: #fff; color: #fff;
...@@ -242,7 +238,7 @@ export default { ...@@ -242,7 +238,7 @@ export default {
display: block; display: block;
width: 100%; width: 100%;
height: 40px; height: 40px;
background-color: #2b7ce9; background-color: #c62245;
border: 0; border: 0;
border-radius: 6px; border-radius: 6px;
} }
......
...@@ -89,7 +89,7 @@ export default { ...@@ -89,7 +89,7 @@ export default {
line-height: 1; line-height: 1;
text-align: center; text-align: center;
&.is-active { &.is-active {
color: #2b7ce9; color: #c62245;
} }
} }
} }
...@@ -101,7 +101,7 @@ export default { ...@@ -101,7 +101,7 @@ export default {
height: 35px; height: 35px;
margin: 0 20px; margin: 0 20px;
font-size: 15px; font-size: 15px;
background-color: #2b7ce9; background-color: #c62245;
border-radius: 6px; border-radius: 6px;
border: 0; border: 0;
} }
......
import BaseAPI from '@/api/base_api'
const httpRequest = new BaseAPI(webConf)
/**
* 获取搜索记录
*/
export function getSearchTips() {
return httpRequest.get('/zy/v2/education/search/tips')
}
/**
* 知识点搜索
*/
export function getSearchTagList(data) {
return httpRequest.post('/zy/v2/education/search/tag', data, {
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
})
}
/**
* 视频课程搜索
*/
export function getSearchCourseVideoList(data) {
return httpRequest.post('/zy/v2/education/search/chapter1', data, {
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
})
}
/**
* 课程搜索
*/
export function getSearchCourseList(data) {
return httpRequest.post('/zy/v2/education/search/chapter2', data, {
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
})
}
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</template> </template>
<script> <script>
import * as api from '@/api/course.js' import * as api from '../api'
export default { export default {
name: 'CourseList', name: 'CourseList',
props: { props: {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</template> </template>
<script> <script>
import * as api from '@/api/course.js' import * as api from '../api'
export default { export default {
name: 'TagList', name: 'TagList',
props: { props: {
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
</template> </template>
<script> <script>
import * as api from '@/api/course.js' import * as api from '../api'
export default { export default {
name: 'VideoList', name: 'VideoList',
props: { props: {
...@@ -52,9 +52,7 @@ export default { ...@@ -52,9 +52,7 @@ export default {
}, },
// 过滤空视频 // 过滤空视频
dataList() { dataList() {
return this.list.filter( return this.list.filter(item => item.resource_id !== '6684350363920760832')
item => item.resource_id !== '6684350363920760832'
)
} }
}, },
methods: { methods: {
...@@ -113,8 +111,7 @@ export default { ...@@ -113,8 +111,7 @@ export default {
top: 0; top: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
background: rgba(1, 1, 1, 0.2) url(../../assets/images/icon_play.png) background: rgba(1, 1, 1, 0.2) url(../../../assets/images/icon_play.png) no-repeat center center;
no-repeat center center;
background-size: 0.56rem 0.7rem; background-size: 0.56rem 0.7rem;
z-index: 10; z-index: 10;
} }
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<van-tabs <van-tabs
class="main-tabs" class="main-tabs"
v-model="tabActive" v-model="tabActive"
color="#2b7ce9" color="#C62245"
:line-height="2" :line-height="2"
:animated="true" :animated="true"
:swipeable="true" :swipeable="true"
...@@ -49,11 +49,11 @@ ...@@ -49,11 +49,11 @@
<script> <script>
// components // components
import SearchBar from '@/components/SearchBar.vue' import SearchBar from '@/components/SearchBar.vue'
import TagList from './tagList.vue' import TagList from './components/tagList.vue'
import VideoList from './videoList.vue' import VideoList from './components/videoList.vue'
import CourseList from './courseList.vue' import CourseList from './components/courseList.vue'
// api // api
import * as api from '@/api/course.js' import * as api from './api'
export default { export default {
name: 'SearchIndex', name: 'SearchIndex',
......
...@@ -83,6 +83,13 @@ export default [ ...@@ -83,6 +83,13 @@ export default [
component: () => import('../pages/course/learn/item.vue'), component: () => import('../pages/course/learn/item.vue'),
meta: { requiredLogin: true } meta: { requiredLogin: true }
}, },
// 课程学习详情
{
path: '/course/learn/:id/tag',
name: 'courseLearnTag',
component: () => import('../pages/course/tag/index.vue'),
meta: { requiredLogin: true }
},
// 课程知识点 // 课程知识点
{ {
path: '/course/learn/:courseId/tag/:chapterId', path: '/course/learn/:courseId/tag/:chapterId',
...@@ -91,6 +98,13 @@ export default [ ...@@ -91,6 +98,13 @@ export default [
meta: { requiredLogin: true } meta: { requiredLogin: true }
}, },
// 课程知识点详情 // 课程知识点详情
{
path: '/course/tag',
name: 'courseTag',
component: () => import('../pages/course/tag/home.vue'),
meta: { requiredLogin: true }
},
// 课程知识点详情
{ {
path: '/course/tag/:id', path: '/course/tag/:id',
name: 'courseTagItem', name: 'courseTagItem',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论