Browse Source

(*) 主动上报位置未授权提示

master
liujiangyong 1 year ago
parent
commit
465c6c9847
  1. 27
      weapp/package/report/report.js

27
weapp/package/report/report.js

@ -498,14 +498,31 @@ Page({
}, },
fail: (res) => { fail: (res) => {
wx.hideLoading(); wx.hideLoading();
wx.showToast({ if (res.errMsg === 'getLocation:fail auth deny') {
title: res.errMsg, that.toSettingModal('请允许位置权限')
icon: 'none', } else {
duration: 1000 wx.showToast({
}); title: res.errMsg,
icon: 'none',
duration: 1000
});
}
} }
}); });
}, },
toSettingModal() {
wx.showModal({
title: '提示',
confirmText: '去设置',
content: '请允许位置权限',
success: function (res) {
const { confirm } = res || {}
if (confirm) {
wx.openSetting()
}
}
})
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */

Loading…
Cancel
Save