瀏覽代碼

添加预约考试条件限制

Tang 3 年之前
父節點
當前提交
7fd9c2e0f3
共有 2 個文件被更改,包括 26 次插入18 次删除
  1. 2 2
      common/request.js
  2. 24 16
      pages2/exam/exam_appointment.vue

+ 2 - 2
common/request.js

@@ -5,8 +5,8 @@ import api from './api.js'
 var num = 1
 //接口api   
 // export const BASE_URL = 'https://api.xyyxt.net'   //release
-export const BASE_URL = 'http://42.192.164.187:19005'  //test
-// export const BASE_URL = 'http://192.168.1.222:5055'    //dev
+// export const BASE_URL = 'http://42.192.164.187:19005'  //test
+export const BASE_URL = 'http://192.168.1.222:5055'    //dev
 
  //图片上传api
 // export const BASE_IMG_URL = 'https://file.xyyxt.net/'     //release

+ 24 - 16
pages2/exam/exam_appointment.vue

@@ -166,7 +166,7 @@ export default {
 	},
 	onPullDownRefresh() {},
 	onLoad(option) {
-		this.$api.getApplylist({ subscribeStatus: 1 }).then(res => {
+		this.$api.getApplylist({ subscribeStatus: 1, exceedExamExpend: 2 }).then(res => {
 			if (res.data.code === 200) {
 				this.listData = res.data.rows;
 			}
@@ -192,19 +192,19 @@ export default {
 				return false;
 			} else {
 				if (times.beforeStatus === 1) {
-					console.log(1)
+					console.log(1);
 					return false;
 				} else if (times.examStatus !== 0) {
-					console.log(2)
+					console.log(2);
 					return false;
 				} else if (times.applySiteExamTime < newDataAge) {
-					console.log(3)
+					console.log(3);
 					return false;
 				} else if (times.applySiteExamTime > newDataAge) {
-					console.log(4)
+					console.log(4);
 					return true;
 				} else if (times.applySiteExamTime == newDataAge) {
-					console.log(5)
+					console.log(5);
 					var hours = new Date().getHours();
 					var mins = new Date().getMinutes();
 					var arrays = times.applySiteStartTime.split('-').map(Number);
@@ -235,13 +235,13 @@ export default {
 			this.details_show = false;
 		},
 		submit() {
-			var bols = this.isShowFun(this.activeList)
-			if(!bols){
+			var bols = this.isShowFun(this.activeList);
+			if (!bols) {
 				uni.showToast({
-					icon:"none",
-					title:"当前已无法取消预约"
-				})
-				return
+					icon: 'none',
+					title: '当前已无法取消预约'
+				});
+				return;
 			}
 			this.$api
 				.editApply({
@@ -252,7 +252,7 @@ export default {
 					if (res.data.code === 200) {
 						this.cancel_show = false;
 						this.details_show = false;
-						this.$api.getApplylist({ subscribeStatus: 1 }).then(res => {
+						this.$api.getApplylist({ subscribeStatus: 1, exceedExamExpend: 2 }).then(res => {
 							this.listData = res.data.rows;
 						});
 					}
@@ -265,13 +265,21 @@ export default {
 			this.current = index;
 			var data = {};
 			if (index === 0) {
-				data.subscribeStatus = 1;
+				data = {
+					subscribeStatus: 1,
+					exceedExamExpend: 2
+				};
 			}
 			if (index === 1) {
-				data.subscribeStatus = 2;
+				data = {
+					subscribeStatus: 2
+				};
 			}
 			if (index === 2) {
-				data.subscribeStatus = 3;
+				data = {
+					subscribeStatus: 1,
+					exceedExamExpend: 1
+				};
 			}
 			this.$api.getApplylist(data).then(res => {
 				if (res.data.code === 200) {