wangxy 1 месяц назад
Родитель
Сommit
0c6e415ebb
1 измененных файлов с 18 добавлено и 16 удалено
  1. 18 16
      pages/xinshuxue/unitTest.vue

+ 18 - 16
pages/xinshuxue/unitTest.vue

@@ -7,16 +7,17 @@
 
 		<view class="exam-body">
 			<view class="xx-jd-box">
-				<view class="xx-row">
+				<view class="xx-row" v-if="data.total">
 					<view>当前学习进度</view>
 					<view class="text-row">
 						<text class="dq-jd-text">{{data.current+1}}</text>
-						<text class="dq-jd-line">/</text>{{data.total}}</view>
+						<text class="dq-jd-line">/</text>{{data.total}}
+					</view>
 				</view>
-				<progress :percent="(data.current+1)/data.total * 100" class="exam-progress-box"
-				stroke-width="10" backgroundColor="#3c7dfd" activeColor="#ffd11c"/>
+				<progress :percent="(data.current+1)/data.total * 100" class="exam-progress-box" stroke-width="10"
+					backgroundColor="#3c7dfd" activeColor="#ffd11c" />
 			</view>
-		
+
 
 			<view class="shiti-frame-box">
 				<w-swiper :list="data.list" :current="data.current" class="ezy-exam-swiper" @change="onSwiperChange">
@@ -24,7 +25,8 @@
 						<view class="body" v-if="item.mta_show">
 							<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>
+							<tiankong :question="item" v-if="item.type == '3'" :placeholders="item.placeholders">
+							</tiankong>
 							<!-- 交卷按钮 -->
 							<view class="shiti-jj-btn" v-if="item.stId == data.list[data.total-1].stId"
 								@click="handleSubmit"></view>
@@ -39,7 +41,7 @@
 		</view>
 
 
-		
+
 
 		<!-- 填空 -->
 		<FillItem :value="result" ref="popupRef" @blur="onBlur"></FillItem>
@@ -74,8 +76,8 @@
 	const {
 		data,
 		handleSubmit,
-    updateRightWrong,
-    resetStart
+		updateRightWrong,
+		resetStart
 	} = useShuxueTest(handleSeeResult, handleSeeResultClose)
 
 	const curTiankong = ref(null);
@@ -84,9 +86,9 @@
 	const uniResRef = ref(null);
 	const uniAnsRef = ref(null);
 
-  function handleSeeResultClose() {
-    uniResRef.value.closePopup()
-  }
+	function handleSeeResultClose() {
+		uniResRef.value.closePopup()
+	}
 
 	function handleSeeResult() {
 		uniResRef.value.showPopup({
@@ -102,7 +104,7 @@
 	}
 
 	function onDoReplay() {
-    resetStart()
+		resetStart()
 	}
 
 	function onCheckAnswer() {
@@ -122,9 +124,9 @@
 			dom && dom.showPopup();
 		})
 
-    uni.$on('unitShuxueTest-submit',val => {
-      updateRightWrong(val)
-    })
+		uni.$on('unitShuxueTest-submit', val => {
+			updateRightWrong(val)
+		})
 	})
 
 	function getPopupRef() {