|
|
@@ -3,7 +3,7 @@
|
|
|
<view class="icon-title-navBar-box">
|
|
|
<text class="nav-bar-title">学习</text>
|
|
|
</view>
|
|
|
- <view class="ezy-page-body xuexi-page-body">
|
|
|
+ <view v-if="existData" class="ezy-page-body xuexi-page-body">
|
|
|
<view class="xxjl-card-box">
|
|
|
<!-- 显示内容 -->
|
|
|
<view class="card-body-box">
|
|
|
@@ -28,14 +28,17 @@
|
|
|
<view class="xx-scroll-body">
|
|
|
<view class="xx-item-list">
|
|
|
<view class="xx-item-title">— 以下为当前等级课程目录 —</view>
|
|
|
- <view v-for="danyuanItem in danyuanList" :key="danyuanItem.danyuanId">
|
|
|
+ <scroll-view v-for="danyuanItem in danyuanList" :key="danyuanItem.danyuanId">
|
|
|
+ <!-- 第一单元 -->
|
|
|
<view class="item-dy-box" @click="handleClickDanyuan">
|
|
|
- <view class="dy-left-box">L{{danyuanItem.danyuanId}}</view>
|
|
|
+ <view class="dy-left-box">L{{banbenInfo.dengjiId}}</view>
|
|
|
<view class="dy-right-box">
|
|
|
<view class="dy-name">{{danyuanItem.danyuanName}}</view>
|
|
|
<view>{{danyuanItem.danyuanIntro}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <!-- 其他单元 -->
|
|
|
+ <view class="xx-item-title">— {{danyuanItem.danyuanName}} {{danyuanItem.danyuanIntro}} —</view>
|
|
|
<view class="xx-item-box" v-for="jieItem in danyuanItem.jieList" :key="jieItem.jieId"
|
|
|
@click="handlePlay(jieItem,'play')">
|
|
|
<view class="xx-item-status"
|
|
|
@@ -47,12 +50,15 @@
|
|
|
</view>
|
|
|
<view class="xx-item-btn"></view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </scroll-view >
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
+ <view v-if="!existData">
|
|
|
+
|
|
|
+ </view>
|
|
|
<danyuanInfoVue ref="dyRef" v-if="isShow" @close="isShow= false"></danyuanInfoVue>
|
|
|
<custom-tab-bar :show="true" :current-index="currentTabIndex" />
|
|
|
<!-- 回到顶部 -->
|
|
|
@@ -93,7 +99,8 @@
|
|
|
currentTabIndex: 1,
|
|
|
cacheManagerLocal: null,
|
|
|
hasCache: false, // 是否有缓存的标志
|
|
|
- needRefresh: false // 是否需要刷新数据的标志
|
|
|
+ needRefresh: false, // 是否需要刷新数据的标志
|
|
|
+ existData: true
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
|
@@ -101,7 +108,7 @@
|
|
|
danyuanInfoVue
|
|
|
},
|
|
|
onShow() {
|
|
|
- // console.log('学习页面显示,使用缓存数据')
|
|
|
+ // console.log('学习页面显示,使用缓存数据')
|
|
|
this.currentTabIndex = 1
|
|
|
const cacheData = cacheManager.get('xuexi-shuxue');
|
|
|
// cacheData && this.shouldUseCache(options, cacheData)
|
|
|
@@ -134,7 +141,7 @@
|
|
|
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
- // debugger
|
|
|
+ // debugger
|
|
|
uni.hideTabBar()
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -192,6 +199,9 @@
|
|
|
this.curProcess = res.data.curProcess;
|
|
|
this.danyuanList = res.data.danyuanList || [];
|
|
|
|
|
|
+ if (!this.danyuanList) {
|
|
|
+ this.existData = false
|
|
|
+ }
|
|
|
// 保存到缓存(新增了参数保存)
|
|
|
const cacheData = {
|
|
|
...res.data,
|
|
|
@@ -234,12 +244,12 @@
|
|
|
},
|
|
|
// 统一保存和跳转方法
|
|
|
async saveAndNavigate(jieId, type) {
|
|
|
-
|
|
|
- if(!this.banbenId ||!this.danyuanId){
|
|
|
+
|
|
|
+ if (!this.banbenId || !this.danyuanId) {
|
|
|
toast("banbenId或者danyuanId 丢失")
|
|
|
return false
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
let req = {
|
|
|
"banbenId": this.banbenId,
|
|
|
"danyuanId": this.danyuanId,
|
|
|
@@ -302,7 +312,7 @@
|
|
|
this.saveAndNavigate(jieId, da.type);
|
|
|
},
|
|
|
handleClickDanyuan() {
|
|
|
- if(!this.danyuanId){
|
|
|
+ if (!this.danyuanId) {
|
|
|
toast("this.danyuanId丢失")
|
|
|
return false
|
|
|
}
|