|
|
@@ -33,7 +33,8 @@
|
|
|
|
|
|
<view v-for="(danyuanItem, index) in danyuanList" :key="danyuanItem.danyuanId">
|
|
|
<!-- 单元标题(带唯一ID,用于位置查询) -->
|
|
|
- <ezyActiveVue class="ezy-list-item-active item-dy-box" @aclick="handleClickDanyuan(danyuanItem.danyuanId)" :id="`unit-title-${danyuanItem.danyuanId}`">
|
|
|
+ <ezyActiveVue class="ezy-list-item-active item-dy-box"
|
|
|
+ @aclick="handleClickDanyuan(danyuanItem.danyuanId)" :id="`unit-title-${danyuanItem.danyuanId}`">
|
|
|
<view class="dy-left-box">L{{banbenInfo.dengjiId}}</view>
|
|
|
<view class="dy-right-box">
|
|
|
<view class="right-content">
|
|
|
@@ -52,7 +53,7 @@
|
|
|
<view>{{ jieItem.jieName }}</view>
|
|
|
<view>{{ jieItem.jieIntro }}</view>
|
|
|
</view>
|
|
|
- <view v-if="jieItem.lock" class="xx-item-btn-lock">锁</view>
|
|
|
+ <view v-if="jieItem.lock" class="xx-item-btn-lock">锁</view>
|
|
|
<view v-else class="xx-item-btn"></view>
|
|
|
</ezyActiveVue>
|
|
|
</view>
|
|
|
@@ -128,7 +129,7 @@
|
|
|
danyuanInfoVue,
|
|
|
ezyActiveVue
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
onHide() {
|
|
|
console.log('学习页面隐藏')
|
|
|
},
|
|
|
@@ -139,13 +140,11 @@
|
|
|
initData(banbenId) {
|
|
|
console.log('123111');
|
|
|
const cacheData = cacheManager.get('contentInfo');
|
|
|
-
|
|
|
if (cacheData) {
|
|
|
console.log('使用缓存数据');
|
|
|
this.updateFromCache();
|
|
|
} else {
|
|
|
console.log('重新请求数据');
|
|
|
- const cacheDataAuth = cacheManager.get('auth');
|
|
|
this.initFromOptions(banbenId);
|
|
|
}
|
|
|
},
|
|
|
@@ -165,7 +164,7 @@
|
|
|
},
|
|
|
|
|
|
initFromOptions(banbenId) {
|
|
|
-
|
|
|
+
|
|
|
this.loadDataFromApi(banbenId);
|
|
|
},
|
|
|
// 从缓存更新数据方法
|
|
|
@@ -187,6 +186,10 @@
|
|
|
},
|
|
|
|
|
|
loadDataFromApi(banbenId) {
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中'
|
|
|
+ });
|
|
|
+
|
|
|
this.banbenInfo = {}
|
|
|
this.curProcess = ''
|
|
|
this.danyuanList = []
|
|
|
@@ -209,10 +212,12 @@
|
|
|
banbenId: banbenId,
|
|
|
};
|
|
|
cacheManager.set('contentInfo', cacheData);
|
|
|
+ uni.hideLoading();
|
|
|
}
|
|
|
}).catch(res => {
|
|
|
cacheManager.remove("contentInfo");
|
|
|
toast("加载失败,请重试");
|
|
|
+ uni.hideLoading();
|
|
|
});
|
|
|
},
|
|
|
|
|
|
@@ -291,13 +296,13 @@
|
|
|
},
|
|
|
handlePlay(da, code) {
|
|
|
|
|
|
- if (da.lock && code == 'play') {
|
|
|
- // 加锁视频需要购买
|
|
|
- uni.navigateTo({
|
|
|
- url: "/pages/chanpinShop/cp1/dingdan"
|
|
|
- })
|
|
|
- return;
|
|
|
- }
|
|
|
+ if (da.lock && code == 'play') {
|
|
|
+ // 加锁视频需要购买
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "/pages/chanpinShop/cp1/dingdan"
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
let jieId = code === 'jixu' ? da.curJieId : da.jieId;
|
|
|
if (!jieId) {
|
|
|
toast("无课程ID");
|
|
|
@@ -330,4 +335,4 @@
|
|
|
|
|
|
}
|
|
|
}
|
|
|
-</script>
|
|
|
+</script>
|