gcz 4 年 前
コミット
92c5a84d2f

+ 1 - 1
common/config.js

@@ -3,7 +3,7 @@ const config = {
 	// baseUrl:'http://wx.hw.hongweisoft.com/parking/client',//64
 	baseUrl:'http://wx.hw.hongweisoft.com/parking/client',//殷登顺
 	// 正式接口访问地址
-	// baseUrl:'http://pdzhtc.com/parking/client',
+	// baseUrl:'http://parking.pdzhtc.com/client',
 	
 	
 	//登录链接

+ 36 - 0
pages/searchparking/searchparking.scss

@@ -0,0 +1,36 @@
+page{
+	background-color: #F6F6FF;
+}
+.parkinglist{
+	margin: 56rpx 40rpx;
+	.parkinglist-item{
+		background-color: #fff;
+		border-radius: 15rpx;
+		margin-bottom: 20rpx;
+		padding: 26rpx 40rpx 46rpx;
+		.up{
+			padding-bottom: 29rpx;
+			margin-bottom: 29rpx;
+			border-bottom: 1px solid #CECECE;
+			.vehicle-no{
+				font-size: 32rpx;
+				font-weight: 600;
+				color: #3A3A3A;
+				line-height: 45rpx;
+			}
+			.space-name{
+				font-size: 30rpx;
+				font-weight: 500;
+				color: #444444;
+				line-height: 42rpx;
+			}
+		}
+		.road-name{
+			font-size: 24rpx;
+			font-weight: 400;
+			color: #787878;
+			line-height: 33rpx;
+			margin-left: 5rpx;
+		}
+	}
+}

+ 97 - 0
pages/searchparking/searchparking.vue

@@ -0,0 +1,97 @@
+<template>
+	<view>
+		<u-navbar
+		 title="我的停车" 
+		 title-color="#fff" 
+		 :custom-back="customBack" 
+		 :border-bottom="false" 
+		 back-icon-color="#CCE8FF" 
+		 :background="{background: 'linear-gradient(145deg, #41AFF9 0%, #2D8CFB 100%)' }">
+		</u-navbar>
+		<mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" >
+		<view class="parkinglist">
+			<view class="parkinglist-item" v-for="(item,index) in parkinglist" :key="item.id">
+				<view class="up u-flex u-row-between">
+					<view class="vehicle-no">{{item.vehicleNo}}</view>
+					<view class="space-name">{{item.spaceName}}</view>
+				</view>
+				<view class="down u-flex u-row-left">
+					<u-icon name="map-fill" color="#008CFF" size="28"></u-icon>
+					<view class="road-name">{{item.roadName}}</view>
+				</view>
+			</view>
+		</view>
+		</mescroll-body>
+		<u-toast ref="uToast" />
+	</view>
+</template>
+
+<script>
+	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
+	export default{
+		mixins: [MescrollMixin], // 使用mixin
+		data(){
+			return{
+				parkinglist:[],
+			}
+		},
+		onLoad(){
+			
+		},
+		onShow(){
+			
+		},
+		methods:{
+			customBack(){
+				this.$u.route({
+					type:'switchTab',
+					url: 'pages/index/index'
+				});
+			},
+			downCallback(){
+				this.mescroll.resetUpScroll();
+			},
+			upCallback(page){
+				console.log('upCallback ',page);
+				let pageNum = page.num; // 页码, 默认从1开始
+				let pageSize = page.size; // 页长, 默认每页10条
+				this.$u.api.getOrderList({orderStatus:1,pageNum:pageNum,pageSize:pageSize})
+				.then(res=>{
+					// uni.hideLoading();
+					// this.$refs.uToast.show({
+					// 	title: res.msg,
+					// 	type: 'success',
+					// });
+					//设置列表数据
+					let curPageData = res.data.rows; 
+					// 接口返回的当前页数据长度 (如列表有26个数据,当前页返回8个,则curPageLen=8)
+					let curPageLen = curPageData.length; 
+					let totalPage = res.data.pages; 
+					
+					if(page.num == 1) this.parkinglist = []; //如果是第一页需手动置空列表
+					this.parkinglist = this.parkinglist.concat(curPageData); //追加新数据
+					
+					// 请求成功,隐藏加载状态
+					//后台接口有返回列表的总页数 totalPage
+					this.mescroll.endByPage(curPageLen, totalPage);
+
+					if(this.parkinglist.length<=0){this.listEmpty = true};
+				
+					console.log('vehicleList',res)
+				}).catch(err=>{
+					// uni.hideLoading();
+					this.$refs.uToast.show({
+						title: err.msg,
+						type: 'error',
+					});
+					console.log('vehicleList ',err)
+				});
+				
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	@import  './searchparking.scss'
+</style>