|
@@ -68,12 +68,14 @@
|
|
|
>试看</span
|
|
|
>
|
|
|
</div>
|
|
|
- <div class="goods-menu clearfix">
|
|
|
+ <div v-for="(courseItem, index) in goodsTeacher" :key="index">
|
|
|
+ <div class="goods-menu clearfix" >
|
|
|
<div class="left-box">
|
|
|
<div class="left-box__body">
|
|
|
<div
|
|
|
class="course-list-item"
|
|
|
- v-for="(course, index) in courseList"
|
|
|
+ v-for="(course, index) in courseItem.courseList"
|
|
|
+ v-if="course.show == 1"
|
|
|
:key="index"
|
|
|
>
|
|
|
<div
|
|
@@ -88,6 +90,10 @@
|
|
|
></i>
|
|
|
{{ course.courseName }}
|
|
|
</div>
|
|
|
+ <span v-if="courseItem.teaList && courseItem.teaList.length > 0" v-for="(tea, index) in courseItem.teaList" :key="index">
|
|
|
+ <el-button type="info" @click="switchTeacher(tea)" round>{{tea.aliasName}}</el-button>
|
|
|
+ </span
|
|
|
+ >
|
|
|
<template v-if="course.showList">
|
|
|
<div
|
|
|
class="item"
|
|
@@ -281,6 +287,7 @@
|
|
|
</ul>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ </div>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="学员须知" name="3">
|
|
|
<div
|
|
@@ -503,6 +510,7 @@ export default {
|
|
|
standPrice: 0,
|
|
|
},
|
|
|
courseList: [],
|
|
|
+ goodsTeacher: [],
|
|
|
goodsId: "",
|
|
|
checked: false,
|
|
|
textarea: "",
|
|
@@ -1536,6 +1544,26 @@ export default {
|
|
|
}
|
|
|
this.getRecommend();
|
|
|
});
|
|
|
+ },
|
|
|
+ //切换老师
|
|
|
+ switchTeacher(data){
|
|
|
+ console.log(data,'data');
|
|
|
+ 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)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
/**
|
|
|
* 是否是试做
|
|
@@ -1552,6 +1580,71 @@ export default {
|
|
|
item.showList = false;
|
|
|
item.list = [];
|
|
|
});
|
|
|
+ //获取商品双师资模板
|
|
|
+ this.$request.getGoodsCourseTeacher({
|
|
|
+ goodsId: this.goodsId
|
|
|
+ }).then((res1) => {
|
|
|
+ console.log(res1,'res1');
|
|
|
+ if(res1.data && res1.data.length > 0){
|
|
|
+ //课程老师模板
|
|
|
+ let teacherTel = res1.data;
|
|
|
+ //商品课程
|
|
|
+ let courses = res.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{
|
|
|
+ //没有双师资模板
|
|
|
+ res.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.courseList = res.rows;
|
|
|
|
|
|
if (this.needOpen) {
|