You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							311 lines
						
					
					
						
							8.9 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							311 lines
						
					
					
						
							8.9 KiB
						
					
					
				| <template> | |
| 	<view class="page-prebook-list"> | |
| 		<view class="nav"> | |
| 			<view :class="'item'+(userSelectIndex==0?' active':'')" @click="selectUser(0)">全部</view> | |
| 			<view :class="'item'+(userSelectIndex==(key+1)?' active':'')" v-for="(item,key) in vistors" @click="selectUser(key+1)">{{item.visitor_name}}</view> | |
| 		</view> | |
| 		<pre-book-list class="preg-books" :dataList="bookList"></pre-book-list> | |
| 	</view> | |
| </template> | |
| 
 | |
| <script> | |
| 	import preBookList from '@/components/preBookList.vue' | |
| 	export default { | |
| 		data() { | |
| 			return { | |
| 				userSelectIndex:0, | |
| 				vistors:false, | |
| 				bookList:[] | |
| 			} | |
| 		}, | |
| 		components:{ | |
| 			preBookList | |
| 		}, | |
| 		onShow(){ | |
| 			this.getVisitors() | |
| 		}, | |
| 		methods: { | |
| 			selectUser(key){ | |
| 				this.userSelectIndex = key | |
| 				this.getBookData() | |
| 			}, | |
| 			getBookData() { | |
| 				var param = new Object() | |
| 				param.page = 1 | |
| 				param.limit = 10000 | |
| 				if(this.userSelectIndex-1 >= 0){ | |
| 					param.visitor_id = this.vistors[this.userSelectIndex-1].id | |
| 					console.log(this.vistors) | |
| 				} | |
| 				uni.showLoading({ | |
| 					title:'加载中', | |
| 					mask:true | |
| 				}) | |
| 				var timerobj = setTimeout(function(){ | |
| 					uni.hideLoading() | |
| 				}, 3000) | |
| 				this.$http.req('get_appoints', param, 'POST', true).then(data=>{ | |
| 					clearTimeout(timerobj) | |
| 					uni.hideLoading() | |
| 					if(data == -1) return | |
| 					this.bookList = data.data | |
| 					// this.bookList = [ | |
| 					// 		  { | |
| 					// 			"id": 27, | |
| 					// 			"user_ids": [], | |
| 					// 			"user_infos": null, | |
| 					// 			"doctor_id": 2, | |
| 					// 			"date": "2024-04-03", | |
| 					// 			"username": "阿兰", | |
| 					// 			"create_datetime": "2024-04-03 15:44:26", | |
| 					// 			"visit_hospital": { | |
| 					// 			  "id": 1, | |
| 					// 			  "visit_day_text": "周一下午,周二上午,周三下午", | |
| 					// 			  "hospital_name": "测试医院", | |
| 					// 			  "hospital_location": "34.5145141,25.6414014", | |
| 					// 			  "hospital_dept_name": "呼吸科", | |
| 					// 			  "remind_text": "你好" | |
| 					// 			}, | |
| 					// 			"wait_count": 10, | |
| 					// 			"handler_type": 1, | |
| 					// 			"start_time": "16:00", | |
| 					// 			"end_time": "16:30", | |
| 					// 			"status": 0 | |
| 					// 		  }, | |
| 					// 		  { | |
| 					// 			"id": 26, | |
| 					// 			"user_ids": [], | |
| 					// 			"user_infos": null, | |
| 					// 			"doctor_id": 2, | |
| 					// 			"date": "2024-04-03", | |
| 					// 			"username": "张三", | |
| 					// 			"create_datetime": "2024-04-03 14:57:17", | |
| 					// 			"visit_hospital": { | |
| 					// 			  "id": 1, | |
| 					// 			  "visit_day_text": "周一下午,周二上午,周三下午", | |
| 					// 			  "hospital_name": "测试医院", | |
| 					// 			  "hospital_location": "34.5145141,25.6414014", | |
| 					// 			  "hospital_dept_name": "呼吸科", | |
| 					// 			  "remind_text": "你好" | |
| 					// 			}, | |
| 					// 			"wait_count": 0, | |
| 					// 			"handler_type": 1, | |
| 					// 			"start_time": "15:00", | |
| 					// 			"end_time": "15:30", | |
| 					// 			"status": 2 | |
| 					// 		  }, | |
| 					// 		  { | |
| 					// 			"id": 25, | |
| 					// 			"user_ids": [], | |
| 					// 			"user_infos": null, | |
| 					// 			"doctor_id": 1, | |
| 					// 			"date": "2024-03-30", | |
| 					// 			"username": "阿兰", | |
| 					// 			"create_datetime": "2024-03-30 08:48:17", | |
| 					// 			"visit_hospital": { | |
| 					// 			  "id": 1, | |
| 					// 			  "visit_day_text": "周一下午,周二上午,周三下午", | |
| 					// 			  "hospital_name": "测试医院", | |
| 					// 			  "hospital_location": "34.5145141,25.6414014", | |
| 					// 			  "hospital_dept_name": "呼吸科", | |
| 					// 			  "remind_text": "你好" | |
| 					// 			}, | |
| 					// 			"wait_count": 0, | |
| 					// 			"handler_type": 1, | |
| 					// 			"start_time": "09:00", | |
| 					// 			"end_time": "09:30", | |
| 					// 			"status": 2 | |
| 					// 		  }, | |
| 					// 		  { | |
| 					// 			"id": 24, | |
| 					// 			"user_ids": [], | |
| 					// 			"user_infos": null, | |
| 					// 			"doctor_id": 2, | |
| 					// 			"date": "2024-03-30", | |
| 					// 			"username": "张三", | |
| 					// 			"create_datetime": "2024-03-30 07:46:51", | |
| 					// 			"visit_hospital": { | |
| 					// 			  "id": 1, | |
| 					// 			  "visit_day_text": "周一下午,周二上午,周三下午", | |
| 					// 			  "hospital_name": "测试医院", | |
| 					// 			  "hospital_location": "34.5145141,25.6414014", | |
| 					// 			  "hospital_dept_name": "呼吸科", | |
| 					// 			  "remind_text": "你好" | |
| 					// 			}, | |
| 					// 			"wait_count": 0, | |
| 					// 			"handler_type": 2, | |
| 					// 			"start_time": "14:00", | |
| 					// 			"end_time": "14:30", | |
| 					// 			"status": 1 | |
| 					// 		  }, | |
| 					// 		  { | |
| 					// 			"id": 23, | |
| 					// 			"user_ids": [], | |
| 					// 			"user_infos": null, | |
| 					// 			"doctor_id": 1, | |
| 					// 			"date": "2024-03-31", | |
| 					// 			"username": "张三", | |
| 					// 			"create_datetime": "2024-03-30 06:50:52", | |
| 					// 			"visit_hospital": { | |
| 					// 			  "id": 1, | |
| 					// 			  "visit_day_text": "周一下午,周二上午,周三下午", | |
| 					// 			  "hospital_name": "测试医院", | |
| 					// 			  "hospital_location": "34.5145141,25.6414014", | |
| 					// 			  "hospital_dept_name": "呼吸科", | |
| 					// 			  "remind_text": "你好" | |
| 					// 			}, | |
| 					// 			"wait_count": 0, | |
| 					// 			"handler_type": 1, | |
| 					// 			"start_time": "15:00", | |
| 					// 			"end_time": "15:30", | |
| 					// 			"status": 2 | |
| 					// 		  }, | |
| 					// 		  { | |
| 					// 			"id": 22, | |
| 					// 			"user_ids": [], | |
| 					// 			"user_infos": null, | |
| 					// 			"doctor_id": 1, | |
| 					// 			"date": "2024-03-30", | |
| 					// 			"username": "张三", | |
| 					// 			"create_datetime": "2024-03-30 06:21:43", | |
| 					// 			"visit_hospital": { | |
| 					// 			  "id": 1, | |
| 					// 			  "visit_day_text": "周一下午,周二上午,周三下午", | |
| 					// 			  "hospital_name": "测试医院", | |
| 					// 			  "hospital_location": "34.5145141,25.6414014", | |
| 					// 			  "hospital_dept_name": "呼吸科", | |
| 					// 			  "remind_text": "你好" | |
| 					// 			}, | |
| 					// 			"wait_count": 0, | |
| 					// 			"handler_type": 1, | |
| 					// 			"start_time": "07:00", | |
| 					// 			"end_time": "07:30", | |
| 					// 			"status": 2 | |
| 					// 		  }, | |
| 					// 		  { | |
| 					// 			"id": 21, | |
| 					// 			"user_ids": [], | |
| 					// 			"user_infos": null, | |
| 					// 			"doctor_id": 1, | |
| 					// 			"date": "2024-03-30", | |
| 					// 			"username": "张三", | |
| 					// 			"create_datetime": "2024-03-30 06:20:40", | |
| 					// 			"visit_hospital": { | |
| 					// 			  "id": 1, | |
| 					// 			  "visit_day_text": "周一下午,周二上午,周三下午", | |
| 					// 			  "hospital_name": "测试医院", | |
| 					// 			  "hospital_location": "34.5145141,25.6414014", | |
| 					// 			  "hospital_dept_name": "呼吸科", | |
| 					// 			  "remind_text": "你好" | |
| 					// 			}, | |
| 					// 			"wait_count": 0, | |
| 					// 			"handler_type": 1, | |
| 					// 			"start_time": "07:00", | |
| 					// 			"end_time": "07:30", | |
| 					// 			"status": 2 | |
| 					// 		  }, | |
| 					// 		  { | |
| 					// 			"id": 20, | |
| 					// 			"user_ids": [], | |
| 					// 			"user_infos": null, | |
| 					// 			"doctor_id": 1, | |
| 					// 			"date": "2024-03-31", | |
| 					// 			"username": "张三", | |
| 					// 			"create_datetime": "2024-03-30 05:07:08", | |
| 					// 			"visit_hospital": { | |
| 					// 			  "id": 1, | |
| 					// 			  "visit_day_text": "周一下午,周二上午,周三下午", | |
| 					// 			  "hospital_name": "测试医院", | |
| 					// 			  "hospital_location": "34.5145141,25.6414014", | |
| 					// 			  "hospital_dept_name": "呼吸科", | |
| 					// 			  "remind_text": "你好" | |
| 					// 			}, | |
| 					// 			"wait_count": 0, | |
| 					// 			"handler_type": 1, | |
| 					// 			"start_time": "15:00", | |
| 					// 			"end_time": "15:30", | |
| 					// 			"status": 2 | |
| 					// 		  }, | |
| 					// 		  { | |
| 					// 			"id": 19, | |
| 					// 			"user_ids": [], | |
| 					// 			"user_infos": null, | |
| 					// 			"doctor_id": 1, | |
| 					// 			"date": "2024-03-31", | |
| 					// 			"username": "阿三", | |
| 					// 			"create_datetime": "2024-03-30 05:02:29", | |
| 					// 			"visit_hospital": { | |
| 					// 			  "id": 1, | |
| 					// 			  "visit_day_text": "周一下午,周二上午,周三下午", | |
| 					// 			  "hospital_name": "测试医院", | |
| 					// 			  "hospital_location": "34.5145141,25.6414014", | |
| 					// 			  "hospital_dept_name": "呼吸科", | |
| 					// 			  "remind_text": "你好" | |
| 					// 			}, | |
| 					// 			"wait_count": 0, | |
| 					// 			"handler_type": 1, | |
| 					// 			"start_time": "10:00", | |
| 					// 			"end_time": "10:30", | |
| 					// 			"status": 2 | |
| 					// 		  } | |
| 					// 		] | |
| 					// console.log(this.bookList) | |
| 				}); | |
| 			}, | |
| 			getVisitors() { | |
| 				var param = new Object() | |
| 				param.page = 1 | |
| 				param.limit = 10000 | |
| 				this.$http.req('get_visitor_names', param, 'GET').then(data=>{ | |
| 					if(data == -1) return | |
| 					this.getBookData() | |
| 					this.vistors = data | |
| 				}); | |
| 			}, | |
| 			pageInit() { | |
| 
 | |
| 			} | |
| 		} | |
| 	} | |
| </script> | |
| 
 | |
| <style lang="scss" scoped> | |
| 	.page-prebook-list{ | |
| 		width: 100%; | |
| 		height: 100vh; | |
| 		box-sizing: border-box; | |
| 		overflow-y: auto; | |
| 		background: #F8F8F8; | |
| 		.nav{ | |
| 			width: 100%; | |
| 			display: flex; | |
| 			height: 132rpx; | |
| 			display: flex; | |
| 			box-sizing: border-box; | |
| 			overflow-x: auto; | |
| 			align-items: center; | |
| 			padding: 0 18rpx; | |
| 			column-gap: 20rpx; | |
| 			.item{ | |
| 				width: auto; | |
| 				flex-shrink: 0; | |
| 				padding: 0 20rpx; | |
| 				height: 60rpx; | |
| 				line-height: 60rpx; | |
| 				background: rgba(201,203,209,0.25); | |
| 				border-radius: 30rpx; | |
| 				box-sizing: border-box; | |
| 				font-size: 24rpx; | |
| 				color: #616266; | |
| 				&.active{ | |
| 					border: 1rpx solid #5BD07A; | |
| 					color: #58CA7F; | |
| 				} | |
| 			} | |
| 		} | |
| 		.preg-books{ | |
| 			width: 714rpx; | |
| 			margin: 0 auto; | |
| 		} | |
| 	} | |
| </style>
 | |
| 
 |