整改跳转

main
123456 2 weeks ago
parent 1f94b45e21
commit eb94328eef
  1. 15
      pages/index/index.vue
  2. 12
      pages/peiwan/index.vue
  3. 16
      unpackage/dist/dev/app-plus/app-service.js

@ -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){

@ -6,7 +6,7 @@
<view class="address" v-if="city" @click="openPage(2)"> <view class="address" v-if="city" @click="openPage(2)">
<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(3)"> <view class="search" @click="openPage(3)">
@ -46,7 +46,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>
@ -93,7 +93,11 @@
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
},2000) },2000)
}, },
onLoad() {}, onLoad() {
if(uni.getSystemInfoSync().platform == 'ios') {
this.getLocation();
}
},
onShow() { onShow() {
if(uni.getStorageSync("userInfo").id){ if(uni.getStorageSync("userInfo").id){
this.getUserInfo(); this.getUserInfo();
@ -278,7 +282,7 @@
}, },
openPage(index,id){ openPage(index,id){
if(!that.city){ if(!that.city){
that.getLocation(); that.toGetLocation();
return ; return ;
} }
if(index == 1){ if(index == 1){

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save