onLoad(option) {this.queryLocation()
}queryLocation() {var that = this;uni.getSetting({success(res) {if (res.authSetting['scope.userLocation'] != undefined && res.authSetting['scope.userLocation'] != true) {uni.showModal({content: '检测到您没打开此小程序的定位权限,是否去设置打开?',confirmText: "确认",cancelText: "取消",success: function (res) {if (res.confirm) {uni.openSetting({success: (res) => {that.getLocal()}})} else {}}});}}});},methods: {
//获取最近经纬度getLocal() {var _self = this;uni.getLocation({type: 'wgs84',success: function(res) {uni.setStorageSync('longitude', res.longitude);uni.setStorageSync('latitude', res.latitude);if(_self.shareId){_self.getFirstPage()}else{_self.setLocalapi(res.longitude, res.latitude);}},fail: function(res) {_self.getLastShop()//_self.ifshow = true; //改变弹窗打开}});},
}