he2802 3 жил өмнө
parent
commit
2d0fce9fe4

+ 3 - 4
pages.json

@@ -356,8 +356,7 @@
 			{
 				"path": "bank/questionBankExplain",
 				"style": {
-					"navigationBarTitleText": "试卷",
-					"navigationStyle": "custom", // 隐藏系统导航栏
+					"navigationBarTitleText": "解析",
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -371,7 +370,7 @@
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
-					}
+					} 
 				}
 			},
 			
@@ -388,7 +387,7 @@
 			{
 				"path": "bank/questionBankContinue",
 				"style": {
-					"navigationBarTitleText": "试卷",
+					"navigationBarTitleText": "试卷题目",
 					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 

+ 3 - 2
pages/index/index.vue

@@ -5,7 +5,7 @@
 				<image  src="/static/logo2.png"></image>
 			</view>
 		</u-navbar>
-		<u-swiper :list="list" @change="e => current = e.current" :autoplay="false"></u-swiper>
+		<!-- <u-swiper :list="list" @change="e => current = e.current" :autoplay="false"></u-swiper> -->
 		<view class="content">
 			<view class="notice" v-if="infoNums">
 				<image src="/static/icon/msg_icon1.png" class="icon"></image>
@@ -235,7 +235,8 @@ export default {
 		},
 		jumpGoodsDetail(item){
 			this.$navTo.togo('/pages2/wd/course', {
-				id: item.goodsId
+				id: item.goodsId,
+				gid:item.gradeId
 			});
 		},
 		preveItem() {

+ 138 - 75
pages/login/login.vue

@@ -7,14 +7,14 @@
 				<u-subsection @change="sectionChange" :list="list" :current="current" active-color="#007AFF" inactive-color="#ffffff" bg-color="rgba(255,255,255,0.52)"></u-subsection>
 			</view>
 			<view class="login_box">
-				<u-form :model="form" ref="uForm" v-if="current==0">
-					<u-form-item ><u-input type="idcard" v-model="form.account" placeholder="手机号/学员身份证"/></u-form-item>
-					<u-form-item ><u-input v-model="form.pwd" type="password" placeholder="登录密码"/></u-form-item>
+				<u-form :model="form" ref="uForm1" v-show="current==0">
+					<u-form-item prop="account" ><u-input type="idcard" v-model="form.account" placeholder-style="color:#999999" placeholder="手机号/学员身份证"/></u-form-item>
+					<u-form-item prop="pwd" ><u-input class="password" v-model="form.pwd" placeholder-style="color:#999999" type="password" placeholder="登录密码"/></u-form-item>
 				</u-form>
-				<u-form :model="form" ref="uForm" v-if="current==1">
-					<u-form-item ><u-input type="number" maxlength="11"  v-model="form.tel" placeholder="手机号"/></u-form-item>
-					<u-form-item >
-						<u-input v-model="form.code" type="number"  placeholder="验证码"/>
+				<u-form :model="form" ref="uForm2" v-show="current==1">
+					<u-form-item  prop="tel" ref="tel"><u-input type="number" maxlength="11" placeholder-style="color:#999999"  v-model="form.tel" placeholder="手机号"/></u-form-item>
+					<u-form-item prop="code" >
+						<u-input v-model="form.code" type="number" placeholder-style="color:#999999"  placeholder="验证码"/>
 						<u-button slot="right"  size="mini" @click="getCode">{{codeTips}}</u-button>
 					</u-form-item>
 				</u-form>
@@ -61,6 +61,50 @@ export default {
 					name: '短信登录'
 				}
 			],
+			rules: {
+				tel: [
+					{ 
+						required: true, 
+						message: '请输入手机号', 
+						// 可以单个或者同时写两个触发验证方式 
+						trigger: ['change','blur'],
+					},
+					{
+						validator: (rule, value, callback) => {
+							// 上面有说,返回true表示校验通过,返回false表示不通过
+							// this.$u.test.mobile()就是返回true或者false的
+							return this.$u.test.mobile(value);
+						},
+						message: '手机号码格式不正确',
+						// 触发器可以同时用blur和change
+						trigger: ['change','blur'],
+					}
+				],
+				account: [
+					{ 
+						required: true, 
+						message: '请输入手机号/学员身份证', 
+						// 可以单个或者同时写两个触发验证方式 
+						trigger: ['change','blur'],
+					}
+				],
+				pwd: [
+					{ 
+						required: true, 
+						message: '请输入密码', 
+						// 可以单个或者同时写两个触发验证方式 
+						trigger: ['change','blur'],
+					}
+				],
+				code: [
+					{ 
+						required: true, 
+						message: '请输入验证码', 
+						// 可以单个或者同时写两个触发验证方式 
+						trigger: ['change','blur'],
+					}
+				],
+			},
 			current: 0,
 			codeTips: '',
 			isUse:false,
@@ -68,6 +112,8 @@ export default {
 		};
 	},
 	onLoad(option) {
+		this.$refs.uForm1.setRules(this.rules)
+		this.$refs.uForm2.setRules(this.rules)
 		if(option.isBack){
 			this.isBack = option.isBack;
 		}
@@ -96,57 +142,62 @@ export default {
 			}
 		},
 		sms_login(){
-			let that = this
-			if(!this.form.tel){
-				this.$u.toast('请输入手机号码');
-				return 
-			}
-			if(!this.form.code){
-				this.$u.toast('请输入验证码');
-				return 
-			}
-			that.isUse = true
-			let datas = {
-				tel:this.form.tel,
-				code:this.form.code
-			}
-			that.$api.smsLogin(datas).then(
-				res => {
-					that.isUse = false
-					if (res.data.code == 200) {
-						if(res.data.data.full_info){
-							//信息完善,直接进入页面
-							uni.setStorageSync('user_account', res.data.data.user_account);
-							uni.setStorageSync('token', res.data.data.token);
-							that.$api.getInfo().then(resdata => {
-								if(resdata.data.code == 200){
-									that.$store.state.userInfo = resdata.data.data;
-									
-									if(!that.isBack){
-										uni.reLaunch({
-											url:'/pages/index/index'
-										})
-									}else{
-										uni.navigateBack();
-									}
-								}
-								
-							});
-							
-						}else{
-							//未完善信息,存为临时信息
-							uni.setStorageSync('user_account_temp', res.data.data.user_account);
-							uni.setStorageSync('token_temp', res.data.data.token);
-							that.$navTo.togo('/pages2/register/bind');
-						}	
-					} else {
-						that.$u.toast(res.data.msg);
+			this.$refs.uForm2.validate(valid => {
+				if(valid) {
+					let that = this
+					if(!this.form.tel){
+						this.$u.toast('请输入手机号码');
+						return 
 					}
-				},
-				err => {
-					that.isUse = false
+					if(!this.form.code){
+						this.$u.toast('请输入验证码');
+						return 
+					}
+					that.isUse = true
+					let datas = {
+						tel:this.form.tel,
+						code:this.form.code
+					}
+					that.$api.smsLogin(datas).then(
+						res => {
+							that.isUse = false
+							if (res.data.code == 200) {
+								if(res.data.data.full_info){
+									//信息完善,直接进入页面
+									uni.setStorageSync('user_account', res.data.data.user_account);
+									uni.setStorageSync('token', res.data.data.token);
+									that.$api.getInfo().then(resdata => {
+										if(resdata.data.code == 200){
+											that.$store.state.userInfo = resdata.data.data;
+											
+											if(!that.isBack){
+												uni.reLaunch({
+													url:'/pages/index/index'
+												})
+											}else{
+												uni.navigateBack();
+											}
+										}
+										
+									});
+									
+								}else{
+									//未完善信息,存为临时信息
+									uni.setStorageSync('user_account_temp', res.data.data.user_account);
+									uni.setStorageSync('token_temp', res.data.data.token);
+									that.$navTo.togo('/pages2/register/bind');
+								}	
+							} else {
+								that.$u.toast(res.data.msg);
+							}
+						},
+						err => {
+							that.isUse = false
+						}
+					);
 				}
-			);
+			})
+			
 		},
 		fakeLogin(){
 			uni.setStorageSync('user_account', '123');
@@ -211,26 +262,28 @@ export default {
 		// 获取验证码
 		getCode() {
 			let that = this
-			if(that.$refs.uCode.canGetCode) {
-				if(!this.form.tel){
-					this.$u.toast('请输入手机号码');
-					return 
-				}
-				let datas = {tel:this.form.tel}
-				that.$api.loginSms(datas).then(
-					res => {
-						if (res.data.code == 200) {
-							that.$u.toast('验证码已发送');
-							// 通知验证码组件内部开始倒计时
-							that.$refs.uCode.start();
-						} else {
-							that.$u.toast(res.data.msg);
+			if(that.$refs.uCode.canGetCode) { 
+				if(that.$refs.tel.validateState == 'success') {
+					let datas = {tel:this.form.tel}
+					that.$api.loginSms(datas).then(
+						res => {
+							if (res.data.code == 200) {
+								that.$u.toast('验证码已发送');
+								// 通知验证码组件内部开始倒计时
+								that.$refs.uCode.start();
+							} else {
+								that.$u.toast(res.data.msg);
+							}
+						},
+						err => {
+							console.log(err);
 						}
-					},
-					err => {
-						console.log(err);
-					}
-			);}
+					);
+				} else {
+					this.$refs.tel.onFieldBlur()
+				}
+			}
+			
 		},
 		sectionChange(index) {
 			this.current = index;
@@ -347,6 +400,16 @@ export default {
 		border-radius: 24rpx;
 		margin-top: 30rpx;
 		padding:40rpx 35rpx;
+		
+		
+		.password {
+			/deep/.uicon-eye-fill {
+				&::before{
+					color:#007AFF;
+					content:"\e613";
+				}
+			}
+		}
 	}
 	/deep/ .u-item-bg{
 		border-radius: 32px !important;

+ 64 - 29
pages/wd/index.vue

@@ -2,8 +2,8 @@
 	<view>
 		<image mode="widthFix" :src="isLogin ? '/static/wd_bg_login.jpg' : '/static/wd_bg.jpg'" :class="isLogin ? 'login_full_img' : 'full_img'"></image>
 
-		<view style="text-align: center;margin-top: 60rpx;" v-if="!isLogin">
-			<view style="color: #007AFF ;font-size: 36rpx;font-weight: bold;">您还没有登录哦~</view>
+		<view class="login_wrap" v-if="!isLogin">
+			<view class="login_text">您还没有登录哦~</view>
 			<view class="loginBtn" @click="jumpLogin">立即登录/注册</view>
 		</view>
 		<view v-if="isLogin" class="loginBox">
@@ -18,13 +18,13 @@
 			</view>
 			<view style="top: 195px;position: relative;padding-bottom: 30rpx;">
 				<navigator  hover-class="none" url="/pages2/plan/index" class="menu_box">
-					<view style="display: flex;align-items: center;">
+					<view class="box_left">
 						<image src="/static/icon/my_icon1.png" class="my_icon"></image>
 						<view>学习计划</view>
 					</view>
-					<view>
+					<view class="box_right">
 						今天有
-						<text style="color: #007AFF;margin: 0 5rpx;">{{ userNums.planSum }}</text>
+						<text>{{ userNums.planSum }}</text>
 						个学习任务
 					</view>
 				</navigator>
@@ -39,53 +39,53 @@
 					</navigator>
 				</view>
 				<navigator  hover-class="none" url="/pages2/learn/my_learn" class="menu_box">
-					<view style="display: flex;align-items: center;">
+					<view class="box_left">
 						<image src="/static/icon/my_icon2.png" class="my_icon"></image>
 						<view>我的学时</view>
 					</view>
-					<view>
+					<view class="box_right">
 						累计
-						<text style="color: #007AFF;margin: 0 5rpx;">{{ userNums.periodSum }}</text>
+						<text>{{ userNums.periodSum }}</text>
 						学时未通过
 					</view>
 				</navigator>
 				<navigator  hover-class="none" url="/pages2/exam/index" class="menu_box">
-					<view style="display: flex;align-items: center;">
+					<view class="box_left">
 						<image src="/static/icon/my_icon10.png" class="my_icon"></image>
 						<view>我的考试</view>
 					</view>
-					<view>
-						<text style="color: #007AFF;margin: 0 5rpx;">{{ userNums.subscribeSum }}</text>
+					<view class="box_right">
+						<text>{{ userNums.subscribeSum }}</text>
 						考试预约
 					</view>
 				</navigator>
 				<navigator  hover-class="none" url="/pages2/order/index" class="menu_box">
-					<view style="display: flex;align-items: center;">
+					<view class="box_left">
 						<image src="/static/icon/my_icon7.png" class="my_icon"></image>
 						<view>我的订单</view>
 					</view>
-					<view>
-						<text style="color: #007AFF;margin: 0 5rpx;">{{ userNums.orderSum }}</text>
+					<view class="box_right">
+						<text>{{ userNums.orderSum }}</text>
 						笔待支付
 					</view>
 				</navigator>
 				<navigator  hover-class="none" url="/pages2/msg/index" class="menu_box">
-					<view style="display: flex;align-items: center;">
+					<view class="box_left">
 						<image src="/static/icon/my_icon8.png" class="my_icon"></image>
 						<view>我的消息</view>
 					</view>
-					<view>
-						<text style="color: #007AFF;margin: 0 5rpx;">{{ userNums.informSum }}</text>
+					<view class="box_right">
+						<text>{{ userNums.informSum }}</text>
 						条未读
 					</view>
 				</navigator>
 				<navigator  hover-class="none" url="/pages2/wd/info" class="menu_box">
-					<view style="display: flex;align-items: center;">
+					<view class="box_left">
 						<image src="/static/icon/my_icon9.png" class="my_icon"></image>
 						<view>我的资料</view>
 					</view>
 				</navigator>
-				<view style="color: #999999;text-align: center;font-size: 32rpx;margin-top: 50rpx;" @click="logout">退出</view>
+				<view class="logout" @click="logout">退出</view>
 			</view>
 		</view>
 
@@ -151,7 +151,30 @@ page {
 	background-color: #f0f1f5;
 }
 </style>
-<style scoped>
+<style scoped lang="scss">
+.login_wrap {
+	text-align: center;
+	margin-top: 60rpx;
+	
+	.login_text {
+		color: #007AFF ;
+		font-size: 36rpx;
+		font-weight: bold;
+	}
+	
+	
+	.loginBtn {
+		width: 526rpx;
+		height: 80rpx;
+		background: linear-gradient(90deg, #015eea, #00c0fa);
+		box-shadow: 0rpx 10rpx 16rpx 4rpx rgba(1, 99, 235, 0.04);
+		border-radius: 40rpx;
+		color: #ffffff;
+		line-height: 80rpx;
+		margin: 0 auto;
+		margin-top: 50rpx;
+	}
+}
 .avatar {
 	height: 70rpx;
 	width: 70rpx;
@@ -168,6 +191,8 @@ page {
 	margin-top: 30rpx;
 }
 .two_menu {
+	font-size: 32rpx;
+	color:#666;
 	display: flex;
 	justify-content: space-between;
 }
@@ -187,6 +212,20 @@ page {
 	justify-content: space-between;
 	color: #666666;
 	font-size: 32rpx;
+	
+	.box_left {
+		display: flex;
+		align-items: center;
+	}
+	
+	.box_right {
+		font-size: 32rpx;
+		
+		text {
+			color: #007AFF;
+			margin: 0 5rpx;
+		}
+	}
 }
 .loginBox {
 	position: relative;
@@ -211,15 +250,11 @@ page {
 	z-index: -999;
 	top: 0;
 }
-.loginBtn {
-	width: 526rpx;
-	height: 80rpx;
-	background: linear-gradient(90deg, #015eea, #00c0fa);
-	box-shadow: 0rpx 10rpx 16rpx 4rpx rgba(1, 99, 235, 0.04);
-	border-radius: 40rpx;
-	color: #ffffff;
-	line-height: 80rpx;
-	margin: 0 auto;
+
+.logout {
+	color: #999999;
+	text-align: center;
+	font-size: 32rpx;
 	margin-top: 50rpx;
 }
 </style>

+ 3 - 4
pages2/bank/collectById.vue

@@ -17,8 +17,7 @@
 			<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>
+					<text>{{total}}</text>
 				</view>
 			</view>
 			<view class="wrongList" v-if="type == 1">
@@ -114,7 +113,7 @@ export default {
 				this.testList = res.data 
 				let total = 0;
 				this.testList.rows.forEach(item => {
-					total += item.num;
+					total += item.questionNum;
 				})
 				
 				this.total = total
@@ -128,7 +127,7 @@ export default {
 				this.typeList = res.data 
 				let total = 0;
 				this.typeList.rows.forEach(item => {
-					total += item.num;
+					total += item.questionNum;
 				})
 				
 				this.total = total

+ 296 - 319
pages2/bank/detail.vue

@@ -1,12 +1,12 @@
 <template>
 	<view>
 		<view style="background-color: #FFFFFF;">
-			<view >
+			<view>
 				<image :src="$method.splitImgHost(goodsData.coverUrl, true)" style="width: 100%;"></image>
 				<view style="padding:20rpx">
 					<view style="display: flex;margin-top: 13rpx;">
-						<view class="yearTag" v-if="goodsData.year">{{goodsData.year}}</view>
-						<view class="titleTag">{{goodsData.goodsName}}</view>
+						<view class="yearTag" v-if="goodsData.year">{{ goodsData.year }}</view>
+						<view class="titleTag">{{ goodsData.goodsName }}</view>
 					</view>
 					<!-- <view style="display: flex;justify-content: space-between;margin-top: 13rpx;" v-if="false">
 						<view class="noteTag"><image src="/static/icon/wk_icon1.png" class="wk_icon"></image>
@@ -17,31 +17,27 @@
 			</view>
 			<u-line color="#D6D6DB" />
 			<view>
-				<view>
-					<u-tabs :list="list" item-width="50%" font-size="24" bar-width="110" :current="current" @change="change" active-color="#007AFF"></u-tabs>
-				</view>
+				<view><u-tabs :list="list" item-width="50%" font-size="24" bar-width="110" :current="current" @change="change" active-color="#007AFF"></u-tabs></view>
 			</view>
 			<u-line color="#D6D6DB" />
 		</view>
 		<view class="intro" v-if="current == 0">
-			<view class="content" style="padding:10rpx;">
-				<rich-text :nodes="goodsData.mobileDetailHtml"></rich-text>
-			</view>
+			<view class="content" style="padding:10rpx;"><rich-text :nodes="goodsData.mobileDetailHtml"></rich-text></view>
 		</view>
-		<view class="title-list"  v-if="current == 1">
+		<view class="title-list" v-if="current == 1">
 			<view class="content">
-				<view class="list" v-for="(item1,index1) in bankList" :key="index1">
-					<template v-if="item1.type==1">
+				<view class="list" v-for="(item1, index1) in bankList" :key="index1">
+					<template v-if="item1.type == 1">
 						<view class="moduleItem" @click="clickModule" :data-id="item1.majorId" :data-index="index1">
-							<view class="courseName">{{item1.name}}</view>
+							<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>
-						
+
 						<template v-if="item1.showList">
-							<view v-for="(item2,index2) in item1.list" :key="index2" >
+							<view v-for="(item2, index2) in item1.list" :key="index2">
 								<view class="section" @click="changeItem" :data-index1="index1" :data-index2="index2" :data-id="item2.chapterExamId" :data-type="item1.type">
 									<image src="/static/icon/down1.png" class="icon_up" v-if="item2.showList"></image>
 									<image src="/static/icon/up1.png" class="icon_up" v-if="!item2.showList"></image>
@@ -49,10 +45,10 @@
 									<u-icon  v-if="item2.showList" name="arrow-down"></u-icon> -->
 									<text style="margin-left:34rpx;">{{ item2.name }}</text>
 								</view>
-								<view  v-if="item2.showList">
-									<view class="article" :class="{active:showTest(article.examId)}"  v-for="(article,index3) in item2.list" :key="index3">
-										<view class="flex_auto">{{article.examName}}</view>
-										<navigator  hover-class="none" :url="'/pages2/bank/questionBankTest?id='+article.examId+'&num='+showTest(article.examId).num">
+								<view v-if="item2.showList">
+									<view class="article" :class="{ active: showTest(article.examId) }" v-for="(article, index3) in item2.list" :key="index3">
+										<view class="flex_auto">{{ article.examName }}</view>
+										<navigator hover-class="none" :url="'/pages2/bank/questionBankTest?id=' + article.examId + '&num=' + showTest(article.examId).num">
 											<view class="btn" v-if="showTest(article.examId)">试做</view>
 										</navigator>
 									</view>
@@ -60,11 +56,9 @@
 								<u-line></u-line>
 							</view>
 						</template>
-						
-						
 					</template>
-					
-					<template v-if="item1.type ==2">
+
+					<template v-if="item1.type == 2">
 						<view class="section" :data-index1="index1" :data-id="item1.majorId" @click="changeItem" :data-type="item1.type">
 							<image src="/static/icon/down1.png" class="icon_up" v-if="item1.showList"></image>
 							<image src="/static/icon/up1.png" class="icon_up" v-if="!item1.showList"></image>
@@ -75,29 +69,26 @@
 						<view v-if="item1.showList" >
 							<view class="article" :class="{active:showTest(article.examId)}"  :key="index2" v-for="(article,index2) in item1.list">
 								<view class="flex_auto">{{item1.name}}</view>
-								<navigator  hover-class="none" :url="'/pages2/bank/questionBankTest?id='+article.majorId+'&num='+showTest(article.examId).num">
+								<navigator  hover-class="none" :url="'/pages2/bank/questionBankTest?id='+article.examId+'&num='+showTest(article.examId).num">
 									<view class="btn"  v-if="showTest(article.examId)">试做</view>
 								</navigator>
-								
 							</view>
 						</view>
 					</template>
-					
-					<template v-if="item1.type ==3">
-						<view class="article" :class="{active:showTest(item1.majorId)}" >
-							<view class="flex_auto">{{item1.name}}</view>
-							<navigator  hover-class="none" :url="'/pages2/bank/questionBankTest?id='+item1.majorId+'&num='+showTest(item1.majorId).num">
+
+					<template v-if="item1.type == 3">
+						<view class="article" :class="{ active: showTest(item1.majorId) }">
+							<view class="flex_auto">{{ item1.name }}</view>
+							<navigator hover-class="none" :url="'/pages2/bank/questionBankTest?id=' + item1.majorId + '&num=' + showTest(item1.majorId).num">
 								<view class="btn" v-if="showTest(item1.majorId)">试做</view>
 							</navigator>
-							
 						</view>
 					</template>
 				</view>
-				
 			</view>
 		</view>
 		<view class="bottomBox">
-			<view class="priceTag">¥ {{goodsData.standPrice}}</view>
+			<view class="priceTag">¥ {{ goodsData.standPrice }}</view>
 			<view style="display: flex;color: #FFFFFF;align-items: center;">
 				<view class="btn1" @click="addCart">加购物车</view>
 				<view class="btn2" @click="buy">立即购买</view>
@@ -119,349 +110,335 @@ export default {
 					name: '大纲'
 				}
 			],
-			current:0,
-			id:'',
-			goodsData:{},
-			bankList:[],
-			goodsExamConfig:[],
+			current: 0,
+			id: '',
+			goodsData: {},
+			bankList: [],
+			goodsExamConfig: []
 		};
 	},
 	filters: {
-	   formatDate: function (value) {
-		   
-		var date = new Date(value);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
-		var Y = date.getFullYear();
-		return Y;
-	  }
-	},
-	onUnload() {
-		
+		formatDate: function(value) {
+			var date = new Date(value); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
+			var Y = date.getFullYear();
+			return Y;
+		}
 	},
+	onUnload() {},
 	computed: { ...mapGetters(['userInfo']) },
 	onLoad(option) {
-		console.log(option)
-		this.id = option.id
+		this.id = option.id;
 		this.getDetail();
-		this.goodsBankList()
-	},
-	onShow() {
-		
+		this.goodsBankList();
 	},
+	onShow() {},
 	methods: {
-		getDetail(){
+		getDetail() {
 			this.$api.commonGoodsDetail(this.id).then(res => {
-				console.log(res)
+				if (res.data.data.mobileDetailHtml) {
+					res.data.data.mobileDetailHtml = res.data.data.mobileDetailHtml.replace(/<img/gi, '<img style="max-width:100%;"');
+				}
 				this.goodsData = res.data.data;
-				this.goodsExamConfig = JSON.parse(res.data.data.goodsExamConfig)
-			})
+				this.goodsExamConfig = JSON.parse(res.data.data.goodsExamConfig);
+			});
 		},
 		goodsBankList() {
-			this.$api.goodsBankList({
-				goodsId:this.id
-			}).then(res => {
-				console.log(res)
-				this.bankList = res.data.data;
-			})
+			this.$api
+				.goodsBankList({
+					goodsId: this.id
+				})
+				.then(res => {
+					console.log(res);
+					this.bankList = res.data.data;
+				});
 		},
-		goodsChapterList(bank,id) {
-			this.$api.goodsChapterList({
-				moduleExamId:id
-			}).then(res => {
-				this.$set(bank,'list',res.data.data)
-				 
-			})
+		goodsChapterList(bank, id) {
+			this.$api
+				.goodsChapterList({
+					moduleExamId: id
+				})
+				.then(res => {
+					this.$set(bank, 'list', res.data.data);
+				});
 		},
-		
+
 		showTest(id) {
 			return this.goodsExamConfig.find(item => item.examId == id);
 		},
 		clickModule(e) {
-			
 			let index = e.currentTarget.dataset.index;
 			let id = e.currentTarget.dataset.id;
-			
-			
-			if(this.bankList[index].list) {
-				this.$set(this.bankList[index],'showList',!this.bankList[index].showList)
+
+			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)
-				 
-			})
+
+			this.$api
+				.goodsChapterList({
+					moduleExamId: id
+				})
+				.then(res => {
+					this.$set(this.bankList[index], 'showList', true);
+					this.$set(this.bankList[index], 'list', res.data.data);
+				});
 		},
-		buy(){
-			if(this.$method.isGoLogin()){
-				return
+		buy() {
+			if (this.$method.isGoLogin()) {
+				return;
 			}
-			this.$navTo.togo('/pages2/order/confirm_list?id='+this.id);
+			this.$navTo.togo('/pages2/order/confirm_list?id=' + this.id);
 		},
-		addCart(){
-			if(this.$method.isGoLogin()){
-				return
+		addCart() {
+			if (this.$method.isGoLogin()) {
+				return;
 			}
-			
-			let self = this
-			this.$api.addCart({goodsId:this.id}).then(res => {
-				if(res.data.code==200){
-					uni.setStorageSync('updateCart',1) //提醒刷新购物车
+
+			let self = this;
+			this.$api.addCart({ goodsId: this.id }).then(res => {
+				if (res.data.code == 200) {
+					uni.setStorageSync('updateCart', 1); //提醒刷新购物车
 					uni.showToast({
-					    title: '添加成功'
+						title: '添加成功'
 					});
-				}else{
+				} else {
 					this.$u.toast(res.data.msg);
 				}
 			});
-			
 		},
-		open(item){
-			item.showChildren = !item.showChildren
+		open(item) {
+			item.showChildren = !item.showChildren;
 		},
-		change(index){
+		change(index) {
 			this.current = index;
 		},
 		changeItem(e) {
-			
-			
-			let index1 = e.currentTarget.dataset.index1
-			let index2 = e.currentTarget.dataset.index2
-			let id = e.currentTarget.dataset.id
-			let type = e.currentTarget.dataset.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)
+			let index1 = e.currentTarget.dataset.index1;
+			let index2 = e.currentTarget.dataset.index2;
+			let id = e.currentTarget.dataset.id;
+			let type = e.currentTarget.dataset.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)
+
+				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)
-					
-					 
-				})
+
+				this.$api
+					.goodsExamList({
+						chapterExamId: id
+					})
+					.then(res => {
+						this.$set(this.bankList[index1], 'showList', true);
+						this.$set(this.bankList[index1], 'list', res.data.data);
+					});
 			}
-			
-			
-			
 		}
 	}
 };
 </script>
-<style >
-	page{
-		background-color: #EAEEF1;
-	}
+<style>
+page {
+	background-color: #eaeef1;
+}
 </style>
 <style lang="scss" scope>
-	.courseName{
-		white-space:nowrap;
-		overflow:hidden;
-		text-overflow:ellipsis; 
-	}
-	.icon_up{
-		width: 32rpx;
-		height: 32rpx;
+.courseName {
+	white-space: nowrap;
+	overflow: hidden;
+	text-overflow: ellipsis;
+}
+.icon_up {
+	width: 32rpx;
+	height: 32rpx;
+}
+.intro {
+	background: #eaeef1;
+	padding: 16rpx 16rpx 124rpx;
+
+	.content {
+		background: #fff;
+		border-radius: 16rpx;
+		.top {
+			border-radius: 16rpx;
+			padding: 32rpx 28rpx 16rpx;
+			font-size: 30rpx;
+			color: #333333;
+		}
+
+		.img {
+			width: 100%;
+		}
 	}
-	.intro {
-		background: #EAEEF1;
-		padding:16rpx 16rpx 124rpx;
-		
-		.content {
-			background:#fff;
-			border-radius: 16rpx;;
-			.top {
-				border-radius: 16rpx;
-				padding:32rpx 28rpx 16rpx;
-				font-size: 30rpx;
+}
+
+.moduleItem {
+	height: 80rpx;
+	color: #333333;
+	font-size: 32rpx;
+	line-height: 80rpx;
+	font-weight: bold;
+	display: flex;
+	justify-content: space-between;
+}
+.title-list {
+	background: #eaeef1;
+	padding: 16rpx 16rpx 124rpx;
+	.content {
+		.list {
+			background: #fff;
+			margin-bottom: 30rpx;
+			overflow: hidden;
+			border-radius: 16rpx;
+			padding: 10rpx 16rpx;
+
+			.module {
+				font-size: 32rpx;
 				color: #333333;
+
+				.icon {
+					margin-right: 10rpx;
+				}
 			}
-			
-			.img {
-				width:100%;
-			}
-		}
-	}
-	
-	.moduleItem{
-		height: 80rpx;
-		color: #333333;
-		font-size: 32rpx;
-		line-height: 80rpx;
-		font-weight: bold;
-		display: flex;
-		justify-content: space-between;
-	
-	}
-	.title-list {
-		background: #EAEEF1;
-		padding:16rpx 16rpx 124rpx;
-		.content {
-			
-			.list {
-				background:#fff;
-				margin-bottom:30rpx;
+
+			.section {
+				font-size: 30rpx;
+				color: #333;
+				white-space: nowrap;
 				overflow: hidden;
-				border-radius: 16rpx;
-				padding:10rpx 16rpx;
-				
-				.module {
-					font-size: 32rpx;
-					color: #333333;
-					
-					.icon {
-						margin-right:10rpx;
-					}
+				text-overflow: ellipsis;
+				margin: 20rpx 0;
+				display: flex;
+				align-items: center;
+			}
+
+			.article {
+				height: 80rpx;
+				display: flex;
+				align-items: center;
+				margin-left: 64rpx;
+				font-size: 24rpx;
+				color: #666666;
+				border-bottom: 1rpx solid #eeeeee;
+				display: flex;
+
+				.flex_auto {
+					flex: 1;
 				}
-				
-				.section {
-					font-size: 30rpx;
-					color: #333;
-					white-space:nowrap;
-					overflow:hidden;
-					text-overflow:ellipsis; 
-					margin: 20rpx 0;
-					display: flex;
-					align-items: center;
+
+				&:nth-last-of-type(1) {
+					border: 0;
 				}
-				
-				.article {
-					height:80rpx;
-					display: flex;
-					align-items: center;
-					margin-left:64rpx;
-					font-size: 24rpx;
-					color: #666666;
-					border-bottom: 1rpx solid #EEEEEE;
-					display: flex;
-					
-					.flex_auto{
-						flex:1;
-					}
-					
-					&:nth-last-of-type(1) {
-						border:0;
-					}
-					
-					&.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;
-						}
+
+				&.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;
 					}
 				}
 			}
 		}
 	}
-	.btn2{
-		width: 200rpx;
-		height: 64rpx;
-		background: linear-gradient(0deg, #FFB102, #FD644F);
-		box-shadow: 0rpx 10rpx 16rpx 4rpx rgba(1, 99, 235, 0.04);
-		border-radius: 32rpx;
-		line-height: 64rpx;
-		text-align: center;
-	}
-	.btn1{
-		width: 200rpx;
-		height: 64rpx;
-		background: linear-gradient(0deg, #015EEA, #00C0FA);
-		border-radius: 32rpx;
-		line-height: 64rpx;
-		text-align: center;
-		margin-right: 20rpx;
-	}
-	.bottomBox{
-		position: fixed;
-		bottom: 0;
-		width: 100%;
-		left: 0;
-		height:98rpx ;
-		background-color: #FFFFFF;
-		display: flex;
-		justify-content: space-between;
-		align-items: center;
-		padding: 0 30rpx;
-	}
-	.blackFont{
-		color: #333333;
-		margin: 0 4rpx;
-	}
-	.wk_icon{
-		width: 24rpx;
-		height: 24rpx;
-		margin-right: 12rpx;
-	}
-	.noteTag{
-		ont-size: 24rpx;
-		font-family: PingFang SC;
-		font-weight: 500;
-		color: #999999;
-		align-items: center;
-	}
-	.priceTag{
-		font-size: 30rpx;
-		font-family: PingFang SC;
-		font-weight: bold;
-		color: #FF2D55;
-	}
-	.titleTag{
-		font-size: 32rpx;
-		font-weight: bold;
-		color: #333333;
-		margin-left: 8rpx;
-	}
-	.yearTag{
-		width: 80rpx;
-		height: 32rpx;
-		background: #EBF5FF;
-		border: 2rpx solid #007AFF;
-		border-radius: 16rpx;
-		font-size: 24rpx;
-		color: #007AFF;
-		text-align: center;
-		line-height: 32rpx;
-	}
-	.itemBox{
-		background: #FFFFFF;
-		box-shadow: 0rpx 10rpx 9rpx 1rpx rgba(165, 196, 239, 0.1);
-		border-radius: 24rpx;
-		width: 100%;
-		padding: 20rpx;
-		margin-bottom: 20rpx;
-	}
+}
+.btn2 {
+	width: 200rpx;
+	height: 64rpx;
+	background: linear-gradient(0deg, #ffb102, #fd644f);
+	box-shadow: 0rpx 10rpx 16rpx 4rpx rgba(1, 99, 235, 0.04);
+	border-radius: 32rpx;
+	line-height: 64rpx;
+	text-align: center;
+}
+.btn1 {
+	width: 200rpx;
+	height: 64rpx;
+	background: linear-gradient(0deg, #015eea, #00c0fa);
+	border-radius: 32rpx;
+	line-height: 64rpx;
+	text-align: center;
+	margin-right: 20rpx;
+}
+.bottomBox {
+	position: fixed;
+	bottom: 0;
+	width: 100%;
+	left: 0;
+	height: 98rpx;
+	background-color: #ffffff;
+	display: flex;
+	justify-content: space-between;
+	align-items: center;
+	padding: 0 30rpx;
+}
+.blackFont {
+	color: #333333;
+	margin: 0 4rpx;
+}
+.wk_icon {
+	width: 24rpx;
+	height: 24rpx;
+	margin-right: 12rpx;
+}
+.noteTag {
+	ont-size: 24rpx;
+	font-family: PingFang SC;
+	font-weight: 500;
+	color: #999999;
+	align-items: center;
+}
+.priceTag {
+	font-size: 30rpx;
+	font-family: PingFang SC;
+	font-weight: bold;
+	color: #ff2d55;
+}
+.titleTag {
+	font-size: 32rpx;
+	font-weight: bold;
+	color: #333333;
+	margin-left: 8rpx;
+}
+.yearTag {
+	width: 80rpx;
+	height: 32rpx;
+	background: #ebf5ff;
+	border: 2rpx solid #007aff;
+	border-radius: 16rpx;
+	font-size: 24rpx;
+	color: #007aff;
+	text-align: center;
+	line-height: 32rpx;
+}
+.itemBox {
+	background: #ffffff;
+	box-shadow: 0rpx 10rpx 9rpx 1rpx rgba(165, 196, 239, 0.1);
+	border-radius: 24rpx;
+	width: 100%;
+	padding: 20rpx;
+	margin-bottom: 20rpx;
+}
 </style>

+ 54 - 8
pages2/bank/questionBank.vue

@@ -301,7 +301,7 @@
 												</view>
 											</view>
 										</view>
-										<view class="ans_submit answerInfos" v-if="bank.ques[ansIndex] || bank.ques[ansIndex].imageList.length || bank.ques[ansIndex].text">
+										<view class="ans_submit answerInfos" v-if="bank.ques[ansIndex] && (bank.ques[ansIndex].imageList.length || bank.ques[ansIndex].text)">
 											<view class="answerTitle">我的答案</view>
 											{{ bank.ques[ansIndex].text || ''}}
 											<view class="imgs">
@@ -424,6 +424,8 @@
 							? `您还有${lastCount}道题未作答, 现在继续作答,还是下次继续?`
 							: cgType === 6
 							? `您还有${lastCount}道题未作答, 您确定要交卷吗?`
+							: cgType == 9
+							? `您已完成所有题目,快去交卷吧!?` 
 							: ''
 					}}
 				</view>
@@ -432,13 +434,17 @@
 					<view class="btnsty btns2" @click="showpopups = false">继续做题</view>
 				</view>
 				<view class="classFootsty" v-if="cgType === 7">
-					<view class="btnsty btns1" @click="showpopups = false">下次继续</view>
-					<view class="btnsty btns2" @click="backPages">结束做题</view>
+					<view class="btnsty btns1" @click="backPages">下次继续</view>
+					<view class="btnsty btns2" @click="submit">结束做题</view>
 				</view>
 				<view class="classFootsty" v-if="cgType === 8">
 					<view class="btnsty btns1" @click="backPages()">下次继续</view>
 					<view class="btnsty btns2" @click="showpopups = false">继续作答</view>
 				</view>
+				<view class="classFootsty" v-if="cgType === 9">
+					<view class="btnsty btns1" @click="showpopups = false">暂不交卷</view>
+					<view class="btnsty btns2" @click="submit">立即交卷</view>
+				</view>
 			</view>
 		</u-popup>
 	</view>
@@ -515,7 +521,7 @@ export default {
 					uni.showToast({
 						icon:'none',
 						mask:true,
-						title:'考试时间到,自动交卷',
+						title:'考试时间到,系统将自动交卷',
 						duration:10000
 					})
 
@@ -637,7 +643,8 @@ export default {
 									return false;
 								}
 							} else if (jsonItem.type == 5) {
-								if (item.ques[indexs] && (item.ques[indexs].text.length || item.ques[indexs].imageList.length)) {
+								if (item.ques[indexs] && (item.ques[indexs].text || item.ques[indexs].imageList.length)) {
+									console.log('chil')
 									return true;
 								} else {
 									return false;
@@ -654,7 +661,8 @@ export default {
 					//简答题
 					if(hasSpecail) {
 						
-						if (item.ansText && (item.ansText.text.length || item.ansText.imageList.length)) {
+						if (item.ques && (item.ques.text || item.ques.imageList.length)) {
+							console.log(5,item)
 							count++;
 						}
 					}
@@ -663,6 +671,16 @@ export default {
 
 			return count;
 		},
+		/**
+		 * 是否做完所有题目
+		 */
+		isDoOver() {
+			let questionOverNum = this.questionOverNum(true); //获取已经回答的题目数(包括简答和案例)
+			if(this.questionList.length == questionOverNum) { //全部做完弹窗
+				this.cgType = 9;
+				this.showpopups = true;
+			}
+		},
 		/**
 		 * 暂不交卷
 		 */
@@ -1050,7 +1068,7 @@ export default {
 								uni.showToast({
 									icon:'none',
 									mask:true,
-									title:'考试时间到,自动交卷',
+									title:'考试时间到,系统将自动交卷',
 									duration:10000
 								})
 
@@ -1109,7 +1127,7 @@ export default {
 										ansArr[index] = json.answerQuestion;
 									} else if (json.type == 5) {
 										ansArr[index] = {
-											text: '',
+											text: json.answerQuestion,
 											imageList: []
 										};
 										json.ansText = {
@@ -1139,6 +1157,7 @@ export default {
 		radioSelect(optionsId, bindex) {
 			if (this.questionList[bindex].ques) return;
 			this.$set(this.questionList[bindex], 'ques', optionsId);
+			this.isDoOver();
 
 			// 回答错误
 			if (this.questionList[bindex].ques != this.questionList[bindex].ans) {
@@ -1171,6 +1190,7 @@ export default {
 		radioSelectChild(optionsId, ansIndex, bindex) {
 			if (this.questionList[bindex].ques[ansIndex]) return;
 			this.$set(this.questionList[bindex].ques, ansIndex, optionsId);
+			this.isDoOver();
 		},
 
 		/**
@@ -1200,6 +1220,7 @@ export default {
 			});
 
 			this.$set(this.questionList[bindex], 'ques', arr);
+			this.isDoOver();
 
 			let isWrong = this.questionList[bindex].ques.some((quesItem, quesIndex) => {
 				return this.questionList[bindex].ques[quesIndex] != this.questionList[bindex].ans[quesIndex];
@@ -1242,6 +1263,7 @@ export default {
 			});
 
 			this.$set(this.questionList[bindex].ques, ansIndex, arr);
+			this.isDoOver();
 		},
 
 		/**
@@ -1252,6 +1274,7 @@ export default {
 		judgeSelect(index, bindex) {
 			if (this.questionList[bindex].ques) return;
 			this.$set(this.questionList[bindex], 'ques', index + '');
+			this.isDoOver();
 			// 回答错误
 			if (this.questionList[bindex].ques != this.questionList[bindex].ans) {
 				this.$api
@@ -1286,6 +1309,7 @@ export default {
 		judgeSelectChild(ansindex, childindex, bindex) {
 			if (this.questionList[bindex].ques[ansindex]) return;
 			this.$set(this.questionList[bindex].ques, ansindex, childindex + '');
+			this.isDoOver();
 		},
 
 		openFooterTab() {
@@ -1330,6 +1354,26 @@ export default {
 					return;
 				}
 			// } 
+			
+				if(this.bankType == 2) {
+					if(this.lastTime > 0) {
+						let lastTime = this.countdown(this.lastTime)
+						uni.showModal({
+							title:'提示',
+							content:`时间还剩余${lastTime},确定交卷吗?`,
+							confirmText:'交卷',
+							cancelText:'继续答题',
+							success:(res) => {
+								if(res.confirm) { //确定
+									this.submit();
+								} else {  //取消
+									
+								}
+							}
+						})
+						return;
+					}
+				}
 			this.submit();
 		},
 		/**
@@ -1732,6 +1776,7 @@ export default {
 				imageList: this.questionList[bankindex].ansText.imageList || [],
 				text: this.questionList[bankindex].ansText.text || ''
 			});
+			this.isDoOver()
 		},
 
 		/**
@@ -1753,6 +1798,7 @@ export default {
 				imageList: this.questionList[bankindex].jsonStr[ansindex].ansText.imageList || [],
 				text: this.questionList[bankindex].jsonStr[ansindex].ansText.text || ''
 			});
+			this.isDoOver()
 		},
 
 		isRight(item, index) {

+ 29 - 12
pages2/bank/questionBankContinue.vue

@@ -275,7 +275,7 @@
 												</view>
 											</view>
 										</view>
-										<view class="ans_submit answerInfos" v-if="bank.ques[ansIndex] || bank.ques[ansIndex].text || bank.ques[ansIndex].imageList.length">
+										<view class="ans_submit answerInfos" v-if="bank.ques[ansIndex] && (bank.ques[ansIndex].text || bank.ques[ansIndex].imageList.length)">
 											<view class="answerTitle">我的答案</view>
 											{{bank.ques[ansIndex].text || ''}}
 											<view class="imgs" v-if="bank.ques[ansIndex] && bank.ques[ansIndex].imageList.length">
@@ -361,6 +361,8 @@
 							? `您还有${lastCount}道题未作答, 现在继续作答,还是下次继续?`
 							: cgType === 6
 							? `您还有${lastCount}道题未作答, 您确定要交卷吗?`
+							: cgType == 9
+							? `您已完成所有题目,快去交卷吧!?` 
 							: ''
 					}}
 				</view>
@@ -369,13 +371,17 @@
 					<view class="btnsty btns2" @click="showpopups = false">继续做题</view>
 				</view>
 				<view class="classFootsty" v-if="cgType === 7">
-					<view class="btnsty btns1" @click="showpopups = false">下次继续</view>
-					<view class="btnsty btns2" @click="backPages">结束做题</view>
+					<view class="btnsty btns1" @click="backPages">下次继续</view>
+					<view class="btnsty btns2" @click="submit">结束做题</view>
 				</view>
 				<view class="classFootsty" v-if="cgType === 8">
 					<view class="btnsty btns1" @click="backPages()">下次继续</view>
 					<view class="btnsty btns2" @click="showpopups = false">继续作答</view>
 				</view>
+				<view class="classFootsty" v-if="cgType === 9">
+					<view class="btnsty btns1" @click="showpopups = false">暂不交卷</view>
+					<view class="btnsty btns2" @click="submit">立即交卷</view>
+				</view>
 			</view>
 		</u-popup>
 	</view>
@@ -478,7 +484,6 @@ export default {
 		 * 点击后退按钮
 		 */
 		clickLeft() {
-			if(this.isContinue) {
 				
 				let ansCount = this.questionOverNum(true); //已答题数
 				this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
@@ -493,12 +498,6 @@ export default {
 					// this.isLastCount = true;
 				}
 				this.showpopups = true;   
-			} else {
-				uni.navigateBack({
-					delta:1
-				})
-			}
-			
 		},
 		/**
 		 * 获取已经回答的题目数
@@ -540,7 +539,7 @@ export default {
 					//简答题
 					if(hasSpecail) {
 						
-						if (item.ansText && (item.ansText.text.length || item.ansText.imageList.length)) {
+						if (item.ques && (item.ques.text.length || item.ques.imageList.length)) {
 							count++;
 						}
 					}
@@ -557,6 +556,16 @@ export default {
 				delta: 1
 			});
 		},
+		/**
+		 * 是否做完所有题目
+		 */
+		isDoOver() {
+			let questionOverNum = this.questionOverNum(true); //获取已经回答的题目数(包括简答和案例)
+			if(this.questionList.length == questionOverNum) { //全部做完弹窗
+				this.cgType = 9;
+				this.showpopups = true;
+			}
+		},
 		pdsubmit() {
 			// if (this.bankType == 1) {
 				let ansCount = this.questionOverNum(true); //已答题数
@@ -573,7 +582,7 @@ export default {
 		goodsQuestionList() {
 			//继续答题
 				
-			console.log(this.isContinue,"继续做题")
+			console.log("继续做题")
 			this.$api.examReport(this.recordId).then(res => {
 				let json = JSON.parse(res.data.data.historyExamJson)
 				
@@ -609,6 +618,7 @@ export default {
 			
 			if(this.questionList[bindex].ques) return;
 			this.$set(this.questionList[bindex],'ques',optionsId)
+			this.isDoOver()
 			
 		},
 		examRecordEdit() {
@@ -679,6 +689,7 @@ export default {
 			
 			if(this.questionList[bindex].ques[ansIndex]) return;
 			this.$set(this.questionList[bindex].ques,ansIndex,optionsId)
+			this.isDoOver()
 			
 		},
 		
@@ -875,6 +886,7 @@ export default {
 			})
 			
 			this.$set(this.questionList[bindex],'ques',arr)
+			this.isDoOver()
 			
 		},
 		
@@ -892,12 +904,14 @@ export default {
 			})
 			
 			this.$set(this.questionList[bindex].ques,ansIndex,arr)
+			this.isDoOver()
 		},
 		
 		judgeSelect(index,bindex) {
 			
 			if(this.questionList[bindex].ques) return;
 			this.$set(this.questionList[bindex],'ques',index+'')
+			this.isDoOver()
 			
 		},
 		
@@ -905,6 +919,7 @@ export default {
 			
 			if(this.questionList[bindex].ques[ansindex]) return;
 			this.$set(this.questionList[bindex].ques,ansindex,childindex+'')
+			this.isDoOver()
 		},
 		
 		/**
@@ -1248,6 +1263,7 @@ export default {
 				imageList:this.questionList[bankindex].ansText.imageList,
 				text:this.questionList[bankindex].ansText.text,
 			})
+			this.isDoOver()
 			
 		},
 		
@@ -1266,6 +1282,7 @@ export default {
 				imageList:this.questionList[bankindex].jsonStr[ansindex].ansText.imageList,
 				text:this.questionList[bankindex].jsonStr[ansindex].ansText.text,
 			})
+			this.isDoOver()
 			
 		},
 		

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 30 - 867
pages2/bank/questionBankExplain.vue


+ 6 - 1
pages2/bank/question_detail.vue

@@ -182,7 +182,12 @@ export default {
 						})
 			        } else if (res.cancel) {
 						uni.navigateTo({
-							url:'/pages2/bank/questionBankExplain?explain=1&recordId='+recordId +'&id=' +examId +'&goodsid=' +goodsId +'&moduleId='+moduleId+'&chapterId=' +chapterExamId
+							url:'/pages2/bank/questionBankAllExplain?id=' + examId +
+									'&goodsid=' + goodsId +
+									'&moduleId=' + moduleId +
+									'&chapterId=' + chapterExamId +
+									'&recordId='+ recordId
+							
 						})
 			            console.log('查看上次答题');
 			        }

+ 2 - 2
pages2/bank/question_record.vue

@@ -29,7 +29,7 @@
 					<view class="btn" v-if="record.status == 1" @click="doRepeat(record.examId, record.goodsId, record.moduleExamId, record.chapterExamId)">重做</view>
 					<navigator
 						:url="
-							'/pages2/bank/questionBankExplain?explain=1&id=' +
+							'/pages2/bank/questionBankExplain?id=' +
 								record.examId +
 								'&goodsid=' +
 								record.goodsId +
@@ -42,7 +42,7 @@
 					>
 						<view class="btn" v-if="record.status == 1">解析</view>
 					</navigator>
-					<navigator  hover-class="none" :url="'/pages2/bank/question_report?examId='+record.examId+'&hideBtns=1&id=' + record.recordId"><view class="btn" v-if="record.status == 1">报告</view></navigator>
+					<navigator  hover-class="none" :url="'/pages2/bank/question_report?examId='+record.examId+'&id=' + record.recordId"><view class="btn" v-if="record.status == 1">报告</view></navigator>
 					<navigator
 						:url="
 							'/pages2/bank/questionBankContinue?recordId=' +

+ 3 - 4
pages2/bank/question_report.vue

@@ -104,9 +104,8 @@ export default {
 		
 	},
 	async onLoad(option) {
-		this.id = option.id;
+		this.recordId = option.id;
 		this.examId = option.examId;
-		this.hideBtns = Boolean(option.hideBtns);
 		
 		this.examWrongRecordWrongNum();
 		await this.bankExam();
@@ -249,7 +248,7 @@ export default {
 		},
 		examWrongRecordWrongNum() {
 			return new Promise(resolve => {
-				this.$api.examWrongRecordWrongNum(this.id).then(res => {
+				this.$api.examWrongRecordWrongNum(this.recordId).then(res => {
 					this.wrongRecordWrongNum = res.data.data;
 					resolve();
 				});
@@ -280,7 +279,7 @@ export default {
 		},
 		examReport() {
 			return new Promise(resolve => {
-				this.$api.examReport(this.id).then(res => {
+				this.$api.examReport(this.recordId).then(res => {
 					this.reportdata = res.data.data;
 					resolve()
 				});

+ 0 - 71
pages2/bank/question_statistics.vue

@@ -62,24 +62,6 @@
 												</view>
 											</view>
 										</view>
-										<!-- <navigator
-											:url="
-												'/pages2/bank/questionBankExplain?continue=1&recordId=' +
-													article.recordId +
-													'&id=' +
-													article.examId +
-													'&goodsid=' +
-													article.goodsId +
-													'&moduleId=' +
-													article.moduleExamId +
-													'&chapterId=' +
-													article.chapterExamId +
-													''
-											"
-										>
-											<view class="btn" v-if="article.recordStatus == 0">继续</view>
-										</navigator>
-										<view class="btn" v-if="article.recordStatus == 1" @click="doRepeat(article.recordId,article.examId,article.goodsId,article.moduleExamId,article.chapterExamId)">重做</view> -->
 										<navigator  hover-class="none" :url="'/pages2/bank/questionBankExplainDetail?goodsId='+article.goodsId+'&examId='+article.examId">
 											<view class="btn">详情</view>
 										</navigator>
@@ -113,23 +95,6 @@
 										</view>
 									</view>
 								</view>
-								<!-- <navigator
-									:url="
-										'/pages2/bank/questionBankExplain?continue=1&recordId=' +
-											article.recordId +
-											'&id=' +
-											article.examId +
-											'&goodsid=' +
-											article.goodsId +
-											'&moduleId=0&chapterId=' +
-											article.chapterExamId +
-											''
-									"
-								>
-									<view class="btn" v-if="article.recordStatus == 0">继续</view>
-								</navigator>
-								
-								<view class="btn" v-if="article.recordStatus == 1" @click="doRepeat(article.recordId,article.examId,article.goodsId,0,article.chapterExamId)">重做</view> -->
 								<navigator  hover-class="none" :url="'/pages2/bank/questionBankExplainDetail?goodsId='+article.goodsId+'&examId='+article.examId">
 									<view class="btn">详情</view>
 								</navigator>
@@ -152,20 +117,6 @@
 									</view>
 								</view>
 							</view>
-							<!-- <navigator
-								:url="
-									'/pages2/bank/questionBankExplain?continue=1&recordId=' +
-										item1.recordId +
-										'&id=' +
-										item1.majorId +
-										'&goodsid=' +
-										item1.goodsId +
-										'&moduleId=0&chapterId=0'
-								"
-							>
-								<view class="btn" v-if="item1.recordStatus == 0">继续</view>
-							</navigator>
-								<view class="btn" v-if="item1.recordStatus == 1" @click="doRepeat(item1.recordId,item1.majorId,item1.goodsId,0,0)">重做</view> -->
 							<navigator  hover-class="none" :url="'/pages2/bank/questionBankExplainDetail?goodsId='+item1.goodsId+'&examId='+item1.majorId">
 								<view class="btn">详情</view>
 							</navigator>
@@ -236,28 +187,6 @@ export default {
 		});
 	},
 	methods: {
-		doRepeat(recordId,examId,goodsId,chapterExamId) {
-			uni.showModal({
-			    title: '提示',
-			    content: '是否清空答案重做?',
-				cancelText:'查看上次',
-				cancelColor:'',
-				confirmText:'重做',
-				confirmColor:'',
-			    success: (res) => {
-			        if (res.confirm) {
-						uni.navigateTo({
-							url:'/pages2/bank/questionBank?id=' +examId +'&goodsid=' +goodsId +'&moduleId=0&chapterId=' +chapterExamId
-						})
-			        } else if (res.cancel) {
-						uni.navigateTo({
-							url:'/pages2/bank/questionBankExplain?isHistory=1&recordId='+recordId +'&id=' +examId +'&goodsid=' +goodsId +'&moduleId=0&chapterId=' +chapterExamId
-						})
-			            console.log('查看上次答题');
-			        }
-			    }
-			});
-		},
 		goodsBankDolist() {
 			this.$api
 				.goodsBankDolist({

+ 90 - 38
pages2/class/questionBank.vue

@@ -412,6 +412,8 @@
 							? `您还有${lastCount}道题未作答, 现在继续作答,还是下次继续?`
 							: cgType === 6
 							? `您还有${lastCount}道题未作答, 您确定要交卷吗?`
+							: cgType == 9
+							? `您已完成所有题目,快去交卷吧!?` 
 							: ''
 					}}
 				</view>
@@ -427,6 +429,10 @@
 					<view class="btnsty btns1" @click="leaveNow()">下次继续</view>
 					<view class="btnsty btns2" @click="showpopups = false">继续作答</view>
 				</view>
+				<view class="classFootsty" v-if="cgType === 9">
+					<view class="btnsty btns1" @click="showpopups = false">暂不交卷</view>
+					<view class="btnsty btns2" @click="submit">立即交卷</view>
+				</view>
 			</view>
 		</u-popup>
 		<u-mask :show="photoPopup" >
@@ -490,6 +496,7 @@ export default {
 			avatarUrl:'',
 			ossAvatarUrl: '',
 			goodsDetail:{},
+			isTakePhoto:false,
 			needPhoto:false //是否需要拍照
 		};
 	},
@@ -511,7 +518,8 @@ export default {
 			this.showDialog = true;
 			uni.setStorageSync('showDialog','1');
 		}
-
+		
+		//考试时候用手势或者返回键 被迫返回做题
 		if (isBack) {
 			console.log(getApp());
 			let app = getApp();
@@ -520,22 +528,29 @@ export default {
 			for (var k in globalData.bankData) {
 				this[k] = globalData.bankData[k];
 			}
-
-			this.timer = setInterval(() => {
-				if (this.lastTime <= 0) {
-					clearInterval(this.timer);
-					uni.showToast({
-						icon:'none',
-						mask:true,
-						title:'考试时间到,自动交卷',
-						duration:10000
-					})
-
-					this.submit();
-					return;
+			
+			//需要拍没拍过直接弹出摄像头
+			if(this.needPhoto && !this.isTakePhoto) {
+				this.photoPopup = true;
+			} else { //不需要拍照
+				if(this.lastTime) {
+					this.timer = setInterval(() => {
+						if (this.lastTime <= 0) {
+							clearInterval(this.timer);
+							uni.showToast({
+								icon:'none',
+								mask:true,
+								title:'考试时间已到,系统将自动交卷',
+								duration:10000
+							})
+					
+							this.submit();
+							return;
+						}
+						this.lastTime--;
+					}, 1000);
 				}
-				this.lastTime--;
-			}, 1000);
+			}
 		} else {
 			this.goodsQuestionList();
 			this.bankExam();
@@ -553,7 +568,7 @@ export default {
 			app.globalData.bankData = this.$data;
 			clearInterval(this.timer);
 			uni.navigateTo({
-				url: '/pages2/bank/questionBank?id=' + this.id + '&goodsid=' + this.goodsId + '&isback=true'
+				url: '/pages2/class/questionBank?id=' + this.id + '&goodsid=' + this.goodsId + '&isback=true'
 			});
 		} else {
 			//点击返回按钮确认允许退出,交卷
@@ -569,7 +584,7 @@ export default {
 				if (self.goodsDetail.goodsPhotoExamConfig) {
 					let goodsPhotoExamConfig = JSON.parse(self.goodsDetail.goodsPhotoExamConfig);
 					if (goodsPhotoExamConfig.photograph > 0) {
-						self.needPhoto = true;
+						// self.needPhoto = true;
 					}
 				}
 				
@@ -583,6 +598,25 @@ export default {
 			};
 			this.$api.studyExamPhotoRecord(data).then(res => {
 				self.ossAvatarUrl = ''
+				self.isTakePhoto = true;
+				//拍照
+				if(this.lastTime) {
+					this.timer = setInterval(() => {
+						if (this.lastTime <= 0) {
+							clearInterval(this.timer);
+							uni.showToast({
+								icon:'none',
+								mask:true,
+								title:'考试时间已到,系统将自动交卷',
+								duration:10000
+							})
+					
+							this.submit();
+							return;
+						}
+						this.lastTime--;
+					}, 1000);
+				}
 			});
 		},
 		uploadFile(options, int) {
@@ -789,7 +823,7 @@ export default {
 					//简答题
 					if(hasSpecail) {
 						
-						if (item.ansText && (item.ansText.text.length || item.ansText.imageList.length)) {
+						if (item.ques && (item.ques.text.length || item.ques.imageList.length)) {
 							count++;
 						}
 					}
@@ -798,6 +832,16 @@ export default {
 
 			return count;
 		},
+		/**
+		 * 是否做完所有题目
+		 */
+		isDoOver() {
+			let questionOverNum = this.questionOverNum(true); //获取已经回答的题目数(包括简答和案例)
+			if(this.questionList.length == questionOverNum) { //全部做完弹窗
+				this.cgType = 9;
+				this.showpopups = true;
+			}
+		},
 		/**
 		 * 暂不交卷
 		 */
@@ -1090,25 +1134,7 @@ export default {
 					}
 					this.allTimes = res.data.data[0].answerTime * 60;
 					this.lastTime = res.data.data[0].answerTime && res.data.data[0].answerTime * 60;
-					//考试时间到了自动交卷
-					if (this.lastTime) {
-						this.timer = setInterval(() => {
-							if (this.lastTime <= 0) {
-								clearInterval(this.timer);
-								uni.showToast({
-									icon:'none',
-									mask:true,
-									title:'考试时间到,自动交卷',
-									duration:10000
-								})
-
-								this.submit();
-								return;
-							}
-							this.lastTime--;
-						}, 1000);
-					} else {
-					}
+					
 					res.data.data.forEach((item, index) => {
 						if (typeof item.jsonStr == 'string') {
 							item.jsonStr = JSON.parse(item.jsonStr);
@@ -1210,6 +1236,24 @@ export default {
 					this.recordId = res.data.data;
 					if(self.needPhoto){
 						self.photoPopup = true; //拍照
+					} else {
+						if(this.lastTime) {
+							this.timer = setInterval(() => {
+								if (this.lastTime <= 0) {
+									clearInterval(this.timer);
+									uni.showToast({
+										icon:'none',
+										mask:true,
+										title:'考试时间已到,系统将自动交卷',
+										duration:10000
+									})
+							
+									this.submit();
+									return;
+								}
+								this.lastTime--;
+							}, 1000);
+						}
 					}
 					
 				});
@@ -1221,6 +1265,7 @@ export default {
 		radioSelect(optionsId, bindex) {
 			if (this.questionList[bindex].ques) return;
 			this.$set(this.questionList[bindex], 'ques', optionsId);
+			this.isDoOver()
 		},
 
 		/**
@@ -1229,6 +1274,7 @@ export default {
 		radioSelectChild(optionsId, ansIndex, bindex) {
 			if (this.questionList[bindex].ques[ansIndex]) return;
 			this.$set(this.questionList[bindex].ques, ansIndex, optionsId);
+			this.isDoOver()
 		},
 
 		/**
@@ -1258,6 +1304,7 @@ export default {
 			});
 
 			this.$set(this.questionList[bindex], 'ques', arr);
+			this.isDoOver()
 
 			let isWrong = this.questionList[bindex].ques.some((quesItem, quesIndex) => {
 				return this.questionList[bindex].ques[quesIndex] != this.questionList[bindex].ans[quesIndex];
@@ -1277,6 +1324,7 @@ export default {
 			});
 
 			this.$set(this.questionList[bindex].ques, ansIndex, arr);
+			this.isDoOver()
 		},
 
 		/**
@@ -1287,6 +1335,7 @@ export default {
 		judgeSelect(index, bindex) {
 			if (this.questionList[bindex].ques) return;
 			this.$set(this.questionList[bindex], 'ques', index + '');
+			this.isDoOver()
 		},
 
 		/**
@@ -1298,6 +1347,7 @@ export default {
 		judgeSelectChild(ansindex, childindex, bindex) {
 			if (this.questionList[bindex].ques[ansindex]) return;
 			this.$set(this.questionList[bindex].ques, ansindex, childindex + '');
+			this.isDoOver()
 		},
 
 		openFooterTab() {
@@ -1679,6 +1729,7 @@ export default {
 				imageList: this.questionList[bankindex].ansText.imageList,
 				text: this.questionList[bankindex].ansText.text
 			});
+			this.isDoOver()
 		},
 
 		/**
@@ -1700,6 +1751,7 @@ export default {
 				imageList: this.questionList[bankindex].jsonStr[ansindex].ansText.imageList,
 				text: this.questionList[bankindex].jsonStr[ansindex].ansText.text
 			});
+			this.isDoOver()
 		},
 
 		isRight(item, index) {

+ 41 - 7
pages2/exam/exam_appointment.vue

@@ -112,7 +112,7 @@
 				<u-line color="#EEEEEE" />
 				<view class="foot" v-if="activeList.subscribeStatus === 1">
 					<view class="btn" @click="hideModel">知道了</view>
-					<view class="btn cancel" v-if="isShowFun(activeList.applyEndTime)" @click="cancelBtn">取消预约</view>
+					<view class="btn cancel" v-if="isShowFun(activeList)" @click="cancelBtn">取消预约</view>
 				</view>
 				<view class="foot" v-else><view class="abtns" @click="hideModel">知道了</view></view>
 			</view>
@@ -185,12 +185,38 @@ export default {
 		};
 	},
 	methods: {
-		isShowFun(times){
-			var timestamp=parseInt(new Date().getTime() / 1000)
-			if(times < timestamp){
-				return false
-			}else{
-				return true
+		isShowFun(times) {
+			var timestamp = parseInt(new Date().getTime() / 1000);
+			var newDataAge = parseInt(new Date(new Date().toLocaleDateString()).getTime() / 1000);
+			if (times.applyEndTime < timestamp) {
+				return false;
+			} else {
+				if (times.beforeStatus === 1) {
+					return false;
+				} else if (times.examStatus !== 0) {
+					return false;
+				} else if (times.applySiteExamTime < times.newDataAge) {
+					return false;
+				} else if (times.applySiteExamTime > times.newDataAge) {
+					return true;
+				} else if (times.applySiteExamTime == times.newDataAge) {
+					var hours = new Date().getHours();
+					var mins = new Date().getMinutes();
+					var arrays = times.applySiteStartTime.split('-').map(Number);
+					if (arrays[0] > hours) {
+						return true;
+					} else if (arrays[0] < hours) {
+						return false;
+					} else {
+						if (arrays[1] <= mins) {
+							return false;
+						} else {
+							return true;
+						}
+					}
+				} else {
+					return true;
+				}
 			}
 		},
 		showDetails(item) {
@@ -204,6 +230,14 @@ export default {
 			this.details_show = false;
 		},
 		submit() {
+			var bols = this.isShowFun(this.activeList)
+			if(!bols){
+				uni.showToast({
+					icon:"none",
+					title:"当前已无法取消预约"
+				})
+				return
+			}
 			this.$api
 				.editApply({
 					subscribeId: this.activeList.subscribeId,

+ 78 - 23
pages2/register/forget.vue

@@ -5,13 +5,13 @@
 		<view style="padding: 30rpx;">
 			<view class="login_box">
 				<u-form :model="form" ref="uForm" >
-					<u-form-item ><u-input  v-model="form.tel" type="number" maxlength="11" placeholder="手机号"/></u-form-item>
-					<u-form-item >
-						<u-input v-model="form.code" type="number"  placeholder="验证码"/>
+					<u-form-item prop="tel" ref="tel"><u-input  v-model="form.tel" type="number" maxlength="11" placeholder-style="color:#999999" placeholder="手机号"/></u-form-item>
+					<u-form-item prop="code">
+						<u-input v-model="form.code" type="number" placeholder-style="color:#999999"  placeholder="验证码"/>
 						<u-button slot="right"  size="mini" @click="getCode">{{codeTips}}</u-button>
 					</u-form-item>
-					<u-form-item ><u-input v-model="form.pwd" type="password" placeholder="请输入新密码"/></u-form-item>
-					<u-form-item ><u-input v-model="form.pwdAgain" type="password" placeholder="再次输入新密码"/></u-form-item>
+					<u-form-item prop="pwd"><u-input class="password" placeholder-style="color:#999999" v-model="form.pwd" type="password" placeholder="请输入新密码"/></u-form-item>
+					<u-form-item prop="pwdAgain"><u-input class="password" placeholder-style="color:#999999" v-model="form.pwdAgain" type="password" placeholder="再次输入新密码"/></u-form-item>
 				</u-form>
 			</view>
 			
@@ -35,6 +35,50 @@ export default {
 				pwd:'',
 				pwdAgain:''
 			},
+			rules: {
+				tel: [
+					{ 
+						required: true, 
+						message: '请输入手机号', 
+						// 可以单个或者同时写两个触发验证方式 
+						trigger: ['change','blur'],
+					},
+					{
+						validator: (rule, value, callback) => {
+							// 上面有说,返回true表示校验通过,返回false表示不通过
+							// this.$u.test.mobile()就是返回true或者false的
+							return this.$u.test.mobile(value);
+						},
+						message: '手机号码格式不正确',
+						// 触发器可以同时用blur和change
+						trigger: ['change','blur'],
+					}
+				],
+				pwd: [
+					{ 
+						required: true, 
+						message: '请输入密码', 
+						// 可以单个或者同时写两个触发验证方式 
+						trigger: ['change','blur'],
+					}
+				],
+				pwdAgain: [
+					{ 
+						required: true, 
+						message: '请输入密码', 
+						// 可以单个或者同时写两个触发验证方式 
+						trigger: ['change','blur'],
+					}
+				],
+				code: [
+					{ 
+						required: true, 
+						message: '请输入验证码', 
+						// 可以单个或者同时写两个触发验证方式 
+						trigger: ['change','blur'],
+					}
+				],
+			},
 			codeTips: '',
 			read:'',
 			isUse:false
@@ -108,25 +152,26 @@ export default {
 		getCode() {
 			let that = this
 			if(that.$refs.uCode.canGetCode) {
-				if(!this.form.tel){
-					this.$u.toast('请输入手机号码');
-					return 
+				if(that.$refs.tel.validateState == 'success') {
+					let datas = {tel:this.form.tel}
+					that.$api.forgetSms(datas).then(
+						res => {
+							if (res.data.code == 200) {
+								that.$u.toast('验证码已发送');
+								// 通知验证码组件内部开始倒计时
+								that.$refs.uCode.start();
+							} else {
+								that.$u.toast(res.data.msg);
+							}
+						},
+						err => {
+							console.log(err);
+						});
+				} else {
+					this.$refs.tel.onFieldBlur()
 				}
-				let datas = {tel:this.form.tel}
-				that.$api.forgetSms(datas).then(
-					res => {
-						if (res.data.code == 200) {
-							that.$u.toast('验证码已发送');
-							// 通知验证码组件内部开始倒计时
-							that.$refs.uCode.start();
-						} else {
-							that.$u.toast(res.data.msg);
-						}
-					},
-					err => {
-						console.log(err);
-					}
-			);}
+			}
+				
 		},
 		sectionChange(index) {
 			this.current = index;
@@ -191,6 +236,7 @@ export default {
 		}
 	},
 	onLoad(option) {
+		this.$refs.uForm.setRules(this.rules)
 		let that = this;
 		this.from = option.from;
 		uni.login({
@@ -252,6 +298,15 @@ export default {
 		border-radius: 24rpx;
 		margin-top: 30rpx;
 		padding:40rpx 35rpx;
+		
+		.password {
+			/deep/.uicon-eye-fill {
+				&::before{
+					color:#007AFF;
+					content:"\e613";
+				}
+			}
+		}
 	}
 	/deep/ .u-item-bg{
 		border-radius: 32px !important;

+ 112 - 67
pages2/register/register.vue

@@ -5,12 +5,12 @@
 		<view style="padding: 30rpx;">
 			<view class="login_box">
 				<u-form :model="form" ref="uForm" >
-					<u-form-item ><u-input  v-model="form.tel" type="number" maxlength="11" placeholder="手机号"/></u-form-item>
-					<u-form-item >
-						<u-input v-model="form.code"  type="number" placeholder="验证码"/>
+					<u-form-item prop="tel" ref="tel"><u-input  v-model="form.tel" type="number" maxlength="11" placeholder-style="color:#999999" placeholder="手机号"/></u-form-item>
+					<u-form-item prop="code">
+						<u-input v-model="form.code"  type="number" placeholder-style="color:#999999" placeholder="验证码"/>
 						<u-button slot="right"  size="mini" @click="getCode">{{codeTips}}</u-button>
 					</u-form-item>
-					<u-form-item ><u-input v-model="form.pwd" type="password" placeholder="请输入登录密码"/></u-form-item>
+					<u-form-item prop="pwd"><u-input v-model="form.pwd" type="password" placeholder-style="color:#999999" placeholder="请输入登录密码"/></u-form-item>
 				</u-form>
 			</view>
 			<view style="margin: 30rpx 0;">
@@ -23,9 +23,7 @@
 			<button :disabled="isUse" class="loginBtn" :class="{able:canRegister()}" @click="submit">
 				确定
 			</button>
-			
-			
-			
+		
 		</view>
 		<u-verification-code seconds="60" ref="uCode" @change="codeChange"></u-verification-code>
 	</view>
@@ -42,6 +40,42 @@ export default {
 			},
 			codeTips: '',
 			read:false,
+			rules: {
+				tel: [
+					{ 
+						required: true, 
+						message: '请输入手机号', 
+						// 可以单个或者同时写两个触发验证方式 
+						trigger: ['change','blur'],
+					},
+					{
+						validator: (rule, value, callback) => {
+							// 上面有说,返回true表示校验通过,返回false表示不通过
+							// this.$u.test.mobile()就是返回true或者false的
+							return this.$u.test.mobile(value);
+						},
+						message: '手机号码格式不正确',
+						// 触发器可以同时用blur和change
+						trigger: ['change','blur'],
+					}
+				],
+				pwd: [
+					{ 
+						required: true, 
+						message: '请输入密码', 
+						// 可以单个或者同时写两个触发验证方式 
+						trigger: ['change','blur'],
+					}
+				],
+				code: [
+					{ 
+						required: true, 
+						message: '请输入验证码', 
+						// 可以单个或者同时写两个触发验证方式 
+						trigger: ['change','blur'],
+					}
+				],
+			},
 			isUse:false
 		};
 	},
@@ -55,49 +89,58 @@ export default {
 		},
 		submit(){
 			let that = this
-			if(!this.form.tel){
-				this.$u.toast('请输入手机号码');
-				return 
-			}
-			if(!this.form.code){
-				this.$u.toast('请输入验证码');
-				return 
-			}
-			if(!this.form.pwd){
-				this.$u.toast('请输入注册密码');
-				return 
-			}
-			if(!this.read){
-				this.$u.toast('请勾选服务协议');
-				return 
-			}
-			that.isUse = true
-			let datas = {
-				tel:this.form.tel,
-				code:this.form.code,
-				pwd:this.form.pwd
-				}
-			that.$api.registerUser(datas).then(
-				res => {
-					that.isUse = false
-					if (res.data.code == 200) {
-						uni.showModal({
-							title: '提示',
-							content: '注册成功',
-							showCancel:false,
-							success: function(resst) {
-								uni.navigateBack()
-							}
-						});
-					} else {
-						that.$u.toast(res.data.msg);
+			// if(!this.form.tel){
+			// 	this.$u.toast('请输入手机号码');
+			// 	return 
+			// }
+			// if(!this.form.code){
+			// 	this.$u.toast('请输入验证码');
+			// 	return 
+			// }
+			// if(!this.form.pwd){
+			// 	this.$u.toast('请输入注册密码');
+			// 	return 
+			// }
+			// if(!this.read){
+			// 	this.$u.toast('请勾选服务协议');
+			// 	return 
+			// }
+			this.$refs.uForm.validate(valid => {
+				if(valid) {
+					if(!this.read){
+						this.$u.toast('请勾选服务协议');
+						return 
 					}
-				},
-				err => {
-					that.isUse = false
-					console.log(err);
+					that.isUse = true
+					let datas = {
+						tel:this.form.tel,
+						code:this.form.code,
+						pwd:this.form.pwd
+						}
+					that.$api.registerUser(datas).then(
+						res => {
+							that.isUse = false
+							if (res.data.code == 200) {
+								uni.showModal({
+									title: '提示',
+									content: '注册成功',
+									showCancel:false,
+									success: function(resst) {
+										uni.navigateBack()
+									}
+								});
+							} else {
+								that.$u.toast(res.data.msg);
+							}
+						},
+						err => {
+							that.isUse = false
+							console.log(err);
+						}
+					);
 				}
-			);
+			})
+			
 		},
 		radioGroupChange(e) {
 			 console.log(e);
@@ -109,25 +152,26 @@ export default {
 		getCode() {
 			let that = this
 			if(that.$refs.uCode.canGetCode) {
-				if(!this.form.tel){
-					this.$u.toast('请输入手机号码');
-					return 
-				}
-				let datas = {tel:this.form.tel}
-				that.$api.registerSms(datas).then(
-					res => {
-						if (res.data.code == 200) {
-							that.$u.toast('验证码已发送');
-							// 通知验证码组件内部开始倒计时
-							that.$refs.uCode.start();
-						} else {
-							that.$u.toast(res.data.msg);
+				if(that.$refs.tel.validateState == 'success') {
+					let datas = {tel:this.form.tel}
+					that.$api.registerSms(datas).then(
+						res => {
+							if (res.data.code == 200) {
+								that.$u.toast('验证码已发送');
+								// 通知验证码组件内部开始倒计时
+								that.$refs.uCode.start();
+							} else {
+								that.$u.toast(res.data.msg);
+							}
+						},
+						err => {
+							console.log(err);
 						}
-					},
-					err => {
-						console.log(err);
-					}
-			);}
+					);	
+				} else {
+					this.$refs.tel.onFieldBlur()
+				}
+			}
 
 		},
 		sectionChange(index) {
@@ -194,6 +238,7 @@ export default {
 	},
 	onLoad(option) {
 		let that = this;
+		this.$refs.uForm.setRules(this.rules)
 		this.from = option.from;
 		uni.login({
 			provider: 'weixin',
@@ -248,7 +293,7 @@ export default {
 	}
 	.login_box{
 		width: 100%;
-		height: 463rpx;
+		height: 500rpx;
 		background: #FFFFFF;
 		box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(1, 99, 235, 0.1);
 		border-radius: 24rpx;

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно