소스 검색

no message

xiaoxin 3 년 전
부모
커밋
a9ba06e4fd
8개의 변경된 파일232개의 추가작업 그리고 187개의 파일을 삭제
  1. 8 1
      components/search.vue
  2. 59 59
      manifest.json
  3. 15 15
      pages/detail/detail.vue
  4. 59 87
      pages/home/home.vue
  5. 62 13
      pages/index/index.vue
  6. 24 11
      pages/my/my.vue
  7. 5 1
      pages/record/record.vue
  8. BIN
      static/no-bus.png

+ 8 - 1
components/search.vue

@@ -27,15 +27,22 @@
 
 	const typeList = ref(['全部', '预约成功', '已通行', '已取消', '候补中'])
 	const typeIndex = ref(0)
-	const timeList = ref(['当月', '当日'])
+	const timeList = ref(['全部', '当天', '本周', '本月'])
 	const timeIndex = ref(0)
 
+	const conveyData = defineEmits(["handLeConveyData"])
+
 	const bindPickerChange = (e, type) => {
 		if (type === 1) {
 			typeIndex.value = e.detail.value
 		} else {
 			timeIndex.value = e.detail.value
 		}
+
+		conveyData("handLeConveyData", {
+			typeIndex: typeIndex.value,
+			timeIndex: timeIndex.value,
+		})
 	}
 </script>
 

+ 59 - 59
manifest.json

@@ -1,60 +1,60 @@
 {
-    "name" : "schoolBus-reservation",
-    "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"
-}
+	"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"
+}

+ 15 - 15
pages/detail/detail.vue

@@ -23,14 +23,15 @@
 				人数
 			</view>
 
-			<picker style="width: 40%;" @change="bindPickerChange($event,1)" :value="busIndex" :range="busList">
-				<view class="right">
-					{{busList[busIndex]}}
+			<!-- <picker style="width: 40%;" @change="bindPickerChange($event,1)" :value="busIndex" :range="busList"> -->
+			<view class="right">
+				<!-- {{busList[busIndex]}}
 					<div class="right-img">
 						<img src="../../static/bottom.png">
-					</div>
-				</view>
-			</picker>
+					</div> -->
+				55
+			</view>
+			<!-- </picker> -->
 		</view>
 
 		<!-- 时间区域 -->
@@ -72,15 +73,15 @@
 				状态
 			</view>
 
-			<picker style="width: 40%;" @change="bindPickerChange($event,1)" :value="busIndex" :range="busList">
-				<view class="right">
-					<!-- {{busList[busIndex]}} -->
-					预约进行中
-					<!-- <div class="right-img">
+			<!-- <picker style="width: 40%;" @change="bindPickerChange($event,1)" :value="busIndex" :range="busList"> -->
+			<view class="right">
+				<!-- {{busList[busIndex]}} -->
+				预约进行中
+				<!-- <div class="right-img">
 						<img src="../../static/bottom.png">
 					</div> -->
-				</view>
-			</picker>
+			</view>
+			<!-- </picker> -->
 		</view>
 
 		<!-- 人员名单区域 -->
@@ -142,8 +143,7 @@
 	}
 
 
