diff --git a/pages/buyer/index.js b/pages/buyer/index.js index 398c070..4096fd6 100644 --- a/pages/buyer/index.js +++ b/pages/buyer/index.js @@ -1917,13 +1917,17 @@ Page({ wx.showModal({ title: '登录成功', content: '🥚 想快速找到离你最近的新鲜鸡蛋供应商、支持自提的门店,或享受精准配送服务?允许获取位置后,我们会为你优先展示周边优质货源、计算最快配送时效,省去手动输入地址的麻烦~隐私安全有保障,位置信息仅用于优化你的购物体验,放心点击【允许】吧!', - showCancel: false, + showCancel: true, + cancelText: '取消', confirmText: '允许', success(res) { if (res.confirm) { console.log('用户点击了允许'); // 调用位置授权函数 that.requestLocationAuth(); + } else if (res.cancel) { + console.log('用户点击了取消'); + // 关闭弹窗,不执行任何操作 } } }); diff --git a/pages/profile/index.js b/pages/profile/index.js index 473e09c..7f272b8 100644 --- a/pages/profile/index.js +++ b/pages/profile/index.js @@ -644,13 +644,17 @@ Page({ wx.showModal({ title: '登录成功', content: '🥚 想快速找到离你最近的新鲜鸡蛋供应商、支持自提的门店,或享受精准配送服务?允许获取位置后,我们会为你优先展示周边优质货源、计算最快配送时效,省去手动输入地址的麻烦~隐私安全有保障,位置信息仅用于优化你的购物体验,放心点击【允许】吧!', - showCancel: false, + showCancel: true, + cancelText: '取消', confirmText: '允许', success(res) { if (res.confirm) { console.log('用户点击了允许'); // 调用位置授权函数 that.requestLocationAuth(); + } else if (res.cancel) { + console.log('用户点击了取消'); + // 关闭弹窗,不执行任何操作 } } });