Explorar el Código

阅读题调整

wangxy hace 1 mes
padre
commit
4b0c20ad79
Se han modificado 2 ficheros con 15 adiciones y 8 borrados
  1. 13 6
      components/questions/yuedu.vue
  2. 2 2
      pages/index/index.vue

+ 13 - 6
components/questions/yuedu.vue

@@ -10,24 +10,24 @@
 			<swiper class="swiper-box" @change="onSwitchChange" :current="swiperDotIndex">
 				<swiper-item v-for="(item,index) in data.content" :key="index" class="swiper-item-content">
 					<view class="swiper-item" :class="'swiper-item' + index" style="background-color: #ccc;">
-						<template v-if="item.stTypeId == 1">
+						<template v-if="item.type == 'danxuan'">
 							<!-- 单选 -->
-							<danxuan :question="item" :key="item.stId"></danxuan>
+              <danxuan :question="item" :key="item.stId"></danxuan>
 						</template>
-						<template v-if="item.stTypeId == 2">
+						<template v-if="item.type == 'duoxuan'">
 
 							<!-- 多选 -->
 							<duoxuan :question="item" :key="item.stId"></duoxuan>
 						</template>
-						<template v-if="item.stTypeId == 3">
+						<template v-if="item.type == 'panduan'">
 							<!-- 判断 -->
 							<panduan :question="item" :key="item.stId"></panduan>
 						</template>
-						<template v-if="item.stTypeId == 4">
+						<template v-if="item.type == 'tiankong'">
 							<!-- 填空 -->
 							<tiankong :question="item" :key="item.stId"></tiankong>
 						</template>
-						<template v-if="item.stTypeId == 5">
+						<template v-if="item.type == 'jianda'">
 							<!-- 简答 -->
 							<jianda :question="item" :key="item.stId"></jianda>
 						</template>
@@ -66,6 +66,13 @@
 	const swiperDotIndex = ref(0);
 
 	watch(() => props.question, (question) => {
+		const danxuanlist = question.danxuan.forEach(item => item.type = 'danxuan')
+		const duoxuanlist = question.duoxuan.forEach(item => item.type = 'duoxuan')
+		const panduanlist = question.panduan.forEach(item => item.type = 'panduan')
+		const tiankonglist = question.tiankong.forEach(item => item.type = 'tiankong')
+		const jiandalist = question.jianda.forEach(item => item.type = 'jianda')
+		
+		
 		data.content = [...question.danxuan, ...question.duoxuan, ...question.panduan, ...question.tiankong, ...
 			question.jianda
 		];

+ 2 - 2
pages/index/index.vue

@@ -167,11 +167,11 @@
 				});
 				break;
 			case 2:
-				uni.showToast({
+				/* uni.showToast({
 					icon: 'none',
 					title: '开发中,敬请期侍!',
 				})
-				return false
+				return false */
 				uni.navigateTo({
 					url: '/pages/lianxi/index'
 				})