Browse Source

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

tanxue 5 months ago
parent
commit
65296b015d

+ 10 - 4
components/chengji/chengji.vue

@@ -19,7 +19,7 @@
 									<!-- 答案解析 -->
 									<view @click="showJiexiPopup(item)" class="answer-btn"></view>
 								</view>
-								<view class="answer-btn-box">
+								<view class="answer-btn-box" v-if="item.type!=3">
 									<!-- 你的答案 -->
 									<view class="answer-item-left">
 										<text class="answer-item-title">您的答案</text>
@@ -32,7 +32,13 @@
 										<text class="answer-item-correct">{{showAnswerResult(item)}}</text>
 									</view>
 								</view>
-									
+								<view  v-else>
+									<!-- 答案 -->
+									<view >
+										<text class="answer-item-title">正确答案</text>
+										<view v-for="ict in showAnswerResult(item)">{{ict}}</view>
+									</view>
+								</view>
 								
 							</view>
 						</view>
@@ -98,7 +104,7 @@
 		if (item.type == 1) {
 			// 单选题
 			return getLetterByIndex(item.result)
-		} else if (item.type == 3){
+		} else if (item.type == 2){
 			if (item.result == 1) {
 				return '正确'
 			} else {
@@ -114,7 +120,7 @@
 		if (item.type == 1) {
 			// 单选题
 			return getLetterByIndex(item.reply)
-		} else if (item.type == 3){
+		} else if (item.type == 2){
 			if (item.reply == 1) {
 				return '正确'
 			} else {

+ 18 - 3
components/question/FillItem.vue

@@ -1,7 +1,7 @@
 <template>
-	<uni-popup background-color="#fff" ref="fillRef">
+	<uni-popup type="top" background-color="#fff" ref="fillRef">
 		<view class="popup-content">
-			<input v-model.trim="result" :focus="true" placeholder="请输入答案" style="width: 100%" @blur="onBlur" type="text" class="input-box" />
+			<input  v-model.trim="result" :focus="true" placeholder="请输入答案"  @blur="onBlur" @confirm="handleConfirm" class="my-textarea" type="text" />
 		</view>
 	</uni-popup>
 </template>
@@ -10,6 +10,7 @@
 	import {ref, watch} from "vue";
 	const fillRef = ref(null);
 	const result = ref('');
+	const focus = ref(false);
 	const emits = defineEmits(['blur']);
 	const props = defineProps({
 		value: {
@@ -26,12 +27,23 @@
 	})
 	
 	function showPopup() {
-		fillRef.value.open('top');
+		fillRef.value.open();
 	}	
+	
+	function handleConfirm() {
+		fillRef.value.close();
+	}
+	
 	function onBlur() {
 		emits("blur", {result: result.value,index: props.index});
+		focus.value = false;
 	}
 	
+	uni.$on("swiper-change", () => {
+		emits("blur", {result: result.value,index: props.index});
+		fillRef.value.close()
+	})
+	
 	defineExpose({
 		showPopup
 	})
@@ -41,4 +53,7 @@
 .popup-content {
 	padding: 20px;
 }
+.my-textarea {
+	height: 36px;
+}
 </style>

+ 10 - 5
pages/study/index.vue

@@ -80,10 +80,12 @@
 			console.log(selectZhang.value);
 			// 已登录
 			// 选择年级进入调用此接口
-			//options.flag == 'selectGrades'
-			nextTick(() => {
-				eggDialogRef.value.eggShow();
-			})
+			//options.flag == 'selectGrades'
+			if(!selectZhang.value.eggFlag){
+				nextTick(() => {
+					eggDialogRef.value.eggShow();
+				})
+			}
 			getZhangInfo()
 			// 蛋
 			// eggDialogRef.value.eggShow();
@@ -296,7 +298,10 @@
 	}
 
 	function eggBtn() {
-		console.log('点击:开启提分之旅');
+		console.log('点击:开启提分之旅');
+		cacheManager.updateObject('auth', {
+			eggFlag:true
+		})
 	}
 </script>
 <style>

+ 1 - 0
pages/unitTest/index.vue

@@ -107,6 +107,7 @@
 	
 	function onSwiperChange(index) {
 		current.value = index;
+		uni.$emit('swiper-change', index)
 	}
 	
 

+ 18 - 5
pages/wrong/index.vue

@@ -5,8 +5,8 @@
 			<text class="nav-bar-title">我的错题</text>
 		</view>
 		<view class="cuoti-border-box">
-			<uni-segmented-control :current="data.current" :values="data.items" 
-			 active-color="#3A7FE9" @clickItem="onChangeTab" class="cuo-tab-box"/>
+			<uni-segmented-control :current="data.current" :values="data.items" active-color="#3A7FE9"
+				@clickItem="onChangeTab" class="cuo-tab-box" />
 			<view class="cuoti-content-box">
 				<view v-if="data.current === 0">
 					<scroll-view style="height: 300px;" scroll-y="true" refresher-enabled="true"
@@ -51,7 +51,7 @@
 				</view>
 			</view>
 		</view>
-		<cuoti ref="wrongRef" :list="data.wrongList" @back="handleBackFromCuoti" ></cuoti>
+		<cuoti ref="wrongRef" :list="data.wrongList" @back="handleBackFromCuoti"></cuoti>
 	</view>
 </template>
 
@@ -114,14 +114,14 @@
 			refreshData(data.current);
 		}
 	}
-	
+
 	function refreshData(code) {
 		const opt = {
 			page: 1,
 			size: 10, // 固定查询10条
 			cardId: data.current + 1 // 前台索引加1为学科cardId
 		}
-		
+
 		if (code == 0) {
 			data.shuxue.list = [];
 			// 数学
@@ -251,11 +251,24 @@
 		})
 	}
 
+	function formatListToUse(list) {
+		list.forEach((item, index) => {
+			item.mta_show = false;
+			item.reply = null;
+			if (item.type == 3) {
+				item.result = JSON.parse(item.result);
+				item.placeholders = item.result.map((item, cindex) => `[bank${cindex}]`)
+				item.reply = item.result.map(() => '');
+			}
+		})
+	}
+
 	function getCuotiData(item) {
 		getWrongInfo({
 			cardId: data.current + 1,
 			cdate: item.cdate
 		}).then(res => {
+			formatListToUse(res.data)
 			data.wrongList = res.data;
 			wrongRef.value.showPopup();
 		})