|
|
@ -6,7 +6,7 @@ |
|
|
|
<view class="address" v-if="city" @click="openPage(5)"> |
|
|
|
<view class="address" v-if="city" @click="openPage(5)"> |
|
|
|
<image src="@/static/dingwei.png"></image>{{city}} |
|
|
|
<image src="@/static/dingwei.png"></image>{{city}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="address" v-else @click="getLocation()"> |
|
|
|
<view class="address" v-else @click="toGetLocation()"> |
|
|
|
<image src="@/static/dingwei.png"></image>获取定位 |
|
|
|
<image src="@/static/dingwei.png"></image>获取定位 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="search" @click="openPage(4)"> |
|
|
|
<view class="search" @click="openPage(4)"> |
|
|
@ -76,7 +76,7 @@ |
|
|
|
<view style="padding: 250rpx 0 0;"> |
|
|
|
<view style="padding: 250rpx 0 0;"> |
|
|
|
<u-empty v-if="!city" text="请开启定位权限" mode="data"> |
|
|
|
<u-empty v-if="!city" text="请开启定位权限" mode="data"> |
|
|
|
<view slot="bottom" style="margin-top: 30rpx;"> |
|
|
|
<view slot="bottom" style="margin-top: 30rpx;"> |
|
|
|
<u-button @click="getLocation()">获取定位</u-button> |
|
|
|
<u-button @click="toGetLocation()">获取定位</u-button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</u-empty> |
|
|
|
</u-empty> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -143,7 +143,11 @@ |
|
|
|
uni.stopPullDownRefresh(); |
|
|
|
uni.stopPullDownRefresh(); |
|
|
|
},2000) |
|
|
|
},2000) |
|
|
|
}, |
|
|
|
}, |
|
|
|
onLoad() {}, |
|
|
|
onLoad() { |
|
|
|
|
|
|
|
if(uni.getSystemInfoSync().platform == 'ios') { |
|
|
|
|
|
|
|
this.getLocation(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
onReady() { |
|
|
|
onReady() { |
|
|
|
const that = this; |
|
|
|
const that = this; |
|
|
|
uni.$on("clickTap", res=>{ |
|
|
|
uni.$on("clickTap", res=>{ |
|
|
@ -204,8 +208,9 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
getLocation() { |
|
|
|
toGetLocation() { |
|
|
|
const that = this; |
|
|
|
const that = this; |
|
|
|
|
|
|
|
console.log(111) |
|
|
|
// APP检查权限 |
|
|
|
// APP检查权限 |
|
|
|
if(uni.getSystemInfoSync().platform == 'android') { |
|
|
|
if(uni.getSystemInfoSync().platform == 'android') { |
|
|
|
plus.android.checkPermission( |
|
|
|
plus.android.checkPermission( |
|
|
@ -411,7 +416,7 @@ |
|
|
|
openPage(index,id){ |
|
|
|
openPage(index,id){ |
|
|
|
const that = this; |
|
|
|
const that = this; |
|
|
|
if(!that.city){ |
|
|
|
if(!that.city){ |
|
|
|
that.getLocation(); |
|
|
|
that.toGetLocation(); |
|
|
|
return ; |
|
|
|
return ; |
|
|
|
} |
|
|
|
} |
|
|
|
if(index == 1){ |
|
|
|
if(index == 1){ |
|
|
|