From 465c6c98478176e83db11a3f7964ad468c273644 Mon Sep 17 00:00:00 2001 From: liujiangyong Date: Fri, 10 Nov 2023 17:04:34 +0800 Subject: [PATCH] =?UTF-8?q?(*)=20=E4=B8=BB=E5=8A=A8=E4=B8=8A=E6=8A=A5?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E6=9C=AA=E6=8E=88=E6=9D=83=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- weapp/package/report/report.js | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/weapp/package/report/report.js b/weapp/package/report/report.js index df115da..acb9398 100644 --- a/weapp/package/report/report.js +++ b/weapp/package/report/report.js @@ -498,14 +498,31 @@ Page({ }, fail: (res) => { wx.hideLoading(); - wx.showToast({ - title: res.errMsg, - icon: 'none', - duration: 1000 - }); + if (res.errMsg === 'getLocation:fail auth deny') { + that.toSettingModal('请允许位置权限') + } else { + 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() + } + } + }) + }, /** * 生命周期函数--监听页面初次渲染完成 */