wangxy hai 6 meses
pai
achega
a49de2a554
Modificáronse 3 ficheiros con 16 adicións e 4 borrados
  1. 5 0
      components/points/uni-points.vue
  2. 4 3
      pages/unitTest/index.vue
  3. 7 1
      pages/unitTest/useUnit.js

+ 5 - 0
components/points/uni-points.vue

@@ -24,6 +24,11 @@
 		isLastZhang: {
 		isLastZhang: {
 			type: Boolean,
 			type: Boolean,
 			default: true
 			default: true
+		},
+		// 当前是否已答过试题 0未答,1已答
+		studyFlag: {
+			type: Number,
+			default: 0
 		}
 		}
 	})
 	})
 	
 	

+ 4 - 3
pages/unitTest/index.vue

@@ -16,7 +16,7 @@
 				</template>
 				</template>
 			</w-swiper>
 			</w-swiper>
 			<view class="exam-submit-btn" v-if="current === list.length-1" 
 			<view class="exam-submit-btn" v-if="current === list.length-1" 
-				@click="handleSubmit(uniPointsRef)"></view>
+				@click="handleSubmit(uniPointsRef,popupRef)"></view>
 		</view>
 		</view>
 
 
 		<!--  左右滑动  -->
 		<!--  左右滑动  -->
@@ -28,7 +28,8 @@
 		<!-- 答卷 -->
 		<!-- 答卷 -->
 		<chengji ref="chengjiRef" :list="list"  @back="handleBack"></chengji>
 		<chengji ref="chengjiRef" :list="list"  @back="handleBack"></chengji>
 		<!-- 分数弹窗 -->
 		<!-- 分数弹窗 -->
-		<uniPointsVue ref="uniPointsRef" @checkAnswer="checkAnswer" @goStudy="goStudyContinue" :isLastZhang="!!haveFlag"></uniPointsVue>
+		<uniPointsVue ref="uniPointsRef" @checkAnswer="checkAnswer" @goStudy="goStudyContinue" :isLastZhang="!!haveFlag" :studyFlag="studyFlag"></uniPointsVue>
+		
 	</view>
 	</view>
 
 
 </template>
 </template>
@@ -66,7 +67,7 @@
 		xueke,
 		xueke,
 		showTishi,
 		showTishi,
 		haveFlag,
 		haveFlag,
-    activeZhang,
+		activeZhang,
 		handleSubmit,
 		handleSubmit,
 		initPage,
 		initPage,
 		handleCloseTishi
 		handleCloseTishi

+ 7 - 1
pages/unitTest/useUnit.js

@@ -70,7 +70,8 @@ export function useExam() {
 		nianji: null,
 		nianji: null,
 		xueke: null,
 		xueke: null,
 		haveFlag: false, // 是否有下一章
 		haveFlag: false, // 是否有下一章
-		activeZhang: null
+		activeZhang: null,
+		studyFlag: 0, // 是否是第一次答题
 	})
 	})
 	onLoad((options) => {
 	onLoad((options) => {
 		const jieId = options.jieId
 		const jieId = options.jieId
@@ -87,6 +88,7 @@ export function useExam() {
 		data.xueke = cardId; // 需要年纪Id 来执行返回页面
 		data.xueke = cardId; // 需要年纪Id 来执行返回页面
 		data.activeZhang = getZhangInfoByJieId(cacheZhangInfo.zhangList,jieId);
 		data.activeZhang = getZhangInfoByJieId(cacheZhangInfo.zhangList,jieId);
 		data.haveFlag = data.activeZhang.curZhang ? data.activeZhang.curZhang.haveFlag: 0;
 		data.haveFlag = data.activeZhang.curZhang ? data.activeZhang.curZhang.haveFlag: 0;
+		data.studyFlag = data.activeZhang.curZhang ? data.activeZhang.curZhang.studyFlag: 0;
 
 
 		// 初始化页面数据
 		// 初始化页面数据
 		initPage();
 		initPage();
@@ -175,6 +177,10 @@ export function useExam() {
 			toast("单元测试数据提交异常");
 			toast("单元测试数据提交异常");
 			return;
 			return;
 		}
 		}
+		
+		const cacheCurrentZhangIndex = cacheManager.get('auth').currentZhang;
+		cacheManager.updateJieStatus('zhangInfo', cacheCurrentZhangIndex, data.jieId);
+		
 		dom.showPopup({
 		dom.showPopup({
 			right: cdata.dui,
 			right: cdata.dui,
 			wrong: cdata.cuo,
 			wrong: cdata.cuo,