Parcourir la source

证书,考试,登陆

xionghaojie il y a 3 ans
Parent
commit
68fe35b466

+ 11 - 71
pages/certificateDetail/certificateDetail.vue

@@ -77,39 +77,15 @@
 				</view>
 			</view>
 			<!-- 答题卡区域 -->
-			<view class="test-info ddflex" v-if="false">
-				<view class="note-box">
+			<view class="test-info ddflex">
+				<view class="note-box" style="margin-top: 0;">
 					<view class="note-title ddflex">
-						<image class="note-title-icon" src="/static/images/wzgg.png"></image>
-						<view>网站提醒</view>
+						<image class="note-title-icon" src="/static/images/cjwt.png"</image>
+						<view>所有证书</view>
 					</view>
 					<view>
-						<view class="note-item ddflex" v-for="item,index in wztxList" :key="index" @click="jumpUrl('/pages/contentDetail/contentDetail?id='+item.id)">
-							<view class="note-item-content">{{item.title}}</view>
-						</view>
-					</view>
-				</view>
-				<!-- 学习资料 -->
-				<view class="note-box">
-					<view class="note-title ddflex">
-						<image class="note-title-icon" src="/static/images/xxzl.png"></image>
-						<view>学习资料</view>
-					</view>
-					<view>
-						<view class="note-item ddflex" v-for="item,index in xxzlList" :key="index" @click="jumpUrl('/pages/contentDetail/contentDetail?id='+item.id)">
-							<view class="note-item-content">{{item.title}}</view>
-						</view>
-					</view>
-				</view>
-				<!-- 常见问题 -->
-				<view class="note-box">
-					<view class="note-title ddflex">
-						<image class="note-title-icon" src="/static/images/cjwt.png"></image>
-						<view>常见问题</view>
-					</view>
-					<view>
-						<view class="note-item ddflex" v-for="item,index in cjwtList" :key="index" @click="jumpUrl('/pages/contentDetail/contentDetail?id='+item.id)">
-							<view class="note-item-content">{{item.title}}</view>
+						<view class="note-item ddflex" v-for="item,index in infoList" :key="index" @click="changeItem(item)">
+							<view class="note-item-content">{{index+1}}. {{item.cateName}}</view>
 						</view>
 					</view>
 				</view>
@@ -130,10 +106,8 @@
 		data() {
 			return {
 				options:{},
+				infoList:[],
 				info:{},
-				wztxList:[],
-				xxzlList:[],
-				cjwtList:[],
 			}
 		},
 		onReady() {},
@@ -146,10 +120,6 @@
 			}
 			this.options = req.getStorage('options')
 			this.getDetail()
-			
-			this.getTextwztxInfo()
-			this.getTextxxzlInfo()
-			this.getTextcjwtInfo()
 		},
 		onUnload() {
 			req.removeStorage('options')
@@ -162,43 +132,13 @@
 			},
 			getDetail(){
 				req.getRequest('/api/v3/exam/user/manager/certificate',this.options,res=>{
-					this.info = res
-				})
-			},
-			// 网站提醒
-			getTextwztxInfo(){
-				let form={
-					code:req.public.wztxCode,
-					page:1,
-					limit:5
-				}
-				req.getRequest('/api/content/list',form,res=>{
-					this.wztxList = res
-				})
-			},
-			// 学习资料
-			getTextxxzlInfo(){
-				let form={
-					code:req.public.xxzlCode,
-					page:1,
-					limit:5
-				}
-				req.getRequest('/api/content/list',form,res=>{
-					this.xxzlList = res
+					this.infoList = res
+					this.info = res[0]
 				})
 			},
