Tang hace 4 años
padre
commit
aad2f436fc
Se han modificado 5 ficheros con 346 adiciones y 225 borrados
  1. 1 2
      components/home.vue
  2. 0 3
      components/my.vue
  3. 208 205
      pages.json
  4. 112 7
      pages2/bank/question.vue
  5. 25 8
      pages2/wd/info.vue

+ 1 - 2
components/home.vue

@@ -284,8 +284,7 @@ export default {
 				 
 			});
 		},
-		getMonDate()
-		{
+		getMonDate(){
 			var d=new Date(),
 			day=d.getDay(),
 			date=d.getDate();

+ 0 - 3
components/my.vue

@@ -128,9 +128,6 @@ export default {
 			levelList: ['初出茅庐','崭露头角','自成一派','小有名气','惊艳四座','初露锋芒'],
 			userLevelList: []
 		};
-	},
-	mounted() {
-		
 	},
 	methods: {
 		getLevel(){

+ 208 - 205
pages.json

@@ -36,231 +36,234 @@
 	"subPackages": [{
 		"root": "pages2",
 		"pages": [{
-			"path": "plan/detail",
-			"style": {
-				"navigationBarTitleText": "学习计划",
-				"app-plus": {
-					"titleNView": false, //禁用原生导航栏 
-					"bounce": "none"
+				"path": "plan/detail",
+				"style": {
+					"navigationBarTitleText": "学习计划",
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
 				}
-			}
-		}, 
-		{
-			"path": "plan/create",
-			"style": {
-				"navigationBarTitleText": "创建计划",
-				"app-plus": {
-					"titleNView": false, //禁用原生导航栏 
-					"bounce": "none"
+			},
+			{
+				"path": "plan/create",
+				"style": {
+					"navigationBarTitleText": "创建计划",
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
 				}
-			}
-		},{
-			"path": "index/search",
-			"style": {
-				"navigationBarTitleText": "搜索",
-				"app-plus": {
-					"titleNView": false, //禁用原生导航栏 
-					"bounce": "none"
+			}, {
+				"path": "index/search",
+				"style": {
+					"navigationBarTitleText": "搜索",
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
 				}
-			}
-		}, {
-			"path": "course/detail",
-			"style": {
-				"navigationBarTitleText": "课程详情",
-				"app-plus": {
-					"titleNView": false //禁用原生导航栏 
-				},
-				"mp-weixin": {
-					"usingComponents": {
-						"polyv-player": "plugin://polyv-player/player"
+			}, {
+				"path": "course/detail",
+				"style": {
+					"navigationBarTitleText": "课程详情",
+					"app-plus": {
+						"titleNView": false //禁用原生导航栏 
+					},
+					"mp-weixin": {
+						"usingComponents": {
+							"polyv-player": "plugin://polyv-player/player"
+						}
 					}
 				}
-			}
-		}, {
-			"path": "wd/info",
-			"style": {
-				"navigationBarTitleText": "基本信息",
-				"app-plus": {
-					"titleNView": false, //禁用原生导航栏 
-					"bounce": "none"
+			}, {
+				"path": "wd/info",
+				"style": {
+					"navigationBarTitleText": "基本信息",
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
 				}
-			}
-		}, {
-			"path": "wd/menu",
-			"style": {
-				"navigationBarTitleText": "基本资料",
-				"app-plus": {
-					"titleNView": false, //禁用原生导航栏 
-					"bounce": "none"
+			}, {
+				"path": "wd/menu",
+				"style": {
+					"navigationBarTitleText": "基本资料",
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
 				}
-			}
-		}, {
-			"path": "wd/edu_info",
-			"style": {
-				"navigationBarTitleText": "教育信息",
-				"app-plus": {
-					"titleNView": false, //禁用原生导航栏 
-					"bounce": "none"
+			}, {
+				"path": "wd/edu_info",
+				"style": {
+					"navigationBarTitleText": "教育信息",
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
 				}
-			}
-		}, {
-			"path": "study/index",
-			"style": {
-				"navigationBarTitleText": "我的学习",
-				"app-plus": {
-					"titleNView": false, //禁用原生导航栏 
-					"bounce": "none"
+			}, {
+				"path": "study/index",
+				"style": {
+					"navigationBarTitleText": "我的学习",
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
 				}
-			}
-		}, {
-			"path": "wd/collect",
-			"style": {
-				"navigationBarTitleText": "我的收藏",
-				"app-plus": {
-					"titleNView": false, //禁用原生导航栏 
-					"bounce": "none"
+			}, {
+				"path": "wd/collect",
+				"style": {
+					"navigationBarTitleText": "我的收藏",
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
 				}
-			}
-		}, {
-			"path": "wd/ranking",
-			"style": {
-				"navigationBarTitleText": "排行榜",
-				"navigationBarBackgroundColor": "#0386FD",
-				"navigationBarTextStyle": "white",
-				"app-plus": {
-					"titleNView": false, //禁用原生导航栏 
-					"bounce": "none"
+			}, {
+				"path": "wd/ranking",
+				"style": {
+					"navigationBarTitleText": "排行榜",
+					"navigationBarBackgroundColor": "#0386FD",
+					"navigationBarTextStyle": "white",
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
 				}
-			}
-		}, {
-			"path": "wd/avatar",
-			"style": {
-				"navigationBarTitleText": "头像昵称",
-				"app-plus": {
-					"titleNView": false, //禁用原生导航栏 
-					"bounce": "none"
+			}, {
+				"path": "wd/avatar",
+				"style": {
+					"navigationBarTitleText": "头像昵称",
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
 				}
-			}
-		}, {
-			"path": "wd/level",
-			"style": {
-				"navigationBarTitleText": "我的等级",
-				"app-plus": {
-					"titleNView": false, //禁用原生导航栏 
-					"bounce": "none"
+			}, {
+				"path": "wd/level",
+				"style": {
+					"navigationBarTitleText": "我的等级",
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
 				}
-			}
-		}, {
-			"path": "wd/help",
-			"style": {
-				"navigationBarTitleText": "助学活动",
-				"navigationBarTextStyle": "white",
-				"navigationStyle": "custom", // 隐藏系统导航栏
-				"app-plus": {
-					"titleNView": false, //禁用原生导航栏 
-					"bounce": "none"
+			}, {
+				"path": "wd/help",
+				"style": {
+					"navigationBarTitleText": "助学活动",
+					"navigationBarTextStyle": "white",
+					"navigationStyle": "custom", // 隐藏系统导航栏
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
 				}
-			}
-		}, {
-			"path": "wd/coupon",
-			"style": {
-				"navigationBarTitleText": "优惠券",
-				"app-plus": {
-					"titleNView": false, //禁用原生导航栏 
-					"bounce": "none"
+			}, {
+				"path": "wd/coupon",
+				"style": {
+					"navigationBarTitleText": "优惠券",
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
 				}
-			}
-		}, {
-			"path": "course/keynote",
-			"style": {
-				"navigationBarTitleText": "重点考点详情",
-				"app-plus": {
-					"titleNView": false, //禁用原生导航栏 
-					"bounce": "none"
+			}, {
+				"path": "course/keynote",
+				"style": {
+					"navigationBarTitleText": "重点考点详情",
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
 				}
-			}
-		}, {
-			"path": "course/read",
-			"style": {
-				"navigationBarTitleText": "阅读",
-				"app-plus": {
-					"titleNView": false, //禁用原生导航栏 
-					"bounce": "none"
+			}, {
+				"path": "course/read",
+				"style": {
+					"navigationBarTitleText": "阅读",
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
 				}
-			}
-		}, {
-			"path": "bank/detail",
-			"style": {
-				"navigationBarTitleText": "题库详情",
-				"app-plus": {
-					"titleNView": false, //禁用原生导航栏 
-					"bounce": "none"
+			}, {
+				"path": "bank/detail",
+				"style": {
+					"navigationBarTitleText": "题库详情",
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
 				}
-			}
-		}, {
-			"path": "bank/question",
-			"style": {
-				"navigationBarTitleText": "题目集",
-				"app-plus": {
-					"titleNView": false, //禁用原生导航栏 
-					"bounce": "none"
+			}, {
+				"path": "bank/question",
+				"style": {
+					// "navigationBarTitleText": "题目集",
+					// "app-plus": {
+					// 	"titleNView": false, //禁用原生导航栏 
+					// 	"bounce": "none"
+					// }
+					"navigationStyle": "custom", // 隐藏系统导航栏
+					"navigationBarTextStyle": "white"
 				}
-			}
-		},{
-			"path": "bank/Parsing",
-			"style": {
-				"navigationBarTitleText": "题目解析",
-				"app-plus": {
-					"titleNView": false, //禁用原生导航栏 
-					"bounce": "none"
+			}, {
+				"path": "bank/Parsing",
+				"style": {
+					"navigationBarTitleText": "题目解析",
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
 				}
-			}
-		},{
-			"path": "bank/endBG",
-			"style": {
-				"navigationBarTitleText": "答题报告",
-				"app-plus": {
-					"titleNView": false, //禁用原生导航栏 
-					"bounce": "none"
+			}, {
+				"path": "bank/endBG",
+				"style": {
+					"navigationBarTitleText": "答题报告",
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
 				}
-			}
-		}, {
-			"path": "wd/enroll",
-			"style": {
-				"navigationBarTitleText": "考试报名",
-				"app-plus": {
-					"titleNView": false, //禁用原生导航栏 
-					"bounce": "none"
+			}, {
+				"path": "wd/enroll",
+				"style": {
+					"navigationBarTitleText": "考试报名",
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
 				}
-			}
-		}, {
-			"path": "plan/edit",
-			"style": {
-				"navigationBarTitleText": "修改计划",
-				"app-plus": {
-					"titleNView": false, //禁用原生导航栏 
-					"bounce": "none"
+			}, {
+				"path": "plan/edit",
+				"style": {
+					"navigationBarTitleText": "修改计划",
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
 				}
-			}
-		},{
-			"path": "faceRecognition/face",
-			"style": {
-				"navigationBarTitleText": "人脸识别",
-				"app-plus": {
-					"titleNView": false, //禁用原生导航栏 
-					"bounce": "none"
+			}, {
+				"path": "faceRecognition/face",
+				"style": {
+					"navigationBarTitleText": "人脸识别",
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
 				}
-			}
-		},{
-			"path": "payment/payment",
-			"style": {
-				"navigationBarTitleText": "支付",
-				"app-plus": {
-					"titleNView": false, //禁用原生导航栏 
-					"bounce": "none"
+			}, {
+				"path": "payment/payment",
+				"style": {
+					"navigationBarTitleText": "支付",
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
 				}
 			}
-		}],
+		],
 		"plugins": {
 			"polyv-player": {
 				"version": "0.1.5",
@@ -269,18 +272,18 @@
 		}
 	}],
 	"preloadRule": {
-	    "pages/index/index": {
-	      "network": "all",
-	      "packages": ["pages2"]
-	    }
-	  },
+		"pages/index/index": {
+			"network": "all",
+			"packages": ["pages2"]
+		}
+	},
 	"globalStyle": {
 		"navigationBarTextStyle": "black",
 		"navigationBarTitleText": "WeChat",
 		"navigationBarBackgroundColor": "#F8F8F8",
 		"backgroundColor": "#F8F8F8",
 		"usingComponents": {
-		  "verify-mpsdk": "/wxcomponents/verify_mpsdk/index/index"
+			"verify-mpsdk": "/wxcomponents/verify_mpsdk/index/index"
 		}
 	},
 	"tabBar": {

+ 112 - 7
pages2/bank/question.vue

@@ -1,5 +1,7 @@
 <template>
 	<view class="bigBox">
+		<u-navbar v-if="setTimeDjs" back-text="返回" :title="timeDJS"></u-navbar>
+		<u-navbar v-else back-text="返回" title="题目集"></u-navbar>
 		<view v-if="nowPageData.type === 4" class="contentList">
 			<view class="headerTitle">
 				<view class="leftIcon" v-for="(item, index) in titleS" :key="index" v-if="item.value === nowPageData.type">
@@ -187,6 +189,8 @@ export default {
 			sc: false, //收藏集进来的?
 			ct: false, //错题进来的?
 			simulateId: 0,
+			setTimeDjs: false, //是否倒计时
+			timeDJS: '00:00:00'
 		};
 	},
 	onLoad(option) {
@@ -200,14 +204,43 @@ export default {
 		if (option.examId) {
 			this.examId = option.examId;
 		}
-		if(option.sc === 'false' && option.ct === 'false'){
-			if(option.bankSectionId){
-				console.log(option.bankSectionId,15235)
-			}
-		}
 		this.titleListFn(option);
 	},
 	methods: {
+		formatSeconds(value) {
+			let result = parseInt(value);
+			let h = Math.floor(result / 3600) < 10 ? '0' + Math.floor(result / 3600) : Math.floor(result / 3600);
+			let m = Math.floor((result / 60) % 60) < 10 ? '0' + Math.floor((result / 60) % 60) : Math.floor((result / 60) % 60);
+			let s = Math.floor(result % 60) < 10 ? '0' + Math.floor(result % 60) : Math.floor(result % 60);
+
+			let res = '';
+			if (h !== '00') res += `${h}:`;
+			if (m !== '00') res += `${m}:`;
+			res += `${s}`;
+			return res;
+		},
+		//倒计时
+		djsItem(v) {
+			var self = this;
+			var dates = v;
+			const setDates = setInterval(() => {
+				if (dates < 1) {
+					self.timeDJS = '考试结束'
+					clearInterval(setDates);
+					uni.showLoading({
+						title: '正在交卷'
+					});
+					setTimeout(function() {
+						uni.hideLoading();
+						self.carryOutDjsDate();
+					}, 1000);
+					return
+				}
+				dates--;
+				self.timeDJS = self.formatSeconds(dates);
+			}, 1000);
+			this.setTimeDjs = true;
+		},
 		//预览图片
 		seeBigImage(url) {
 			var urlarr = [];
@@ -457,7 +490,7 @@ export default {
 			}
 			if (this.typeId === '1') {
 				self.$api.questionsimulate(self.bankId).then(res => {
-					self.simulateId = res.data.data.simulateId
+					self.simulateId = res.data.data.simulateId;
 					if (res.data.data.list.length) {
 						res.data.data.list.forEach((items, indexs) => {
 							items.jsonStr = JSON.parse(items.jsonStr);
@@ -471,6 +504,7 @@ export default {
 						self.nowPageData = res.data.data.list[self.numIndex];
 						self.favoritesStatus(res.data.data.list[self.numIndex].questionId);
 						self.list = res.data.data.list;
+						self.djsItem(res.data.data.examTime);
 					} else {
 						uni.showModal({
 							title: '提示',
@@ -486,7 +520,7 @@ export default {
 							}
 						});
 					}
-				})
+				});
 			} else {
 				if (option.bankSectionId) {
 					var data = {
@@ -744,6 +778,77 @@ export default {
 					}
 				}
 			});
+		},
+		//考试结束自动交卷
+		carryOutDjsDate() {
+			var self = this;
+			var correct = 0;
+			var errorz = 0;
+			var errorArrays = [];
+			var answerListString = JSON.parse(JSON.stringify(self.answerList));
+			answerListString.forEach((item, index) => {
+				if (item.isRight !== undefined) {
+					if (item.isRight === 1) {
+						correct++;
+					} else {
+						errorArrays.push(item.questionId);
+						errorz++;
+					}
+				}
+				item.selectIds = item.selectIds.toString();
+				item.replyStr.forEach((items, indexs) => {
+					if (items.selectId) {
+						items.selectId = items.selectId.toString();
+					}
+				});
+				item.replyStr = JSON.stringify(item.replyStr);
+			});
+			var data = {
+				bankId: self.bankId,
+				type: self.typeId,
+				answerList: answerListString
+			};
+			if (self.examId !== null) {
+				data.examId = self.examId;
+			}
+			if (self.simulateId !== null) {
+				data.simulateId = self.simulateId;
+			}
+			if (self.sc === 'true') {
+				var num = 0;
+				self.list.forEach((item, index) => {
+					if (item.type !== 4) {
+						num++;
+					}
+				});
+				uni.redirectTo({
+					url: `/pages2/bank/endBG?bankId=${self.bankId}&type=${
+						self.typeId
+					}&allIndex=${num}&correct=${correct}&error=${errorz}&errorArrayList=${errorArrays.toString()}&bankSectionId=${self.bankSectionId}&examId=${self.examId}`
+				});
+			} else {
+				self.$api.questiondetailrecord(data).then(res => {
+					if (res.data.code === 200) {
+						var num = 0;
+						self.list.forEach((item, index) => {
+							if (item.type !== 4) {
+								num++;
+							}
+						});
+						uni.redirectTo({
+							url: `/pages2/bank/endBG?bankId=${self.bankId}&type=${
+								self.typeId
+							}&allIndex=${num}&correct=${correct}&error=${errorz}&errorArrayList=${errorArrays.toString()}&bankSectionId=${self.bankSectionId}&examId=${self.examId}`
+						});
+					} else {
+						uni.showToast({
+							title: '提交失败',
+							icon: 'none',
+							duration: 2000
+						});
+					}
+				});
+			}
 		}
 	}
 };

+ 25 - 8
pages2/wd/info.vue

@@ -165,25 +165,41 @@ export default {
 					}
 				],
 				width: 0,
-				height: 0
+				height: 0,
 			}
 		};
 	},
 	onReady() {
 		this.$refs.uForm.setRules(this.rules);
-		this.form = this.userInfo
-		
+		if(this.form.houseProvince === ''){
+			this.form.houseProvince = '广东省'
+		}
+		if(this.form.houseCity === ''){
+			this.form.houseCity = '广州市'
+		}
+		if(this.form.houseDistrict === ''){
+			this.form.houseDistrict = '天河区'
+		}
+		if(this.form.province === ''){
+			this.form.province = '广东省'
+		}
+		if(this.form.city === ''){
+			this.form.city = '广州市'
+		}
+		if(this.form.district === ''){
+			this.form.district = '天河区'
+		}
 	},
 	onLoad(option) {
 		const Verify = require('@/wxcomponents/verify_mpsdk/main.js');
 		Verify.init();
 	},
 	methods: {
-		getUserInfos() {
-			this.$api.getInfo().then(res => {
-				this.form = res.data.data;
-			});
-		},
+		// getUserInfos() {
+		// 	this.$api.getInfo().then(res => {
+		// 		this.form = res.data.data;
+		// 	});
+		// },
 		changePhotoListHeader(lists, name) {
 			this.fileList = lists;
 		},
@@ -350,6 +366,7 @@ export default {
 		},
 		// 籍贯获取选择的地区
 		handleGetRegion(region) {
+			console.log(region)
 			this.form.houseProvince = region[0].name;
 			this.form.houseCity = region[1].name;
 			this.form.houseDistrict = region[2].name;