|
@@ -1,7 +1,8 @@
|
|
|
<template>
|
|
|
<view class="parking">
|
|
|
<view class="loading" v-show="loading">
|
|
|
- <u-loading size="36" mode="flower"></u-loading>
|
|
|
+ <!-- <u-loading size="36" mode="flower"></u-loading> -->
|
|
|
+ <u-loadmore status="loading" icon-type="flower" :load-text="{loading: '正在定位中...',}" />
|
|
|
</view>
|
|
|
<view class="parking-header">
|
|
|
<u-search placeholder="搜索停车场" v-model="searchContent" :show-action="false" @change="searchInputChange"></u-search>
|
|
@@ -112,7 +113,6 @@
|
|
|
searchContent: '',
|
|
|
page_map:'',
|
|
|
loading: false,
|
|
|
- // id: 0, //使用 marker点击事件 需要填写id
|
|
|
latitude: 26.64969,
|
|
|
longitude: 106.636453,
|
|
|
scale: 16,
|
|
@@ -120,20 +120,7 @@
|
|
|
latitude: 26.64969,
|
|
|
longitude: 106.636453,
|
|
|
},
|
|
|
- covers: [
|
|
|
- // {
|
|
|
- // latitude: 26.597864,
|
|
|
- // longitude: 106.72947,
|
|
|
- // id: '0',
|
|
|
- // iconPath: require('./../../static/img/parking-icon.png')
|
|
|
- // },
|
|
|
- // {
|
|
|
- // latitude: 26.497864,
|
|
|
- // longitude: 106.72947,
|
|
|
- // id: '1',
|
|
|
- // iconPath: require('./../../static/img/parking-icon.png')
|
|
|
- // }
|
|
|
- ],
|
|
|
+ covers: [],
|
|
|
// 附近列表是否显示
|
|
|
nearParkingFlag: false,
|
|
|
// 轮播选中
|
|
@@ -156,7 +143,7 @@
|
|
|
onShow() {
|
|
|
this.isShowSearchParking = false
|
|
|
this.isShowParkingDetail = false
|
|
|
- this.getNearRoadsl()
|
|
|
+ // this.getNearRoadsl()
|
|
|
},
|
|
|
methods:{
|
|
|
/*
|
|
@@ -174,7 +161,7 @@
|
|
|
getLocation(){
|
|
|
let that = this;
|
|
|
console.log("请求定位")
|
|
|
- // that.loading = true
|
|
|
+ that.loading = true
|
|
|
uni.getLocation({
|
|
|
type:"gcj02",
|
|
|
success : function (res) {
|
|
@@ -223,7 +210,7 @@
|
|
|
const nearParkingList = [] // 附近停车场列表
|
|
|
this.covers = []
|
|
|
res.data.forEach((item, index, arr)=>{
|
|
|
- if(item.latitude&&item.longitude){
|
|
|
+ if(item.latitude && item.longitude){
|
|
|
nearParkingList.push(item)
|
|
|
let marker = {
|
|
|
latitude: item.latitude,
|
|
@@ -233,15 +220,16 @@
|
|
|
width: 20,
|
|
|
height: 25
|
|
|
}
|
|
|
+ // 选中经纬度图标变大
|
|
|
if (lon && lat) {
|
|
|
if (lon === item.longitude && lat === item.latitude) {
|
|
|
marker.width = 40
|
|
|
marker.height = 50
|
|
|
}
|
|
|
} else {
|
|
|
- if (index === 1) {
|
|
|
- marker.width = 40
|
|
|
- marker.height = 50
|
|
|
+ if (this.covers.length > 0) {
|
|
|
+ this.covers[0].width = 40
|
|
|
+ this.covers[0].height = 50
|
|
|
}
|
|
|
}
|
|
|
this.covers.push(marker)
|