Browse Source

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

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

17
weapp/package/report/report.js

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

Loading…
Cancel
Save