Browse Source

Merge branch '2025鹅状元数学' of https://gogs.mtavip.com/wangguoyu/uniProject into 2025鹅状元数学

tanxue 3 weeks ago
parent
commit
3dfe0bc8e9

+ 39 - 52
pages/chanpinneirong/chanpin2.vue

@@ -7,13 +7,12 @@
 				<view class="xxjl-card-box">
 				<view class="xxjl-card-box">
 					<!-- 显示内容 -->
 					<!-- 显示内容 -->
 					<view class="card-body-box">
 					<view class="card-body-box">
-						<img :src="banbenInfo.cover" />
+						<img :src="neirongInfo.cover" />
 						<view class="body-right">
 						<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>
 					</view>
 					<view class="card-progress-box">
 					<view class="card-progress-box">
@@ -22,7 +21,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(banbenInfo,'jixu')">
+						<ezyActiveVue class="ezy-btn-active jxxx-btn" @aclick="handlePlay(neirongInfo,'jixu')">
 						</ezyActiveVue>
 						</ezyActiveVue>
 					</view>
 					</view>
 				</view>
 				</view>
@@ -31,29 +30,17 @@
 			<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="(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"
 						<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 class="xx-text-box">
-							<view>{{ jieItem.jieName }}</view>
-							<view>{{ jieItem.jieIntro }}</view>
+							<view>{{ item.jieName }}</view>
+							<view>{{ item.jieIntro }}</view>
 						</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>
 						<view v-else class="xx-item-btn"></view>
 					</ezyActiveVue>
 					</ezyActiveVue>
 				</view>
 				</view>
@@ -101,16 +88,16 @@
 		updateChanpin2Process
 		updateChanpin2Process
 	} from "./useNeirongChanpin2"
 	} from "./useNeirongChanpin2"
 	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,
 
 
-				danyuanList: [],
-				banbenInfo: {},
+				jieList: [],
+				neirongInfo: {},
 				banbenId: '',
 				banbenId: '',
-				danyuanId: '',
+				jieId: '',
 				chanpinId: '',
 				chanpinId: '',
 				dengjiId: '',
 				dengjiId: '',
 				curProcess: '',
 				curProcess: '',
@@ -185,15 +172,15 @@
 				const cacheData = cacheManager.get('contentInfo');
 				const cacheData = cacheManager.get('contentInfo');
 				console.log('cacheData 从缓存更新数据方法', cacheData);
 				console.log('cacheData 从缓存更新数据方法', cacheData);
 				if (cacheData) {
 				if (cacheData) {
-					this.banbenInfo = {
+					this.neirongInfo = {
 						...cacheData
 						...cacheData
 					};
 					};
 					this.curProcess = cacheData.curProcess;
 					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
 						this.existData = false
 					} else {
 					} else {
 						this.existData = true
 						this.existData = true
@@ -211,27 +198,27 @@
 					title: '加载中'
 					title: '加载中'
 				});
 				});
 				this.dengjiId = dengjiId
 				this.dengjiId = dengjiId
-				this.banbenInfo = {}
+				this.neirongInfo = {}
 				this.curProcess = ''
 				this.curProcess = ''
