Explorar o código

修复考试预约

Tang %!s(int64=3) %!d(string=hai) anos
pai
achega
6c02de98fd

+ 1 - 1
common/request.js

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

+ 14 - 1
pages2/appointment/index.vue

@@ -141,8 +141,10 @@ export default {
 					}
 					if (res.data.data === 3) {
 						this.$api.goodsList({ makeGoodsId: this.goodsId }).then(res => {
-							if (res.data.code === 200 && res.data.rows.length) {
+							if (res.data.code === 200) {
+								if(res.data.rows.length){
 								this.goodsIdBK = res.data.rows[0].goodsId;
+								}
 							}
 						});
 						this.showTip = true;
@@ -151,11 +153,22 @@ export default {
 			});
 		},
 		submit() {
+			if(!this.goodsIdBK){
+				uni.showModal({
+					showCancel:false,
+					content:"请联系管理员配置补考商品"
+				})
+			}else{
 			this.showTip = false;
+			this.$store.commit('updateBackApplyData',{
+				goodsId: this.goodsId,
+				gradeId: this.gradeId
+			})
 			this.$navTo.togo('/pages2/order/confirm_list', {
 				id: this.goodsIdBK,
 				isBK:'1'
 			});
+			}
 		}
 	}
 };

+ 19 - 3
pages2/appointment/kporder.vue

@@ -11,8 +11,15 @@
 			<view class="appointmentItem" v-if="activeList.length">
 				<view class="title">考前培训时间:</view>
 				<view class="main">
-					<view v-for="(item, index) in activeList" class="item" :key="index" @click="choItem(index)">
-						<view class="checkbox"><u-checkbox v-if="item.status === 0" v-model="item.checked" shape="circle"></u-checkbox></view>
+					<view v-for="(item, index) in activeList" class="item" :key="index" @click="choItem(index, item.examTime)">
+						<view class="checkbox">
+							<u-checkbox
+								:disabled="item.examTime >= applyDs.applySiteExamTime ? true : false"
+								v-if="item.status === 0"
+								v-model="item.checked"
+								shape="circle"
+							></u-checkbox>
+						</view>
 						<view class="box">
 							<view :class="['time', { active: item.checked }, { no: item.status !== 0 }]">{{ item.dataTime + ' ' + item.startTime + ' ~ ' + item.endTime }}</view>
 							<view class="statusInfo" v-if="item.status !== 0">
@@ -28,6 +35,9 @@
 					</view>
 				</view>
 			</view>
+			<view v-else class="appointmentItem">
+				<view class="title">当前考培地点无考前培训时间点</view>
+			</view>
 			<view class="btnMain">
 				<view class="return" @click="backPage">上一步</view>
 				<view class="sure" @click="sureOppoint">确定预约</view>