-	const listData = ref([
-		{
+	const listData = ref([{
 			name: '张三',
 			url: '../../static/man.png',
 			// 1代表男生,2代表女生

+ 59 - 87
pages/home/home.vue

@@ -19,12 +19,19 @@
 			<view class="bus-title">
 				选择预约车辆 <span>/ 墨轩湖 - 综合楼</span>
 			</view>
-			<view class="bus-list">
+			<view class="bus-list" v-if="busList.length">
 				<view :class="currentIndex2 === index?'active':'bus-list-item'" v-for="(item,index) in busList"
 					:key="index" @click="handleChangeCurrentIndex(index,2,item)">
 					{{item}}
 				</view>
-
+			</view>
+			<view class="bus-list-nodata" v-else>
+				<view class="nodata-img">
+					<img src="../../static/no-bus.png" alt="">
+					<view class="nodata-info">
+						请先选择发车时间
+					</view>
+				</view>
 			</view>
 		</view>
 
@@ -67,71 +74,9 @@
 		onLoad
 	} from "@dcloudio/uni-app"
 
-	const wxCode = ref('')
-	const access_token = ref('')
-
 	onLoad(() => {
-		const busUserInfo = uni.getStorageSync('busUserInfo');
-		if (!busUserInfo) {
-			wxCode.value = getQueryString('wxcode')
-			get_access_token(wxCode.value)
-		}
-	})
-
-	// 通过wxcode换取access_token
-	const get_access_token = (wxCode) => {
-		uni.request({
-			url: 'open.wecard.qq.com/connect/oauth2/token',
-			method: 'POST',
-			// header: {
-			// 	'content-type': 'application/json'
-			// },
-			data: {
-				"wxcode": wxCode,
-				"app_key": "4AA7B3944BDF3739",
-				"app_secret": "69E762653EF393C0122278F21754B6CF",
-				"grant_type": "authorization_code",
-				"redirect_uri": "http://192.168.161.125:5173/#/pages/home/home"
-			},
-			success: (res) => {
-				alert(JSON.stringify(res))
-				// access_token.value = res.data.access_token
-				// alert(access_token.value)
-				// getUserInfo(access_token.value)
-			}
-		});
-	}
-
-	// 通过access_token换取用户信息
-	const getUserInfo = (access_token) => {
-		uni.request({
-			url: 'open.wecard.qq.com/connect/oauth/get-user-info',
-			method: "POST",
-			data: {
-				"access_token": access_token
-			},
-			header: {
-				'content-type': 'application/json'
-			},
-			success: (res) => {
-				alert(JSON.stringify(res))
-			}
-		});
-	}
 
-	//获取当前URL指定参数
-	const getQueryString = (name) => {
-		// 获取URL
-		let url = window.location.href;
-		// 正则匹配URL
-		let pattern = new RegExp("[?&]" + name + "=([^&]+)", "i");
-		let matcher = pattern.exec(url);
-		if (matcher == null || matcher.length < 1) {
-			return false;
-		}
-		// 输出指定的参数值
-		return decodeURIComponent(matcher[1]);
-	}
+	})
 
 	const currentIndex1 = ref(null)
 	const currentIndex2 = ref(null)
@@ -145,6 +90,7 @@
 
 	// 发车车辆列表
 	const busList = ref(['车牌尾号:6601(63/63)', '车牌尾号:6661(63/63)', '车牌尾号:6001(63/63)'])
+	// const busList = ref([])
 
 	// 改变选中项回调
 	const handleChangeCurrentIndex = (index, type, value) => {
@@ -253,34 +199,60 @@
 			.bus-list {
 				display: flex;
 				flex-direction: column;
-			}
 
-			.bus-list-item {
-				display: flex;
-				justify-content: center;
-				align-items: center;
-				margin-bottom: 30rpx;
-				height: 100rpx;
-				font-size: 26rpx;
-				border: 1rpx solid #CCCCCC;
-				border-radius: 12rpx;
+				.bus-list-item {
+					display: flex;
+					justify-content: center;
+					align-items: center;
+					margin-bottom: 30rpx;
+					height: 100rpx;
+					font-size: 26rpx;
+					border: 1rpx solid #CCCCCC;
+					border-radius: 12rpx;
+				}
+
+				.active {
+					display: flex;
+					justify-content: center;
+					align-items: center;
+					margin-bottom: 30rpx;
+					height: 100rpx;
+					font-size: 26rpx;
+					border: 1rpx solid #CCCCCC;
+					border-radius: 12rpx;
+					color: #fff;
+					background-image: linear-gradient(#8684FF, #3D50E7);
+				}
+
+				.disable {
+					background: #E6E6E6;
+				}
 			}
 
-			.active {
+			.bus-list-nodata {
 				display: flex;
-				justify-content: center;
+				flex-direction: column;
 				align-items: center;
-				margin-bottom: 30rpx;
-				height: 100rpx;
-				font-size: 26rpx;
-				border: 1rpx solid #CCCCCC;
-				border-radius: 12rpx;
-				color: #fff;
-				background-image: linear-gradient(#8684FF, #3D50E7);
-			}
+				color: #B3B3B3;
 
-			.disable {
-				background: #E6E6E6;
+				.nodata-img {
+					position: relative;
+					width: 500rpx;
+					height: 500rpx;
+
+					img {
+						width: 100%;
+						height: 100%;
+					}
+
+					.nodata-info {
+						position: absolute;
+						left: 250rpx;
+						bottom: 50rpx;
+						transform: translateX(-50%);
+						white-space: nowrap;
+					}
+				}
 			}
 		}
 

+ 62 - 13
pages/index/index.vue

@@ -9,32 +9,81 @@
 	} from "@dcloudio/uni-app"
 
 	const APPKEY = '4AA7B3944BDF3739'
+	const APPID = 'wxd87cbe1db0437303'
 	const ocode = '1015730314'
-	const URL = 'http://192.168.161.125:5173/#/pages/home/home'
+	const SCOPE = 'snsapi_base'
+	const URL = 'https://chtech.ncjti.edu.cn/jiaofei/jiaofeiManage/'
+	const URL2 = 'http://192.168.161.78:5173/#/pages/index/index'
 
 	onLoad(() => {
-		hasUserInfo()
+		// loginFilter()
+		uni.switchTab({
+			url: "/pages/home/home"
+		})
 	})
 
-	const hasUserInfo = () => {
-		try {
-			const busUserInfo = uni.getStorageSync('busUserInfo');
-			if (!busUserInfo) {
-				window.
-				location.href =
-					`https://open.wecard.qq.com/connect/oauth/authorize?app_key=${APPKEY}&response_type=code&scope=snsapi_base&ocode=${ocode}&redirect_uri=${encodeURIComponent(URL)}`
+	const loginFilter = () => {
+		const wxcode = uni.getStorageSync('wxcode')
+		if (!wxcode) {
+			const wxcode = getQueryString('wxcode')
+			if (!wxcode) {
+				getWxcodeURL()
 			} else {
+				alert(wxcode)
+				uni.setStorageSync('wxcode', wxcode)
+				getCode()
+			}
+		} else {
+			getCode()
+		}
+	}
+
+	const getCode = () => {
+		const code = uni.getStorageSync('code');
+		if (!code) {
+			const code = getQueryString('code')
+			if (!code) {
+				alert(666)
+				getCodeURL()
+			} else {
+				alert(code)
+				uni.setStorageSync('code', code)
 				uni.switchTab({
 					url: "/pages/home/home"
 				})
 			}
-		} catch (e) {
-			uni.showToast({
-				title: '异常:' + e,
-				duration: 3000
+		} else {
+			uni.switchTab({
+				url: "/pages/home/home"
 			})
 		}
 	}
+
+	const getWxcodeURL = () => {
+		window.
+		location.href =
+			`https://open.wecard.qq.com/connect/oauth/authorize?app_key=${APPKEY}&response_type=code&scope=snsapi_base&ocode=${ocode}&redirect_uri=${encodeURIComponent(URL2)}`
+	}
+
+	const getCodeURL = () => {
+		window.
+		location.href =
+			`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${APPID}&redirect_uri=${encodeURIComponent(URL)}&response_type=code&scope=${SCOPE}#wechat_redirect`
+	}
+
+	//获取当前URL指定参数
+	const getQueryString = (name) => {
+		// 获取URL
+		let url = window.location.href;
+		// 正则匹配URL
+		let pattern = new RegExp("[?&]" + name + "=([^&]+)", "i");
+		let matcher = pattern.exec(url);
+		if (matcher == null || matcher.length < 1) {
+			return false;
+		}
+		// 输出指定的参数值
+		return decodeURIComponent(matcher[1]);
+	}
 </script>
 
 <style lang="scss" scoped>

+ 24 - 11
pages/my/my.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="container">
 		<!-- 筛选区域 -->
-		<Search />
+		<Search @handLeConveyData="getConveyData" />
 
 		<!-- 列表区域 -->
 		<view class="list" v-for="(item,index) in listData" :key="index">
@@ -12,7 +12,7 @@
 				<view v-else>
 					墨轩湖到黄家湖
 				</view>
-				<view class="list-img" :class="item.type ===1 ? 'mr-15':''">
+				<view class="list-img" :class="item.type ===1 ? 'mr-30':''">
 					<img v-if="item.type===1" src="../../static/success.png">
 					<img v-if="item.type===2" src="../../static/pass.png">
 					<img v-if="item.type===3" src="../../static/cancel.png">
@@ -32,7 +32,7 @@
 				<view class="list-info-item" v-if="item.capacity">
 					<span>容 量:</span>{{item.capacity}}
 				</view>
-				<view class="list-info-item" v-if="item.message">
+				<view class="list-info-item2" v-if="item.message">
 					<span>变更信息:</span>{{item.message}}
 				</view>
 			</view>
@@ -40,9 +40,12 @@
 				<view class="list-button-change" v-if="item.type ===1">
 					更换车次
 				</view>
-				<view class="list-button-cancel">
+				<view class="list-button-cancel" v-if="item.type ===1">
 					取消预约
 				</view>
+				<view class="list-button-cancel" v-if="item.type ===4">
+					取消候补
+				</view>
 			</view>
 		</view>
 
@@ -64,7 +67,7 @@
 			departureTime: '2023-03-31  15:15:15',
 			busNumber: '0269',
 			capacity: '53人',
-			message: '车辆0290变更为6001,容量53变更为63'
+			message: '车辆0290变更为6001,容量53变更为63车辆0290变更为6001,容量53变更为63车辆0290变更为6001,容量53变更为63'
 		},
 		{
 			type: 2,
@@ -94,10 +97,16 @@
 			// message: '车辆0290变更为6001,容量53变更为63'
 		}
 	])
+
+	const getConveyData = (Obj) => {
+		console.log(Obj);
+	}
 </script>
 
 <style lang="scss" scoped>
 	.container {
+		display: flex;
+		flex-direction: column;
 		background-color: #F2F2F2;
 
 		.list {
@@ -125,8 +134,8 @@
 					}
 				}
 
-				.mr-15 {
-					margin-right: 15rpx;
+				.mr-30 {
+					margin-right: 30rpx;
 				}
 			}
 
@@ -137,8 +146,8 @@
 				padding: 0 30rpx;
 				margin-top: 15rpx;
 
-				.list-info-item {
-					height: 60rpx;
+				.list-info-item,
+				.list-info-item2 {
 					line-height: 60rpx;
 					font-size: 28rpx;
 					color: #333333;
@@ -150,17 +159,21 @@
 						color: #999999;
 					}
 				}
+
+				.list-info-item {
+					height: 60rpx;
+				}
 			}
 
 			.list-button {
 				display: flex;
 				justify-content: flex-end;
 				align-items: center;
-				height: 114rpx;
 				font-size: 28rpx;
 				text-align: center;
 
 				.list-button-change {
+					margin: 17rpx 0 40rpx 0;
 					width: 170rpx;
 					height: 70rpx;
 					line-height: 70rpx;
@@ -170,7 +183,7 @@
 				}
 
 				.list-button-cancel {
-					margin: 0 30rpx;
+					margin: 17rpx 30rpx 40rpx;
 					width: 170rpx;
 					height: 70rpx;
 					line-height: 70rpx;

+ 5 - 1
pages/record/record.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="container">
 		<!-- 筛选区域 -->
-		<Search />
+		<Search @handLeConveyData="getConveyData" />
 
 		<!-- 列表区域 -->
 		<view class="list" v-for="(item,index) in listData" :key="index" @click="handleLookDetail(item)">
@@ -82,6 +82,10 @@
 			url: `/pages/detail/detail?info=${info}`
 		})
 	}
+
+	const getConveyData = (Obj) => {
+		console.log(Obj);
+	}
 </script>
 
 <style lang="scss" scoped>

BIN
static/no-bus.png