Tang vor 3 Jahren
Ursprung
Commit
f12db36a72

+ 4 - 0
common/api.js

@@ -11,6 +11,8 @@ import grade from './httpList/grade.js'
 import base from './httpList/base.js'
 import apply from './httpList/apply.js'
 import systemPlan from './httpList/systemPlan.js'
+import myStudent from './httpList/myStudent.js'
+import order from './httpList/order.js'
 export default {
 	...login,
 	...polyvVideo,
@@ -25,4 +27,6 @@ export default {
 	...base,
 	...apply,
 	...systemPlan,
+	...myStudent,
+	...order,
 }

+ 29 - 0
common/httpList/myStudent.js

@@ -0,0 +1,29 @@
+import {
+	myRequest
+} from '../request.js'
+export default {
+	//确认重学
+	courseperiodrebuild(data) {
+		return myRequest({
+			url: '/course/period/rebuild',
+			method: 'post',
+			data: data
+		})
+	},
+	//查看班级作弊重学详细情况
+	getcourseperiodcheat(data) {
+		return myRequest({
+			url: '/course/period/cheat',
+			method: 'get',
+			data: data
+		})
+	},
+	//查询用户拥有商品的学时记录
+	getcourseperiodlistGoods(data) {
+		return myRequest({
+			url: '/course/period/listGoods',
+			method: 'get',
+			data: data
+		})
+	},
+}

+ 29 - 0
common/httpList/order.js

@@ -0,0 +1,29 @@
+import {
+	myRequest
+} from '../request.js'
+export default {
+	//修改订单
+	eddOrder(data) {
+		return myRequest({
+			url: '/order/edit',
+			method: 'post',
+			data: data
+		})
+	},
+	//查询订单商品列表
+	getordergoodslists(data) {
+		return myRequest({
+			url: '/order/goods/list',
+			method: 'get',
+			data: data
+		})
+	},
+	//查询订单列表
+	getorderlists(data) {
+		return myRequest({
+			url: '/order/list',
+			method: 'get',
+			data: data
+		})
+	},
+}

+ 10 - 0
pages.json

@@ -403,6 +403,16 @@
 					}
 				}
 			},
+			{
+				"path": "appointment/kporder",
+				"style": {
+					"navigationBarTitleText": "考前培训预约考试",
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
+				}
+			},
 			{
 				"path": "appointment/appointment_success",
 				"style": {

+ 148 - 116
pages2/appointment/appointment_success.vue

@@ -2,9 +2,10 @@
 	<view class="safeArea">
 		<view style="padding: 8rpx;">
 			<view class="box1">
-				<view>您所报考的【XXXXX】专业</view>
+				<view>您所报考的【{{ listData.categoryName }}】专业</view>
 				<view class="status">
-					<u-icon name="checkmark-circle" color="#34C759" size="32"></u-icon><text style="margin-left: 8rpx;">考试预约成功</text>
+					<u-icon name="checkmark-circle" color="#34C759" size="32"></u-icon>
+					<text style="margin-left: 8rpx;">{{ listData.subscribeStatus === 1 ? '考试预约成功' : '预约异常' }}</text>
 				</view>
 			</view>
 			<view class="box2">
@@ -13,15 +14,15 @@
 				<view class="boxMain">
 					<view class="list_item">
 						<view class="txt_left">姓名</view>
-						<view class="txt_right">倪虹洁</view>
+						<view class="txt_right">{{ listData.realname }}</view>
 					</view>
 					<view class="list_item">
 						<view class="txt_left">身份证</view>
-						<view class="txt_right">44046354687236685698</view>
+						<view class="txt_right">{{ listData.idCard }}</view>
 					</view>
 					<view class="list_item">
 						<view class="txt_left">考试身份</view>
-						<view class="txt_right">非补考学员</view>
+						<view class="txt_right">{{ listData.studentType === 1 ? '非补考学员' : listData.studentType === 2 ? '补考学员' : '' }}</view>
 					</view>
 				</view>
 			</view>
@@ -31,166 +32,197 @@
 				<view class="boxMain">
 					<view class="list_item">
 						<view class="txt_left">考试标题</view>
-						<view class="txt_right txt_right1">2020年二建建筑工程管理与实补考标题</view>
+						<view class="txt_right txt_right1">{{listData.applyName}}</view>
 					</view>
 					<view class="list_item">
 						<view class="txt_left">报名开放时间</view>
-						<view class="txt_right">2021/10/23 ~ 2021/10/29</view>
+						<view class="txt_right">{{$method.timestampToTime(listData.applyStartTime)}} ~ {{$method.timestampToTime(listData.applyEndTime)}}</view>
 					</view>
 					<view class="list_item">
 						<view class="txt_left">报考专业</view>
-						<view class="txt_right">XXXXX专业</view>
+						<view class="txt_right">{{listData.categoryName}}专业</view>
 					</view>
 					<view class="list_item">
 						<view class="txt_left">考试地点</view>
-						<view class="txt_right">广州市天河区燕岭路建设大厦3楼</view>
+						<view class="txt_right">{{listData.applySiteAddress}}</view>
 					</view>
 					<view class="list_item">
 						<view class="txt_left">考试时间</view>
-						<view class="txt_right">2021/10/23  10:00 ~ 11:00</view>
+						<view class="txt_right">{{$method.timestampToTime(listData.applySiteExamTime)}} {{listData.applySiteStartTime}} ~ {{listData.applySiteEndTime}}</view>
 					</view>
-					<view class="list_item">
+					<view class="list_item" v-if="listData.applySiteAddressTrain">
 						<view class="txt_left">考前培训地点</view>
-						<view class="txt_right">广州市天河区燕岭路建设大厦3楼</view>
+						<view class="txt_right">{{listData.applySiteAddressTrain}}</view>
 					</view>
-					<view class="list_item">
+					<view class="list_item" v-if="listData.applySiteExamTrainTime && listData.applySiteStartTrainTime && listData.applySiteEndTrainTime">
 						<view class="txt_left">考前培训时间</view>
-						<view class="txt_right">2021/10/23  10:00:00</view>
+						<view class="txt_right">{{$method.timestampToTime(listData.applySiteExamTrainTime)}} {{listData.applySiteStartTrainTime}} ~ {{listData.applySiteEndTrainTime}}</view>
 					</view>
 					<view class="tip">*您可在“我的>我的考试预约”中查询</view>
 				</view>
 			</view>
 			<view style="height: 120rpx;"></view>
 			<view class="foot safeArea">
-				<view class="btn return">返回我的网课</view>
-				<view class="btn view">查看【我的考试预约】</view>
+				<view class="btn return" @click="backPage">返回我的网课</view>
+				<view class="btn view" @click="goMent">查看【我的考试预约】</view>
 			</view>
 		</view>
 	</view>
-	
 </template>
 
 <script>
 import { mapGetters } from 'vuex';
 export default {
-	components: {
-		
-	},
+	components: {},
 	data() {
 		return {
+			subscribeId: null,
+			listData: {}
 		};
 	},
-	onShow() {
+	onLoad(option) {
+		this.subscribeId = Number(option.subscribeId);
+		this.getInfo();
 	},
+	onShow() {},
 	methods: {
+		goMent(){
+			uni.redirectTo({
+			    url: '/pages2/exam/exam_appointment'
+			});
+		},
+		backPage(){
+			uni.redirectTo({
+			    url: '/pages2/wd/class'
+			});
+		},
+		getInfo() {
+			this.$api.getApplylist({ subscribeId: this.subscribeId }).then(res => {
+				if (res.data.code === 200 && res.data.rows.length) {
+					if(res.data.rows[0].applySiteStartTime){
+						res.data.rows[0].applySiteStartTime = res.data.rows[0].applySiteStartTime.replace("-",":")
+					}
+					if(res.data.rows[0].applySiteEndTime){
+						res.data.rows[0].applySiteEndTime = res.data.rows[0].applySiteEndTime.replace("-",":")
+					}
+					if(res.data.rows[0].applySiteStartTrainTime){
+						res.data.rows[0].applySiteStartTrainTime = res.data.rows[0].applySiteStartTrainTime.replace("-",":")
+					}
+					if(res.data.rows[0].applySiteEndTrainTime){
+						res.data.rows[0].applySiteEndTrainTime = res.data.rows[0].applySiteEndTrainTime.replace("-",":")
+					}
+					this.listData = res.data.rows[0];
+				}
+			});
+		}
 	},
 	onReachBottom() {},
 	computed: { ...mapGetters(['userInfo']) }
 };
 </script>
-<style >
-	::-webkit-scrollbar{
-	 width: 0;
-	 height: 0;
-	 color: transparent
-	}
-	page{
-		background-color: #EAEEF1;
-	}
+<style>
+::-webkit-scrollbar {
+	width: 0;
+	height: 0;
+	color: transparent;
+}
+page {
+	background-color: #eaeef1;
+}
 </style>
 <style scoped lang="scss">
-	.tip{
-		font-size: 24rpx;
-		color: #999999;
-		height: 40rpx;
-		line-height: 40rpx;
-	}
-	.title2{
-		font-size: 30rpx;
-		font-weight: bold;
-		color: #333333;
-		height: 90rpx;
-		line-height: 90rpx;
-		margin-left: 30rpx;
+.tip {
+	font-size: 24rpx;
+	color: #999999;
+	height: 40rpx;
+	line-height: 40rpx;
+}
+.title2 {
+	font-size: 30rpx;
+	font-weight: bold;
+	color: #333333;
+	height: 90rpx;
+	line-height: 90rpx;
+	margin-left: 30rpx;
+}
+.box2 {
+	width: 100%;
+	background: #ffffff;
+	border-radius: 16rpx;
+	margin-top: 16rpx;
+	.boxMain {
+		padding: 30rpx;
 	}
-	.box2{
-		width: 100%;
-		background: #FFFFFF;
-		border-radius: 16rpx;
-		margin-top: 16rpx;
-		.boxMain{
-			padding: 30rpx;
+	.list_item {
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		line-height: 1;
+		&:not(:last-child) {
+			margin-bottom: 57rpx;
 		}
-		.list_item{
-			display: flex;
-			justify-content: space-between;
-			align-items: center;
-			line-height: 1;
-			&:not(:last-child){
-				margin-bottom: 57rpx;
-			}
-			.txt_left{
-				font-size: 24rpx;
-				color: #666666;
-			}
-			.txt_right{
-				color: #333333;
-				font-size: 30rpx;
-				font-weight: bold;
-				width: 75%;
-				text-align: right;
-				&.txt_right1{
-					width:370rpx;
-					text-align: left;
-					line-height: 1.4;
-				}
+		.txt_left {
+			font-size: 24rpx;
+			color: #666666;
+		}
+		.txt_right {
+			color: #333333;
+			font-size: 30rpx;
+			font-weight: bold;
+			width: 75%;
+			text-align: right;
+			&.txt_right1 {
+				width: 370rpx;
+				// text-align: left;
+				line-height: 1.4;
 			}
 		}
 	}
-	.box1{
-		width: 100%;
-		background: #FFFFFF;
-		border-radius: 16rpx;
-		padding: 15rpx;
+}
+.box1 {
+	width: 100%;
+	background: #ffffff;
+	border-radius: 16rpx;
+	padding: 15rpx;
+	text-align: center;
+	.status {
+		font-size: 36rpx;
+		font-family: PingFang SC;
+		font-weight: bold;
+		color: #34c759;
+		margin: 19rpx 0;
+	}
+}
+.foot {
+	height: 98rpx;
+	width: 100%;
+	position: fixed;
+	bottom: 0;
+	left: 0;
+	background: rgba(255, 255, 255, 0.98);
+	box-sizing: unset;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+	.btn {
+		height: 80rpx;
+		line-height: 80rpx;
+		border-radius: 40rpx;
+		font-size: 30rpx;
+		font-family: PingFang SC;
+		font-weight: bold;
 		text-align: center;
-		.status{
-			font-size: 36rpx;
-			font-family: PingFang SC;
-			font-weight: bold;
-			color: #34C759;
-			margin: 19rpx 0;
-		}
 	}
-	.foot{
-		height: 98rpx;
-		width: 100%;
-		position: fixed;
-		bottom: 0;
-		left: 0;
-		background: rgba(255, 255, 255, 0.98);
-		box-sizing: unset;
-		display: flex;
-		justify-content: center;
-		align-items: center;
-		.btn{
-			height: 80rpx;
-			line-height: 80rpx;
-			border-radius: 40rpx;
-			font-size: 30rpx;
-			font-family: PingFang SC;
-			font-weight: bold;
-			text-align: center;
-		}
-		.return{
-			width: 264rpx;
-			background: #F5F5F5;
-			color: #007AFF;
-		}
-		.view{
-			width: 374rpx;
-			background: #007AFF;
-			color: #FFFFFF;
-			margin-left:24rpx;
-		}
+	.return {
+		width: 264rpx;
+		background: #f5f5f5;
+		color: #007aff;
+	}
+	.view {
+		width: 374rpx;
+		background: #007aff;
+		color: #ffffff;
+		margin-left: 24rpx;
 	}
+}
 </style>

+ 52 - 14
pages2/appointment/index.vue

@@ -41,9 +41,15 @@
 			<view class="appointmentItem appointmentType">
 				<view class="item">
 					<view class="labelName">学员类型:</view>
-					<u-radio-group placement="column">
-						<u-radio :customStyle="{ marginBottom: '8px' }" v-for="(item, index) in radiolist" :key="index" :label="item.label" :name="item.name" @change="radioChange">
-							{{ item.name }}
+					<u-radio-group placement="column" v-model="radioInfo">
+						<u-radio
+							:customStyle="{ marginBottom: '8px' }"
+							v-for="(item, index) in radiolist"
+							:key="index"
+							:name="item.name"
+							v-if="listData.applyStatus.indexOf(item.name) !== -1"
+						>
+							{{ item.label }}
 						</u-radio>
 					</u-radio-group>
 				</view>
@@ -75,11 +81,14 @@ export default {
 	data() {
 		return {
 			showTip: false,
-			radiolist: [{ name: '非补考学员', label: '1' }, { name: '补考学员', label: '2' }],
+			radiolist: [{ name: '1', label: '非补考学员' }, { name: '2', label: '补考学员' }],
 			goodsId: 0,
 			gradeId: 0,
-			applyStatus:'',
-			listData: {} //页面数据
+			applyStatus: '',
+			listData: {
+				applyStatus: []
+			}, //页面数据
+			radioInfo: ''
 		};
 	},
 	onLoad(option) {
@@ -94,19 +103,48 @@ export default {
 				gradeId: this.gradeId
 			};
 			this.$api.getApplysubscribe(data).then(res => {
-				console.log(res.data, 123);
+				if (res.data.data.applyStatus) {
+					res.data.data.applyStatus = res.data.data.applyStatus.split(',');
+				}
 				this.listData = res.data.data;
 			});
 		},
-		radioChange(e) {
-			console.log(e);
-		},
 		next() {
-			this.showTip = true;
+			if (!this.radioInfo) {
+				uni.showToast({
+					title: '请选择您的考试身份',
+					icon: 'none'
+				});
+				return;
+			}
+			let data = {
+				applyId: this.listData.applyId,
+				applyStatus: this.radioInfo,
+				goodsId: this.goodsId,
+				gradeId: this.gradeId
+			};
+			this.$api.getApplysubscribeNext(data).then(res => {
+				if (res.data.code === 500) {
+					uni.showModal({
+						content: res.data.msg,
+						showCancel: false
+					});
+				} else {
+					if (res.data.data === 1 || res.data.data === 2) {
+						this.$navTo.togo('/pages2/appointment/order', {
+							applyId: this.listData.applyId,
+							applyStatus: this.radioInfo,
+							goodsId: this.goodsId,
+							dataId:res.data.data
+						});
+					}
+					if (res.data.data === 3) {
+						this.showTip = true;
+					}
+				}
+			});
 		},
-		submit() {
-			this.$navTo.togo('/pages2/appointment/order');
-		}
+		submit() {}
 	}
 };
 </script>

+ 388 - 0
pages2/appointment/kporder.vue

@@ -0,0 +1,388 @@
+<template>
+	<view class="safeArea">
+		<view class="appointment">
+			<view class="appointmentItem">
+				<view class="title">考前培训地点:</view>
+				<view class="place" @click="showAddress">
+					<view class="name">{{ addressName }}</view>
+					<view><u-icon name="arrow-right" color="#999999" size="28"></u-icon></view>
+				</view>
+			</view>
+			<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 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">
+								<template v-if="item.status === 2">
+									预约名额已满
+								</template>
+								<template v-if="item.status === 1">
+									此时段您已经有其他考前培训预约
+								</template>
+							</view>
+						</view>
+						<view class="num">已报:{{ item.registration }}/{{ item.num }}</view>
+					</view>
+				</view>
+			</view>
+			<view class="btnMain">
+				<view class="return" @click="backPage">上一步</view>
+				<view class="sure" @click="sureOppoint">确定预约</view>
+			</view>
+		</view>
+		<!-- 弹框-->
+		<u-popup v-model="address_show" mode="bottom" class="addModel">
+			<view class="tipBox safeArea">
+				<view class="line"></view>
+				<view class="title">温馨提示</view>
+				<u-line color="#EEEEEE" />
+				<scroll-view class="addressList" :scroll-y="true">
+					<view class="item" v-for="(item, index) in listData" :key="index" @click="choAddress(index)">
+						<u-checkbox class="checkbox" v-model="item.checked" shape="circle"></u-checkbox>
+						<view :class="['address', { active: item.checked }]">{{ item.siteAddress }}</view>
+					</view>
+				</scroll-view>
+				<u-line color="#EEEEEE" />
+				<view class="btn" @click="sureAddress">确认</view>
+			</view>
+		</u-popup>
+	</view>
+</template>
+
+<script>
+import { mapGetters } from 'vuex';
+export default {
+	data() {
+		return {
+			address_show: false,
+			addressName: '请选择',
+			addressId: null, //当前选中考试点ID
+			listData: [], //考试地点数据
+			activeList: [], //选中考试地点列表
+			applyId: null, //考试计划ID
+			goodsId: null, //商品ID
+			applyStatus: null, //学员状态ID
+			applyDs: {}
+		};
+	},
+	onLoad(option) {
+		this.applyId = Number(option.applyId);
+		this.goodsId = Number(option.goodsId);
+		this.applyStatus = Number(option.applyStatus);
+		this.getInfo();
+		this.getVuexData();
+		uni.showModal({
+			content: '线下考前培训,自由填选如您有需要,建议先进行预约具体安排,后续会有相关工作人员与您沟通',
+			showCancel: false
+		});
+	},
+	methods: {
+		getVuexData() {
+			this.applyDs = this.$store.getters.getApplyData;
+		},
+		//获取考培地点
+		getInfo() {
+			this.$api.getApplysubscribeApplySiteTrain({ applyId: this.applyId }).then(res => {
+				if (res.data.code === 200) {
+					res.data.data.forEach((item, index) => {
+						item.checked = false;
+					});
+					this.listData = res.data.data;
+				}
+			});
+		},
+		showAddress() {
+			this.address_show = true;
+		},
+		choAddress(index) {
+			this.listData.forEach((item, idx) => {
+				this.$set(item, 'checked', false);
+				if (idx === index) {
+					this.$set(item, 'checked', true);
+				}
+			});
+		},
+		sureAddress() {
+			var self = this;
+			const index = this.listData.findIndex(item => item.checked);
+			if (index === -1) {
+				uni.showToast({
+					title: '请选择考前培训地点',
+					icon: 'none'
+				});
+				return;
+			}
+			if (this.addressId === this.listData[index].id) {
+				this.address_show = false;
+				return;
+			}
+			this.addressName = this.listData[index].siteAddress;
+			this.addressId = this.listData[index].id;
+			var arrays = [];
+			this.listData[index].examUserApplySiteTime.forEach(item => {
+				item.examApplySiteTimeTwoVo.forEach(items => {
+					arrays.push({
+						examTime: item.examTime,
+						startTimeC: items.startTime,
+						endTimeC: items.endTime,
+						dataTime: self.$method.timestampToTime(item.examTime),
+						startTime: items.startTime.replace('-', ':'),
+						endTime: items.endTime.replace('-', ':'),
+						num: items.num,
+						registration: items.registration,
+						checked: false,
+						status: items.status === 1 ? items.status : items.registration >= items.num ? 2 : items.status
+					});
+				});
+			});
+			this.activeList = arrays;
+			this.address_show = false;
+		},
+		choItem(index) {
+			const item = this.activeList[index];
+			if (item.status !== 0) {
+				return;
+			}
+			this.activeList.forEach((item, idx) => {
+				item.checked = false;
+				if (idx === index) {
+					item.checked = true;
+				}
+			});
+		},
+		sureOppoint() {
+			var self = this;
+			if (self.addressId) {
+				var ast = self.activeList.some(item => {
+					return item.checked === true;
+				});
+				if (ast) {
+					var copyData = JSON.parse(JSON.stringify(self.activeList));
+					const index = copyData.findIndex(item => item.checked);
+					var data = {
+						applySiteAddressTrain: self.addressName,
+						applySiteExamTrainTime: copyData[index].examTime,
+						applySiteStartTrainTime: copyData[index].startTimeC,
+						applySiteEndTrainTime: copyData[index].endTimeC
+					};
+					let newObj = {};
+					Object.assign(newObj, data, self.applyDs);
+					self.$api.addApply(newObj).then(res => {
+						if (res.data.code === 200) {
+							uni.reLaunch({
+								url: `/pages2/appointment/appointment_success?subscribeId=${res.data.data}`
+							});
+						}
+					});
+				} else {
+					uni.showToast({
+						title: '请选择考试时间',
+						icon: 'none'
+					});
+				}
+			} else {
+				var data = JSON.parse(JSON.stringify(self.applyDs));
+				self.$api.addApply(data).then(res => {
+					if (res.data.code === 200) {
+						uni.reLaunch({
+							url: `/pages2/appointment/appointment_success?subscribeId=${res.data.data}`
+						});
+					}
+				});
+			}
+		},
+		backPage() {
+			uni.navigateBack({
+				delta: 1
+			});
+		}
+	}
+};
+</script>
+<style>
+page {
+	background-color: #eaeef1;
+}
+.addModel .u-drawer-bottom {
+	box-shadow: 0px 0px 16px 4px rgba(145, 156, 178, 0.1);
+	border-radius: 32rpx 32rpx 0px 0px;
+}
+</style>
+<style scoped lang="scss">
+.appointment {
+	padding: 0 8rpx;
+	.appointmentItem {
+		margin: 24rpx 0 40rpx;
+		.title {
+			font-size: 30rpx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			color: #333333;
+			line-height: 1;
+			margin-bottom: 16rpx;
+			padding-left: 24rpx;
+		}
+		.place {
+			height: 80rpx;
+			background: #ffffff;
+			border-radius: 16rpx;
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			padding: 0 24rpx;
+		}
+	}
+	.main {
+		background: #ffffff;
+		border-radius: 16rpx;
+		padding: 32rpx 16rpx;
+		.item {
+			display: flex;
+			align-items: center;
+			margin-bottom: 16rpx;
+			font-size: 28rpx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			color: #333333;
+			.statusInfo {
+				font-size: 24rpx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #ff3b30;
+				padding-left: 24rpx;
+			}
+			.checkbox {
+				width: 32rpx;
+				height: 32rpx;
+				display: flex;
+				align-items: center;
+			}
+			.time {
+				width: 430rpx;
+				height: 80rpx;
+				line-height: 80rpx;
+				background: #f5f5f5;
+				border: 2rpx solid #f5f5f5;
+				border-radius: 16rpx;
+				font-size: 30rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				text-align: center;
+				color: #333333;
+				margin: 0 18rpx 0 8rpx;
+				&.active {
+					background: #ebf5ff;
+					border: 2rpx solid #007aff;
+				}
+				&.no {
+					background: #ffdddb;
+					border: 2rpx solid #ffdddb;
+				}
+			}
+		}
+	}
+	.btnMain {
+		display: flex;
+		justify-content: center;
+		text-align: center;
+		.return {
+			width: 200rpx;
+			height: 80rpx;
+			line-height: 80rpx;
+			background: #f5f5f5;
+			border-radius: 40rpx;
+			font-size: 30rpx;
+			font-family: PingFang SC;
+			font-weight: bold;
+			color: #007aff;
+		}
+		.sure {
+			width: 438rpx;
+			height: 80rpx;
+			line-height: 80rpx;
+			background: #007aff;
+			border-radius: 40rpx;
+			font-size: 30rpx;
+			font-family: PingFang SC;
+			font-weight: bold;
+			color: #ffffff;
+			margin-left: 24rpx;
+		}
+	}
+}
+.tipBox {
+	width: 100%;
+	font-family: PingFang SC;
+	.line {
+		width: 80rpx;
+		height: 8rpx;
+		background: #999999;
+		border-radius: 4rpx;
+		margin: 8rpx auto;
+	}
+	.title {
+		text-align: center;
+		font-size: 24rpx;
+		font-family: PingFang SC;
+		font-weight: 500;
+		color: #999999;
+		margin: 15rpx 0;
+	}
+	.main {
+		font-size: 30rpx;
+		font-weight: 500;
+		color: #666666;
+		line-height: 48rpx;
+		margin-bottom: 40rpx;
+	}
+	.addressList {
+		height: 500rpx;
+		padding-top: 24rpx;
+		.item {
+			display: flex;
+			align-items: center;
+			padding: 0 24rpx;
+			margin-bottom: 24rpx;
+			.checkbox {
+				width: 32rpx;
+				height: 32rpx;
+				display: flex;
+				align-items: center;
+				margin-right: 8rpx;
+			}
+			.address {
+				width: 654rpx;
+				height: 80rpx;
+				line-height: 80rpx;
+				background: #f5f5f5;
+				border-radius: 16rpx;
+				font-size: 30rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #333333;
+				padding: 0 24rpx;
+				&.active {
+					background: #ebf5ff;
+					border: 2rpx solid #007aff;
+				}
+			}
+		}
+	}
+	.btn {
+		width: 200rpx;
+		height: 64rpx;
+		line-height: 64rpx;
+		background: linear-gradient(0deg, #015eea, #00c0fa);
+		border-radius: 32rpx;
+		margin: 17rpx auto;
+		font-size: 30rpx;
+		font-family: PingFang SC;
+		font-weight: 500;
+		text-align: center;
+		color: #ffffff;
+	}
+}
+</style>

+ 201 - 121
pages2/appointment/order.vue

@@ -4,29 +4,33 @@
 			<view class="appointmentItem">
 				<view class="title">考试地点:</view>
 				<view class="place" @click="showAddress">
-					<view class="name">{{addressName}}</view>
+					<view class="name">{{ addressName }}</view>
 					<view><u-icon name="arrow-right" color="#999999" size="28"></u-icon></view>
 				</view>
 			</view>
-			<view class="appointmentItem">
+			<view class="appointmentItem" v-if="activeList.length">
 				<view class="title">考试时间:</view>
 				<view class="main">
-					<view v-for="(item,index) in list" class="item" :key="index" @click="choItem(index)">
-						<view class="checkbox"><u-checkbox v-if="item.status===1" v-model="item.checked" shape="circle"></u-checkbox></view>
+					<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 class="box">
-							<view :class="['time',{'active':item.checked},{'no':item.status!==1}]">{{item.time}}</view>
-							<view class="statusInfo" v-if="item.status !==1">
-								<template v-if="item.status===2">预约名额已满</template>
-								<template v-if="item.status===3">此时段您已经有其他考试预约</template>
+							<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">
+								<template v-if="item.status === 2">
+									预约名额已满
+								</template>
+								<template v-if="item.status === 1">
+									此时段您已经有其他考试预约
+								</template>
 							</view>
 						</view>
-						<view class="num">已报:{{item.appoint}}/{{item.total}}</view>
+						<view class="num">已报:{{ item.registration }}/{{ item.num }}</view>
 					</view>
 				</view>
 			</view>
 			<view class="btnMain">
-				<view class="return">上一步</view>
-				<view class="sure" @click="sureOppoint">确定预约</view>
+				<view class="return" @click="backPage">上一步</view>
+				<view class="sure" @click="sureOppoint">{{ dataId === 1 ? '下一步' : dataId === 2 ? '确定预约' : '异常' }}</view>
 			</view>
 		</view>
 		<!-- 弹框-->
@@ -36,9 +40,9 @@
 				<view class="title">温馨提示</view>
 				<u-line color="#EEEEEE" />
 				<scroll-view class="addressList" :scroll-y="true">
-					<view class="item" v-for="(item,index) in addressList" :key="index" @click="choAddress(index)">
+					<view class="item" v-for="(item, index) in listData" :key="index" @click="choAddress(index)">
 						<u-checkbox class="checkbox" v-model="item.checked" shape="circle"></u-checkbox>
-						<view :class="['address',{'active': item.checked}]">{{item.address}}</view>
+						<view :class="['address', { active: item.checked }]">{{ item.siteAddress }}</view>
 					</view>
 				</scroll-view>
 				<u-line color="#EEEEEE" />
@@ -54,89 +58,165 @@ export default {
 	data() {
 		return {
 			address_show: false,
-			addressName: '广州市天可区燕岭路建设大厦3楼',
-			addressList:[{checked:true,address: '广州市天可区燕岭路建设大厦3楼'},{checked:false,address: '广州市海珠区广州塔3楼'},{checked:false,address: '深圳市企鹅大厦附近的写字楼'}],
-			list: [{
-					time: '2021/10/23  10:00 ~ 11:00',
-					total: 100,
-					appoint: 100,
-					checked: true,
-					status: 1, // 1:可报 2:预约名额已满 3:此时段您已经有其他考试预约
-				},
-				{
-					time: '2021/10/23  10:00 ~ 11:00',
-					total: 100,
-					appoint: 20,
-					status: 2,
-				},
-				{
-					time: '2021/10/23  10:00 ~ 11:00',
-					total: 100,
-					appoint: 20,
-					status: 3
-				},
-				{
-					time: '2021/10/23  10:00 ~ 11:00',
-					total: 100,
-					appoint: 20,
-					status: 1
-				}
-			]
+			addressName: '请选择',
+			addressId: null, //当前选中考试点ID
+			listData: [], //考试地点数据
+			activeList: [], //选中考试地点列表
+			applyId: null, //考试计划ID
+			goodsId: null, //商品ID
+			applyStatus: null, //学员状态ID
+			dataId: null //跳转拷贝
 		};
 	},
-	onLoad(option) {},
+	onLoad(option) {
+		this.applyId = Number(option.applyId);
+		this.goodsId = Number(option.goodsId);
+		this.applyStatus = Number(option.applyStatus);
+		this.dataId = Number(option.dataId);
+		this.getInfo();
+	},
 	methods: {
-		showAddress(){
-			this.address_show = true
+		//获取考试地点
+		getInfo() {
+			this.$api.getApplysubscribeApplySite({ applyId: this.applyId }).then(res => {
+				if (res.data.code === 200) {
+					res.data.data.forEach((item, index) => {
+						item.checked = false;
+					});
+					this.listData = res.data.data;
+				}
+			});
 		},
-		choAddress(index){
-			this.addressList.forEach((item,idx)=>{
-				item.checked = false
-				this.$set(item, 'checked',false)
-				if(idx === index){
-					this.$set(item, 'checked',true)
+		showAddress() {
+			this.address_show = true;
+		},
+		choAddress(index) {
+			this.listData.forEach((item, idx) => {
+				this.$set(item, 'checked', false);
+				if (idx === index) {
+					this.$set(item, 'checked', true);
 				}
-			})
+			});
 		},
-		sureAddress(){
-			const index = this.addressList.findIndex(item => item.checked)
-			this.addressName = this.addressList[index].address
-			this.address_show = false
+		sureAddress() {
+			var self = this;
+			const index = this.listData.findIndex(item => item.checked);
+			if (index === -1) {
+				uni.showToast({
+					title: '请选择考试地点',
+					icon: 'none'
+				});
+				return;
+			}
+			if (this.addressId === this.listData[index].id) {
+				this.address_show = false;
+				return;
+			}
+			this.addressName = this.listData[index].siteAddress;
+			this.addressId = this.listData[index].id;
+			var arrays = [];
+			this.listData[index].examUserApplySiteTime.forEach(item => {
+				item.examApplySiteTimeTwoVo.forEach(items => {
+					arrays.push({
+						examTime: item.examTime,
+						startTimeC: items.startTime,
+						endTimeC: items.endTime,
+						dataTime: self.$method.timestampToTime(item.examTime),
+						startTime: items.startTime.replace('-', ':'),
+						endTime: items.endTime.replace('-', ':'),
+						num: items.num,
+						registration: items.registration,
+						checked: false,
+						status: items.status === 1 ? items.status : items.registration >= items.num ? 2 : items.status
+					});
+				});
+			});
+			this.activeList = arrays;
+			this.address_show = false;
 		},
-		choItem(index){
-			const item = this.list[index]
-			if(item.status!==1){
-				return
+		choItem(index) {
+			const item = this.activeList[index];
+			if (item.status !== 0) {
+				return;
 			}
-			this.list.forEach((item,idx)=>{
-				item.checked = false
-				if(idx === index){
-					item.checked = true
+			this.activeList.forEach((item, idx) => {
+				item.checked = false;
+				if (idx === index) {
+					item.checked = true;
 				}
-			})
+			});
 		},
-		sureOppoint(){
-			this.$navTo.togo('/pages2/order/confirm_list');
+		sureOppoint() {
+			var self = this;
+			if (self.addressId) {
+				var ast = self.activeList.some(item => {
+					return item.checked === true;
+				});
+				if (ast) {
+					var copyData = JSON.parse(JSON.stringify(self.activeList));
+					const index = copyData.findIndex(item => item.checked);
+					var data = {
+						applyId: self.applyId,
+						goodsId: self.goodsId,
+						studentType: self.applyStatus,
+						applySiteAddress: self.addressName,
+						applySiteExamTime: copyData[index].examTime,
+						applySiteStartTime: copyData[index].startTimeC,
+						applySiteEndTime: copyData[index].endTimeC
+					};
+					if (self.dataId === 1) {
+						self.$store.commit('updateApplyData', data);
+						self.$navTo.togo('/pages2/appointment/kporder', {
+							applyId: self.applyId,
+							applyStatus: self.applyStatus,
+							goodsId: self.goodsId
+						});
+					}
+					if (self.dataId === 2) {
+						self.$api.addApply(data).then(res => {
+							if (res.data.code === 200) {
+								uni.reLaunch({
+									url: `/pages2/appointment/appointment_success?subscribeId=${res.data.data}`
+								});
+							}
+						});
+					}
+				} else {
+					uni.showToast({
+						title: '请选择考试时间',
+						icon: 'none'
+					});
+				}
+			} else {
+				uni.showToast({
+					title: '请选择考试地点',
+					icon: 'none'
+				});
+			}
+		},
+		backPage() {
+			uni.navigateBack({
+				delta: 1
+			});
 		}
-	},
-
+	}
 };
 </script>
-<style >
-page{
-	background-color: #EAEEF1;
+<style>
+page {
+	background-color: #eaeef1;
 }
-.addModel .u-drawer-bottom{
+.addModel .u-drawer-bottom {
 	box-shadow: 0px 0px 16px 4px rgba(145, 156, 178, 0.1);
 	border-radius: 32rpx 32rpx 0px 0px;
 }
 </style>
 <style scoped lang="scss">
-.appointment{
-	padding:0 8rpx;
-	.appointmentItem{
+.appointment {
+	padding: 0 8rpx;
+	.appointmentItem {
 		margin: 24rpx 0 40rpx;
-		.title{
+		.title {
 			font-size: 30rpx;
 			font-family: PingFang SC;
 			font-weight: 500;
@@ -145,9 +225,9 @@ page{
 			margin-bottom: 16rpx;
 			padding-left: 24rpx;
 		}
-		.place{
+		.place {
 			height: 80rpx;
-			background: #FFFFFF;
+			background: #ffffff;
 			border-radius: 16rpx;
 			display: flex;
 			justify-content: space-between;
@@ -155,11 +235,11 @@ page{
 			padding: 0 24rpx;
 		}
 	}
-	.main{
-		background: #FFFFFF;
+	.main {
+		background: #ffffff;
 		border-radius: 16rpx;
 		padding: 32rpx 16rpx;
-		.item{
+		.item {
 			display: flex;
 			align-items: center;
 			margin-bottom: 16rpx;
@@ -167,25 +247,25 @@ page{
 			font-family: PingFang SC;
 			font-weight: 500;
 			color: #333333;
-			.statusInfo{
+			.statusInfo {
 				font-size: 24rpx;
 				font-family: PingFang SC;
 				font-weight: 500;
-				color: #FF3B30;
-				padding-left:24rpx;
+				color: #ff3b30;
+				padding-left: 24rpx;
 			}
 			.checkbox {
-				width:32rpx;
-				height:32rpx;
+				width: 32rpx;
+				height: 32rpx;
 				display: flex;
 				align-items: center;
 			}
-			.time{
+			.time {
 				width: 430rpx;
 				height: 80rpx;
 				line-height: 80rpx;
-				background: #F5F5F5;
-				border: 2rpx solid #F5F5F5;
+				background: #f5f5f5;
+				border: 2rpx solid #f5f5f5;
 				border-radius: 16rpx;
 				font-size: 30rpx;
 				font-family: PingFang SC;
@@ -193,57 +273,57 @@ page{
 				text-align: center;
 				color: #333333;
 				margin: 0 18rpx 0 8rpx;
-				&.active{
-					background: #EBF5FF;
-					border: 2px solid #007AFF;
+				&.active {
+					background: #ebf5ff;
+					border: 2rpx solid #007aff;
 				}
-				&.no{
-					background: #FFDDDB;
-					border: 2px solid #FFDDDB;
+				&.no {
+					background: #ffdddb;
+					border: 2rpx solid #ffdddb;
 				}
 			}
 		}
 	}
-	.btnMain{
+	.btnMain {
 		display: flex;
 		justify-content: center;
 		text-align: center;
-		.return{
+		.return {
 			width: 200rpx;
 			height: 80rpx;
 			line-height: 80rpx;
-			background: #F5F5F5;
+			background: #f5f5f5;
 			border-radius: 40rpx;
 			font-size: 30rpx;
 			font-family: PingFang SC;
 			font-weight: bold;
-			color: #007AFF;
+			color: #007aff;
 		}
-		.sure{
+		.sure {
 			width: 438rpx;
 			height: 80rpx;
 			line-height: 80rpx;
-			background: #007AFF;
+			background: #007aff;
 			border-radius: 40rpx;
 			font-size: 30rpx;
 			font-family: PingFang SC;
 			font-weight: bold;
-			color: #FFFFFF;
-			margin-left:24rpx;
+			color: #ffffff;
+			margin-left: 24rpx;
 		}
 	}
 }
-.tipBox{
+.tipBox {
 	width: 100%;
 	font-family: PingFang SC;
-	.line{
+	.line {
 		width: 80rpx;
 		height: 8rpx;
 		background: #999999;
 		border-radius: 4rpx;
 		margin: 8rpx auto;
 	}
-	.title{
+	.title {
 		text-align: center;
 		font-size: 24rpx;
 		font-family: PingFang SC;
@@ -251,58 +331,58 @@ page{
 		color: #999999;
 		margin: 15rpx 0;
 	}
-	.main{
+	.main {
 		font-size: 30rpx;
 		font-weight: 500;
 		color: #666666;
 		line-height: 48rpx;
 		margin-bottom: 40rpx;
 	}
-	.addressList{
+	.addressList {
 		height: 500rpx;
-		padding-top:24rpx;
-		.item{
+		padding-top: 24rpx;
+		.item {
 			display: flex;
 			align-items: center;
 			padding: 0 24rpx;
 			margin-bottom: 24rpx;
-			.checkbox{
-				width:32rpx;
-				height:32rpx;
+			.checkbox {
+				width: 32rpx;
+				height: 32rpx;
 				display: flex;
 				align-items: center;
 				margin-right: 8rpx;
 			}
-			.address{
+			.address {
 				width: 654rpx;
 				height: 80rpx;
 				line-height: 80rpx;
-				background: #F5F5F5;
+				background: #f5f5f5;
 				border-radius: 16rpx;
 				font-size: 30rpx;
 				font-family: PingFang SC;
 				font-weight: bold;
 				color: #333333;
 				padding: 0 24rpx;
-				&.active{
-					background: #EBF5FF;
-					border: 2rpx solid #007AFF;
+				&.active {
+					background: #ebf5ff;
+					border: 2rpx solid #007aff;
 				}
 			}
 		}
 	}
-	.btn{
+	.btn {
 		width: 200rpx;
 		height: 64rpx;
 		line-height: 64rpx;
-		background: linear-gradient(0deg, #015EEA, #00C0FA);
+		background: linear-gradient(0deg, #015eea, #00c0fa);
 		border-radius: 32rpx;
 		margin: 17rpx auto;
 		font-size: 30rpx;
 		font-family: PingFang SC;
 		font-weight: 500;
 		text-align: center;
-		color: #FFFFFF;
+		color: #ffffff;
 	}
 }
 </style>

+ 201 - 95
pages2/exam/exam_appointment.vue

@@ -1,37 +1,43 @@
 <template>
 	<view>
 		<view style="width: 100%;text-align: center;position: fixed;height: 96rpx;z-index: 999;">
-			<u-tabs :list="list" sticky :current="current" @change="change" active-color="#007AFF"  inactive-color="#999"></u-tabs>
+			<u-tabs :list="list" sticky :current="current" @change="change" active-color="#007AFF" inactive-color="#999"></u-tabs>
 		</view>
 		<view class="safeArea" style="position: absolute;top: 96rpx;width: 100%;">
-			<view v-show="current==0" class="examMain">
-				<view class="noData" v-if="list1.length === 0">您暂无相关考试预约哦~</view>
-				<view  v-for="(item, index) in list1" :key="index" class="examList">
-					<view class="time">2021/10/29 09:30:00</view>
+			<view class="examMain">
+				<view class="noData" v-if="!listData.length">您暂无相关考试预约哦~</view>
+				<view v-for="(item, index) in listData" :key="index" class="examList">
+					<view class="time">{{ $method.timestampToTime(item.createTime, false) }}</view>
 					<view class="main">
-						<view class="top" @click="showDetails(item.id)">
-							<view class="subject">2020年二建建筑工程管理与实补考标...</view>
+						<view class="top" @click="showDetails(item)">
+							<view class="subject">{{ item.goodsName }}</view>
 							<u-icon name="arrow-right" color="#999999" size="28"></u-icon>
 						</view>
 						<view class="item">
 							<view class="left">报考专业</view>
-							<view class="right">XXXXX专业</view>
+							<view class="right">{{ item.categoryName }}专业</view>
 						</view>
 						<view class="item">
 							<view class="left">考试地点</view>
-							<view class="right">广州市天河区燕岭路建设大厦3楼</view>
+							<view class="right">{{ item.applySiteAddress }}</view>
 						</view>
 						<view class="item">
 							<view class="left">考试时间</view>
-							<view class="right">2021/10/23  10:00 ~ 11:00</view>
+							<view class="right">
+								{{ $method.timestampToTime(item.applySiteExamTime) }} {{ item.applySiteStartTime.replace('-', ':') }} ~
+								{{ item.applySiteEndTime.replace('-', ':') }}
+							</view>
 						</view>
-						<view class="item">
+						<view class="item" v-if="item.applySiteAddressTrain">
 							<view class="left">考前培训地点</view>
-							<view class="right">广州市天河区燕岭路建设大厦3楼</view>
+							<view class="right">{{ item.applySiteAddressTrain }}</view>
 						</view>
-						<view class="item">
+						<view class="item" v-if="item.applySiteExamTrainTime && item.applySiteStartTrainTime && item.applySiteEndTrainTime">
 							<view class="left">考前培训时间</view>
-							<view class="right">2021/10/23  10:00:00</view>
+							<view class="right">
+								{{ $method.timestampToTime(item.applySiteExamTrainTime) }} {{ item.applySiteStartTrainTime.replace('-', ':') }} ~
+								{{ item.applySiteEndTrainTime.replace('-', ':') }}
+							</view>
 						</view>
 					</view>
 				</view>
@@ -40,28 +46,75 @@
 		<!-- 弹框 考试详情-->
 		<u-popup v-model="details_show" mode="center" class="detailsModel">
 			<view class="detailsBox">
-				<view class="time">2021年10月29日 09:30:00</view>
+				<view class="time">{{ $method.timestampToTime(activeList.createTime, false) }}</view>
 				<view class="boxItem border">
 					<view class="title">报考学员信息</view>
-					<view class="item">姓名:<text class="val">倪虹洁</text></view>
-					<view class="item">身份证:<text class="val">44046354687236685698</text></view>
-					<view class="item">考试身份:<text class="val">非补考学员</text></view>
+					<view class="item">
+						姓名:
+						<text class="val">{{ activeList.realname }}</text>
+					</view>
+					<view class="item">
+						身份证:
+						<text class="val">{{ activeList.idCard }}</text>
+					</view>
+					<view class="item">
+						考试身份:
+						<text class="val">{{ activeList.studentType == 1 ? '非补考学员' : activeList.studentType == 2 ? '补考学员' : '' }}</text>
+					</view>
 				</view>
 				<view class="boxItem">
 					<view class="title">报考学员信息</view>
-					<view class="item">考试标题:<text class="val">这是一个考试标题</text></view>
-					<view class="item">报名开放时间:<text class="val">2021/10/23 ~ 2021/10/29</text></view>
-					<view class="item">报考专业:<text class="val">XXXXXXX</text></view>
-					<view class="item">考试地点:<text class="val">XXXXXXX</text></view>
-					<view class="item">考试时间:<text class="val">XXXXXXX</text></view>
-					<view class="item">考前培训地点:<text class="val">XXXXXXX</text></view>
-					<view class="item">考前培训时间:<text class="val">XXXXXXX</text></view>
+					<view class="item">
+						考试标题:
+						<text class="val">{{ activeList.applyName }}</text>
+					</view>
+					<view class="item">
+						报名开放时间:
+						<text class="val">{{ $method.timestampToTime(activeList.applyStartTime) }} ~ {{ $method.timestampToTime(activeList.applyEndTime) }}</text>
+					</view>
+					<view class="item">
+						报考专业:
+						<text class="val">{{ activeList.categoryName }}</text>
+					</view>
+					<view class="item">
+						考试地点:
+						<text class="val">{{ activeList.applySiteAddress }}</text>
+					</view>
+					<view class="item">
+						考试时间:
+						<text class="val">
+							{{
+								$method.timestampToTime(activeList.applySiteExamTime) +
+									' ' +
+									activeList.applySiteStartTime.replace('-', ':') +
+									'~' +
+									activeList.applySiteEndTime.replace('-', ':')
+							}}
+						</text>
+					</view>
+					<view class="item" v-if="activeList.applySiteAddressTrain">
+						考前培训地点:
+						<text class="val">{{ activeList.applySiteAddressTrain }}</text>
+					</view>
+					<view class="item" v-if="activeList.applySiteExamTrainTime && activeList.applySiteStartTrainTime && activeList.applySiteEndTrainTime">
+						考前培训时间:
+						<text class="val">
+							{{
+								$method.timestampToTime(activeList.applySiteExamTrainTime) +
+									' ' +
+									activeList.applySiteStartTrainTime.replace('-', ':') +
+									'~' +
+									activeList.applySiteEndTrainTime.replace('-', ':')
+							}}
+						</text>
+					</view>
 				</view>
 				<u-line color="#EEEEEE" />
-				<view class="foot">
+				<view class="foot" v-if="activeList.subscribeStatus === 1">
 					<view class="btn" @click="hideModel">知道了</view>
 					<view class="btn cancel" @click="cancelBtn">取消预约</view>
 				</view>
+				<view class="foot" v-else><view class="abtns" @click="hideModel">知道了</view></view>
 			</view>
 		</u-popup>
 		<!-- 弹框 取消预约-->
@@ -75,7 +128,7 @@
 					<view class="item">您确定要取消本次考试预约吗?。</view>
 				</view>
 				<view class="btn">
-					<view class="btn1 cancel" @click="cancel_show=false">取消</view>
+					<view class="btn1 cancel" @click="cancel_show = false">取消</view>
 					<view class="btn1 submit" @click="submit">确定</view>
 				</view>
 			</view>
@@ -93,22 +146,31 @@ export default {
 			list: [
 				{
 					name: '已预约'
-				}, 
+				},
 				{
 					name: '已取消'
-				}, 
+				},
 				{
 					name: '已过期'
 				}
 			],
-			list1:[1,2,3],
-			current: 0
+			listData: [],
+			current: 0,
+			activeList: {
+				applySiteStartTime: '',
+				applySiteEndTime: '',
+				applySiteStartTrainTime: '',
+				applySiteEndTrainTime: ''
+			}
 		};
 	},
-	onPullDownRefresh(){
-	},
+	onPullDownRefresh() {},
 	onLoad(option) {
-		
+		this.$api.getApplylist({ subscribeStatus: 1 }).then(res => {
+			if (res.data.code === 200) {
+				this.listData = res.data.rows;
+			}
+		});
 	},
 	onShow() {
 		/* if(this.current === 2 && this.$method.isLogin()){
@@ -123,36 +185,68 @@ export default {
 		};
 	},
 	methods: {
-		showDetails(id){
-			this.details_show = true
+		showDetails(item) {
+			this.activeList = JSON.parse(JSON.stringify(item));
+			this.details_show = true;
 		},
-		cancelBtn(){
-			this.cancel_show = true
+		cancelBtn() {
+			this.cancel_show = true;
 		},
-		hideModel(){
-			this.details_show = false
+		hideModel() {
+			this.details_show = false;
 		},
-		submit(){
-			console.log('确定')
+		submit() {
+			this.$api
+				.editApply({
+					subscribeId: this.activeList.subscribeId,
+					subscribeStatus: 2
+				})
+				.then(res => {
+					if (res.data.code === 200) {
+						this.cancel_show = false;
+						this.details_show = false;
+						this.$api.getApplylist({ subscribeStatus: 1 }).then(res => {
+							this.listData = res.data.rows;
+						});
+					}
+				});
 		},
-		change(index){
+		change(index) {
+			if (this.current === index) {
+				return;
+			}
 			this.current = index;
+			var data = {};
+			if (index === 0) {
+				data.subscribeStatus = 1;
+			}
+			if (index === 1) {
+				data.subscribeStatus = 2;
+			}
+			if (index === 2) {
+				data.subscribeStatus = 3;
+			}
+			this.$api.getApplylist(data).then(res => {
+				if (res.data.code === 200) {
+					this.listData = res.data.rows;
+				}
+			});
 		}
 	},
-	onReachBottom() {},
+	onReachBottom() {}
 	// computed: { ...mapGetters(['userInfo']) }
 };
 </script>
-<style >
+<style>
 page {
-	background: #EAEEF1;
+	background: #eaeef1;
 }
-.detailsModel .u-mode-center-box{
+.detailsModel .u-mode-center-box {
 	border-radius: 24rpx;
 }
 </style>
 <style scoped lang="scss">
-.noData{
+.noData {
 	text-align: center;
 	font-size: 32rpx;
 	font-family: PingFang SC;
@@ -160,62 +254,62 @@ page {
 	color: #999999;
 	margin: 160rpx 0;
 }
-.examMain{
+.examMain {
 	padding: 8rpx;
-	.time{
+	.time {
 		text-align: center;
 		font-size: 24rpx;
 		font-family: PingFang SC;
 		font-weight: 500;
 		color: #999999;
 	}
-	.main{
-		background: #FFFFFF;
+	.main {
+		background: #ffffff;
 		border-radius: 16rpx;
 		margin: 20rpx 0;
 	}
-	.top{
+	.top {
 		height: 103rpx;
 		display: flex;
 		justify-content: center;
 		align-items: center;
-		border-bottom: 1px solid #EEEEEE;
-		.subject{
+		border-bottom: 1px solid #eeeeee;
+		.subject {
 			max-width: 514rpx;
-			height:40rpx;
+			height: 40rpx;
 			font-size: 30rpx;
 			font-family: PingFang SC;
 			font-weight: bold;
-			color: #007AFF;
-			white-space:nowrap;
-			overflow:hidden;
-			text-overflow:ellipsis;
+			color: #007aff;
+			white-space: nowrap;
+			overflow: hidden;
+			text-overflow: ellipsis;
 		}
 	}
-	.item{
+	.item {
 		display: flex;
 		justify-content: space-between;
 		align-items: center;
-		margin-left:31rpx;
+		margin-left: 31rpx;
 		height: 80rpx;
-		padding-right:24rpx;
-		border-bottom: 1px solid #EEEEEE;
+		padding-right: 24rpx;
+		border-bottom: 1px solid #eeeeee;
 		font-size: 24rpx;
 		font-family: PingFang SC;
 		font-weight: 500;
 		color: #666666;
-		.right{
+		.right {
 			font-size: 30rpx;
 			font-family: PingFang SC;
 			font-weight: bold;
 		}
 	}
 }
-.detailsBox{
+.detailsBox {
 	width: 640rpx;
-	background: #FFFFFF;
+	background: #ffffff;
 	border-radius: 24rpx;
-	.time{
+	.time {
 		margin: 32rpx 0;
 		padding: 0 37rpx;
 		font-size: 30rpx;
@@ -223,99 +317,111 @@ page {
 		font-weight: bold;
 		color: #333333;
 	}
-	.boxItem{
+	.boxItem {
 		margin-left: 36rpx;
 		margin-bottom: 29rpx;
-		&.border{
+		&.border {
 			border-bottom: 1px solid #eee;
 		}
-		.title{
+		.title {
 			font-size: 24rpx;
 			font-family: PingFang SC;
 			font-weight: 500;
-			color: #007AFF;
+			color: #007aff;
 			position: relative;
-			&::before{
+			&::before {
 				content: '';
 				width: 4rpx;
 				height: 24rpx;
-				background: #007AFF;
+				background: #007aff;
 				border-radius: 2rpx;
 				position: absolute;
-				top:6rpx;
+				top: 6rpx;
 				left: -8rpx;
 			}
 		}
-		.item{
+		.item {
 			margin: 24rpx 0;
 			font-size: 26rpx;
 			font-family: PingFang SC;
 			font-weight: 500;
 			color: #999999;
-			.val{
+			.val {
 				color: #333333;
 			}
 		}
 	}
-	.foot{
+	.foot {
 		padding: 20rpx 40rpx;
 		display: flex;
 		justify-content: center;
-		.btn{
+		.btn {
 			width: 200rpx;
 			height: 80rpx;
 			line-height: 80rpx;
 			text-align: center;
-			background: #F5F5F5;
+			background: #f5f5f5;
 			border-radius: 40rpx;
 			font-size: 30rpx;
 			font-family: PingFang SC;
 			font-weight: bold;
-			color: #007AFF;
-			&.cancel{
-				background: #FF3B30;
-				color: #FFFFFF;
+			color: #007aff;
+			&.cancel {
+				background: #ff3b30;
+				color: #ffffff;
 			}
 		}
+		.abtns {
+			width: 526rpx;
+			height: 80rpx;
+			line-height: 80rpx;
+			text-align: center;
+			background: #007aff;
+			border-radius: 40rpx;
+			font-size: 30rpx;
+			font-family: PingFang SC;
+			font-weight: bold;
+			color: #fff;
+		}
 	}
 }
-.tipBox{
+.tipBox {
 	width: 640rpx;
 	padding: 30rpx 20rpx 40rpx;
-	background: #FFFFFF;
+	background: #ffffff;
 	border-radius: 24rpx;
 	font-family: PingFang SC;
-	.title{
+	.title {
 		text-align: center;
 		font-size: 30rpx;
 		font-weight: bold;
 		color: #333333;
 		margin-bottom: 40rpx;
 	}
-	.main{
+	.main {
 		font-size: 30rpx;
 		font-weight: 500;
 		color: #666666;
 		line-height: 48rpx;
 		margin-bottom: 40rpx;
 	}
-	.btn{
+	.btn {
 		display: flex;
 		justify-content: center;
-		.btn1{
+		.btn1 {
 			width: 200rpx;
 			height: 80rpx;
 			line-height: 80rpx;
 			text-align: center;
-			background: #F5F5F5;
+			background: #f5f5f5;
 			border-radius: 40px;
 			font-size: 30rpx;
 			font-weight: bold;
-			color: #007AFF;
+			color: #007aff;
 			margin: 0 20rpx;
-			&.submit{
-				background: #007AFF;
-				color:#fff;
+			&.submit {
+				background: #007aff;
+				color: #fff;
 			}
 		}
 	}

+ 194 - 99
pages2/exam/exam_result.vue

@@ -4,39 +4,42 @@
 			<u-tabs :list="list" sticky :current="current" @change="change" active-color="#007AFF" inactive-color="#999"></u-tabs>
 		</view>
 		<view class="safeArea" style="position: absolute;top: 96rpx;width: 100%;">
-			<view v-show="current==0" class="examMain">
-				<view class="noData" v-if="list1.length === 0">您暂无相关考试成绩和证书哦~~</view>
-				<view  v-for="(item, index) in list1" :key="index" class="examList">
-					<view class="time">2021/10/29 09:30:00</view>
+			<view class="examMain">
+				<view class="noData" v-if="!listData.length">您暂无相关考试成绩和证书哦~~</view>
+				<view v-for="(item, index) in listData" :key="index" class="examList">
+					<view class="time">{{ $method.timestampToTime(item.createTime, false) }}</view>
 					<view class="main">
-						<view class="top" @click="showDetails(item.id)">
-							<view class="subject">2020年二建建筑工程管理与实补考标...</view>
+						<view class="top" @click="showDetails(item)">
+							<view class="subject">{{ item.goodsName }}</view>
 							<u-icon name="arrow-right" color="#999999" size="28"></u-icon>
 						</view>
 						<view class="item">
 							<view class="left">报考专业</view>
-							<view class="right">XXXXX专业</view>
+							<view class="right">{{ item.categoryName }}</view>
 						</view>
 						<view class="item">
 							<view class="left">考试地点</view>
-							<view class="right">广州市天河区燕岭路建设大厦3楼</view>
+							<view class="right">{{ item.applySiteAddress }}</view>
 						</view>
 						<view class="item">
 							<view class="left">考试时间</view>
-							<view class="right">2021/10/23  10:00 ~ 11:00</view>
+							<view class="right">
+								{{ $method.timestampToTime(item.applySiteExamTime) }} {{ item.applySiteStartTime.replace('-', ':') }} ~
+								{{ item.applySiteEndTime.replace('-', ':') }}
+							</view>
 						</view>
 						<view class="item">
 							<view class="left">考试成绩</view>
-							<view class="right">99分</view>
+							<view class="right">{{ item.performance }}分</view>
 						</view>
 						<view class="item">
 							<view class="left">考试结果</view>
-							<view class="right pass">通过</view>
-							<!-- <view class="right nopass">未通过</view> --><!--这是不通过样式-->
+							<view class="right pass" v-if="item.result === 1">通过</view>
+							<view class="right nopass" v-if="item.result === 0">未通过</view>
 						</view>
-						<view class="item">
+						<view class="item" v-if="item.result === 1">
 							<view class="left">证书编号</view>
-							<view class="right">XXXXXXXXXX</view>
+							<view class="right">{{ item.certificateCode }}</view>
 						</view>
 					</view>
 				</view>
@@ -45,34 +48,83 @@
 		<!-- 弹框 考试详情-->
 		<u-popup v-model="details_show" mode="center" class="detailsModel">
 			<view class="detailsBox">
-				<view class="time">2021年10月29日 09:30:00</view>
+				<view class="time">{{ $method.timestampToTime(activeList.createTime, false) }}</view>
 				<view class="boxItem border">
 					<view class="title">报考学员信息</view>
-					<view class="item">姓名:<text class="val">倪虹洁</text></view>
-					<view class="item">身份证:<text class="val">44046354687236685698</text></view>
-					<view class="item">考试身份:<text class="val">非补考学员</text></view>
+					<view class="item">
+						姓名:
+						<text class="val">{{ activeList.realname }}</text>
+					</view>
+					<view class="item">
+						身份证:
+						<text class="val">{{ activeList.idCard }}</text>
+					</view>
+					<view class="item">
+						考试身份:
+						<text class="val">{{ activeList.studentType == 1 ? '非补考学员' : activeList.studentType == 2 ? '补考学员' : '' }}</text>
+					</view>
 				</view>
 				<view class="boxItem">
 					<view class="title">报考学员信息</view>
-					<view class="item">考试标题:<text class="val">这是一个考试标题</text></view>
-					<view class="item">报名开放时间:<text class="val">2021/10/23 ~ 2021/10/29</text></view>
-					<view class="item">报考专业:<text class="val">XXXXXXX</text></view>
-					<view class="item">考试地点:<text class="val">XXXXXXX</text></view>
-					<view class="item">考试时间:<text class="val">XXXXXXX</text></view>
-					<view class="item">考前培训地点:<text class="val">XXXXXXX</text></view>
-					<view class="item">考前培训时间:<text class="val">XXXXXXX</text></view>
+					<view class="item">
+						考试标题:
+						<text class="val">{{ activeList.applyName }}</text>
+					</view>
+					<view class="item">
+						报名开放时间:
+						<text class="val">{{ $method.timestampToTime(activeList.applyStartTime) }} ~ {{ $method.timestampToTime(activeList.applyEndTime) }}</text>
+					</view>
+					<view class="item">
+						报考专业:
+						<text class="val">{{ activeList.categoryName }}</text>
+					</view>
+					<view class="item">
+						考试地点:
+						<text class="val">{{ activeList.applySiteAddress }}</text>
+					</view>
+					<view class="item">
+						考试时间:
+						<text class="val">{{
+								$method.timestampToTime(activeList.applySiteExamTime) +
+									' ' +
+									activeList.applySiteStartTime.replace('-', ':') +
+									'~' +
+									activeList.applySiteEndTime.replace('-', ':')
+							}}</text>
+					</view>
+					<view class="item" v-if="activeList.applySiteAddressTrain">
+						考前培训地点:
+						<text class="val">{{ activeList.applySiteAddressTrain }}</text>
+					</view>
+					<view class="item" v-if="activeList.applySiteExamTrainTime && activeList.applySiteStartTrainTime && activeList.applySiteEndTrainTime">
+						考前培训时间:
+						<text class="val">{{
+								$method.timestampToTime(activeList.applySiteExamTrainTime) +
+									' ' +
+									activeList.applySiteStartTrainTime.replace('-', ':') +
+									'~' +
+									activeList.applySiteEndTrainTime.replace('-', ':')
+							}}</text>
+					</view>
 				</view>
 				<view class="boxItem">
 					<view class="title">考试成绩和证书信息</view>
-					<view class="item">考试成绩:<text class="val">96分</text></view>
-					<view class="item">考试结果:<text class="val pass">通过</text></view>
-					<!-- <view class="item">考试结果:<text class="val nopass">未通过</text></view> -->
-					<view class="item">证书编号:<text class="val">XXXXXXX</text></view>
+					<view class="item">
+						考试成绩:
+						<text class="val">{{activeList.performance}}分</text>
+					</view>
+					<view class="item" v-if="activeList.result === 1">
+						考试结果:
+						<text class="val pass">通过</text>
+					</view>
+					<view class="item" v-if="activeList.result === 0">考试结果:<text class="val nopass">未通过</text></view>
+					<view class="item" v-if="activeList.result === 1">
+						证书编号:
+						<text class="val">{{activeList.certificateCode}}</text>
+					</view>
 				</view>
 				<u-line color="#EEEEEE" />
-				<view class="foot">
-					<view class="btn" @click="hideModel">知道了</view>
-				</view>
+				<view class="foot"><view class="btn" @click="hideModel">知道了</view></view>
 			</view>
 		</u-popup>
 	</view>
@@ -86,20 +138,48 @@ export default {
 			details_show: false,
 			list: [
 				{
-					name: '已通过(3)'
-				}, 
+					name: '已通过'
+				},
 				{
-					name: '未通过(0)'
+					name: '未通过'
 				}
 			],
-			list1:[1,2,3],
-			current: 0
+			list1: [1, 2, 3],
+			listData: [],
+			current: 0,
+			activeList:{
+				applySiteStartTime: '',
+				applySiteEndTime: '',
+				applySiteStartTrainTime: '',
+				applySiteEndTrainTime: ''
+			},
 		};
 	},
-	onPullDownRefresh(){
-	},
+	onPullDownRefresh() {},
 	onLoad(option) {
-		
+		this.$api.getApplylist().then(res => {
+			if (res.data.code === 200) {
+				var a = [];
+				var b = [];
+				res.data.rows.forEach(items => {
+					if (items.result === 1) {
+						a.push(items);
+					}
+					if (items.result === 0) {
+						b.push(items);
+					}
+				});
+				this.list = [
+					{
+						name: `已通过(${a.length})`
+					},
+					{
+						name: `未通过(${b.length})`
+					}
+				];
+				this.listData = a
+			}
+		});
 	},
 	onShow() {
 		/* if(this.current === 2 && this.$method.isLogin()){
@@ -114,30 +194,45 @@ export default {
 		};
 	},
 	methods: {
-		showDetails(id){
-			this.details_show = true
+		showDetails(item) {
+			this.activeList = JSON.parse(JSON.stringify(item));
+			this.details_show = true;
 		},
-		hideModel(){
-			this.details_show = false
+		hideModel() {
+			this.details_show = false;
 		},
-		change(index){
+		change(index) {
+			if (this.current === index) {
+				return;
+			}
+			this.current = index;
+			var data = {};
+			if (index === 0) {
+				data.result = 1;
+			}
+			if (index === 1) {
+				data.result = 0;
+			}
+			this.$api.getApplylist(data).then(res => {
+				this.listData = res.data.rows;
+			});
 			this.current = index;
 		}
 	},
-	onReachBottom() {},
+	onReachBottom() {}
 	// computed: { ...mapGetters(['userInfo']) }
 };
 </script>
-<style >
+<style>
 page {
-	background: #EAEEF1;
+	background: #eaeef1;
 }
-.detailsModel .u-mode-center-box{
+.detailsModel .u-mode-center-box {
 	border-radius: 24rpx;
 }
 </style>
 <style scoped lang="scss">
-.noData{
+.noData {
 	text-align: center;
 	font-size: 32rpx;
 	font-family: PingFang SC;
@@ -145,68 +240,68 @@ page {
 	color: #999999;
 	margin: 160rpx 0;
 }
-.pass{
-	color: #34C759!important;
+.pass {
+	color: #34c759 !important;
 }
-.nopass{
-	color: #FF3B30!important;;
+.nopass {
+	color: #ff3b30 !important;
 }
-.examMain{
+.examMain {
 	padding: 8rpx;
-	.time{
+	.time {
 		text-align: center;
 		font-size: 24rpx;
 		font-family: PingFang SC;
 		font-weight: 500;
 		color: #999999;
 	}
-	.main{
-		background: #FFFFFF;
+	.main {
+		background: #ffffff;
 		border-radius: 16rpx;
 		margin: 20rpx 0;
 	}
-	.top{
+	.top {
 		height: 103rpx;
 		display: flex;
 		justify-content: center;
 		align-items: center;
-		border-bottom: 1px solid #EEEEEE;
-		.subject{
+		border-bottom: 1px solid #eeeeee;
+		.subject {
 			max-width: 514rpx;
-			height:40rpx;
+			height: 40rpx;
 			font-size: 30rpx;
 			font-family: PingFang SC;
 			font-weight: bold;
-			color: #007AFF;
-			white-space:nowrap;
-			overflow:hidden;
-			text-overflow:ellipsis;
+			color: #007aff;
+			white-space: nowrap;
+			overflow: hidden;
+			text-overflow: ellipsis;
 		}
 	}
-	.item{
+	.item {
 		display: flex;
 		justify-content: space-between;
 		align-items: center;
-		margin-left:31rpx;
+		margin-left: 31rpx;
 		height: 80rpx;
-		padding-right:24rpx;
-		border-bottom: 1px solid #EEEEEE;
+		padding-right: 24rpx;
+		border-bottom: 1px solid #eeeeee;
 		font-size: 24rpx;
 		font-family: PingFang SC;
 		font-weight: 500;
 		color: #666666;
-		.right{
+		.right {
 			font-size: 30rpx;
 			font-family: PingFang SC;
 			font-weight: bold;
 		}
 	}
 }
-.detailsBox{
+.detailsBox {
 	width: 640rpx;
-	background: #FFFFFF;
+	background: #ffffff;
 	border-radius: 24rpx;
-	.time{
+	.time {
 		margin: 32rpx 0;
 		padding: 0 37rpx;
 		font-size: 30rpx;
@@ -214,96 +309,96 @@ page {
 		font-weight: bold;
 		color: #333333;
 	}
-	.boxItem{
+	.boxItem {
 		margin-left: 36rpx;
 		margin-bottom: 29rpx;
-		&.border{
+		&.border {
 			border-bottom: 1px solid #eee;
 		}
-		.title{
+		.title {
 			font-size: 24rpx;
 			font-family: PingFang SC;
 			font-weight: 500;
-			color: #007AFF;
+			color: #007aff;
 			position: relative;
-			&::before{
+			&::before {
 				content: '';
 				width: 4rpx;
 				height: 24rpx;
-				background: #007AFF;
+				background: #007aff;
 				border-radius: 2rpx;
 				position: absolute;
-				top:6rpx;
+				top: 6rpx;
 				left: -12rpx;
 			}
 		}
-		.item{
+		.item {
 			margin: 24rpx 0;
 			font-size: 26rpx;
 			font-family: PingFang SC;
 			font-weight: 500;
 			color: #999999;
-			.val{
+			.val {
 				color: #333333;
 			}
 		}
 	}
-	.foot{
+	.foot {
 		padding: 20rpx 40rpx;
 		display: flex;
 		justify-content: center;
-		.btn{
+		.btn {
 			width: 526rpx;
 			height: 80rpx;
 			line-height: 80rpx;
 			text-align: center;
-			background: #F5F5F5;
+			background: #f5f5f5;
 			border-radius: 40rpx;
 			font-size: 30rpx;
 			font-family: PingFang SC;
 			font-weight: bold;
-			background: #007AFF;
-			color: #FFFFFF;
+			background: #007aff;
+			color: #ffffff;
 		}
 	}
 }
-.tipBox{
+.tipBox {
 	width: 640rpx;
 	padding: 30rpx 20rpx 40rpx;
-	background: #FFFFFF;
+	background: #ffffff;
 	border-radius: 24rpx;
 	font-family: PingFang SC;
-	.title{
+	.title {
 		text-align: center;
 		font-size: 30rpx;
 		font-weight: bold;
 		color: #333333;
 		margin-bottom: 40rpx;
 	}
-	.main{
+	.main {
 		font-size: 30rpx;
 		font-weight: 500;
 		color: #666666;
 		line-height: 48rpx;
 		margin-bottom: 40rpx;
 	}
-	.btn{
+	.btn {
 		display: flex;
 		justify-content: center;
-		.btn1{
+		.btn1 {
 			width: 200rpx;
 			height: 80rpx;
 			line-height: 80rpx;
 			text-align: center;
-			background: #F5F5F5;
+			background: #f5f5f5;
 			border-radius: 40px;
 			font-size: 30rpx;
 			font-weight: bold;
-			color: #007AFF;
+			color: #007aff;
 			margin: 0 20rpx;
-			&.submit{
-				background: #007AFF;
-				color:#fff;
+			&.submit {
+				background: #007aff;
+				color: #fff;
 			}
 		}
 	}

+ 12 - 1
pages2/exam/index.vue

@@ -3,7 +3,7 @@
 		<view class="examWrap">
 			<view class="examItem" @click="goAppointment">
 				<view class="item">考试预约</view>
-				<view class="item"><text class="num">3</text>个<u-icon name="arrow-right" color="#999999" size="28"></u-icon></view>
+				<view class="item"><text class="num">{{yyNum}}</text>个<u-icon name="arrow-right" color="#999999" size="28"></u-icon></view>
 			</view>
 			<view class="examItem" @click="goResult">
 				<view class="item">考试成绩和证书</view>
@@ -20,11 +20,22 @@ export default {
 	},
 	data() {
 		return {
+			yyNum:0,
 		};
 	},
+	onLoad(){
+		this.getInfo()
+	},
 	onShow() {
 	},
 	methods: {
+		getInfo(){
+			this.$api.getApplylist().then(res => {
+				if(res.data.code === 200){
+					this.yyNum = res.data.rows.length
+				}
+			})
+		},
 		goAppointment(){
 			this.$navTo.togo('/pages2/exam/exam_appointment');
 		},

+ 95 - 70
pages2/learn/my_learn.vue

@@ -4,24 +4,40 @@
 			<u-tabs :list="list" sticky :current="current" @change="change" active-color="#333" inactive-color="#999"></u-tabs>
 		</view>
 		<view class="learnWrap">
-			<template v-if="current===0">
+			<template v-if="current === 0">
 				<!-- <view class="noData">您暂无相关学时审核记录哦~</view> -->
-				<view class="learnItem">
-					<view class="title">2020年二建建筑工程管理与实补这是商品名称</view>
+				<view class="learnItem" v-for="(item, index) in listData" :key="index">
+					<view class="title">{{ item.goodsName }}</view>
 					<view class="status">
 						<view class="label">审核状态:</view>
-						<view class="val red">不可审核</view>
+						<view
+							class="val"
+							:class="item.periodStatus === -1 || item.periodStatus === 3 ? 'red' : item.periodStatus === 1 ? 'green' : item.periodStatus === 2 ? 'blue' : ''"
+						>
+							{{
+								item.periodStatus === -1
+									? '不可审核'
+									: item.periodStatus === 1
+									? '机构审核通过'
+									: item.periodStatus === 2
+									? '等待审核'
+									: item.periodStatus === 3
+									? '机构审核不通过'
+									: ''
+							}}
+						</view>
 					</view>
 					<view class="tip">
 						<view class="label">审核提示:</view>
 						<view class="val green">您的学时还未修完,请尽快完成课程学习</view>
 					</view>
-					<u-line color="#EEEEEE" />
-					<view class="btnBox">
-						<view class="btn">课程学习</view>
+					<view v-if="item.periodStatus !== 2">
+						<u-line color="#EEEEEE" />
+					<!-- <view class="subTitle">这是一个考试标题</view> -->
+						<view class="btnBox"><view class="btn">课程学习</view></view>
 					</view>
 				</view>
-				<view class="learnItem">
+				<!-- <view class="learnItem">
 					<view class="title">2020年二建建筑工程管理与实补这是商品名称</view>
 					<view class="status">
 						<view class="label">审核状态:</view>
@@ -47,9 +63,7 @@
 					</view>
 					<u-line color="#EEEEEE" />
 					<view class="subTitle">这是一个考试标题</view>
-					<view class="btnBox">
-						<view class="btn">预约考试</view>
-					</view>
+					<view class="btnBox"><view class="btn">预约考试</view></view>
 				</view>
 				<view class="learnItem">
 					<view class="title">2020年二建建筑工程管理与实补这是商品名称</view>
@@ -59,9 +73,7 @@
 					</view>
 					<u-line color="#EEEEEE" />
 					<view class="subTitle">这是一个考试标题</view>
-					<view class="btnBox">
-						<view class="btn">进入刷题</view>
-					</view>
+					<view class="btnBox"><view class="btn">进入刷题</view></view>
 				</view>
 				<view class="learnItem">
 					<view class="title">2020年二建建筑工程管理与实补这是商品名称</view>
@@ -71,39 +83,43 @@
 					</view>
 					<view class="tip">
 						<view class="label">审核提示:</view>
-						<view class="val">机构已审核通过,需等待注册中心复审后即可获得继续教育学时。审核时间约15个工作日,届时请前往官网申请证书延期。
+						<view class="val">
+							机构已审核通过,需等待注册中心复审后即可获得继续教育学时。审核时间约15个工作日,届时请前往官网申请证书延期。
 							<view class="link">复制官网链接</view>
 						</view>
 					</view>
 					<u-line color="#EEEEEE" />
-					<view class="btnBox">
-						<view class="btn">课程学习</view>
-					</view>
+					<view class="btnBox"><view class="btn">课程学习</view></view>
 				</view>
 				<view class="learnItem">
 					<view class="title">2020年二建建筑工程管理与实补这是商品名称</view>
 					<view class="status">
 						<view class="label">审核状态:</view>
-						<view class="val red">机构审核不通过
-							<view class="remark">有<text class="red">3节</text>需重修</view>
+						<view class="val red">
+							机构审核不通过
+							<view class="remark">
+								有
+								<text class="red">3节</text>
+								需重修
+							</view>
 						</view>
 					</view>
 					<view class="tip">
 						<view class="label">审核提示:</view>
-						<view class="val">请查看需重学记录,并及时重学对应课程,以免延误学时审核进度。
-						</view>
+						<view class="val">请查看需重学记录,并及时重学对应课程,以免延误学时审核进度。</view>
 					</view>
 					<u-line color="#EEEEEE" />
-					<view class="btnBox">
-						<view class="btn">课程学习</view>
-					</view>
-				</view>
+					<view class="btnBox"><view class="btn">课程学习</view></view>
+				</view> -->
 			</template>
-			<template v-if="current===1">
+			<template v-if="current === 1">
 				<!-- <view class="noData">您暂无相关学习凭证记录哦~</view> -->
 				<view class="learnItem">
 					<view class="title">2020年二建建筑工程管理与实补这是商品名称</view>
-					<view class="number"><text class="label">编号:</text>GZXY123456789</view>
+					<view class="number">
+						<text class="label">编号:</text>
+						GZXY123456789
+					</view>
 					<view class="btnBox">
 						<view class="btn">电子照片</view>
 						<view class="btn">下载凭证</view>
@@ -117,25 +133,34 @@
 <script>
 import { mapGetters } from 'vuex';
 export default {
-	components: {
-	},
+	components: {},
 	data() {
 		return {
 			current: 0,
 			list: [
 				{
 					name: '学时审核'
-				}, 
+				},
 				{
 					name: '学习凭证'
 				}
-			]
+			],
+			listData: []
 		};
 	},
-	onShow() {
+	onLoad(option) {
+		this.getInfos();
 	},
+	onShow() {},
 	methods: {
-		change(index){
+		getInfos() {
+			this.$api.getcourseperiodlistGoods().then(res => {
+				if (res.data.code === 200) {
+					this.listData = res.data.rows;
+				}
+			});
+		},
+		change(index) {
 			this.current = index;
 		}
 	},
@@ -143,53 +168,53 @@ export default {
 	computed: { ...mapGetters(['userInfo']) }
 };
 </script>
-<style >
-	page {
-			background: #EAEEF1;
-		}
+<style>
+page {
+	background: #eaeef1;
+}
 </style>
 <style scoped lang="scss">
-.learnWrap{
-	padding:98rpx 8rpx 8rpx;
+.learnWrap {
+	padding: 98rpx 8rpx 8rpx;
 }
-.noData{
+.noData {
 	font-size: 32rpx;
 	font-family: PingFang SC;
 	font-weight: 500;
 	color: #999999;
 	margin: 160rpx auto;
-	text-align:center;
+	text-align: center;
 }
-.learnItem{
-	background: #FFFFFF;
+.learnItem {
+	background: #ffffff;
 	border-radius: 16rpx;
 	padding: 32rpx 32rpx 0;
 	font-family: PingFang SC;
 	margin-bottom: 16rpx;
-	overflow:hidden;
-	.red{
-		color:#FF3B30!important;
+	overflow: hidden;
+	.red {
+		color: #ff3b30 !important;
 	}
-	.blue{
-		color:#007AFF!important;
+	.blue {
+		color: #007aff !important;
 	}
-	.green{
-		color:#34C759!important;
+	.green {
+		color: #34c759 !important;
 	}
-	.title{
+	.title {
 		font-size: 30rpx;
 		font-weight: bold;
 		color: #333333;
 		margin-bottom: 68rpx;
 	}
-	.status{
+	.status {
 		font-size: 24rpx;
 		font-weight: 500;
 		color: #666666;
 		margin-bottom: 26rpx;
-		display:flex;
+		display: flex;
 	}
-	.number{
+	.number {
 		font-size: 24rpx;
 		font-weight: 500;
 		color: #666666;
@@ -197,67 +222,67 @@ export default {
 		font-size: 30rpx;
 		font-weight: bold;
 		font-family: PingFang SC;
-		color:#333;
-		.label{
+		color: #333;
+		.label {
 			font-size: 24rpx;
 			font-weight: 500;
 			color: #666666;
 		}
 	}
-	.val{
+	.val {
 		font-size: 30rpx;
 		font-weight: bold;
-		color:#333;
-		.remark{
+		color: #333;
+		.remark {
 			font-size: 24rpx;
 			font-family: PingFang SC;
 			font-weight: 500;
 			color: #666666;
 		}
-		.link{
+		.link {
 			font-size: 30rpx;
 			font-family: PingFang SC;
 			font-weight: 500;
 			text-decoration: underline;
-			color: #007AFF;
+			color: #007aff;
 			margin-top: 36rpx;
 			text-decoration: underline;
 		}
 	}
-	.tip{
+	.tip {
 		font-size: 24rpx;
 		font-weight: 500;
 		color: #666666;
 		margin: 30rpx 0 27rpx;
-		display:flex;
+		display: flex;
 	}
-	.label{
+	.label {
 		width: 120rpx;
 		flex-shrink: 0;
 		margin-top: 5rpx;
 	}
-	.subTitle{
+	.subTitle {
 		font-size: 30rpx;
 		font-weight: bold;
 		color: #333333;
 		margin: 15rpx 0 40rpx;
 	}
-	.btnBox{
+	.btnBox {
 		height: 88rpx;
 		display: flex;
 		align-items: center;
 		justify-content: flex-end;
-		.btn{
+		.btn {
 			width: 224rpx;
 			height: 56rpx;
 			line-height: 56rpx;
 			text-align: center;
-			background: #007AFF;
+			background: #007aff;
 			border-radius: 16rpx;
 			font-size: 30rpx;
 			font-family: PingFang SC;
 			font-weight: 500;
-			color: #FFFFFF;
+			color: #ffffff;
 			margin-left: 16rpx;
 		}
 	}

+ 181 - 87
pages2/order/index.vue

@@ -1,33 +1,38 @@
 <template>
 	<view>
 		<view style="width: 100%;text-align: center;position: fixed;height: 96rpx;z-index: 999;">
-			<u-tabs :list="list"   sticky :current="current" @change="change" active-color="#007AFF"></u-tabs>
+			<u-tabs :list="list" sticky :current="current" @change="change" active-color="#007AFF"></u-tabs>
 		</view>
 		<view style="position: absolute;top: 96rpx;width: 100%;">
-			<view v-show="current==0">
-				<view  v-for="(item, index) in list1" style="padding: 20rpx;">
+			<view>
+				<view v-if="!order.length" class="noData">您暂无相关订单哦~</view>
+				<view v-else v-for="(item, index) in order" style="padding: 20rpx 20rpx 0rpx 20rpx" class="lisChild">
 					<view class="item">
 						<view style="display: flex;justify-content: space-between;align-items: center;height: 50rpx;" @click="openPopup(index)">
-							<view style="color: #666666;font-size: 24rpx;">订单编号:2018031903</view>
-							<view style="color: #999999;font-size: 24rpx;">2021-10-20</view>
+							<view style="color: #666666;font-size: 24rpx;">订单编号:{{ item.orderSn }}</view>
+							<view style="color: #999999;font-size: 24rpx;">{{ $method.timestampToTime(item.createTime) }}</view>
 						</view>
 						<u-line color="#D6D6DB" />
-						<view style="display: flex;justify-content: space-between;padding: 25rpx 0;">
-							<image src="/static/login_bg.jpg" style="height: 134rpx;width: 388rpx;border-radius: 16rpx;"></image>
-							<view style="margin-left: 20rpx;">
-								<view style="color: #333333;font-size: 30rpx;font-weight: bold;">
-									2020年二建建筑工程管理与实
-									务(实务专题班)
-								</view>
-								<view class="priceTag">
-									¥ 999.00
-								</view>
+						<view style="display: flex;justify-content: space-between;padding: 25rpx 0;border-bottom: 1rpx solid #eee;" v-for="(items, indexs) in 2" :key="indexs">
+							<image src="/static/login_bg.jpg" style="height: 134rpx;width: 278rpx;border-radius: 16rpx;flex-shrink: 0;"></image>
+							<view style="margin-left: 20rpx;flex:1;display: flex;flex-direction: column;">
+								<view style="color: #333333;font-size: 30rpx;font-weight: bold;flex:1">{{ item.goodsName }}</view>
+								<view class="priceTag">¥ {{ item.payPrice }}</view>
 							</view>
 						</view>
-						<u-line color="#D6D6DB" />
-						<view style="display: flex;flex-direction: row-reverse;align-items: center;height: 50rpx;margin-top: 10rpx;" >
-							<view class="btn2">继续支付</view>
-							<view class="btn1">取消订单</view>
+						<view style="height: 80rpx;display: flex;justify-content: space-between;align-items: center;">
+							<view>
+								<text style="color:#999;font-size: 24rpx;margin-right: 8rpx;">共1项</text>
+								<text style="color: #333;font-size: 30rpx;font-weight: bold;">合计</text>
+								<text style="color:#ff2d55;font-size: 30rpx;font-weight: bold;">¥999.00</text>
+							</view>
+							<view style="display: flex;align-items: center;">
+								<view class="btn2" v-if="item.orderStatus === 0">继续支付</view>
+								<view class="btn2" v-if="item.orderStatus === -1 || item.orderStatus === -2">重新购买</view>
+								<view class="btn2" v-if="item.orderStatus === 1 || item.orderStatus === 2">退款</view>
+								<view class="btn1" v-if="item.orderStatus === -1 || item.orderStatus === -2" @click="delOrder(item)">删除订单</view>
+								<view class="btn1" @click="closeOrder(item)" v-if="item.orderStatus === 0">取消订单</view>
+							</view>
 						</view>
 					</view>
 				</view>
@@ -37,39 +42,39 @@
 </template>
 
 <script>
-
 import { mapGetters } from 'vuex';
 export default {
-	components: {
-		
-	},
+	components: {},
 	data() {
 		return {
 			list: [
 				{
 					name: '待支付'
-				}, 
+				},
 				{
 					name: '已支付'
-				}, 
+				},
 				{
 					name: '已取消'
 				}
 			],
-			list1:[1,2,3,4,5,6,7],
-			current: 0
+			list1: [1, 2, 3, 4, 5, 6, 7],
+			current: 0,
+			order: [],
+			order1: [],
+			order2: [],
+			order3: []
 		};
 	},
-	onPullDownRefresh(){
-	},
-	onLoad(option) {
-		
-	},
+	onPullDownRefresh() {},
+	onLoad(option) {},
 	onShow() {
+		this.getOrderList();
 		/* if(this.current === 2 && this.$method.isLogin()){
 			this.$refs.refMy.init();
 		} */
 	},
+	//分享功能
 	onShareAppMessage(res) {
 		var self = this;
 		return {
@@ -78,68 +83,157 @@ export default {
 		};
 	},
 	methods: {
-		change(index){
+		//删除订单
+		delOrder(item) {
+			var self = this;
+			uni.showModal({
+				content: '确定要删除该订单吗',
+				success: function(res) {
+					if (res.confirm) {
+						self.$api
+							.eddOrder({
+								orderId: item.orderId,
+								status: 0
+							})
+							.then(res => {
+								if (res.data.code === 200) {
+									self.$method.showToast('订单删除成功');
+									self.getOrderList();
+								}
+							});
+					}
+				}
+			});
+		},
+		//取消订单
+		closeOrder(item) {
+			var self = this;
+			uni.showModal({
+				content: '确定要取消该订单吗',
+				success: function(res) {
+					if (res.confirm) {
+						self.$api
+							.eddOrder({
+								orderId: item.orderId,
+								orderStatus: -1
+							})
+							.then(res => {
+								if (res.data.code === 200) {
+									self.$method.showToast('订单取消成功', 'success');
+									self.getOrderList();
+								}
+							});
+					}
+				}
+			});
+		},
+		//获取订单
+		getOrderList() {
+			this.$api.getorderlists({ status: 1 }).then(res => {
+				if (res.data.code === 200) {
+					var array1 = []; //待支付
+					var array2 = []; //已支付
+					var array3 = []; //已取消
+					res.data.rows.forEach(item => {
+						if (item.orderStatus === 0) {
+							array1.push(item);
+						}
+						if (item.orderStatus === 1 || item.orderStatus === 2) {
+							array2.push(item);
+						}
+						if (item.orderStatus === -1 || item.orderStatus === -2) {
+							array3.push(item);
+						}
+					});
+					this.order1 = array1;
+					this.order2 = array2;
+					this.order3 = array3;
+					this.change(this.current);
+				}
+			});
+		},
+		change(index) {
 			this.current = index;
+			if (index === 0) {
+				this.order = JSON.parse(JSON.stringify(this.order1));
+			}
+			if (index === 1) {
+				this.order = JSON.parse(JSON.stringify(this.order2));
+			}
+			if (index === 2) {
+				this.order = JSON.parse(JSON.stringify(this.order3));
+			}
 		}
 	},
 	onReachBottom() {},
 	computed: { ...mapGetters(['userInfo']) }
 };
 </script>
-<style >
-	page {
-			background: #EAEEF1;
-		}
+<style>
+page {
+	background: #eaeef1;
+}
 </style>
 <style scoped>
-	.btn2{
-		width: 144rpx;
-		height: 48rpx;
-		background: #FFFFFF;
-		border: 2rpx solid #007AFF;
-		border-radius: 16rpx;
-		text-align: center;
-		line-height: 48rpx;
-		color: #007AFF;
-		margin: 0 8rpx;
-	}
-	.btn1{
-		width: 144rpx;
-		height: 48rpx;
-		background: #FFFFFF;
-		border: 2rpx solid #999999;
-		border-radius: 16rpx;
-		text-align: center;
-		line-height: 48rpx;
-		color: #999999;
-		margin: 0 8rpx;
-	}
-.item{
-		width: 100%;
-		background: #FFFFFF;
-		border-radius: 16rpx;
-		margin-bottom: 20rpx;
-		padding: 15rpx;
-	}
-	.priceTag{
-		font-size: 30rpx;
-		font-family: PingFang SC;
-		font-weight: bold;
-		color: #FF2D55;
-		display: flex;
-		flex-direction: row-reverse;
-	}
-	
-	.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;
-	}
+.lisChild:last-child {
+	margin-bottom: 34rpx;
+}
+.noData {
+	text-align: center;
+	font-size: 32rpx;
+	font-family: PingFang SC;
+	font-weight: 500;
+	color: #999999;
+	margin: 160rpx 0;
+}
+.btn2 {
+	width: 144rpx;
+	height: 46rpx;
+	background: #ffffff;
+	border: 2rpx solid #007aff;
+	border-radius: 16rpx;
+	text-align: center;
+	line-height: 48rpx;
+	color: #007aff;
+	margin: 0 8rpx;
+}
+.btn1 {
+	width: 144rpx;
+	height: 48rpx;
+	background: #ffffff;
+	border: 2rpx solid #999999;
+	border-radius: 16rpx;
+	text-align: center;
+	line-height: 48rpx;
+	color: #999999;
+	margin: 0 8rpx;
+}
+.item {
+	width: 100%;
+	background: #ffffff;
+	border-radius: 16rpx;
+	/* margin-bottom: 20rpx; */
+	padding: 15rpx;
+}
+.priceTag {
+	font-size: 30rpx;
+	font-family: PingFang SC;
+	font-weight: bold;
+	color: #ff2d55;
+	display: flex;
+	flex-direction: row-reverse;
+}
+
+.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;
+}
 </style>

+ 14 - 10
pages2/wd/class.vue

@@ -1,17 +1,17 @@
 <template>
 	<view style="padding: 30rpx;">
-		<navigator :url="'/pages2/wd/course?id='+item.goodsId" v-for="(item, index) in goodsList" :key="index" style="margin-bottom: 30rpx;">
+		<navigator :url="'/pages2/wd/course?id=' + item.goodsId" v-for="(item, index) in goodsList" :key="index" style="margin-bottom: 30rpx;">
 			<view class="class_item">
 				<image :src="$method.splitImgHost(item.coverUrl, true)" style="height: 316rpx;width: 100%;border-radius: 24rpx;"></image>
 				<view style="color: #333333;font-weight: bold;font-size: 32rpx;">{{ item.goodsName }}</view>
 				<view class=".content_box">
 					<image src="/static/icon/wk_icon1.png" class="wk_icon"></image>
-					<text class="content">3</text>
+					<text class="content">{{item.courseNum}}</text>
-					<text class="content">120</text>
+					<text class="content">{{ item.secAllNum }}</text>
-					<text class="content">60</text>
+					<text class="content">{{ item.classHours }}</text>
 					学时
 				</view>
 				<view class=".content_box">
@@ -23,18 +23,22 @@
 			<view class="bottomBox">
 				<view class=".content_box">
 					<image src="/static/icon/wk_icon3.png" class="wk_icon"></image>
-					学习进度:26/120
+					学习进度:{{ item.stuAllNum }}/{{ item.secAllNum }}
 				</view>
 				<view class="box_progress">
-					<view style="width: 60%;"><u-line-progress active-color="#ff9900" :percent="70"></u-line-progress></view>
+					<view style="width: 60%;"><u-line-progress :showText="false" active-color="#ff9900" :percent="(item.stuAllNum / item.secAllNum) * 100"></u-line-progress></view>
 					<view><u-button type="warning" size="mini" @click.stop="studyIn">进入学习</u-button></view>
 				</view>
-				<view class="box_progress">
-					<view style="width: 60%;"><text style="color: #333333;white-space: nowrap;text-overflow: ellipsis;">这是一个考试标题</text></view>
+				<view class="box_progress" v-if="item.applyStatus === 1">
+					<view style="width: 60%;">
+						<text style="color: #333333;white-space: nowrap;text-overflow: ellipsis;">{{ item.applyName }}</text>
+					</view>
 					<view><u-button :plain="true" type="primary" size="mini" @click.stop="appointment(item)">预约考试</u-button></view>
 				</view>
-				<view class="box_progress" v-if="false">
-					<view style="width: 60%;"><text style="color: #2979ff;white-space: nowrap;text-overflow: ellipsis;">【机电全科】2021年一建黄金A</text></view>
+				<view class="box_progress" v-if="item.beforeStatus === 1">
+					<view style="width: 60%;">
+						<text style="color: #2979ff;white-space: nowrap;text-overflow: ellipsis;">{{ item.beforeName }}</text>
+					</view>
 					<view><u-button type="primary" size="mini">进入刷题</u-button></view>
 				</view>
 			</view>

+ 5 - 3
pages2/wd/course.vue

@@ -17,7 +17,7 @@
 						<u-line-progress active-color="#ff9900" :percent="70"></u-line-progress>
 					</view>
 					<view>
-						<u-button type="warning" size="mini" @click.stop="studyIn">进入学习</u-button>
+						<u-button type="warning" size="mini" @click.stop="studyIn(item)">进入学习</u-button>
 					</view>
 				</view>
 				
@@ -52,8 +52,10 @@
 					}
 				});
 			},
-			studyIn(){
-				this.$navTo.togo('/pages2/verify/input');
+			studyIn(item){
+				this.$navTo.togo('/pages2/course/detail',{
+					id:item.courseId
+				});
 			},
 			appointment(){
 				this.$navTo.togo('/pages2/appointment/index');

+ 8 - 1
store/index.js

@@ -12,7 +12,8 @@ const store = new Vuex.Store({
 		dictObj:null,
 		allowLoading:true,
 		goodsAuditionConfigIdList:[], //当前访问页面的试听节ID
-		shoppingCartList:[]  //购物车支付商品
+		shoppingCartList:[],  //购物车支付商品
+		applyData:{},//预约考试数据存放
 	},  
 	 getters: {
 		userInfo: state => {
@@ -34,9 +35,15 @@ const store = new Vuex.Store({
 		},
 		shoppingCartList:state => {
 			return state.shoppingCartList
+		},
+		getApplyData:state => {
+			return state.applyData
 		}
 	},
     mutations: { 
+		updateApplyData(state, arrays) {
+		    state.applyData = arrays;  
+		},
         updateUserInfo(state, provider) {
             state.userInfo = provider.userInfo;  
         },