|
@@ -103,9 +103,8 @@
|
|
|
</view>
|
|
|
<u-line color="#D6D6DB" />
|
|
|
<view>
|
|
|
- <view
|
|
|
- ><u-tabs
|
|
|
- gutter="0"
|
|
|
+ <view>
|
|
|
+ <u-tabs
|
|
|
:item-width="itemWidth()"
|
|
|
:list="list"
|
|
|
font-size="32"
|
|
@@ -113,8 +112,8 @@
|
|
|
:current="current"
|
|
|
@change="change"
|
|
|
active-color="#007AFF"
|
|
|
- ></u-tabs
|
|
|
- ></view>
|
|
|
+ ></u-tabs>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<u-line color="#D6D6DB" />
|
|
|
</view>
|
|
@@ -127,6 +126,12 @@
|
|
|
<view class="note">正在直播中</view>
|
|
|
<view class="title">{{livingItem.sectionName}}</view>
|
|
|
</view>
|
|
|
+ <view v-if="teacherList && teacherList.length > 0" class='teacher_names'>
|
|
|
+ <view v-for="(tea, index) in teacherList" :key="index" class="names"
|
|
|
+ :class="{nactive: teacherIndex == index}" @click="activeFunc(tea, index)">
|
|
|
+ {{ tea.aliasName }}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
<view class="menuBox onessss" v-for="(item, index) in menuList" :key="index">
|
|
|
<!--模块 -->
|
|
|
<view v-if="item.type == 1"
|
|
@@ -559,25 +564,36 @@
|
|
|
</scroll-view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+
|
|
|
<view class="check_con">
|
|
|
<scroll-view scroll-y="true" style="height: 700rpx;">
|
|
|
- <view class="course_items" v-for="(item, index) in s_courseList" :key="index">
|
|
|
- <view class="course_lefts">
|
|
|
- <view class="course_title">{{ item.courseName }}</view>
|
|
|
- <view class="course_pros">
|
|
|
- 学习进度
|
|
|
- <text> {{ item.stuAllNum + item.recordNum }}/{{ item.secAllNum + item.examNum}}</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="course_rights" @click="jump(item, index)">
|
|
|
- <view class="cicles">
|
|
|
- <u-icon name="arrow-right" color="#498AFE" size="20"></u-icon>
|
|
|
- </view>
|
|
|
- <view class="intoStudy">进入学习</view>
|
|
|
+ <view v-for="(courseItem, gTindex) in goodsTeacher" :key="gTindex">
|
|
|
+ <view v-for="(item, index) in courseItem.courseList" :key="index" v-show="item.subjectId === newActiveSubjectId || !newActiveSubjectId">
|
|
|
+ <view class="course_items" v-if="item.show && item.show == 1">
|
|
|
+ <view class="course_lefts">
|
|
|
+ <view class="course_title">
|
|
|
+ {{ item.courseName }}
|
|
|
+ </view>
|
|
|
+ <view v-if="courseItem.teaList && courseItem.teaList.length > 0" class='teacher_names' >
|
|
|
+ <view v-for="(tea, tindex) in courseItem.teaList" :key="tindex" class="names"
|
|
|
+ :class="{nactive: teaIndex == tindex}" @click.stop="switchTeacher(tea, tindex)">{{tea.aliasName}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="course_pros">
|
|
|
+ 学习进度
|
|
|
+ <text> {{ item.stuAllNum + item.recordNum }}/{{ item.secAllNum + item.examNum}}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="course_rights" @click="jump(item, index, 'jump')">
|
|
|
+ <view class="cicles">
|
|
|
+ <u-icon name="arrow-right" color="#498AFE" size="20"></u-icon>
|
|
|
+ </view>
|
|
|
+ <view class="intoStudy">进入学习</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </view>
|
|
|
</scroll-view>
|
|
|
- </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</u-popup>
|
|
|
|
|
@@ -709,6 +725,11 @@ export default {
|
|
|
s_courseList: [], // 筛选后的
|
|
|
subList: [],
|
|
|
subIndex: 0,
|
|
|
+ goodsTeacher: [],
|
|
|
+ teacherList: [],
|
|
|
+ teaIndex: 0,
|
|
|
+ teacherIndex: 0,
|
|
|
+ newActiveSubjectId: "", //当前选中ID
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -760,12 +781,14 @@ export default {
|
|
|
},
|
|
|
// 点击课程目录
|
|
|
cMenu(item, index) {
|
|
|
+ console.log('item', item)
|
|
|
this.subIndex = index
|
|
|
- if (item.subjectId != 0) {
|
|
|
- this.s_courseList = this.courseList.filter((e) => e.subjectId == item.subjectId)
|
|
|
- } else {
|
|
|
- this.s_courseList = this.courseList
|
|
|
- }
|
|
|
+ this.newActiveSubjectId = item.subjectId
|
|
|
+ // if (item.subjectId != 0) {
|
|
|
+ // this.s_courseList = this.courseList.filter((e) => e.subjectId == item.subjectId)
|
|
|
+ // } else {
|
|
|
+ // this.s_courseList = this.courseList
|
|
|
+ // }
|
|
|
},
|
|
|
courseCourseList() {
|
|
|
// /course/courseList查询商品下的课程列表
|
|
@@ -782,7 +805,7 @@ export default {
|
|
|
this.courseList.push.apply(this.courseList, res.data.rows)
|
|
|
this.s_courseList = this.courseList
|
|
|
this.courseTotal = res.data.total || 0
|
|
|
-
|
|
|
+ // 科目
|
|
|
let allItem = [{ subjectId: 0, subjectName: '所有'}]
|
|
|
let ids = []
|
|
|
const newArr = []
|
|
@@ -830,6 +853,9 @@ export default {
|
|
|
console.log('查询用户最后一次看的录播的信息', res.data, this.courseId)
|
|
|
this.originOnShow()
|
|
|
this.originMounted()
|
|
|
+
|
|
|
+ //获取商品双师资模板
|
|
|
+ this.getCourseTeacher(this.courseList)
|
|
|
} else {
|
|
|
this.toggleCourseShow = true
|
|
|
}
|
|
@@ -837,6 +863,79 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ getCourseTeacher(rows) {
|
|
|
+ //获取商品双师资模板
|
|
|
+ this.$api.courseTeacherList({
|
|
|
+ goodsId: this.goodsId
|
|
|
+ }).then((res1) => {
|
|
|
+ console.log(res1,'res1');
|
|
|
+ if(res1.data.data && res1.data.data.length > 0){
|
|
|
+ //课程老师模板
|
|
|
+ let teacherTel = res1.data.data;
|
|
|
+ //商品课程
|
|
|
+ let courses = rows;
|
|
|
+ teacherTel.forEach((tea) => {
|
|
|
+ let dataList = []
|
|
|
+ let teacherList = []
|
|
|
+ courses.forEach((item) => {
|
|
|
+ if(tea.courseIds.search(item.courseId) > -1){
|
|
|
+ dataList.push(item)
|
|
|
+ teacherList = tea.courseList
|
|
|
+ }
|
|
|
+ })
|
|
|
+ let result = {
|
|
|
+ teaList:teacherList,
|
|
|
+ courseList:dataList
|
|
|
+ }
|
|
|
+ this.goodsTeacher.push(result)
|
|
|
+ })
|
|
|
+ if(this.goodsTeacher && this.goodsTeacher.length > 0){
|
|
|
+ let courseIds = []
|
|
|
+ this.goodsTeacher.forEach((item) => {
|
|
|
+ item.courseList.forEach((course) => {
|
|
|
+ courseIds.push(course.courseId)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ if(courseIds.length > 0){
|
|
|
+ courses.forEach((item) => {
|
|
|
+ if(!courseIds.includes(item.courseId)){
|
|
|
+ let data = {
|
|
|
+ teaList:[],
|
|
|
+ courseList: []
|
|
|
+ }
|
|
|
+ data.courseList.push(item)
|
|
|
+ this.goodsTeacher.push(data)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.goodsTeacher.forEach((item) => {
|
|
|
+ if(item.courseList && item.courseList.length > 0){
|
|
|
+ item.courseList[0].show = 1
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //没有双师资模板
|
|
|
+ rows.forEach((item) => {
|
|
|
+ item.show = 1
|
|
|
+ let data = {
|
|
|
+ teaList:[],
|
|
|
+ courseList: []
|
|
|
+ }
|
|
|
+ data.courseList.push(item)
|
|
|
+ this.goodsTeacher.push(data)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ console.log(this.goodsTeacher,'this.goodsTeacher', this.courseId);
|
|
|
+ this.goodsTeacher.forEach((item) => {
|
|
|
+ if(item.courseList.some(x => x.courseId == this.courseId)){
|
|
|
+ this.teacherList = item.teaList
|
|
|
+ }
|
|
|
+ })
|
|
|
+ console.log(this.teacherList,'this.teacherList');
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
// 原来onshow里面的内容
|
|
|
originOnShow() {
|
|
|
console.log('原来onshow里面的originOnShow')
|
|
@@ -974,17 +1073,72 @@ export default {
|
|
|
closePop() {
|
|
|
this.toggleCourseShow = false
|
|
|
},
|
|
|
+ //切换老师
|
|
|
+ switchTeacher(data, tindex){
|
|
|
+ console.log(data,'data');
|
|
|
+ this.teaIndex = tindex
|
|
|
+ this.goodsTeacher.forEach((item,index) => {
|
|
|
+ if(item.teaList && item.teaList.length > 0){
|
|
|
+ let list = item.teaList.filter(x => x.aliasName == data.aliasName)
|
|
|
+ if(list && list.length > 0){
|
|
|
+ item.courseList.forEach((course,courseIndex) => {
|
|
|
+ if(course.courseId == data.courseId){
|
|
|
+ console.log(index,'index');
|
|
|
+ console.log(courseIndex,'courseIndex');
|
|
|
+ this.$set(this.goodsTeacher[index].courseList[courseIndex],"show",1)
|
|
|
+ }else{
|
|
|
+ this.$set(this.goodsTeacher[index].courseList[courseIndex],"show",0)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ console.log('切换后的this.goodsTeacher, ', this.goodsTeacher)
|
|
|
+ },
|
|
|
+ async activeFunc(item, index) {
|
|
|
+ console.log('item', item, this.goodsTeacher)
|
|
|
+ this.teacherIndex = index
|
|
|
+ let findResult = ''
|
|
|
+ this.goodsTeacher.forEach((citem,index) => {
|
|
|
+ citem.courseList.forEach((e, e_index) => {
|
|
|
+ if (e.courseId == item.courseId) {
|
|
|
+ findResult = e
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ console.log('findResult:', findResult)
|
|
|
+ this.jump(findResult, 1)
|
|
|
+ // return
|
|
|
+ // this.vid = ''
|
|
|
+ // this.hasStart = true
|
|
|
+ // await this.originUnload()
|
|
|
+ // this.reStart = false
|
|
|
+ // this.courseId = item.courseId
|
|
|
+ // this.gradeId = findResult.gradeId
|
|
|
+ // console.log('切换老师', item.courseId, item.gradeId)
|
|
|
+ // this.originOnShow()
|
|
|
+ // this.originMounted()
|
|
|
+ },
|
|
|
// 进入学习
|
|
|
- async jump(item, index) {
|
|
|
- console.log('item------>', item,'courseId:',item.courseId, 'goodsId:', this.goodsId, 'orderGoodsId:',item.orderGoodsId)
|
|
|
+ async jump(item, index, type) {
|
|
|
+ // console.log('item------>', index,item,'courseId:',item.courseId, 'goodsId:', this.goodsId, 'orderGoodsId:',item.orderGoodsId)
|
|
|
this.vid = ''
|
|
|
this.hasStart = true
|
|
|
await this.originUnload()
|
|
|
- // return
|
|
|
+
|
|
|
+ if (type) {
|
|
|
+ this.goodsTeacher.forEach((citem) => {
|
|
|
+ if(citem.courseList.some(x => x.courseId == item.courseId)){
|
|
|
+ this.teacherList = citem.teaList
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
this.reStart = false
|
|
|
this.courseId = item.courseId
|
|
|
this.gradeId = item.gradeId
|
|
|
this.toggleCourseShow = false
|
|
|
+ this.teacherIndex = type ? this.teaIndex : 0
|
|
|
|
|
|
if (index == 0) {
|
|
|
if (item.rebuild === 0) {
|
|
@@ -1306,7 +1460,6 @@ export default {
|
|
|
this.menuList = [];
|
|
|
this.$nextTick(() => {
|
|
|
this.menuList = res.data.rows;
|
|
|
- console.log('nextTick==', this.menuList)
|
|
|
});
|
|
|
}
|
|
|
});
|
|
@@ -1421,7 +1574,10 @@ export default {
|
|
|
}).then(res => {
|
|
|
let nowTime = Number(new Date().getTime()/1000).toFixed(0)
|
|
|
// this.livingItem = res.data.data[0]
|
|
|
+ console.log('res.data.data---', res.data.data)
|
|
|
+ if (res.data.data) {
|
|
|
this.livingItem = res.data.data.find(item => item.liveStartTime<=nowTime&&item.liveEndTime>nowTime);
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
getbaseprofiletplists() {
|