-			// 常见问题
-			getTextcjwtInfo(){
-				let form={
-					code:req.public.cjwtCode,
-					page:1,
-					limit:5
-				}
-				req.getRequest('/api/content/list',form,res=>{
-					this.cjwtList = res
-				})
+			changeItem(item){
+				this.info = item
 			},
-			
 			// 时间格式化
 			dateYM(date){
 				return req.dateFormat(date).v6

+ 8 - 3
pages/login/login.vue

@@ -10,7 +10,7 @@
 				<view class="re-con">
 					<view class="re-tit">考生登录</view>
 					<view class="re-li dflex">
-						<input v-model="testNumber" type="number" placeholder="准考证号" maxlength="-1" placeholder-class="placeholder" class="re-ipt flex" />
+						<input v-model="testNumber" @blur="getTestProject" type="number" placeholder="身份证号" maxlength="-1" placeholder-class="placeholder" class="re-ipt flex" />
 					</view>
 					<uni-data-select
 					      v-model="paperId"
@@ -19,7 +19,7 @@
 						  placeholder="考试项目"
 					    ></uni-data-select>
 					<view class="re-btn" @click="okLogin()">登录</view>
-					<view class="re-btn-text" @click="queryScore">考生成绩查询</view>
+					<!-- <view class="re-btn-text" @click="queryScore">考生成绩查询</view> -->
 				</view>
 			</view>
 			<view class="bottom-content ddflex">
@@ -128,7 +128,12 @@ export default {
 		// 获取考试项目
 		getTestProject(){
 			console.log('11')
-			req.getRequest('/api/v3/exam/user/manager',{},res=>{
+			let data = {
+				
+			}
+			if(this.testNumber) data.idNumber = this.testNumber
+			else delete data.idNumber
+			req.getRequest('/api/v3/exam/user/manager',data,res=>{
 				console.log('this.range',res)
 				this.range = res.map(item=>{return {text:item.title,value:item.id}})
 				console.log(this.range)

+ 2 - 2
pages/scoreQuery/scoreQuery.vue

@@ -55,8 +55,8 @@
 							<view class="fflex">{{examResult.userName}}</view>
 						</view>
 						<view class="ddflex">
-							<view class="test-people-label">准考证号</view>
-							<view class="fflex" style="word-break: break-all;">{{examResult.admissionNo}}</view>
+							<view class="test-people-label">身份证号</view>
+							<view class="fflex" style="word-break: break-all;">{{examResult.idNumber}}</view>
 						</view>
 						<view class="ddflex">
 							<view class="test-people-label">考试科目</view>

+ 32 - 7
pages/selectTest/selectTest.vue

@@ -10,12 +10,13 @@
 			<view class="test-box">
 				<view class="test-title">选择考试试卷</view>
 				<view>
-					<view class="note-item" style="font-size: 16px;" v-for="item,index in testList" :key="index+'test'" @click="toTest(item)">
-						<view class="note-item-content">{{index+1}}.  {{item.title}}</view>
+					<view class="note-item ddflex" style="font-size: 16px;" v-for="item,index in testList" :key="index+'test'">
+						<view class="note-item-content" @click="item.resultId?'':toTest(item)">{{index+1}}.  {{item.title}}</view>
+						<view style="color: green;font-size: 14rpx;" v-if="item.resultId" @click="queryScore(item)">成绩查询</view>
 					</view>
 				</view>
 				
-				<uni-pagination style="margin-top: 30px;" title="标题文字" show-icon="true" total="50" current="2"></uni-pagination>
+				<!-- <uni-pagination style="margin-top: 30px;" title="标题文字" show-icon="true" total="50" current="2"></uni-pagination> -->
 				
 				<!-- <navigator class="back-btn ddflex" hover-class="none" open-type="navigateBack">
 					<image src="/static/images/back3.png"></image>
@@ -87,14 +88,19 @@
 				otherInfo:[],
 				noteInfo:[],
 				
-				testList:[]
+				testList:[],
+				
+				userInfo:{}
 			}
 		},
 		onReady() {},
 		onLoad(options) {
 			this.paperId = options.paperId;
 			this.admissionNo = options.admissionNo;
+		},
+		onShow() {
 			this.getTestProject()
+			this.getUserInfo()
 		},
 		methods: {
 			jumpUrl(url){
@@ -102,9 +108,15 @@
 					url:url
 				})
 			},
+			// 考试信息
+			getUserInfo(){
+				req.getRequest('/api/v3/exam/user/manager/info',{},res=>{
+					this.userInfo = res
+				})
+			},
 			// 获取考试项目
 			getTestProject(){
-				req.getRequest('/api/v3/exam/user/manager',{},res=>{
+				req.getRequest('/api/v3/exam/user/manager/paper',{examId:this.paperId},res=>{
 					this.testList = res
 				})
 			},
@@ -117,7 +129,7 @@
 						if(res.confirm){
 							uni.navigateTo({
 								// url: '/pages/test/test?paperId='+this.paperId,
-								url: '/pages/test/test?paperId='+item.id,
+								url: '/pages/test/test?paperId='+item.id+'&testId='+this.paperId,
 								success:()=> {
 									this.close()
 								}
@@ -127,7 +139,20 @@
 						}
 					}
 				})
-			}
+			},
+			// 成绩查询
+			queryScore(item){
+				var formP = {
+					admission: this.userInfo.admissionNo,
+					paperId: item.id
+				};
+				console.log(this.userInfo)
+				req.getRequest('/api/v3/exam/user/manager/result', formP, res => {
+						uni.navigateTo({
+							url:'/pages/scoreQuery/scoreQuery?paperId='+ item.id+'&admissionNo='+this.userInfo.admissionNo
+						})
+				});
+			},
 		}
 	}
 

+ 11 - 8
pages/test/test.vue

@@ -66,12 +66,12 @@
 							<view class="fflex">{{userInfo.userName}}</view>
 						</view>
 						<view class="ddflex">
-							<view class="test-people-label">准考证号</view>
-							<view class="fflex" style="word-break: break-all;">{{userInfo.admissionNo}}</view>
+							<view class="test-people-label">身份证号</view>
+							<view class="fflex" style="word-break: break-all;">{{userInfo.idNumber}}</view>
 						</view>
 						<view class="ddflex">
 							<view class="test-people-label">考试科目</view>
-							<view class="fflex">{{userInfo.cateName}}</view>
+							<view class="fflex">{{paper.title}}</view>
 						</view>
 					</view>
 				</view>
@@ -172,6 +172,7 @@
 				state:1,
 				
 				userInfo:{},
+				testId:null,//考试项目ID
 				
 				paperId: '', //考试题目
 				paperTitle: '', //考试标题
@@ -209,6 +210,7 @@
 		onReady() {},
 		async onLoad(options) {
 			this.paperId = options.paperId;
+			this.testId = options.testId
 
 			console.log(this.userInfo)
 			// 需要先判断用户是否还能考试
@@ -308,10 +310,10 @@
 								title:'提示',
 								content:'您已参加过该考试',
 								showCancel:false,
-								success(res) {
+								success:(res)=> {
 									if(res.confirm){
-										uni.reLaunch({
-											url:'/pages/login/login',
+										uni.redirectTo({
+											url:'/pages/selectTest/selectTest?paperId='+this.testId,
 											success() {
 												console.log('您已参加过该考试')
 											}
@@ -593,10 +595,11 @@
 				this.$refs.popup.open('center')
 			},
 			close(back) {
+				let _ts = this
 				this.$refs.popup.close()
 				if(back){
-					uni.reLaunch({
-						url:'/pages/login/login'
+					uni.redirectTo({
+						url:'/pages/selectTest/selectTest?paperId='+this.testId,
 					})
 				}
 			},