Selaa lähdekoodia

添加预约考试

linhancai 3 vuotta sitten
vanhempi
commit
c017d00bdb

+ 10 - 5
.hbuilderx/launch.json

@@ -2,10 +2,15 @@
   // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
     "version": "0.0",
     "configurations": [{
-            "type": "uniCloud",
-            "default": {
-                "launchtype": "local"
-            }
-        }
+     	"default" : 
+     	{
+     		"launchtype" : "local"
+     	},
+     	"mp-weixin" : 
+     	{
+     		"launchtype" : "local"
+     	},
+     	"type" : "uniCloud"
+     }
     ]
 }

+ 4 - 4
manifest.json

@@ -75,7 +75,7 @@
     "quickapp" : {},
     /* 小程序特有相关 */
     "mp-weixin" : {
-        "appid" : "wx8295c6fa6b0b3106",
+        "appid" : "wx57536ef2a9a48f42",
         "setting" : {
             "urlCheck" : false,
             "postcss" : true,
@@ -87,9 +87,9 @@
                 "desc" : "你的位置信息将用于小程序位置接口的效果展示"
             }
         },
-		"optimization":{
-			"subPackages": true
-		}
+        "optimization" : {
+            "subPackages" : true
+        }
     },
     "mp-alipay" : {
         "usingComponents" : true

+ 1 - 29
package-lock.json

@@ -1,36 +1,8 @@
 {
   "name": "zz-applet",
   "version": "1.0.0",
-  "lockfileVersion": 2,
+  "lockfileVersion": 1,
   "requires": true,
-  "packages": {
-    "": {
-      "name": "zz-applet",
-      "version": "1.0.0",
-      "license": "ISC",
-      "dependencies": {
-        "jweixin-module": "^1.6.0",
-        "tki-qrcode": "^0.1.6",
-        "uview-ui": "^1.8.3"
-      },
-      "devDependencies": {}
-    },
-    "node_modules/jweixin-module": {
-      "version": "1.6.0",
-      "resolved": "https://registry.npmjs.org/jweixin-module/-/jweixin-module-1.6.0.tgz",
-      "integrity": "sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w=="
-    },
-    "node_modules/tki-qrcode": {
-      "version": "0.1.6",
-      "resolved": "https://registry.npmjs.org/tki-qrcode/-/tki-qrcode-0.1.6.tgz",
-      "integrity": "sha512-EnnlS8psowC7PsW3MDYcxvJYkuklX3WAZ/BYanR4TdBHTu74GfjTBX8Y16REP+AeDENiVtBPh4jtTRL2P736hQ=="
-    },
-    "node_modules/uview-ui": {
-      "version": "1.8.3",
-      "resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-1.8.3.tgz",
-      "integrity": "sha512-DqKc+qRrOZLPcyfWv4b0HspSS9n1Cd6BbgKiYEv9rjTAnWoqJV7rXsvWqZdr5iKGP5EMNbNS741GLNw4sIHbpw=="
-    }
-  },
   "dependencies": {
     "jweixin-module": {
       "version": "1.6.0",

+ 10 - 0
pages.json

@@ -286,6 +286,16 @@
 						"bounce": "none"
 					}
 				}
+			},
+			{
+				"path": "appointment/order",
+				"style": {
+					"navigationBarTitleText": "预约考试",
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
+				}
 			}
 		]/*,
 		 "plugins": {

+ 3 - 2
pages/index/index.vue

@@ -27,7 +27,8 @@ export default {
 	},
 	methods: {
 		jumpBank() {
-			this.$navTo.togo('/pages2/bank/questionBank');
+			// this.$navTo.togo('/pages2/bank/questionBank');
+			this.$navTo.togo('/pages2/appointment/index');
 		},
 		getDict() {
 		
@@ -59,7 +60,7 @@ export default {
 		}
 	},
 	onReachBottom() {},
-	computed: { ...mapGetters(['userInfo']) }
+	// computed: { ...mapGetters(['userInfo']) }
 };
 </script>
 

+ 2 - 2
pages/login/login.vue

@@ -134,8 +134,8 @@ export default {
 				return 
 			}
 			//虚拟登录
-			/* that.fakeLogin()
-			return */
+			that.fakeLogin()
+			return
 			that.isUse = true
 			that.$api.accountLogin(this.form).then(
 				res => {

+ 203 - 10
pages2/appointment/index.vue

@@ -1,26 +1,219 @@
 <template>
-	<view>
-		预约考试
+	<view class="safeArea">
+		<view class="appointment">
+			<view class="appointmentItem appointmentHead">
+				<view class="imgBox">
+					<image src="/static/login_bg.jpg"></image>
+				</view>
+				<u-line color="#EEEEEE" />
+				<view class="title">这是一个考试标题过长换行过长换行过长换行过长换行过长换行</view>
+			</view>
+			<view class="appointmentItem appointmentTime">
+				<view class="item">
+					<view class="labelName">报名时间:</view>
+					<view class="valName">2021/12/1 ~ 2021/12/31</view>
+				</view>
+				<u-line color="#EEEEEE" />
+				<view class="item">
+					<view class="labelName">温馨提示:</view>
+					<view class="valName">预约开放期登录CCMS,进入主页,显示预核准的已报科目考试,点击预约考试科目,按流程选择考试考点、具体考试时间,提交完成。</view>
+				</view>
+			</view>
+			<view class="appointmentItem appointmentMajor">
+				<view class="top">
+					<view class="labelName">报考专业:</view>
+					<view class="valName">XXX专业名称XXX</view>
+				</view>
+			</view>
+			<view class="appointmentItem appointmentInfo">
+				<view class="item"><text class="labelName">姓<text style="opacity: 0;">姓</text>名:</text>倪虹洁</view>
+				<u-line color="#EEEEEE" />
+				<view class="item"><text class="labelName">身份证:</text>44046354687236685698</view>
+			</view>
+			<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.name"
+					     :name="item.name"
+					     @change="radioChange"
+					   >{{item.name}}
+					   </u-radio>
+					 </u-radio-group>
+				</view>
+			</view>
+			<view class="btn" @click="next">下一步</view>
+		</view>
+		<!-- 弹框-->
+		<u-popup v-model="showTip" mode="center" class="tipModel">
+			<view class="tipBox">
+				<view class="title">温馨提示</view>
+				<view class="main">
+					<view class="item">您所报考的【设备安装施工员】专业,</view>
+					<view class="item">考试次数已经用完。</view>
+					<view class="item">需要预约考试的补考学员,</view>
+					<view class="item">请先购买补考机会。</view>
+				</view>
+				<view class="btn">
+					<view class="btn1 cancel" @click="showTip=false">知道了</view>
+					<view class="btn1 submit" @click="submit">马上缴费</view>
+				</view>
+			</view>
+		</u-popup>
 	</view>
 </template>
 
 <script>
 import { mapGetters } from 'vuex';
 export default {
-	components: {},
 	data() {
-		return {};
+		return {
+			showTip: false,
+			radiolist: [{name: '非补考学员'},{name: '补考学员'}]
+		};
 	},
 	onLoad(option) {},
-
-	
 	methods: {
-		
+		radioChange(e){
+			console.log(e)
+		},
+		next(){
+			this.showTip = true
+		},
+		submit(){
+			this.$navTo.togo('/pages2/appointment/order');
+		}
 	},
 
 };
 </script>
-
-<style scoped>
-
+<style >
+page{
+	background-color: #EAEEF1;
+}
+.appointmentType .u-radio__label{
+	margin-left:16rpx!important;
+	margin-right: 116rpx!important;;
+}
+.tipModel .u-mode-center-box{
+	background-color: transparent!important;
+}
+</style>
+<style scoped lang="scss">
+.appointment{
+	padding: 16rpx;
+	.appointmentItem{
+		background: #FFFFFF;
+		border-radius: 16rpx;
+		margin-bottom: 16rpx;
+		.item{
+			padding: 24rpx 0;
+		}
+		.labelName{
+			font-size: 28rpx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			color: #999999;
+			margin-bottom: 16rpx;
+			line-height: 1;
+		}
+		.valName{
+			font-size: 30rpx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			color: #333333;
+		}
+	}
+	.appointmentHead{
+		padding-top: 16rpx;
+		.imgBox{
+			width: 590rpx;
+			height: 232rpx;
+			margin: 0 auto;
+			background: #ccc;
+			overflow: hidden;
+		}
+		.title{
+			padding:24rpx 28rpx 31rpx 31rpx;
+			font-size: 30rpx;
+			font-weight: bold;
+			font-family: PingFang SC;
+			color: #333333;
+		}
+	}
+	.appointmentTime{
+		padding: 10rpx 30rpx 0;
+	}
+	.appointmentMajor{
+		padding: 34rpx 30rpx 24rpx;
+	}
+	.appointmentInfo{
+		padding: 8rpx 30rpx;
+	}
+	.appointmentType{
+		padding: 8rpx 30rpx 4rpx;
+		.u-radio__label{
+			margin-left:16rpx;
+			margin-right: 116rpx;
+		}
+	}
+	.btn{
+		width: 526rpx;
+		height: 80rpx;
+		line-height: 80rpx;
+		background: #007AFF;
+		border-radius: 40rpx;
+		font-size: 30rpx;
+		font-family: PingFang SC;
+		font-weight: bold;
+		color: #FFFFFF;
+		margin: 40rpx auto;
+		text-align: center;
+	}
+}
+.tipBox{
+	width: 640rpx;
+	padding: 30rpx 36rpx 40rpx;
+	background: #FFFFFF;
+	border-radius: 24rpx;
+	font-family: PingFang SC;
+	.title{
+		text-align: center;
+		font-size: 30rpx;
+		font-weight: bold;
+		color: #333333;
+		margin-bottom: 40rpx;
+	}
+	.main{
+		font-size: 30rpx;
+		font-weight: 500;
+		color: #666666;
+		line-height: 48rpx;
+		margin-bottom: 40rpx;
+	}
+	.btn{
+		display: flex;
+		justify-content: center;
+		.btn1{
+			width: 200rpx;
+			height: 80rpx;
+			line-height: 80rpx;
+			text-align: center;
+			background: #F5F5F5;
+			border-radius: 40px;
+			font-size: 30rpx;
+			font-weight: bold;
+			color: #007AFF;
+			margin: 0 20rpx;
+			&.submit{
+				background: #007AFF;
+				color:#fff;
+			}
+		}
+	}
+}
 </style>

+ 308 - 0
pages2/appointment/order.vue

@@ -0,0 +1,308 @@
+<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">
+				<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 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>
+						</view>
+						<view class="num">已报:{{item.appoint}}/{{item.total}}</view>
+					</view>
+				</view>
+			</view>
+			<view class="btnMain">
+				<view class="return">上一步</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 addressList" :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>
+				</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: '广州市天可区燕岭路建设大厦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
+				}
+			]
+		};
+	},
+	onLoad(option) {},
+	methods: {
+		showAddress(){
+			this.address_show = true
+		},
+		choAddress(index){
+			this.addressList.forEach((item,idx)=>{
+				item.checked = false
+				this.$set(item, 'checked',false)
+				if(idx === index){
+					this.$set(item, 'checked',true)
+				}
+			})
+			console.log(this.addressList)
+		},
+		sureAddress(){
+			const index = this.addressList.findIndex(item => item.checked)
+			this.addressName = this.addressList[index].address
+			this.address_show = false
+		},
+		choItem(index){
+			const item = this.list[index]
+			if(item.status!==1){
+				return
+			}
+			this.list.forEach((item,idx)=>{
+				item.checked = false
+				if(idx === index){
+					item.checked = true
+				}
+			})
+		},
+		sureOppoint(){
+			this.$navTo.togo('/pages2/order/confirm_list');
+		}
+	},
+
+};
+</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: 2px solid #007AFF;
+				}
+				&.no{
+					background: #FFDDDB;
+					border: 2px 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;
+		.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>

+ 6 - 3
pages2/order/confirm_list.vue

@@ -23,7 +23,7 @@
 				</view>
 			</view>
 		</view>
-		<view class="bottomBox">
+		<view class="bottomBox safeArea">
 			<view class="priceTag">¥ 999.00</view>
 			<view style="display: flex;color: #FFFFFF;align-items: center;">
 				<view class="btn2" @click="goBuy()">确认购买</view>
@@ -236,7 +236,7 @@ export default {
 		background-color: #EAEEF1;
 	}
 </style>
-<style scoped>
+<style scoped lang="scss">
 	.picker-item {
 	        height: 50px;
 	        align-items: center;
@@ -348,6 +348,9 @@ export default {
 		display: flex;
 		justify-content: space-between;
 		align-items: center;
-		padding: 0 30rpx;
+		box-sizing: unset;
+		>view{
+			margin: 0 30rpx;
+		}
 	}
 </style>

+ 4 - 1
uni.scss

@@ -11,7 +11,10 @@
  *
  * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
  */
-
+.safeArea{
+	padding-bottom: constant(safe-area-inset-bottom);
+	padding-bottom: env(safe-area-inset-bottom);
+}
 /* 颜色变量 */
 @import 'uview-ui/theme.scss';
 /* 行为相关颜色 */