|
|
@@ -7,13 +7,12 @@
|
|
|
<view class="xxjl-card-box">
|
|
|
<!-- 显示内容 -->
|
|
|
<view class="card-body-box">
|
|
|
- <img :src="banbenInfo.cover" />
|
|
|
+ <img :src="neirongInfo.cover" />
|
|
|
<view class="body-right">
|
|
|
- <view class="right-name">{{ banbenInfo.chanpinName }}</view>
|
|
|
- <view>等级:{{banbenInfo.dengjiName}}</view>
|
|
|
- <view>版本:{{banbenInfo.name}}</view>
|
|
|
- <view>单元:{{banbenInfo.curDanyuanName}}</view>
|
|
|
- <view>课程:{{banbenInfo.curKechengName}}</view>
|
|
|
+ <view class="right-name">{{ neirongInfo.chanpinName }}</view>
|
|
|
+ <view>等级:{{neirongInfo.dengjiName}}</view>
|
|
|
+ <view>版本:{{neirongInfo.name}}</view>
|
|
|
+ <view>课程:{{neirongInfo.curKechengName}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="card-progress-box">
|
|
|
@@ -22,7 +21,7 @@
|
|
|
<progress :percent="curProcess" class="xx-progress" stroke-width="20"
|
|
|
backgroundColor="#3c7dfd" activeColor="#ffd11c" />
|
|
|
</view>
|
|
|
- <ezyActiveVue class="ezy-btn-active jxxx-btn" @aclick="handlePlay(banbenInfo,'jixu')">
|
|
|
+ <ezyActiveVue class="ezy-btn-active jxxx-btn" @aclick="handlePlay(neirongInfo,'jixu')">
|
|
|
</ezyActiveVue>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -31,29 +30,17 @@
|
|
|
<view class="xx-item-list">
|
|
|
<view class="xx-item-title">— 以下为当前等级课程目录 —</view>
|
|
|
|
|
|
- <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}`">
|
|
|
- <view class="dy-left-box">L{{banbenInfo.dengjiId}}</view>
|
|
|
- <view class="dy-right-box">
|
|
|
- <view class="right-content">
|
|
|
- <view>{{danyuanItem.danyuanName}}</view>
|
|
|
- <view class="dy-name">{{danyuanItem.danyuanIntro}}</view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </ezyActiveVue>
|
|
|
+ <view v-for="(item, index) in jieList" :key="item.jieId">
|
|
|
<!-- 节列表 -->
|
|
|
- <ezyActiveVue class="ezy-list-item-active xx-item-box" v-for="jieItem in danyuanItem.jieList"
|
|
|
- :key="jieItem.jieId" @aclick="handlePlay(jieItem,'play')">
|
|
|
+ <ezyActiveVue class="ezy-list-item-active xx-item-box" @aclick="handlePlay(item,'play')">
|
|
|
<view class="xx-item-status"
|
|
|
- :class="jieItem.wanchengFlag == 1 ? 'completed-status' : 'uncompleted-status'"></view>
|
|
|
- <img :src="jieItem.cover" />
|
|
|
+ :class="item.wanchengFlag == 1 ? 'completed-status' : 'uncompleted-status'"></view>
|
|
|
+ <img :src="item.cover" />
|
|
|
<view class="xx-text-box">
|
|
|
- <view>{{ jieItem.jieName }}</view>
|
|
|
- <view>{{ jieItem.jieIntro }}</view>
|
|
|
+ <view>{{ item.jieName }}</view>
|
|
|
+ <view>{{ item.jieIntro }}</view>
|
|
|
</view>
|
|
|
- <view v-if="jieItem.lock" class="xx-item-lock-btn"></view>
|
|
|
+ <view v-if="item.lock" class="xx-item-lock-btn"></view>
|
|
|
<view v-else class="xx-item-btn"></view>
|
|
|
</ezyActiveVue>
|
|
|
</view>
|
|
|
@@ -101,16 +88,16 @@
|
|
|
updateChanpin2Process
|
|
|
} from "./useNeirongChanpin2"
|
|
|
import tipSmallDialog from "@/components/dialog/tipSmallDialog.vue";
|
|
|
-
|
|
|
+ // 产品2 计算特训
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
canExitApp: false,
|
|
|
|
|
|
- danyuanList: [],
|
|
|
- banbenInfo: {},
|
|
|
+ jieList: [],
|
|
|
+ neirongInfo: {},
|
|
|
banbenId: '',
|
|
|
- danyuanId: '',
|
|
|
+ jieId: '',
|
|
|
chanpinId: '',
|
|
|
dengjiId: '',
|
|
|
curProcess: '',
|
|
|
@@ -185,15 +172,15 @@
|
|
|
const cacheData = cacheManager.get('contentInfo');
|
|
|
console.log('cacheData 从缓存更新数据方法', cacheData);
|
|
|
if (cacheData) {
|
|
|
- this.banbenInfo = {
|
|
|
+ this.neirongInfo = {
|
|
|
...cacheData
|
|
|
};
|
|
|
this.curProcess = cacheData.curProcess;
|
|
|
- this.danyuanList = [...(cacheData.danyuanList || [])];
|
|
|
- this.banbenId = cacheData.banbenId
|
|
|
+ this.jieList = [...(cacheData.jieList || [])];
|
|
|
+ this.dengjiId = cacheData.dengjiId
|
|
|
|
|
|
|
|
|
- if (this.danyuanList.length == 0) {
|
|
|
+ if (this.jieList.length == 0) {
|
|
|
this.existData = false
|
|
|
} else {
|
|
|
this.existData = true
|
|
|
@@ -211,27 +198,27 @@
|
|
|
title: '加载中'
|
|
|
});
|
|
|
this.dengjiId = dengjiId
|
|
|
- this.banbenInfo = {}
|
|
|
+ this.neirongInfo = {}
|
|
|
this.curProcess = ''
|
|
|
- this.danyuanList = []
|
|
|
+ this.jieList = []
|
|
|
const req = {
|
|
|
dengjiId: dengjiId
|
|
|
}
|
|
|
shuxueChanpinDengjiInfo(req).then(res => {
|
|
|
if (res.code === 0) {
|
|
|
|
|
|
- this.banbenInfo = res.data;
|
|
|
- this.banbenInfo.danyuanId = res.data.curDanyuanId;
|
|
|
+ this.neirongInfo = res.data;
|
|
|
+ this.neirongInfo.jieId = res.data.curJieId;
|
|
|
this.curProcess = res.data.curProcess * 100;
|
|
|
- this.danyuanList = res.data.danyuanList || [];
|
|
|
- if (this.danyuanList.length == 0) {
|
|
|
+ this.jieList = res.data.jieList || [];
|
|
|
+ if (this.jieList.length == 0) {
|
|
|
this.existData = false
|
|
|
} else {
|
|
|
this.existData = true
|
|
|
}
|
|
|
const cacheData = {
|
|
|
...res.data,
|
|
|
- banbenId: banbenId,
|
|
|
+ dengjiId: dengjiId,
|
|
|
};
|
|
|
cacheManager.set('contentInfo', cacheData);
|
|
|
uni.hideLoading();
|
|
|
@@ -251,7 +238,7 @@
|
|
|
},
|
|
|
|
|
|
getJieAndDanyuan(data, jieId) {
|
|
|
- for (let danyuan of data.danyuanList) {
|
|
|
+ for (let danyuan of data.jieList) {
|
|
|
for (let jie of danyuan.jieList) {
|
|
|
if (jie.jieId == jieId) {
|
|
|
return {
|
|
|
@@ -267,23 +254,23 @@
|
|
|
async saveAndNavigate(jieId, type, da, code) {
|
|
|
|
|
|
console.log('this.banbenId', this.banbenId);
|
|
|
- console.log('this.danyuanIddanyuanId', da.danyuanId);
|
|
|
+ console.log('this.danyuanIddanyuanId', da.jieId);
|
|
|
if (code == 'jixu') {
|
|
|
- if (!this.banbenId || !da.danyuanId) {
|
|
|
- toast("banbenId或者danyuanId 丢失")
|
|
|
+ if (!this.banbenId || !da.jieId) {
|
|
|
+ toast("banbenId或者jieId 丢失")
|
|
|
return false
|
|
|
}
|
|
|
}
|
|
|
|
|
|
let req = {
|
|
|
"banbenId": this.banbenId,
|
|
|
- "danyuanId": da.danyuanId,
|
|
|
+ "jieId": da.jieId,
|
|
|
"jieId": jieId
|
|
|
}
|
|
|
console.log('req', req);
|
|
|
const res = await shuxueSave(req);
|
|
|
if (res.code == 0) {
|
|
|
- let curJieAndDanyuan = this.getJieAndDanyuan(this.banbenInfo, jieId);
|
|
|
+ let curJieAndDanyuan = this.getJieAndDanyuan(this.neirongInfo, jieId);
|
|
|
if (!curJieAndDanyuan) {
|
|
|
toast("未找到课程信息");
|
|
|
return false;
|
|
|
@@ -292,7 +279,7 @@
|
|
|
const cacheData = cacheManager.get('contentInfo') || {};
|
|
|
cacheData.curDanyuanName = curJieAndDanyuan.danyuan.danyuanName;
|
|
|
cacheData.curKechengName = curJieAndDanyuan.jie.jieIntro;
|
|
|
- cacheData.danyuanId = curJieAndDanyuan.jie.danyuanId;
|
|
|
+ cacheData.jieId = curJieAndDanyuan.jie.jieId;
|
|
|
cacheData.curJieId = jieId;
|
|
|
cacheData.type = curJieAndDanyuan.jie.type;
|
|
|
cacheManager.set('contentInfo', cacheData);
|
|
|
@@ -329,16 +316,16 @@
|
|
|
}
|
|
|
this.saveAndNavigate(jieId, da.type, da, code);
|
|
|
},
|
|
|
- handleClickDanyuan(danyuanId) {
|
|
|
+ handleClickDanyuan(jieId) {
|
|
|
|
|
|
- if (!danyuanId) {
|
|
|
- toast("danyuanId丢失")
|
|
|
+ if (!jieId) {
|
|
|
+ toast("jieId丢失")
|
|
|
return false
|
|
|
}
|
|
|
this.isShow = true;
|
|
|
setTimeout(() => {
|
|
|
// 更新为点击的动态单元Id [临时]
|
|
|
- this.$refs.dyRef.handleShow(danyuanId)
|
|
|
+ this.$refs.dyRef.handleShow(jieId)
|
|
|
}, 100)
|
|
|
},
|
|
|
handleBack() {
|