1.wx.openSetting()需要放入点击事件的回调中,或者点击事件的回调的回调中。
// 页面用户点击事件
bindTapEvent: function() {
// 第一种情况
wx.openSetting(); // 可以拉起
// 第二种情况
wx.showModal({
...
success: (res) {
if(res.confirm) {
wx.openSetting(); // 可以拉起
}
}
})
}
2.若无用户点击事件
onLoad: function (options) {
// 第一种情况
wx.openSetting(); // 不可拉起
// 第二种情况
wx.showModal({
...
success: (res) {
if(res.confirm) {
wx.openSetting(); // 不可拉起
}
}
})
}