
// 重新定位
? ? repositionFun: function () {
? ? ? ? let that = this;
? ? ? ? wx.getLocation({
? ? ? ? ? ? type: "gcj02",
? ? ? ? ? ? altitude: "true",
? ? ? ? ? ? success: function (res) {
? ? ? ? ? ? ? ? console.log(res);
? ? ? ? ? ? ? ? that.setData({
? ? ? ? ? ? ? ? ? ? longitude: res.longitude,
? ? ? ? ? ? ? ? ? ? latitude: res.latitude,
? ? ? ? ? ? ? ? ? ? scale: 17
? ? ? ? ? ? ? ? });
? ? ? ? ? ? },
? ? ? ? ? ? fail: function () {
? ? ? ? ? ? ? ? wx.getSetting({
? ? ? ? ? ? ? ? ? ? success: (res) => {
? ? ? ? ? ? ? ? ? ? ? ? if (res.authSetting['scope.userLocation'] != undefined && res.authSetting['scope.userLocation'] != true) {
? ? ? ? ? ? ? ? ? ? ? ? ? ? wx.showModal({
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? title: '是否授權當前位置',
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? content: '需要獲取您的地理位置,請確認授權,否則地圖功能將無法使用',
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? success: function (res) {
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if (res.cancel) {
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? console.info("1授權失敗返回數(shù)據(jù)");
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? } else if (res.confirm) {
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? wx.openSetting({
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? success: function (data) {
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if (data.authSetting["scope.userLocation"] == true) {
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? wx.showToast({
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? title: '授權成功',
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? icon: 'success',
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? duration: 5000
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? })
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? } else {
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? wx.showToast({
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? title: '授權失敗',
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? image: "../../images/warn.png",
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? duration: 2000
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? });
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? })
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? ? ? })
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? });
? ? ? ? ? ? }
? ? ? ? })
? ? },