wangguoyu vor 4 Monaten
Ursprung
Commit
235c8568b4
2 geänderte Dateien mit 78 neuen und 28 gelöschten Zeilen
  1. 1 0
      components/question/yingyu/danxuan.vue
  2. 77 28
      pages/unitTest/index.vue

+ 1 - 0
components/question/yingyu/danxuan.vue

@@ -68,6 +68,7 @@
 	}
 	
 	function formatData(val) {
+		console.log('val',val);
 		if (val) {
 			data.name = val.name;
 			data.contents = val.optList.map((item, index) => {

+ 77 - 28
pages/unitTest/index.vue

@@ -12,24 +12,25 @@
 						<danxuan :question="item" v-if="item.type == '1'"></danxuan>
 						<panduan :question="item" v-if="item.type == '2'"></panduan>
 						<tiankong :question="item" v-if="item.type == '3'" :placeholders="item.placeholders"></tiankong>
-						<yingyuDanxuan :question="item" v-if="item.type == '4'" :placeholders="item.placeholders"></yingyuDanxuan>
+						<yingyuDanxuan :question="ceshiData" v-if="item.type == '4'" :placeholders="item.placeholders">
+						</yingyuDanxuan>
 					</view>
 				</template>
 			</w-swiper>
-			<view class="exam-submit-btn" v-if="current === list.length-1" 
-				@click="handleSubmit(uniPointsRef)"></view>
+			<view class="exam-submit-btn" v-if="current === list.length-1" @click="handleSubmit(uniPointsRef)"></view>
 		</view>
-			
+
 		<!--  左右滑动  -->
-		<view class="tip-mask-box"  @click="handleCloseTishi" v-if="showTishi">
+		<view class="tip-mask-box" @click="handleCloseTishi" v-if="showTishi">
 			<view class="exam-tip-box">左右滑动查看更多题目</view>
 		</view>
-		
+
 
 		<!-- 答卷 -->
-		<chengji ref="chengjiRef" :list="list"  @back="handleBack" :cardId="cardId"></chengji>
+		<chengji ref="chengjiRef" :list="list" @back="handleBack" :cardId="cardId"></chengji>
 		<!-- 分数弹窗 -->
-		<uniPointsVue ref="uniPointsRef" @checkAnswer="checkAnswer" @goStudy="goStudyContinue" :isLastZhang="!!haveFlag" :studyFlag="studyFlag"></uniPointsVue>
+		<uniPointsVue ref="uniPointsRef" @checkAnswer="checkAnswer" @goStudy="goStudyContinue" :isLastZhang="!!haveFlag"
+			:studyFlag="studyFlag"></uniPointsVue>
 		<!-- 填空 -->
 		<FillItem :value="result" ref="popupRef" @blur="onBlur"></FillItem>
 
@@ -46,7 +47,8 @@
 	import danxuan from "@/components/question/danxuan.vue";
 	import panduan from "@/components/question/panduan.vue";
 	import tiankong from "@/components/question/tiankong.vue";
-	import yingyuDanxuan from "@/components/question/yingyu/danxuan.vue";
+	 import yingyuDanxuan from "@/components/question/yingyu/danxuanCeshi.vue";
+	//import yingyuDanxuan from "@/components/question/yingyu/danxuan.vue";
 	import chengji from "@/components/chengji/chengji.vue";
 	import uniPointsVue from '@/components/points/uni-points.vue';
 	import * as httpUnit from "@/api/unitTest.js"
@@ -58,10 +60,13 @@
 	} from './useUnit';
 	import {
 		ref,
+		reactive
 	} from "vue";
-    import cacheManager from "@/utils/cacheManager";
-	import {onLoad} from "@dcloudio/uni-app"
-	
+	import cacheManager from "@/utils/cacheManager";
+	import {
+		onLoad
+	} from "@dcloudio/uni-app"
+
 
 
 	const {
@@ -88,31 +93,76 @@
 
 	const uniPointsRef = ref(null);
 	const chengjiRef = ref(null);
-	const popupRef= ref(null);
+	const popupRef = ref(null);
 	const result = ref('');
 	const curTiankong = ref(null);
-	
+
+	const ceshiData = reactive({
+			"stId": 378,
+			"type": 4,
+			"name": "<p>发音:/b/ 1231[yingyu1]</p>",
+			"result": "0",
+			"answer": "<p>单词book发音为/bʊk/ [yingyu5]; 单词pool的发音是/puːl/ [yingyu4]。</p>",
+			"audios": "https://ezy-app.oss-cn-beijing.aliyuncs.com/test/resource/uploadFile1a3bd1236181491b8de49e84857a9163.MP3,https://ezy-app.oss-cn-beijing.aliyuncs.com/test/resource/uploadFile16b16267eafb43b6a272b8b212049ae4.MP3,https://ezy-app.oss-cn-beijing.aliyuncs.com/test/resource/uploadFileb23646275ada46769e76a3ae0dba230e.MP3,https://ezy-app.oss-cn-beijing.aliyuncs.com/test/resource/uploadFileeff5e2bb7a6f4a0d9bc78b503ebea846.MP3,https://ezy-app.oss-cn-beijing.aliyuncs.com/test/resource/uploadFile6cbe483d691b4e5eb13401e301d62c9c.mp3",
+			"jiangjie": null,
+			"optList": [{
+				"neirong": "<p>book [yingyu2]</p>",
+				"audio":"https://ezy-app.oss-cn-beijing.aliyuncs.com/test/resource/uploadFile1a3bd1236181491b8de49e84857a9163.MP3"
+			}, {
+				"neirong": "<p>pool [yingyu3]</p>",
+				"audio":"https://ezy-app.oss-cn-beijing.aliyuncs.com/test/resource/uploadFile16b16267eafb43b6a272b8b212049ae4.MP3"
+			}]
+		},
+		{
+			"stId": 379,
+			"type": 4,
+			"name": "<p>判断划线部分发音是否相同。</p><p><br></p><p>park  [yingyu1]</p><p><br></p><p>cup [yingyu2]</p>",
+			"result": "0",
+			"answer": "<p>在单词park中,p发 /p/音 [yingyu3];在单词cup中,p发/p/音 [yingyu4],故发音相同。</p>",
+			"audios": "https://ezy-app.oss-cn-beijing.aliyuncs.com/test/resource/uploadFile304fcea7440e400ca2bd0207354b2fa3.MP3,https://ezy-app.oss-cn-beijing.aliyuncs.com/test/resource/uploadFile052863fbfd074e718c63509db47f0f6c.MP3,https://ezy-app.oss-cn-beijing.aliyuncs.com/test/resource/uploadFilefee406d7614443609b450b4f260b33e5.MP3,https://ezy-app.oss-cn-beijing.aliyuncs.com/test/resource/uploadFile725a16a4dea642ccaf0129ae877b4a7c.MP3",
+			"jiangjie": null,
+			"optList": [{
+				"neirong": "<p>相同</p>",
+					"audio":"https://ezy-app.oss-cn-beijing.aliyuncs.com/test/resource/uploadFile1a3bd1236181491b8de49e84857a9163.MP3"
+			}, {
+				"neirong": "<p>不同</p>",
+					"audio":"https://ezy-app.oss-cn-beijing.aliyuncs.com/test/resource/uploadFile1a3bd1236181491b8de49e84857a9163.MP3"
+			}]
+		}
+	);
+
+
 	function getPopupRef() {
 		return popupRef.value;
 	}
 	onLoad(() => {
-		uni.$on('tiankong-fillItem',(val) => {
-			const {index,question} = val;
+		uni.$on('tiankong-fillItem', (val) => {
+			const {
+				index,
+				question
+			} = val;
 			curTiankong.value = val;
 			result.value = question.reply[index];
 			const dom = getPopupRef();
 			dom && dom.showPopup();
 		})
-		
+
 	})
-	function onBlur({result}) {
+
+	function onBlur({
+		result
+	}) {
 		if (curTiankong.value) {
-			uni.$emit('tiankong-setResult', {index: curTiankong.value.index,stId:curTiankong.value.question.stId,result});
+			uni.$emit('tiankong-setResult', {
+				index: curTiankong.value.index,
+				stId: curTiankong.value.question.stId,
+				result
+			});
 		}
 		const dom = getPopupRef();
 		dom && dom.handleClear();
 	}
-	
+
 	// 查看答案
 	function checkAnswer() {
 		chengjiRef.value.showPopup();
@@ -120,15 +170,15 @@
 	// 继续学习
 	async function goStudyContinue() {
 		// 设置 从单元测试 到 岛 的路由参数
-    activeZhang.value.nextZhang ? activeZhang.value.nextZhang.zhangId : null;
-    cacheManager.updateObject('auth', {
-      zhangId: activeZhang.value.nextZhang.zhangId,
-    })
+		activeZhang.value.nextZhang ? activeZhang.value.nextZhang.zhangId : null;
+		cacheManager.updateObject('auth', {
+			zhangId: activeZhang.value.nextZhang.zhangId,
+		})
 		uni.redirectTo({
 			url: `/pages/study/index`
 		})
 	}
-	
+
 	function handleBack() {
 		// 数学
 		uni.redirectTo({
@@ -136,12 +186,12 @@
 		})
 		uni.$emit('back-outpage')
 	}
-	
+
 	function onSwiperChange(index) {
 		current.value = index;
 		uni.$emit('swiper-change', index)
 	}
-	
+
 	function courseBjFun() {
 		switch (cardId) {
 			case 1:
@@ -154,7 +204,6 @@
 				break;
 		}
 	}
-
 </script>
 
 <style lang="scss" scoped>