-				this.danyuanList = []
+				this.jieList = []
 				const req = {
 				const req = {
 					dengjiId: dengjiId
 					dengjiId: dengjiId
 				}
 				}
 				shuxueChanpinDengjiInfo(req).then(res => {
 				shuxueChanpinDengjiInfo(req).then(res => {
 					if (res.code === 0) {
 					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.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
 							this.existData = false
 						} else {
 						} else {
 							this.existData = true
 							this.existData = true
 						}
 						}
 						const cacheData = {
 						const cacheData = {
 							...res.data,
 							...res.data,
-							banbenId: banbenId,
+							dengjiId: dengjiId,
 						};
 						};
 						cacheManager.set('contentInfo', cacheData);
 						cacheManager.set('contentInfo', cacheData);
 						uni.hideLoading();
 						uni.hideLoading();
@@ -251,7 +238,7 @@
 			},
 			},
 
 
 			getJieAndDanyuan(data, jieId) {
 			getJieAndDanyuan(data, jieId) {
-				for (let danyuan of data.danyuanList) {
+				for (let danyuan of data.jieList) {
 					for (let jie of danyuan.jieList) {
 					for (let jie of danyuan.jieList) {
 						if (jie.jieId == jieId) {
 						if (jie.jieId == jieId) {
 							return {
 							return {
@@ -267,23 +254,23 @@
 			async saveAndNavigate(jieId, type, da, code) {
 			async saveAndNavigate(jieId, type, da, code) {
 
 
 				console.log('this.banbenId', this.banbenId);
 				console.log('this.banbenId', this.banbenId);
-				console.log('this.danyuanIddanyuanId', da.danyuanId);
+				console.log('this.danyuanIddanyuanId', da.jieId);
 				if (code == 'jixu') {
 				if (code == 'jixu') {
-					if (!this.banbenId || !da.danyuanId) {
-						toast("banbenId或者danyuanId 丢失")
+					if (!this.banbenId || !da.jieId) {
+						toast("banbenId或者jieId 丢失")
 						return false
 						return false
 					}
 					}
 				}
 				}
 
 
 				let req = {
 				let req = {
 					"banbenId": this.banbenId,
 					"banbenId": this.banbenId,
-					"danyuanId": da.danyuanId,
+					"jieId": da.jieId,
 					"jieId": jieId
 					"jieId": jieId
 				}
 				}
 				console.log('req', req);
 				console.log('req', req);
 				const res = await shuxueSave(req);
 				const res = await shuxueSave(req);
 				if (res.code == 0) {
 				if (res.code == 0) {
-					let curJieAndDanyuan = this.getJieAndDanyuan(this.banbenInfo, jieId);
+					let curJieAndDanyuan = this.getJieAndDanyuan(this.neirongInfo, jieId);
 					if (!curJieAndDanyuan) {
 					if (!curJieAndDanyuan) {
 						toast("未找到课程信息");
 						toast("未找到课程信息");
 						return false;
 						return false;
@@ -292,7 +279,7 @@
 					const cacheData = cacheManager.get('contentInfo') || {};
 					const cacheData = cacheManager.get('contentInfo') || {};
 					cacheData.curDanyuanName = curJieAndDanyuan.danyuan.danyuanName;
 					cacheData.curDanyuanName = curJieAndDanyuan.danyuan.danyuanName;
 					cacheData.curKechengName = curJieAndDanyuan.jie.jieIntro;
 					cacheData.curKechengName = curJieAndDanyuan.jie.jieIntro;
-					cacheData.danyuanId = curJieAndDanyuan.jie.danyuanId;
+					cacheData.jieId = curJieAndDanyuan.jie.jieId;
 					cacheData.curJieId = jieId;
 					cacheData.curJieId = jieId;
 					cacheData.type = curJieAndDanyuan.jie.type;
 					cacheData.type = curJieAndDanyuan.jie.type;
 					cacheManager.set('contentInfo', cacheData);
 					cacheManager.set('contentInfo', cacheData);
@@ -329,16 +316,16 @@
 				}
 				}
 				this.saveAndNavigate(jieId, da.type, da, code);
 				this.saveAndNavigate(jieId, da.type, da, code);
 			},
 			},
-			handleClickDanyuan(danyuanId) {
+			handleClickDanyuan(jieId) {
 
 
-				if (!danyuanId) {
-					toast("danyuanId丢失")
+				if (!jieId) {
+					toast("jieId丢失")
 					return false
 					return false
 				}
 				}
 				this.isShow = true;
 				this.isShow = true;
 				setTimeout(() => {
 				setTimeout(() => {
 					// 更新为点击的动态单元Id [临时]
 					// 更新为点击的动态单元Id [临时]
-					this.$refs.dyRef.handleShow(danyuanId)
+					this.$refs.dyRef.handleShow(jieId)
 				}, 100)
 				}, 100)
 			},
 			},
 			handleBack() {
 			handleBack() {

+ 3 - 1
pages/chanpinneirong/index.vue

@@ -124,7 +124,9 @@
 						})
 						})
 						break;
 						break;
 					case 2:
 					case 2:
-
+						this.$nextTick(() => {
+							this.$refs.chanpin2Ref.initData()
+						})
 						break;
 						break;
 					default:
 					default:
 
 

+ 2 - 6
pages/chanpinneirong/useNeirongChanpin2.js

@@ -3,14 +3,10 @@ import cacheManager from "@/utils/cacheManager.js";
 export function updateChanpin2Process() {
 export function updateChanpin2Process() {
 	const cacheData = cacheManager.get('contentInfo');
 	const cacheData = cacheManager.get('contentInfo');
 	console.log('cacheData333333', cacheData)
 	console.log('cacheData333333', cacheData)
-	const list = cacheData.danyuanList;
+	const list = cacheData.jieList;
 	const defaultCurProcess = cacheData.curProcess;
 	const defaultCurProcess = cacheData.curProcess;
-	let mList = [];
-	list.forEach(item => {
-		mList = [...mList, ...item.jieList]
-	})
 
 
-	const process = mList.filter(item => item.wanchengFlag).length/mList.length * 100 || 0;
+	const process = list.filter(item => item.wanchengFlag).length/list.length * 100 || 0;
 	cacheData.curProcess = defaultCurProcess > process ? defaultCurProcess: process;
 	cacheData.curProcess = defaultCurProcess > process ? defaultCurProcess: process;
 	cacheManager.set('contentInfo', cacheData);
 	cacheManager.set('contentInfo', cacheData);
 }
 }