|
|
|
@ -195,6 +195,58 @@ |
|
|
|
|
// this.latitude = app.globalData.latitude; |
|
|
|
|
// this.longitude = app.globalData.longitude; |
|
|
|
|
/* this.onControltap(); */ |
|
|
|
|
// #ifdef MP-WEIXIN |
|
|
|
|
let that = this; |
|
|
|
|
uni.getSetting({ |
|
|
|
|
success: (res) => { |
|
|
|
|
//如果没有定位权限 |
|
|
|
|
if (!res.authSetting["scope.userLocation"]) { |
|
|
|
|
//向用户发起授权请求 |
|
|
|
|
uni.authorize({ |
|
|
|
|
scope: "scope.userLocation", |
|
|
|
|
success: () => { |
|
|
|
|
//获取到定位授权 |
|
|
|
|
that.onControltap(); |
|
|
|
|
}, |
|
|
|
|
//授权失败 |
|
|
|
|
fail: () => { |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
uni.showModal({ |
|
|
|
|
title: "您已拒绝获取定位权限", |
|
|
|
|
content: "是否进入权限管理,调整授权?", |
|
|
|
|
success: (res) => { |
|
|
|
|
if (res.confirm) { |
|
|
|
|
//调起客户端小程序设置界面,返回用户设置的操作结果。(重新让用户授权) |
|
|
|
|
uni.openSetting({ |
|
|
|
|
success: (res) => { |
|
|
|
|
console.log(res |
|
|
|
|
.authSetting |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
} else if (res.cancel) { |
|
|
|
|
return uni.showToast({ |
|
|
|
|
title: "已取消", |
|
|
|
|
icon:'none' |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
//已经开启定位授权 |
|
|
|
|
if(this.goodsFirstClassList.length == 1){ |
|
|
|
|
that.onControltap(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
fail: (res) => { |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
// #endif |
|
|
|
|
}, |
|
|
|
|
components:{ |
|
|
|
|
touchbox, |
|
|
|
@ -359,7 +411,7 @@ |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
postionIng() { |
|
|
|
|
/* postionIng() { |
|
|
|
|
let that = this; |
|
|
|
|
uni.getLocation({ |
|
|
|
|
type: 'wgs84', |
|
|
|
@ -381,7 +433,7 @@ |
|
|
|
|
// }) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
}, */ |
|
|
|
|
//金纬度转 |
|
|
|
|
findByLatAndLng(item, item1) { |
|
|
|
|
let datas = { |
|
|
|
|