Tang 3 năm trước cách đây
mục cha
commit
13ffa75c95

+ 2 - 2
common/httpList/course.js

@@ -12,7 +12,7 @@ export default {
 	},
 	chapterList(data) {
 		return myRequest({
-			url: '/app/common/course/chapterList',
+			url: '/app/common/course/chapterList/'+data,
 			method: 'get',
 			data: data,
 			noToken: true
@@ -20,7 +20,7 @@ export default {
 	},
 	sectionList(data) {
 		return myRequest({
-			url: '/app/common/course/sectionList',
+			url: '/app/common/course/sectionList/'+data,
 			method: 'get',
 			data: data,
 			noToken: true

+ 128 - 2
common/httpList/goods.js

@@ -28,8 +28,92 @@ export default {
 		return myRequest({
 			url: '/collect/question',
 			data:data,
-			method: 'get',
-			noToken: true
+			method: 'POST'
+		})
+	},
+	
+	deleteCollectQuestion(data) {
+		return myRequest({
+			url: '/collect/question/delete/'+data,
+			method: 'POST',
+		})
+	},
+	examRecord(data) {
+		return myRequest({
+			url: '/exam/record',
+			data:data,
+			method: 'POST',
+		})
+	},
+	
+	examWrongRecord(data) {
+		return myRequest({
+			url: '/exam/wwrong/record',
+			data:data,
+			method: 'POST',
+		})
+	},
+	
+	examRecordEdit(data) {
+		return myRequest({
+			url: '/exam/record/edit',
+			data:data,
+			method: 'POST',
+		})
+	},
+	
+	examaperList(data) {
+		return myRequest({
+			url: '/exam/paper/list',
+			data:data,
+			method: 'GET',
+		})
+	},
+	
+	examRecordList(data) {
+		return myRequest({
+			url: '/exam/record/list',
+			data:data,
+			method: 'GET',
+		})
+	},
+	
+	collectQuestionTypeList(data) {
+		return myRequest({
+			url: '/collect/question/type_list',
+			data:data,
+			method: 'GET',
+		})
+	},
+	
+	wrongRecordTypeQuestionList(data) {
+		return myRequest({
+			url: '/exam/wwrong/record/type_question_list',
+			data:data,
+			method: 'GET',
+		})
+	},
+	
+	wrongRecordTypeList(data) {
+		return myRequest({
+			url: '/exam/wwrong/record/type_list',
+			data:data,
+			method: 'GET',
+		})
+	},
+
+	listGoodsUserQuestion(data) {
+		return myRequest({
+			url: '/bank/question/listGoodsUserQuestion',
+			data:data,
+			method: 'get'
+		})
+	},
+	getCollectInfo(data) {
+		return myRequest({
+			url: '/collect/question/getInfo',
+			data:data,
+			method: 'get'
 		})
 	},
 	
@@ -42,6 +126,16 @@ export default {
 		})
 	},
 	
+	wrongRecordList(data) {
+		return myRequest({
+			url: '/exam/wwrong/record/list',
+			method: 'get',
+			data:data
+		})
+	},
+	
+	
+	
 	goodsChapterList(data) {
 		return myRequest({
 			url: '/app/common/bank/chapter/list',
@@ -50,6 +144,38 @@ export default {
 			noToken: true
 		})
 	},
+	wrongRecordExamQuestionList(data) {
+		return myRequest({
+			url: '/exam/wwrong/record/exam_question_list',
+			method: 'get',
+			data:data,
+		})
+	},
+	
+	wrongRecordDelete(data) {
+		return myRequest({
+			url: '/exam/wwrong/record/delete/question',
+			method: 'post',
+			data:data
+		})
+	},
+	
+	goodsCollectExamList(data) {
+		return myRequest({
+			url: '/collect/question/exam_list',
+			method: 'get',
+			data:data
+		})
+	},
+	
+	goodsCollectList(data) {
+		return myRequest({
+			url: '/collect/question/list',
+			method: 'get',
+			data:data
+		})
+	},
+	
 	goodsExamList(data) {
 		return myRequest({
 			url: '/app/common/bank/exam/list',

+ 2 - 1
common/request.js

@@ -4,7 +4,8 @@
 import store from '@/store/index.js'
 import api from './api.js'
 var num = 1
-export const BASE_URL = 'http://192.168.1.222:5055'//接口api
+export const BASE_URL = 'http://192.168.1.222:5055'//接口api  http://42.192.164.187:19005
+
 export const BASE_IMG_URL = 'https://file-dev.xyyxt.net/'//图片上传api  'https://file.xyyxt.net/
 export const tenantId = '867735392558919680'
 export const myRequest = (options) => {

+ 7 - 4
pages2/components/course/courseChapter.vue → components/course/courseChapter.vue

@@ -7,7 +7,7 @@
 		</view>
 		<view v-if="!down">
 			<view v-for="(itemM,indexM) in list" >
-				<courseSection :menuItem="itemM"></courseSection>
+				<courseSection :isBuy="isBuy" :menuItem="itemM"></courseSection>
 				<u-line v-if="indexM<list.length-1"></u-line>
 			</view>
 		</view>
@@ -16,13 +16,17 @@
 
 <script>
 import { mapGetters } from 'vuex';
-import courseSection from '@/pages2/components/course/courseSection.vue';
+import courseSection from '@/components/course/courseSection.vue';
 export default {
 	name: 'courseChapter',
 	props: {
 		menuItem: {
 			type: Object,
 			default: {}
+		},
+		isBuy: {
+			type: Boolean,
+			default: false
 		}
 	},
 	components: {
@@ -40,7 +44,6 @@ export default {
 		
 	},
 	mounted() {
-		
 	},
 	methods: {
 		openChapter(item){
@@ -51,7 +54,7 @@ export default {
 		},
 		getSectionList(chapterId) {
 			let self = this
-			this.$api.sectionList({chapterId:chapterId}).then(res => {
+			this.$api.sectionList(chapterId).then(res => {
 				if(res.data.code==200){
 					for(let i=0;i<res.data.data.length;i++){
 						let item = res.data.data[i]

+ 7 - 3
pages2/components/course/courseModule.vue → components/course/courseModule.vue

@@ -7,7 +7,7 @@
 		</view>
 		<view v-if="!down">
 			<view v-for="(itemM,indexM) in list" >
-				<courseChapter  :menuItem="itemM"></courseChapter>
+				<courseChapter :isBuy="isBuy"  :menuItem="itemM"></courseChapter>
 				<u-line v-if="indexM<list.length-1"></u-line>
 			</view>
 		</view>
@@ -15,13 +15,17 @@
 </template>
 
 <script>
-import courseChapter from '@/pages2/components/course/courseChapter.vue';
+import courseChapter from '@/components/course/courseChapter.vue';
 export default {
 	name: 'courseModule',
 	props: {
 		menuItem: {
 			type: Object,
 			default: {}
+		},
+		isBuy: {
+			type: Boolean,
+			default: false
 		}
 	},
 	components: {
@@ -49,7 +53,7 @@ export default {
 		},
 		getChapterList(moduleId) {
 			let self = this
-			this.$api.chapterList({moduleId:moduleId}).then(res => {
+			this.$api.chapterList(moduleId).then(res => {
 				if(res.data.code==200){
 					for(let i=0;i<res.data.data.length;i++){
 						let item = res.data.data[i]

+ 46 - 5
pages2/components/course/courseSection.vue → components/course/courseSection.vue

@@ -5,7 +5,9 @@
 			<view class="tag tagColor2" v-if="menuItem.sectionType==2">直播</view>
 			<view class="tag tagColor3" v-if="menuItem.sectionType==3">回放</view>
 			<view class="t_content">
-				<view>{{menuItem.name}}</view>
+			<view v-if="menuItem.sectionType==1" :class="playSectionId==newId?'color1':''">{{menuItem.name}}</view>
+			<view v-if="menuItem.sectionType==2" :class="playSectionId==newId?'color2':''">{{menuItem.name}}</view>
+			<view v-if="menuItem.sectionType==3" :class="playSectionId==newId?'color3':''">{{menuItem.name}}</view>
 				<view style="font-size: 20rpx;color: #FF3B30;" v-if="menuItem.liveStartTime">
 					<view v-if="menuItem.liveStartTime>nowTime">
 						<text>{{$method.timestampToTime(menuItem.liveStartTime)}}</text>-
@@ -20,13 +22,14 @@
 				</view>
 			</view>
 		</view>
-		<view v-if="menuItem.tryListen" class="tryBox">
+		<view v-if="menuItem.tryListen&&!isBuy" class="tryBox">
 			试看
 		</view>
 	</view>
 </template>
 
 <script>
+import { mapGetters } from 'vuex';
 import eventHub from '@/common/eventHub.js'
 export default {
 	name: 'courseSection',
@@ -34,11 +37,16 @@ export default {
 		menuItem: {
 			type: Object,
 			default: {}
+		},
+		isBuy: {
+			type: Boolean,
+			default: false
 		}
 	},
 	data() {
 		return {
-			nowTime:0
+			nowTime:0,
+			newId:0
 		};
 	},
 	onLoad() {},
@@ -47,12 +55,36 @@ export default {
 	},
 	mounted() {
 		this.nowTime = Number(new  Date().getTime()/1000).toFixed(0)
+		this.newId= this.menuItem.sectionId>0?this.menuItem.sectionId:this.menuItem.menuId
 	},
 	methods: {
 		getVideo(){
-			eventHub.$emit('getSection', this.menuItem.recordingUrl)
+			if(!this.isBuy){
+				//非购买
+				if(!this.menuItem.tryListen){
+					//不允许试听
+					return
+				}
+				
+			}
+			if(!this.menuItem.recordingUrl){
+				uni.showToast({
+				    title: '暂无播放数据',
+				    icon: 'error'
+				});
+			}
+			if(this.playSectionId==this.newId){
+				//切换为同一节
+				return
+			}
+			//设置播放的节ID
+			this.$store.commit('setPlaySectionId', {playSectionId  :this.newId});
+	//		return
+			eventHub.$emit('getSection', this.menuItem)
+			
 		}
-	}
+	},
+	computed: { ...mapGetters(['playSectionId']) }
 	
 };
 </script>
@@ -100,6 +132,15 @@ export default {
 		border: 2rpx solid #007AFF;
 		color: #007AFF;
 	}
+	.color3{
+		color: #FF9500;
+	}
+	.color2{
+		color: #FF3B30;
+	}
+	.color1{
+		color: #007AFF;
+	}
 	.tag{
 		border-radius: 8rpx;
 		font-size: 20rpx;

+ 3 - 1
iconfont/iconfont.css

@@ -15,7 +15,9 @@
   -webkit-font-smoothing: antialiased;
   -moz-osx-font-smoothing: grayscale;
 }
-
+.image-wrap {
+	max-width: 100%;
+}
 .iconrenzheng:before {
   content: "\e60b";
 }

+ 37 - 1
pages.json

@@ -170,6 +170,11 @@
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
+					},
+					"mp-weixin": {
+						"usingComponents": {
+							"polyv-player": "plugin://polyv-player/player"
+						}
 					}
 				}
 			},
@@ -433,6 +438,37 @@
 					}
 				}
 			},
+			{
+				"path": "subject/collectBank",
+				"style": {
+					"navigationBarTitleText": "试卷",
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
+				}
+			},
+			
+			{
+				"path": "subject/collectTypeBank",
+				"style": {
+					"navigationBarTitleText": "试卷",
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
+				}
+			},
+			{
+				"path": "subject/collectQuestionTypeBank",
+				"style": {
+					"navigationBarTitleText": "试卷",
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
+				}
+			},
 			{
 				"path": "subject/report",
 				"style": {
@@ -506,7 +542,7 @@
 		],
 		 "plugins": {
 			"polyv-player": {
-				"version": "0.1.5",
+				"version": "0.3.0",
 				"provider": "wx4a350a258a6f7876"
 			}
 		}

+ 1 - 1
pages2/bank/detail.vue

@@ -345,7 +345,7 @@ export default {
 					height:80rpx;
 					display: flex;
 					align-items: center;
-					margin-left:72rpx;
+
 					font-size: 24rpx;
 					color: #666666;
 					border-bottom: 1rpx solid #EEEEEE;

+ 32 - 20
pages2/bank/my_question.vue

@@ -1,31 +1,32 @@
 <template>
 	<view style="padding: 30rpx;">
 		<view v-for="(item, index) in list" :key="index"  style="margin-bottom: 30rpx;">
-			<navigator url="/pages2/bank/detail">
+			<navigator :url="'/pages2/bank/question_detail?id='+item.goodsId">
+			<!-- <navigator url="/pages2/bank/detail"> -->
 				<view class="class_item">
-					<image src="/static/login_bg.jpg" style="height: 316rpx;width: 100%;border-radius: 24rpx;"></image>
+					<image class="img" :src="$method.splitImgHost(item.coverUrl, true)"></image>
 					<view style="color: #333333;font-weight: bold;font-size: 32rpx;">
-						2020年二建建筑工程管理与实务(实务专题
-						班)
+						{{item.goodsName}}
 					</view>
 					<view class=".content_box">
 						<image src="/static/icon/wk_icon2.png" class="wk_icon"></image>
-						学习有效期:<text class="content"> 2020.11.20 - 2021.12.19 </text>
+						学习有效期:<text class="content"> {{$method.timestampToTime(item.studyStartTime)}} - {{$method.timestampToTime(item.studyEndTime)}} </text>
 					</view>
 				</view>
-			</navigator>
-			<view class="bottomBox">
-				<view class="box_progress">
-					<view style="width: 60%;">
-						<u-line-progress active-color="#007AFF" :percent="70"></u-line-progress>
-					</view>
-					<view>
-						<navigator url="/pages2/bank/question_detail">
-							<view class="btn">进入刷题</view>
-						</navigator>
+			<!-- </navigator> -->
+				<view class="bottomBox">
+					<view class="box_progress">
+						<view style="width: 60%;">
+							<u-line-progress active-color="#007AFF" :percent="70"></u-line-progress>
+						</view>
+						<view>
+							<!-- <navigator :url="'/pages2/bank/question_detail?id='+item.goodsId"> -->
+								<view class="btn">进入刷题</view>
+							<!-- </navigator> -->
+						</view>
 					</view>
 				</view>
-			</view>
+			</navigator>
 			
 		</view>
 	</view>
@@ -35,19 +36,24 @@
 	export default {
 		data() {
 			return {
-				list:[
-					1,2,3
-				]
+				list:[]
 				
 			}
 		},
 		onLoad(option) {
-			// this.getDict()
+			this.listGoodsUserQuestion();
 		},
 		onShow(){
 			
 		},
 		methods: {
+			listGoodsUserQuestion() {
+				this.$api.listGoodsUserQuestion({
+					
+				}).then(res => {
+					this.list = res.data.rows;
+				})
+			},
 			studyIn(){
 				this.$navTo.togo('/pages2/verify/input');
 			},
@@ -115,5 +121,11 @@
 		padding: 20rpx;
 		z-index: 999;
 		position: relative;
+		
+		.img {
+			width:100%;
+			border-radius: 24rpx;
+			height: 316rpx;
+		}
 	}
 </style>

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1018 - 265
pages2/bank/questionBank.vue


+ 21 - 33
pages2/bank/questionBankTest.vue

@@ -27,13 +27,13 @@
 							<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 class="flex_auto">{{ item.content }}</view>
 								</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 class="flex_auto">{{ item.content }}</view>
 								</view>
 							</view> 
 							<view v-if="ques[bankIndex]">
@@ -54,7 +54,7 @@
 							<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="flex_auto">{{ item.content }}</view>
 								</view>
 							</view>
 							<view v-if="!ques[bankIndex]" class="submit_checkbox" @click="checkboxSubmit" :data-bindex="bankIndex">
@@ -63,7 +63,7 @@
 							<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 class="flex_auto">{{ item.content }}</view>
 								</view>
 							</view> 
 							<view v-if="ques[bankIndex]">
@@ -520,14 +520,14 @@ export default {
 		},
 		changeIndex(e) {
 			let index = e.currentTarget.dataset.index
-			if(index >= 5) {
-				uni.showToast({
-				    title: '返回详情购买后即可继续',
-				    duration: 2000,
-					icon:'none'
-				});
-				return;
-			}
+			// if(index >= 5) {
+			// 	uni.showToast({
+			// 	    title: '返回详情购买后即可继续',
+			// 	    duration: 2000,
+			// 		icon:'none'
+			// 	});
+			// 	return;
+			// }
 			
 			this.current = e.currentTarget.dataset.index
 		},
@@ -546,12 +546,11 @@ export default {
 		},
 		
 		collect() {
-			// uni.showToast({
-			//     title: '返回详情购买后即可收藏~',
-			//     duration: 2000,
-			// 	icon:'none'
-			// });
-			this.collectQuestion()
+			uni.showToast({
+			    title: '返回详情购买后即可收藏~',
+			    duration: 2000,
+				icon:'none'
+			});
 			return;
 		},
 		
@@ -738,21 +737,6 @@ export default {
 			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'
-					});
-				}
-			})
 		}
 	}
 };
@@ -766,6 +750,10 @@ export default {
 .lisSty {
 	margin-bottom: 16rpx;
 	display: flex;
+	
+	.flex_auto {
+		flex:1;
+	}
 }
 .activeTI {
 	vertical-align: middle;

+ 189 - 60
pages2/bank/question_detail.vue

@@ -47,19 +47,64 @@
 		</view>
 		<view class="title-list">
 			<view class="content">
-				<view class="list" v-for="(item1,index) in outline">
-					<view class="section" :data-index="index" @click="changeItem" :class="{up:!item1.showList}">
-						2Z106010 施工承发包的模式-2Z106020 施工合同...
-					</view>
-					<view class="article" v-if="item1.showList" :class="{active:index1 == 0}" v-for="(article,index1) in item1.list">
-						施工承发包模式-施工合同与物资采购合同二
-						<navigator url="/pages2/bank/questionBank">
-							<view v-if="index1 == 0" class="btn">做题</view>
-							<view v-if="index1 == 1" class="btn">继续</view>
-							<view v-if="index1 == 2" class="btn">重做</view>
-						</navigator>
+				<view class="list" v-for="(item1,index1) in bankList" :key="index1">
+					<template v-if="item1.type==1">
+						<view class="moduleItem" @click="clickModule(item1.majorId,index1)">
+							<view class="courseName">{{item1.name}}</view>
+							<view>
+								<image src="/static/icon/up.png" class="icon_up" v-if="!item1.showList"></image>
+								<image src="/static/icon/down.png" class="icon_up" v-if="item1.showList"></image>
+							</view>
+						</view>
 						
-					</view>
+						<template v-if="item1.showList">
+							<view v-for="(item2,index2) in item1.list" :key="index2" >
+								<view class="section" @click="changeItem(index1,item2.chapterExamId,item1.type)">
+									<image src="/static/icon/up1.png" class="icon_up" v-if="!item2.showList"></image>
+									<image src="/static/icon/down1.png" class="icon_up" v-if="item2.showList"></image>
+									{{item2.name}}
+								</view>
+								<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/questionBank?id='+article.examId+'&goodsid='+goodsData.goodsId">
+											<view class="btn">做题</view>
+										</navigator>
+									</view>
+								</view>
+								<u-line></u-line>
+							</view>
+						</template>
+						
+						
+					</template>
+					
+					<template v-if="item1.type ==2">
+						<view class="section" @click="changeItem(index1,item1.majorId,item1.type)">
+							<image src="/static/icon/up1.png" class="icon_up" v-if="!item1.showList"></image>
+							<image src="/static/icon/down1.png" class="icon_up" v-if="item1.showList"></image>
+							{{item1.name}}
+						</view>
+						<view v-if="item1.showList" >
+							<view class="article" :class="{active:index2 == 0}"  :key="index3" v-for="(article,index2) in item1.list">
+								<view class="flex_auto">{{item1.name}}</view>
+								<navigator :url="'/pages2/bank/questionBank?id='+article.majorId+'&goodsid='+goodsData.goodsId">
+									<view class="btn">做题</view>
+								</navigator>
+								
+							</view>
+						</view>
+					</template>
+					
+					<template v-if="item1.type ==3">
+						<view class="article active" >
+							<view class="flex_auto">{{item1.name}}</view>
+							<navigator :url="'/pages2/bank/questionBank?id='+item1.majorId+'&goodsid='+goodsData.goodsId">
+								<view class="btn">做题</view>
+							</navigator>
+							
+						</view>
+					</template>
 				</view>
 			</view>
 		</view>
@@ -71,19 +116,9 @@ import { mapGetters } from 'vuex';
 export default {
 	data() {
 		return {
-			outline:[{
-				list:[1,2,3],
-				showList:false,
-			},{
-				list:[1,2,3],
-				showList:false,
-			},{
-				list:[1,2,3],
-				showList:false,
-			},{
-				list:[1,2,3],
-				showList:false,
-			}]
+			goodsData:{},
+			bankList:[],
+			id:'',
 		};
 	},
 	onUnload() {
@@ -91,20 +126,82 @@ export default {
 	},
 	computed: { ...mapGetters(['userInfo']) },
 	onLoad(option) {
-
+		this.id = option.id
+		this.getDetail();
+		this.goodsBankList()
 	},
 	onShow() {
 		
 	},
 	methods: {
+		getDetail(){
+			this.$api.goodsDetail(this.id).then(res => {
+				console.log(res)
+				this.goodsData = res.data.data;
+				 
+			})
+		},
 		
-		changeItem(e) {
-			let index = e.currentTarget.dataset.index
-			this.outline.forEach((arrItem,i) => {
-				if(i == index) {
-					arrItem.showList = !arrItem.showList
-				}
+		goodsBankList() {
+			this.$api.goodsBankList({
+				goodsId:this.id
+			}).then(res => {
+				console.log(res)
+				this.bankList = res.data.data;
+			})
+		},
+		clickModule(id,index) {
+			
+			
+			if(this.bankList[index].list) {
+				this.$set(this.bankList[index],'showList',!this.bankList[index].showList)
+				return;
+			}
+			
+			this.$api.goodsChapterList({
+				moduleExamId:id
+			}).then(res => {
+				this.$set(this.bankList[index],'showList',true)
+				this.$set(this.bankList[index],'list',res.data.data)
+				 
 			})
+		},
+		changeItem(index1,id,type) {
+			
+			if(type == 1) {
+				if(this.bankList[index1].list[index2].list) {
+					this.$set(this.bankList[index1].list[index2],'showList',!this.bankList[index1].list[index2].showList)
+					return;
+				}
+				
+				this.$api.goodsExamList({
+					chapterExamId:id
+				}).then(res => {
+					
+					this.$set(this.bankList[index1].list[index2],'showList',true)
+					this.$set(this.bankList[index1].list[index2],'list',res.data.data)
+					
+					 
+				})
+				
+			} else if(type == 2) {
+				if(this.bankList[index1].list) {
+					this.$set(this.bankList[index1],'showList',!this.bankList[index1].showList)
+					return;
+				}
+				
+				this.$api.goodsExamList({
+					chapterExamId:id
+				}).then(res => {
+					
+					this.$set(this.bankList[index1],'showList',true)
+					this.$set(this.bankList[index1],'list',res.data.data)
+					
+					 
+				})
+			}
+			
+			
 			
 		}
 	}
@@ -215,6 +312,30 @@ export default {
 		}
 	}
 	
+	
+	.courseName{
+		white-space:nowrap;
+		overflow:hidden;
+		text-overflow:ellipsis; 
+	}
+	
+	
+	.moduleItem{
+		height: 80rpx;
+		color: #333333;
+		font-size: 32rpx;
+		line-height: 80rpx;
+		font-weight: bold;
+		display: flex;
+		justify-content: space-between;
+	
+	}
+	
+	.icon_up{
+		width: 32rpx;
+		height: 32rpx;
+	}
+	
 	.title-list {
 		background: #EAEEF1;
 		padding:16rpx 16rpx 124rpx;
@@ -227,46 +348,40 @@ export default {
 				border-radius: 16rpx;
 				padding:10rpx 16rpx;
 				
-				.section {
-					padding:30rpx 0;
-					border-bottom: 1rpx solid #EEEEEE;
-					font-size: 24rpx;
-					color: #666666;
-					
-					&::before {
-						content:'^';
-						display: inline-block;
-						margin-right:20rpx;
-					}
+				.module {
+					font-size: 30rpx;
+					color: #333333;
 					
-					&.up {
-						border:0;
-						&::before {
-							transform: rotate(180deg);
-						}
+					.icon {
+						margin-right:10rpx;
 					}
 				}
 				
+				.section {
+					font-size: 30rpx;
+					font-family: PingFang SC;
+					font-weight: bold;
+					color: #333333;
+					white-space:nowrap;
+					overflow:hidden;
+					text-overflow:ellipsis; 
+					margin: 20rpx 0;
+					display: flex;
+					align-items: center;
+				}
+				
 				.article {
 					height:80rpx;
 					display: flex;
 					align-items: center;
-					margin-left:88rpx;
+					margin-left:72rpx;
 					font-size: 24rpx;
 					color: #666666;
 					border-bottom: 1rpx solid #EEEEEE;
+					display: flex;
 					
-					.btn {
-						width: 96rpx;
-						height: 48rpx;
-						line-height: 48rpx;
-						text-align: center;
-						color:#fff;
-						font-size: 30rpx;
-						border-radius:24rpx;
-						background: #007AFF;
-						margin-left:36rpx;
-						border-radius: 24rpx;
+					.flex_auto{
+						flex:1;
 					}
 					
 					&:nth-last-of-type(1) {
@@ -275,6 +390,20 @@ export default {
 					
 					&.active {
 						color:#007AFF;
+						
+						
+						.btn {
+							width: 96rpx;
+							height: 48rpx;
+							line-height: 48rpx;
+							text-align: center;
+							color:#fff;
+							font-size: 30rpx;
+							border-radius:24rpx;
+							background: #007AFF;
+							margin-left:36rpx;
+							border-radius: 24rpx;
+						}
 					}
 				}
 			}

+ 50 - 194
pages2/bank/question_record.vue

@@ -6,17 +6,17 @@
 		</view>
 		
 		<view class="record">
-			<view class="item">
-				<view class="note">真题</view>
-				<view class="title">试卷名称可换行我也不知道最多多少个字试卷名称可换行我也不知道最多多少个字</view>
+			<view class="item" v-for="record in recordList">
+				<view class="note">{{record.paperName}}</view>
+				<view class="title">{{record.examName}}</view>
 				<view class="desc">
 					<view>
 						<image src="/static/icon/wk_icon2.png"></image>
-						<text>2021/12/20  14:30</text>
+						<text>{{$method.timestampToTime(record.updateTime,false)}}</text>
 					</view>
 					<view>
 						<image src="/static/icon/wk_icon2.png"></image>
-						<text>总共 95 题 做对 0 题</text>
+						<text>总共 {{record.totalQuestionNum}} 题 做对  {{record.rightQuestionNum}} 题</text>
 					</view>
 				</view>
 				<view class="btns">
@@ -26,186 +26,7 @@
 					<view class="btn">
 						解析
 					</view>
-					<view class="btn">
-						报告
-					</view>
-				</view>
-			</view>
-			
-			<view class="item">
-				<view class="note">真题</view>
-				<view class="title">试卷道最多多少个字</view>
-				<view class="desc">
-					<view>
-						<image src="/static/icon/wk_icon2.png"></image>
-						<text>2021/12/20  14:30</text>
-					</view>
-					<view>
-						<image src="/static/icon/wk_icon2.png"></image>
-						<text>总共 95 题 做对 0 题</text>
-					</view>
-				</view>
-				<view class="btns">
-					<view class="btn">
-						重做
-					</view>
-					<view class="btn">
-						解析
-					</view>
-					<view class="btn">
-						报告
-					</view>
-				</view>
-			</view>
-			<view class="item">
-				<view class="note">真题</view>
-				<view class="title">试卷名称可换行我也不知道最多多少个字试卷名称可换行我也不知道最多多少个字</view>
-				<view class="desc">
-					<view>
-						<image src="/static/icon/wk_icon2.png"></image>
-						<text>2021/12/20  14:30</text>
-					</view>
-					<view>
-						<image src="/static/icon/wk_icon2.png"></image>
-						<text>总共 95 题 做对 0 题</text>
-					</view>
-				</view>
-				<view class="btns">
-					<view class="btn">
-						重做
-					</view>
-					<view class="btn">
-						解析
-					</view>
-					<view class="btn">
-						报告
-					</view>
-				</view>
-			</view>
-			
-			<view class="item">
-				<view class="note">真题</view>
-				<view class="title">试卷道最多多字</view>
-				<view class="desc">
-					<view>
-						<image src="/static/icon/wk_icon2.png"></image>
-						<text>2021/12/20  14:30</text>
-					</view>
-					<view>
-						<image src="/static/icon/wk_icon2.png"></image>
-						<text>总共 95 题 做对 0 题</text>
-					</view>
-				</view>
-				<view class="btns">
-					<view class="btn">
-						重做
-					</view>
-					<view class="btn">
-						解析
-					</view>
-					<view class="btn">
-						报告
-					</view>
-				</view>
-			</view>
-			<view class="item">
-				<view class="note">真题</view>
-				<view class="title">试卷名称可换行我也不知道最多多少个字试卷名称可换行我也不知道最多多少个字试卷名称可换行我也不知道最多多少个字</view>
-				<view class="desc">
-					<view>
-						<image src="/static/icon/wk_icon2.png"></image>
-						<text>2021/12/20  14:30</text>
-					</view>
-					<view>
-						<image src="/static/icon/wk_icon2.png"></image>
-						<text>总共 95 题 做对 0 题</text>
-					</view>
-				</view>
-				<view class="btns">
-					<view class="btn">
-						重做
-					</view>
-					<view class="btn">
-						解析
-					</view>
-					<view class="btn">
-						报告
-					</view>
-				</view>
-			</view>
-			
-			<view class="item">
-				<view class="note">真题</view>
-				<view class="title">试卷道最多多少个字</view>
-				<view class="desc">
-					<view>
-						<image src="/static/icon/wk_icon2.png"></image>
-						<text>2021/12/20  14:30</text>
-					</view>
-					<view>
-						<image src="/static/icon/wk_icon2.png"></image>
-						<text>总共 95 题 做对 0 题</text>
-					</view>
-				</view>
-				<view class="btns">
-					<view class="btn">
-						重做
-					</view>
-					<view class="btn">
-						解析
-					</view>
-					<view class="btn">
-						报告
-					</view>
-				</view>
-			</view>
-			<view class="item">
-				<view class="note">真题</view>
-				<view class="title">试卷名称可换行我也不知道最多多少个字</view>
-				<view class="desc">
-					<view>
-						<image src="/static/icon/wk_icon2.png"></image>
-						<text>2021/12/20  14:30</text>
-					</view>
-					<view>
-						<image src="/static/icon/wk_icon2.png"></image>
-						<text>总共 95 题 做对 0 题</text>
-					</view>
-				</view>
-				<view class="btns">
-					<view class="btn">
-						重做
-					</view>
-					<view class="btn">
-						解析
-					</view>
-					<view class="btn">
-						报告
-					</view>
-				</view>
-			</view>
-			
-			<view class="item">
-				<view class="note">真题</view>
-				<view class="title">试卷道最多多少个字</view>
-				<view class="desc">
-					<view>
-						<image src="/static/icon/wk_icon2.png"></image>
-						<text>2021/12/20  14:30</text>
-					</view>
-					<view>
-						<image src="/static/icon/wk_icon2.png"></image>
-						<text>总共 95 题 做对 0 题</text>
-					</view>
-				</view>
-				<view class="btns">
-					<view class="btn">
-						重做
-					</view>
-					<view class="btn">
-						解析
-					</view>
-					<view class="btn">
+					<view class="btn" v-if="record.status == 1">
 						报告
 					</view>
 				</view>
@@ -217,10 +38,7 @@
 			<view class="content">
 				<view class="top">全部题库记录</view>
 				<view class="list">
-					<view class="item">试卷名称可换行并完整显示</view>
-					<view class="item">试卷名称可换行并完整显示</view>
-					<view class="item">试卷名称可换行并完整显示</view>
-					<view class="item">试卷名称单行卡片变小</view>
+					<view class="item" v-for="listItem in list" @click="testClick(listItem)">{{listItem.goodsName}}</view>
 				</view>
 			</view>
 			<view class="modal_wrap" @click="index=0"></view>
@@ -230,9 +48,7 @@
 			<view class="content">
 				<view class="top">全部试卷类型</view>
 				<view class="list">
-					<view class="item">模拟卷</view>
-					<view class="item">真题</view>
-					<view class="item">练习</view>
+					<view class="item" v-for="listItem in list1" @click="paperClick(listItem)">{{listItem.paperName}}</view>
 				</view>
 			</view>
 			<view class="modal_wrap" @click="index=0"></view>
@@ -245,18 +61,58 @@
 		data() {
 			return {
 				index:0,
+				list:[],
+				list1:[],
+				recordList:[]
 			}
 		},
 		onLoad(option) {
-			// this.getDict()
+			this.listGoodsUserQuestion();
+			this.examaperList();
+			
+			this.$api.examRecordList({}).then(res => {
+				this.recordList = res.data.rows
+			})
 		},
 		onShow(){
 			
 		},
 		methods: {
+			testClick(item) {
+				this.index = 0
+				this.$api.examRecordList({
+					goodsId:item.goodsId
+				}).then(res => {
+					this.recordList = res.data.rows
+				})
+			},
+			paperClick(item) {
+				this.index = 0
+				this.$api.examRecordList({
+					paperId:item.paperId
+				}).then(res => {
+					this.recordList = res.data.rows
+				})
+			},
 			tab(e) {
 				this.index = e.currentTarget.dataset.index;
-			}
+			},
+			
+			examaperList() {
+				this.$api.examaperList({
+					
+				}).then(res => {
+					this.list1 = res.data.rows;
+				})
+			},
+			
+			listGoodsUserQuestion() {
+				this.$api.listGoodsUserQuestion({
+					
+				}).then(res => {
+					this.list = res.data.rows;
+				})
+			},
 		},
 		
 	}

+ 124 - 12
pages2/class/detail.vue

@@ -1,9 +1,9 @@
 <template>
 	<view>
-		<view style="position: fixed;width: 100%;z-index: 999;background: #FFFFFF;" id="top">
+		<view style="position: fixed;width: 100%;z-index: 999;background: #FFFFFF;top: 0;" id="top">
 			<view class="video_box" v-if="!startStatus">
-				<image src="https://cdn.uviewui.com/uview/swiper/3.jpg" style="width: 100%;height: 460rpx;"></image>
-				<image class="video_play" src="/static/play.png" @click="startVideo"></image>
+				<image :src="$method.splitImgHost(detail.coverUrl)" style="width: 100%;height: 460rpx;"></image>
+				<image v-if="false" class="video_play" src="/static/play.png" @click="startVideo"></image>
 			</view>
 			<view v-else class="video_box" style="width: 100%;height: 460rpx;">
 				<polyv-player
@@ -21,7 +21,7 @@
 						<view class="video_t1">{{ detail.courseName }}</view>
 					</u-col>
 					<u-col span="2">
-						<view class="video_t1_t">
+						<view class="video_t1_t" @click="openPhoto">
 							<image src="/static/icon/jy_icon.png" style="width: 40rpx;height: 40rpx;"></image>
 							讲义
 						</view>
@@ -41,11 +41,11 @@
 			<view v-show="current == 0">
 				<view class="menuBox" v-for="(item, index) in menuList">
 					<!--模块 -->
-					<view v-if="item.type == 1"><courseModule :menuItem="item"></courseModule></view>
+					<view v-if="item.type == 1"><courseModule :isBuy="true" :menuItem="item"></courseModule></view>
 					<!--章 -->
-					<view v-if="item.type == 2"><courseChapter :menuItem="item"></courseChapter></view>
+					<view v-if="item.type == 2"><courseChapter :isBuy="true" :menuItem="item"></courseChapter></view>
 					<!--节 -->
-					<view v-if="item.type == 3"><courseSection :menuItem="item"></courseSection></view>
+					<view v-if="item.type == 3"><courseSection :isBuy="true" :menuItem="item"></courseSection></view>
 				</view>
 			</view>
 			<!--笔记 -->
@@ -97,14 +97,40 @@
 				</view>
 			</view>
 		</view>
+		<!-- 播放前拍照start -->
+		<u-popup v-model="photoPopup" mode="bottom" border-radius="32">
+					<view class="photoBox">
+						<view class="photoTop">
+							<view class="sqzz">
+								<u-icon name="close" color="#333333" size="30" @click="closePhoto"></u-icon>
+							</view>
+							<view class="centersq">
+								请正视手机屏幕
+							</view>
+							<view class="sqzz">
+								
+							</view>
+						</view>
+						<view class="photoCenter">
+							<camera device-position="front" flash="off" @error="error" style="width: 100%; height: 100%" v-if="photoPopup"></camera>
+							<view class="custom">
+								<image src="@/static/zhezhao@2x.png" mode=""></image>
+							</view>
+						</view>
+						<view class="btnResult" @click="takePhoto">
+							拍照
+						</view>
+					</view>
+		</u-popup>
+		<!-- 播放前拍照end -->
 	</view>
 </template>
 
 <script>
 import eventHub from '@/common/eventHub.js';
-import courseModule from '@/pages2/components/course/courseModule.vue';
-import courseChapter from '@/pages2/components/course/courseChapter.vue';
-import courseSection from '@/pages2/components/course/courseSection.vue';
+import courseModule from '@/components/course/courseModule.vue';
+import courseChapter from '@/components/course/courseChapter.vue';
+import courseSection from '@/components/course/courseSection.vue';
 import { mapGetters } from 'vuex';
 export default {
 	components: {
@@ -166,23 +192,62 @@ export default {
 			],
 			current: 0,
 			vid:'',
+			goodsId:0,
+			goodsData:{},
+			photoPopup:false,
 		};
 	},
 	onUnload() {},
 	computed: { ...mapGetters(['userInfo']) },
 	onLoad(option) {
 		this.courseId = option.id;
+		this.goodsId = uni.getStorageSync('courseGoodsId');
 		this.courseDetail();
 		this.getMenuList();
+		this.getGoodsDetail()
 	},
 	onShow() {},
 	mounted() {
 		eventHub.$on('getSection', item => {
-			this.vid = item
+			this.vid = item.recordingUrl
 			this.startStatus = true
 		});
 	},
 	methods: {
+		//拍照
+		openPhoto(){
+			this.photoPopup = true
+		},
+		//确认拍照
+		takePhoto() {
+			var self = this
+			const ctx = uni.createCameraContext();
+			ctx.takePhoto({
+				quality: 'high',
+				success: res => {
+					console.log(res.tempImagePath)
+					self.photoPopup = false
+				},
+				fail: err => {
+					console.log(err)
+				}
+			});
+		},
+		//拍照报错
+		error(e) {
+			console.log(e.detail);
+		},
+		//关闭相机
+		closePhoto(){
+			this.photoPopup = false
+		},
+		getGoodsDetail(){
+			let self = this
+			this.$api.goodsDetail(this.goodsId).then(res => {
+				self.goodsData = res.data.data;
+				 
+			})
+		},
 		startVideo() {
 			this.startStatus = true;
 		},
@@ -218,7 +283,54 @@ export default {
 };
 </script>
 
-<style scope>
+<style  lang="scss" scope>
+	.photoBox{
+		.photoTop{
+			height: 74upx;
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+			padding: 0upx 38upx;
+			.sqzz{
+				width: 28upx;
+				height: 28upx;
+				display: flex;
+				align-items: center;
+				justify-content: center;
+			}
+			.centersq{
+				color: #333;
+				font-size: 30upx;
+				font-weight: 500;
+			}
+		}
+		.photoCenter{
+			width: 750upx;
+			height: 979upx;
+			position: relative;
+			.custom{
+				width: 750upx;
+				height: 979upx;
+				position: absolute;
+				top: 0;
+				left: 0;
+				image{
+					width: 100%;
+					height: 100%;
+				}
+			}
+		}
+		.btnResult{
+			height: 100upx;
+			width: 100%;
+			background-color: #07c160;
+			text-align: center;
+			line-height: 100upx;
+			color: #fff;
+			font-size: 32upx;
+			font-weight: bold;
+		}
+	}
 .chat_box {
 	display: flex;
 	padding: 20rpx;

+ 131 - 13
pages2/course/detail.vue

@@ -2,7 +2,23 @@
 	<view>
 		<view class="videoBox" >
 			<view >
-				<image :src="$method.splitImgHost(detail.coverUrl)" style="height: 460rpx;width: 100%;"></image>
+				<view class="video_box" v-if="!startStatus">
+					<image :src="$method.splitImgHost(detail.coverUrl)" style="width: 100%;height: 460rpx;"></image>
+					<image v-if="false" class="video_play" src="/static/play.png" @click="startVideo"></image>
+				</view>
+				<view v-else class="video_box" style="width: 100%;height: 460rpx;">
+					<polyv-player
+						id="playerVideo"
+						playerId="playerVideo"
+						height="460rpx"
+						:vid="vid"
+						:showSettingBtn="true"
+						:enablePlayGesture="true"
+						:playbackRate="playbackRate"
+						:isAllowSeek="isAllowSeek"
+						:autoplay="autoplay"
+					></polyv-player>
+				</view>
 				<view style="padding:20rpx;height: 120rpx;">
 					<view style="display: flex;">
 						<view class="yearTag">{{detail.year}}</view>
@@ -23,7 +39,7 @@
 		</view>
 		<view style="padding: 20rpx;position: relative;top: 680rpx;" v-show="current==0">
 			<view class="content">
-				<view v-html="detail.mobileDetailHtml"></view>
+				<view v-html="detail.mobileDetailHtml" style="width: 100%;"></view>
 			</view>
 		</view>
 		<view style="padding: 20rpx;padding-bottom: 100rpx;position: relative;top: 680rpx;" v-show="current==1">
@@ -40,8 +56,8 @@
 						<view v-show="!item.down">
 							<view v-for="(itemM,indexM) in menuList" >
 								<courseModule v-if="itemM.type==1" :menuItem="itemM"></courseModule>
-								<courseChapter v-if="itemM.type==2" :menuItem="itemM"></courseChapter>
-								<courseSection v-if="itemM.type==3" :menuItem="itemM"></courseSection>
+								<courseChapter v-if="itemM.type==2" :isBuy="false" :menuItem="itemM"></courseChapter>
+								<courseSection v-if="itemM.type==3" :isBuy="false" :menuItem="itemM"></courseSection>
 								<u-line></u-line>
 							</view>
 						</view>
@@ -61,9 +77,10 @@
 </template>
 
 <script>
-import courseModule from '@/pages2/components/course/courseModule.vue';
-import courseChapter from '@/pages2/components/course/courseChapter.vue';
-import courseSection from '@/pages2/components/course/courseSection.vue';
+import eventHub from '@/common/eventHub.js';
+import courseModule from '@/components/course/courseModule.vue';
+import courseChapter from '@/components/course/courseChapter.vue';
+import courseSection from '@/components/course/courseSection.vue';
 import { mapGetters } from 'vuex';
 export default {
 	components: {
@@ -85,22 +102,81 @@ export default {
 			current:0,
 			detail:{},
 			courseList:[],
-			menuList:[]
+			menuList:[],
+			startStatus:false,
+			playbackRate: [1.0],
+			isAllowSeek:'no',
+			vid:'',
+			autoplay:true,
+			listenConfigList:[],
+			listenSecond:0,
+			timer:null
 		};
 	},
 	onUnload() {
 		
 	},
-	computed: { ...mapGetters(['userInfo','goodsAuditionConfigIdList']) },
+	computed: { ...mapGetters(['userInfo','goodsAuditionConfigIdList','playSectionId']) },
 	onLoad(option) {
 		this.id = option.id;
 		this.getDetail()
 		this.goodsCourseList()
 	},
-	onShow() {
-		
+	mounted() {
+		eventHub.$on('getSection', item => {
+			console.log('播放')
+			//播放试听
+			this.listenSecond = 0
+			for (var itemChild of this.listenConfigList) {
+				if(itemChild.sectionId==this.playSectionId){
+					if(itemChild.auditionMinute>0){
+						this.listenSecond = itemChild.auditionMinute *60 //试听秒数
+					}
+					
+				}
+			}
+			
+			if(this.listenSecond>0){
+				if(this.timer){
+					clearInterval(this.timer);
+				}
+				this.timer = setInterval(this.timeEvent, 2000);//定时器
+				this.vid = item.recordingUrl
+				this.startStatus = true
+			}else{
+				console.log(this.listenSecond,333)
+				this.$u.toast('试听配置错误');
+			}
+			
+		});
 	},
 	methods: {
+		closePlay(){
+			this.vid = ""
+			this.startStatus = false
+		},
+		timeEvent() {
+			let self = this
+		        var polyvPlayerContext = this.selectComponent('#playerVideo');
+				if (polyvPlayerContext != null) {
+					let PlayCurrentTime = polyvPlayerContext.getCurrentTime();
+					if(PlayCurrentTime>=this.listenSecond){
+						polyvPlayerContext.stop();
+						clearInterval(this.timer);
+						this.timer = null
+						uni.showModal({
+							title: '提示',
+							content: '试听结束',
+							showCancel:false,
+							success: function(resst) {
+								self.closePlay()
+							}
+						});
+						
+					}
+					
+				}
+		},
 		openCourse(item){
 			item.down = !item.down
 			if(!item.down&&this.menuList.length==0){
@@ -160,10 +236,14 @@ export default {
 			let sectionIdList = []
 			this.$api.goodsDetail(this.id).then(res => {
 				if(res.data.code==200){
+					if(res.data.data.mobileDetailHtml){
+						res.data.data.mobileDetailHtml = res.data.data.mobileDetailHtml.replace(/<img/gi,'<img style="max-width:100%;"')
+					}
+					
 					self.detail = res.data.data
 					if(self.detail.goodsAuditionConfig){
-						let configList = JSON.parse(self.detail.goodsAuditionConfig)
-						for (var itemChild of configList) {
+						self.listenConfigList = JSON.parse(self.detail.goodsAuditionConfig)
+						for (var itemChild of self.listenConfigList) {
 							sectionIdList.push(itemChild.sectionId)//存储试听节ID
 						}
 						self.$store.commit('setGoodsAuditionConfigIdList', {goodsAuditionConfigIdList:sectionIdList});
@@ -198,6 +278,43 @@ export default {
 	}
 </style>
 <style scope>
+	.video_t2 {
+		font-size: 24rpx;
+		font-family: PingFang SC;
+		font-weight: 500;
+		color: #666666;
+	}
+	.video_t1 {
+		height: 80rpx;
+		color: #333333;
+		line-height: 80rpx;
+		font-size: 30rpx;
+		font-family: PingFang SC;
+		font-weight: bold;
+		color: #333333;
+	}
+	.video_t1_t {
+		display: flex;
+		flex-direction: column;
+		height: 80rpx;
+		color: #333333;
+		text-align: center;
+		align-items: center;
+		border-left: solid 1px #d6d6db;
+	}
+	.video_play {
+		position: absolute;
+		width: 95rpx;
+		height: 95rpx;
+		top: 0;
+		left: 0;
+		right: 0;
+		bottom: 0;
+		margin: auto;
+	}
+	.video_box {
+		position: relative;
+	}
 	.courseName{
 		white-space:nowrap;
 		overflow:hidden;
@@ -235,6 +352,7 @@ export default {
 	}
 	.content{
 		background-color: #FFFFFF;
+		width: 100%;
 	}
 	.btn2{
 		width: 200rpx;

+ 5 - 5
pages2/order/index.vue

@@ -13,18 +13,18 @@
 							<view style="color: #999999;font-size: 24rpx;">{{ $method.timestampToTime(item.createTime) }}</view>
 						</view>
 						<u-line color="#D6D6DB" />
-						<view style="display: flex;justify-content: space-between;padding: 25rpx 0;border-bottom: 1rpx solid #eee;" v-for="(items, indexs) in 2" :key="indexs">
+						<view style="display: flex;justify-content: space-between;padding: 25rpx 0;border-bottom: 1rpx solid #eee;" v-for="(items, indexs) in item.orderGoodsList" :key="indexs">
 							<image src="/static/login_bg.jpg" style="height: 134rpx;width: 278rpx;border-radius: 16rpx;flex-shrink: 0;"></image>
 							<view style="margin-left: 20rpx;flex:1;display: flex;flex-direction: column;">
-								<view style="color: #333333;font-size: 30rpx;font-weight: bold;flex:1">{{ item.goodsName }}</view>
-								<view class="priceTag">¥ {{ item.payPrice }}</view>
+								<view style="color: #333333;font-size: 30rpx;font-weight: bold;flex:1">{{ items.goodsName }}</view>
+								<view class="priceTag">¥ {{ items.goodsPrice }}</view>
 							</view>
 						</view>
 						<view style="height: 80rpx;display: flex;justify-content: space-between;align-items: center;">
 							<view>
-								<text style="color:#999;font-size: 24rpx;margin-right: 8rpx;">共1项</text>
+								<text style="color:#999;font-size: 24rpx;margin-right: 8rpx;">共{{item.orderGoodsList.length}}项</text>
 								<text style="color: #333;font-size: 30rpx;font-weight: bold;">合计</text>
-								<text style="color:#ff2d55;font-size: 30rpx;font-weight: bold;">¥999.00</text>
+								<text style="color:#ff2d55;font-size: 30rpx;font-weight: bold;">¥{{item.payPrice}}</text>
 							</view>
 							<view style="display: flex;align-items: center;">
 								<view class="btn2" v-if="item.orderStatus === 0">继续支付</view>

+ 128 - 33
pages2/subject/collect.vue

@@ -8,32 +8,61 @@
 			<view class="sceenModelBg" @click="hideSceen"></view>
 			<view class="sceenMain">
 				<template v-if="sceenType===1">
-					<view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList1" :key="index" @click="choSceen(index,'tk')">{{item.name}}</view>
+					<view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList1" :key="index" @click="choseRecord(index)">{{item.goodsName}}</view>
 				</template>
 				<template v-if="sceenType===2">
-					<view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList2" :key="index" @click="choSceen(index,'sj')">{{item.name}}</view>
+					<view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList2" :key="index" @click="choseType(index)">{{item.paperName}}</view>
 				</template>
 			</view>
 		</view>
 		<view class="wrap">
+			<view class="wrongTab">
+				<view class="item" :class="{active:type == 1}" @click="selectType(1)">试卷归类</view>
+				<view class="item" :class="{active:type == 2}" @click="selectType(2)">题型归类</view>
+			</view>
 			<view class="wrongHead">
 				<view class="title">收藏统计</view>
 				<view class="progress">
-					
+					<text v-if="type == 1">{{testList.total}}</text>
+					<text v-if="type == 2">{{typeList.total}}</text>
 				</view>
 			</view>
-			<view class="wrongTab">
-				<view class="item active">试卷归类</view>
-				<view class="item">题型归类</view>
+			<view class="wrongList" v-if="type == 1">
+				<view class="item" v-for="(item,index) in testList.rows" :key="index">
+					<view class="title">{{item.examName}}</view>
+					<view class="bt">
+						<view class="left">收藏数<text class="num">{{item.questionNum}}</text></view>
+						<view class="right">
+							<navigator :url="'/pages2/subject/collectBank?id='+item.examId">
+								<view class="btn">重做</view>
+							</navigator>
+							<navigator :url="'/pages2/subject/collectBank?id='+item.examId+'&explain=1'">
+								<view class="btn">解析</view>
+							</navigator>
+							<!-- <view class="btn">解析</view> -->
+						</view>
+					</view>
+				</view>
 			</view>
-			<view class="wrongList">
-				<view class="item" v-for="(item,index) in 5" :key="index">
-					<view class="title">试卷名称可换行我也不知道最多多少个字总之可以换行就对了</view>
+			
+			<view class="wrongList" v-if="type == 2">
+				<view class="item" v-for="(item,index) in typeList.rows" :key="index">
+					<view class="title">
+						<text v-if="item.type==1">单选题</text>
+						<text v-if="item.type==2">多选题</text>
+						<text v-if="item.type==3">判断题</text>
+						<text v-if="item.type==4">案例题</text>
+						<text v-if="item.type==5">简答题</text>
+					</view>
 					<view class="bt">
-						<view class="left">错题数<text class="num">23</text></view>
+						<view class="left">收藏数<text class="num">{{item.num}}</text></view>
 						<view class="right">
-							<view class="btn">重做</view>
-							<view class="btn">解析</view>
+							<navigator :url="'/pages2/subject/collectTypeBank?type='+item.type">
+								<view class="btn">重做</view>
+							</navigator>
+							<navigator :url="'/pages2/subject/collectTypeBank?type='+item.type+'&explain=1'">
+								<view class="btn">解析</view>
+							</navigator>
 						</view>
 					</view>
 				</view>
@@ -50,41 +79,102 @@ export default {
 		return {
 			sceenType: null,
 			scennList1:[
-				{id: 1, name: '全部题库记录', checked: true},{id: 1, name: '试卷名称可换行并完整显示'},{id: 1, name: '试卷名称可换行并完整显示'},{id: 1, name: '试卷名称可换行并完整显示'}
+				{goodsId: '', goodsName: '全部题库记录', checked: true}
 			],
 			scennList2:[
-				{id: 1, name: '全部试卷类型', checked: true},{id: 1, name: '模拟卷'},{id: 1, name: '真题'},{id: 1, name: '练习'}
+				{paperId: '', paperName: '全部试卷类型', checked: true}
 			],
+			type:1,
+			testList:[],
+			typeList:[],
+			goodsid:'',
+			paperid:''
 		};
 	},
 	onPullDownRefresh() {},
-	onLoad(option) {},
+	onLoad(option) {
+		
+		
+		
+		this.listGoodsUserQuestion();
+		this.examaperList();
+		this.getData();
+	},
 	methods: {
+		getData() {
+			if(this.type == 1) {
+				this.goodsCollectExamList()
+			} else if(this.type == 2) {
+				this.collectQuestionTypeList();
+			}
+		},
+		examaperList() {
+			this.$api.examaperList({
+				
+			}).then(res => {
+				this.scennList2 = [...this.scennList2,...res.data.rows];
+			})
+		},
+		
+		listGoodsUserQuestion() {
+			this.$api.listGoodsUserQuestion({
+				
+			}).then(res => {
+				this.scennList1 = [...this.scennList1,...res.data.rows];
+			})
+		},
+		goodsCollectExamList() {
+			this.$api.goodsCollectExamList({
+				paperId:this.paperid,
+				goodsId:this.goodsid
+			}).then(res => {
+				this.testList = res.data 
+			})
+		},
+		collectQuestionTypeList() {
+			this.$api.collectQuestionTypeList({
+				paperId:this.paperid,
+				goodsId:this.goodsid
+			}).then(res => {
+				this.typeList = res.data 
+			})
+		},
 		showSceen(type){
 			this.sceenType = type
 		},
+		/**
+		 * @param {Object} tab切换
+		 */
+		selectType(type) {
+			this.type = type;
+			this.getData();
+		},
 		hideSceen(){
 			this.sceenType = null
 		},
-		choSceen(index,type){
-			if(type==='tk'){
-				this.scennList1.forEach((item,idx)=>{
-					this.$set(item, 'checked',false)
-					if(index===idx){
-						this.$set(item, 'checked',true)
-					}
-				})
-			}
-			if(type==='sj'){
-				this.scennList2.forEach((item,idx)=>{
-					this.$set(item, 'checked',false)
-					if(index===idx){
-						this.$set(item, 'checked',true)
-					}
-				})
-			}
+		choseRecord(index) {
 			this.sceenType = null
-		}
+			this.scennList1.forEach((item,idx)=>{
+				this.$set(item, 'checked',false)
+				if(index==idx){
+					this.goodsid = item.goodsId
+					this.$set(item, 'checked',true)
+				}
+			})
+			
+			this.getData()
+		},
+		choseType(index) {
+			this.sceenType = null
+			this.scennList2.forEach((item,idx)=>{
+				this.$set(item, 'checked',false)
+				if(index==idx){
+					this.paperid = item.paperId
+					this.$set(item, 'checked',true)
+				}
+			})
+			this.getData()
+		},
 	}
 };
 </script>
@@ -184,9 +274,13 @@ page {
 	.progress{
 		width: 180rpx;
 		height: 180rpx;
+		line-height: 140rpx;
 		border: 20rpx solid #EEEEEE;
 		border-radius: 50%;
 		margin: 24rpx auto;
+		font-size: 50rpx;
+		text-align: center;
+		
 	}
 }
 .wrongTab{
@@ -211,6 +305,7 @@ page {
 	}
 }
 .wrongList{
+	margin-top:20rpx;
 	.item{;
 		background: #FFFFFF;
 		border-radius: 16rpx;

+ 1141 - 0
pages2/subject/collectBank.vue

@@ -0,0 +1,1141 @@
+<template>
+	<view id="questionBank">
+		<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="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>
+								</view>
+								<text>{{bankIndex+1}}/{{questionList.length}}</text>
+							</view>
+							<view style="color: #666;font-size: 28rpx;"></view>
+							<view class="leftLetters"></view>
+						</view>
+						<view class="titles">
+							<rich-text :nodes="bank.content"></rich-text>
+						</view>		
+					</view>
+					<view class="pad_8 titBox">
+						<template v-if="bank.type == 1">
+							<view v-if="!bank.ques">
+								<view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty" @click="radioSelect(item.optionsId,bankIndex)">
+									<view class="activeTI">{{ ast[index] }}</view>
+									<view class="flex_auto">{{ item.content }}</view>
+								</view>
+							</view>
+							<view v-if="bank.ques">
+								<view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty">
+									<text :class="{right:(item.optionsId == bank.ques) || (item.optionsId == bank.ans),wrong:(item.optionsId == bank.ques) && (bank.ques != bank.ans)}"  class="activeTI">{{ ast[index] }}</text>
+									<view class="flex_auto">{{ item.content }}</view>
+								</view>
+							</view> 
+							<view v-if="bank.ques">
+								<view class="pad_8 answer">
+									<view>正确答案:{{ast[bank.ans-1]}}</view>
+									<view v-if="!explain">我的答案:{{ast[bank.ques-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>
+						</template>
+						
+						<template v-if="bank.type == 2">
+							<view v-if="!bank.ques">
+								<view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty" @click="checkboxSelect(item.optionsId,bankIndex,index)">
+									<view :class="{checked:item.checked}" class="activeTI">{{ ast[index] }}</view>
+									<view class="flex_auto">{{ item.content }}</view>
+								</view>
+							</view>
+							<view v-if="!bank.ques" class="submit_checkbox" @click="checkboxSubmit(bankIndex)">
+								确认答案
+							</view>
+							<view v-if="bank.ques">
+								<view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty">
+									<text :class="{right:(bank.ques.indexOf(item.optionsId) != -1 ) || (bank.ans.indexOf(item.optionsId) != -1),wrong:(bank.ques.indexOf(item.optionsId) != -1 ) && (bank.ans.indexOf(item.optionsId) == -1)}"  class="activeTI">{{ ast[index] }}</text>
+									<view class="flex_auto">{{ item.content }}</view>
+								</view>
+							</view> 
+							<view v-if="bank.ques">
+								<view class="pad_8 answer">
+									<view>正确答案:
+										<text v-for="ansItem in bank.ans">{{ast[ansItem-1]}}</text>
+									</view>
+									<view v-if="!explain">我的答案:
+										<text v-for="quesItem in bank.ques">{{ast[quesItem-1]}}</text>
+									</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 == 3">
+							<view v-if="!bank.ques">
+								<view v-for="(item, index) in judge" :key="index" class="lisSty" @click="judgeSelect(index,bankIndex)">
+									<view class="activeTI">{{ ast[index] }}</view>
+									{{ item }}
+								</view>
+							</view>
+							<view v-if="bank.ques">
+								<view v-for="(item, index) in judge" :key="index" class="lisSty">
+									<text :class="{right:(index == bank.ques) || (index == bank.ans),wrong:(index == bank.ques) && (bank.ques != bank.ans)}"  class="activeTI">{{ ast[index] }}</text>
+									{{ item }}
+								</view>
+							</view> 
+							<view v-if="bank.ques">
+								<view class="pad_8 answer">
+									<view>正确答案:{{ast[bank.ans]}}</view>
+									<view v-if="!explain">我的答案:{{ast[bank.ques]}}</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="!bank.ques">
+									<view class="top flex">
+										<image :data-index="bankIndex" class="icon" @click="chooseImg(bankIndex)" src="/static/08-10_032.jpg" mode=""></image>
+										<view class="progress">0/4</view>
+										<view class="submit"  @click="submitAns(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(imgIndex,bankIndex)">x</text>
+											<image :src="$method.splitImgHost(img, true)"></image>
+										</view>
+									</view>
+								</view>
+								<view class="ans_submit answerInfos" v-if="bank.ques && !explain">
+									<view class="answerTitle">答案我的</view>
+									{{bank.ques.text}}
+									<view class="imgs">
+										<image class="img" v-for="ques in bank.ques.imageList" :src="ques"></image>
+									</view>
+								</view>
+							</view>
+							<view v-if="bank.ques">
+								<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 == 4">
+							<view class="tabs">
+								<view class="tab" :class="{current:tabIndex == bank.current}" :key="tabIndex" v-for="(tab,tabIndex) in bank.jsonStr" @click="tabSelect(tabIndex,bankIndex)">问题{{tabIndex}}</view>
+							</view>
+							<view v-for="(ansItem,ansIndex) in bank.jsonStr" v-if="bank.current == ansIndex" :key="ansIndex">
+								<view class="titles">
+									<rich-text :nodes="ansItem.content"></rich-text>
+								</view>
+								<template v-if="ansItem.type == 1">
+									<view v-if="!bank.ques[ansIndex]">
+										<view v-for="(option, childIndex) in ansItem.optionsList" :key="childIndex" class="lisSty" @click="radioSelectChild(option.optionsId,ansIndex,bankIndex)">
+											<view class="activeTI">{{ ast[childIndex] }}</view>
+											<rich-text class="textChild" :nodes="option.content"></rich-text>
+										</view>
+									</view>
+									<view v-if="bank.ques[ansIndex]">
+										<view v-for="(option, childIndex) in ansItem.optionsList" :key="index" class="lisSty">
+											<text :class="{right:(option.optionsId == bank.ques[ansIndex]) || (option.optionsId == bank.ans[ansIndex]),wrong:(option.optionsId == bank.ques[ansIndex]) && (bank.ques[ansIndex] != bank.ans[ansIndex])}"  class="activeTI">{{ ast[childIndex] }}</text>
+											<rich-text :nodes="option.content"></rich-text>
+										</view>
+									</view> 
+									<view v-if="bank.ques[ansIndex]">
+										<view class="pad_8 answer">
+											<view>正确答案:{{ast[bank.ans[ansIndex]-1]}}</view>
+											<view v-if="!explain">我的答案:{{ast[bank.ques[ansIndex]-1]}}</view>
+										</view>
+										<view class="pad_8 answerInfos">
+											<view class="answerTitle">答案解析</view>
+											<view class="answerContent">
+												<rich-text :nodes="option.analysisContent"></rich-text>
+											</view>
+										</view>
+									</view>
+								</template>
+								
+								<template v-if="ansItem.type == 2">
+									<view v-if="!bank.ques[ansIndex]">
+										<view v-for="(option, childindex) in ansItem.optionsList" :key="childindex" class="lisSty" @click="checkboxSelectChild(bankIndex,ansIndex,childindex)">
+											<view :class="{checked:option.checked}" class="activeTI">{{ ast[childindex] }}</view>
+											<rich-text :nodes="option.content"></rich-text>
+										</view>
+									</view>
+									<view v-if="!bank.ques[ansIndex]" class="submit_checkbox" @click="checkboxSubmitChild(bankIndex,ansIndex)">
+										确认答案
+									</view>
+									<view v-if="bank.ques && bank.ques[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="bank.ques[ansIndex]">
+										<view class="pad_8 answer">
+											<view>正确答案:
+												<text v-for="ansItem1 in bank.ans[ansIndex]">{{ast[ansItem1-1]}}</text>
+											</view>
+											<view v-if="!explain">我的答案:
+												<text v-for="quesItem in bank.ques[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>
+								</template>
+								
+								<template v-if="ansItem.type == 3">
+									<view v-if="!bank.ques[ansIndex]">
+										<view v-for="(option, childindex) in judge" :key="childindex" class="lisSty" @click="judgeSelectChild(ansIndex,childindex,bankIndex)">
+											<view class="activeTI">{{ ast[childindex] }}</view>
+											{{ option }}
+										</view>
+									</view>
+									<view v-if="bank.ques[ansIndex]">
+										<view v-for="(option, childindex) in judge" :key="childindex" class="lisSty">
+											<text :class="{right:(childindex == bank.ques[ansIndex]) || (childindex == bank.ans[ansIndex]),wrong:(childindex == bank.ques[ansIndex]) && (bank.ques[ansIndex] != bank.ans[ansIndex])}"  class="activeTI">{{ ast[childindex] }}</text>
+											{{ option }}
+										</view>
+									</view> 
+									<view v-if="bank.ques[ansIndex]">
+										<view class="pad_8 answer">
+											<view>正确答案:{{ast[bank.ans[ansIndex]]}}</view>
+											<view v-if="!explain">我的答案:{{ast[bank.ques[ansIndex]]}}</view>
+										</view>
+										<view class="pad_8 answerInfos">
+											<view class="answerTitle">答案解析</view>
+											<view class="answerContent">
+												<rich-text :nodes="ansItem.analysisContent"></rich-text>
+											</view>
+										</view>
+									</view>
+								</template>
+								
+								
+								<!-- 简答题 -->
+								<template v-if="ansItem.type == 5">
+									<view class="ans">
+										<view class="ans_input" v-if="!bank.ques[ansIndex]">
+											<view class="top flex">
+												<image class="icon" @click="chooseImgChild(bankIndex,ansIndex)" src="/static/08-10_032.jpg" mode=""></image>
+												<view class="progress">0/4</view>
+												<view class="submit"  @click="submitAnsChild(bankIndex,ansIndex)">确认答案</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(imgIndex,bankIndex,ansIndex)">x</text>
+													<image :src="$method.splitImgHost(img, true)"></image>
+												</view>
+											</view>
+										</view>
+										<view class="ans_submit answerInfos" v-if="bank.ques[ansIndex] && !explain">
+											<view class="answerTitle">答案我的</view>
+											{{bank.ques[ansIndex].text}}
+											<view class="imgs">
+												<image class="img" v-for="ques in bank.ques[ansIndex].imageList" :src="ques"></image>
+											</view>
+										</view>
+									</view>
+									<view v-if="bank.ques[ansIndex]">
+										<view class="pad_8 answerInfos">
+											<view class="answerTitle">答案解析</view>
+											<view class="answerContent">
+												<rich-text :nodes="ansItem.analysisContent"></rich-text>
+											</view>
+										</view>
+									</view>
+								</template>
+								
+								
+							</view>
+						</template>
+						
+						
+					</view>
+					
+				
+					<view class="footer_btn">
+						<view @click="openFooterTab">答题卡</view>
+					</view>
+				</view>
+			</swiper-item>
+		</swiper>
+		
+		<u-popup v-model="show" mode="bottom" border-radius="14" height="680rpx">
+			<view class="popupView">
+				<view class="popupTops">
+					<view class="topIcon"></view>
+					点击编号即可跳转至对应题目
+				</view>
+				<view class="popupContent">
+					<scroll-view scroll-y="true" style="height: 506rpx;">
+						<view class="boxSty">
+							<view v-for="(item, index) in questionList" :key="index" @click="changeIndex(index)" :class="{isRight:isRight(item,index),isWrong:isWrong(item,index)}" class="liListSty">{{ index + 1 }}</view>
+						</view>
+					</scroll-view>
+				</view>
+			</view>
+		</u-popup>
+		
+		<view class="dialog" v-if="showDialog">
+			<view class="text">左右滑动切换上下题</view>
+			<view class="btn" @click="hideDialog">我知道了</view>
+		</view>
+	</view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			id:'',
+			current:0,
+			questionList:[],
+			ast: ['A', 'B', 'C', 'D','E','F','G'],
+			judge:['错误','正确'],
+			show: false,
+			showDialog:true,
+			bankList: [],
+			collectList:[],
+			goodsId:'',
+			explain:''
+		};
+	},
+	onLoad(option){
+		this.id = option.id;
+		this.explain = option.explain;
+		this.goodsQuestionList();
+	},
+	onUnload() {
+		
+	},
+	methods: {
+		
+		goodsQuestionList() {
+			this.$api.goodsQuestionList({
+				examId:this.id
+			}).then(res => {
+				
+				res.data.data.forEach((item,index) => { 
+					if(typeof item.jsonStr == 'string') {
+						item.jsonStr = JSON.parse(item.jsonStr)
+						
+						if(item.type == 2) { //多选
+							item.jsonStr.forEach(str => {
+								str.optionsId = ''+str.optionsId;
+							})
+							let arr = item.answerQuestion.split(',');
+							arr.forEach((a,i) => {
+								arr[i] = ''+a;
+							})
+							item.ans = arr;
+							if(this.explain) {
+								item.ques = item.ans;
+							}
+							return;
+						} else if(item.type == 5) {
+							item.ansText = {
+								text: '',
+								imageList: []
+							}
+							
+							if(this.explain) {
+								item.ques = {
+									text:item.analysisContent
+								}
+								
+								return;
+							}
+							
+							
+						} else if(item.type == 4) {
+							console.log(item.jsonStr)
+							item.ques = []
+							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: []
+									}
+								}
+							})
+							
+							item.ans = ansArr
+							if(this.explain) {
+								item.ques = item.ans;
+							}
+							return;
+							
+						}
+						
+						item.ans = item.answerQuestion
+						if(this.explain) {
+							item.ques = item.ans;
+						}
+					} else {
+						if(this.explain) {
+							item.ques = item.ans;
+						}
+					}
+					
+				})
+				
+				this.questionList = res.data.data;
+				
+			})
+		},
+		/**
+		 * @param {Object} e单选点击
+		 */
+		radioSelect(optionsId,bindex) {
+			if(this.questionList[bindex].ques) return;
+			this.$set(this.questionList[bindex],'ques',optionsId)
+			
+		},
+		
+		/**
+		 * @param {Object} e单选点击
+		 */
+		radioSelectChild(optionsId,ansIndex,bindex) {
+			if(this.questionList[bindex].ques[ansIndex]) return;
+			this.$set(this.questionList[bindex].ques,ansIndex,optionsId)
+			
+		},
+		
+		
+		/**
+		 * @param {Object} 多选点击
+		 */
+		checkboxSelect(optionsId,bindex,index) {
+			
+			this.$set(this.questionList[bindex].jsonStr[index],'checked',!this.questionList[bindex].jsonStr[index].checked)
+		},
+		
+		/**
+		 * @param {Object} 多选点击
+		 */
+		checkboxSelectChild(bindex,ansIndex,childIndex) {
+			
+			this.$set(this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex],'checked',!this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex].checked)
+		},
+		
+		/**
+		 * @param {Object} 多选确认
+		 */
+		checkboxSubmit(bindex) {
+			
+			if(this.questionList[bindex].ques) return;
+			let arr = [];
+			this.questionList[bindex].jsonStr.forEach(item => {
+				if(item.checked) {
+					arr.push(item.optionsId)
+				}
+			})
+			
+			this.$set(this.questionList[bindex],'ques',arr)
+			
+		},
+		
+		/**
+		 * @param {Object} 多选确认
+		 */
+		checkboxSubmitChild(bindex,ansIndex) {
+			
+			if(this.questionList[bindex].ques[ansIndex]) return;
+			let arr = [];
+			this.questionList[bindex].jsonStr[ansIndex].optionsList.forEach(item => {
+				if(item.checked) {
+					arr.push(item.optionsId)
+				}
+			})
+			
+			this.$set(this.questionList[bindex].ques,ansIndex,arr)
+		},
+		
+		judgeSelect(index,bindex) {
+			if(this.questionList[bindex].ques) return;
+			this.$set(this.questionList[bindex],'ques',index+'')
+			
+		},
+		
+		judgeSelectChild(ansindex,childindex,bindex) {
+			if(this.questionList[bindex].ques[ansindex]) return;
+			this.$set(this.questionList[bindex].ques,ansindex,childindex+'')
+		},
+		
+		openFooterTab() {
+			this.show = true;
+		},
+		hideDialog() {
+			this.showDialog = false
+		},
+		changeIndex(index) {
+			this.current = index
+		},
+		
+		swiperChange(e) {
+			this.current = e.detail.current;
+		},
+		
+		
+		deleteImg(imgIndex,bankIndex) {
+			
+			
+			this.questionList[bankIndex].ansText.imageList.splice(imgIndex,1)
+		},
+		
+		
+		deleteImgChild(imgIndex,bankIndex,ansIndex) {
+			
+			
+			this.questionList[bankIndex].jsonStr[ansIndex].ansText.imageList.splice(imgIndex,1)
+		},
+		
+		chooseImg(bankindex) {
+			uni.chooseImage({
+				count: 1, //默认9
+				sizeType: ['compressed', ], //可以指定是原图还是压缩图,默认二者都有
+				sourceType: ['album','camera'], //从相册选择
+				success: (res) => {
+					let self = this;
+					// console.log(JSON.stringify(res.tempFilePaths));
+					let img = res.tempFilePaths[0];
+					uni.getImageInfo({
+						src: img,
+						success: async res => {
+							let canvasWidth = res.width; //图片原始长宽
+							let canvasHeight = res.height;
+							if (canvasWidth > 1000 || canvasHeight > 1000) {
+								uni.compressImage({
+									src: img,
+									quality: 75,
+									width: '50%',
+									height: '50%',
+									success: async rest => {
+										const dir = await self.uploadFile(rest.tempFilePath, 0);
+										this.questionList[bankindex].ansText.imageList.push(dir)
+									} 
+								});
+							} else {
+								const dir = await self.uploadFile(img, 0);
+								this.questionList[bankindex].ansText.imageList.push(dir)
+							}
+						}
+					});
+				}
+			})
+		},
+		
+		chooseImgChild(bankindex,ansindex) {
+			uni.chooseImage({
+				count: 1, //默认9
+				sizeType: ['compressed', ], //可以指定是原图还是压缩图,默认二者都有
+				sourceType: ['album','camera'], //从相册选择
+				success: (res) => {
+					let self = this;
+					// console.log(JSON.stringify(res.tempFilePaths));
+					let img = res.tempFilePaths[0];
+					uni.getImageInfo({
+						src: img,
+						success: async res => {
+							let canvasWidth = res.width; //图片原始长宽
+							let canvasHeight = res.height;
+							if (canvasWidth > 1000 || canvasHeight > 1000) {
+								uni.compressImage({
+									src: img,
+									quality: 75,
+									width: '50%',
+									height: '50%',
+									success: async rest => {
+										const dir = await self.uploadFile(rest.tempFilePath, 0);
+										this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.push(dir)
+									} 
+								});
+							} else {
+								const dir = await self.uploadFile(img, 0);
+								this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.push(dir)
+							}
+						}
+					});
+				}
+			})
+		},
+		
+		uploadFile(options, int) {
+			var self = this;
+			return new Promise((resolve, reject) => {
+				var data = {
+					imageStatus: int
+				};
+				self.$api.aliyunpolicy(data).then(res => {
+					console.log(res.data,6)
+					if(res.data.code!=200){
+						self.$method.showToast('签名错误'+JSON.stringify(res.data))
+						return
+					}
+					var ossToken = res.data.data.resultContent;
+					if(ossToken.host==null||ossToken.host==undefined){
+						self.$method.showToast('上传路径报错'+JSON.stringify(res.data))
+						return
+					}
+					uni.uploadFile({
+						url: ossToken.host,
+						name: 'file',
+						filePath: options,
+						fileType: 'image',
+						header: {
+							AuthorizationToken: 'WX ' + uni.getStorageSync('token')
+						},
+						formData: {
+							key: ossToken.dir,
+							OSSAccessKeyId: ossToken.accessid,
+							policy: ossToken.policy,
+							Signature: ossToken.signature,
+							callback: ossToken.callback,
+							success_action_status: 200
+						},
+						success: result => {
+							if (result.statusCode === 200) {
+								resolve(ossToken.dir);
+							} else {
+								uni.showToast({
+									title: '上传失败',
+									icon: 'none'
+								});
+								return;
+							}
+						},
+						fail: error => {
+							uni.showToast({
+								title: '上传接口报错'+error,
+								icon: 'none'
+							});
+							return;
+						}
+					});
+				});
+			});
+		},
+		submitAns(type,bankindex) {
+				
+			console.log(this.questionList[bankindex])
+			if(!this.questionList[bankindex].ansText.text && !this.questionList[bankindex].ansText.imageList.length) {
+				uni.showToast({
+					title: '请输入内容或上传图片',
+					duration: 2000,
+					icon:'none'
+				});
+				return
+			}
+			
+			this.$set(this.ques,bankindex,{
+				imageList:this.questionList[bankindex].ansText.imageList,
+				text:this.questionList[bankindex].ansText.text,
+			})
+			
+		},
+		
+		submitAnsChild(bankindex,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.questionList[bankindex].ques,ansindex,{
+				imageList:this.questionList[bankindex].jsonStr[ansindex].ansText.imageList,
+				text:this.questionList[bankindex].jsonStr[ansindex].ansText.text,
+			})
+			
+		},
+		
+		isRight(item,index) {
+			//单选
+			if(this.questionList[index].ques) {
+				if(item.type == 1) {
+					return this.questionList[index].ques == this.questionList[index].ans;
+				//多选
+				} else if(item.type == 2) {
+					//每一项都相等
+					return this.questionList[index].ques.every((item,index) => {
+						return item == this.questionList[index].ans;
+					})
+				//判断
+				} else if(item.type == 3) {
+					return this.questionList[index].ques == this.questionList[index].ans;
+				} else {
+					return false;
+				}
+			} else {
+				return false;
+			}
+			
+		},
+		
+		
+		right(bankIndex,ansIndex,option) {
+			if(this.questionList[bankIndex].ques[ansIndex] && this.questionList[bankIndex].ans[ansIndex]) {
+				
+				if((this.questionList[bankIndex].ques[ansIndex].indexOf(option.optionsId) != -1 ) || (this.questionList[bankIndex].ans[ansIndex].indexOf(option.optionsId) != -1)) {
+					return true
+				} else {
+					return false;
+				}
+			} else {
+				return false;
+			}
+			
+		},
+		
+		wrong(bankIndex,ansIndex,option) {
+			if(this.questionList[bankIndex].ques[ansIndex] && this.questionList[bankIndex].ans[ansIndex]) {
+				
+				if((this.questionList[bankIndex].ques[ansIndex].indexOf(option.optionsId) != -1 ) && (this.questionList[bankIndex].ans[ansIndex].indexOf(option.optionsId) == -1)) {
+					return true;
+				} else {
+					return false;
+				}
+			} else {
+				return false;
+			}
+		},
+		
+		isWrong(item,index) {
+			if(this.questionList[index].ques) {
+				//单选
+				if(item.type == 1) {
+					return this.questionList[index].ques != this.questionList[index].ans;
+				//多选
+				} else if(item.type == 2) {
+					//每一项都相等
+					return this.questionList[index].ques.some((item,index) => {
+						return item != this.questionList[index].ans;
+					})
+				//判断
+				} else if(item.type == 3) {
+					return this.questionList[index].ques != this.questionList[index].ans;
+				} else {
+					return false;
+				}
+			} else {
+				return false;
+			}
+			
+		},
+		
+		tabSelect(index,bankindex) {
+			
+			this.$set(this.questionList[bankindex],'current',index)
+			
+		},
+	}
+};
+</script>
+
+<style lang="scss" scoped>
+.swiper {
+	width:100%;
+	height:100vh;
+}
+.lisSty {
+	margin-bottom: 16rpx;
+	display: flex;
+	
+	.flex_auto {
+		flex:1;
+	}
+}
+.activeTI {
+	vertical-align: middle;
+	display: inline-block;
+	border: 1rpx solid #eee;
+	border-radius: 50rpx;
+	height: 48rpx;
+	line-height: 46rpx;
+	text-align: center;
+	width: 48rpx;
+	margin-right: 15rpx;
+	color: #666;
+	font-size: 30rpx;
+	
+	
+	&.right {
+		color:#fff;
+		background:green;
+	}
+	
+	&.wrong {
+		color:#fff;
+		background:red;
+	}
+	
+	&.checked {
+		color:#fff;
+		background:blue;
+	}
+}
+
+.submit_checkbox {
+	margin:20rpx auto;
+	width: 526rpx;
+	height: 80rpx;
+	background: rgba(0, 122, 255, 1);
+	color:#fff;
+	text-align: center;
+	line-height: 80rpx;
+	font-size: 30rpx;
+	border-radius: 40rpx;
+}
+.titles {
+	overflow: hidden;
+	margin-bottom: 24rpx;
+}
+.titBox {
+	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;
+	
+	.ans_input {
+	    border-radius: 16rpx;
+		background:#fff;
+		.top {
+			border-bottom:1rpx solid #EEEEEE;
+			padding: 16rpx;
+			display: flex;
+			align-items: center;
+			
+			.icon {
+				margin-right:20rpx;
+				width: 40rpx;
+				height: 38rpx;
+			}
+			
+			.progress {
+				flex:1;
+			}
+			
+			.submit {
+				width: 168rpx;
+				height: 48rpx;
+				line-height: 48rpx;
+				text-align: center;
+				color:#fff;
+				font-size: 30rpx;
+				background: #007AFF;
+				border-radius: 24rpx;
+			}
+		}
+		
+		.textarea {
+			textarea {
+				width:100%;
+				height:287rpx;
+				padding:10rpx;
+			}
+		}
+		
+		.imgs {
+			overflow: hidden;
+			display: flex;
+			width:100%;
+			.img {
+				width: 104rpx;
+				height: 104rpx;
+				border-radius: 8rpx;
+				position:relative;
+				margin:20rpx;
+				
+				
+				text {
+					position:absolute;
+					right:-15rpx;
+					top:-15rpx;
+					width:30rpx;
+					height:30rpx;
+					text-align: center;
+					line-height: 30rpx;
+					color:#fff;
+					background:red;
+					border-radius:50%;
+				}
+				
+				image {
+					width:100%;
+					height:100%;
+				}
+			}
+		}
+	}
+	
+	.ans_submit {
+		padding:16rpx;
+		border-radius: 16rpx;
+		background:#fff;
+		
+		.imgs {
+			overflow: hidden;
+			display: flex;
+			width:100%;
+			.img {
+				width: 104rpx;
+				height: 104rpx;
+				border-radius: 8rpx;
+				position:relative;
+				margin:20rpx;
+				
+				image {
+					width:100%;
+					height:100%;
+				}
+			}
+		}
+	}
+}
+.firstLetter {
+	display: flex;
+	justify-content: space-between;
+	align-items: center;
+	margin-bottom: 30rpx;
+	.leftLetters {
+		display: flex;
+		align-items: center;
+		width: 220rpx;
+		.btnType {
+			padding: 5rpx 10rpx;
+			border: 1rpx solid #007aff;
+			border-radius: 10rpx;
+			background-color: rgba(0, 122, 255, 0.1);
+			font-size: 28rpx;
+			color: #007aff;
+			margin-right: 15rpx;
+		}
+	}
+}
+.popupView {
+	height: 100%;
+	padding-bottom: 100rpx;
+	.popupTops {
+		height: 77rpx;
+		border-bottom: 1rpx solid #eee;
+		text-align: center;
+		line-height: 77rpx;
+		font-size: 24rpx;
+		color: #999;
+		position: relative;
+		.topIcon {
+			position: absolute;
+			top: 10rpx;
+			left: 50%;
+			transform: translateX(-50%);
+			width: 80rpx;
+			height: 8rpx;
+			background-color: #999;
+			border-radius: 4rpx;
+		}
+	}
+	.popupContent {
+	}
+}
+.pageContent {
+	position:relative;
+	background-color: #eaeef1;
+	min-height: 100vh;
+	padding-top: 8rpx;
+	padding-bottom: 100rpx;
+}
+.pad_8 {
+	background-color: #fff;
+	margin: 0rpx 8rpx 8rpx;
+	border-radius: 16rpx;
+}
+.answer {
+	height: 80rpx;
+	line-height: 80rpx;
+	padding: 0rpx 24rpx;
+	display: flex;
+	align-items: center;
+	justify-content: space-between;
+	color: #666;
+	font-size: 30rpx;
+}
+.footer_btn {
+	background-color: #fff;
+	z-index: 10078;
+	position: absolute;
+	bottom: 0rpx;
+	display: flex;
+	align-items: center;
+	justify-content: space-between;
+	width: 100%;
+	height: 98rpx;
+	padding: 0rpx 38rpx;
+	border-top: 1rpx solid #eee;
+	
+	.collect {
+		visibility: hidden;
+		
+		&.show {
+			visibility: visible;
+		}
+	}
+}
+.boxSty {
+	padding: 44rpx 41rpx 0rpx;
+}
+.liListSty {
+	border:1rpx solid #EEEEEE;
+	width: 88rpx;
+	height: 88rpx;
+	border-radius: 32rpx;
+	text-align: center;
+	line-height: 88rpx;
+	color: #333;
+	font-size: 32rpx;
+	float: left;
+	margin: 20rpx 23rpx;
+	
+	&.isRight {
+		border:1rpx solid #EEEEEE;
+		color:#fff;
+		background: green;
+	}
+	
+	&.isWrong {
+		border:1rpx solid #EEEEEE;
+		color:#fff;
+		background: red;
+	}
+}
+.answerInfos {
+	padding: 25rpx 25rpx 25rpx 23rpx;
+}
+.answerTitle {
+	margin-bottom: 28rpx;
+	color: #666;
+	font-size: 30rpx;
+}
+.answerContent {
+	font-size: 30rpx;
+	color: #666;
+}
+
+.textChild {
+	display: inline-block;
+	vertical-align: middle;
+}
+
+.dialog {
+	position: fixed;
+	left:0;
+	top:0;
+	width:100%;
+	height:100%;
+	background-color: rgba(0,0,0,0.8);
+	display: flex;
+	flex-direction: column;
+	align-items: center;
+	justify-content: center;
+	z-index: 20000;
+	
+	.text {
+		font-size: 32rpx;
+		color: #FFFFFF;
+		text-align: center;
+	}
+	
+	.btn {
+		width: 242rpx;
+		height: 82rpx;
+		border: 2rpx solid #FFFFFF;
+		border-radius: 16rpx;
+		text-align: center;
+		line-height: 82rpx;
+		margin:41rpx auto;
+		color:#fff;
+		font-size: 32rpx;
+	}
+}
+</style>

+ 1139 - 0
pages2/subject/collectQuestionTypeBank.vue

@@ -0,0 +1,1139 @@
+<template>
+	<view id="questionBank">
+		<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="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>
+								</view>
+								<text>{{bankIndex+1}}/{{questionList.length}}</text>
+							</view>
+							<view style="color: #666;font-size: 28rpx;"></view>
+							<view class="leftLetters"></view>
+						</view>
+						<view class="titles">
+							<rich-text :nodes="bank.content"></rich-text>
+						</view>		
+					</view>
+					<view class="pad_8 titBox">
+						<template v-if="bank.type == 1">
+							<view v-if="!bank.ques">
+								<view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty" @click="radioSelect(item.optionsId,bankIndex)">
+									<view class="activeTI">{{ ast[index] }}</view>
+									<view class="flex_auto">{{ item.content }}</view>
+								</view>
+							</view>
+							<view v-if="bank.ques">
+								<view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty">
+									<text :class="{right:(item.optionsId == bank.ques) || (item.optionsId == bank.ans),wrong:(item.optionsId == bank.ques) && (bank.ques != bank.ans)}"  class="activeTI">{{ ast[index] }}</text>
+									<view class="flex_auto">{{ item.content }}</view>
+								</view>
+							</view> 
+							<view v-if="bank.ques">
+								<view class="pad_8 answer">
+									<view>正确答案:{{ast[bank.ans-1]}}</view>
+									<view v-if="!explain">我的答案:{{ast[bank.ques-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>
+						</template>
+						
+						<template v-if="bank.type == 2">
+							<view v-if="!bank.ques">
+								<view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty" @click="checkboxSelect(item.optionsId,bankIndex,index)">
+									<view :class="{checked:item.checked}" class="activeTI">{{ ast[index] }}</view>
+									<view class="flex_auto">{{ item.content }}</view>
+								</view>
+							</view>
+							<view v-if="!bank.ques" class="submit_checkbox" @click="checkboxSubmit(bankIndex)">
+								确认答案
+							</view>
+							<view v-if="bank.ques">
+								<view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty">
+									<text :class="{right:(bank.ques.indexOf(item.optionsId) != -1 ) || (bank.ans.indexOf(item.optionsId) != -1),wrong:(bank.ques.indexOf(item.optionsId) != -1 ) && (bank.ans.indexOf(item.optionsId) == -1)}"  class="activeTI">{{ ast[index] }}</text>
+									<view class="flex_auto">{{ item.content }}</view>
+								</view>
+							</view> 
+							<view v-if="bank.ques">
+								<view class="pad_8 answer">
+									<view>正确答案:
+										<text v-for="ansItem in bank.ans">{{ast[ansItem-1]}}</text>
+									</view>
+									<view v-if="!explain">我的答案:
+										<text v-for="quesItem in bank.ques">{{ast[quesItem-1]}}</text>
+									</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 == 3">
+							<view v-if="!bank.ques">
+								<view v-for="(item, index) in judge" :key="index" class="lisSty" @click="judgeSelect(index,bankIndex)">
+									<view class="activeTI">{{ ast[index] }}</view>
+									{{ item }}
+								</view>
+							</view>
+							<view v-if="bank.ques">
+								<view v-for="(item, index) in judge" :key="index" class="lisSty">
+									<text :class="{right:(index == bank.ques) || (index == bank.ans),wrong:(index == bank.ques) && (bank.ques != bank.ans)}"  class="activeTI">{{ ast[index] }}</text>
+									{{ item }}
+								</view>
+							</view> 
+							<view v-if="bank.ques">
+								<view class="pad_8 answer">
+									<view>正确答案:{{ast[bank.ans]}}</view>
+									<view v-if="!explain">我的答案:{{ast[bank.ques]}}</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="!bank.ques">
+									<view class="top flex">
+										<image :data-index="bankIndex" class="icon" @click="chooseImg(bankIndex)" src="/static/08-10_032.jpg" mode=""></image>
+										<view class="progress">0/4</view>
+										<view class="submit"  @click="submitAns(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(imgIndex,bankIndex)">x</text>
+											<image :src="$method.splitImgHost(img, true)"></image>
+										</view>
+									</view>
+								</view>
+								<view class="ans_submit answerInfos" v-if="bank.ques && !explain">
+									<view class="answerTitle">答案我的</view>
+									{{bank.ques.text}}
+									<view class="imgs">
+										<image class="img" v-for="ques in bank.ques.imageList" :src="ques"></image>
+									</view>
+								</view>
+							</view>
+							<view v-if="bank.ques">
+								<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 == 4">
+							<view class="tabs">
+								<view class="tab" :class="{current:tabIndex == bank.current}" :key="tabIndex" v-for="(tab,tabIndex) in bank.jsonStr" @click="tabSelect(tabIndex,bankIndex)">问题{{tabIndex}}</view>
+							</view>
+							<view v-for="(ansItem,ansIndex) in bank.jsonStr" v-if="bank.current == ansIndex" :key="ansIndex">
+								<view class="titles">
+									<rich-text :nodes="ansItem.content"></rich-text>
+								</view>
+								<template v-if="ansItem.type == 1">
+									<view v-if="!bank.ques[ansIndex]">
+										<view v-for="(option, childIndex) in ansItem.optionsList" :key="childIndex" class="lisSty" @click="radioSelectChild(option.optionsId,ansIndex,bankIndex)">
+											<view class="activeTI">{{ ast[childIndex] }}</view>
+											<rich-text class="textChild" :nodes="option.content"></rich-text>
+										</view>
+									</view>
+									<view v-if="bank.ques[ansIndex]">
+										<view v-for="(option, childIndex) in ansItem.optionsList" :key="index" class="lisSty">
+											<text :class="{right:(option.optionsId == bank.ques[ansIndex]) || (option.optionsId == bank.ans[ansIndex]),wrong:(option.optionsId == bank.ques[ansIndex]) && (bank.ques[ansIndex] != bank.ans[ansIndex])}"  class="activeTI">{{ ast[childIndex] }}</text>
+											<rich-text :nodes="option.content"></rich-text>
+										</view>
+									</view> 
+									<view v-if="bank.ques[ansIndex]">
+										<view class="pad_8 answer">
+											<view>正确答案:{{ast[bank.ans[ansIndex]-1]}}</view>
+											<view v-if="!explain">我的答案:{{ast[bank.ques[ansIndex]-1]}}</view>
+										</view>
+										<view class="pad_8 answerInfos">
+											<view class="answerTitle">答案解析</view>
+											<view class="answerContent">
+												<rich-text :nodes="option.analysisContent"></rich-text>
+											</view>
+										</view>
+									</view>
+								</template>
+								
+								<template v-if="ansItem.type == 2">
+									<view v-if="!bank.ques[ansIndex]">
+										<view v-for="(option, childindex) in ansItem.optionsList" :key="childindex" class="lisSty" @click="checkboxSelectChild(bankIndex,ansIndex,childindex)">
+											<view :class="{checked:option.checked}" class="activeTI">{{ ast[childindex] }}</view>
+											<rich-text :nodes="option.content"></rich-text>
+										</view>
+									</view>
+									<view v-if="!bank.ques[ansIndex]" class="submit_checkbox" @click="checkboxSubmitChild(bankIndex,ansIndex)">
+										确认答案
+									</view>
+									<view v-if="bank.ques && bank.ques[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="bank.ques[ansIndex]">
+										<view class="pad_8 answer">
+											<view>正确答案:
+												<text v-for="ansItem1 in bank.ans[ansIndex]">{{ast[ansItem1-1]}}</text>
+											</view>
+											<view v-if="!explain">我的答案:
+												<text v-for="quesItem in bank.ques[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>
+								</template>
+								
+								<template v-if="ansItem.type == 3">
+									<view v-if="!bank.ques[ansIndex]">
+										<view v-for="(option, childindex) in judge" :key="childindex" class="lisSty" @click="judgeSelectChild(ansIndex,childindex,bankIndex)">
+											<view class="activeTI">{{ ast[childindex] }}</view>
+											{{ option }}
+										</view>
+									</view>
+									<view v-if="bank.ques[ansIndex]">
+										<view v-for="(option, childindex) in judge" :key="childindex" class="lisSty">
+											<text :class="{right:(childindex == bank.ques[ansIndex]) || (childindex == bank.ans[ansIndex]),wrong:(childindex == bank.ques[ansIndex]) && (bank.ques[ansIndex] != bank.ans[ansIndex])}"  class="activeTI">{{ ast[childindex] }}</text>
+											{{ option }}
+										</view>
+									</view> 
+									<view v-if="bank.ques[ansIndex]">
+										<view class="pad_8 answer">
+											<view>正确答案:{{ast[bank.ans[ansIndex]]}}</view>
+											<view v-if="!explain">我的答案:{{ast[bank.ques[ansIndex]]}}</view>
+										</view>
+										<view class="pad_8 answerInfos">
+											<view class="answerTitle">答案解析</view>
+											<view class="answerContent">
+												<rich-text :nodes="ansItem.analysisContent"></rich-text>
+											</view>
+										</view>
+									</view>
+								</template>
+								
+								
+								<!-- 简答题 -->
+								<template v-if="ansItem.type == 5">
+									<view class="ans">
+										<view class="ans_input" v-if="!bank.ques[ansIndex]">
+											<view class="top flex">
+												<image class="icon" @click="chooseImgChild(bankIndex,ansIndex)" src="/static/08-10_032.jpg" mode=""></image>
+												<view class="progress">0/4</view>
+												<view class="submit"  @click="submitAnsChild(bankIndex,ansIndex)">确认答案</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(imgIndex,bankIndex,ansIndex)">x</text>
+													<image :src="$method.splitImgHost(img, true)"></image>
+												</view>
+											</view>
+										</view>
+										<view class="ans_submit answerInfos" v-if="bank.ques[ansIndex] && !explain">
+											<view class="answerTitle">答案我的</view>
+											{{bank.ques[ansIndex].text}}
+											<view class="imgs">
+												<image class="img" v-for="ques in bank.ques[ansIndex].imageList" :src="ques"></image>
+											</view>
+										</view>
+									</view>
+									<view v-if="bank.ques[ansIndex]">
+										<view class="pad_8 answerInfos">
+											<view class="answerTitle">答案解析</view>
+											<view class="answerContent">
+												<rich-text :nodes="ansItem.analysisContent"></rich-text>
+											</view>
+										</view>
+									</view>
+								</template>
+								
+								
+							</view>
+						</template>
+						
+						
+					</view>
+					
+				
+					<view class="footer_btn">
+						<view @click="openFooterTab">答题卡</view>
+					</view>
+				</view>
+			</swiper-item>
+		</swiper>
+		
+		<u-popup v-model="show" mode="bottom" border-radius="14" height="680rpx">
+			<view class="popupView">
+				<view class="popupTops">
+					<view class="topIcon"></view>
+					点击编号即可跳转至对应题目
+				</view>
+				<view class="popupContent">
+					<scroll-view scroll-y="true" style="height: 506rpx;">
+						<view class="boxSty">
+							<view v-for="(item, index) in questionList" :key="index" @click="changeIndex(index)" :class="{isRight:isRight(item,index),isWrong:isWrong(item,index)}" class="liListSty">{{ index + 1 }}</view>
+						</view>
+					</scroll-view>
+				</view>
+			</view>
+		</u-popup>
+		
+		<view class="dialog" v-if="showDialog">
+			<view class="text">左右滑动切换上下题</view>
+			<view class="btn" @click="hideDialog">我知道了</view>
+		</view>
+	</view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			current:0,
+			questionList:[],
+			ast: ['A', 'B', 'C', 'D','E','F','G'],
+			judge:['错误','正确'],
+			show: false,
+			showDialog:true,
+			bankList: [],
+			collectList:[],
+			type:'',
+			explain:''
+		};
+	},
+	onLoad(option){
+		this.type = option.type;
+		this.explain = option.explain;
+		this.wrongRecordTypeQuestionList();
+	},
+	onUnload() {
+		
+	},
+	methods: {
+		
+		wrongRecordTypeQuestionList() {
+			this.$api.wrongRecordTypeQuestionList({
+				type:this.type
+			}).then(res => {
+				
+				res.data.rows.forEach((item,index) => { 
+					if(typeof item.jsonStr == 'string') {
+						item.jsonStr = JSON.parse(item.jsonStr)
+						
+						if(item.type == 2) { //多选
+							item.jsonStr.forEach(str => {
+								str.optionsId = ''+str.optionsId;
+							})
+							let arr = item.answerQuestion.split(',');
+							arr.forEach((a,i) => {
+								arr[i] = ''+a;
+							})
+							item.ans = arr;
+							if(this.explain) {
+								item.ques = item.ans;
+							}
+							return;
+						} else if(item.type == 5) {
+							item.ansText = {
+								text: '',
+								imageList: []
+							}
+							
+							if(this.explain) {
+								item.ques = {
+									text:item.analysisContent
+								}
+								
+								return;
+							}
+							
+							
+						} else if(item.type == 4) {
+							console.log(item.jsonStr)
+							item.ques = []
+							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: []
+									}
+								}
+							})
+							
+							item.ans = ansArr
+							if(this.explain) {
+								item.ques = item.ans;
+							}
+							return;
+							
+						}
+						
+						item.ans = item.answerQuestion
+						if(this.explain) {
+							item.ques = item.ans;
+						}
+					} else {
+						if(this.explain) {
+							item.ques = item.ans;
+						}
+					}
+					
+				})
+				
+				this.questionList = res.data.rows;
+				
+			})
+		},
+		/**
+		 * @param {Object} e单选点击
+		 */
+		radioSelect(optionsId,bindex) {
+			if(this.questionList[bindex].ques) return;
+			this.$set(this.questionList[bindex],'ques',optionsId)
+			
+		},
+		
+		/**
+		 * @param {Object} e单选点击
+		 */
+		radioSelectChild(optionsId,ansIndex,bindex) {
+			if(this.questionList[bindex].ques[ansIndex]) return;
+			this.$set(this.questionList[bindex].ques,ansIndex,optionsId)
+			
+		},
+		
+		
+		/**
+		 * @param {Object} 多选点击
+		 */
+		checkboxSelect(optionsId,bindex,index) {
+			
+			this.$set(this.questionList[bindex].jsonStr[index],'checked',!this.questionList[bindex].jsonStr[index].checked)
+		},
+		
+		/**
+		 * @param {Object} 多选点击
+		 */
+		checkboxSelectChild(bindex,ansIndex,childIndex) {
+			
+			this.$set(this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex],'checked',!this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex].checked)
+		},
+		
+		/**
+		 * @param {Object} 多选确认
+		 */
+		checkboxSubmit(bindex) {
+			
+			if(this.questionList[bindex].ques) return;
+			let arr = [];
+			this.questionList[bindex].jsonStr.forEach(item => {
+				if(item.checked) {
+					arr.push(item.optionsId)
+				}
+			})
+			
+			this.$set(this.questionList[bindex],'ques',arr)
+			
+		},
+		
+		/**
+		 * @param {Object} 多选确认
+		 */
+		checkboxSubmitChild(bindex,ansIndex) {
+			
+			if(this.questionList[bindex].ques[ansIndex]) return;
+			let arr = [];
+			this.questionList[bindex].jsonStr[ansIndex].optionsList.forEach(item => {
+				if(item.checked) {
+					arr.push(item.optionsId)
+				}
+			})
+			
+			this.$set(this.questionList[bindex].ques,ansIndex,arr)
+		},
+		
+		judgeSelect(index,bindex) {
+			if(this.questionList[bindex].ques) return;
+			this.$set(this.questionList[bindex],'ques',index+'')
+			
+		},
+		
+		judgeSelectChild(ansindex,childindex,bindex) {
+			if(this.questionList[bindex].ques[ansindex]) return;
+			this.$set(this.questionList[bindex].ques,ansindex,childindex+'')
+		},
+		
+		openFooterTab() {
+			this.show = true;
+		},
+		hideDialog() {
+			this.showDialog = false
+		},
+		changeIndex(index) {
+			this.current = index
+		},
+		
+		swiperChange(e) {
+			this.current = e.detail.current;
+		},
+		
+		
+		deleteImg(imgIndex,bankIndex) {
+			
+			
+			this.questionList[bankIndex].ansText.imageList.splice(imgIndex,1)
+		},
+		
+		
+		deleteImgChild(imgIndex,bankIndex,ansIndex) {
+			
+			
+			this.questionList[bankIndex].jsonStr[ansIndex].ansText.imageList.splice(imgIndex,1)
+		},
+		
+		chooseImg(bankindex) {
+			uni.chooseImage({
+				count: 1, //默认9
+				sizeType: ['compressed', ], //可以指定是原图还是压缩图,默认二者都有
+				sourceType: ['album','camera'], //从相册选择
+				success: (res) => {
+					let self = this;
+					// console.log(JSON.stringify(res.tempFilePaths));
+					let img = res.tempFilePaths[0];
+					uni.getImageInfo({
+						src: img,
+						success: async res => {
+							let canvasWidth = res.width; //图片原始长宽
+							let canvasHeight = res.height;
+							if (canvasWidth > 1000 || canvasHeight > 1000) {
+								uni.compressImage({
+									src: img,
+									quality: 75,
+									width: '50%',
+									height: '50%',
+									success: async rest => {
+										const dir = await self.uploadFile(rest.tempFilePath, 0);
+										this.questionList[bankindex].ansText.imageList.push(dir)
+									} 
+								});
+							} else {
+								const dir = await self.uploadFile(img, 0);
+								this.questionList[bankindex].ansText.imageList.push(dir)
+							}
+						}
+					});
+				}
+			})
+		},
+		
+		chooseImgChild(bankindex,ansindex) {
+			uni.chooseImage({
+				count: 1, //默认9
+				sizeType: ['compressed', ], //可以指定是原图还是压缩图,默认二者都有
+				sourceType: ['album','camera'], //从相册选择
+				success: (res) => {
+					let self = this;
+					// console.log(JSON.stringify(res.tempFilePaths));
+					let img = res.tempFilePaths[0];
+					uni.getImageInfo({
+						src: img,
+						success: async res => {
+							let canvasWidth = res.width; //图片原始长宽
+							let canvasHeight = res.height;
+							if (canvasWidth > 1000 || canvasHeight > 1000) {
+								uni.compressImage({
+									src: img,
+									quality: 75,
+									width: '50%',
+									height: '50%',
+									success: async rest => {
+										const dir = await self.uploadFile(rest.tempFilePath, 0);
+										this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.push(dir)
+									} 
+								});
+							} else {
+								const dir = await self.uploadFile(img, 0);
+								this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.push(dir)
+							}
+						}
+					});
+				}
+			})
+		},
+		
+		uploadFile(options, int) {
+			var self = this;
+			return new Promise((resolve, reject) => {
+				var data = {
+					imageStatus: int
+				};
+				self.$api.aliyunpolicy(data).then(res => {
+					console.log(res.data,6)
+					if(res.data.code!=200){
+						self.$method.showToast('签名错误'+JSON.stringify(res.data))
+						return
+					}
+					var ossToken = res.data.data.resultContent;
+					if(ossToken.host==null||ossToken.host==undefined){
+						self.$method.showToast('上传路径报错'+JSON.stringify(res.data))
+						return
+					}
+					uni.uploadFile({
+						url: ossToken.host,
+						name: 'file',
+						filePath: options,
+						fileType: 'image',
+						header: {
+							AuthorizationToken: 'WX ' + uni.getStorageSync('token')
+						},
+						formData: {
+							key: ossToken.dir,
+							OSSAccessKeyId: ossToken.accessid,
+							policy: ossToken.policy,
+							Signature: ossToken.signature,
+							callback: ossToken.callback,
+							success_action_status: 200
+						},
+						success: result => {
+							if (result.statusCode === 200) {
+								resolve(ossToken.dir);
+							} else {
+								uni.showToast({
+									title: '上传失败',
+									icon: 'none'
+								});
+								return;
+							}
+						},
+						fail: error => {
+							uni.showToast({
+								title: '上传接口报错'+error,
+								icon: 'none'
+							});
+							return;
+						}
+					});
+				});
+			});
+		},
+		submitAns(type,bankindex) {
+				
+			console.log(this.questionList[bankindex])
+			if(!this.questionList[bankindex].ansText.text && !this.questionList[bankindex].ansText.imageList.length) {
+				uni.showToast({
+					title: '请输入内容或上传图片',
+					duration: 2000,
+					icon:'none'
+				});
+				return
+			}
+			
+			this.$set(this.ques,bankindex,{
+				imageList:this.questionList[bankindex].ansText.imageList,
+				text:this.questionList[bankindex].ansText.text,
+			})
+			
+		},
+		
+		submitAnsChild(bankindex,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.questionList[bankindex].ques,ansindex,{
+				imageList:this.questionList[bankindex].jsonStr[ansindex].ansText.imageList,
+				text:this.questionList[bankindex].jsonStr[ansindex].ansText.text,
+			})
+			
+		},
+		
+		isRight(item,index) {
+			//单选
+			if(this.questionList[index].ques) {
+				if(item.type == 1) {
+					return this.questionList[index].ques == this.questionList[index].ans;
+				//多选
+				} else if(item.type == 2) {
+					//每一项都相等
+					return this.questionList[index].ques.every((item,index) => {
+						return item == this.questionList[index].ans;
+					})
+				//判断
+				} else if(item.type == 3) {
+					return this.questionList[index].ques == this.questionList[index].ans;
+				} else {
+					return false;
+				}
+			} else {
+				return false;
+			}
+			
+		},
+		
+		
+		right(bankIndex,ansIndex,option) {
+			if(this.questionList[bankIndex].ques[ansIndex] && this.questionList[bankIndex].ans[ansIndex]) {
+				
+				if((this.questionList[bankIndex].ques[ansIndex].indexOf(option.optionsId) != -1 ) || (this.questionList[bankIndex].ans[ansIndex].indexOf(option.optionsId) != -1)) {
+					return true
+				} else {
+					return false;
+				}
+			} else {
+				return false;
+			}
+			
+		},
+		
+		wrong(bankIndex,ansIndex,option) {
+			if(this.questionList[bankIndex].ques[ansIndex] && this.questionList[bankIndex].ans[ansIndex]) {
+				
+				if((this.questionList[bankIndex].ques[ansIndex].indexOf(option.optionsId) != -1 ) && (this.questionList[bankIndex].ans[ansIndex].indexOf(option.optionsId) == -1)) {
+					return true;
+				} else {
+					return false;
+				}
+			} else {
+				return false;
+			}
+		},
+		
+		isWrong(item,index) {
+			if(this.questionList[index].ques) {
+				//单选
+				if(item.type == 1) {
+					return this.questionList[index].ques != this.questionList[index].ans;
+				//多选
+				} else if(item.type == 2) {
+					//每一项都相等
+					return this.questionList[index].ques.some((item,index) => {
+						return item != this.questionList[index].ans;
+					})
+				//判断
+				} else if(item.type == 3) {
+					return this.questionList[index].ques != this.questionList[index].ans;
+				} else {
+					return false;
+				}
+			} else {
+				return false;
+			}
+			
+		},
+		
+		tabSelect(index,bankindex) {
+			
+			this.$set(this.questionList[bankindex],'current',index)
+			
+		},
+	}
+};
+</script>
+
+<style lang="scss" scoped>
+.swiper {
+	width:100%;
+	height:100vh;
+}
+.lisSty {
+	margin-bottom: 16rpx;
+	display: flex;
+	.flex_auto {
+		flex:1;
+	}
+}
+.activeTI {
+	vertical-align: middle;
+	display: inline-block;
+	border: 1rpx solid #eee;
+	border-radius: 50rpx;
+	height: 48rpx;
+	line-height: 46rpx;
+	text-align: center;
+	width: 48rpx;
+	margin-right: 15rpx;
+	color: #666;
+	font-size: 30rpx;
+	
+	
+	&.right {
+		color:#fff;
+		background:green;
+	}
+	
+	&.wrong {
+		color:#fff;
+		background:red;
+	}
+	
+	&.checked {
+		color:#fff;
+		background:blue;
+	}
+}
+
+.submit_checkbox {
+	margin:20rpx auto;
+	width: 526rpx;
+	height: 80rpx;
+	background: rgba(0, 122, 255, 1);
+	color:#fff;
+	text-align: center;
+	line-height: 80rpx;
+	font-size: 30rpx;
+	border-radius: 40rpx;
+}
+.titles {
+	overflow: hidden;
+	margin-bottom: 24rpx;
+}
+.titBox {
+	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;
+	
+	.ans_input {
+	    border-radius: 16rpx;
+		background:#fff;
+		.top {
+			border-bottom:1rpx solid #EEEEEE;
+			padding: 16rpx;
+			display: flex;
+			align-items: center;
+			
+			.icon {
+				margin-right:20rpx;
+				width: 40rpx;
+				height: 38rpx;
+			}
+			
+			.progress {
+				flex:1;
+			}
+			
+			.submit {
+				width: 168rpx;
+				height: 48rpx;
+				line-height: 48rpx;
+				text-align: center;
+				color:#fff;
+				font-size: 30rpx;
+				background: #007AFF;
+				border-radius: 24rpx;
+			}
+		}
+		
+		.textarea {
+			textarea {
+				width:100%;
+				height:287rpx;
+				padding:10rpx;
+			}
+		}
+		
+		.imgs {
+			overflow: hidden;
+			display: flex;
+			width:100%;
+			.img {
+				width: 104rpx;
+				height: 104rpx;
+				border-radius: 8rpx;
+				position:relative;
+				margin:20rpx;
+				
+				
+				text {
+					position:absolute;
+					right:-15rpx;
+					top:-15rpx;
+					width:30rpx;
+					height:30rpx;
+					text-align: center;
+					line-height: 30rpx;
+					color:#fff;
+					background:red;
+					border-radius:50%;
+				}
+				
+				image {
+					width:100%;
+					height:100%;
+				}
+			}
+		}
+	}
+	
+	.ans_submit {
+		padding:16rpx;
+		border-radius: 16rpx;
+		background:#fff;
+		
+		.imgs {
+			overflow: hidden;
+			display: flex;
+			width:100%;
+			.img {
+				width: 104rpx;
+				height: 104rpx;
+				border-radius: 8rpx;
+				position:relative;
+				margin:20rpx;
+				
+				image {
+					width:100%;
+					height:100%;
+				}
+			}
+		}
+	}
+}
+.firstLetter {
+	display: flex;
+	justify-content: space-between;
+	align-items: center;
+	margin-bottom: 30rpx;
+	.leftLetters {
+		display: flex;
+		align-items: center;
+		width: 220rpx;
+		.btnType {
+			padding: 5rpx 10rpx;
+			border: 1rpx solid #007aff;
+			border-radius: 10rpx;
+			background-color: rgba(0, 122, 255, 0.1);
+			font-size: 28rpx;
+			color: #007aff;
+			margin-right: 15rpx;
+		}
+	}
+}
+.popupView {
+	height: 100%;
+	padding-bottom: 100rpx;
+	.popupTops {
+		height: 77rpx;
+		border-bottom: 1rpx solid #eee;
+		text-align: center;
+		line-height: 77rpx;
+		font-size: 24rpx;
+		color: #999;
+		position: relative;
+		.topIcon {
+			position: absolute;
+			top: 10rpx;
+			left: 50%;
+			transform: translateX(-50%);
+			width: 80rpx;
+			height: 8rpx;
+			background-color: #999;
+			border-radius: 4rpx;
+		}
+	}
+	.popupContent {
+	}
+}
+.pageContent {
+	position:relative;
+	background-color: #eaeef1;
+	min-height: 100vh;
+	padding-top: 8rpx;
+	padding-bottom: 100rpx;
+}
+.pad_8 {
+	background-color: #fff;
+	margin: 0rpx 8rpx 8rpx;
+	border-radius: 16rpx;
+}
+.answer {
+	height: 80rpx;
+	line-height: 80rpx;
+	padding: 0rpx 24rpx;
+	display: flex;
+	align-items: center;
+	justify-content: space-between;
+	color: #666;
+	font-size: 30rpx;
+}
+.footer_btn {
+	background-color: #fff;
+	z-index: 10078;
+	position: absolute;
+	bottom: 0rpx;
+	display: flex;
+	align-items: center;
+	justify-content: space-between;
+	width: 100%;
+	height: 98rpx;
+	padding: 0rpx 38rpx;
+	border-top: 1rpx solid #eee;
+	
+	.collect {
+		visibility: hidden;
+		
+		&.show {
+			visibility: visible;
+		}
+	}
+}
+.boxSty {
+	padding: 44rpx 41rpx 0rpx;
+}
+.liListSty {
+	border:1rpx solid #EEEEEE;
+	width: 88rpx;
+	height: 88rpx;
+	border-radius: 32rpx;
+	text-align: center;
+	line-height: 88rpx;
+	color: #333;
+	font-size: 32rpx;
+	float: left;
+	margin: 20rpx 23rpx;
+	
+	&.isRight {
+		border:1rpx solid #EEEEEE;
+		color:#fff;
+		background: green;
+	}
+	
+	&.isWrong {
+		border:1rpx solid #EEEEEE;
+		color:#fff;
+		background: red;
+	}
+}
+.answerInfos {
+	padding: 25rpx 25rpx 25rpx 23rpx;
+}
+.answerTitle {
+	margin-bottom: 28rpx;
+	color: #666;
+	font-size: 30rpx;
+}
+.answerContent {
+	font-size: 30rpx;
+	color: #666;
+}
+
+.textChild {
+	display: inline-block;
+	vertical-align: middle;
+}
+
+.dialog {
+	position: fixed;
+	left:0;
+	top:0;
+	width:100%;
+	height:100%;
+	background-color: rgba(0,0,0,0.8);
+	display: flex;
+	flex-direction: column;
+	align-items: center;
+	justify-content: center;
+	z-index: 20000;
+	
+	.text {
+		font-size: 32rpx;
+		color: #FFFFFF;
+		text-align: center;
+	}
+	
+	.btn {
+		width: 242rpx;
+		height: 82rpx;
+		border: 2rpx solid #FFFFFF;
+		border-radius: 16rpx;
+		text-align: center;
+		line-height: 82rpx;
+		margin:41rpx auto;
+		color:#fff;
+		font-size: 32rpx;
+	}
+}
+</style>

+ 1141 - 0
pages2/subject/collectTypeBank.vue

@@ -0,0 +1,1141 @@
+<template>
+	<view id="questionBank">
+		<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="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>
+								</view>
+								<text>{{bankIndex+1}}/{{questionList.length}}</text>
+							</view>
+							<view style="color: #666;font-size: 28rpx;"></view>
+							<view class="leftLetters"></view>
+						</view>
+						<view class="titles">
+							<rich-text :nodes="bank.content"></rich-text>
+						</view>		
+					</view>
+					<view class="pad_8 titBox">
+						<template v-if="bank.type == 1">
+							<view v-if="!bank.ques">
+								<view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty" @click="radioSelect(item.optionsId,bankIndex)">
+									<view class="activeTI">{{ ast[index] }}</view>
+									<view class="flex_auto">{{ item.content }}</view>
+								</view>
+							</view>
+							<view v-if="bank.ques">
+								<view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty">
+									<text :class="{right:(item.optionsId == bank.ques) || (item.optionsId == bank.ans),wrong:(item.optionsId == bank.ques) && (bank.ques != bank.ans)}"  class="activeTI">{{ ast[index] }}</text>
+									<view class="flex_auto">{{ item.content }}</view>
+									
+								</view>
+							</view> 
+							<view v-if="bank.ques">
+								<view class="pad_8 answer">
+									<view>正确答案:{{ast[bank.ans-1]}}</view>
+									<view v-if="!explain">我的答案:{{ast[bank.ques-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>
+						</template>
+						
+						<template v-if="bank.type == 2">
+							<view v-if="!bank.ques">
+								<view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty" @click="checkboxSelect(item.optionsId,bankIndex,index)">
+									<view :class="{checked:item.checked}" class="activeTI">{{ ast[index] }}</view>
+									<view class="flex_auto">{{ item.content }}</view>
+								</view>
+							</view>
+							<view v-if="!bank.ques" class="submit_checkbox" @click="checkboxSubmit(bankIndex)">
+								确认答案
+							</view>
+							<view v-if="bank.ques">
+								<view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty">
+									<text :class="{right:(bank.ques.indexOf(item.optionsId) != -1 ) || (bank.ans.indexOf(item.optionsId) != -1),wrong:(bank.ques.indexOf(item.optionsId) != -1 ) && (bank.ans.indexOf(item.optionsId) == -1)}"  class="activeTI">{{ ast[index] }}</text>
+									<view class="flex_auto">{{ item.content }}</view>
+								</view>
+							</view> 
+							<view v-if="bank.ques">
+								<view class="pad_8 answer">
+									<view>正确答案:
+										<text v-for="ansItem in bank.ans">{{ast[ansItem-1]}}</text>
+									</view>
+									<view v-if="!explain">我的答案:
+										<text v-for="quesItem in bank.ques">{{ast[quesItem-1]}}</text>
+									</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 == 3">
+							<view v-if="!bank.ques">
+								<view v-for="(item, index) in judge" :key="index" class="lisSty" @click="judgeSelect(index,bankIndex)">
+									<view class="activeTI">{{ ast[index] }}</view>
+									{{ item }}
+								</view>
+							</view>
+							<view v-if="bank.ques">
+								<view v-for="(item, index) in judge" :key="index" class="lisSty">
+									<text :class="{right:(index == bank.ques) || (index == bank.ans),wrong:(index == bank.ques) && (bank.ques != bank.ans)}"  class="activeTI">{{ ast[index] }}</text>
+									{{ item }}
+								</view>
+							</view> 
+							<view v-if="bank.ques">
+								<view class="pad_8 answer">
+									<view>正确答案:{{ast[bank.ans]}}</view>
+									<view v-if="!explain">我的答案:{{ast[bank.ques]}}</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="!bank.ques">
+									<view class="top flex">
+										<image :data-index="bankIndex" class="icon" @click="chooseImg(bankIndex)" src="/static/08-10_032.jpg" mode=""></image>
+										<view class="progress">0/4</view>
+										<view class="submit"  @click="submitAns(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(imgIndex,bankIndex)">x</text>
+											<image :src="$method.splitImgHost(img, true)"></image>
+										</view>
+									</view>
+								</view>
+								<view class="ans_submit answerInfos" v-if="bank.ques && !explain">
+									<view class="answerTitle">答案我的</view>
+									{{bank.ques.text}}
+									<view class="imgs">
+										<image class="img" v-for="ques in bank.ques.imageList" :src="ques"></image>
+									</view>
+								</view>
+							</view>
+							<view v-if="bank.ques">
+								<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 == 4">
+							<view class="tabs">
+								<view class="tab" :class="{current:tabIndex == bank.current}" :key="tabIndex" v-for="(tab,tabIndex) in bank.jsonStr" @click="tabSelect(tabIndex,bankIndex)">问题{{tabIndex}}</view>
+							</view>
+							<view v-for="(ansItem,ansIndex) in bank.jsonStr" v-if="bank.current == ansIndex" :key="ansIndex">
+								<view class="titles">
+									<rich-text :nodes="ansItem.content"></rich-text>
+								</view>
+								<template v-if="ansItem.type == 1">
+									<view v-if="!bank.ques[ansIndex]">
+										<view v-for="(option, childIndex) in ansItem.optionsList" :key="childIndex" class="lisSty" @click="radioSelectChild(option.optionsId,ansIndex,bankIndex)">
+											<view class="activeTI">{{ ast[childIndex] }}</view>
+											<rich-text class="textChild" :nodes="option.content"></rich-text>
+										</view>
+									</view>
+									<view v-if="bank.ques[ansIndex]">
+										<view v-for="(option, childIndex) in ansItem.optionsList" :key="index" class="lisSty">
+											<text :class="{right:(option.optionsId == bank.ques[ansIndex]) || (option.optionsId == bank.ans[ansIndex]),wrong:(option.optionsId == bank.ques[ansIndex]) && (bank.ques[ansIndex] != bank.ans[ansIndex])}"  class="activeTI">{{ ast[childIndex] }}</text>
+											<rich-text :nodes="option.content"></rich-text>
+										</view>
+									</view> 
+									<view v-if="bank.ques[ansIndex]">
+										<view class="pad_8 answer">
+											<view>正确答案:{{ast[bank.ans[ansIndex]-1]}}</view>
+											<view v-if="!explain">我的答案:{{ast[bank.ques[ansIndex]-1]}}</view>
+										</view>
+										<view class="pad_8 answerInfos">
+											<view class="answerTitle">答案解析</view>
+											<view class="answerContent">
+												<rich-text :nodes="option.analysisContent"></rich-text>
+											</view>
+										</view>
+									</view>
+								</template>
+								
+								<template v-if="ansItem.type == 2">
+									<view v-if="!bank.ques[ansIndex]">
+										<view v-for="(option, childindex) in ansItem.optionsList" :key="childindex" class="lisSty" @click="checkboxSelectChild(bankIndex,ansIndex,childindex)">
+											<view :class="{checked:option.checked}" class="activeTI">{{ ast[childindex] }}</view>
+											<rich-text :nodes="option.content"></rich-text>
+										</view>
+									</view>
+									<view v-if="!bank.ques[ansIndex]" class="submit_checkbox" @click="checkboxSubmitChild(bankIndex,ansIndex)">
+										确认答案
+									</view>
+									<view v-if="bank.ques && bank.ques[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="bank.ques[ansIndex]">
+										<view class="pad_8 answer">
+											<view>正确答案:
+												<text v-for="ansItem1 in bank.ans[ansIndex]">{{ast[ansItem1-1]}}</text>
+											</view>
+											<view v-if="!explain">我的答案:
+												<text v-for="quesItem in bank.ques[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>
+								</template>
+								
+								<template v-if="ansItem.type == 3">
+									<view v-if="!bank.ques[ansIndex]">
+										<view v-for="(option, childindex) in judge" :key="childindex" class="lisSty" @click="judgeSelectChild(ansIndex,childindex,bankIndex)">
+											<view class="activeTI">{{ ast[childindex] }}</view>
+											{{ option }}
+										</view>
+									</view>
+									<view v-if="bank.ques[ansIndex]">
+										<view v-for="(option, childindex) in judge" :key="childindex" class="lisSty">
+											<text :class="{right:(childindex == bank.ques[ansIndex]) || (childindex == bank.ans[ansIndex]),wrong:(childindex == bank.ques[ansIndex]) && (bank.ques[ansIndex] != bank.ans[ansIndex])}"  class="activeTI">{{ ast[childindex] }}</text>
+											{{ option }}
+										</view>
+									</view> 
+									<view v-if="bank.ques[ansIndex]">
+										<view class="pad_8 answer">
+											<view>正确答案:{{ast[bank.ans[ansIndex]]}}</view>
+											<view v-if="!explain">我的答案:{{ast[bank.ques[ansIndex]]}}</view>
+										</view>
+										<view class="pad_8 answerInfos">
+											<view class="answerTitle">答案解析</view>
+											<view class="answerContent">
+												<rich-text :nodes="ansItem.analysisContent"></rich-text>
+											</view>
+										</view>
+									</view>
+								</template>
+								
+								
+								<!-- 简答题 -->
+								<template v-if="ansItem.type == 5">
+									<view class="ans">
+										<view class="ans_input" v-if="!bank.ques[ansIndex]">
+											<view class="top flex">
+												<image class="icon" @click="chooseImgChild(bankIndex,ansIndex)" src="/static/08-10_032.jpg" mode=""></image>
+												<view class="progress">0/4</view>
+												<view class="submit"  @click="submitAnsChild(bankIndex,ansIndex)">确认答案</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(imgIndex,bankIndex,ansIndex)">x</text>
+													<image :src="$method.splitImgHost(img, true)"></image>
+												</view>
+											</view>
+										</view>
+										<view class="ans_submit answerInfos" v-if="bank.ques[ansIndex] && !explain">
+											<view class="answerTitle">答案我的</view>
+											{{bank.ques[ansIndex].text}}
+											<view class="imgs">
+												<image class="img" v-for="ques in bank.ques[ansIndex].imageList" :src="ques"></image>
+											</view>
+										</view>
+									</view>
+									<view v-if="bank.ques[ansIndex]">
+										<view class="pad_8 answerInfos">
+											<view class="answerTitle">答案解析</view>
+											<view class="answerContent">
+												<rich-text :nodes="ansItem.analysisContent"></rich-text>
+											</view>
+										</view>
+									</view>
+								</template>
+								
+								
+							</view>
+						</template>
+						
+						
+					</view>
+					
+				
+					<view class="footer_btn">
+						<view @click="openFooterTab">答题卡</view>
+					</view>
+				</view>
+			</swiper-item>
+		</swiper>
+		
+		<u-popup v-model="show" mode="bottom" border-radius="14" height="680rpx">
+			<view class="popupView">
+				<view class="popupTops">
+					<view class="topIcon"></view>
+					点击编号即可跳转至对应题目
+				</view>
+				<view class="popupContent">
+					<scroll-view scroll-y="true" style="height: 506rpx;">
+						<view class="boxSty">
+							<view v-for="(item, index) in questionList" :key="index" @click="changeIndex(index)" :class="{isRight:isRight(item,index),isWrong:isWrong(item,index)}" class="liListSty">{{ index + 1 }}</view>
+						</view>
+					</scroll-view>
+				</view>
+			</view>
+		</u-popup>
+		
+		<view class="dialog" v-if="showDialog">
+			<view class="text">左右滑动切换上下题</view>
+			<view class="btn" @click="hideDialog">我知道了</view>
+		</view>
+	</view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			current:0,
+			questionList:[],
+			ast: ['A', 'B', 'C', 'D','E','F','G'],
+			judge:['错误','正确'],
+			show: false,
+			showDialog:true,
+			bankList: [],
+			collectList:[],
+			type:'',
+			explain:''
+		};
+	},
+	onLoad(option){
+		this.type = option.type;
+		this.explain = option.explain;
+		this.goodsCollectList();
+	},
+	onUnload() {
+		
+	},
+	methods: {
+		
+		goodsCollectList() {
+			this.$api.goodsCollectList({
+				type:this.type
+			}).then(res => {
+				
+				res.data.rows.forEach((item,index) => { 
+					if(typeof item.jsonStr == 'string') {
+						item.jsonStr = JSON.parse(item.jsonStr)
+						
+						if(item.type == 2) { //多选
+							item.jsonStr.forEach(str => {
+								str.optionsId = ''+str.optionsId;
+							})
+							let arr = item.answerQuestion.split(',');
+							arr.forEach((a,i) => {
+								arr[i] = ''+a;
+							})
+							item.ans = arr;
+							if(this.explain) {
+								item.ques = item.ans;
+							}
+							return;
+						} else if(item.type == 5) {
+							item.ansText = {
+								text: '',
+								imageList: []
+							}
+							
+							if(this.explain) {
+								item.ques = {
+									text:item.analysisContent
+								}
+								
+								return;
+							}
+							
+							
+						} else if(item.type == 4) {
+							console.log(item.jsonStr)
+							item.ques = []
+							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: []
+									}
+								}
+							})
+							
+							item.ans = ansArr
+							if(this.explain) {
+								item.ques = item.ans;
+							}
+							return;
+							
+						}
+						
+						item.ans = item.answerQuestion
+						if(this.explain) {
+							item.ques = item.ans;
+						}
+					} else {
+						if(this.explain) {
+							item.ques = item.ans;
+						}
+					}
+					
+				})
+				
+				this.questionList = res.data.rows;
+				
+			})
+		},
+		/**
+		 * @param {Object} e单选点击
+		 */
+		radioSelect(optionsId,bindex) {
+			if(this.questionList[bindex].ques) return;
+			this.$set(this.questionList[bindex],'ques',optionsId)
+			
+		},
+		
+		/**
+		 * @param {Object} e单选点击
+		 */
+		radioSelectChild(optionsId,ansIndex,bindex) {
+			if(this.questionList[bindex].ques[ansIndex]) return;
+			this.$set(this.questionList[bindex].ques,ansIndex,optionsId)
+			
+		},
+		
+		
+		/**
+		 * @param {Object} 多选点击
+		 */
+		checkboxSelect(optionsId,bindex,index) {
+			
+			this.$set(this.questionList[bindex].jsonStr[index],'checked',!this.questionList[bindex].jsonStr[index].checked)
+		},
+		
+		/**
+		 * @param {Object} 多选点击
+		 */
+		checkboxSelectChild(bindex,ansIndex,childIndex) {
+			
+			this.$set(this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex],'checked',!this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex].checked)
+		},
+		
+		/**
+		 * @param {Object} 多选确认
+		 */
+		checkboxSubmit(bindex) {
+			
+			if(this.questionList[bindex].ques) return;
+			let arr = [];
+			this.questionList[bindex].jsonStr.forEach(item => {
+				if(item.checked) {
+					arr.push(item.optionsId)
+				}
+			})
+			
+			this.$set(this.questionList[bindex],'ques',arr)
+			
+		},
+		
+		/**
+		 * @param {Object} 多选确认
+		 */
+		checkboxSubmitChild(bindex,ansIndex) {
+			
+			if(this.questionList[bindex].ques[ansIndex]) return;
+			let arr = [];
+			this.questionList[bindex].jsonStr[ansIndex].optionsList.forEach(item => {
+				if(item.checked) {
+					arr.push(item.optionsId)
+				}
+			})
+			
+			this.$set(this.questionList[bindex].ques,ansIndex,arr)
+		},
+		
+		judgeSelect(index,bindex) {
+			if(this.questionList[bindex].ques) return;
+			this.$set(this.questionList[bindex],'ques',index+'')
+			
+		},
+		
+		judgeSelectChild(ansindex,childindex,bindex) {
+			if(this.questionList[bindex].ques[ansindex]) return;
+			this.$set(this.questionList[bindex].ques,ansindex,childindex+'')
+		},
+		
+		openFooterTab() {
+			this.show = true;
+		},
+		hideDialog() {
+			this.showDialog = false
+		},
+		changeIndex(index) {
+			this.current = index
+		},
+		
+		swiperChange(e) {
+			this.current = e.detail.current;
+		},
+		
+		
+		deleteImg(imgIndex,bankIndex) {
+			
+			
+			this.questionList[bankIndex].ansText.imageList.splice(imgIndex,1)
+		},
+		
+		
+		deleteImgChild(imgIndex,bankIndex,ansIndex) {
+			
+			
+			this.questionList[bankIndex].jsonStr[ansIndex].ansText.imageList.splice(imgIndex,1)
+		},
+		
+		chooseImg(bankindex) {
+			uni.chooseImage({
+				count: 1, //默认9
+				sizeType: ['compressed', ], //可以指定是原图还是压缩图,默认二者都有
+				sourceType: ['album','camera'], //从相册选择
+				success: (res) => {
+					let self = this;
+					// console.log(JSON.stringify(res.tempFilePaths));
+					let img = res.tempFilePaths[0];
+					uni.getImageInfo({
+						src: img,
+						success: async res => {
+							let canvasWidth = res.width; //图片原始长宽
+							let canvasHeight = res.height;
+							if (canvasWidth > 1000 || canvasHeight > 1000) {
+								uni.compressImage({
+									src: img,
+									quality: 75,
+									width: '50%',
+									height: '50%',
+									success: async rest => {
+										const dir = await self.uploadFile(rest.tempFilePath, 0);
+										this.questionList[bankindex].ansText.imageList.push(dir)
+									} 
+								});
+							} else {
+								const dir = await self.uploadFile(img, 0);
+								this.questionList[bankindex].ansText.imageList.push(dir)
+							}
+						}
+					});
+				}
+			})
+		},
+		
+		chooseImgChild(bankindex,ansindex) {
+			uni.chooseImage({
+				count: 1, //默认9
+				sizeType: ['compressed', ], //可以指定是原图还是压缩图,默认二者都有
+				sourceType: ['album','camera'], //从相册选择
+				success: (res) => {
+					let self = this;
+					// console.log(JSON.stringify(res.tempFilePaths));
+					let img = res.tempFilePaths[0];
+					uni.getImageInfo({
+						src: img,
+						success: async res => {
+							let canvasWidth = res.width; //图片原始长宽
+							let canvasHeight = res.height;
+							if (canvasWidth > 1000 || canvasHeight > 1000) {
+								uni.compressImage({
+									src: img,
+									quality: 75,
+									width: '50%',
+									height: '50%',
+									success: async rest => {
+										const dir = await self.uploadFile(rest.tempFilePath, 0);
+										this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.push(dir)
+									} 
+								});
+							} else {
+								const dir = await self.uploadFile(img, 0);
+								this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.push(dir)
+							}
+						}
+					});
+				}
+			})
+		},
+		
+		uploadFile(options, int) {
+			var self = this;
+			return new Promise((resolve, reject) => {
+				var data = {
+					imageStatus: int
+				};
+				self.$api.aliyunpolicy(data).then(res => {
+					console.log(res.data,6)
+					if(res.data.code!=200){
+						self.$method.showToast('签名错误'+JSON.stringify(res.data))
+						return
+					}
+					var ossToken = res.data.data.resultContent;
+					if(ossToken.host==null||ossToken.host==undefined){
+						self.$method.showToast('上传路径报错'+JSON.stringify(res.data))
+						return
+					}
+					uni.uploadFile({
+						url: ossToken.host,
+						name: 'file',
+						filePath: options,
+						fileType: 'image',
+						header: {
+							AuthorizationToken: 'WX ' + uni.getStorageSync('token')
+						},
+						formData: {
+							key: ossToken.dir,
+							OSSAccessKeyId: ossToken.accessid,
+							policy: ossToken.policy,
+							Signature: ossToken.signature,
+							callback: ossToken.callback,
+							success_action_status: 200
+						},
+						success: result => {
+							if (result.statusCode === 200) {
+								resolve(ossToken.dir);
+							} else {
+								uni.showToast({
+									title: '上传失败',
+									icon: 'none'
+								});
+								return;
+							}
+						},
+						fail: error => {
+							uni.showToast({
+								title: '上传接口报错'+error,
+								icon: 'none'
+							});
+							return;
+						}
+					});
+				});
+			});
+		},
+		submitAns(type,bankindex) {
+				
+			console.log(this.questionList[bankindex])
+			if(!this.questionList[bankindex].ansText.text && !this.questionList[bankindex].ansText.imageList.length) {
+				uni.showToast({
+					title: '请输入内容或上传图片',
+					duration: 2000,
+					icon:'none'
+				});
+				return
+			}
+			
+			this.$set(this.ques,bankindex,{
+				imageList:this.questionList[bankindex].ansText.imageList,
+				text:this.questionList[bankindex].ansText.text,
+			})
+			
+		},
+		
+		submitAnsChild(bankindex,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.questionList[bankindex].ques,ansindex,{
+				imageList:this.questionList[bankindex].jsonStr[ansindex].ansText.imageList,
+				text:this.questionList[bankindex].jsonStr[ansindex].ansText.text,
+			})
+			
+		},
+		
+		isRight(item,index) {
+			//单选
+			if(this.questionList[index].ques) {
+				if(item.type == 1) {
+					return this.questionList[index].ques == this.questionList[index].ans;
+				//多选
+				} else if(item.type == 2) {
+					//每一项都相等
+					return this.questionList[index].ques.every((item,index) => {
+						return item == this.questionList[index].ans;
+					})
+				//判断
+				} else if(item.type == 3) {
+					return this.questionList[index].ques == this.questionList[index].ans;
+				} else {
+					return false;
+				}
+			} else {
+				return false;
+			}
+			
+		},
+		
+		
+		right(bankIndex,ansIndex,option) {
+			if(this.questionList[bankIndex].ques[ansIndex] && this.questionList[bankIndex].ans[ansIndex]) {
+				
+				if((this.questionList[bankIndex].ques[ansIndex].indexOf(option.optionsId) != -1 ) || (this.questionList[bankIndex].ans[ansIndex].indexOf(option.optionsId) != -1)) {
+					return true
+				} else {
+					return false;
+				}
+			} else {
+				return false;
+			}
+			
+		},
+		
+		wrong(bankIndex,ansIndex,option) {
+			if(this.questionList[bankIndex].ques[ansIndex] && this.questionList[bankIndex].ans[ansIndex]) {
+				
+				if((this.questionList[bankIndex].ques[ansIndex].indexOf(option.optionsId) != -1 ) && (this.questionList[bankIndex].ans[ansIndex].indexOf(option.optionsId) == -1)) {
+					return true;
+				} else {
+					return false;
+				}
+			} else {
+				return false;
+			}
+		},
+		
+		isWrong(item,index) {
+			if(this.questionList[index].ques) {
+				//单选
+				if(item.type == 1) {
+					return this.questionList[index].ques != this.questionList[index].ans;
+				//多选
+				} else if(item.type == 2) {
+					//每一项都相等
+					return this.questionList[index].ques.some((item,index) => {
+						return item != this.questionList[index].ans;
+					})
+				//判断
+				} else if(item.type == 3) {
+					return this.questionList[index].ques != this.questionList[index].ans;
+				} else {
+					return false;
+				}
+			} else {
+				return false;
+			}
+			
+		},
+		
+		tabSelect(index,bankindex) {
+			
+			this.$set(this.questionList[bankindex],'current',index)
+			
+		},
+	}
+};
+</script>
+
+<style lang="scss" scoped>
+.swiper {
+	width:100%;
+	height:100vh;
+}
+.lisSty {
+	margin-bottom: 16rpx;
+	display: flex;
+	
+	.flex_auto {
+		flex:1;
+	}
+}
+.activeTI {
+	vertical-align: middle;
+	display: inline-block;
+	border: 1rpx solid #eee;
+	border-radius: 50rpx;
+	height: 48rpx;
+	line-height: 46rpx;
+	text-align: center;
+	width: 48rpx;
+	margin-right: 15rpx;
+	color: #666;
+	font-size: 30rpx;
+	
+	
+	&.right {
+		color:#fff;
+		background:green;
+	}
+	
+	&.wrong {
+		color:#fff;
+		background:red;
+	}
+	
+	&.checked {
+		color:#fff;
+		background:blue;
+	}
+}
+
+.submit_checkbox {
+	margin:20rpx auto;
+	width: 526rpx;
+	height: 80rpx;
+	background: rgba(0, 122, 255, 1);
+	color:#fff;
+	text-align: center;
+	line-height: 80rpx;
+	font-size: 30rpx;
+	border-radius: 40rpx;
+}
+.titles {
+	overflow: hidden;
+	margin-bottom: 24rpx;
+}
+.titBox {
+	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;
+	
+	.ans_input {
+	    border-radius: 16rpx;
+		background:#fff;
+		.top {
+			border-bottom:1rpx solid #EEEEEE;
+			padding: 16rpx;
+			display: flex;
+			align-items: center;
+			
+			.icon {
+				margin-right:20rpx;
+				width: 40rpx;
+				height: 38rpx;
+			}
+			
+			.progress {
+				flex:1;
+			}
+			
+			.submit {
+				width: 168rpx;
+				height: 48rpx;
+				line-height: 48rpx;
+				text-align: center;
+				color:#fff;
+				font-size: 30rpx;
+				background: #007AFF;
+				border-radius: 24rpx;
+			}
+		}
+		
+		.textarea {
+			textarea {
+				width:100%;
+				height:287rpx;
+				padding:10rpx;
+			}
+		}
+		
+		.imgs {
+			overflow: hidden;
+			display: flex;
+			width:100%;
+			.img {
+				width: 104rpx;
+				height: 104rpx;
+				border-radius: 8rpx;
+				position:relative;
+				margin:20rpx;
+				
+				
+				text {
+					position:absolute;
+					right:-15rpx;
+					top:-15rpx;
+					width:30rpx;
+					height:30rpx;
+					text-align: center;
+					line-height: 30rpx;
+					color:#fff;
+					background:red;
+					border-radius:50%;
+				}
+				
+				image {
+					width:100%;
+					height:100%;
+				}
+			}
+		}
+	}
+	
+	.ans_submit {
+		padding:16rpx;
+		border-radius: 16rpx;
+		background:#fff;
+		
+		.imgs {
+			overflow: hidden;
+			display: flex;
+			width:100%;
+			.img {
+				width: 104rpx;
+				height: 104rpx;
+				border-radius: 8rpx;
+				position:relative;
+				margin:20rpx;
+				
+				image {
+					width:100%;
+					height:100%;
+				}
+			}
+		}
+	}
+}
+.firstLetter {
+	display: flex;
+	justify-content: space-between;
+	align-items: center;
+	margin-bottom: 30rpx;
+	.leftLetters {
+		display: flex;
+		align-items: center;
+		width: 220rpx;
+		.btnType {
+			padding: 5rpx 10rpx;
+			border: 1rpx solid #007aff;
+			border-radius: 10rpx;
+			background-color: rgba(0, 122, 255, 0.1);
+			font-size: 28rpx;
+			color: #007aff;
+			margin-right: 15rpx;
+		}
+	}
+}
+.popupView {
+	height: 100%;
+	padding-bottom: 100rpx;
+	.popupTops {
+		height: 77rpx;
+		border-bottom: 1rpx solid #eee;
+		text-align: center;
+		line-height: 77rpx;
+		font-size: 24rpx;
+		color: #999;
+		position: relative;
+		.topIcon {
+			position: absolute;
+			top: 10rpx;
+			left: 50%;
+			transform: translateX(-50%);
+			width: 80rpx;
+			height: 8rpx;
+			background-color: #999;
+			border-radius: 4rpx;
+		}
+	}
+	.popupContent {
+	}
+}
+.pageContent {
+	position:relative;
+	background-color: #eaeef1;
+	min-height: 100vh;
+	padding-top: 8rpx;
+	padding-bottom: 100rpx;
+}
+.pad_8 {
+	background-color: #fff;
+	margin: 0rpx 8rpx 8rpx;
+	border-radius: 16rpx;
+}
+.answer {
+	height: 80rpx;
+	line-height: 80rpx;
+	padding: 0rpx 24rpx;
+	display: flex;
+	align-items: center;
+	justify-content: space-between;
+	color: #666;
+	font-size: 30rpx;
+}
+.footer_btn {
+	background-color: #fff;
+	z-index: 10078;
+	position: absolute;
+	bottom: 0rpx;
+	display: flex;
+	align-items: center;
+	justify-content: space-between;
+	width: 100%;
+	height: 98rpx;
+	padding: 0rpx 38rpx;
+	border-top: 1rpx solid #eee;
+	
+	.collect {
+		visibility: hidden;
+		
+		&.show {
+			visibility: visible;
+		}
+	}
+}
+.boxSty {
+	padding: 44rpx 41rpx 0rpx;
+}
+.liListSty {
+	border:1rpx solid #EEEEEE;
+	width: 88rpx;
+	height: 88rpx;
+	border-radius: 32rpx;
+	text-align: center;
+	line-height: 88rpx;
+	color: #333;
+	font-size: 32rpx;
+	float: left;
+	margin: 20rpx 23rpx;
+	
+	&.isRight {
+		border:1rpx solid #EEEEEE;
+		color:#fff;
+		background: green;
+	}
+	
+	&.isWrong {
+		border:1rpx solid #EEEEEE;
+		color:#fff;
+		background: red;
+	}
+}
+.answerInfos {
+	padding: 25rpx 25rpx 25rpx 23rpx;
+}
+.answerTitle {
+	margin-bottom: 28rpx;
+	color: #666;
+	font-size: 30rpx;
+}
+.answerContent {
+	font-size: 30rpx;
+	color: #666;
+}
+
+.textChild {
+	display: inline-block;
+	vertical-align: middle;
+}
+
+.dialog {
+	position: fixed;
+	left:0;
+	top:0;
+	width:100%;
+	height:100%;
+	background-color: rgba(0,0,0,0.8);
+	display: flex;
+	flex-direction: column;
+	align-items: center;
+	justify-content: center;
+	z-index: 20000;
+	
+	.text {
+		font-size: 32rpx;
+		color: #FFFFFF;
+		text-align: center;
+	}
+	
+	.btn {
+		width: 242rpx;
+		height: 82rpx;
+		border: 2rpx solid #FFFFFF;
+		border-radius: 16rpx;
+		text-align: center;
+		line-height: 82rpx;
+		margin:41rpx auto;
+		color:#fff;
+		font-size: 32rpx;
+	}
+}
+</style>

+ 116 - 38
pages2/subject/wrong.vue

@@ -8,32 +8,61 @@
 			<view class="sceenModelBg" @click="hideSceen"></view>
 			<view class="sceenMain">
 				<template v-if="sceenType===1">
-					<view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList1" :key="index" @click="choSceen(index,'tk')">{{item.name}}</view>
+					<view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList1" :key="index" @click="choseRecord(index)">{{item.goodsName}}</view>
 				</template>
 				<template v-if="sceenType===2">
-					<view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList2" :key="index" @click="choSceen(index,'sj')">{{item.name}}</view>
+					<view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList2" :key="index" @click="choseType(index)">{{item.paperName}}</view>
 				</template>
 			</view>
 		</view>
 		<view class="wrap">
+			<view class="wrongTab">
+				<view class="item" :class="{active:type == 1}" @click="selectType(1)">试卷归类</view>
+				<view class="item" :class="{active:type == 2}" @click="selectType(2)">题型归类</view>
+			</view>
 			<view class="wrongHead">
 				<view class="title">错题统计<text class="sub">(不含简答和案例题)</text></view>
 				<view class="progress">
-					
+					<text v-if="type == 1">{{testList.total}}</text>
+					<text v-if="type == 2">{{typeList.total}}</text>
+				</view>
+			</view> 
+			<view class="wrongList" v-if="type == 1">
+				<view class="item" v-for="(item,index) in testList.rows" :key="index">
+					<view class="title">{{item.examName}}</view>
+					<view class="bt">
+						<view class="left">错题数<text class="num">{{item.wrongQuestionNum}}</text></view>
+						<view class="right">
+							<navigator :url="'/pages2/subject/collectBank?id='+item.examId">
+								<view class="btn">重做</view>
+							</navigator>
+							<navigator :url="'/pages2/subject/collectBank?id='+item.examId+'&explain=1'">
+								<view class="btn">解析</view>
+							</navigator>
+							<!-- <view class="btn">解析</view> -->
+						</view>
+					</view>
 				</view>
 			</view>
-			<view class="wrongTab">
-				<view class="item active">试卷归类</view>
-				<view class="item">题型归类</view>
-			</view>
-			<view class="wrongList">
-				<view class="item" v-for="(item,index) in 5" :key="index">
-					<view class="title">试卷名称可换行我也不知道最多多少个字总之可以换行就对了</view>
+			
+			<view class="wrongList" v-if="type == 2">
+				<view class="item" v-for="(item,index) in typeList.rows" :key="index">
+					<view class="title">
+						<text v-if="item.type==1">单选题</text>
+						<text v-if="item.type==2">多选题</text>
+						<text v-if="item.type==3">判断题</text>
+						<text v-if="item.type==4">案例题</text>
+						<text v-if="item.type==5">简答题</text>
+					</view>
 					<view class="bt">
-						<view class="left">错题数<text class="num">23</text></view>
+						<view class="left">错题数<text class="num">{{item.num}}</text></view>
 						<view class="right">
-							<view class="btn">重做</view>
-							<view class="btn">解析</view>
+							<navigator :url="'/pages2/subject/collectQuestionTypeBank?type='+item.type">
+								<view class="btn">重做</view>
+							</navigator>
+							<navigator :url="'/pages2/subject/collectQuestionTypeBank?type='+item.type+'&explain=1'">
+								<view class="btn">解析</view>
+							</navigator>
 						</view>
 					</view>
 				</view>
@@ -50,51 +79,96 @@ export default {
 		return {
 			sceenType: null,
 			scennList1:[
-				{id: 1, name: '全部题库记录', checked: true},{id: 1, name: '试卷名称可换行并完整显示'},{id: 1, name: '试卷名称可换行并完整显示'},{id: 1, name: '试卷名称可换行并完整显示'}
+				{goodsId: '', goodsName: '全部题库记录', checked: true}
 			],
 			scennList2:[
-				{id: 1, name: '全部试卷类型', checked: true},{id: 1, name: '模拟卷'},{id: 1, name: '真题'},{id: 1, name: '练习'}
+				{paperId: '', paperName: '全部试卷类型', checked: true}
 			],
+			type:1,
+			testList:[],
+			typeList:[],
+			goodsid:'',
+			paperid:''
 		};
 	},
 	onPullDownRefresh() {},
 	onLoad(option) {
-		this.questionRecordList();
+		this.listGoodsUserQuestion();
+		this.examaperList();
+		this.getData();
 	},
 	methods: {
-		questionRecordList() {
-			this.$api.questionRecordList({
-				isRight:0,
+		getData() {
+			if(this.type == 1) {
+				this.wrongRecordList()
+			} else if(this.type == 2) {
+				this.wrongRecordTypeList();
+			}
+		},
+		examaperList() {
+			this.$api.examaperList({
+				
+			}).then(res => {
+				this.scennList2 = [...this.scennList2,...res.data.rows];
+			})
+		},
+		
+		listGoodsUserQuestion() {
+			this.$api.listGoodsUserQuestion({
 				
 			}).then(res => {
-				console.log(res)
+				this.scennList1 = [...this.scennList1,...res.data.rows];
+			})
+		},
+		wrongRecordList() {
+			this.$api.wrongRecordList({
+				paperId:this.paperid,
+				goodsId:this.goodsid
+			}).then(res => {
+				this.testList = res.data;
+			})
+		},
+		wrongRecordTypeList() {
+			this.$api.wrongRecordTypeList({
+				paperId:this.paperid,
+				goodsId:this.goodsid
+			}).then(res => {
+				this.typeList = res.data;
 			})
 		},
+		selectType(type) {
+			this.type = type;
+			this.getData();
+		},
 		showSceen(type){
 			this.sceenType = type
 		},
 		hideSceen(){
 			this.sceenType = null
 		},
-		choSceen(index,type){
-			if(type==='tk'){
-				this.scennList1.forEach((item,idx)=>{
-					this.$set(item, 'checked',false)
-					if(index===idx){
-						this.$set(item, 'checked',true)
-					}
-				})
-			}
-			if(type==='sj'){
-				this.scennList2.forEach((item,idx)=>{
-					this.$set(item, 'checked',false)
-					if(index===idx){
-						this.$set(item, 'checked',true)
-					}
-				})
-			}
+		choseRecord(index) {
 			this.sceenType = null
-		}
+			this.scennList1.forEach((item,idx)=>{
+				this.$set(item, 'checked',false)
+				if(index==idx){
+					this.goodsid = item.goodsId
+					this.$set(item, 'checked',true)
+				}
+			})
+			
+			this.getData()
+		},
+		choseType(index) {
+			this.sceenType = null
+			this.scennList2.forEach((item,idx)=>{
+				this.$set(item, 'checked',false)
+				if(index==idx){
+					this.paperid = item.paperId
+					this.$set(item, 'checked',true)
+				}
+			})
+			this.getData()
+		},
 	}
 };
 </script>
@@ -194,9 +268,12 @@ page {
 	.progress{
 		width: 180rpx;
 		height: 180rpx;
+		line-height: 140rpx;
 		border: 20rpx solid #EEEEEE;
 		border-radius: 50%;
 		margin: 24rpx auto;
+		font-size: 50rpx;
+		text-align: center;
 	}
 }
 .wrongTab{
@@ -221,6 +298,7 @@ page {
 	}
 }
 .wrongList{
+	margin-top:20rpx;
 	.item{;
 		background: #FFFFFF;
 		border-radius: 16rpx;

+ 4 - 4
pages2/wd/class.vue

@@ -7,7 +7,7 @@
 				<view class=".content_box">
 					<image src="/static/icon/wk_icon1.png" class="wk_icon"></image>
-					<text class="content">{{item.courseNum}}</text>
+					<text class="content">{{ item.courseNum }}</text>
 					<text class="content">{{ item.secAllNum }}</text>
@@ -27,7 +27,7 @@
 				</view>
 				<view class="box_progress">
 					<view style="width: 60%;"><u-line-progress :showText="false" active-color="#ff9900" :percent="(item.stuAllNum / item.secAllNum) * 100"></u-line-progress></view>
-					<view><u-button type="warning" size="mini" @click.stop="studyIn">进入学习</u-button></view>
+					<view><u-button type="warning" size="mini" @click.stop="studyIn(item.goodsId)">进入学习</u-button></view>
 				</view>
 				<view class="box_progress" v-if="item.applyStatus === 1">
 					<view style="width: 60%;">
@@ -67,8 +67,8 @@ export default {
 				}
 			});
 		},
-		studyIn() {
-			this.$navTo.togo('/pages2/verify/input');
+		studyIn(v) {
+			this.$navTo.togo('/pages2/wd/course?id=' + v);
 		},
 		appointment(item) {
 			var data = {

+ 12 - 5
pages2/wd/course.vue

@@ -1,6 +1,6 @@
 <template>
 	<view style="padding: 30rpx;">
-		<navigator :url="'/pages2/class/detail?id='+item.courseId" v-for="(item, index) in courseList" :key="index" style="margin-bottom: 30rpx;">
+		<view @click="jump(item)"  v-for="(item, index) in courseList" :key="index" style="margin-bottom: 30rpx;">
 			<view class="class_item">
 				<image :src="$method.splitImgHost(item.coverUrl, true)" style="height: 316rpx;width: 100%;border-radius: 24rpx;"></image>
 				<view style="color: #333333;font-weight: bold;font-size: 32rpx;">
@@ -23,7 +23,7 @@
 				
 			</view>
 			
-		</navigator>
+		</view>
 	</view>
 </template>
 
@@ -38,12 +38,18 @@
 		},
 		onLoad(option) {
 			this.goodsId = option.id
-			 this.courseCourseList()
+			uni.setStorageSync('courseGoodsId', this.goodsId);
+			this.courseCourseList()
 		},
 		onShow(){
 			
 		},
 		methods: {
+			jump(item){
+				this.$navTo.togo('/pages2/class/detail', {
+					id: item.courseId
+				});
+			},
 			courseCourseList() {
 				let self = this
 				this.$api.courseCourseList({goodsId:this.goodsId}).then(res => {
@@ -53,9 +59,10 @@
 				});
 			},
 			studyIn(item){
-				this.$navTo.togo('/pages2/course/detail',{
-					id:item.courseId
+				this.$navTo.togo('/pages2/class/detail', {
+					id: item.courseId
 				});
+				// this.$navTo.togo('/pages2/verify/input');
 			},
 			appointment(){
 				this.$navTo.togo('/pages2/appointment/index');

+ 6 - 4
pages2/wd/question_bank.vue

@@ -9,10 +9,12 @@
 			</view>
 		</navigator>
 		<view class="bottom">
-			<view class="item collect">
-				<view class="text">收藏集></view>
-				<image class="img" src="/static/sc.png"></image>
-			</view>
+			<navigator url="/pages2/subject/collect">
+				<view class="item collect">
+					<view class="text">收藏集></view>
+					<image class="img" src="/static/sc.png"></image>
+				</view>
+			</navigator>
 			<view class="item list">
 				<navigator url="/pages2/bank/question_record">
 					<view class="list-in">

BIN
static/zhezhao@2x.png


+ 42 - 35
store/index.js

@@ -2,63 +2,70 @@ import Vue from 'vue'
 import Vuex from 'vuex'
 import api from '@/common/api.js'
 Vue.use(Vuex);
-const store = new Vuex.Store({  
-    state: {  
-        login: true,  
-        token: '',  
-        avatarUrl: '',  
-        userName: '',
-		userInfo:null,
-		dictObj:null,
-		allowLoading:true,
-		goodsAuditionConfigIdList:[], //当前访问页面的试听节ID
-		shoppingCartList:[],  //购物车支付商品
-		applyData:{},//预约考试数据存放
-	},  
-	 getters: {
+const store = new Vuex.Store({
+	state: {
+		login: true,
+		token: '',
+		avatarUrl: '',
+		userName: '',
+		userInfo: null,
+		dictObj: null,
+		allowLoading: true,
+		goodsAuditionConfigIdList: [], //当前访问页面的试听节ID
+		shoppingCartList: [], //购物车支付商品
+		applyData: {}, //预约考试数据存放
+		playSectionId: 0
+	},
+	getters: {
 		userInfo: state => {
-			if(state.userInfo==null){
-				if(uni.getStorageSync('user_account')){
+			if (state.userInfo == null) {
+				if (uni.getStorageSync('user_account')) {
 					getUserInfo(state)
 				}
 			}
 			return state.userInfo
 		},
-		dictObj:state => {
+		dictObj: state => {
 			return state.dictObj
 		},
-		allowLoading:state => {
+		allowLoading: state => {
 			return state.allowLoading
 		},
-		goodsAuditionConfigIdList:state => {
+		goodsAuditionConfigIdList: state => {
 			return state.goodsAuditionConfigIdList
 		},
-		shoppingCartList:state => {
+		shoppingCartList: state => {
 			return state.shoppingCartList
 		},
-		getApplyData:state => {
+		getApplyData: state => {
 			return state.applyData
+		},
+		playSectionId: state => {
+			return state.playSectionId
 		}
 	},
-    mutations: { 
+	mutations: {
 		updateApplyData(state, arrays) {
-		    state.applyData = arrays;  
+			state.applyData = arrays;
+		},
+		updateUserInfo(state, provider) {
+			state.userInfo = provider.userInfo;
 		},
-        updateUserInfo(state, provider) {
-            state.userInfo = provider.userInfo;  
-        },
-		setGoodsAuditionConfigIdList(state, provider){
-			state.goodsAuditionConfigIdList = provider.goodsAuditionConfigIdList;  
+		setGoodsAuditionConfigIdList(state, provider) {
+			state.goodsAuditionConfigIdList = provider.goodsAuditionConfigIdList;
 		},
-		setShoppingCartList(state, provider){
-			state.shoppingCartList = provider.shoppingCartList;  
+		setShoppingCartList(state, provider) {
+			state.shoppingCartList = provider.shoppingCartList;
 		},
-    }  
-})  
-async function getUserInfo(state){
+		setPlaySectionId(state, provider) {
+			state.playSectionId = provider.playSectionId;
+		},
+	}
+})
+async function getUserInfo(state) {
 	const resdata = await api.getInfo()
-	if(resdata.data.code == 200){
+	if (resdata.data.code == 200) {
 		state.userInfo = resdata.data.data;
 	}
 }
-export default store
+export default store

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác