Browse Source

新增司机身份相关页面

xiaoxin 3 years ago
parent
commit
79e6d964a9
49 changed files with 868 additions and 145 deletions
  1. 80 79
      manifest.json
  2. 20 3
      pages.json
  3. 113 16
      pages/detail/detail.vue
  4. 323 0
      pages/detailDriver/detailDriver.vue
  5. 0 19
      pages/home/home.vue
  6. 29 3
      pages/index/index.vue
  7. 3 3
      pages/my/my.vue
  8. 1 1
      pages/record/record.vue
  9. 271 0
      pages/recordDriver/recordDriver.vue
  10. BIN
      static/pass2.png
  11. 0 1
      unpackage/dist/build/h5/assets/_plugin-vue_export-helper.1b428a4d.js
  12. 1 0
      unpackage/dist/build/h5/assets/_plugin-vue_export-helper.517f0c1c.js
  13. 1 0
      unpackage/dist/build/h5/assets/api.e5d33ef6.js
  14. 1 0
      unpackage/dist/build/h5/assets/detail-75c0735f.css
  15. 0 1
      unpackage/dist/build/h5/assets/detail-ca65d544.css
  16. 1 0
      unpackage/dist/build/h5/assets/detailDriver-c96d0a15.css
  17. 1 1
      unpackage/dist/build/h5/assets/home-894c6d59.css
  18. 2 2
      unpackage/dist/build/h5/assets/index-4fa572a1.js
  19. 1 0
      unpackage/dist/build/h5/assets/isWeixin.7d8069c5.js
  20. 0 1
      unpackage/dist/build/h5/assets/isWeixin.e741caea.js
  21. 1 0
      unpackage/dist/build/h5/assets/my-749ea1e9.css
  22. 0 1
      unpackage/dist/build/h5/assets/my-cf0f3bfb.css
  23. 0 1
      unpackage/dist/build/h5/assets/no-bus.fca891d8.js
  24. 1 0
      unpackage/dist/build/h5/assets/pages-404-404.335ab7b7.js
  25. 0 1
      unpackage/dist/build/h5/assets/pages-404-404.4a6ae27b.js
  26. 0 1
      unpackage/dist/build/h5/assets/pages-detail-detail.32ef1271.js
  27. 1 0
      unpackage/dist/build/h5/assets/pages-detail-detail.d1521fa6.js
  28. 1 0
      unpackage/dist/build/h5/assets/pages-detailDriver-detailDriver.1f7da63d.js
  29. 1 0
      unpackage/dist/build/h5/assets/pages-home-home.c6860968.js
  30. 0 1
      unpackage/dist/build/h5/assets/pages-home-home.d0c4a1d2.js
  31. 1 0
      unpackage/dist/build/h5/assets/pages-index-index.89d27924.js
  32. 0 1
      unpackage/dist/build/h5/assets/pages-index-index.cd725f37.js
  33. 1 0
      unpackage/dist/build/h5/assets/pages-my-my.31ad77eb.js
  34. 0 1
      unpackage/dist/build/h5/assets/pages-my-my.eabf7c60.js
  35. 0 1
      unpackage/dist/build/h5/assets/pages-record-record.33ab8cdd.js
  36. 1 0
      unpackage/dist/build/h5/assets/pages-record-record.796ee0dc.js
  37. 1 0
      unpackage/dist/build/h5/assets/pages-recordDriver-recordDriver.6b91147d.js
  38. 1 0
      unpackage/dist/build/h5/assets/pass2.405256ad.js
  39. 0 1
      unpackage/dist/build/h5/assets/record-7096c017.css
  40. 1 0
      unpackage/dist/build/h5/assets/record-9e309213.css
  41. 1 0
      unpackage/dist/build/h5/assets/recordDriver-306b30fd.css
  42. 1 0
      unpackage/dist/build/h5/assets/right.5b5369cb.js
  43. 1 1
      unpackage/dist/build/h5/assets/search-1f99e3e7.css
  44. 1 0
      unpackage/dist/build/h5/assets/search.1b0309d2.js
  45. 0 1
      unpackage/dist/build/h5/assets/search.f46795dd.js
  46. 1 1
      unpackage/dist/build/h5/assets/uni-app.es.772a0883.js
  47. 3 3
      unpackage/dist/build/h5/index.html
  48. BIN
      unpackage/dist/build/h5/static/pass2.png
  49. 1 0
      util/api.js

+ 80 - 79
manifest.json

@@ -1,80 +1,81 @@
 {
-    "name" : "校车预约",
-    "appid" : "__UNI__43F49FA",
-    "description" : "",
-    "versionName" : "1.0.0",
-    "versionCode" : "100",
-    "transformPx" : false,
-    "app-plus" : {
-        /* 5+App特有相关 */
-        "usingComponents" : true,
-        "nvueCompiler" : "uni-app",
-        "nvueStyleCompiler" : "uni-app",
-        "splashscreen" : {
-            "alwaysShowBeforeRender" : true,
-            "waiting" : true,
-            "autoclose" : true,
-            "delay" : 0
-        },
-        "modules" : {},
-        /* 模块配置 */
-        "distribute" : {
-            /* 应用发布信息 */
-            "android" : {
-                /* android打包配置 */
-                "permissions" : [
-                    "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
-                    "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
-                    "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
-                    "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
-                    "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
-                    "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.CAMERA\"/>",
-                    "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
-                    "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
-                    "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
-                    "<uses-feature android:name=\"android.hardware.camera\"/>",
-                    "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
-                ]
-            },
-            "ios" : {},
-            /* ios打包配置 */
-            "sdkConfigs" : {}
-        }
-    },
-    /* SDK配置 */
-    "quickapp" : {},
-    /* 快应用特有相关 */
-    "mp-weixin" : {
-        /* 小程序特有相关 */
-        "appid" : "",
-        "setting" : {
-            "urlCheck" : false
-        },
-        "usingComponents" : true
-    },
-    "vueVersion" : "3",
-    "h5" : {
-        "title" : "校车预约",
-        "devServer" : {
-            "disableHostCheck" : true,
-            "proxy" : {
-                "/carstop/carbook" : {
-                    //目标接口域名
-                    "target" : "https://chtech.ncjti.edu.cn/carstop/carbook",
-                    // "target": "http://192.168.161.170:8088/carBook",
-                    //是否跨域
-                    "changeOrigin" : true,
-                    // 设置支持https协议的代理
-                    "secure" : false
-                }
-            }
-        },
-        "router" : {
-            "base" : "/carstop/dist5/"
-        }
-    }
-}
+	"name": "校车预约",
+	"appid": "__UNI__43F49FA",
+	"description": "",
+	"versionName": "1.0.0",
+	"versionCode": "100",
+	"transformPx": false,
+	"app-plus": {
+		/* 5+App特有相关 */
+		"usingComponents": true,
+		"nvueCompiler": "uni-app",
+		"nvueStyleCompiler": "uni-app",
+		"splashscreen": {
+			"alwaysShowBeforeRender": true,
+			"waiting": true,
+			"autoclose": true,
+			"delay": 0
+		},
+		"modules": {},
+		/* 模块配置 */
+		"distribute": {
+			/* 应用发布信息 */
+			"android": {
+				/* android打包配置 */
+				"permissions": [
+					"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
+					"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
+					"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
+					"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
+					"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
+					"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
+					"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
+					"<uses-permission android:name=\"android.permission.CAMERA\"/>",
+					"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
+					"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
+					"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
+					"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
+					"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
+					"<uses-feature android:name=\"android.hardware.camera\"/>",
+					"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
+				]
+			},
+			"ios": {},
+			/* ios打包配置 */
+			"sdkConfigs": {}
+		}
+	},
+	/* SDK配置 */
+	"quickapp": {},
+	/* 快应用特有相关 */
+	"mp-weixin": {
+		/* 小程序特有相关 */
+		"appid": "",
+		"setting": {
+			"urlCheck": false
+		},
+		"usingComponents": true
+	},
+	"vueVersion": "3",
+	"h5": {
+		"title": "校车预约",
+		"devServer": {
+			"disableHostCheck": true,
+			"proxy": {
+				"/carstop/carbook": {
+					//目标接口域名
+					"target": "https://chtech.ncjti.edu.cn/carstop/carbook",
+					// "target": "http://192.168.161.170:8088/carBook",
+					// "target": "https://chtech.ncjti.edu.cn/testingServer/carbook",
+					//是否跨域
+					"changeOrigin": true,
+					// 设置支持https协议的代理
+					"secure": false
+				}
+			}
+		},
+		"router": {
+			"base": "/carstop/dist5/"
+		}
+	}
+}

+ 20 - 3
pages.json

