Selaa lähdekoodia

内容调整, 显示调整,小程序大小处理,流程测试

zhengkaixin 1 kuukausi sitten
vanhempi
commit
c58a66765d

+ 29 - 42
pages.json

@@ -1,39 +1,23 @@
 {
 
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
-		
 		{
-			"path": "pages/index/main",
-			"style": {
-				"navigationBarTitleText": "快捷停车"
-				
-				
+			"path" : "pages/index/index",
+			"style" : 
+			{
+				"navigationBarTitleText" : "加载中"
 			}
-		},
-		{
-			"path": "pages/index/index",
-			"style": {
-				"navigationBarTitleText": "选择停车场"
-			}
-		},
-
-		
-
-		{
-			"path": "pages/index/center",
-			"style": {
-				"navigationBarTitleText": "个人中心"
-			}
 		}
+		 
 		
 		
 		
 
 	],
 	"preloadRule": {
-		"pages/index/center": {
+		"pages/index/index": {
 			"network": "all",
-			"packages": [ "pages/mylock", "pages/information"]
+			"packages": [ "pages/business","pages/mylock", "pages/information"]
 		}
 	},
 	"easycom": {
@@ -56,7 +40,27 @@
 		
 					}
 				}
-		
+				,
+				{
+					"path": "index",
+					"style": {
+						"navigationBarTitleText": "选择停车场"
+					}
+				},
+				
+				{
+					"path": "main",
+					"style": {
+						"navigationBarTitleText": "快捷停车"
+					}
+				},
+				
+				{
+					"path": "center",
+					"style": {
+						"navigationBarTitleText": "个人中心"
+					}
+				}
 			]
 		},
 		{
@@ -144,24 +148,7 @@
 			]
 		}
 	],
-	"tabBar": {
-		"navigationStyle": "custom",
-		"color": "#7A7E83",
-		"selectedColor": "#347CF6",
-		"borderStyle": "black",
-		"backgroundColor": "#ffffff",
-
-		"list": [{
-			"pagePath": "pages/index/index",
-
-			"text": "附近"
-		}, {
-			"pagePath": "pages/index/center",
-
-			"text": "我的"
-		}]
-	},
-
+	
 	"permission": {
 		"scope.userLocation": {
 			"desc": "获得用户当前位置"

+ 3 - 3
components/Tabbar.vue → pages/business/as-components/Tabbar.vue

@@ -24,13 +24,13 @@
 						iconPath:require("@/assets/img/tabBar/index1.png") ,
 						selectedIconPath: require( "@/assets/img/tabBar/index1-HL.png"),
 						text: '附近 ',
-						pagePath: "/pages/index/index",
+						pagePath2: "/pages/business/index",
 					},
 					 {
 					 	iconPath: require("@/assets/img/tabBar/parking_icon.png"),
 					 	selectedIconPath: require("@/assets/img/tabBar/parking_icon.png"),
 					 	text: '',
-						pagePath2: "/pages/index/main",
+						pagePath2: "/pages/business/main",
 					 	midButton: true,
 					 },
 					
@@ -40,7 +40,7 @@
 						selectedIconPath: require("@/assets/img/tabBar/center-HL.png"),
 
 						text: '我的',
-						pagePath: "/pages/index/center",
+						pagePath2: "/pages/business/center",
 					}
 				],
 			};

+ 24 - 11
components/componentLockInfo.vue → pages/business/as-components/componentLockInfo.vue

@@ -84,11 +84,11 @@
 								</view>
 								<view class="text">
 									<u-icon name="map-fill" size="24" color="#999999" ></u-icon>
-									{{floorlockInfo.describe}}
+									{{floorlockInfo.locationAddress}}
 								</view>
 							</view>
 							
-							<view class="value2">
+							<view class="value2" v-if="floorlockInfo.longitude&&floorlockInfo.latitude" @click="openLocation" >
 								<view class="item1">
 									<img class="img" src="@/assets/img/parkingDetails/item8.png" alt="">
 									
@@ -182,17 +182,17 @@
 					</view>
 					<view class="page  pagemanage" v-if="isMy">
 						<view class="page-main">
-							<view class="mitem" @click="gotoUrl('/pages/mylock/bindLock')">
+							<view class="mitem" @click="gotoUrl('pages/mylock/bindLock')">
 								<img class="img" src="@/assets/img/quick/item2.svg" alt="">
 								
 								绑定地锁
 							</view>
