|
@@ -61,14 +61,36 @@ export default {
|
|
|
openChapter(item){
|
|
|
this.down = !this.down
|
|
|
if(!this.down&&this.list.length==0){
|
|
|
- if(this.isRebuild){
|
|
|
- this.getReSectionList(item.id,item.courseId,item.moduleId)
|
|
|
+ console.log(item.id,69)
|
|
|
+ if(this.isBuy){
|
|
|
+ if(this.isRebuild){
|
|
|
+ this.getReSectionList(item.id,item.courseId,item.moduleId)
|
|
|
+ }else{
|
|
|
+ this.getBuySectionList(item.id,item.courseId,item.moduleId)
|
|
|
+ }
|
|
|
}else{
|
|
|
this.getSectionList(item.id)
|
|
|
}
|
|
|
|
|
|
}
|
|
|
},
|
|
|
+ getSectionList(chapterId) {
|
|
|
+ let self = this
|
|
|
+ this.$api.sectionList(chapterId).then(res => {
|
|
|
+ if(res.data.code==200){
|
|
|
+ for(let i=0;i<res.data.data.length;i++){
|
|
|
+ let item = res.data.data[i]
|
|
|
+ item.id = item.sectionId
|
|
|
+ //判断是否试听
|
|
|
+ item.tryListen = false
|
|
|
+ if(self.goodsAuditionConfigIdList.indexOf(item.id)!==-1){
|
|
|
+ item.tryListen = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ self.list = res.data.data
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
getReSectionList(chapterId,courseId,moduleId) {
|
|
|
let self = this
|
|
|
this.$api.reSectionList({chapterId:chapterId,gradeId:this.gradeId,courseId:courseId,rebuild:1,moduleId:moduleId}).then(res => {
|
|
@@ -86,9 +108,9 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- getSectionList(chapterId) {
|
|
|
+ getBuySectionList(chapterId,courseId,moduleId) {
|
|
|
let self = this
|
|
|
- this.$api.sectionList(chapterId).then(res => {
|
|
|
+ this.$api.reSectionList({chapterId:chapterId,gradeId:this.gradeId,courseId:courseId,moduleId:moduleId}).then(res => {
|
|
|
if(res.data.code==200){
|
|
|
for(let i=0;i<res.data.data.length;i++){
|
|
|
let item = res.data.data[i]
|