@@ -24,18 +24,35 @@
 		}, {
 			"path": "pages/record/record",
 			"style": {
-				"navigationBarTitleText": "预约记录",
+				"navigationBarTitleText": "预约记录--车队长",
 				"navigationStyle": "custom",
 				"enablePullDownRefresh": true
 			}
 		}, {
 			"path": "pages/detail/detail",
 			"style": {
-				"navigationBarTitleText": "预约详情",
+				"navigationBarTitleText": "预约详情--车队长",
 				"navigationStyle": "custom",
 				"enablePullDownRefresh": false
 			}
-		}, {
+		},
+		{
+			"path": "pages/recordDriver/recordDriver",
+			"style": {
+				"navigationBarTitleText": "预约记录--司机",
+				"navigationStyle": "custom",
+				"enablePullDownRefresh": true
+			}
+		},
+		{
+			"path": "pages/detailDriver/detailDriver",
+			"style": {
+				"navigationBarTitleText": "预约详情--司机",
+				"navigationStyle": "custom",
+				"enablePullDownRefresh": false
+			}
+		},
+		{
 			"path": "pages/404/404",
 			"style": {
 				"navigationBarTitleText": "错误页面",

+ 113 - 16
pages/detail/detail.vue

@@ -70,6 +70,17 @@
 			</picker>
 		</view>
 
+		<!-- 预约截止时间区域 -->
+		<view class="box">
+			<view class="left">预约截止时间</view>
+			<picker style="width: 40%;" @change="bindPickerChange($event, 7)" mode="time" :value="info.yy_end">
+				<view :class="['right', info.yy_end != 0 ? '' : 'unSelect']">
+					{{ info.yy_end != 0 ? info.yy_end : '请选择' }}
+					<view class="right-img"><img src="../../static/bottom.png" /></view>
+				</view>
+			</picker>
+		</view>
+
 		<!-- 路线区域 -->
 		<view class="box">
 			<view class="left">路线</view>
@@ -82,11 +93,11 @@
 			</picker>
 		</view>
 
-		<!-- 终点站区域 -->
+		<!-- 站点区域 -->
 		<view class="box">
-			<view class="left">终点站</view>
+			<view class="left">站点</view>
 
-			<picker style="width: 60%;" @change="bindPickerChange($event, 3)" :range="endList" range-key="route_end">
+			<picker style="width: 80%;" @change="bindPickerChange($event, 3)" :range="endList" range-key="route_end">
 				<view :class="['right', info.route_end ? '' : 'unSelect']">
 					{{ info.route_end ? info.route_end : '请选择' }}
 					<view class="right-img"><img src="../../static/bottom.png" /></view>
@@ -111,7 +122,16 @@
 
 		<!-- 人员名单区域 -->
 		<view class="list">
-			<view class="list-title" v-if="info.user_num != 0">人员名单({{ info.user_num }}/{{ info.contain }})</view>
+			<view class="list-title" v-if="info.user_num != 0">
+				<!-- 人员名单({{ info.user_num }}/{{ info.contain }}) -->
+				<view class="list-title-left">人员名单({{ typeList[result_state].text }}{{ listData.length }}人)</view>
+				<picker style="width: 38%;" :range="typeList" range-key="text" @change="bindPickerChange($event, 6)">
+					<view class="list-title-right">
+						{{ typeList[result_state].text }}
+						<view class="right-img"><img src="../../static/bottom.png" /></view>
+					</view>
+				</picker>
+			</view>
 			<view class="list-item" v-for="(item, index) in listData" :key="index">
 				<view class="item-img"><img src="../../static/man.png" /></view>
 				<view class="item-info">
@@ -123,7 +143,14 @@
 						<span>{{ item.yy_time }}</span>
 					</view>
 				</view>
-				<view class="item-type"><img src="../../static/subscribe.png" /></view>
+				<view v-if="item.yy_state === '1'" class="item-type"><img src="../../static/subscribe.png" /></view>
+				<view v-else class="item-type"><img src="../../static/pass2.png" /></view>
+			</view>
+
+			<!-- 无数据时展示的区域 -->
+			<view class="list-nodata" v-if="listData.length == 0">
+				<img src="../../static/no-bus.png" />
+				<view>暂无数据</view>
 			</view>
 		</view>
 	</view>
@@ -149,8 +176,9 @@ onLoad(options => {
 		} else {
 			info.value = JSON.parse(options.info)
 			// console.log(info.value)
+			idRef.value = info.value.id
 			// 获取人员列表
-			getData(info.value)
+			getData()
 			// 获取路线数组
 			getPathList()
 			// 获取终点站列表
@@ -182,6 +210,9 @@ onLoad(options => {
 // 带过来的预约详情数据
 const info = ref({})
 
+// 参数id
+const idRef = ref(null)
+
 // 车牌号绑定数据
 const form = ref({
 	selectValue: '',
@@ -207,6 +238,26 @@ const listData = ref([])
 const time_early = ref(null)
 // 发车时间推迟多少分钟可以扫码
 const time_late = ref(null)
+// 发车前多少分钟截止预约
+const time_yy_end = ref(null)
+
+// 人员名单筛选状态
+const result_state = ref(0)
+
+const typeList = ref([
+	{
+		text: '全部',
+		value: 0
+	},
+	{
+		text: '已预约未上车',
+		value: 1
+	},
+	{
+		text: '已上车',
+		value: 2
+	}
+])
 
 // 获取路线数组请求
 const getPathList = async () => {
@@ -246,17 +297,12 @@ const getBusList = async () => {
 }
 
 // 获取人员名单请求
-const getData = async value => {
-	const { route, route_end, yy_date, ci_time, car_number } = value
-
+const getData = async () => {
 	const res = await myRequest({
 		url: '/appqueryAppointeds.action',
 		data: {
-			route,
-			route_end,
-			yy_date,
-			ci_time,
-			car_number
+			id: idRef.value,
+			result_state: result_state.value
 		}
 	})
 	// console.log(res)
@@ -309,6 +355,13 @@ const handleSave = () => {
 		})
 		return
 	}
+	if (!info.value.yy_end) {
+		uni.showToast({
+			title: '请选择预约截止时间',
+			icon: 'none'
+		})
+		return
+	}
 	if (!info.value.route) {
 		uni.showToast({
 			title: '请选择路线',
@@ -338,7 +391,7 @@ const handleSave = () => {
 // 保存请求
 const handleSaveRequest = () => {
 	// console.log(info.value)
-	const { id, car_number, ci_time, route, route_end, contain, sm_start, sm_end } = info.value
+	const { id, car_number, ci_time, route, route_end, contain, sm_start, sm_end, yy_end } = info.value
 
 	uni.request({
 		url: '/carstop/carbook/scheupdate.action',
@@ -351,7 +404,8 @@ const handleSaveRequest = () => {
 			route_end,
 			contain,
 			sm_start,
-			sm_end
+			sm_end,
+			yy_end
 		},
 		success: res => {
 			if (res.data.code == 200) {
@@ -418,6 +472,7 @@ const getTimeConfig = async () => {
 	// console.log(res)
 	time_early.value = res.sm_end
 	time_late.value = res.sm_start
+	time_yy_end.value = res.yy_end
 }
 
 // 下拉框选择时的回调
@@ -431,6 +486,7 @@ const bindPickerChange = (e, type) => {
 		info.value.ci_time = e.detail.value
 		info.value.sm_start = time_change(info.value.ci_time, time_early.value * -1)
 		info.value.sm_end = time_change(info.value.ci_time, time_late.value)
+		info.value.yy_end = time_change(info.value.ci_time, time_yy_end.value * -1)
 	} else if (type == 2) {
 		info.value.route = pathList.value[e.detail.value].route
 		getEndList()
@@ -441,6 +497,11 @@ const bindPickerChange = (e, type) => {
 		info.value.sm_start = e.detail.value
 	} else if (type == 5) {
 		info.value.sm_end = e.detail.value
+	} else if (type == 6) {
+		result_state.value = e.detail.value
+		getData()
+	} else if (type == 7) {
+		info.value.yy_end = e.detail.value
 	}
 }
 // 获取当前时间  hh:mm
@@ -548,9 +609,34 @@ const getCurrentTime = () => {
 		padding: 13rpx 30rpx;
 
 		.list-title {
+			display: flex;
+			margin-top: 20rpx;
 			height: 41rpx;
 			color: #999999;
 			font-size: 28rpx;
+
+			.list-title-left {
+				flex: 1;
+			}
+
+			.list-title-right {
+				flex: 1;
+				display: flex;
+				justify-content: flex-end;
+				color: #000;
+
+				.right-img {
+					margin-left: 27rpx;
+					margin-top: -5rpx;
+					width: 17rpx;
+					height: 12rpx;
+
+					img {
+						width: 100%;
+						height: 100%;
+					}
+				}
+			}
 		}
 
 		.list-item {
@@ -618,6 +704,17 @@ const getCurrentTime = () => {
 				}
 			}
 		}
+
+		.list-nodata {
+			padding: 50rpx 0;
+			background-color: #fff;
+			text-align: center;
+			color: #999999;
+
+			img {
+				width: 500rpx;
+			}
+		}
 	}
 }
 

+ 323 - 0
pages/detailDriver/detailDriver.vue

@@ -0,0 +1,323 @@
+<template>
+	<view class="container">
+		<!-- 车牌号区域 -->
+		<view class="box">
+			<view class="left">车牌号</view>
+			<view class="right">{{ info.car_number }}</view>
+		</view>
+
+		<!-- 人数区域 -->
+		<view class="box">
+			<view class="left">容量</view>
+			<view class="right">{{ info.contain }}</view>
+		</view>
+
+		<!-- 发车日期区域 -->
+		<view class="box">
+			<view class="left">发车日期</view>
+			<view class="right">{{ info.yy_date }}</view>
+		</view>
+
+		<!-- 发车时间区域 -->
+		<view class="box">
+			<view class="left">发车时间</view>
+			<view class="right">{{ info.ci_time }}</view>
+		</view>
+
+		<!-- 扫码开始时间区域 -->
+		<view class="box">
+			<view class="left">扫码开始时间</view>
+			<view class="right">{{ info.sm_start }}</view>
+		</view>
+
+		<!-- 扫码结束时间区域 -->
+		<view class="box">
+			<view class="left">扫码结束时间</view>
+			<view class="right">{{ info.sm_end }}</view>
+		</view>
+
+		<!-- 预约截止时间区域 -->
+		<view class="box">
+			<view class="left">预约截止时间</view>
+			<view class="right">{{ info.yy_end }}</view>
+		</view>
+
+		<!-- 路线区域 -->
+		<view class="box">
+			<view class="left">路线</view>
+			<view class="right2">{{ info.route }}</view>
+		</view>
+
+		<!-- 终点站区域 -->
+		<view class="box">
+			<view class="left">站点</view>
+			<view class="right2">{{ info.route_end }}</view>
+		</view>
+
+		<!-- 状态区域 -->
+		<view class="box">
+			<view class="left">状态</view>
+			<view class="right">{{ info.state_str }}</view>
+		</view>
+
+		<!-- 提前一天预约区域 -->
+		<view class="box">
+			<view class="left">可否提前一天预约</view>
+			<view class="right">{{ info.before_state == 0 ? '不可以' : '可以' }}</view>
+		</view>
+
+		<!-- 人员名单区域 -->
+		<view class="list">
+			<view class="list-title">
+				<view class="list-title-left">人员名单({{ typeList[result_state].text }}{{ listData.length }}人)</view>
+
+				<picker style="width: 38%;" :range="typeList" range-key="text" @change="bindPickerChange">
+					<view class="list-title-right">
+						{{ typeList[result_state].text }}
+						<view class="right-img"><img src="../../static/bottom.png" /></view>
+					</view>
+				</picker>
+			</view>
+
+			<view class="list-item" v-for="(item, index) in listData" :key="index">
+				<view class="item-img"><img src="../../static/man.png" /></view>
+				<view class="item-info">
+					<view class="info-name">
+						<view>{{ item.user_name }}</view>
+					</view>
+					<view class="info-mes">
+						{{ item.user_zz }}
+						<span>{{ item.yy_time }}</span>
+					</view>
+				</view>
+				<view v-if="item.yy_state === '1'" class="item-type"><img src="../../static/subscribe.png" /></view>
+				<view v-else class="item-type"><img src="../../static/pass2.png" /></view>
+			</view>
+
+			<!-- 无数据时展示的区域 -->
+			<view class="list-nodata" v-if="listData.length == 0">
+				<img src="../../static/no-bus.png" />
+				<view>暂无数据</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script setup>
+import { ref } from 'vue'
+import { onLoad } from '@dcloudio/uni-app'
+
+import { myRequest } from '@/util/api.js'
+
+import { isWeixin } from '@/util/isWeixin.js'
+
+onLoad(options => {
+	if (isWeixin()) {
+		let userInfo = JSON.parse(uni.getStorageSync('bus-userInfo'))
+		if (userInfo.user_zz !== '司机') {
+			uni.redirectTo({
+				url: '/pages/404/404?message=暂无权限'
+			})
+		} else {
+			info.value = JSON.parse(options.info)
+			idRef.value = info.value.id
+			// 获取人员列表
+			getData()
+		}
+	} else {
+		uni.redirectTo({
+			url: '/pages/404/404?message=请在微信客户端打开链接'
+		})
+	}
+})
+
+// 带过来的预约详情数据
+const info = ref({})
+
+// 参数id
+const idRef = ref(null)
+
+// 人员列表数组
+const listData = ref([])
+
+// 人员名单筛选状态
+const result_state = ref(0)
+
+const typeList = ref([
+	{
+		text: '全部',
+		value: 0
+	},
+	{
+		text: '已预约未上车',
+		value: 1
+	},
+	{
+		text: '已上车',
+		value: 2
+	}
+])
+
+// 获取人员名单请求
+const getData = async () => {
+	const res = await myRequest({
+		url: '/appqueryAppointeds.action',
+		data: {
+			id: idRef.value,
+			result_state: result_state.value
+		}
+	})
+	// console.log(res)
+	listData.value = res.data
+}
+
+// 下拉框的选择回调事件
+const bindPickerChange = e => {
+	result_state.value = e.detail.value
+	getData()
+}
+</script>
+
+<style lang="scss" scoped>
+.container {
+	background-color: #fff;
+
+	.box {
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		padding: 0 30rpx;
+		height: 98rpx;
+		font-size: 28rpx;
+		border-bottom: 1rpx solid #e6e6e6;
+
+		.left {
+			flex: 1;
+			color: #999999;
+		}
+
+		.right {
+			flex: 1;
+			display: flex;
+			justify-content: flex-end;
+		}
+		.right2 {
+			flex: 3;
+			display: flex;
+			justify-content: flex-end;
+		}
+	}
+
+	.list {
+		padding: 13rpx 30rpx;
+
+		.list-title {
+			display: flex;
+			margin-top: 20rpx;
+			height: 41rpx;
+			color: #999999;
+			font-size: 28rpx;
+
+			.list-title-left {
+				flex: 1;
+			}
+
+			.list-title-right {
+				flex: 1;
+				display: flex;
+				justify-content: flex-end;
+				color: #000;
+
+				.right-img {
+					margin-left: 27rpx;
+					margin-top: -5rpx;
+					width: 17rpx;
+					height: 12rpx;
+
+					img {
+						width: 100%;
+						height: 100%;
+					}
+				}
+			}
+		}
+
+		.list-item {
+			display: flex;
+			align-items: center;
+			box-sizing: border-box;
+			padding: 29rpx 0 26rpx 0;
+			height: 155rpx;
+			border-bottom: 1rpx solid #e6e6e6;
+
+			.item-img {
+				width: 100rpx;
+				height: 100rpx;
+				border-radius: 50%;
+
+				img {
+					width: 100%;
+					height: 100%;
+				}
+			}
+
+			.item-info {
+				flex: 1;
+				display: flex;
+				flex-direction: column;
+				justify-content: space-evenly;
+				margin-left: 6rpx;
+				height: 100rpx;
+
+				.info-name {
+					display: flex;
+					align-items: center;
+					font-size: 32rpx;
+
+					.info-name-img {
+						margin-left: 26rpx;
+						width: 30rpx;
+						height: 35rpx;
+
+						img {
+							width: 100%;
+							height: 100%;
+						}
+					}
+				}
+
+				.info-mes {
+					font-size: 24rpx;
+					color: #999999;
+
+					span {
+						margin-left: 26rpx;
+						color: #a6a6a6;
+					}
+				}
+			}
+
+			.item-type {
+				width: 104rpx;
+				height: 41rpx;
+
+				img {
+					width: 100%;
+					height: 100%;
+				}
+			}
+		}
+
+		.list-nodata {
+			padding: 50rpx 0;
+			background-color: #fff;
+			text-align: center;
+			color: #999999;
+
+			img {
+				width: 500rpx;
+			}
+		}
+	}
+}
+</style>

+ 0 - 19
pages/home/home.vue

@@ -96,7 +96,6 @@ import { isWeixin } from '../../util/isWeixin.js'
 onLoad(() => {
 	if (isWeixin()) {
 		card_number.value = uni.getStorageSync('bus_card_number')
-		getUserInfo()
 	} else {
 		uni.redirectTo({
 			url: '/pages/404/404?message=请在微信客户端打开链接'
@@ -120,7 +119,6 @@ onShow(() => {
 
 // 页面下拉触发刷新回调
 onPullDownRefresh(() => {
-	getUserInfo()
 	dateType.value == '今天' ? getTimeFormat() : getTimeFormat(1)
 	getPathList()
 	getOrderConfig()
@@ -189,23 +187,6 @@ watch(
 	}
 )
 
-// 获取用户信息
-const getUserInfo = async () => {
-	const res = await myRequest({
-		url: '/appget_user.action',
-		data: {
-			card_number: card_number.value
-		}
-	})
-	// console.log(res);
-	uni.setStorageSync('bus-userInfo', JSON.stringify(res.data))
-	if (res.data && res.data.user_zz !== '教师') {
-		uni.reLaunch({
-			url: '/pages/record/record'
-		})
-	}
-}
-
 // 获取所有的发车路线
 const getPathList = async () => {
 	const res = await myRequest({

+ 29 - 3
pages/index/index.vue

@@ -7,10 +7,13 @@ import { onLoad } from '@dcloudio/uni-app'
 
 import { getQueryString } from '../../util/getParams.js'
 
+import { myRequest } from '../../util/api.js'
+
 const APPKEY = '4AA7B3944BDF3739'
 const ocode = '1015730314'
 // 线上地址
 const URL = 'https://chtech.ncjti.edu.cn/carstop/carbook/appopenid.action'
+// const URL = 'https://chtech.ncjti.edu.cn/testingServer/carbook/appopenid.action'
 // 本地地址
 // const URL = 'http://192.168.161.170:8088/carBook/appopenid.action'
 
@@ -27,14 +30,37 @@ const loginFilter = () => {
 			getCardnumberURL()
 		} else {
 			uni.setStorageSync('bus_card_number', card_number)
-			uni.switchTab({
-				url: '/pages/home/home'
-			})
+			getUserInfo()
 		}
 	} else {
+		getUserInfo()
+	}
+}
+
+// 获取用户信息
+const getUserInfo = async () => {
+	const card_number = uni.getStorageSync('bus_card_number')
+	const res = await myRequest({
+		url: '/appget_user.action',
+		data: {
+			card_number
+		}
+	})
+	// console.log(res);
+	uni.setStorageSync('bus-userInfo', JSON.stringify(res.data))
+	// 判断用户权限
+	if (res.data && res.data.user_zz === '教师') {
 		uni.switchTab({
 			url: '/pages/home/home'
 		})
+	} else if (res.data && res.data.user_zz === '车队长') {
+		uni.reLaunch({
+			url: '/pages/record/record'
+		})
+	} else if (res.data && res.data.user_zz === '司机') {
+		uni.reLaunch({
+			url: '/pages/recordDriver/recordDriver'
+		})
 	}
 }
 

+ 3 - 3
pages/my/my.vue

@@ -29,7 +29,7 @@
 					{{ item.contain }}人
 				</view>
 				<view class="list-info-item">
-					<span>终点站:</span>
+					<span>站点:</span>
 					{{ item.route_end }}
 				</view>
 				<view class="list-info-item highlight" v-if="item.state === 1">
@@ -379,9 +379,9 @@ const getConveyData = Obj => {
 				margin: 17rpx 30rpx 40rpx;
 				width: 170rpx;
 				height: 70rpx;
-				color: #999999;
+				color: #fff;
 				border-radius: 15rpx;
-				background-color: #e6e6e6;
+				background-color: #ffc400;
 			}
 		}
 	}

+ 1 - 1
pages/record/record.vue

@@ -30,7 +30,7 @@
 				<span>{{ item.route }}</span>
 			</view>
 			<view class="list-item">
-				点:
+				点:
 				<span>{{ item.route_end }}</span>
 			</view>
 			<view class="list-item">

+ 271 - 0
pages/recordDriver/recordDriver.vue

@@ -0,0 +1,271 @@
+<template>
+	<view class="container">
+		<!-- 筛选区域 -->
+		<Search :typeList="typeList" :timeList="busList" @handLeConveyData="getConveyData" />
+
+		<!-- 列表区域 -->
+		<view class="list" v-for="(item, index) in listData" :key="index" @click="handleLookDetail(item)">
+			<view class="list-title">
+				<view class="title-number">车牌:{{ item.car_number != 0 ? item.car_number : '无' }}</view>
+				<view class="title-icon"><img src="../../static/right.png" /></view>
+			</view>
+			<view class="list-item">
+				状态:
+				<span :class="item.state_str == '预约进行中' || item.state_str == '候补中' ? 'list-item-type' : ''">{{ item.state_str }}</span>
+			</view>
+			<view class="list-item">
+				发车日期:
+				<span>{{ item.yy_date }}</span>
+			</view>
+			<view class="list-item" v-if="item.state_str == '预约进行中' || item.state_str == '已截止'">
+				发车时间:
+				<span>{{ item.ci_time != 0 ? item.ci_time : '' }}</span>
+			</view>
+			<view class="list-item">
+				扫码时间:
+				<span>{{ item.sm_start + '-' + item.sm_end }}</span>
+			</view>
+			<view class="list-item">
+				线路:
+				<span>{{ item.route }}</span>
+			</view>
+			<view class="list-item">
+				站点:
+				<span>{{ item.route_end }}</span>
+			</view>
+			<view class="list-item">
+				人数:
+				<view class="list-item-progress" v-if="item.state_str == '预约进行中' || item.state_str == '已截止'">
+					<progress activeColor="#3C50E8" stroke-width="9" :percent="item.percent ? item.percent : 0" />
+				</view>
+				<span v-if="item.state_str == '预约进行中' || item.state_str == '已截止'">{{ item.user_num + '/' + item.contain }}</span>
+				<span v-else>{{ item.contain }}</span>
+			</view>
+		</view>
+
+		<!-- 无数据时展示的区域 -->
+		<view class="list-nodata" v-if="listData.length == 0">
+			<img src="../../static/no-bus.png" />
+			<view>暂无数据</view>
+		</view>
+	</view>
+</template>
+
+<script setup>
+import { ref } from 'vue'
+
+import { onLoad, onPullDownRefresh } from '@dcloudio/uni-app'
+
+import { myRequest } from '../../util/api.js'
+
+import { isWeixin } from '../../util/isWeixin.js'
+
+import Search from '../../components/search'
+
+onLoad(() => {
+	if (isWeixin()) {
+		let userInfo = uni.getStorageSync('bus-userInfo')
+		if (!userInfo) {
+			uni.redirectTo({
+				url: '/pages/index/index'
+			})
+		} else {
+			let info = JSON.parse(userInfo)
+			if (info.user_zz !== '司机') {
+				uni.redirectTo({
+					url: '/pages/404/404?message=暂无权限'
+				})
+			} else {
+				getBusList()
+				getData()
+			}
+		}
+	} else {
+		uni.redirectTo({
+			url: '/pages/404/404?message=请在微信客户端打开链接'
+		})
+	}
+})
+
+onPullDownRefresh(() => {
+	getBusList()
+	getData()
+	setTimeout(function() {
+		uni.stopPullDownRefresh()
+	}, 500)
+})
+
+// 预约状态  全部:0  预约进行中:1  已截止:2  已分配:3   候补中:4
+const result_state = ref(0)
+
+// 预约状态数组
+const typeList = ref([
+	{
+		text: '全部',
+		value: 0
+	},
+	{
+		text: '预约进行中',
+		value: 1
+	},
+	{
+		text: '已截止',
+		value: 2
+	},
+	{
+		text: '已分配',
+		value: 3
+	},
+	{
+		text: '候补中',
+		value: 4
+	}
+])
+
+// 当前选择车牌号 默认为全部
+const busNumber = ref('全部')
+
+// 车牌列表数据
+const busList = ref([
+	{
+		text: '全部',
+		value: 0
+	}
+])
+
+// 预约记录数据
+const listData = ref([])
+
+// 获取预约记录数据
+const getData = async () => {
+	const res = await myRequest({
+		url: '/appcarCaptainManage.action',
+		data: {
+			result_state: result_state.value,
+			car_number: busNumber.value
+		}
+	})
+	// console.log(res.data)
+	if (res.data.length) {
+		res.data.forEach(item => {
+			item.percent = Math.ceil((parseInt(item.user_num) / parseInt(item.contain)) * 100)
+		})
+	}
+	listData.value = res.data
+}
+
+// 获取车牌号数组请求
+const getBusList = async () => {
+	const res = await myRequest({
+		url: '/appqueryCarInfos.action'
+	})
+	// console.log(res)
+	if (res.data.length) {
+		let temList = [
+			{
+				text: '全部',
+				value: 0
+			}
+		]
+		res.data.forEach((item, index) => {
+			temList.push({
+				text: item.car_number,
+				value: index + 1
+			})
+		})
+		busList.value = temList
+	}
+}
+
+// 点击每一条记录回调
+const handleLookDetail = item => {
+	const info = JSON.stringify(item)
+	uni.navigateTo({
+		url: `/pages/detailDriver/detailDriver?info=${info}`
+	})
+}
+
+// 条件筛选框选择回调
+const getConveyData = Obj => {
+	// console.log(Obj)
+	result_state.value = Obj.typeIndex
+	busNumber.value = busList.value[Obj.timeIndex].text
+	getData()
+}
+</script>
+
+<style lang="scss" scoped>
+.container {
+	background-color: #f2f2f2;
+
+	.list {
+		margin-bottom: 20rpx;
+		padding-bottom: 24rpx;
+		background-color: #fff;
+
+		.list-title {
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			padding: 0 30rpx;
+			margin-bottom: 20rpx;
+			height: 94rpx;
+			font-size: 32rpx;
+			font-weight: bold;
+			border-bottom: 1rpx solid #e6e6e6;
+
+			.title-icon {
+				margin-top: -20rpx;
+				width: 15rpx;
+				height: 25rpx;
+
+				img {
+					width: 100%;
+					height: 100%;
+				}
+			}
+		}
+
+		.list-item {
+			display: flex;
+			align-items: center;
+			padding: 0 30rpx;
+			margin-bottom: 14rpx;
+
+			color: #999999;
+			font-size: 28rpx;
+
+			span {
+				color: #333333;
+			}
+
+			.list-item-type {
+				color: #3d51e8;
+			}
+
+			.list-item-progress {
+				margin-right: 36rpx;
+				width: 437rpx;
+				height: 22rpx;
+
+				:deep(.uni-progress-bar),
+				:deep(.uni-progress-inner-bar) {
+					border-radius: 85rpx;
+				}
+			}
+		}
+	}
+
+	.list-nodata {
+		margin-top: -20rpx;
+		padding-top: 100rpx;
+		background-color: #fff;
+		text-align: center;
+		color: #999999;
+
+		img {
+			width: 600rpx;
+		}
+	}
+}
+</style>

BIN
static/pass2.png


+ 0 - 1
unpackage/dist/build/h5/assets/_plugin-vue_export-helper.1b428a4d.js

@@ -1 +0,0 @@
-const o=(o,t)=>{const c=o.__vccOpts||o;for(const[s,n]of t)c[s]=n;return c};export{o as _};

+ 1 - 0
unpackage/dist/build/h5/assets/_plugin-vue_export-helper.517f0c1c.js

@@ -0,0 +1 @@
+const s="/testingServer/dist5/assets/no-bus-49df1801.png",t=(s,t)=>{const n=s.__vccOpts||s;for(const[o,e]of t)n[o]=e;return n};export{t as _,s as a};

+ 1 - 0
unpackage/dist/build/h5/assets/api.e5d33ef6.js

@@ -0,0 +1 @@
+import{U as a,E as e,V as s,Z as t,y as d,p as o}from"./index-cc1fec8e.js";const n=n=>(a({title:"加载中",mask:!0}),new Promise(((a,i)=>{e({url:"/testingServer/carbook"+n.url,method:n.method||"GET",data:n.data||{},success:e=>{s(),200===e.data.code?a(e.data.data):"未查到用户信息"==e.data.message?(t("bus_card_number"),d({url:"/pages/index/index"})):o({title:e.data.message,icon:"none"})},fail:a=>{s(),o({title:"请求数据失败",icon:"none"}),i(a)}})})));export{n as m};

File diff suppressed because it is too large
+ 1 - 0
unpackage/dist/build/h5/assets/detail-75c0735f.css


File diff suppressed because it is too large
+ 0 - 1
unpackage/dist/build/h5/assets/detail-ca65d544.css


File diff suppressed because it is too large
+ 1 - 0
unpackage/dist/build/h5/assets/detailDriver-c96d0a15.css


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/build/h5/assets/home-894c6d59.css


File diff suppressed because it is too large
+ 2 - 2
unpackage/dist/build/h5/assets/index-4fa572a1.js


+ 1 - 0
unpackage/dist/build/h5/assets/isWeixin.7d8069c5.js

@@ -0,0 +1 @@
+const e=()=>!!(-1!=navigator.userAgent.toLowerCase().indexOf("micromessenger"));export{e as i};

File diff suppressed because it is too large
+ 0 - 1
unpackage/dist/build/h5/assets/isWeixin.e741caea.js


File diff suppressed because it is too large
+ 1 - 0
unpackage/dist/build/h5/assets/my-749ea1e9.css


File diff suppressed because it is too large
+ 0 - 1
unpackage/dist/build/h5/assets/my-cf0f3bfb.css


+ 0 - 1
unpackage/dist/build/h5/assets/no-bus.fca891d8.js

@@ -1 +0,0 @@
-const s="/carstop/dist5/assets/no-bus-49df1801.png";export{s as _};

File diff suppressed because it is too large
+ 1 - 0
unpackage/dist/build/h5/assets/pages-404-404.335ab7b7.js


File diff suppressed because it is too large
+ 0 - 1
unpackage/dist/build/h5/assets/pages-404-404.4a6ae27b.js


File diff suppressed because it is too large
+ 0 - 1
unpackage/dist/build/h5/assets/pages-detail-detail.32ef1271.js


File diff suppressed because it is too large
+ 1 - 0
unpackage/dist/build/h5/assets/pages-detail-detail.d1521fa6.js


File diff suppressed because it is too large
+ 1 - 0
unpackage/dist/build/h5/assets/pages-detailDriver-detailDriver.1f7da63d.js


File diff suppressed because it is too large
+ 1 - 0
unpackage/dist/build/h5/assets/pages-home-home.c6860968.js


File diff suppressed because it is too large
+ 0 - 1
unpackage/dist/build/h5/assets/pages-home-home.d0c4a1d2.js


File diff suppressed because it is too large
+ 1 - 0
unpackage/dist/build/h5/assets/pages-index-index.89d27924.js


File diff suppressed because it is too large
+ 0 - 1
unpackage/dist/build/h5/assets/pages-index-index.cd725f37.js


File diff suppressed because it is too large
+ 1 - 0
unpackage/dist/build/h5/assets/pages-my-my.31ad77eb.js


File diff suppressed because it is too large
+ 0 - 1
unpackage/dist/build/h5/assets/pages-my-my.eabf7c60.js


File diff suppressed because it is too large
+ 0 - 1
unpackage/dist/build/h5/assets/pages-record-record.33ab8cdd.js


File diff suppressed because it is too large
+ 1 - 0
unpackage/dist/build/h5/assets/pages-record-record.796ee0dc.js


File diff suppressed because it is too large
+ 1 - 0
unpackage/dist/build/h5/assets/pages-recordDriver-recordDriver.6b91147d.js


File diff suppressed because it is too large
+ 1 - 0
unpackage/dist/build/h5/assets/pass2.405256ad.js


File diff suppressed because it is too large
+ 0 - 1
unpackage/dist/build/h5/assets/record-7096c017.css


File diff suppressed because it is too large
+ 1 - 0
unpackage/dist/build/h5/assets/record-9e309213.css


File diff suppressed because it is too large
+ 1 - 0
unpackage/dist/build/h5/assets/recordDriver-306b30fd.css


File diff suppressed because it is too large
+ 1 - 0
unpackage/dist/build/h5/assets/right.5b5369cb.js


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/build/h5/assets/search-1f99e3e7.css


File diff suppressed because it is too large
+ 1 - 0
unpackage/dist/build/h5/assets/search.1b0309d2.js


File diff suppressed because it is too large
+ 0 - 1
unpackage/dist/build/h5/assets/search.f46795dd.js


+ 1 - 1
unpackage/dist/build/h5/assets/uni-app.es.772a0883.js

@@ -1 +1 @@
-import{a6 as a,a7 as s,a8 as o,a9 as r,aa as n,ab as t,ac as c,ad as e}from"./index-4fa572a1.js";function i(a,s){return c(a)?s:a}const b=o=>(r,n=s())=>{!e&&a(o,r,n)},d=b(o),f=b(r),m=b(n),p=b(t);export{d as a,p as b,m as c,f as o,i as r};
+import{a6 as a,a7 as s,a8 as o,a9 as r,aa as n,ab as t,ac as c,ad as e}from"./index-cc1fec8e.js";function i(a,s){return c(a)?s:a}const b=o=>(r,n=s())=>{!e&&a(o,r,n)},d=b(o),f=b(r),m=b(n),p=b(t);export{d as a,p as b,m as c,f as o,i as r};

+ 3 - 3
unpackage/dist/build/h5/index.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html lang="en">
   <head>
-    <link rel="stylesheet" href="/carstop/dist5/assets/uni.956a6ead.css">
+    <link rel="stylesheet" href="/testingServer/dist5/assets/uni.956a6ead.css">
 
     <meta charset="UTF-8" />
     <script>
@@ -14,8 +14,8 @@
     <title>校车预约</title>
     <!--preload-links-->
     <!--app-context-->
-    <script type="module" crossorigin src="/carstop/dist5/assets/index-4fa572a1.js"></script>
-    <link rel="stylesheet" href="/carstop/dist5/assets/index-88c6c4d6.css">
+    <script type="module" crossorigin src="/testingServer/dist5/assets/index-cc1fec8e.js"></script>
+    <link rel="stylesheet" href="/testingServer/dist5/assets/index-88c6c4d6.css">
   </head>
   <body>
     <div id="app"><!--app-html--></div>

BIN
unpackage/dist/build/h5/static/pass2.png


+ 1 - 0
util/api.js

@@ -1,4 +1,5 @@
 const BASE_URL = "/carstop/carbook"
+// const BASE_URL = "/testingServer/carbook"
 export const myRequest = (options) => {
 	uni.showLoading({
 		title: "加载中",