xiaoxin il y a 1 an
Parent
commit
3c6c642479
4 fichiers modifiés avec 95 ajouts et 6 suppressions
  1. 84 0
      components/search2.vue
  2. 3 3
      pages/record/record.vue
  3. 3 3
      pages/recordDriver/recordDriver.vue
  4. 5 0
      util/api.js

+ 84 - 0
components/search2.vue

@@ -0,0 +1,84 @@
+<template>
+	<view class="search">
+		<uni-data-picker v-slot:default v-model="typeValue" :localdata="typeList" popup-title="请选择预约状态" @nodeclick="onnodeclick">
+			<view class="search-type">
+				{{ typeList[typeValue].text }}
+				<view class="search-type-img"><img src="../static/bottom.png" /></view>
+			</view>
+		</uni-data-picker>
+
+		<uni-data-picker v-slot:default v-model="timeValue" :localdata="timeList" popup-title="请选择预约时间" @nodeclick="onnodeclick">
+			<view class="search-time">
+				{{ timeList[timeValue].text }}
+				<view class="search-time-img"><img src="../static/bottom.png" /></view>
+			</view>
+		</uni-data-picker>
+	</view>
+</template>
+
+<script setup>
+import { ref } from 'vue'
+
+const props = defineProps({
+	typeList: Array,
+	timeList: Array
+})
+
+const typeValue = ref(0)
+const timeValue = ref(0)
+
+const conveyData = defineEmits(['handLeConveyData'])
+
+const onnodeclick = () => {
+	conveyData('handLeConveyData', {
+		typeIndex: typeValue.value,
+		timeIndex: timeValue.value
+	})
+}
+</script>
+
+<style lang="scss" scoped>
+.search {
+	display: flex;
+	justify-content: space-around;
+	align-items: center;
+	margin-bottom: 20rpx;
+	height: 100rpx;
+	font-size: 28rpx;
+	background-color: #fff;
+
+	.search-type {
+		flex: 1;
+		display: flex;
+		justify-content: space-evenly;
+
+		.search-type-img {
+			margin-top: -5rpx;
+			width: 17rpx;
+			height: 12rpx;
+
+			img {
+				width: 100%;
+				height: 100%;
+			}
+		}
+	}
+
+	.search-time {
+		flex: 1;
+		display: flex;
+		justify-content: space-evenly;
+
+		.search-time-img {
+			margin-top: -5rpx;
+			width: 17rpx;
+			height: 12rpx;
+
+			img {
+				width: 100%;
+				height: 100%;
+			}
+		}
+	}
+}
+</style>

+ 3 - 3
pages/record/record.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="container">
 		<!-- 筛选区域 -->
-		<Search :typeList="typeList" :timeList="timeList" @handLeConveyData="getConveyData" />
+		<Search2 :typeList="typeList" :timeList="timeList" @handLeConveyData="getConveyData" />
 
 		<!-- 列表区域 -->
 		<view class="list" v-for="(item, index) in listData" :key="index" @click="handleLookDetail(item)">
@@ -61,7 +61,7 @@ import { isWeixin } from '@/util/isWeixin.js'
 
 import { filterIdentity } from '@/util/filterIdentity.js'
 
-import Search from '@/components/search'
+import Search2 from '@/components/search2'
 
 onLoad(() => {
 	if (isWeixin()) {
@@ -246,4 +246,4 @@ const getConveyData = (Obj) => {
 		}
 	}
 }
-</style>
+</style>

+ 3 - 3
pages/recordDriver/recordDriver.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="container">
 		<!-- 筛选区域 -->
-		<Search :typeList="typeList" :timeList="busList" @handLeConveyData="getConveyData" />
+		<Search2 :typeList="typeList" :timeList="busList" @handLeConveyData="getConveyData" />
 
 		<!-- 列表区域 -->
 		<view class="list" v-for="(item, index) in listData" :key="index" @click="handleLookDetail(item)">
@@ -61,7 +61,7 @@ import { isWeixin } from '@/util/isWeixin.js'
 
 import { filterIdentity } from '@/util/filterIdentity.js'
 
-import Search from '@/components/search'
+import Search2 from '@/components/search2'
 
 onLoad(() => {
 	if (isWeixin()) {
@@ -266,4 +266,4 @@ const getConveyData = (Obj) => {
 		}
 	}
 }
-</style>
+</style>

+ 5 - 0
util/api.js

@@ -6,6 +6,11 @@ export const myRequest = (options) => {
 		title: "加载中",
 		mask: true,
 	});
+	// 当前时间
+	let timestamp = new Date().getTime();
+	// 将时间戳添加到URL中
+	options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + 'timestamp=' + timestamp;
+
 	return new Promise((resolve, reject) => {
 		uni.request({
 			url: BASE_URL + options.url,