|
|
@@ -16,6 +16,9 @@
|
|
|
<text class="course-name">等级:{{ subjectDetail.dengjiName }}</text>
|
|
|
<text class="course-name">版本:{{ subjectDetail.dengjiName }}</text>
|
|
|
<text class="course-name">单元:{{ subjectDetail.curDanyuanName }}</text>
|
|
|
+ <progress :percent="20" class="exam-progress-box"
|
|
|
+ stroke-width="10" backgroundColor="#3c7dfd" activeColor="#ffd11c"/>
|
|
|
+ <text class="course-name">继续学习</text>
|
|
|
</view>
|
|
|
<!-- 单元列表 -->
|
|
|
<view v-for="(unit, index) in danyuanList" :key="unit.danyuanId" :id="'unit-' + index" class="unit-item">
|
|
|
@@ -24,7 +27,7 @@
|
|
|
<text class="unit-name">{{ unit.danyuanName }}</text>
|
|
|
<text class="unit-intro">{{ unit.danyuanIntro }}</text>
|
|
|
</view>
|
|
|
-
|
|
|
+ <text class="unit-name">{{ unit.danyuanName }}</text>
|
|
|
<!-- 节列表 -->
|
|
|
<view v-for="section in unit.jieList" :key="section.jieId" class="section-item">
|
|
|
<view class="status" :class="section.wanchengFlag === 1 ? 'completed' : 'uncompleted'">
|
|
|
@@ -72,7 +75,7 @@
|
|
|
CustomTabBar
|
|
|
},
|
|
|
onShow() {
|
|
|
- debugger
|
|
|
+
|
|
|
console.log('学习页面显示,尝试恢复滚动位置')
|
|
|
// 如果没有恢复过,从缓存恢复
|
|
|
if (!this.hasRestoredScroll) {
|
|
|
@@ -82,18 +85,18 @@
|
|
|
|
|
|
// 新增:页面隐藏时保存滚动位置
|
|
|
onHide() {
|
|
|
- debugger
|
|
|
+
|
|
|
console.log('学习页面隐藏,保存滚动位置')
|
|
|
this.saveScrollPosition()
|
|
|
},
|
|
|
|
|
|
onLoad() {
|
|
|
- debugger
|
|
|
+
|
|
|
this.loadDataFromApi()
|
|
|
},
|
|
|
|
|
|
onReady() {
|
|
|
- debugger
|
|
|
+
|
|
|
// 页面渲染完成后执行
|
|
|
setTimeout(() => {
|
|
|
this.getUnitPositions();
|
|
|
@@ -194,6 +197,7 @@
|
|
|
|
|
|
// 更新当前显示的单元
|
|
|
updateCurrentUnit(scrollTop) {
|
|
|
+
|
|
|
const query = uni.createSelectorQuery().in(this);
|
|
|
|
|
|
for (let i = 0; i < this.danyuanList.length; i++) {
|