|
|
@@ -12,7 +12,8 @@
|
|
|
<view>{{ danyuanInfo.danyuanName }}</view>
|
|
|
<view>{{ danyuanInfo.danyuanIntro }}</view>
|
|
|
</view>
|
|
|
- <view class="arrow-icon right-icon" @click="next" :class="{ 'disabled': currentIndex == list.length - 1 }"> </view>
|
|
|
+ <view class="arrow-icon right-icon" @click="next"
|
|
|
+ :class="{ 'disabled': currentIndex == dagangList.length - 1 }"> </view>
|
|
|
</view>
|
|
|
<view class="xx-scroll-body">
|
|
|
<view class="xx-jd-box">
|
|
|
@@ -25,15 +26,20 @@
|
|
|
<view class="jxxx-btn" @click="handlePlay(subjectDetail,'jixu')"></view>
|
|
|
</view>
|
|
|
<view class="jd-item-box">
|
|
|
- <view class="jd-item-btn"><icon class="dydg-icon"></icon>单元大纲</view>
|
|
|
- <view class="jd-item-btn"><icon class="dyml-icon"></icon>单元目录</view>
|
|
|
+ <view class="jd-item-btn">
|
|
|
+ <icon class="dydg-icon"></icon>单元大纲
|
|
|
+ </view>
|
|
|
+ <view class="jd-item-btn">
|
|
|
+ <icon class="dyml-icon"></icon>单元目录
|
|
|
+ </view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
</view>
|
|
|
<view class="xx-item-list">
|
|
|
- <view class="xx-item-box" v-for="section in dagangList" :key="section.jieId" >
|
|
|
- <view class="xx-item-status" :class="section.wanchengFlag === 1 ? 'completed-status' : 'uncompleted-status'"> </view>
|
|
|
- <img :src="section.cover"/>
|
|
|
+ <view class="xx-item-box" v-for="section in dagangList" :key="section.jieId">
|
|
|
+ <view class="xx-item-status"
|
|
|
+ :class="section.wanchengFlag === 1 ? 'completed-status' : 'uncompleted-status'"> </view>
|
|
|
+ <img :src="section.cover" />
|
|
|
<view class="xx-text-box">
|
|
|
<view>{{ section.jieName }}</view>
|
|
|
<view>{{ section.jieIntro }}</view>
|
|
|
@@ -42,12 +48,12 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
</view>
|
|
|
<!-- 底部占位 -->
|
|
|
<view class="xx-next-btn">学习下一单元</view>
|
|
|
<view class="xx-xw-text">课程已学完</view>
|
|
|
-
|
|
|
+
|
|
|
<!-- <scroll-view scroll-y class="scroll-view" :scroll-top="scrollTop" @scroll="onScroll"> </scroll-view> -->
|
|
|
|
|
|
<danyuanInfoVue ref="dyRef" v-if="isShow" @close="isShow= false"></danyuanInfoVue>
|
|
|
@@ -70,8 +76,15 @@
|
|
|
currentUnitName: "",
|
|
|
isShow: true,
|
|
|
currentIndex: 0,
|
|
|
- danyuanInfo:{}
|
|
|
-
|
|
|
+ danyuanInfo: {},
|
|
|
+ banbenId: '',
|
|
|
+ danyuanId: '',
|
|
|
+ typeId: '',
|
|
|
+ fontDanyuanId: '',
|
|
|
+ nextDanyuanId: ''
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
|
@@ -86,21 +99,47 @@
|
|
|
console.log('学习页面隐藏,保存滚动位置')
|
|
|
},
|
|
|
|
|
|
- onLoad() {
|
|
|
-
|
|
|
+ onLoad(options) {
|
|
|
+ console.log('options', options);
|
|
|
+ this.typeId = options.typeId
|
|
|
+ this.danyuanId = options.danyuanId
|
|
|
+ this.banbenId = options.banbenId
|
|
|
this.loadDataFromApi()
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
+
|
|
|
+ loadDataFromApi() {
|
|
|
+ const req = {
|
|
|
+ banbenId: this.banbenId,
|
|
|
+ danyuanId: this.danyuanId
|
|
|
+ }
|
|
|
+ shuxueChanpinDanyuanInfo(req).then(res => {
|
|
|
+ this.danyuanInfo = res.data
|
|
|
+ this.fontDanyuanId = res.data.fontDanyuanId
|
|
|
+ this.nextDanyuanId = res.data.nextDanyuanId
|
|
|
+ this.dagangList = res.data.dagangList || []
|
|
|
+ // 初始化当前单元
|
|
|
+ // if (this.danyuanList.length > 0) {
|
|
|
+ // this.currentUnitName = this.danyuanList[0].danyuanName
|
|
|
+ // }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
prev() {
|
|
|
if (this.currentIndex > 0) {
|
|
|
this.currentIndex--
|
|
|
+ this.danyuanId = this.fontDanyuanId
|
|
|
+ this.loadDataFromApi()
|
|
|
}
|
|
|
+
|
|
|
},
|
|
|
next() {
|
|
|
- if (this.currentIndex < this.list.length - 1) {
|
|
|
+ if (this.currentIndex < this.dagangList.length - 1) {
|
|
|
this.currentIndex++
|
|
|
+ this.danyuanId = this.nextDanyuanId
|
|
|
+ this.loadDataFromApi()
|
|
|
}
|
|
|
},
|
|
|
|
|
|
@@ -132,21 +171,6 @@
|
|
|
}, 100)
|
|
|
},
|
|
|
|
|
|
- loadDataFromApi() {
|
|
|
- const req = {
|
|
|
- banbenId: 7,
|
|
|
- danyuanId:2
|
|
|
- }
|
|
|
- shuxueChanpinDanyuanInfo(req).then(res => {
|
|
|
- this.danyuanInfo = res.data
|
|
|
- this.dagangList = res.data.dagangList || []
|
|
|
- // 初始化当前单元
|
|
|
- // if (this.danyuanList.length > 0) {
|
|
|
- // this.currentUnitName = this.danyuanList[0].danyuanName
|
|
|
- // }
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
@@ -160,4 +184,4 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-</script>
|
|
|
+</script>
|