Bladeren bron

对接答题和收藏接口

chenxiong 3 jaren geleden
bovenliggende
commit
9bedfbf39c
4 gewijzigde bestanden met toevoegingen van 547 en 138 verwijderingen
  1. 8 0
      common/httpList/goods.js
  2. 2 2
      pages/login/login.vue
  3. 7 1
      pages2/bank/detail.vue
  4. 530 135
      pages2/bank/questionBankTest.vue

+ 8 - 0
common/httpList/goods.js

@@ -24,6 +24,14 @@ export default {
 			noToken: true
 		})
 	},
+	collectQuestion(data) {
+		return myRequest({
+			url: '/collect/question',
+			data:data,
+			method: 'get',
+			noToken: true
+		})
+	},
 	
 	goodsBankList(data) {
 		return myRequest({

+ 2 - 2
pages/login/login.vue

@@ -144,8 +144,8 @@ export default {
 				return 
 			}
 			//虚拟登录
-			/* that.fakeLogin()
-			return */
+			that.fakeLogin()
+			return
 			that.isUse = true
 			that.$api.accountLogin(this.form).then(
 				res => {

+ 7 - 1
pages2/bank/detail.vue

@@ -33,6 +33,8 @@
 				<view class="list" v-for="(item1,index1) in bankList" :key="index1">
 					<template v-if="item1.type==1">
 						<view class="module" @click="clickModule" :data-id="item1.majorId" :data-index="index1">
+							<u-icon class="icon" name="arrow-down-fill" v-if="item1.showList"></u-icon>
+							<u-icon class="icon" name="play-right-fill" v-if="!item1.showList"></u-icon>
 							{{item1.name}} {{item1.subjectName}}
 						</view>
 						
@@ -46,7 +48,7 @@
 								<view  v-if="item2.showList">
 									<view class="article" :class="{active:index3 == 0}"  v-for="(article,index3) in item2.list" :key="index3">
 										<view class="flex_auto">{{article.examName}}</view>
-										<navigator :url="'/pages2/bank/questionBankTest?id='+article.majorId">
+										<navigator :url="'/pages2/bank/questionBankTest?id='+article.examId">
 											<view class="btn">试做</view>
 										</navigator>
 									</view>
@@ -299,6 +301,10 @@ export default {
 				.module {
 					font-size: 30rpx;
 					color: #333333;
+					
+					.icon {
+						margin-right:10rpx;
+					}
 				}
 				
 				.section {

+ 530 - 135
pages2/bank/questionBankTest.vue

@@ -3,15 +3,15 @@
 		<swiper class="swiper" :current="current" @change="swiperChange" :interval="interval">
 			<swiper-item v-for="(bank,bankIndex) in questionList" :key="bankIndex">
 				<view class="pageContent">
-					<view class="pad_8 titBox">
+					<view class="pad_8 titBox" >
 						<view class="firstLetter">
 							<view class="leftLetters">
 								<view class="btnType">
 									<text v-if="bank.type==1">单选</text>
 									<text v-if="bank.type==2">多选</text>
 									<text v-if="bank.type==3">判断</text>
-									<text v-if="bank.type==4">简答题</text>
-									<text v-if="bank.type==5">案例题</text>
+									<text v-if="bank.type==4">案例题</text>
+									<text v-if="bank.type==5">简答题</text>
 								</view>
 								<text>1/{{current}}</text>
 							</view>
@@ -20,147 +20,275 @@
 						</view>
 						<view class="titles">
 							<rich-text :nodes="bank.content"></rich-text>
-						</view>
-						<view class="">
-							<template v-if="bank.type == 1">
-								<view v-if="!ques[bankIndex]">
-									<view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty" @click="radioSelect" :data-index="index" :data-bindex="bankIndex" :data-optionsId="item.optionsId">
-										<view class="activeTI">{{ ast[index] }}</view>
-										{{ item.content }}
+						</view>		
+					</view>
+					<view class="pad_8 titBox">
+						<template v-if="bank.type == 1">
+							<view v-if="!ques[bankIndex]">
+								<view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty" @click="radioSelect" :data-index="index" :data-bindex="bankIndex" :data-optionsId="item.optionsId">
+									<view class="activeTI">{{ ast[index] }}</view>
+									{{ item.content }}
+								</view>
+							</view>
+							<view v-if="ques[bankIndex]">
+								<view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty">
+									<text :class="{right:(item.optionsId == ques[bankIndex]) || (item.optionsId == ans[bankIndex]),wrong:(item.optionsId == ques[bankIndex]) && (ques[bankIndex] != ans[bankIndex])}"  class="activeTI">{{ ast[index] }}</text>
+									{{ item.content }}
+								</view>
+							</view> 
+							<view v-if="ques[bankIndex]">
+								<view class="pad_8 answer">
+									<view>正确答案:{{ast[ans[bankIndex]-1]}}</view>
+									<view>我的答案:{{ast[ques[bankIndex]-1]}}</view>
+								</view>
+								<view class="pad_8 answerInfos">
+									<view class="answerTitle">答案解析</view>
+									<view class="answerContent">
+										<rich-text :nodes="bank.analysisContent"></rich-text>
 									</view>
 								</view>
-								<view v-if="ques[bankIndex]">
-									<view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty">
-										<text :class="{right:(item.optionsId == ques[bankIndex]) || (item.optionsId == ans[bankIndex]),wrong:(item.optionsId == ques[bankIndex]) && (ques[bankIndex] != ans[bankIndex])}"  class="activeTI">{{ ast[index] }}</text>
-										{{ item.content }}
+							</view>
+						</template>
+						
+						<template v-if="bank.type == 2">
+							<view v-if="!ques[bankIndex]">
+								<view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty" @click="checkboxSelect" :data-index="index" :data-bindex="bankIndex" :data-optionsId="item.optionsId">
+									<view :class="{checked:item.checked}" class="activeTI">{{ ast[index] }}</view>
+									{{ item.content }}
+								</view>
+							</view>
+							<view v-if="!ques[bankIndex]" class="submit_checkbox" @click="checkboxSubmit" :data-bindex="bankIndex">
+								确认答案
+							</view>
+							<view v-if="ques[bankIndex]">
+								<view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty">
+									<text :class="{right:(ques[bankIndex].indexOf(item.optionsId) != -1 ) || (ans[bankIndex].indexOf(item.optionsId) != -1),wrong:(ques[bankIndex].indexOf(item.optionsId) != -1 ) && (ans[bankIndex].indexOf(item.optionsId) == -1)}"  class="activeTI">{{ ast[index] }}</text>
+									{{ item.content }} 
+								</view>
+							</view> 
+							<view v-if="ques[bankIndex]">
+								<view class="pad_8 answer">
+									<view>正确答案:
+										<text v-for="ansItem in ans[bankIndex]">{{ast[ansItem-1]}}</text>
 									</view>
-								</view> 
-								<view v-if="ques[bankIndex]">
-									<view class="pad_8 answer">
-										<view>正确答案:{{ast[ans[bankIndex]-1]}}</view>
-										<view>我的答案:{{ast[ques[bankIndex]-1]}}</view>
+									<view>我的答案:
+										<text v-for="quesItem in ques[bankIndex]">{{ast[quesItem-1]}}</text>
 									</view>
-									<view class="pad_8 answerInfos">
-										<view class="answerTitle">答案解析</view>
-										<view class="answerContent">
-											<rich-text :nodes="bank.analysisContent"></rich-text>
+								</view>
+								<view class="pad_8 answerInfos">
+									<view class="answerTitle">答案解析</view>
+									<view class="answerContent">
+										<rich-text :nodes="bank.analysisContent"></rich-text>
+									</view>
+								</view>
+							</view>
+						</template>
+						
+						<template v-if="bank.type == 3">
+							<view v-if="!ques[bankIndex]">
+								<view v-for="(item, index) in judge" :key="index" class="lisSty" @click="judgeSelect" :data-index="index" :data-bindex="bankIndex" >
+									<view class="activeTI">{{ ast[index] }}</view>
+									{{ item }}
+								</view>
+							</view>
+							<view v-if="ques[bankIndex]">
+								<view v-for="(item, index) in judge" :key="index" class="lisSty">
+									<text :class="{right:(index == ques[bankIndex]) || (index == ans[bankIndex]),wrong:(index == ques[bankIndex]) && (ques[bankIndex] != ans[bankIndex])}"  class="activeTI">{{ ast[index] }}</text>
+									{{ item }}
+								</view>
+							</view> 
+							<view v-if="ques[bankIndex]">
+								<view class="pad_8 answer">
+									<view>正确答案:{{ast[ans[bankIndex]]}}</view>
+									<view>我的答案:{{ast[ques[bankIndex]]}}</view>
+								</view>
+								<view class="pad_8 answerInfos">
+									<view class="answerTitle">答案解析</view>
+									<view class="answerContent">
+										<rich-text :nodes="bank.analysisContent"></rich-text>
+									</view>
+								</view>
+							</view>
+						</template>
+						
+						
+						<!-- 简答题 -->
+						<template v-if="bank.type == 5">
+							<view class="ans">
+								<view class="ans_input" v-if="!ques[bankIndex]">
+									<view class="top flex">
+										<image :data-index="bankIndex" class="icon" :data-bindex="bankIndex" @click="chooseImg" src="/static/08-10_032.jpg" mode=""></image>
+										<view class="progress">0/4</view>
+										<view class="submit"  @click="submitAns" :data-bindex="bankIndex" >确认答案</view>
+									</view>
+									<view class="textarea">
+										<textarea v-model="bank.ansText.text" placeholder="在此输入答案"></textarea>
+									</view>
+									<view class="imgs">
+										<view class="img" v-for="(img,imgIndex) in bank.ansText.imageList" >
+											<text @click="deleteImg" :data-imgIndex="imgIndex" :data-bindex="bankIndex">x</text>
+											<image :src="img"></image>
 										</view>
 									</view>
 								</view>
-							</template>
-							
-							<template v-if="bank.type == 2">
-								<view v-if="!ques[bankIndex]">
-									<view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty" @click="checkboxSelect" :data-index="index" :data-bindex="bankIndex" :data-optionsId="item.optionsId">
-										<view :class="{checked:item.checked}" class="activeTI">{{ ast[index] }}</view>
-										{{ item.content }}
+								<view class="ans_submit answerInfos" v-if="ques[bankIndex]">
+									<view class="answerTitle">答案我的</view>
+									{{ques[bankIndex].text}}
+									<view class="imgs">
+										<image class="img" v-for="ques in ques[bankIndex].imageList" :src="ques"></image>
+									</view>
+								</view>
+							</view>
+							<view v-if="ques[bankIndex]">
+								<view class="pad_8 answerInfos">
+									<view class="answerTitle">答案解析</view>
+									<view class="answerContent">
+										<rich-text :nodes="bank.analysisContent"></rich-text>
 									</view>
 								</view>
-								<view v-if="!ques[bankIndex]" class="submit_checkbox" @click="checkboxSubmit" :data-bindex="bankIndex">
-									确认答案
+							</view>
+						</template>
+						
+						<!-- 案例题 -->
+						<template v-if="bank.type == 4">
+							<view class="tabs">
+								<view class="tab" :class="{current:tabIndex == bank.current}" :data-bindex="bankIndex" :data-index="tabIndex" :key="tabIndex" v-for="(tab,tabIndex) in bank.jsonStr" @click="tabSelect">问题{{tabIndex}}</view>
+							</view>
+							<view v-for="(ansItem,ansIndex) in bank.jsonStr" v-if="bank.current == ansIndex" :key="ansIndex">
+								<view class="titles">
+									<rich-text :nodes="ans.content"></rich-text>
 								</view>
-								<view v-if="ques[bankIndex]">
-									<view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty">
-										<text :class="{right:(ques[bankIndex].indexOf(item.optionsId) != -1 ) || (ans[bankIndex].indexOf(item.optionsId) != -1),wrong:(ques[bankIndex].indexOf(item.optionsId) != -1 ) && (ans[bankIndex].indexOf(item.optionsId) == -1)}"  class="activeTI">{{ ast[index] }}</text>
-										{{ item.content }}  {{ques[bankIndex].indexOf(item.optionsId) != -1 }}  {{item.optionsId}} {{ans[bankIndex].indexOf(item.optionsId) != -1}}
+								<template v-if="ansItem.type == 1">
+									<view v-if="!ques[bankIndex][ansIndex]">
+										<view v-for="(option, childIndex) in ansItem.optionsList" :key="childIndex" class="lisSty" @click="radioSelectChild" :data-ansIndex="ansIndex" :data-bindex="bankIndex" :data-optionsId="option.optionsId">
+											<view class="activeTI">{{ ast[childIndex] }}</view>
+											<rich-text class="textChild" :nodes="option.content"></rich-text>
+										</view>
 									</view>
-								</view> 
-								<view v-if="ques[bankIndex]">
-									<view class="pad_8 answer">
-										<view>正确答案:
-											<text v-for="ansItem in ans[bankIndex]">{{ast[ansItem-1]}}</text>
+									<view v-if="ques[bankIndex][ansIndex]">
+										<view v-for="(option, childIndex) in ansItem.optionsList" :key="index" class="lisSty">
+											<text :class="{right:(option.optionsId == ques[bankIndex][ansIndex]) || (option.optionsId == ans[bankIndex][ansIndex]),wrong:(option.optionsId == ques[bankIndex][ansIndex]) && (ques[bankIndex][ansIndex] != ans[bankIndex][ansIndex])}"  class="activeTI">{{ ast[childIndex] }}</text>
+											<rich-text :nodes="option.content"></rich-text>
 										</view>
-										<view>我的答案:
-											<text v-for="quesItem in ques[bankIndex]">{{ast[quesItem-1]}}</text>
+									</view> 
+									<view v-if="ques[bankIndex][ansIndex]">
+										<view class="pad_8 answer">
+											<view>正确答案:{{ast[ans[bankIndex][ansIndex]-1]}}</view>
+											<view>我的答案:{{ast[ques[bankIndex][ansIndex]-1]}}</view>
 										</view>
-									</view>
-									<view class="pad_8 answerInfos">
-										<view class="answerTitle">答案解析</view>
-										<view class="answerContent">
-											<rich-text :nodes="bank.analysisContent"></rich-text>
+										<view class="pad_8 answerInfos">
+											<view class="answerTitle">答案解析</view>
+											<view class="answerContent">
+												<rich-text :nodes="option.analysisContent"></rich-text>
+											</view>
 										</view>
 									</view>
-								</view>
-							</template>
-							
-							<template v-if="bank.type == 3">
-								<view v-if="!ques[bankIndex]">
-									<view v-for="(item, index) in judge" :key="index" class="lisSty" @click="judgeSelect" :data-index="index" :data-bindex="bankIndex" >
-										<view class="activeTI">{{ ast[index] }}</view>
-										{{ item }}
+								</template>
+								
+								<template v-if="ansItem.type == 2">
+									<view v-if="!ques[bankIndex][ansIndex]">
+										<view v-for="(option, childindex) in ansItem.optionsList" :key="childindex" :data-childindex="childindex" class="lisSty" @click="checkboxSelectChild" :data-ansIndex="ansIndex" :data-bindex="bankIndex" :data-optionsId="ans.optionsId">
+											<view :class="{checked:option.checked}" class="activeTI">{{ ast[childindex] }}</view>
+											<rich-text :nodes="option.content"></rich-text>
+										</view>
 									</view>
-								</view>
-								<view v-if="ques[bankIndex]">
-									<view v-for="(item, index) in judge" :key="index" class="lisSty">
-										<text :class="{right:(index == ques[bankIndex]) || (index == ans[bankIndex]),wrong:(index == ques[bankIndex]) && (ques[bankIndex] != ans[bankIndex])}"  class="activeTI">{{ ast[index] }}</text>
-										{{ item }}
+									<view v-if="!ques[bankIndex][ansIndex]" :data-ansindex="ansIndex" class="submit_checkbox" @click="checkboxSubmitChild" :data-bindex="bankIndex">
+										确认答案
 									</view>
-								</view> 
-								<view v-if="ques[bankIndex]">
-									<view class="pad_8 answer">
-										<view>正确答案:{{ast[ans[bankIndex]]}}</view>
-										<view>我的答案:{{ast[ques[bankIndex]]}}</view>
+									<view v-if="ques[bankIndex] && ques[bankIndex][ansIndex]">
+										<view v-for="(option, childindex) in ansItem.optionsList" :key="childindex" class="lisSty">
+											<text :class="{right:right(bankIndex,ansIndex,option),wrong:wrong(bankIndex,ansIndex,option)}"  class="activeTI">{{ ast[childindex] }}</text>
+											<rich-text :nodes="option.content"></rich-text>
+										</view>
+									</view> 
+									<view v-if="ques[bankIndex][ansIndex]">
+										<view class="pad_8 answer">
+											<view>正确答案:
+												<text v-for="ansItem1 in ans[bankIndex][ansIndex]">{{ast[ansItem1-1]}}</text>
+											</view>
+											<view>我的答案:
+												<text v-for="quesItem in ques[bankIndex][ansIndex]">{{ast[quesItem-1]}}</text>
+											</view>
+										</view>
+										<view class="pad_8 answerInfos">
+											<view class="answerTitle">答案解析</view>
+											<view class="answerContent">
+												<rich-text :nodes="ansItem.analysisContent"></rich-text>
+											</view>
+										</view>
 									</view>
-									<view class="pad_8 answerInfos">
-										<view class="answerTitle">答案解析</view>
-										<view class="answerContent">
-											<rich-text :nodes="bank.analysisContent"></rich-text>
+								</template>
+								
+								<template v-if="ansItem.type == 3">
+									<view v-if="!ques[bankIndex][ansIndex]">
+										<view v-for="(option, childindex) in judge" :key="childindex" class="lisSty" @click="judgeSelectChild" :data-ansIndex="ansIndex" :data-childindex="childindex" :data-bindex="bankIndex" >
+											<view class="activeTI">{{ ast[childindex] }}</view>
+											{{ option }}
 										</view>
 									</view>
-								</view>
-							</template>
-							<template v-if="bank.type == 4">
-								<view class="ans">
-									<view class="ans_input" v-if="!ques[bankIndex]">
-										<view class="top flex">
-											<image :data-index="bankIndex" class="icon" :data-bindex="bankIndex" @click="chooseImg" src="/static/08-10_032.jpg" mode=""></image>
-											<view class="progress">0/4</view>
-											<view class="submit"  @click="submitAns" :data-bindex="bankIndex" >确认答案</view>
+									<view v-if="ques[bankIndex][ansIndex]">
+										<view v-for="(option, childindex) in judge" :key="childindex" class="lisSty">
+											<text :class="{right:(childindex == ques[bankIndex][ansIndex]) || (childindex == ans[bankIndex][ansIndex]),wrong:(childindex == ques[bankIndex][ansIndex]) && (ques[bankIndex][ansIndex] != ans[bankIndex][ansIndex])}"  class="activeTI">{{ ast[childindex] }}</text>
+											{{ option }}
 										</view>
-										<view class="textarea">
-											<textarea v-model="bank.text" placeholder="在此输入答案"></textarea>
+									</view> 
+									<view v-if="ques[bankIndex][ansIndex]">
+										<view class="pad_8 answer">
+											<view>正确答案:{{ast[ans[bankIndex][ansIndex]]}}</view>
+											<view>我的答案:{{ast[ques[bankIndex][ansIndex]]}}</view>
 										</view>
-										<view class="imgs">
-											<view class="img" v-for="(img,imgIndex) in bank.imageList" >
-												<text @click="deleteImg" :data-imgIndex="imgIndex" :data-bindex="bankIndex">x</text>
-												<image :src="img"></image>
+										<view class="pad_8 answerInfos">
+											<view class="answerTitle">答案解析</view>
+											<view class="answerContent">
+												<rich-text :nodes="ansItem.analysisContent"></rich-text>
 											</view>
 										</view>
 									</view>
-									<view class="ans_submit answerInfos" v-if="ques[bankIndex]">
-										<view class="answerTitle">答案我的</view>
-										{{ques[bankIndex].text}}
-										<view class="imgs">
-											<image class="img" v-for="ques in ques[bankIndex].imageList" :src="ques"></image>
+								</template>
+								
+								
+								<!-- 简答题 -->
+								<template v-if="ansItem.type == 5">
+									<view class="ans">
+										<view class="ans_input" v-if="!ques[bankIndex][ansIndex]">
+											<view class="top flex">
+												<image :data-ansindex="ansIndex" class="icon" :data-bindex="bankIndex" @click="chooseImgChild" src="/static/08-10_032.jpg" mode=""></image>
+												<view class="progress">0/4</view>
+												<view class="submit"  @click="submitAnsChild" :data-ansindex="ansIndex" :data-index="ansIndex" :data-bindex="bankIndex" >确认答案</view>
+											</view>
+											<view class="textarea">
+												<textarea v-model="ansItem.ansText.text" placeholder="在此输入答案"></textarea>
+											</view>
+											<view class="imgs">
+												<view class="img" v-for="(img,imgIndex) in ansItem.ansText.imageList" >
+													<text @click="deleteImgChild" :data-imgIndex="imgIndex" :data-ansindex="ansIndex"  :data-bindex="bankIndex">x</text>
+													<image :src="img"></image>
+												</view>
+											</view>
+										</view>
+										<view class="ans_submit answerInfos" v-if="ques[bankIndex][ansIndex]">
+											<view class="answerTitle">答案我的</view>
+											{{ques[bankIndex][ansIndex].text}}
+											<view class="imgs">
+												<image class="img" v-for="ques in ques[bankIndex][ansIndex].imageList" :src="ques"></image>
+											</view>
 										</view>
 									</view>
-								</view>
-								<view v-if="ques[bankIndex]">
-									<view class="pad_8 answerInfos">
-										<view class="answerTitle">答案解析</view>
-										<view class="answerContent">
-											这是官方答案解析文本,卡片高度根据内容自动调整,我实在编不出来内容了,我实在编不出来内容了,我实在编不出来内容了,我实在编不出来内容了,就这样吧。
+									<view v-if="ques[bankIndex][ansIndex]">
+										<view class="pad_8 answerInfos">
+											<view class="answerTitle">答案解析</view>
+											<view class="answerContent">
+												<rich-text :nodes="ansItem.analysisContent"></rich-text>
+											</view>
 										</view>
 									</view>
-								</view>
-							</template>
-							
-							<!-- <view v-if="ques[bankIndex] ">
-								<view v-for="(item, index) in bank.jsonStr" :key="index" 
-									 
-									class="lisSty">
-									<view :class="{right:(item.value == ques[bankIndex]) && (ques[bankIndex] == ans[bankIndex]),wrong:(item.value == ques[bankIndex]) && (ques[bankIndex] != ans[bankIndex])}" class="activeTI">{{ ast[index] }}</view>
-									{{ item.label }}
-								</view>
+								</template>
+								
+								
 							</view>
-							<view v-if="!ques[bankIndex]">
-								<view v-for="(item, index) in bank.jsonStr" :key="index" @click="click" :data-value="item.value" class="lisSty">
-									<text class="activeTI">{{ ast[index] }}</text>
-									{{ item.label }}
-								</view>
-							</view> -->
-							
-						</view>
+						</template>
+						
+						
 					</view>
 					
 					
@@ -182,7 +310,7 @@
 				<view class="popupContent">
 					<scroll-view scroll-y="true" style="height: 506rpx;">
 						<view class="boxSty">
-							<view v-for="(item, index) in questionList" :key="index" :data-index="index" @click="changeIndex" :class="{disabled:index>=5}" class="liListSty">{{ index + 1 }}</view>
+							<view v-for="(item, index) in questionList" :key="index" :data-index="index" @click="changeIndex" :class="{isRight:isRight(item,index),isWrong:isWrong(item,index)}" class="liListSty">{{ index + 1 }}</view>
 						</view>
 					</scroll-view>
 				</view>
@@ -235,9 +363,47 @@ export default {
 						})
 						this.$set(this.ans,index,arr);
 						return;
+					} else if(item.type == 5) {
+						item.ansText = {
+							text: '',
+							imageList: []
+						}
+						
 					} else if(item.type == 4) {
-						item.text = '';
-						item.imageList = [];
+						console.log(item.jsonStr)
+						this.$set(this.ques,index,[])
+						item.current = 0;
+						let ansArr = []; 
+						item.jsonStr.forEach((json,index) => {
+							if(json.type == 1) {
+								ansArr[index] = json.answerQuestion;
+							} else if(json.type == 2) {
+								json.optionsList.forEach(str => {
+									str.optionsId = ''+str.optionsId;
+								})
+								let arr = json.answerQuestion.split(',');
+								arr.forEach((a,i) => {
+									arr[i] = ''+a;
+								})
+								ansArr[index] = arr
+							} else if(json.type == 3) {
+								ansArr[index] = json.answerQuestion;
+							} else if(json.type == 5) {
+								ansArr[index] = {
+									text: '',
+									imageList: []
+								}
+								json.ansText = {
+									text: '',
+									imageList: []
+								}
+							}
+						})
+						
+						
+						this.$set(this.ans,index,ansArr);
+						return;
+						
 					}
 					
 					this.$set(this.ans,index,item.answerQuestion);
@@ -257,6 +423,20 @@ export default {
 			this.$set(this.ques,bindex,optionsId)
 		},
 		
+		/**
+		 * @param {Object} e单选点击
+		 */
+		radioSelectChild(e) {
+			console.log(e.currentTarget.dataset)
+			let optionsId = e.currentTarget.dataset.optionsid;
+			
+			let ansIndex = e.currentTarget.dataset.ansindex;
+			let bindex = e.currentTarget.dataset.bindex;
+			if(this.ques[bindex][ansIndex]) return;
+			this.$set(this.ques[bindex],ansIndex,optionsId)
+			
+		},
+		
 		
 		/**
 		 * @param {Object} 多选点击
@@ -269,6 +449,18 @@ export default {
 			this.$set(this.questionList[bindex].jsonStr[index],'checked',!this.questionList[bindex].jsonStr[index].checked)
 		},
 		
+		/**
+		 * @param {Object} 多选点击
+		 */
+		checkboxSelectChild(e) {
+			let optionsId = e.currentTarget.dataset.optionsid;
+			let bindex = e.currentTarget.dataset.bindex;
+			let ansIndex = e.currentTarget.dataset.ansindex;
+			let childIndex = e.currentTarget.dataset.childindex;
+			
+			this.$set(this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex],'checked',!this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex].checked)
+		},
+		
 		/**
 		 * @param {Object} 多选确认
 		 */
@@ -285,9 +477,24 @@ export default {
 			})
 			
 			this.$set(this.ques,bindex,arr)
+		},
+		
+		/**
+		 * @param {Object} 多选确认
+		 */
+		checkboxSubmitChild(e) {
+			let bindex = e.currentTarget.dataset.bindex;
+			let ansIndex = e.currentTarget.dataset.ansindex;
 			
-			console.log(this.ques);
-			console.log(this.ans)
+			if(this.ques[bindex][ansIndex]) return;
+			let arr = [];
+			this.questionList[bindex].jsonStr[ansIndex].optionsList.forEach(item => {
+				if(item.checked) {
+					arr.push(item.optionsId)
+				}
+			})
+			
+			this.$set(this.ques[bindex],ansIndex,arr)
 		},
 		
 		judgeSelect(e) {
@@ -297,6 +504,14 @@ export default {
 			this.$set(this.ques,bindex,index+'')
 		},
 		
+		judgeSelectChild(e) {
+			let ansindex = e.currentTarget.dataset.ansindex;
+			let childindex = e.currentTarget.dataset.childindex;
+			let bindex = e.currentTarget.dataset.bindex;
+			if(this.ques[bindex][ansindex]) return;
+			this.$set(this.ques[bindex],ansindex,childindex+'')
+		},
+		
 		openFooterTab() {
 			this.show = true;
 		},
@@ -331,11 +546,12 @@ export default {
 		},
 		
 		collect() {
-			uni.showToast({
-			    title: '返回详情购买后即可收藏~',
-			    duration: 2000,
-				icon:'none'
-			});
+			// uni.showToast({
+			//     title: '返回详情购买后即可收藏~',
+			//     duration: 2000,
+			// 	icon:'none'
+			// });
+			this.collectQuestion()
 			return;
 		},
 		
@@ -352,7 +568,17 @@ export default {
 			var imgIndex = e.currentTarget.dataset.imgindex;
 			var bankIndex = e.currentTarget.dataset.bankindex;
 			
-			this.questionList[bankIndex].imageList.splice(imgIndex,1)
+			this.questionList[bankIndex].ansText.imageList.splice(imgIndex,1)
+		},
+		
+		
+		deleteImgChild(e) {
+			
+			var imgIndex = e.currentTarget.dataset.imgindex;
+			var bankIndex = e.currentTarget.dataset.bankindex;
+			var ansIndex = e.currentTarget.dataset.ansindex;
+			
+			this.questionList[bankIndex].jsonStr[ansIndex].ansText.imageList.splice(imgIndex,1)
 		},
 		
 		chooseImg(e) {
@@ -365,7 +591,24 @@ export default {
 				success: (res) => {
 					// console.log(JSON.stringify(res.tempFilePaths));
 					
-					this.questionList[bankindex].imageList.push(res.tempFilePaths)
+					this.questionList[bankindex].ansText.imageList.push(res.tempFilePaths)
+				}
+			})
+		},
+		
+		chooseImgChild(e) {
+			let bankindex = e.currentTarget.dataset.bindex;
+			let ansindex = e.currentTarget.dataset.ansindex;
+			uni.chooseImage({
+				count: 1, //默认9
+				sizeType: ['original', ], //可以指定是原图还是压缩图,默认二者都有
+				sourceType: ['album','camera'], //从相册选择
+				success: (res) => {
+					// console.log(JSON.stringify(res.tempFilePaths));
+					
+					console.log(this.questionList[bankindex].jsonStr[ansindex])
+					
+					this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.push(res.tempFilePaths)
 				}
 			})
 		},
@@ -375,7 +618,7 @@ export default {
 			let bankindex = e.currentTarget.dataset.bindex;
 				
 			console.log(this.questionList[bankindex])
-			if(!this.questionList[bankindex].text && !this.questionList[bankindex].imageList.length) {
+			if(!this.questionList[bankindex].ansText.text && !this.questionList[bankindex].ansText.imageList.length) {
 				uni.showToast({
 					title: '请输入内容或上传图片',
 					duration: 2000,
@@ -385,10 +628,131 @@ export default {
 			}
 			
 			this.$set(this.ques,bankindex,{
-				imageList:this.questionList[bankindex].imageList,
-				text:this.questionList[bankindex].text,
+				imageList:this.questionList[bankindex].ansText.imageList,
+				text:this.questionList[bankindex].ansText.text,
 			})
 			
+		},
+		
+		submitAnsChild(e) {
+			let type = e.currentTarget.dataset.type;
+			let bankindex = e.currentTarget.dataset.bindex;
+			let ansindex = e.currentTarget.dataset.ansindex;
+				
+			if(!this.questionList[bankindex].jsonStr[ansindex].ansText.text && !this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.length) {
+				uni.showToast({
+					title: '请输入内容或上传图片',
+					duration: 2000,
+					icon:'none'
+				});
+				return
+			}
+			
+			this.$set(this.ques[bankindex],ansindex,{
+				imageList:this.questionList[bankindex].jsonStr[ansindex].ansText.imageList,
+				text:this.questionList[bankindex].jsonStr[ansindex].ansText.text,
+			})
+			
+		},
+		
+		isRight(item,index) {
+			//单选
+			if(this.ques[index]) {
+				if(item.type == 1) {
+					return this.ques[index] == this.ans[index];
+				//多选
+				} else if(item.type == 2) {
+					//每一项都相等
+					return this.ques.every((item,index) => {
+						return item == this.ans[index];
+					})
+				//判断
+				} else if(item.type == 3) {
+					return this.ques[index] == this.ans[index];
+				} else {
+					return false;
+				}
+			} else {
+				return false;
+			}
+			
+		},
+		
+		
+		right(bankIndex,ansIndex,option) {
+			console.log(this.ques[bankIndex][ansIndex] || this.ans[bankIndex][ansIndex] )
+			if(this.ques[bankIndex][ansIndex] && this.ans[bankIndex][ansIndex]) {
+				
+				if((this.ques[bankIndex][ansIndex].indexOf(option.optionsId) != -1 ) || (this.ans[bankIndex][ansIndex].indexOf(option.optionsId) != -1)) {
+					return true
+				} else {
+					return false;
+				}
+			} else {
+				return false;
+			}
+			
+		},
+		
+		wrong(bankIndex,ansIndex,option) {
+			console.log(this.ques[bankIndex][ansIndex] || this.ans[bankIndex][ansIndex] )
+			if(this.ques[bankIndex][ansIndex] && this.ans[bankIndex][ansIndex]) {
+				
+				if((this.ques[bankIndex][ansIndex].indexOf(option.optionsId) != -1 ) && (this.ans[bankIndex][ansIndex].indexOf(option.optionsId) == -1)) {
+					return true;
+				} else {
+					return false;
+				}
+			} else {
+				return false;
+			}
+		},
+		
+		isWrong(item,index) {
+			if(this.ques[index]) {
+				//单选
+				if(item.type == 1) {
+					return this.ques[index] != this.ans[index];
+				//多选
+				} else if(item.type == 2) {
+					//每一项都相等
+					return this.ques.some((item,index) => {
+						return item != this.ans[index];
+					})
+				//判断
+				} else if(item.type == 3) {
+					return this.ques[index] != this.ans[index];
+				} else {
+					return false;
+				}
+			} else {
+				return false;
+			}
+			
+		},
+		
+		tabSelect(e) {
+			let index = e.currentTarget.dataset.index;
+			let bankindex = e.currentTarget.dataset.bindex;
+			
+			this.$set(this.questionList[bankindex],'current',index)
+			
+			console.log(this.questionList[bankindex])
+		},
+		
+		collectQuestion() {
+			this.$api.collectQuestion({
+				examId:this.id
+			}).then(res => {
+				if(res.data.code==200){
+					
+					uni.showToast({
+						title: '收藏成功',
+						duration: 2000,
+						icon:'none'
+					});
+				}
+			})
 		}
 	}
 };
@@ -401,7 +765,7 @@ export default {
 }
 .lisSty {
 	margin-bottom: 16rpx;
-	
+	display: flex;
 }
 .activeTI {
 	vertical-align: middle;
@@ -452,6 +816,26 @@ export default {
 	padding: 41rpx 25rpx 24rpx 25rpx;
 }
 
+.tabs {
+	margin:10rpx;
+	display: flex;
+	.tab {
+		margin:0 10rpx;
+		width: 96rpx;
+		height: 48rpx;
+		line-height: 48rpx;
+		text-align: center;
+		color:#007AFF;
+		font-size: 28rpx;
+		border-radius: 16rpx;
+		
+		&.current {
+			color:#fff;
+			background: #007AFF;
+		}
+	}
+}
+
 .ans {
 	margin:8rpx 8rpx 8rpx;
 	
@@ -634,21 +1018,27 @@ export default {
 	padding: 44rpx 41rpx 0rpx;
 }
 .liListSty {
+	border:1rpx solid #EEEEEE;
 	width: 88rpx;
 	height: 88rpx;
 	border-radius: 32rpx;
-	background-color: #ff3b30;
 	text-align: center;
 	line-height: 88rpx;
-	color: #fff;
+	color: #333;
 	font-size: 32rpx;
 	float: left;
 	margin: 20rpx 23rpx;
 	
-	&.disabled {
+	&.isRight {
 		border:1rpx solid #EEEEEE;
-		color:#EEEEEE;
-		background: none;
+		color:#fff;
+		background: green;
+	}
+	
+	&.isWrong {
+		border:1rpx solid #EEEEEE;
+		color:#fff;
+		background: red;
 	}
 }
 .answerInfos {
@@ -664,6 +1054,11 @@ export default {
 	color: #666;
 }
 
+.textChild {
+	display: inline-block;
+	vertical-align: middle;
+}
+
 .dialog {
 	position: fixed;
 	left:0;