|
@@ -7,12 +7,13 @@
|
|
|
<view class="xxjl-card-box">
|
|
<view class="xxjl-card-box">
|
|
|
<!-- 显示内容 -->
|
|
<!-- 显示内容 -->
|
|
|
<view class="card-body-box">
|
|
<view class="card-body-box">
|
|
|
- <img :src="neirongInfo.cover" />
|
|
|
|
|
|
|
+ <img :src="banbenInfo.cover" />
|
|
|
<view class="body-right">
|
|
<view class="body-right">
|
|
|
- <view class="right-name">{{ neirongInfo.chanpinName }}</view>
|
|
|
|
|
- <view class="right-item right-item-mini">等级:{{neirongInfo.dengjiName}}</view>
|
|
|
|
|
- <view class="right-item">版本:{{neirongInfo.name}}</view>
|
|
|
|
|
- <view>课程:{{neirongInfo.curKechengName}}</view>
|
|
|
|
|
|
|
+ <view class="right-name">{{ banbenInfo.chanpinName }}</view>
|
|
|
|
|
+ <view class="right-item right-item-mini">等级:{{banbenInfo.dengjiName}}</view>
|
|
|
|
|
+ <view class="right-item">版本:{{banbenInfo.name}}</view>
|
|
|
|
|
+ <view class="right-item right-item-mini">单元:{{banbenInfo.curDanyuanName}}</view>
|
|
|
|
|
+ <view class="right-item">课程:{{banbenInfo.curKechengName}}</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="card-progress-box">
|
|
<view class="card-progress-box">
|
|
@@ -21,7 +22,7 @@
|
|
|
<progress :percent="curProcess" class="xx-progress" stroke-width="20"
|
|
<progress :percent="curProcess" class="xx-progress" stroke-width="20"
|
|
|
backgroundColor="#3c7dfd" activeColor="#ffd11c" />
|
|
backgroundColor="#3c7dfd" activeColor="#ffd11c" />
|
|
|
</view>
|
|
</view>
|
|
|
- <ezyActiveVue class="ezy-btn-active jxxx-btn" @aclick="handlePlay(neirongInfo,'jixu')">
|
|
|
|
|
|
|
+ <ezyActiveVue class="ezy-btn-active jxxx-btn" @aclick="handlePlay(banbenInfo,'jixu')">
|
|
|
</ezyActiveVue>
|
|
</ezyActiveVue>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -30,18 +31,29 @@
|
|
|
<view class="xx-item-list">
|
|
<view class="xx-item-list">
|
|
|
<view class="xx-item-title">— 以下为当前等级课程目录 —</view>
|
|
<view class="xx-item-title">— 以下为当前等级课程目录 —</view>
|
|
|
|
|
|
|
|
- <view v-for="(item, index) in dagangList" :key="item.jieId">
|
|
|
|
|
|
|
+ <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>
|
|
|
<!-- 节列表 -->
|
|
<!-- 节列表 -->
|
|
|
- <ezyActiveVue class="ezy-list-item-active xx-item-box" :class="item.lock?'xx-disabled-item-box':''"
|
|
|
|
|
- @aclick="handlePlay(item,'play')">
|
|
|
|
|
|
|
+ <ezyActiveVue class="ezy-list-item-active xx-item-box" :class="jieItem.lock?'xx-disabled-item-box':''" v-for="jieItem in danyuanItem.jieList"
|
|
|
|
|
+ :key="jieItem.jieId" @aclick="handlePlay(jieItem,'play')">
|
|
|
<view class="xx-item-status"
|
|
<view class="xx-item-status"
|
|
|
- :class="item.wanchengFlag == 1 ? 'completed-status' : 'uncompleted-status'"></view>
|
|
|
|
|
- <img :src="item.cover" />
|
|
|
|
|
|
|
+ :class="jieItem.wanchengFlag == 1 ? 'completed-status' : 'uncompleted-status'"></view>
|
|
|
|
|
+ <img :src="jieItem.cover" />
|
|
|
<view class="xx-text-box">
|
|
<view class="xx-text-box">
|
|
|
- <view>{{ item.jieName }}</view>
|
|
|
|
|
- <view>{{ item.jieIntro }}</view>
|
|
|
|
|
|
|
+ <view>{{ jieItem.jieName }}</view>
|
|
|
|
|
+ <view>{{ jieItem.jieIntro }}</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view v-if="item.lock" class="xx-item-lock-btn"></view>
|
|
|
|
|
|
|
+ <view v-if="jieItem.lock" class="xx-item-lock-btn"></view>
|
|
|
<view v-else class="xx-item-btn"></view>
|
|
<view v-else class="xx-item-btn"></view>
|
|
|
</ezyActiveVue>
|
|
</ezyActiveVue>
|
|
|
</view>
|
|
</view>
|
|
@@ -63,8 +75,7 @@
|
|
|
<!-- 弹窗组件 -->
|
|
<!-- 弹窗组件 -->
|
|
|
<danyuanInfoVue ref="dyRef" v-if="isShow" @close="isShow = false"></danyuanInfoVue>
|
|
<danyuanInfoVue ref="dyRef" v-if="isShow" @close="isShow = false"></danyuanInfoVue>
|
|
|
<!-- 购买提示窗 -->
|
|
<!-- 购买提示窗 -->
|
|
|
- <tipSmallDialog ref="gmtRef" content="需要购买当前课程才能学习" @confirm-btn="handleConfirmBtn" qrBtnName="前往购买">
|
|
|
|
|
- </tipSmallDialog>
|
|
|
|
|
|
|
+ <tipSmallDialog ref="gmtRef" content="需要购买当前课程才能学习" @confirm-btn="handleConfirmBtn" qrBtnName="前往购买"></tipSmallDialog>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -74,7 +85,7 @@
|
|
|
import cacheManager from "@/utils/cacheManager.js";
|
|
import cacheManager from "@/utils/cacheManager.js";
|
|
|
import {
|
|
import {
|
|
|
yingyuPinduInfo,
|
|
yingyuPinduInfo,
|
|
|
- shuxueSave2
|
|
|
|
|
|
|
+ shuxueSave
|
|
|
} from "@/api/chanpinneirong.js"
|
|
} from "@/api/chanpinneirong.js"
|
|
|
import {
|
|
import {
|
|
|
onLoad,
|
|
onLoad,
|
|
@@ -90,22 +101,22 @@
|
|
|
updateChanpin4Process
|
|
updateChanpin4Process
|
|
|
} from "./useNeirongChanpin4"
|
|
} from "./useNeirongChanpin4"
|
|
|
import tipSmallDialog from "@/components/dialog/tipSmallDialog.vue";
|
|
import tipSmallDialog from "@/components/dialog/tipSmallDialog.vue";
|
|
|
- // 产品2 计算特训
|
|
|
|
|
|
|
+
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
canExitApp: false,
|
|
canExitApp: false,
|
|
|
|
|
|
|
|
- dagangList: [],
|
|
|
|
|
- neirongInfo: {},
|
|
|
|
|
- banbenId: '',
|
|
|
|
|
- jieId: '',
|
|
|
|
|
|
|
+ danyuanList: [],
|
|
|
|
|
+ banbenInfo: {},
|
|
|
|
|
+ dengjiId: '',
|
|
|
|
|
+ danyuanId: '',
|
|
|
chanpinId: '',
|
|
chanpinId: '',
|
|
|
dengjiId: '',
|
|
dengjiId: '',
|
|
|
curProcess: '',
|
|
curProcess: '',
|
|
|
existData: false,
|
|
existData: false,
|
|
|
isShow: false,
|
|
isShow: false,
|
|
|
- danyuanId: '',
|
|
|
|
|
|
|
+
|
|
|
stickyHeight: 0, // 吸顶栏高度(px)
|
|
stickyHeight: 0, // 吸顶栏高度(px)
|
|
|
currentStickyTitle: '', // 初始为空,不显示吸顶
|
|
currentStickyTitle: '', // 初始为空,不显示吸顶
|
|
|
currentStickyIntro: '',
|
|
currentStickyIntro: '',
|
|
@@ -134,18 +145,18 @@
|
|
|
handleConfirmBtn() {
|
|
handleConfirmBtn() {
|
|
|
// 加锁视频需要购买
|
|
// 加锁视频需要购买
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
|
- url: "/pages/chanpinShop/cp2/dingdan"
|
|
|
|
|
|
|
+ url: "/pages/chanpinShop/cp1/dingdan"
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- initData(data) {
|
|
|
|
|
- console.log('4444444');
|
|
|
|
|
|
|
+ initData(dengjiId) {
|
|
|
|
|
+ console.log('4444');
|
|
|
const cacheData = cacheManager.get('contentInfo');
|
|
const cacheData = cacheManager.get('contentInfo');
|
|
|
if (cacheData) {
|
|
if (cacheData) {
|
|
|
- console.log('使用缓存数据');
|
|
|
|
|
|
|
+ console.log('使用缓存数据44');
|
|
|
this.updateFromCache();
|
|
this.updateFromCache();
|
|
|
} else {
|
|
} else {
|
|
|
- console.log('重新请求数据');
|
|
|
|
|
- this.initFromOptions(data);
|
|
|
|
|
|
|
+ console.log('重新请求数据44');
|
|
|
|
|
+ this.initFromOptions(dengjiId);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
goTopBtn() {
|
|
goTopBtn() {
|
|
@@ -163,9 +174,9 @@
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- initFromOptions(data) {
|
|
|
|
|
|
|
+ initFromOptions(dengjiId) {
|
|
|
|
|
|
|
|
- this.loadDataFromApi(data);
|
|
|
|
|
|
|
+ this.loadDataFromApi(dengjiId);
|
|
|
},
|
|
},
|
|
|
// 从缓存更新数据方法
|
|
// 从缓存更新数据方法
|
|
|
updateFromCache() {
|
|
updateFromCache() {
|
|
@@ -174,17 +185,15 @@
|
|
|
const cacheData = cacheManager.get('contentInfo');
|
|
const cacheData = cacheManager.get('contentInfo');
|
|
|
console.log('cacheData 从缓存更新数据方法', cacheData);
|
|
console.log('cacheData 从缓存更新数据方法', cacheData);
|
|
|
if (cacheData) {
|
|
if (cacheData) {
|
|
|
- this.neirongInfo = {
|
|
|
|
|
|
|
+ this.banbenInfo = {
|
|
|
...cacheData
|
|
...cacheData
|
|
|
};
|
|
};
|
|
|
this.curProcess = cacheData.curProcess;
|
|
this.curProcess = cacheData.curProcess;
|
|
|
- this.dagangList = [...(cacheData.dagangList || [])];
|
|
|
|
|
- console.log('dagangListdagangList', this.dagangList);
|
|
|
|
|
|
|
+ this.danyuanList = [...(cacheData.danyuanList || [])];
|
|
|
this.dengjiId = cacheData.dengjiId
|
|
this.dengjiId = cacheData.dengjiId
|
|
|
- this.danyuanId = cacheData.danyuanId
|
|
|
|
|
- this.chanpinId = cacheData.chanpinId
|
|
|
|
|
|
|
|
|
|
- if (this.dagangList.length == 0) {
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (this.danyuanList.length == 0) {
|
|
|
this.existData = false
|
|
this.existData = false
|
|
|
} else {
|
|
} else {
|
|
|
this.existData = true
|
|
this.existData = true
|
|
@@ -197,38 +206,31 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- loadDataFromApi(data) {
|
|
|
|
|
- console.log('data', data);
|
|
|
|
|
|
|
+ loadDataFromApi(dengjiId) {
|
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
|
title: '加载中'
|
|
title: '加载中'
|
|
|
});
|
|
});
|
|
|
- this.dengjiId = data.dengjiId
|
|
|
|
|
- this.danyuanId = data.danyuanId
|
|
|
|
|
- this.chanpinId = data.chanpinId
|
|
|
|
|
- this.neirongInfo = {}
|
|
|
|
|
|
|
+ this.dengjiId = dengjiId
|
|
|
|
|
+ this.banbenInfo = {}
|
|
|
this.curProcess = ''
|
|
this.curProcess = ''
|
|
|
- this.dagangList = []
|
|
|
|
|
|
|
+ this.danyuanList = []
|
|
|
const req = {
|
|
const req = {
|
|
|
- dengjiId: this.dengjiId,
|
|
|
|
|
- danyuanId: this.danyuanId,
|
|
|
|
|
-
|
|
|
|
|
|
|
+ dengjiId: dengjiId
|
|
|
}
|
|
}
|
|
|
yingyuPinduInfo(req).then(res => {
|
|
yingyuPinduInfo(req).then(res => {
|
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
|
-
|
|
|
|
|
- this.neirongInfo = res.data;
|
|
|
|
|
- this.neirongInfo.jieId = res.data.curJieId;
|
|
|
|
|
|
|
+ this.banbenInfo = res.data;
|
|
|
|
|
+ this.banbenInfo.danyuanId = res.data.curDanyuanId;
|
|
|
this.curProcess = res.data.curProcess * 100;
|
|
this.curProcess = res.data.curProcess * 100;
|
|
|
- this.dagangList = res.data.dagangList || [];
|
|
|
|
|
- if (this.dagangList.length == 0) {
|
|
|
|
|
|
|
+ this.danyuanList = res.data.danyuanList || [];
|
|
|
|
|
+ if (this.danyuanList.length == 0) {
|
|
|
this.existData = false
|
|
this.existData = false
|
|
|
} else {
|
|
} else {
|
|
|
this.existData = true
|
|
this.existData = true
|
|
|
}
|
|
}
|
|
|
const cacheData = {
|
|
const cacheData = {
|
|
|
...res.data,
|
|
...res.data,
|
|
|
- dengjiId: this.dengjiId,
|
|
|
|
|
- chanpinId: this.chanpinId
|
|
|
|
|
|
|
+ dengjiId: dengjiId,
|
|
|
};
|
|
};
|
|
|
cacheManager.set('contentInfo', cacheData);
|
|
cacheManager.set('contentInfo', cacheData);
|
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|
|
@@ -248,61 +250,72 @@
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
getJieAndDanyuan(data, jieId) {
|
|
getJieAndDanyuan(data, jieId) {
|
|
|
- for (let jie of data.dagangList) {
|
|
|
|
|
- if (jie.jieId == jieId) {
|
|
|
|
|
- return {
|
|
|
|
|
- jie
|
|
|
|
|
|
|
+ for (let danyuan of data.danyuanList) {
|
|
|
|
|
+ for (let jie of danyuan.jieList) {
|
|
|
|
|
+ if (jie.jieId == jieId) {
|
|
|
|
|
+ return {
|
|
|
|
|
+ danyuan,
|
|
|
|
|
+ jie
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
return null;
|
|
return null;
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- async saveAndNavigate(jieId, da, code) {
|
|
|
|
|
|
|
+ async saveAndNavigate(jieId, type, da, code) {
|
|
|
|
|
|
|
|
|
|
+ console.log('this.dengjiId', this.dengjiId);
|
|
|
|
|
+ console.log('this.danyuanIddanyuanId', da.danyuanId);
|
|
|
|
|
+ console.log('da', da);
|
|
|
if (code == 'jixu') {
|
|
if (code == 'jixu') {
|
|
|
- if (!da.jieId) {
|
|
|
|
|
- toast("jieId 丢失")
|
|
|
|
|
|
|
+ if (!this.dengjiId || !da.danyuanId) {
|
|
|
|
|
+ toast("dengjiId或者danyuanId 丢失")
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
let req = {
|
|
let req = {
|
|
|
- "dengjiId": da.dengjiId,
|
|
|
|
|
- "jieId": da.jieId
|
|
|
|
|
|
|
+ "dengjiId": this.dengjiId,
|
|
|
|
|
+ "danyuanId": da.danyuanId,
|
|
|
|
|
+ "jieId": jieId
|
|
|
}
|
|
}
|
|
|
console.log('req', req);
|
|
console.log('req', req);
|
|
|
- const res = await shuxueSave2(req);
|
|
|
|
|
|
|
+ const res = await shuxueSave(req);
|
|
|
if (res.code == 0) {
|
|
if (res.code == 0) {
|
|
|
- let curJieAndDanyuan = this.getJieAndDanyuan(this.neirongInfo, jieId);
|
|
|
|
|
- console.log('curJieAndDanyuan', curJieAndDanyuan);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ let curJieAndDanyuan = this.getJieAndDanyuan(this.banbenInfo, jieId);
|
|
|
if (!curJieAndDanyuan) {
|
|
if (!curJieAndDanyuan) {
|
|
|
toast("未找到课程信息");
|
|
toast("未找到课程信息");
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const cacheData = cacheManager.get('contentInfo') || {};
|
|
const cacheData = cacheManager.get('contentInfo') || {};
|
|
|
|
|
+ cacheData.curDanyuanName = curJieAndDanyuan.danyuan.danyuanName;
|
|
|
cacheData.curKechengName = curJieAndDanyuan.jie.jieIntro;
|
|
cacheData.curKechengName = curJieAndDanyuan.jie.jieIntro;
|
|
|
- cacheData.jieId = curJieAndDanyuan.jie.jieId;
|
|
|
|
|
|
|
+ cacheData.danyuanId = curJieAndDanyuan.jie.danyuanId;
|
|
|
cacheData.curJieId = jieId;
|
|
cacheData.curJieId = jieId;
|
|
|
cacheData.type = curJieAndDanyuan.jie.type;
|
|
cacheData.type = curJieAndDanyuan.jie.type;
|
|
|
cacheManager.set('contentInfo', cacheData);
|
|
cacheManager.set('contentInfo', cacheData);
|
|
|
|
|
|
|
|
- uni.navigateTo({
|
|
|
|
|
- url: `/pages/jisuantexun/lookShipin?jieId=${jieId}`
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ if (type == 1) {
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
|
+ url: `/pages/xinshuxue/lookShipin?jieId=${jieId}`
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
|
+ url: `/pages/xinshuxue/unitTest?jieId=${jieId}`
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
handlePlay(da, code) {
|
|
handlePlay(da, code) {
|
|
|
- console.log('ddd', da)
|
|
|
|
|
- if (da.lock && code == 'play') {
|
|
|
|
|
|
|
|
|
|
|
|
+ if (da.lock && code == 'play') {
|
|
|
|
|
+
|
|
|
this.$refs.gmtRef.handleShow();
|
|
this.$refs.gmtRef.handleShow();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 加锁视频需要购买
|
|
// 加锁视频需要购买
|
|
|
// uni.navigateTo({
|
|
// uni.navigateTo({
|
|
|
// url: "/pages/chanpinShop/cp1/dingdan"
|
|
// url: "/pages/chanpinShop/cp1/dingdan"
|
|
@@ -314,18 +327,18 @@
|
|
|
toast("无课程ID");
|
|
toast("无课程ID");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- this.saveAndNavigate(jieId, da, code);
|
|
|
|
|
|
|
+ this.saveAndNavigate(jieId, da.type, da, code);
|
|
|
},
|
|
},
|
|
|
- handleClickDanyuan(jieId) {
|
|
|
|
|
|
|
+ handleClickDanyuan(danyuanId) {
|
|
|
|
|
|
|
|
- if (!jieId) {
|
|
|
|
|
- toast("jieId丢失")
|
|
|
|
|
|
|
+ if (!danyuanId) {
|
|
|
|
|
+ toast("danyuanId丢失")
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
|
this.isShow = true;
|
|
this.isShow = true;
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
// 更新为点击的动态单元Id [临时]
|
|
// 更新为点击的动态单元Id [临时]
|
|
|
- this.$refs.dyRef.handleShow(jieId)
|
|
|
|
|
|
|
+ this.$refs.dyRef.handleShow(danyuanId)
|
|
|
}, 100)
|
|
}, 100)
|
|
|
},
|
|
},
|
|
|
handleBack() {
|
|
handleBack() {
|