From cc344ede1a270d5607fd20c386971b771446cc38 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 04 Mar 2022 15:58:30 +0800
Subject: [PATCH] 考试相关更改

---
 components/dyw-answer/answer.vue |  100 ++++++
 /dev/null                        |   43 ---
 pages/business/business.vue      |  282 +++++++++++++++++++++
 pages/exam/examTextPage.vue      |   73 +++--
 common/api/examFunc.js           |   46 ---
 pages/exam/examResultPage.vue    |    8 
 store/state.js                   |    1 
 pages/exam/startexam.vue         |   18 
 store/actions.js                 |  183 +++++++------
 9 files changed, 531 insertions(+), 223 deletions(-)

diff --git a/common/api/exam.js b/common/api/exam.js
deleted file mode 100644
index 235a6a5..0000000
--- a/common/api/exam.js
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * @Author: Morpheus
- * @Date: 2021-05-09 15:17:44
- * @Last Modified by: Morpheus
- * @Last Modified time: 2021-12-24 11:26:04
- */
-// 校区
-import request from '@/common/axios'
-
-export const enterExam = (params) => {
-    return request({
-        url: '/simulateExamRecord/beginExam',
-        method: 'POST',
-        data: params
-    })
-}
-
-export const submitExam = (params) => {
-    return request({
-        url: '/simulateExamRecord/saveSimulateExam',
-        method: 'POST',
-        data: params
-    })
-}
\ No newline at end of file
diff --git a/common/api/examFunc.js b/common/api/examFunc.js
index cbe77f3..292075c 100644
--- a/common/api/examFunc.js
+++ b/common/api/examFunc.js
@@ -12,11 +12,11 @@
 	let queTypeArr = []
 
 	quesModules.forEach((item, index) => {
-		
-		
+
+
 
 		let quesType = item.choicesType
-		
+
 		// 是否答题了
 		item.selectedFlag = false
 		// 答题的结果
@@ -24,32 +24,20 @@
 		// 题目是否做对
 		item.correctOrError = false
 
-
 		queTypeArr.push(quesType)
 
-		item.template = item.choicesType
-
-		if (item.template == 1) {
+		if (item.choicesType == 1 || item.choicesType == 3) {
 			item.dualChooseArr = []
 		}
 
 
 		item.options = item.examSubjectOptions
 
-		if (item.template == 2) {
-			item.rightAnswer = item.answer
-		}
-		
-		if (item.template == 0 || item.template == 1) {
-			item.options.forEach(it => {
-				it.newOptLetter = it.optionName
-				it.optContent = it.optionContent
-				it.optLetter = it.newOptLetter
-			})
+		if (item.choicesType == 0 || item.choicesType == 1 || item.choicesType == 3) {
 			item.options.reverse()
 		}
 
-		
+
 		questionList.push(item)
 
 	})
@@ -58,26 +46,4 @@
 
 	store.state.questionList = questionList
 
-}
-
-export const topicOptions = (options) => {
-
-	var questionList = store.state.questionList
-
-	questionList.forEach((item, index) => {
-
-	})
-
-	store.state.questionList = questionList
-
-	// for (let j = 0; j < quesModules[i].examSubjectOptions.length; j++) {
-	// 	// 解决theoryExamAnswer可能为null的问题,把它赋值为字符串
-	// 	quesModules[i].examSubjectOptions[j].tempAnswer = "" //暂存每题的答案
-	// 	quesModules[i].examSubjectOptions[j].template = quesModules[i].choicesType //防止template初始值是null
-	// 	quesModules[i].examSubjectOptions[j].recordId = store.state.examDetail
-	// 		.id //搬移recordId的位置
-	// 	quesModules[i].examSubjectOptions[j].blankArr = [] //新建blankArr属性,临时保存填空题答案
-	// 	quesModules[i].examSubjectOptions[j].dualChooseArr = [] //新建blankArr属性,临时保存填空题答案
-	// 	questionList.push(quesModules[i].examSubjectOptions[j])
-	// }
 }
diff --git a/common/axios.js b/common/axios.js
deleted file mode 100644
index 97852e0..0000000
--- a/common/axios.js
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * 全站http配置
- *
- * axios参数说明
- * isSerialize是否开启form表单提交
- * isToken是否需要token
- */
-import axios from "axios";
-
-const service = axios.create({
-  baseURL: "http://192.168.0.114:81", //正常接口
-  timeout: 600000, // request timeout
-});
-
-// 返回其他状态码
-service.defaults.validateStatus = function (status) {
-  return status >= 200 && status <= 500;
-};
-
-// 跨域请求,允许保存cookie
-service.defaults.withCredentials = true;
-
-// http request拦截
-service.interceptors.request.use(
-  (config) => {
-    return config;
-  },
-  (error) => {
-    return Promise.reject(error);
-  }
-);
-
-// http response 拦截
-service.interceptors.response.use(
-  (res) => {
-    return res;
-  },
-  (error) => {
-    return Promise.reject(new Error(error));
-  }
-);
-
-export default service;
diff --git a/components/dyw-answer/answer.vue b/components/dyw-answer/answer.vue
index 5925787..6e42e28 100644
--- a/components/dyw-answer/answer.vue
+++ b/components/dyw-answer/answer.vue
@@ -5,15 +5,14 @@
 	paper 模拟考试 知识点练习 -->
 	<view class="container">
 		<!-- 大标题 -->
-
 		<u-navbar class="header" id="header" height="44" back-icon-color="#fff" title="模拟考试" title-color="#fff"
 			:background="{background: '#103289'}" :custom-back="exitExam">
 			<u-button class="slot-wrap-right" type="primary" size="mini" @click="handleSubmit(1)">交卷
 			</u-button>
 		</u-navbar>
-
+		
 		<!-- 小标题栏 -->
-		<view id="subHeader">
+		<view id="subHeader" :style="{'margin-top': subHeaderTop}">
 			<view class="sub-header" v-if='questionList.length > 0'>
 				<u-tag class="typeTag" :text="answerStatusName" mode="dark" shape="circle" />
 				<view v-if="examDetail.exam.examTime<=0">不限时</view>
@@ -87,6 +86,28 @@
 							</template>
 						</view>
 
+						<!-- type == 3 实操题 -->
+						<view class="content-solutions" v-if='item.choicesType == 3'>
+							<view style="color: #103289;">
+								您选择的顺序为:<text style="text-decoration: underline;">{{item.tempAnswer}}</text>
+							</view>
+							<template v-for='subItem in item.options'>
+								<view class="content-solutions-item"
+									@click='!item.selectedFlag && chooseMutiSolution(item,subItem)'>
+									<view class="content-solutions-item-single">
+										{{subItem.optionName}}
+									</view>
+
+									<view
+										:class="item.tempAnswer.indexOf(subItem.optionName) > -1 ? 'content-solutions-item-select' : ''"
+										class="content-solutions-item-content">{{subItem.optionContent}}</view>
+								</view>
+							</template>
+							<u-button v-show="!item.selectedFlag" type="primary" shape="circle"
+								:custom-style="{backgroundColor: '#103289'}" @click="pictureConfirm(item)">确认答案
+							</u-button>
+						</view>
+
 						<view class="explain" v-if="item.selectedFlag">
 							<view>
 								<view style="display: flex; justify-content: flex-start; align-items: center;">
@@ -121,6 +142,7 @@
 			<view class="footer-right" @click='handleChangeCurrentSwiper(1)'>下一题</view>
 		</view>
 
+
 		<!-- 答题卡弹出层 -->
 		<modal v-model="showQuestion">
 			<view class='question-modal' :style="{'height': modalHeight}">
@@ -135,17 +157,17 @@
 							<template v-for="(item, index) in questionList">
 								<view v-show="item.choicesType == subItem.value">
 									<!-- 未作答 -->
-									<view v-if="item.tempAnswer == ''"
+									<view v-if="!item.selectedFlag"
 										class="question-modal-body-item question-modal-body-item-unselect"
 										@click="handleJumpSwiper(index)">
 										{{index + 1 }}
 									</view>
 									<!-- 回答正确 -->
-									<view v-else-if='item.tempAnswer == item.answer'
+									<view v-else-if='item.selectedFlag && item.tempAnswer == item.answer'
 										class="question-modal-body-item question-modal-body-item-right"
 										@click="handleJumpSwiper(index)">{{index + 1 }}</view>
 									<!-- 回答错误 -->
-									<view v-else-if='item.tempAnswer != item.answer'
+									<view v-else-if='item.selectedFlag && item.tempAnswer != item.answer'
 										class="question-modal-body-item question-modal-body-item-failed"
 										@click="handleJumpSwiper(index)">{{index + 1 }}</view>
 								</view>
@@ -183,6 +205,7 @@
 	export default {
 		data() {
 			return {
+				subHeaderTop: 0,
 				isreadOnly: true,
 				quesModules: [],
 				judgeArr: [{
@@ -210,8 +233,8 @@
 						be: false,
 					},
 					{
-						name: '填空题',
-						value: '4',
+						name: '实操题',
+						value: '3',
 						be: false,
 					},
 					{
@@ -260,6 +283,9 @@
 						case 2:
 							// 判断题
 							break;
+						case 3:
+							// 实操题
+							break;
 
 						default:
 					}
@@ -297,8 +323,8 @@
 					case 2:
 						return '判断题'
 						break;
-					case 4:
-						return '填空题'
+					case 3:
+						return '实操题'
 						break;
 					case 5:
 						return '简答题'
@@ -336,7 +362,10 @@
 				uni.getSystemInfo({
 					//获取手机屏幕高度信息,让swiper的高度和手机屏幕一样高                
 					success: function(res) {
-						tempHeight = res.windowHeight;
+						tempHeight = res.windowHeight - res.statusBarHeight;
+						
+						that.subHeaderTop = res.statusBarHeight + 'px'
+
 						that.modalHeight = res.windowHeight - uni.upx2px(200) + 'px';
 
 						that.modalContentHeight = res.windowHeight - uni.upx2px(360) + 'px';
@@ -431,11 +460,19 @@
 			},
 			// 多选题中的答案确认
 			confirm(item) {
+				if (item.tempAnswer == "")
+					return this.$refs.uToast.show({
+						title: '答案不能为空,请选择',
+						type: 'warning',
+						duration: 2000
+					})
+
+
+
 				let one = item.answer.split(',')
 				let two = item.tempAnswer.split(',')
 				let flag = true
 				if (one.length == two.length) {
-
 					one.forEach((item) => {
 						if (two.indexOf(item) == -1) {
 							flag = false
@@ -446,6 +483,44 @@
 					flag = false
 				}
 
+
+				item.selectedFlag = true
+
+				if (flag != false) item.correctOrError = true
+
+				this.$forceUpdate()
+
+				if (this.currentIndex < this.max) {
+					setTimeout(() => {
+						this.currentIndex += 1
+					}, 300)
+				}
+			},
+			// 实操题中的答案确认
+			pictureConfirm(item) {
+				if (item.tempAnswer == "") {
+					this.$refs.uToast.show({
+						title: '答案不能为空,请选择',
+						type: 'warning',
+						duration: 2000
+					})
+
+					return
+				}
+
+				let one = item.answer.split(',')
+				let two = item.tempAnswer.split(',')
+				let flag = true
+				if (one.length == two.length) {
+					one.forEach((item, index) => {
+						if (item != two[index]) {
+							flag = false
+							return
+						}
+					})
+				} else {
+					flag = false
+				}
 
 				item.selectedFlag = true
 
@@ -538,6 +613,7 @@
 		font-size: 32rpx;
 		font-weight: bold;
 		background-color: #FFFFFF;
+		box-shadow: 0 0 5px 1px #eee;
 	}
 
 	.footer {
diff --git a/pages/business/business.vue b/pages/business/business.vue
index 3b48f0a..d449e51 100644
--- a/pages/business/business.vue
+++ b/pages/business/business.vue
@@ -1,6 +1,42 @@
 <template>
 	<view class="container">
-		<u-empty text="功能研发中" mode="favor" margin-top="400"></u-empty>
+		<view class="head">
+			<u-navbar :is-fixed="false" :border-bottom="false" :is-back="true" back-icon-name="arrow-leftward"
+				back-icon-color="#fff" back-icon-size="35" :background="{ background: '#103289' }" title="工作台"
+				title-color="#fff"></u-navbar>
+			<view class="head-bg"></view>
+			<!-- 我的订阅 start -->
+			<view class="card sub">
+				<view class="title">常用工具</view>
+				<view class="list">
+					<u-grid :col="4" :border="false">
+						<u-grid-item bg-color="transparent" v-for="(item, index) in dataOne" :key="index">
+							<navigator hover-class="none" class="nav-item" @click="goOnePage(item.url,index)">
+								<image :src="item.img" mode="widthFix" class="nav-item-img"></image>
+								<view class="nav-item-name">{{item.title}}</view>
+							</navigator>
+						</u-grid-item>
+					</u-grid>
+				</view>
+			</view>
+			<!-- 我的订阅 end -->
+
+			<view class="card wrap">
+				<view class="title">管理</view>
+				<view class="list">
+					<u-grid :col="4" :border="false">
+						<u-grid-item bg-color="transparent" v-for="(item, index) in dataTwo" :key="index">
+							<navigator hover-class="none" url="" class="nav-item" @click="goTwoPage(item.url,index)">
+								<image :src="item.img" mode="widthFix" class="nav-item-img"></image>
+								<view class="nav-item-name">{{item.title}}</view>
+							</navigator>
+						</u-grid-item>
+					</u-grid>
+				</view>
+			</view>
+
+		</view>
+		<u-toast ref="uToast" />
 		<!-- 底部导航条 -->
 		<u-tabbar :list="tabbar" :mid-button="false"></u-tabbar>
 	</view>
@@ -11,20 +47,258 @@
 		data() {
 			return {
 				tabbar: this.$store.state.tabbar,
+				dataOne: [{
+					title: '群防任务',
+					img: '../../static/workbench/task1.png',
+					url: ''
+				}, {
+					title: '巡逻任务',
+					img: '../../static/workbench/task2.png',
+					url: '/pages/patrol/patrol'
+				}, {
+					title: '事件上报',
+					img: '../../static/workbench/task3.png',
+					url: '/pages/reported/reported'
+				}, {
+					title: '积分商城',
+					img: '../../static/workbench/task8.png',
+					url: ''
+				}, {
+					title: '通讯录',
+					img: '../../static/workbench/task4.png',
+					url: ''
+				}, {
+					title: '电子证件',
+					img: '../../static/workbench/task9.png',
+					url: ''
+				}],
+				dataTwo: [{
+						title: '参与投票',
+						img: '../../static/workbench/task5.png',
+						url: '/pages/voting/voteManage'
+					}, {
+						title: '投票发起',
+						img: '../../static/workbench/task7.png',
+						url: '/pages/voting/vote'
+					}, {
+						title: '投票排行',
+						img: '../../static/workbench/task6.png',
+						url: '/pages/voting/votRanking'
+					}
+					// ,{
+					// 	title:'模拟考试',
+					// 	img:'../../static/workbench/exam.png',
+					// 	url:'/pages/exam/startexam'
+					// }
+				]
 			};
 		},
 		onLoad() {
-
+			if (this.$store.state.billFlag) this.dataTwo.push({
+				title: '模拟考试',
+				img: '../../static/workbench/exam.png',
+				url: '/pages/exam/startexam'
+			})
 		},
 		mounted() {
-			
+			if (this.$store.state.UserData.stype != "1") {
+				this.$refs.uToast.show({
+					title: '功能暂未开放',
+					type: 'warning',
+				});
+			}
 		},
 		methods: {
-	
+			//页面跳转
+			goOnePage(url, index) {
+				if (this.$store.state.UserData.stype != "1") {
+					this.$refs.uToast.show({
+						title: '功能暂未开放',
+						type: 'warning',
+					});
+					return;
+				} else if (index == "0" || index == "3" || index == "4") {
+					this.$refs.uToast.show({
+						title: '功能研发中',
+						type: 'warning',
+					});
+					return;
+				} else if (index == 5) {
+					this.getUser();
+				} else {
+					uni.navigateTo({
+						url: url
+					})
+				}
+			},
+			//获取用户信息
+			getUser() {
+				var that = this;
+				debugger
+				uni.request({
+					url: that.$store.state.BaopiAPI + '/blade-user/detail',
+					method: 'GET',
+					data: {
+						cardid: that.$store.state.UserData.cardid,
+						isDeleted: 0,
+						status: 1,
+					},
+					success: (res) => {
+						if (res.statusCode == "200") {
+							var urls = "http://223.82.109.183:2080/securityInfo.html?securityNumber=" + res
+								.data.data.securitynumber;
+							uni.navigateTo({
+								url: '../voting/information?url=' + urls
+							});
+						} else {
+							this.$refs.uToast.show({
+								title: '暂无证件信息',
+								type: 'warning',
+							});
+						}
+					}
+				});
+			},
+			goTwoPage(url, index) {
+				if (url == '/pages/exam/startexam') uni.navigateTo({
+					url: url
+				})
+				if (this.$store.state.UserData.stype != "1") {
+					this.$refs.uToast.show({
+						title: '功能暂未开放',
+						type: 'warning',
+					});
+					return;
+				} else if (index == "2") {
+					this.$refs.uToast.show({
+						title: '功能研发中',
+						type: 'warning',
+					});
+					return;
+				} else {
+					uni.navigateTo({
+						url: url
+					})
+				}
+			},
 		}
 	};
 </script>
 
 <style lang="scss">
+	.container {
+		background-color: #f7f7f7;
+		min-height: 100vh;
+		overflow: hidden;
+	}
 
+	.head {
+		position: relative;
+		top: 0;
+		left: 0;
+		z-index: 1;
+	}
+
+	.head-bg {
+		position: absolute;
+		left: 0px;
+		top: 0px;
+		z-index: -1;
+		width: 750rpx;
+		height: 270rpx;
+		background: #103289;
+	}
+
+	.card {
+		margin: 30rpx;
+		background: #ffffff;
+		border-radius: 20rpx;
+		margin-top: 36rpx;
+	}
+
+	.sub {
+		.title {
+			padding-top: 36rpx;
+			display: flex;
+			justify-content: center;
+			align-items: center;
+
+			font-size: 30rpx;
+			font-family: Source Han Sans CN;
+			font-weight: 500;
+			color: #000000;
+
+			&::before {
+				content: '';
+				display: block;
+				width: 135rpx;
+				height: 1rpx;
+				background: #e4e7ed;
+				margin: 0 17rpx;
+			}
+
+			&::after {
+				content: '';
+				display: block;
+				width: 135rpx;
+				height: 1rpx;
+				background: #e4e7ed;
+				margin: 0 17rpx;
+			}
+		}
+	}
+
+	.list {
+		display: flex;
+		flex-wrap: wrap;
+		padding: 0 0 30rpx;
+
+		.nav-item {
+			width: 100%;
+			display: flex;
+			flex-direction: column;
+			justify-content: space-between;
+			align-items: center;
+			font-size: 30rpx;
+			font-family: Source Han Sans CN;
+			font-weight: 400;
+			color: #131313;
+			line-height: 48rpx;
+
+			&-img {
+				width: 64rpx;
+				height: 64rpx;
+				margin-bottom: 20rpx;
+			}
+
+			&-name {
+				font-size: 26rpx;
+				font-family: PingFang SC;
+				font-weight: 400;
+				color: #585b61;
+				opacity: 0.77;
+			}
+		}
+	}
+
+	.wrap {
+		.title {
+			padding: 36rpx 16rpx;
+			display: flex;
+			align-items: center;
+			font-size: 32rpx;
+			font-family: Source Han Sans CN;
+			font-weight: 500;
+			color: #000000;
+
+			&::before {
+				content: "";
+				display: block;
+				width: 5rpx;
+				height: 36rpx;
+				margin-right: 10rpx;
+				background: #103289;
+			}
+		}
+	}
 </style>
diff --git a/pages/exam/examResultPage.vue b/pages/exam/examResultPage.vue
index 3648fbf..846bdb9 100644
--- a/pages/exam/examResultPage.vue
+++ b/pages/exam/examResultPage.vue
@@ -15,6 +15,10 @@
 				<text class="val">{{totalQueNum}}题</text>
 			</view>
 			<view class="box">
+				<text class="title">总分数:</text>
+				<text class="val">{{totalScore}}分</text>
+			</view>
+			<view class="box">
 				<text class="title">答对:</text>
 				<text class="val">{{rightQueNum}}题</text>
 			</view>
@@ -46,11 +50,11 @@
 		data() {
 			return {
 				totalQueNum: '',
+				totalScore: '',
 				rightQueNum: '',
 				wrongQueNum: '',
 				noneQueNum: '',
 				score: '',
-
 			}
 		},
 		methods: {
@@ -64,8 +68,8 @@
 
 		},
 		onLoad(options) {
-			console.log(options, 77777)
 			this.totalQueNum = options.totalQueNum
+			this.totalScore = options.totalScore
 			this.rightQueNum = options.rightQueNum
 			this.wrongQueNum = options.wrongQueNum
 			this.noneQueNum = options.noneQueNum
diff --git a/pages/exam/examTextPage.vue b/pages/exam/examTextPage.vue
index 316e990..37fb949 100644
--- a/pages/exam/examTextPage.vue
+++ b/pages/exam/examTextPage.vue
@@ -13,13 +13,11 @@
 
 <script>
 	import Answer from '@/components/dyw-answer/answer.vue';
-	import {
-		enterExam,
-		submitExam
-	} from '@/common/api/exam'
+
 	import {
 		ModifyQuesList
 	} from '@/common/api/examFunc'
+	
 	export default {
 		data() {
 			return {
@@ -33,28 +31,32 @@
 
 			var that = this
 			// 理论考试
-			enterExam({
-				idCardNo: option.id
-			}).then(res => {
-				var examObj = res.data.data.simulateExamRecord
+			uni.request({
+				url: "http://z4042833u6.wicp.vip/simulateExamRecord/beginExam",
+				method: 'POST',
+				data: {
+					idCardNo: option.id
+				},
+				success: (res) => {
+					var examObj = res.data.data.simulateExamRecord
 
-				examObj.exam = {
-					name: '模拟考试',
-					examScore: 100,
-					examTime: res.data.data.simulateExamRecord.answerTime,
-					checkFace: 1,
-					...option
+					examObj.exam = {
+						name: '模拟考试',
+						examScore: 100,
+						examTime: res.data.data.simulateExamRecord.answerTime,
+						checkFace: 1,
+						...option
+					}
+
+					examObj.exam.totalQuestion = res.data.data.examSubjectInfo.length
+					examObj.totalQuestion = res.data.data.examSubjectInfo.length
+					that.$store.state.examDetail = examObj
+
+					that.$store.state.paperDetail = res.data.data.simulateExamRecord
+					// 提取出所有的题目
+					ModifyQuesList(res.data.data.examSubjectInfo)
 				}
-
-				examObj.exam.totalQuestion = res.data.data.examSubjectInfo.length
-				examObj.totalQuestion = res.data.data.examSubjectInfo.length
-				that.$store.state.examDetail = examObj
-
-				that.$store.state.paperDetail = res.data.data.simulateExamRecord
-				// 提取出所有的题目
-				ModifyQuesList(res.data.data.examSubjectInfo)
-			})
-
+			});
 		},
 		components: {
 			Answer
@@ -70,6 +72,7 @@
 			handleConfirm() {
 				let that = this
 				let totalQueNum = 0
+				let totalScore = 0
 				let rightQueNum = 0
 				let wrongQueNum = 0
 				let noneQueNum = 0
@@ -103,24 +106,40 @@
 						noneQueNum += 1
 					}
 					totalQueNum += 1
+					totalScore += item.score
 				})
+
+				if (noneQueNum == totalQueNum)
+					return this.$refs.uToast.show({
+						title: '请答题后再交卷',
+						type: 'warning',
+						duration: 2000
+					})
 
 				// 进行交卷的api请求
 				that.$u.route('/pages/exam/examResultPage', {
 					recordId: that.$store.state.examDetail.recordId,
 					totalQueNum: totalQueNum,
+					totalScore: totalScore,
 					rightQueNum: rightQueNum,
 					wrongQueNum: wrongQueNum,
 					noneQueNum: noneQueNum,
 					score: score
 				})
 
-				submitExam(sendData).then(res => {})
+
+				uni.request({
+					url: "http://z4042833u6.wicp.vip/simulateExamRecord/saveSimulateExam",
+					method: 'POST',
+					data: sendData,
+					success: (res) => {
+
+					}
+				});
 			},
 			/* 题目答案变化
 			 */
-			onChange(answer) {
-			}
+			onChange(answer) {}
 		}
 	}
 </script>
diff --git a/pages/exam/startexam.vue b/pages/exam/startexam.vue
index 741e7ad..096be8c 100644
--- a/pages/exam/startexam.vue
+++ b/pages/exam/startexam.vue
@@ -19,9 +19,8 @@
 			</ul>
 		</view>
 		<view class="btnArea">
-			<u-button class="btnClass" type="success" :ripple="true" shape="circle"
-				@click="enterExam">进入考试</u-button>
-			<u-button class="btnClass" type="error" :ripple="true" shape="circle" @click="exitExam">退出考试</u-button>
+			<u-button class="btnClass" type="success" shape="circle" @click="enterExam">进入考试</u-button>
+			<u-button class="btnClass" type="error" shape="circle" @click="exitExam">退出考试</u-button>
 		</view>
 		<u-toast ref="uToast" />
 	</view>
@@ -36,11 +35,11 @@
 		},
 		methods: {
 			enterExam() {
-				// 进入考试
-				this.$u.route('/pages/exam/examTextPage', {
-					id: this.examItem.id,
-					examType: 'exam',
+
+				uni.navigateTo({
+					url: '/pages/exam/examTextPage?examType=exam&id=' + this.examItem.id
 				})
+
 			},
 			exitExam() {
 				// 退出考试
@@ -49,8 +48,7 @@
 				})
 			}
 		},
-		computed: {
-		},
+		computed: {},
 		onLoad(options) {
 			// 页面跳转 传递对象 传对象
 			options = {
@@ -70,7 +68,7 @@
 		padding: 0 40rpx;
 		margin-left: -30rpx;
 		line-height: 64rpx;
-		
+
 	}
 
 	.subTitle {
diff --git a/store/actions.js b/store/actions.js
index 47c7c4c..6465dfc 100644
--- a/store/actions.js
+++ b/store/actions.js
@@ -3,95 +3,108 @@
 
 import websocket from "./websocket.js"
 import positions from "./positions.js"
+
+
 const actions = {
-	loging(store, data) {
-		var user = [{
-					name: '1',
-					password: '111111'
-				},
-				{
-					name: '2',
-					password: '222222'
-				},
-				{
-					name: '3',
-					password: '333333'
-				},
-			],
-			pasw = md5(data.pass),
-			url = this.state.piAPI + '/blade-auth/oauth/token?tenantId=000000&username=' + data.name +
-			' &password=' + pasw + '&grant_type=password&scope=all&type=account';
-		// url ='http://192.168.0.109:82/blade-auth/oauth/token';
-		// url ='http://192.168.0.109:82/blade-auth/oauth/token?tenantId=000000&username=admin&password=93369e86dc5fa854a0eaf75558c4039d&grant_type=password';
-		// url ='http://web.byisf.com/api/blade-auth/oauth/token?tenantId=000000&username=admin&password=93369e86dc5fa854a0eaf75558c4039d&grant_type=password&scope=all';
-		// console.log(url);
-		wx.request({ //uniapp 自带axios
-			url: url, //仅为示例,并非真实接口地址。
-			// data: d,
-			// data: {
-			// 	tenantId: '000000',
-			// 	username: data.name,
-			// 	password: pasw,
-			// 	grant_type: 'password',
-			// 	scope: 'all',
-			// 	type: "account"
-			// },
-			header: {
-				// "Content-Type":"",
-				"Authorization": "Basic c2FiZXI6c2FiZXJfc2VjcmV0",
-				"Tenant-Id": "000000"
+    loging (store, data) {
+        var user = [{
+            name: '1',
+            password: '111111'
+        },
+        {
+            name: '2',
+            password: '222222'
+        },
+        {
+            name: '3',
+            password: '333333'
+        },
+        ],
+            pasw = md5(data.pass),
+            url = this.state.piAPI + '/blade-auth/oauth/token?tenantId=000000&username=' + data.name +
+                ' &password=' + pasw + '&grant_type=password&scope=all&type=account'
+        // url ='http://192.168.0.109:82/blade-auth/oauth/token';
+        // url ='http://192.168.0.109:82/blade-auth/oauth/token?tenantId=000000&username=admin&password=93369e86dc5fa854a0eaf75558c4039d&grant_type=password';
+        // url ='http://web.byisf.com/api/blade-auth/oauth/token?tenantId=000000&username=admin&password=93369e86dc5fa854a0eaf75558c4039d&grant_type=password&scope=all';
+        // console.log(url);
+        wx.request({ //uniapp 自带axios
+            url: url, //仅为示例,并非真实接口地址。
+            // data: d,
+            // data: {
+            // 	tenantId: '000000',
+            // 	username: data.name,
+            // 	password: pasw,
+            // 	grant_type: 'password',
+            // 	scope: 'all',
+            // 	type: "account"
+            // },
+            header: {
+                // "Content-Type":"",
+                "Authorization": "Basic c2FiZXI6c2FiZXJfc2VjcmV0",
+                "Tenant-Id": "000000"
 
-				// "Cookie": "JSESSIONID=maOJY05vT2jj4nHwsQGSPgWWVFH1mY-TGWOLYCSh"
-			},
-			method: "post",
-			// 	// dataType: 'JSON',
-			success: (res) => {
-				if (res.statusCode == 200) {
-					if (res.data.error_code == "400") {
-						uni.hideNavigationBarLoading();
-						uni.showToast({
-							title: '密码错误,请重试',
-							icon: 'none',
-							duration: 2000
-						});
-						return;
-					}
-					store.commit('getUserData', res.data)
-					// console.log(res.data,123542);
-					data.isit = true;
-					data.userName = res.data.nick_name; //警袁姓名
-					data.userID = res.data.user_id; //警袁id
-					data.avatar = res.data.avatar; //头像
-					data.accounts = data.name;
-					data.pass = data.pass;
-					// data.userPhon = res.user_id;
-					store.commit('login', data);
+                // "Cookie": "JSESSIONID=maOJY05vT2jj4nHwsQGSPgWWVFH1mY-TGWOLYCSh"
+            },
+            method: "post",
+            // 	// dataType: 'JSON',
+            success: (res) => {
+                if (res.statusCode == 200) {
+                    if (res.data.error_code == "400") {
+                        uni.hideNavigationBarLoading()
+                        uni.showToast({
+                            title: '密码错误,请重试',
+                            icon: 'none',
+                            duration: 2000
+                        })
+                        return
+                    }
+                    store.commit('getUserData', res.data)
+                    // console.log(res.data,123542);
+                    data.isit = true
+                    data.userName = res.data.nick_name //警袁姓名
+                    data.userID = res.data.user_id //警袁id
+                    data.avatar = res.data.avatar //头像
+                    data.accounts = data.name
+                    data.pass = data.pass
+                    // data.userPhon = res.user_id;
+                    store.commit('login', data)
 
-				}
-			},
-			fail: (res) => {
-				console.log('失去连接 请稍等');
-				// console.log(res);
-			}
-		});
-		// var time = setTimeout(() => { //模拟请求时间
-		// 	var ud = user,
-		// 		isit = false;
-		// 	for (var key in ud) {
-		// 		if (ud[key].name == data.name && ud[key].password == data.pass) {
-		// 			isit = true;
-		// 			break;
-		// 		} else {
-		// 			isit = false;
-		// 		}
-		// 	}
-		// 	data.isit = isit;
-		// 	store.commit('login', data);
-		// }, 2000)
+                    wx.request({
+                        url: "http://z4042833u6.wicp.vip/userVip/getUserVipInfo?idCardNo=" + res
+                            .data.cardid,
+                        method: 'get',
+                        success: (result) => {
+                            if (JSON.stringify(result.data.data) != '{}') {
+                                store.state.billFlag = true
+                            }
+                        }
+                    })
 
-	},
-	...websocket.actions,
-	...positions.actions
+                }
+            },
+            fail: (res) => {
+                console.log('失去连接 请稍等')
+                // console.log(res);
+            }
+        })
+        // var time = setTimeout(() => { //模拟请求时间
+        // 	var ud = user,
+        // 		isit = false;
+        // 	for (var key in ud) {
+        // 		if (ud[key].name == data.name && ud[key].password == data.pass) {
+        // 			isit = true;
+        // 			break;
+        // 		} else {
+        // 			isit = false;
+        // 		}
+        // 	}
+        // 	data.isit = isit;
+        // 	store.commit('login', data);
+        // }, 2000)
+
+    },
+    ...websocket.actions,
+    ...positions.actions
 }
 
 export default actions
diff --git a/store/state.js b/store/state.js
index 1ebdbd6..8f3ea88 100644
--- a/store/state.js
+++ b/store/state.js
@@ -5,6 +5,7 @@
 	examDetail: {}, // 考试详情
 	questionList: [], // 考试考题列表
 	paperDetail: {},
+	billFlag: false,
 	queTypeArr:[0,0,0,0,0],
 	loging: false,
 	message: {

--
Gitblit v1.9.3