消息中心添加订阅授权提示
parent
52cb4f4ac0
commit
326bd3b5d4
|
@ -92,6 +92,51 @@
|
|||
}).exec()
|
||||
if(options.index==undefined){this.isWen = false;this.ntype = 'message';}
|
||||
this.checkMsg();
|
||||
let that = this ;
|
||||
wx.showModal({
|
||||
title: '温馨提示',
|
||||
content: '为及时通知到您,需要向您申请消息发送权限,不会骚扰您的生活!',
|
||||
confirmText:"同意",
|
||||
cancelText:"拒绝",
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
//调用订阅消息
|
||||
console.log('用户点击确定', '订阅消息授权成功');
|
||||
//调用订阅
|
||||
wx.requestSubscribeMessage({
|
||||
tmplIds: ['d0efR-Ga27c6eIvx9mAwJcnAqzhM_Sq68XiFvjvlBJM','eyxvInLLF3L_wmcSQc_O7XLKF7RoGK1dM3OwKj5fHio'],
|
||||
success: (res) => {
|
||||
console.log(res, 'success')
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log(res, 'fail')
|
||||
},
|
||||
complete: (res) => {
|
||||
wx.getSetting({
|
||||
withSubscriptions: true,
|
||||
success: (res) => {
|
||||
console.log(res, '获取设置信息')
|
||||
}
|
||||
})
|
||||
console.log(res, 'complete')
|
||||
}
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消', '订阅消息授权');
|
||||
///显示第二个弹说明一下
|
||||
wx.showModal({
|
||||
title: '温馨提示',
|
||||
content: '拒绝后您将无法获得及时的消息通知哦',
|
||||
confirmText:"知道了",
|
||||
showCancel:false,
|
||||
success: function (res) {
|
||||
///点击知道了的后续操作
|
||||
///如跳转首页面
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
readMsg(index1,index2){
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue