更新
This commit is contained in:
@@ -83,7 +83,8 @@
|
||||
</view>
|
||||
</view>
|
||||
<msg-models :showAuthFrror="showAuthFrror" @hideOneModal="hideModel"></msg-models>
|
||||
<three-sites @hideOneModal="showThreeSites=false" :showThreeSites="showThreeSites"></three-sites>
|
||||
<three-sites v-if="showThreeSites" @hideOneModal="showThreeSites=false"
|
||||
:showThreeSites="showThreeSites"></three-sites>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -237,7 +238,8 @@
|
||||
},
|
||||
|
||||
onPullDownRefresh() {
|
||||
// this.refreshLocation()
|
||||
this.refreshLocation()
|
||||
|
||||
setTimeout(function() {
|
||||
uni.stopPullDownRefresh()
|
||||
}, 800);
|
||||
@@ -306,6 +308,7 @@
|
||||
type: 'wgs84',
|
||||
success: (res) => {
|
||||
uni.setStorageSync('location', res)
|
||||
this.getSiteList()
|
||||
},
|
||||
fail: () => {
|
||||
uni.getSetting({
|
||||
@@ -318,25 +321,23 @@
|
||||
success: (resSec) => {
|
||||
if (resSec.confirm) {
|
||||
uni.openSetting({
|
||||
success: (resThird) => {
|
||||
if (resThird
|
||||
.authSetting[
|
||||
'scope.userLocation'
|
||||
]) {
|
||||
this.refreshLocation()
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '获取定位失败,请稍后再试!',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
complete: () => {
|
||||
this.getSiteList()
|
||||
},
|
||||
// complete: () => {
|
||||
// this.getSiteList()
|
||||
// },
|
||||
});
|
||||
},
|
||||
|
||||
@@ -443,14 +444,16 @@
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
params: {
|
||||
longitude: 117.157817,
|
||||
latitude: 31.802472,
|
||||
// longitude: 117.157817,
|
||||
// latitude: 31.802472,
|
||||
clientBelong: 'ZHONGPIN',
|
||||
comprehensiveSort: 1,
|
||||
zpDisable: 'ENABLE',
|
||||
sort: "juli",
|
||||
...uni.getStorageSync('location'),
|
||||
...this.filterData,
|
||||
// latitude: '37.38808',
|
||||
// longitude: '112.40546'
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -256,14 +256,14 @@
|
||||
}
|
||||
},
|
||||
},
|
||||
onShow() {
|
||||
this.tools.userLocationChenk().then(res => {
|
||||
this.refreshLocation();
|
||||
}).catch(err => {});
|
||||
this.getSiteList()
|
||||
},
|
||||
// onShow() {
|
||||
// this.tools.userLocationChenk().then(res => {
|
||||
// this.refreshLocation();
|
||||
// }).catch(err => {});
|
||||
// this.getSiteList()
|
||||
// },
|
||||
onLoad() {
|
||||
// this.refreshLocation()
|
||||
this.refreshLocation()
|
||||
if (!uni.getStorageSync('filterData')) {
|
||||
this.getFilterData()
|
||||
} else {
|
||||
@@ -369,15 +369,55 @@
|
||||
onSelected(e) {
|
||||
// console.log(e)
|
||||
},
|
||||
// refreshLocation() {
|
||||
// uni.getLocation({
|
||||
// type: 'wgs84',
|
||||
// success: function(res) {
|
||||
// uni.setStorageSync('location', res)
|
||||
// }
|
||||
// });
|
||||
// },
|
||||
refreshLocation() {
|
||||
uni.getLocation({
|
||||
type: 'wgs84',
|
||||
success: function(res) {
|
||||
success: (res) => {
|
||||
uni.setStorageSync('location', res)
|
||||
}
|
||||
this.getSiteList()
|
||||
},
|
||||
fail: () => {
|
||||
uni.getSetting({
|
||||
success: (res) => {
|
||||
if (!res.authSetting['scope.userLocation']) {
|
||||
uni.showModal({
|
||||
title: '请您打开定位权限',
|
||||
content: '用于获取您当前位置附近的油站',
|
||||
confirmText: '去设置',
|
||||
success: (resSec) => {
|
||||
if (resSec.confirm) {
|
||||
uni.openSetting({
|
||||
complete:() => {
|
||||
// this.getSiteList()
|
||||
// this.realPosition()
|
||||
this.refreshLocation()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}else {
|
||||
uni.showToast({
|
||||
title:'获取定位失败,请稍后再试!',
|
||||
icon:'none'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// complete: () => {
|
||||
// this.getSiteList()
|
||||
// },
|
||||
});
|
||||
},
|
||||
|
||||
getSiteList() {
|
||||
let parameter = {
|
||||
currentPage: this.currentPage,
|
||||
|
||||
Reference in New Issue
Block a user