wkyy пре 3 година
родитељ
комит
13a3b21d0b
2 измењених фајлова са 32 додато и 32 уклоњено
  1. 5 2
      pages/index/index.vue
  2. 27 30
      pages/user/myReservation/myReservation.vue

+ 5 - 2
pages/index/index.vue

@@ -87,7 +87,7 @@
 
 		<view style="height:50px"></view>
 		<!-- 站点 -->
-		<view class="station" v-if="message == 'getLocation:ok' && chargeList.length == 0"
+		<view class="station" v-if="stationList.length != 0 && chargeList.length == 0"
 			@click="gotoUrl('pages/searchPile/stationAndPile/stationDetails?id=' + stationData.id)">
 			<view class="img-box">
 				<img src="static/img/Frame 198 (1).png" alt="">
@@ -124,7 +124,7 @@
 			</view>
 		</view>
 		<!-- 定位 -->
-		<view class="location-box" v-if="message != 'getLocation:ok' && chargeList.length == 0">
+		<view class="location-box" v-if="stationList.length == 0  && chargeList.length == 0">
 			<view class="location">
 				<view class="location-text">
 					<view class="text-1 oldTextjp" oldstyle="font-size: 20px;">
@@ -245,6 +245,7 @@
 		},
 		data() {
 			return {
+				stationList: [],
 				bannerList:[],
 				distance: 0,
 				timeOut: false,
@@ -598,6 +599,8 @@
 							var lnglat = new AMap.LngLat(this.longitude,this.latitude);
 							var myDistance = lnglat.distance([this.stationData.longitude,this.stationData.latitude]);
 							this.distance = myDistance/1000;
+							
+							this.stationList = response.data.data;
 						}).catch(error => {
 							uni.showToast({
 								title: error,

+ 27 - 30
pages/user/myReservation/myReservation.vue

@@ -14,6 +14,10 @@
 			</view>
 			<u-mask :show="screenShow" @click="screenShow = false" z-index="100"></u-mask>
 		</view>
+		<view class="carNone" v-if="appointmentList.length == 0">
+			<img src="static/img/暂无数据-缺省页.png" alt="">
+			<p>暂无预约</p>
+		</view>
 		<view class="reservation-items" v-for="(item,index) in appointmentList" :key="item.id" @click="gotoUrl('pages/user/myReservation/reservationListDetails?id='+item.id)">
 			<view class="station-name ellipsis">
 				{{item.stationName}}/{{item.deviceName}}
@@ -93,7 +97,6 @@
 
 <script>
 	import * as API from '@/apis/apointment.js'
-	import * as WxJsApi from '@/utils/wxJsApi.js'
 	
 	import {
 		hourDistanceArr,
@@ -111,11 +114,11 @@
 				statusList: [
 					{id:"",name:"全部预约单"},
 					{id:"0",name:"待确认"},
-					{id:"1",name:"已确认"},
+					{id:"1",name:"已预约"},
 					{id:"2",name:"已完成"},
 					{id:"3",name:"已取消"},
 					{id:"4",name:"已拒绝"},
-					{id:"5",name:"已过期"},
+					{id:"9",name:"已过期"},
 				],
 				statusClass: '',
 				pageIndex: 1,
@@ -127,13 +130,6 @@
 		onShow() {
 			this.getAppointmentList(true);
 		},
-		onReady() {
-			WxJsApi.getWxConfig(['getLocation', 'addEventListener', 'scanQRCode']).then((res) => {
-				// console.log(res)
-			}).catch(error => {
-				console.log(res)
-			})
-		},
 		onReachBottom() {
 			if (this.appointmentList.length < this.recordsTotal) {			
 				this.myLoadmore();
@@ -163,12 +159,18 @@
 					status: this.status
 				}).then((res) => {
 					uni.hideLoading();
-					
 					this.appointmentList = [
 						...this.appointmentList,
 						...res.data.data
 					];
 					this.recordsTotal = res.data.recordsTotal;
+					
+					var list = res.data.data;
+					for (let i = 0; i < list.length; i++) {
+						if(list[i].status == '0') {
+							
+						}
+					}
 				}).catch(error => {
 					uni.showToast({
 						title: error,
@@ -180,24 +182,6 @@
 				this.pageIndex += 1;
 				this.getAppointmentList()
 			},
-			//微信扫二维码
-			getScanCode() {
-				WxJsApi.scanQRCode(1).then(res => {
-					console.log("scanQRCode------" + res)
-					if (res) {
-						API.scanCode(res).then((response) => {
-		
-						}).catch(error => {
-							uni.showToast({
-								title: error,
-								icon: "none"
-							})
-						})
-					}
-				}).catch(error => {
-		
-				})
-			},
 			refuseClick(item) {
 				uni.showLoading({
 					title: "加载中",
@@ -221,6 +205,19 @@
 </script>
 
 <style lang="scss" scoped>
+	.carNone{
+		display: flex;
+		flex-direction: column;
+		justify-content: center;
+		align-items: center;
+		img{
+			width: 100%;
+			height: 100%;
+		}
+		p{
+			margin-top: -60px;
+		}
+	}
 	.preference {
 		background-color: #ffffff;
 		left: 0rpx;
@@ -239,7 +236,7 @@
 		padding-bottom: 20rpx;
 	}
 	.content-s{
-		height: 200px;
+		height: 240px;
 		overflow-y:scroll;
 	}
 	page {