From dad56f30efd93ddccf1b7c053230ed7b5814de27 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期一, 27 五月 2024 15:06:01 +0800
Subject: [PATCH] 代码初始化

---
 h5/pages/answer/answer.vue |  120 +++++++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 83 insertions(+), 37 deletions(-)

diff --git a/h5/pages/answer/answer.vue b/h5/pages/answer/answer.vue
index 2f6a7b0..9b2c532 100644
--- a/h5/pages/answer/answer.vue
+++ b/h5/pages/answer/answer.vue
@@ -1,16 +1,13 @@
 <template>
 	<view class="box">
 		<view class="box_bgimage" :style="{backgroundImage: 'url(' + bg + ')'}">
-			<text class="box_bgimage_a">{{title}}</text>
-			<text class="box_bgimage_b">{{content}}</text>
+			<text class="box_bgimage_a">璁垮闂嵎灏忚皟鐮�</text>
+			<text class="box_bgimage_b">绛旈鍒嗗�奸渶瑕佽揪鍒�30鍒嗘墠鑳界敵璇疯闂摝锝�</text>
 		</view>
 		<view class="box_list">
 			<view class="box_list_answer" v-if="list && list.length > 0">
-				<view class="box_list_answer_name">
-					{{i + 1}}銆亄{list[i].title}}
-				</view>
 				<!--    鍒ゆ柇   -->
-				<template v-if="list[i].type === 0">
+<!-- 				<template v-if="list[i].type === 0">
 					<view class="box_list_answer_item" v-for="(item, index) in list[i].options" :key="index" @click="select(index)">
 						<image src="@/static/video_error@2x.png" v-if="success && problemIndex === index" />
 						<image src="@/static/video@2x.png" v-else-if="!String(problemIndex) || problemIndex !== index" />
@@ -19,20 +16,29 @@
 						<text v-else-if="!String(problemIndex) || problemIndex !== index">{{item.code}}</text>
 						<text style="color: rgba(2, 94, 239, 1)" v-else-if="problemIndex === index">{{item.code}}</text>
 					</view>
-				</template>
+				</template> -->
 				<!--    鍗曢��   -->
-				<template v-else-if="list[i].type === 1">
-					<view class="box_list_answer_item" v-for="(item, index) in list[i].options" :key="index" @click="select(index)">
-						<image src="@/static/video_error@2x.png" v-if="success && problemIndex === index" />
-						<image src="@/static/video@2x.png" v-else-if="!String(problemIndex) || problemIndex !== index" />
-						<image src="@/static/video_sel@2x.png" v-else-if="problemIndex === index" />
-						<text style="color: rgba(237, 69, 69, 1)" v-if="success && problemIndex === index">{{item.code}} {{item.value}}</text>
-						<text v-else-if="!String(problemIndex) || problemIndex !== index">{{item.code}} {{item.value}}</text>
-						<text style="color: rgba(2, 94, 239, 1)" v-else-if="problemIndex === index">{{item.code}} {{item.value}}</text>
+				<view v-for="(item,index) in list"  :key="index" class="list_item">
+					<view class="box_list_answer_name">
+						{{index + 1}}銆亄{item.title}}
 					</view>
-				</template>
+					<view class="box_list_answer_item" v-for="(line, lIndex) in item.options" :key="lIndex" @click="select(index)">
+						<image src="@/static/video_error@2x.png"  />
+						<image src="@/static/video@2x.png"  />	
+						<image src="@/static/video_sel@2x.png"  />
+						<text style="color: rgba(237, 69, 69, 1)" >{{line.code}} {{line.value}}</text>
+						<text >{{line.code}} {{line.value}}</text>
+						<text style="color: rgba(2, 94, 239, 1)" >{{line.code}} {{line.value}}</text>
+					</view>
+					<view class="box_list_answer_tips" v-if="success">
+						<image src="@/static/ic_wrong@2x.png" />
+						<text>鍥炵瓟閿欒</text>
+					</view>
+				</view>
+				<view class="empty"></view>
+				<view class="box_list_answer_btn" @click="next()">鎻愪氦</view>
 				<!--    澶氶��    -->
-				<template v-else-if="list[i].type === 2">
+<!-- 				<template v-else-if="list[i].type === 2">
 					<view class="box_list_answer_item" v-for="(item, index) in list[i].options" :key="index"
 						@click="selectMultiple(item.code)">
 						<image src="@/static/checkbox_wrong@2x.png"
@@ -47,28 +53,55 @@
 						<text style="color: rgba(2, 94, 239, 1)"
 							v-else-if="multiple.toString().indexOf(item.code) !== -1">{{item.code}} {{item.value}}</text>
 					</view>
