wangxy 3 mesiacov pred
rodič
commit
f712a9b515
1 zmenil súbory, kde vykonal 14 pridanie a 7 odobranie
  1. 14 7
      pages/newEnglish/components/pinPage.vue

+ 14 - 7
pages/newEnglish/components/pinPage.vue

@@ -4,7 +4,7 @@
 		<selectTypesVue activeSelect="2"></selectTypesVue>
 		<!-- 拼读区 -->
 		<!-- 单词字母多余6个需要追加 class:pin-small-words-box  -->
-		<view class="pin-words-box" :class="{'pin-small-words-box': wordLength > 6, isAll: data.isAll, 'pin-right-words-box':  data.isAll && data.result, 'pin-error-words-box':  data.isAll && !data.result}">
+		<view class="pin-words-box" :class="{'pin-small-words-box': wordLength > 6, 'isAll': data.isAll, 'pin-right-words-box':  data.isAll && data.result, 'pin-error-words-box':  data.isAll && !data.result}">
 			<view class="words-item" v-for="item in data.selectList">{{item}}</view>
 		</view>
 		<view class="pin-body-box">
@@ -40,6 +40,9 @@
 	import {
 		getUserIdentity,
 	} from "@/utils/common.js"
+	import {useAudio} from "./useAudio.js"
+	
+
 	
 	const userCode = getUserIdentity();
 	
@@ -51,13 +54,15 @@
 			type: Array
 		},
 	})
+	
+	const { handlePlay } = useAudio(props.activeWord.yinpin)
 
 	const data = reactive({
 		list: [],
 		randomList: [],
 		selectList: [],
 		result: false, // 正确性
-    isAll: false, // 是否全答
+		isAll: false, // 是否全答
 	})
 	
 	onLoad(() => {
@@ -111,11 +116,6 @@
 
 	function handleSelect(word) {
 
-    if (data.selectList.some(item => item == '') != -1) {
-      data.isAll = true;
-    } else {
-      data.isAll = false;
-    }
 
     // 点击触发取消
 		/*if (data.selectList.find(item => item == word)) {
@@ -138,6 +138,13 @@
 		})
 		// 校验正确性
 		checkIsRight();
+		
+		if (data.selectList.some(item => item == '')) {
+		  data.isAll = false;
+		} else {
+		  data.isAll = true;
+		}
+		
 	}
 
 	function checkIsRight() {