zhengkaixin 3 hónapja
szülő
commit
9d1146944b

+ 2 - 1
App.vue

@@ -7,7 +7,8 @@
 	//import * as API from '@/apis/weixin.js'
 	
 	import './config/.env.js'
-	export default {
+	export default {
+	
 		onLaunch: function() {
 			console.log('App Launch')
 			

+ 14 - 1
apis/pagejs/index.js

@@ -9,8 +9,21 @@ export function parkingList(data) {
  	})
 }
 
+export function recordDetails(data) {
+ 	return requestWhite({
+ 		method: 'post',
+ 		data: data,
+ 		url: '/mobile/parkingRecord/recordDetails'
+ 	})
+}
 
-
+export function recordList(data) {
+ 	return requestWhite({
+ 		method: 'post',
+ 		data: data,
+ 		url: '/mobile/parkingRecord/recordList'
+ 	})
+}
 
 export function setPreferred(data) {
  	return requestWhite({

+ 15 - 0
main.js

@@ -35,6 +35,21 @@ Vue.mixin({
 			//let vConsole = new Vconsole()
 		}
 
+	},
+	onShareTimeline(){
+		return {
+			title: '智泊e家',
+			path: '/pages/index/index' ,
+		}
+	},
+	onShareAppMessage(res) {
+		if (res.from === 'button') { // 来自页面内分享按钮
+			//.log(res.target)
+		}
+		return {
+			title: '智泊e家',
+			path: '/pages/index/index' 
+		}
 	},
 	methods: {
 		distanceN(distance){

+ 8 - 1
pages.json

@@ -65,7 +65,14 @@
 					"path" : "parkingRecord",
 					"style" : 
 					{
-						"navigationBarTitleText" : ""
+						"navigationBarTitleText" : "停车记录"
+					}
+				},
+				{
+					"path" : "parkingInfo",
+					"style" : 
+					{
+						"navigationBarTitleText" : "停车记录"
 					}
 				}
 			]

+ 20 - 6
pages/index/main/lockInfo.vue

@@ -1,5 +1,7 @@
 <template>
-	<view>
+	<view>
+		<componentLogin ref="refLogin"  :check="1"
+		@findByOpenId="findByOpenId"></componentLogin>
 		<u-popup v-model="showMessage" mode="bottom" border-radius="30">
 			<view class="showMessage">
 				<view class="title">降锁成功</view>
@@ -137,8 +139,12 @@
 
 <script>
 	import * as API from '@/apis/pagejs/index.js'
+	import componentLogin from '@/components/componentLogin.vue';
 
-	export default {
+	export default {
+		components: {
+			componentLogin,
+		},
 		data() {
 			return {
 				id: "",
@@ -159,7 +165,7 @@
 				uni.setNavigationBarTitle({
 					title: "加载中..."
 				})
-				this.getFloorlockDetails()
+				// this.$refs.refLogin.findByOpenId()
 			} else {
 				this.loading = true
 				uni.setNavigationBarTitle({
@@ -199,9 +205,8 @@
 			}
 		},
 		onReady() {
-			this.setIntervalId = setInterval(() => {
-				this.getFloorlockDetails(1)
-			}, 1000 * 5)
+			this.$refs.refLogin.findByOpenId()
+			
 		},
 		onUnload() {
 			//setInterval
@@ -211,6 +216,15 @@
 
 		},
 		methods: {
+			findByOpenId(res) {
+				
+				this.setIntervalId = setInterval(() => {
+					this.getFloorlockDetails(1)
+				}, 1000 * 5)
+				
+				this.getFloorlockDetails()
+				
+			},
 			confirmPhone() {
 				this.openModalBl = false;
 				uni.makePhoneCall({

+ 20 - 6
pages/index/main/parkingDetails.vue

@@ -1,5 +1,7 @@
 <template>
-	<view class="jpmain ">
+	<view class="jpmain ">
+		<componentLogin ref="refLogin"  :check="1"
+		@findByOpenId="findByOpenId"></componentLogin>
 		<view class="title">
 			<view class="name">
 				<view class="stationName">
@@ -128,8 +130,12 @@
 
 <script>
 	import * as API from '@/apis/pagejs/index.js'
+	import componentLogin from '@/components/componentLogin.vue';
 	
-	export default {
+	export default {
+		components: {
+			componentLogin,
+		},
 		data() {
 			return {
 				id:"",
@@ -152,10 +158,12 @@
 				console.log(op)
 			}
 			
-			this.getParkingDetails()
+			
+			
 			
 			
 		},
+		
 		onShareTimeline(){
 			return {
 				title: '智泊e家-'+this.parkingInfo.name,
@@ -172,9 +180,8 @@
 			}
 		},
 		onReady() {
-			this.setIntervalId=setInterval(()=>{
-				this.getParkingFloorlockList(1)
-			},1000*5)
+			this.$refs.refLogin.findByOpenId()
+			
 		},
 		onUnload() {
 			//setInterval
@@ -195,6 +202,13 @@
 			}
 		},
 		methods: {
+			findByOpenId(res) {
+				this.getParkingDetails()
+				
+				this.setIntervalId=setInterval(()=>{
+					this.getParkingFloorlockList(1)
+				},1000*5)
+			},
 			clickStar(){
 				//this.isStar=!this.isStar
 				this.setPreferred()

+ 21 - 0
pages/information/parkingInfo.vue

@@ -0,0 +1,21 @@
+<template>
+	<view>
+		
+	</view>
+</template>
+
+<script>
+	import * as API from '@/apis/pagejs/index.js'
+	
+	export default {
+		data() {
+			return {
+				
+			};
+		}
+	}
+</script>
+
+<style lang="scss">
+
+</style>

+ 95 - 18
pages/information/parkingRecord.vue

@@ -1,19 +1,96 @@
-<template>
-	<view>
-		
-	</view>
-</template>
-
+<template>
+	<view class="jpmain  ">
+		<view class="top">
+
+		</view>
+		<view class="body">
+			<view class="item" v-for="(item,i) in list" @click="gotoUrl('/pages/information/parkingInfo?id='+item.id)"
+				:key="i">
+				<view class="data">
+					<view class="view1">
+
+					</view>
+					<view class="view2">
+
+					</view>
+					<view class="view3">
+
+					</view>
+				</view>
+				<view class="goto">
+					使用中
+
+					<u-icon name="arrow-right" size="24" color="#BBBBBB"></u-icon>
+
+				</view>
+			</view>
+		</view>
+
+	</view>
+</template>
+
 <script>
-	export default {
-		data() {
-			return {
-				
-			};
-		}
-	}
-</script>
-
-<style lang="scss">
-
-</style>
+	import * as API from '@/apis/pagejs/index.js'
+	
+	export default {
+		data() {
+			return {
+				list: [],
+				listForm: {
+					name: "",
+					pageIndex: 1,
+					pageSize: 20,
+					recordsTotal: 1,
+				}
+			};
+		},
+		onLoad() {
+			this.getList()
+		},
+		onReachBottom() {
+			if (this.list.length < this.listForm.recordsTotal) {
+				this.myLoadmore();
+			}
+		},
+		methods: {
+			myLoadmore() {
+				this.listForm.pageIndex += 1;
+				this.getList()
+			},
+
+			getList() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+
+				API.recordList(this.listForm).then((res) => {
+					var list = []
+
+					if (this.listForm.pageIndex == 1) {
+						list = res.data.data;
+					} else {
+						list = [
+							...list,
+							...res.data.data
+						];
+					}
+					this.list = res.data.data
+					uni.hideLoading();
+
+				}).catch(error => {
+
+					uni.hideLoading();
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+
+</style>