|
@@ -1,10 +1,10 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <div>
|
|
|
|
|
|
|
+ <div class="home-container">
|
|
|
<head-bar :isBack="false">
|
|
<head-bar :isBack="false">
|
|
|
<template #title>
|
|
<template #title>
|
|
|
<div style="width: 100%">
|
|
<div style="width: 100%">
|
|
|
<div class="rightSearch">
|
|
<div class="rightSearch">
|
|
|
- <div class="searchImg" @click="selectAll1">
|
|
|
|
|
|
|
+ <div class="searchImg" @click="search">
|
|
|
<img src="../../assets/images/home/search.png" alt="" />
|
|
<img src="../../assets/images/home/search.png" alt="" />
|
|
|
</div>
|
|
</div>
|
|
|
<el-input v-model="courseName" auto-complete="off" placeholder="搜索课程..."></el-input>
|
|
<el-input v-model="courseName" auto-complete="off" placeholder="搜索课程..."></el-input>
|
|
@@ -12,8 +12,48 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
</head-bar>
|
|
</head-bar>
|
|
|
- <class-filter @getAll="selectAll"> </class-filter>
|
|
|
|
|
- <course-all :courseList="zoneClass"></course-all>
|
|
|
|
|
|
|
+ <div class="home-box">
|
|
|
|
|
+ <class-filter @getAll="search" :zoneClass.sync="zoneClass"> </class-filter>
|
|
|
|
|
+ <van-pull-refresh v-model="isLoading" @refresh="onRefresh" class="rheight">
|
|
|
|
|
+ <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad" class="vheight">
|
|
|
|
|
+ <!-- <course-all :courseList="zoneClass"></course-all> -->
|
|
|
|
|
+ <van-empty description="暂无课程" v-if="!zoneClass.length" />
|
|
|
|
|
+ <div v-for="(c, cIndex) in zoneClass" :key="cIndex" class="courseItem" @click="goTo(c.courseId)">
|
|
|
|
|
+ <div class="cDetail">
|
|
|
|
|
+ <div class="courseImg">
|
|
|
|
|
+ <img
|
|
|
|
|
+ :src="c.cover ? JSON.parse(c.cover)[0].url : require('../../assets/images/home/wheel.png')"
|
|
|
|
|
+ alt=""
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="cRight">
|
|
|
|
|
+ <div>{{ c.title }}</div>
|
|
|
|
|
+ <div>创建者:{{ c.uname }}</div>
|
|
|
|
|
+ <div class="jdBox">
|
|
|
|
|
+ <div class="jdImg"><img src="../../assets/images/home/jd.png" alt="" /></div>
|
|
|
|
|
+ <div>{{ JSON.parse(c.chapters).length }}阶段</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div>{{ c.typename ? c.typename : '暂无分类' }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="cButtonBox" v-show="false">
|
|
|
|
|
+ <div class="cButton">
|
|
|
|
|
+ <div class="bImg"><img src="../../assets/images/home/courseEvaIcon.png" alt="" /></div>
|
|
|
|
|
+ <div>评课</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="cButton">
|
|
|
|
|
+ <div class="bImg"><img src="../../assets/images/home/evaIcon.png" alt="" /></div>
|
|
|
|
|
+ <div>评价</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="cButton">
|
|
|
|
|
+ <div class="bImg"><img src="../../assets/images/home/analysisIcon.png" alt="" /></div>
|
|
|
|
|
+ <div>分析</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </van-list>
|
|
|
|
|
+ </van-pull-refresh>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -22,56 +62,83 @@ import { selectTypeCourse2 } from '@/api/home'
|
|
|
import { mapGetters } from 'vuex'
|
|
import { mapGetters } from 'vuex'
|
|
|
import headBar from '@/components/headBar.vue'
|
|
import headBar from '@/components/headBar.vue'
|
|
|
import classFilter from './components/classFilter.vue'
|
|
import classFilter from './components/classFilter.vue'
|
|
|
-import courseAll from './components/courseAll.vue'
|
|
|
|
|
|
|
+// import courseAll from './components/courseAll.vue'
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
headBar,
|
|
headBar,
|
|
|
- classFilter,
|
|
|
|
|
- courseAll
|
|
|
|
|
|
|
+ classFilter
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
courseName: '',
|
|
courseName: '',
|
|
|
- zoneClass: []
|
|
|
|
|
|
|
+ zoneClass: [],
|
|
|
|
|
+ typea: '',
|
|
|
|
|
+ typeb: '',
|
|
|
|
|
+ typec: '',
|
|
|
|
|
+ page: 1,
|
|
|
|
|
+ isLoading: false,
|
|
|
|
|
+ loading: false,
|
|
|
|
|
+ finished: false
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
|
...mapGetters(['userinfo'])
|
|
...mapGetters(['userinfo'])
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- selectAll1(){
|
|
|
|
|
- this.selectAll({})
|
|
|
|
|
|
|
+ goTo(cid) {
|
|
|
|
|
+ // eslint-disable-next-line prettier/prettier
|
|
|
|
|
+ this.$router.push({ path: '/courseDetail', query: { courseid: cid }})
|
|
|
},
|
|
},
|
|
|
- selectAll(tList) {
|
|
|
|
|
- var a = '',b = '',c = ''
|
|
|
|
|
- if (tList != undefined) {
|
|
|
|
|
- var typeList = Object.values(tList);
|
|
|
|
|
- a = typeList[0]
|
|
|
|
|
- b = typeList[2]
|
|
|
|
|
- c = typeList[1]
|
|
|
|
|
|
|
+ search(tList) {
|
|
|
|
|
+ this.page = 1
|
|
|
|
|
+ if (tList !== undefined) {
|
|
|
|
|
+ var typeList = Object.values(tList)
|
|
|
|
|
+ this.typea = typeList[0]
|
|
|
|
|
+ this.typeb = typeList[2]
|
|
|
|
|
+ this.typec = typeList[1]
|
|
|
}
|
|
}
|
|
|
|
|
+ this.selectAll(true)
|
|
|
|
|
+ },
|
|
|
|
|
+ onRefresh() {
|
|
|
|
|
+ this.page = 1
|
|
|
|
|
+ this.finished = false
|
|
|
|
|
+ this.selectAll(true)
|
|
|
|
|
+ },
|
|
|
|
|
+ onLoad() {
|
|
|
|
|
+ this.page++
|
|
|
|
|
+ this.selectAll()
|
|
|
|
|
+ },
|
|
|
|
|
+ async selectAll(isRefresh) {
|
|
|
const params = {
|
|
const params = {
|
|
|
uid: this.userinfo.userid,
|
|
uid: this.userinfo.userid,
|
|
|
oid: this.userinfo.organizeid,
|
|
oid: this.userinfo.organizeid,
|
|
|
- typea: a != undefined ? a : '',
|
|
|
|
|
- typeb: b != undefined ? a : '',
|
|
|
|
|
|
|
+ typea: this.typea !== undefined ? this.typea : '',
|
|
|
|
|
+ typeb: this.typeb !== undefined ? this.typeb : '',
|
|
|
typec: '',
|
|
typec: '',
|
|
|
- typed: c != undefined ? a : '',
|
|
|
|
|
|
|
+ typed: this.typec !== undefined ? this.typec : '',
|
|
|
typeE: '',
|
|
typeE: '',
|
|
|
cu: '',
|
|
cu: '',
|
|
|
cn: this.courseName,
|
|
cn: this.courseName,
|
|
|
classid: this.userinfo.classid,
|
|
classid: this.userinfo.classid,
|
|
|
org: this.userinfo.org,
|
|
org: this.userinfo.org,
|
|
|
- page: 1,
|
|
|
|
|
|
|
+ page: this.page,
|
|
|
pageSize: 10
|
|
pageSize: 10
|
|
|
}
|
|
}
|
|
|
- selectTypeCourse2(params)
|
|
|
|
|
- .then(res => {
|
|
|
|
|
- this.zoneClass = res[0]
|
|
|
|
|
- })
|
|
|
|
|
- .catch(err => {
|
|
|
|
|
- console.log(err)
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ const res = await selectTypeCourse2(params)
|
|
|
|
|
+ if (isRefresh) {
|
|
|
|
|
+ this.isLoading = false
|
|
|
|
|
+ // 下拉刷新
|
|
|
|
|
+ this.zoneClass = res[0]
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.loading = false
|
|
|
|
|
+ // 上拉加载
|
|
|
|
|
+ this.zoneClass = [...this.zoneClass, ...res[0]]
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$emit('update:list', this.zoneClass)
|
|
|
|
|
+ if (res[0].length === 0) {
|
|
|
|
|
+ // 证明没有下一页数据了
|
|
|
|
|
+ this.finished = true
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
@@ -81,6 +148,118 @@ export default {
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
|
|
+.home-container {
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ .home-box {
|
|
|
|
|
+ height: calc(100% - 55px);
|
|
|
|
|
+ margin-top: 55px;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ }
|
|
|
|
|
+ .rheight {
|
|
|
|
|
+ height: calc(100% - 40px);
|
|
|
|
|
+ overflow: auto;
|
|
|
|
|
+ background: #e8ebf2;
|
|
|
|
|
+
|
|
|
|
|
+ /deep/.van-pull-refresh__track {
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .vheight {
|
|
|
|
|
+ padding: 10px 0;
|
|
|
|
|
+ // height: 100%;
|
|
|
|
|
+ // overflow: auto;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // .courseBox {
|
|
|
|
|
+ // background: #e8ebf2;
|
|
|
|
|
+ // padding: 15px 0;
|
|
|
|
|
+ .courseItem {
|
|
|
|
|
+ background: #fff;
|
|
|
|
|
+ width: 90%;
|
|
|
|
|
+ margin: 0 auto 15px;
|
|
|
|
|
+ border-radius: 10px;
|
|
|
|
|
+ box-shadow: 0 0 10px 1px #dcdfe6;
|
|
|
|
|
+ padding: 10px;
|
|
|
|
|
+ .cDetail {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: row;
|
|
|
|
|
+ flex-wrap: nowrap;
|
|
|
|
|
+ align-items: flex-start;
|
|
|
|
|
+ .courseImg {
|
|
|
|
|
+ width: 110px;
|
|
|
|
|
+ height: 80px;
|
|
|
|
|
+ > img {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ border-radius: 5px;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .cRight {
|
|
|
|
|
+ margin-left: 20px;
|
|
|
|
|
+ > div {
|
|
|
|
|
+ margin: 2px 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ > div:nth-child(1) {
|
|
|
|
|
+ font-size: 18px;
|
|
|
|
|
+ font-weight: bold;
|
|
|
|
|
+ max-width: 225px;
|
|
|
|
|
+ white-space: nowrap;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
|
|
+ word-break: break-word;
|
|
|
|
|
+ }
|
|
|
|
|
+ .jdBox {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: row;
|
|
|
|
|
+ flex-wrap: nowrap;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: flex-start;
|
|
|
|
|
+ .jdImg {
|
|
|
|
|
+ width: 15px;
|
|
|
|
|
+ margin-top: 1px;
|
|
|
|
|
+ height: 15px;
|
|
|
|
|
+ > img {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .cButtonBox {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: row;
|
|
|
|
|
+ flex-wrap: nowrap;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ padding: 10px 0 0 0;
|
|
|
|
|
+ .cButton {
|
|
|
|
|
+ width: 100px;
|
|
|
|
|
+ height: 30px;
|
|
|
|
|
+ margin: 0 10px 0 0;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: row;
|
|
|
|
|
+ flex-wrap: nowrap;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ border: 1px solid #587ff3;
|
|
|
|
|
+ color: #587ff3;
|
|
|
|
|
+ border-radius: 5px;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ .bImg {
|
|
|
|
|
+ width: 20px;
|
|
|
|
|
+ height: 20px;
|
|
|
|
|
+ > img {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ // }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
/deep/.rightSearch {
|
|
/deep/.rightSearch {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
flex-direction: row;
|