-				</template>
-				<view class="box_list_answer_tips" v-if="success">
-					<image src="@/static/ic_wrong@2x.png" />
-					<text>鍥炵瓟閿欒</text>
-				</view>
-				<view class="box_list_answer_btn" @click="next()">涓嬩竴棰�</view>
+				</template> -->
 			</view>
 		</view>
 	</view>
 </template>
 
 <script>
+	import { getProblemsVO, getSystemDictData } from '@/api'
 	export default {
 		name: 'answer',
 
 		data() {
 			return {
 				i: 0,
-				problemIndex: null,
+				problemIndex: 0,
 				multiple: null,
-				success: false,
-				list: [],
+				success: true,
+				list: [
+					{
+						type: '1',
+						title: '绗竴棰�',
+						options: [
+							{ code: '骞村垔', value: '111111' },
+							{ code: '骞村垔', value: '111111' },
+							{ code: '骞村垔', value: '111111' },
+							{ code: '骞村垔', value: '111111' },
+						]
+					},
+					{
+						type: '1',
+						title: '绗竴棰�',
+						options: [
+							{ code: '骞村垔', value: '111111' },
+							{ code: '骞村垔', value: '111111' },
+							{ code: '骞村垔', value: '111111' },
+							{ code: '骞村垔', value: '111111' },
+						]
+					},
+					{
+						type: '1',
+						title: '绗竴棰�',
+						options: [
+							{ code: '骞村垔', value: '111111' },
+							{ code: '骞村垔', value: '111111' },
+							{ code: '骞村垔', value: '111111' },
+							{ code: '骞村垔', value: '111111' },
+						]
+					}
+				],
 				bg: require("@/static/banner_dati.jpg"),
 				title: '',
 				content: ''
@@ -76,14 +109,14 @@
 		},
 		
 		onLoad() {
-			this.getProblems()
+			// this.getProblems()
 			this.getInfo()
 		},
 
 		methods: {
 			getInfo() {
 				// title
-				this.$u.api.getSystemDictData({
+				getSystemDictData({
 					dictCode: 'SYSTEM',
 					label: 'THEME'
 				}).then(res => {
@@ -91,7 +124,8 @@
 						this.title = res.data.code
 					}
 				})
-				this.$u.api.getSystemDictData({
+				// this.$u.api.getSystemDictData({
+				getSystemDictData({
 					dictCode: 'SYSTEM',
 					label: 'DESCRIPTION'
 				}).then(res => {
@@ -101,7 +135,7 @@
 				})
 			},
 			getProblems() {
-				this.$u.api.getProblemsVO({ useType: 1 })
+				getProblemsVO({ useType: 1 })
 					.then(res => {
 						if (res.code === 200) {
 							res.data.forEach(item => {
@@ -157,6 +191,10 @@
 			},
 			// 涓嬩竴棰�
 			next() {
+				uni.navigateTo({
+					url: `/pages/userinfo/userinfo?userAnswerId=${1}`
+				})
+				return
 				if (this.list[this.i].type === 0 || this.list[this.i].type === 1) {
 					if (!String(this.problemIndex)) return
 					if (this.list[this.i].answer === this.list[this.i].options[this.problemIndex].code) {
@@ -236,6 +274,7 @@
 			.box_list_answer {
 				width: 100%;
 				height: 100%;
+				overflow-y: auto;
 				background: #FFFFFF;
 				border-radius: 16rpx;
 				padding: 30rpx;
@@ -253,6 +292,9 @@
 					box-sizing: border-box;
 					background: #F7F7F7;
 					border-radius: 8rpx;
+					display: flex;
+					align-items: center;
+					margin-bottom: 24rpx;
 					image {
 						width: 28rpx;
 						height: 28rpx;
@@ -265,14 +307,14 @@
 					}
 				}
 			}
+			.list_item{
+				margin-bottom: 24rpx;
+			}
 			.box_list_answer_item {
 				width: 100%;
 				display: flex;
 				align-items: center;
 				margin-bottom: 30rpx;
-				&:last-child {
-					margin-bottom: 0 !important;
-				}
 				image {
 					width: 36rpx;
 					height: 36rpx;
@@ -288,11 +330,15 @@
 				background: #CCCCCC !important;
 				border: none !important;
 			}
+			.empty{
+				height: 160rpx;
+				width: 100%;
+			}
 			.box_list_answer_btn {
-				position: absolute;
-				bottom: 30rpx;
-				left: 30rpx;
-				width: calc(100% - 60rpx);
+				position: fixed;
+				bottom: 140rpx;
+				left: 60rpx;
+				width: 630rpx;
 				height: 88rpx;
 				line-height: 88rpx;
 				text-align: center;

--
Gitblit v1.9.3