wangguoyu 1 month ago
parent
commit
0c04243735
1 changed files with 20 additions and 21 deletions
  1. 20 21
      pages/chanpinneirong/index.vue

+ 20 - 21
pages/chanpinneirong/index.vue

@@ -22,7 +22,7 @@
 							<progress :percent="curProcess" class="xx-progress" stroke-width="10"
 								backgroundColor="#3c7dfd" activeColor="#ffd11c" />
 						</view>
-						<view class="jxxx-btn" @click="handlePlay(curJieObject,'jixu')"></view>
+						<view class="jxxx-btn" @click="handlePlay(danyuanInfo,'jixu')"></view>
 					</view>
 					<view class="jd-item-box">
 						<view class="jd-item-btn" @click="handleClickDanyuan">
@@ -71,7 +71,9 @@
 	} from "@/api/chanpinneirong.js"
 	import danyuanInfoVue from '@/pages/xinshuxue/components/danyuanInfo.vue';
 	import danyuanMuluVue from '@/pages/xinshuxue/components/danyuanMulu.vue';
-import { toast } from '../../utils/common';
+	import {
+		toast
+	} from '../../utils/common';
 
 	export default {
 		data() {
@@ -91,8 +93,8 @@ import { toast } from '../../utils/common';
 				curProcess: '',
 				curWanchengStatus: false, //false是可以点击 true是不可以点击
 				cacheManagerLocal: null,
-				curJieObject:null
-				
+				curJieObject: null
+
 
 
 			}
@@ -180,18 +182,18 @@ import { toast } from '../../utils/common';
 					this.fontDanyuanId = res.data.fontDanyuanId
 					this.nextDanyuanId = res.data.nextDanyuanId
 					this.dagangList = res.data.dagangList || []
-					const result = this.jisuanWanchengStatus(this.dagangList);
-					if (result.allCompleted) {
-						console.log('全部完成');
-						this.curWanchengStatus = true
-						this.curJieObject = null
-					} else {
-						this.curWanchengStatus = false
-						this.curJieObject = result.firstUncompleted
-						// 当前单元下 第一个未完成的jie 内容
-						console.log('未完成项目:', result.firstUncompleted);
-					}
-					console.log('this.curWanchengStatus', this.curWanchengStatus);
+					// const result = this.jisuanWanchengStatus(this.dagangList);
+					// if (result.allCompleted) {
+					// 	console.log('全部完成');
+					// 	this.curWanchengStatus = true
+					// 	this.curJieObject = null
+					// } else {
+					// 	this.curWanchengStatus = false
+					// 	this.curJieObject = result.firstUncompleted
+					// 	// 当前单元下 第一个未完成的jie 内容
+					// 	console.log('未完成项目:', result.firstUncompleted);
+					// }
+					// console.log('this.curWanchengStatus', this.curWanchengStatus);
 					cacheManager.set('xuexi-shuxue', res.data)
 					cacheManager.updateObject('auth', {
 						chanpinId: this.chanpinId,
@@ -219,21 +221,18 @@ import { toast } from '../../utils/common';
 			},
 
 			handlePlay(da, code) {
-				
 				let jieId = null;
 				if (code == 'jixu') {
-					if(this.curWanchengStatus){
+					if (da.curProcess >=100) {
 						toast("当前单元节内容全部学习完毕,请切换下一单元!")
 						return
 					}
-					
+					jieId = da.jieId;
 					if (da.type == 1) {
-						jieId = da.jieId;
 						uni.navigateTo({
 							url: `/pages/xinshuxue/lookShipin?jieId=${jieId}`
 						})
 					} else {
-						jieId = da.jieId;
 						uni.navigateTo({
 							url: `/pages/xinshuxue/unitTest?jieId=${jieId}`
 						})