-							<view class="mitem"  @click="gotoUrl('/pages/mylock/infoLock?add=1&id='+id)" >
+							<view class="mitem"  @click="gotoUrl('pages/mylock/infoLock?add=1&id='+floorlockInfo.id)" >
 								<img class="img" src="@/assets/img/quick/item1.svg" alt="">
 								
 								白名单
 							</view>
-							<view class="mitem end"  @click="gotoUrl('/pages/mylock/bindLock?id='+id)">
+							<view class="mitem end"  @click="gotoUrl('pages/mylock/bindLock?id='+floorlockInfo.id)">
 								<img class="img" src="@/assets/img/quick/item3.svg" alt="">
 								属性查看
 							</view>
@@ -214,24 +214,25 @@
 
 		</view>
 		<view class="page-role" v-else>
-			<img class="img" src="@/assets/img/nonwhitelist/info.png" alt="">
+			<u-icon name="hourglass" size="300" color="#19be6b"  v-if="!permission"></u-icon>
+			<img class="img"  v-else src="@/assets/img/nonwhitelist/info.png" alt="">
 			<view class="text1">{{permission?'暂无权限':'加载中...'}}</view>
 			<view class="text2" v-if="permission">此车位仅限车主及授权用户使用</view>
 			<view class="botton" @click="gotoIndex" v-if="permission">返回首页</view>
 		</view>
-		<tabbar  v-if="showtabbar"  ></tabbar>
+		 
 	</view>
 </template>
 
 <script>
 	import componentLogin from '@/components/componentLogin.vue';
-	import tabbar from '@/components/Tabbar.vue';
+	 
 	import * as API from '@/apis/pagejs/pagesIndex.js'
 
 	export default {
 		components: {
 			componentLogin,
-			tabbar,
+			 
 			//'u-collapse-item': () => import('@/uni_modules/uview-ui/components/u-collapse-item/u-collapse-item'),
 			//'u-collapse': () => import('@/uni_modules/uview-ui/components/u-collapse/u-collapse'),
 			
@@ -374,10 +375,22 @@
 				this.$refs.refLogin.ashow()
 			},
 			gotoMain(){
-				uni.switchTab({
-					url:"/pages/index/index"
+				uni.reLaunch({
+					url:"/pages/business/index"
 				})
 			},
+			openLocation(){
+				
+				   
+				   uni.openLocation({
+				   			latitude:this.floorlockInfo.latitude,
+				   			longitude: this.floorlockInfo.longitude,
+				   			success: function () {
+				   				console.log('success');
+				   			}
+				   		});
+
+			},
 			operateBtn() {
 				if(!this.jphelp.getPersonInfo().id){
 					this.loginBl=true;

+ 1 - 1
pages/index/center.vue → pages/business/center.vue

@@ -69,7 +69,7 @@
 	import * as API from '@/apis/pagejs/index.js'
 	
 	import componentLogin from '@/components/componentLogin.vue';
-	import tabbar from '@/components/Tabbar.vue';
+	import tabbar from '@/pages/business/as-components/Tabbar.vue';
 	
 	export default {
 		components: {

+ 377 - 0
pages/business/index.vue

@@ -0,0 +1,377 @@
+<template>
+	<view class="jpmain body">
+		<componentLogin ref="refLogin"  :check="0"
+		@findByOpenId="findByOpenId"></componentLogin>
+
+		<view class="Area Area1" v-if="pointAuthorize">
+			<view class="top">
+				<view class="name">附近地锁</view>
+				<view class="value" @click="getUserLocation()">
+					<img class="img" src="@/assets/img/homepage/riLine-restart-line.svg" alt="">
+					重新定位
+				</view>
+			</view>
+			<view class="list">
+				<view class="line" v-for="(item,i) in nearList"
+					@click="gotoInfo(item)">
+					
+					<view class="itembody">
+						<view class="itemhead">
+							 <img class="img" src="@/assets/img/index.png" alt="">
+						</view>
+						<view class="item" >
+							<view class="name">
+						
+								{{item.name}}
+								<span class="tag" v-if="item.userPreferred"> <u-icon name="star-fill" color="#FFAE00" size="24"></u-icon> 常用 </span>
+								
+							</view>
+							<view class="item2"   >
+								<span class="span" :class="' lockStatus lockStatus'+item.lockStatus">{{item.lockStatusN}}</span><span class="span">|</span><span  class="span" >{{item.parkingName}}</span>
+							</view>
+						</view>
+						
+					</view>
+					
+					<view class="value">小于50米
+					<u-icon name="arrow-right"  color="#CCCCCC"></u-icon>
+					</view>
+				</view>
+			</view>
+			
+			<u-empty text="50米内没有地锁" mode="list" margin-top="80" v-if="!nearList.length">
+				<view slot="bottom">
+					<view class="value-slot" @click="getUserLocation()">
+						<img class="img" src="@/assets/img/homepage/riLine-restart-line.svg" alt="">
+						重新定位
+					</view>
+				</view>
+			</u-empty>
+
+		</view>
+
+		<view class="Area Area2" v-if="otherList.length">
+			<view class="top">
+				<view class="name">全部地锁</view>
+
+			</view>
+			<view class="list">
+				<view class="line" v-for="(item,i) in otherList" :key="i"
+					@click="gotoInfo(item)">
+					
+					
+					<view class="itembody">
+						<view class="itemhead">
+							 <img class="img" src="@/assets/img/index.png" alt="">
+						</view>
+						<view class="item" >
+							<view class="name">
+						
+								{{item.name}}
+								<span class="tag"  v-if="item.userPreferred" > <u-icon name="star-fill" color="#FFAE00" size="24"></u-icon> 常用 </span>
+							</view>
+							<view class="item2"   >
+								<span class="span" :class="' lockStatus lockStatus'+item.lockStatus">{{item.lockStatusN}}</span><span class="span">|</span><span  class="span" >{{item.parkingName}}</span>
+							</view>
+						</view>
+						
+					</view>
+					<view class="value" v-if="item.distance" >{{distanceN(item.distance)}}<u-icon name="arrow-right" color="#CCCCCC"></u-icon></view>
+					<view class="value" v-else ><u-icon name="arrow-right" color="#CCCCCC"></u-icon></view>
+					
+					
+				</view>
+
+			</view>
+		</view>
+		<tabbar  ></tabbar>
+	</view>
+</template>
+
+<script>
+	import * as API from '@/apis/pagejs/pagesIndex.js'
+	import componentLogin from '@/components/componentLogin.vue';
+	 
+	import tabbar from '@/pages/business/as-components/Tabbar.vue';
+	
+	export default {
+		components: {
+			componentLogin,tabbar,
+		},
+		data() {
+			return {
+				pointAuthorize:true,
+				latitude: 30.337053,
+
+				longitude: 112.240222,
+			
+				allList: [],
+				isReady:true,
+				point: false, //是否获取了定位
+			}
+		},
+		onLoad() {
+			this.userInfo = this.jphelp.getPersonInfo()
+			
+		},
+		onReady() {
+			this.$refs.refLogin.findByOpenId()
+			//this.getParkingList()
+			
+		},
+		onShow() {
+				if(this.isReady){
+					if(this.point){
+						// #ifdef MP-WEIXIN
+							this.getUserLocation()	
+						// #endif
+					}else{
+						this.getParkingList()
+					}
+					
+				}
+		},
+		 
+		computed: {
+			otherList() {
+				var sz = []
+
+
+				for (var i in this.allList) {
+					var item = this.allList[i]
+					if (this.point) {
+
+						if (item.distance > 1) {
+							sz.push(item)
+						}
+					} else {
+						sz.push(item)
+					}
+				}
+
+				return sz
+			},
+			nearList() {
+				var sz = []
+				for (var i in this.allList) {
+					var item = this.allList[i]
+					if (this.point) {
+
+						if (item.distance < 1) {
+							sz.push(item)
+						}
+					} else {
+
+					}
+
+				}
+
+				return sz
+			}
+		},
+		methods: {
+			gotoInfo(item){
+				var url='pages/business/lockInfo?from=1&id='+item.id;
+				if (this.point) {
+					url+=`&point=1&longitude=${this.longitude}&latitude=${this.latitude}`
+				}
+				url+="&d="+new Date().getTime()
+				this.gotoUrl(url)
+			},
+			getParkingList() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				var obj = {
+					pageIndex: 1,
+					pageSize: 999,
+					radius: 50,
+				}
+				if (this.point) {
+					obj.longitude = this.longitude
+					obj.latitude = this.latitude
+				}
+				API.floorList(obj).then((res) => {
+
+					this.allList = res.data.data
+					console.log(this.nearList)
+					uni.hideLoading();
+
+				}).catch(error => {
+
+					uni.hideLoading();
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+
+				})
+			},
+			findByOpenId(res) {
+				this.isReady=true
+				// #ifdef MP-WEIXIN
+					this.getUserLocation()	
+				// #endif
+				
+				this.getParkingList()
+				
+			},
+			getUserLocation() {
+				var _this=this
+				uni.authorize({
+					scope: 'scope.userLocation',
+					success() {
+						uni.getLocation({
+							type: 'gcj02',
+							altitude:true,
+							isHighAccuracy:true,
+							success: function(res) {
+								
+								console.log('当前位置的经度:' + res.longitude);
+								console.log('当前位置的纬度:' + res.latitude);
+								_this.point=true
+								_this.longitude=res.longitude
+								_this.latitude=res.latitude
+								_this.getParkingList()
+							}
+						});
+					}
+				})
+			}
+		}
+	}
+</script>
+
+<style scoped lang="scss">
+	.body {
+		padding: 32rpx;
+		padding-top:40rpx;
+	}
+	
+	.value-slot {
+		color: rgba(22, 119, 255, 1);
+		font-size: 24rpx;
+		display: flex;
+		align-items: center;
+	
+		.img {
+			width: 28rpx;
+			height: 28rpx;
+		}
+	}
+	.Area {
+		.img {
+			margin: 0 8rpx;
+		}
+
+		margin-bottom: 32rpx;
+
+		.top {
+			margin-bottom: 8rpx;
+			display: flex;
+			justify-content: space-between;
+
+			.name {
+				color: rgba(51, 51, 51, 1);
+				font-size: 32rpx;
+				font-weight: bold;
+			}
+
+			.value {
+				color: rgba(22, 119, 255, 1);
+				font-size: 24rpx;
+				display: flex;
+				align-items: center;
+
+				.img {
+					width: 28rpx;
+					height: 28rpx;
+				}
+			}
+		}
+
+		.list {
+			.line{
+				    display: flex;
+				    align-items: center;
+					    justify-content: space-between;
+					.itemhead{
+							    display: flex;
+						.img {
+							width: 48rpx;
+							height: 48rpx;
+						}
+					}
+				.itembody{
+					padding: 16rpx 0;
+					
+					    display: flex;
+					    align-items: center;
+				}
+				.item {
+					    display: flex;
+					    flex-direction: column;
+				padding-left: 16rpx;
+					.name {
+						color: rgba(51, 51, 51, 1);
+						font-size: 32rpx;
+						display: flex;
+						align-items: center;
+						//padding-bottom: 8rpx;
+						
+						.tag{
+							font-size: 24rpx;
+							color: rgba(255,174,0,1);
+							border: 1px solid rgba(255,174,0,1);
+							padding: 1px 8rpx;
+							border-radius: 4px;
+							margin-left: 8rpx;
+
+						}
+				
+					}
+				
+					.value {
+						color: rgba(119, 119, 119, 1);
+				
+						font-size: 28rpx;
+					}
+				}
+				.item2{
+					
+						color: rgba(119, 119, 119, 1);
+								
+						font-size: 24rpx;
+						.span{
+							margin-right: 12rpx;
+						}
+						.lockStatus{
+							color: #4CAF50;
+						}
+						.lockStatus1{
+							color: #4CAF50;
+						}
+						.lockStatus2{
+							color: #ff9800;
+						}
+						.lockStatus4{
+							color: red;
+						}
+				}
+			}
+			
+		}
+	}
+
+	.Area2 {
+		margin-top: 40rpx;
+		.list {
+			.line {
+				border-bottom: 1px solid rgba(232, 232, 232, 1);
+				;
+
+			}
+		}
+	}
+</style>

+ 3 - 4
pages/business/lockInfo.vue

@@ -7,15 +7,14 @@
 
 <script>
 	import componentLogin from '@/components/componentLogin.vue';
-	import lockInfo from '@/components/componentLockInfo.vue';
+	import lockInfo from '@/pages/business/as-components/componentLockInfo.vue';
 	
-	import tabbar from '@/components/Tabbar.vue';
-	import * as API from '@/apis/pagejs/pagesIndex.js'
+ 	import * as API from '@/apis/pagejs/pagesIndex.js'
 
 	export default {
 		components: {
 			componentLogin,
-			tabbar,lockInfo
+			 lockInfo
 			//'u-collapse-item': () => import('@/uni_modules/uview-ui/components/u-collapse-item/u-collapse-item'),
 			//'u-collapse': () => import('@/uni_modules/uview-ui/components/u-collapse/u-collapse'),
 			

+ 4 - 4
pages/index/main.vue → pages/business/main.vue

@@ -43,9 +43,9 @@
 
 <script>
 	import componentLogin from '@/components/componentLogin.vue';
-	import tabbar from '@/components/Tabbar.vue';
+	import tabbar from '@/pages/business/as-components/Tabbar.vue';
 	
-	 import lockInfo from '@/components/componentLockInfo.vue';
+	 import lockInfo from '@/pages/business/as-components/componentLockInfo.vue';
 	
 	
 	import * as API from '@/apis/pagejs/pagesIndex.js'
@@ -168,8 +168,8 @@
 				this.$refs.refLogin.ashow()
 			},
 			gotoMain(){
-				uni.switchTab({
-					url:"/pages/index/index"
+				uni.reLaunch({
+					url:"/pages/business/index"
 				})
 			},
 			operateBtn() {

+ 1 - 1
pages/business/readme.vue

@@ -198,7 +198,7 @@
 
 <script>
 	import * as API from '@/apis/pagejs/index.js'
-	import componentLogin from '@/components/componentLogin.vue';
+	import componentLogin from '@/pages/business/as-components/componentLogin.vue';
 
 	export default {
 		components: {

+ 20 - 387
pages/index/index.vue

@@ -1,390 +1,23 @@
-<template>
-	<view class="jpmain body">
-		<componentLogin ref="refLogin"  :check="0"
-		@findByOpenId="findByOpenId"></componentLogin>
-
-		<view class="Area Area1" v-if="pointAuthorize">
-			<view class="top">
-				<view class="name">附近地锁</view>
-				<view class="value" @click="getUserLocation()">
-					<img class="img" src="@/assets/img/homepage/riLine-restart-line.svg" alt="">
-					重新定位
-				</view>
-			</view>
-			<view class="list">
-				<view class="line" v-for="(item,i) in nearList"
-					@click="gotoInfo(item)">
-					
-					<view class="itembody">
-						<view class="itemhead">
-							 <img class="img" src="@/assets/img/index.png" alt="">
-						</view>
-						<view class="item" >
-							<view class="name">
-						
-								{{item.name}}
-								<span class="tag" v-if="item.userPreferred"> <u-icon name="star-fill" color="#FFAE00" size="24"></u-icon> 常用 </span>
-								
-							</view>
-							<view class="item2"   >
-								<span class="span" :class="' lockStatus lockStatus'+item.lockStatus">{{item.lockStatusN}}</span><span class="span">|</span><span  class="span" >{{item.parkingName}}</span>
-							</view>
-						</view>
-						
-					</view>
-					
-					<view class="value">小于50米
-					<u-icon name="arrow-right"  color="#CCCCCC"></u-icon>
-					</view>
-				</view>
-			</view>
-			
-			<u-empty text="50米内没有地锁" mode="list" margin-top="80" v-if="!nearList.length">
-				<view slot="bottom">
-					<view class="value-slot" @click="getUserLocation()">
-						<img class="img" src="@/assets/img/homepage/riLine-restart-line.svg" alt="">
-						重新定位
-					</view>
-				</view>
-			</u-empty>
-
-		</view>
-
-		<view class="Area Area2" v-if="otherList.length">
-			<view class="top">
-				<view class="name">全部地锁</view>
-
-			</view>
-			<view class="list">
-				<view class="line" v-for="(item,i) in otherList" :key="i"
-					@click="gotoInfo(item)">
-					
-					
-					<view class="itembody">
-						<view class="itemhead">
-							 <img class="img" src="@/assets/img/index.png" alt="">
-						</view>
-						<view class="item" >
-							<view class="name">
-						
-								{{item.name}}
-								<span class="tag"  v-if="item.userPreferred" > <u-icon name="star-fill" color="#FFAE00" size="24"></u-icon> 常用 </span>
-							</view>
-							<view class="item2"   >
-								<span class="span" :class="' lockStatus lockStatus'+item.lockStatus">{{item.lockStatusN}}</span><span class="span">|</span><span  class="span" >{{item.parkingName}}</span>
-							</view>
-						</view>
-						
-					</view>
-					<view class="value" v-if="item.distance" >{{distanceN(item.distance)}}<u-icon name="arrow-right" color="#CCCCCC"></u-icon></view>
-					<view class="value" v-else ><u-icon name="arrow-right" color="#CCCCCC"></u-icon></view>
-					
-					
-				</view>
-
-			</view>
-		</view>
-		<tabbar  ></tabbar>
-	</view>
-</template>
-
-<script>
-	import * as API from '@/apis/pagejs/pagesIndex.js'
-	import componentLogin from '@/components/componentLogin.vue';
-	import tabbar from '@/components/Tabbar.vue';
-	
-	export default {
-		components: {
-			componentLogin,tabbar,
-		},
-		data() {
-			return {
-				pointAuthorize:true,
-				latitude: 30.337053,
-
-				longitude: 112.240222,
-			
-				allList: [],
-				isReady:true,
-				point: false, //是否获取了定位
-			}
-		},
-		onLoad() {
-			this.userInfo = this.jphelp.getPersonInfo()
-			
-		},
-		onReady() {
-			this.$refs.refLogin.findByOpenId()
-			//this.getParkingList()
-			
-		},
-		onShow() {
-				if(this.isReady){
-					if(this.point){
-						// #ifdef MP-WEIXIN
-							this.getUserLocation()	
-						// #endif
-					}else{
-						this.getParkingList()
-					}
-					
-				}
-		},
-		onShareTimeline(){
-			return {
-				title: '智泊e家',
-				path: '/pages/index/index' ,
-			}
-		},
-		onShareAppMessage(res) {
-			if (res.from === 'button') { // 来自页面内分享按钮
-				//.log(res.target)
-			}
+<template>
+	<view>
+		加载中...
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
 			return {
-				title: '智泊e家',
-				path: '/pages/index/index' 
-			}
-		},
-		computed: {
-			otherList() {
-				var sz = []
-
-
-				for (var i in this.allList) {
-					var item = this.allList[i]
-					if (this.point) {
-
-						if (item.distance > 1) {
-							sz.push(item)
-						}
-					} else {
-						sz.push(item)
-					}
-				}
-
-				return sz
-			},
-			nearList() {
-				var sz = []
-				for (var i in this.allList) {
-					var item = this.allList[i]
-					if (this.point) {
-
-						if (item.distance < 1) {
-							sz.push(item)
-						}
-					} else {
-
-					}
-
-				}
-
-				return sz
-			}
-		},
-		methods: {
-			gotoInfo(item){
-				var url='pages/business/lockInfo?from=1&id='+item.id;
-				if (this.point) {
-					url+=`&point=1&longitude=${this.longitude}&latitude=${this.latitude}`
-				}
-				url+="&d="+new Date().getTime()
-				this.gotoUrl(url)
-			},
-			getParkingList() {
-				uni.showLoading({
-					title: "加载中",
-					mask: true,
-				})
-				var obj = {
-					pageIndex: 1,
-					pageSize: 999,
-					radius: 50,
-				}
-				if (this.point) {
-					obj.longitude = this.longitude
-					obj.latitude = this.latitude
-				}
-				API.floorList(obj).then((res) => {
-
-					this.allList = res.data.data
-					console.log(this.nearList)
-					uni.hideLoading();
-
-				}).catch(error => {
-
-					uni.hideLoading();
-					uni.showToast({
-						title: error,
-						icon: "none"
-					})
-
-				})
-			},
-			findByOpenId(res) {
-				this.isReady=true
-				// #ifdef MP-WEIXIN
-					this.getUserLocation()	
-				// #endif
-				
-				this.getParkingList()
-				
-			},
-			getUserLocation() {
-				var _this=this
-				uni.authorize({
-					scope: 'scope.userLocation',
-					success() {
-						uni.getLocation({
-							type: 'gcj02',
-							altitude:true,
-							isHighAccuracy:true,
-							success: function(res) {
-								
-								console.log('当前位置的经度:' + res.longitude);
-								console.log('当前位置的纬度:' + res.latitude);
-								_this.point=true
-								_this.longitude=res.longitude
-								_this.latitude=res.latitude
-								_this.getParkingList()
-							}
-						});
-					}
-				})
-			}
-		}
-	}
-</script>
-
-<style scoped lang="scss">
-	.body {
-		padding: 32rpx;
-		padding-top:40rpx;
-	}
-	
-	.value-slot {
-		color: rgba(22, 119, 255, 1);
-		font-size: 24rpx;
-		display: flex;
-		align-items: center;
-	
-		.img {
-			width: 28rpx;
-			height: 28rpx;
+				
+			};
+		},onLoad() {
+			uni.reLaunch({
+				url:"/pages/business/main"
+			})
 		}
-	}
-	.Area {
-		.img {
-			margin: 0 8rpx;
-		}
-
-		margin-bottom: 32rpx;
-
-		.top {
-			margin-bottom: 8rpx;
-			display: flex;
-			justify-content: space-between;
-
-			.name {
-				color: rgba(51, 51, 51, 1);
-				font-size: 32rpx;
-				font-weight: bold;
-			}
-
-			.value {
-				color: rgba(22, 119, 255, 1);
-				font-size: 24rpx;
-				display: flex;
-				align-items: center;
-
-				.img {
-					width: 28rpx;
-					height: 28rpx;
-				}
-			}
-		}
-
-		.list {
-			.line{
-				    display: flex;
-				    align-items: center;
-					    justify-content: space-between;
-					.itemhead{
-							    display: flex;
-						.img {
-							width: 48rpx;
-							height: 48rpx;
-						}
-					}
-				.itembody{
-					padding: 16rpx 0;
-					
-					    display: flex;
-					    align-items: center;
-				}
-				.item {
-					    display: flex;
-					    flex-direction: column;
-				padding-left: 16rpx;
-					.name {
-						color: rgba(51, 51, 51, 1);
-						font-size: 32rpx;
-						display: flex;
-						align-items: center;
-						//padding-bottom: 8rpx;
-						
-						.tag{
-							font-size: 24rpx;
-							color: rgba(255,174,0,1);
-							border: 1px solid rgba(255,174,0,1);
-							padding: 1px 8rpx;
-							border-radius: 4px;
-							margin-left: 8rpx;
+	}
+</script>
 
-						}
-				
-					}
-				
-					.value {
-						color: rgba(119, 119, 119, 1);
-				
-						font-size: 28rpx;
-					}
-				}
-				.item2{
-					
-						color: rgba(119, 119, 119, 1);
-								
-						font-size: 24rpx;
-						.span{
-							margin-right: 12rpx;
-						}
-						.lockStatus{
-							color: #4CAF50;
-						}
-						.lockStatus1{
-							color: #4CAF50;
-						}
-						.lockStatus2{
-							color: #ff9800;
-						}
-						.lockStatus4{
-							color: red;
-						}
-				}
-			}
-			
-		}
-	}
-
-	.Area2 {
-		margin-top: 40rpx;
-		.list {
-			.line {
-				border-bottom: 1px solid rgba(232, 232, 232, 1);
-				;
-
-			}
-		}
-	}
-</style>
+<style lang="scss">
+
+</style>

+ 29 - 12
pages/mylock/bindLock.vue

@@ -209,7 +209,7 @@
 					this.bindInfo.type = res.data.floorlockInfo.type
 					this.bindInfo.latitude = res.data.floorlockInfo.latitude
 					this.bindInfo.longitude = res.data.floorlockInfo.longitude
-					this.bindInfo.address = res.data.floorlockInfo.address
+					this.bindInfo.address = res.data.floorlockInfo.locationAddress
 					
 					
 					
@@ -381,20 +381,37 @@
 					title: "加载中",
 					mask: true,
 				})
-				API.add( this.bindInfo ).then((res) => {
-				
-					uni.redirectTo({
-						url:"/pages/mylock/bindLockStatus?id="+this.nowscan.id
+				if(this.bindInfo.id){
+					API.updateLock( this.bindInfo ).then((res) => {
+					
+						uni.navigateBack()
+						
+								 
+					}).catch(error => {
+						uni.showToast({
+							title: error,
+							icon: "none"
+						})
 					})
-						uni.hideLoading();
+				}else{
+					API.add( this.bindInfo ).then((res) => {
 					
-							 
-				}).catch(error => {
-					uni.showToast({
-						title: error,
-						icon: "none"
+						uni.redirectTo({
+							url:"/pages/mylock/bindLockStatus?id="+this.nowscan.id
+						})
+							uni.hideLoading();
+						
+								 
+					}).catch(error => {
+						uni.showToast({
+							title: error,
+							icon: "none"
+						})
 					})
-				})
+				}
+				
+				
+				
 			},
 			gotoscanMP(){
 				// 允许从相机和相册扫码