@@ -82,6 +92,7 @@ export default {
 	methods: {
 		getVuexData() {
 			this.applyDs = this.$store.getters.getApplyData;
+			console.log(this.applyDs.applySiteExamTime)
 		},
 		//获取考培地点
 		getInfo() {
@@ -123,6 +134,7 @@ export default {
 			this.addressId = this.listData[index].id;
 			var arrays = [];
 			this.listData[index].examUserApplySiteTime.forEach(item => {
+				if(item.examTime < self.applyDs.applySiteExamTime){
 				item.examApplySiteTimeTwoVo.forEach(items => {
 					arrays.push({
 						examTime: item.examTime,
@@ -137,11 +149,15 @@ export default {
 						status: items.status === 1 ? items.status : items.registration >= items.num ? 2 : items.status
 					});
 				});
+				}
 			});
 			this.activeList = arrays;
 			this.address_show = false;
 		},
-		choItem(index) {
+		choItem(index,time) {
+			if(time >= this.applyDs.applySiteExamTime){
+				return
+			}
 			const item = this.activeList[index];
 			if (item.status !== 0) {
 				return;

+ 1 - 1
pages2/learn/my_learn.vue

@@ -131,7 +131,7 @@ export default {
 		jumpPage(v, int) {
 			//int 1.课程学习 2.预约考试 3.进入刷题 4.查看详情 5.重修目录
 			if (int === 1) {
-				this.$navTo.togo('/pages2/wd/course?id=' + v.goodsId);
+				this.$navTo.togo(`/pages2/wd/course?id=${v.goodsId}&gid=${v.gradeId}`);
 			}
 			if (int === 2) {
 				this.$navTo.togo(`/pages2/appointment/index?goodsId=${v.goodsId}&gradeId=${v.gradeId}`);

+ 1 - 1
pages2/order/confirm_pay.vue

@@ -129,7 +129,7 @@ export default {
 						timeStamp: String(data.timeStamp),
 					    success: function (res) {
 							uni.redirectTo({
-							    url: '/pages2/order/confirm_success?sn='+data.orderSn
+							    url: `/pages2/order/confirm_success?sn=${data.orderSn}&isBk=${self.isBK}`
 							});
 					        console.log('success:' + JSON.stringify(res));
 					    },

+ 33 - 4
pages2/order/confirm_success.vue

@@ -5,7 +5,15 @@
 				<view class="box1">
 					<view class="box1_t1">
 						<u-icon name="checkmark-circle" color="#34C759" size="32"></u-icon><text style="margin-left: 8rpx;">您的订单已支付成功!</text></view>
-					<view style="display: flex;align-items: center;justify-content: center;">
+					<view style="display: flex;align-items: center;justify-content: center;" v-if="isBK === '1'">
+						<view class="btn1" @click="backMyStudent">
+							返回我的网课
+						</view>
+						<view class="btn2" @click="gots">
+							继续本次的考试预约
+						</view>
+					</view>
+					<view style="display: flex;align-items: center;justify-content: center;" v-else>
 						<view class="btn1" @click="goCourse">
 							继续选课
 						</view>
@@ -61,13 +69,20 @@ export default {
 			array:['全部','建设工程施工管理','机电全科','机电工程管理与实','机电全科','全科'],
 			current:0,
 			menuIndex:0,
-			sn:''
+			sn:'',
+			isBK:'',//1补考商品
+			getDatas:{}
 		};
 	},
 	onPullDownRefresh(){
 	},
 	onLoad(option) {
 		this.sn = option.sn
+		this.isBK = option.isBk
+		if(option.isBk === '1'){
+			this.getDatas = this.$store.getters.getBackPageApplyData
+			console.log(this.isBK === '1',this.getDatas)
+		}
 	},
 	onShow() {
 		/* if(this.current === 2 && this.$method.isLogin()){
@@ -75,6 +90,18 @@ export default {
 		} */
 	},
 	methods: {
+		// 返回我的网课
+		backMyStudent(){
+			uni.redirectTo({
+			    url: '/pages2/wd/class'
+			});
+		},
+		// 继续本次的考试预约
+		gots(){
+			uni.redirectTo({
+			    url: `/pages2/appointment/index?goodsId=${this.getDatas.goodsId}&gradeId=${this.getDatas.gradeId}`
+			});
+		},
 		goCourse(){
 			uni.switchTab({
 			    url: '/pages/course/index'
@@ -115,7 +142,8 @@ export default {
 </style>
 <style scoped>
 	.btn2{
-		width: 160rpx;
+		/* width: 160rpx;		 */
+		padding: 0rpx 20rpx;
 		height: 56rpx;
 		background: #007AFF;
 		border-radius: 16rpx;
@@ -126,7 +154,8 @@ export default {
 		line-height: 56rpx;
 	}
 	.btn1{
-		width: 160rpx;
+		padding: 0rpx 20rpx;
+		/* width: 160rpx; */
 		height: 56rpx;
 		background: #F5F5F5;
 		border-radius: 16rpx;

+ 13 - 2
pages2/verify/input.vue

@@ -126,7 +126,7 @@
 						:prop="item.required ? item.fieldKey : ''"
 					>
 						<picker @change="bindPickerChange(item.fieldKey, $event)" :value="form[item.fieldKey]" :range="getarrays(item.fieldKey)">
-							<view class="picker">{{ returnName(item.fieldKey) }}</view>
+							<view class="picker">{{ returnName(item.fieldKey) }}</u-icon> <image src="@/static/icon/clears.png" v-if="clearWatch(item.fieldKey)" @click.stop="clearFun(item.fieldKey)" mode="" style="width:30rpx;height:30rpx;vertical-align: middle;margin-left:10rpx;"></image> </view>
 						</picker>
 					</u-form-item>
 					<u-form-item
@@ -138,7 +138,7 @@
 						:prop="item.required ? item.fieldKey : ''"
 					>
 						<picker mode="date" :value="form[item.fieldKey]" @change="bindDateChange(item.fieldKey, $event)">
-							<view class="picker">{{ getTimes(item.fieldKey) }}</view>
+							<view class="picker">{{ getTimes(item.fieldKey) }} <image src="@/static/icon/clears.png" v-if="clearWatch(item.fieldKey)" @click.stop="clearFun(item.fieldKey)" mode="" style="width:30rpx;height:30rpx;vertical-align: middle;margin-left:10rpx;"></image> </view>
 						</picker>
 					</u-form-item>
 					<u-form-item
@@ -482,6 +482,17 @@ export default {
 	},
 	computed: { ...mapGetters(['dictObj']) },
 	methods: {
+		clearFun(key){
+			this.form[key] = ''
+		},
+		//清除按钮
+		clearWatch(key){
+			if(this.form[key]){
+				return true
+			}else{
+				return false
+			}
+		},
 		cahngeText() {
 			this.$set(this.form, 'name', '唐');
 			console.log(this.form.name, 123);

BIN=BIN
static/icon/clears.png


+ 7 - 0
store/index.js

@@ -14,6 +14,7 @@ const store = new Vuex.Store({
 		goodsAuditionConfigIdList: [], //当前访问页面的试听节ID
 		shoppingCartList: [], //购物车支付商品
 		applyData: {}, //预约考试数据存放
+		backPageApplyData: {}, //预约考试返回页面的数据存放
 		playSectionId: 0,
 		copyData: null, //存放审核资料数据
 	},
@@ -58,6 +59,9 @@ const store = new Vuex.Store({
 		getApplyData: state => {
 			return state.applyData
 		},
+		getBackPageApplyData: state => {
+			return state.backPageApplyData
+		},
 		playSectionId: state => {
 			return state.playSectionId
 		},
@@ -83,6 +87,9 @@ const store = new Vuex.Store({
 		updateApplyData(state, arrays) {
 			state.applyData = arrays;
 		},
+		updateBackApplyData(state, arrays) {
+			state.backPageApplyData = arrays;
+		},
 		updateUserInfo(state, provider) {
 			state.userInfo = provider.userInfo;
 		},