|
|
@ -364,33 +364,34 @@ |
|
|
|
|
|
|
|
|
|
|
|
// 开启订阅消息 |
|
|
|
// 开启订阅消息 |
|
|
|
openMsg() { |
|
|
|
openMsg() { |
|
|
|
var that = this |
|
|
|
uni.requestSubscribeMessage({ |
|
|
|
// 获取用户的当前设置,判断是否点击了“总是保持以上,不在询问” |
|
|
|
tmplIds: ['oUvaCPeeOg4wH6HTvCcSabU6FnzXUXOBXsqBYAPOV-U'], |
|
|
|
wx.getSetting({ |
|
|
|
success (res) { |
|
|
|
withSubscriptions:true, //是否获取用户订阅消息的订阅状态,默认false不返回 |
|
|
|
console.log(res) |
|
|
|
success(res) { |
|
|
|
}, |
|
|
|
if(res.authSetting['scope.subscribeMessage'] || res.authSetting['scope.subscribeMessage'] == undefined) { //用户点击了“总是保持以上,不再询问” |
|
|
|
fail:(res) => { |
|
|
|
uni.openSetting({ // 打开设置页 |
|
|
|
console.log(res) |
|
|
|
success(res) { |
|
|
|
} |
|
|
|
console.log(res.authSetting) |
|
|
|
}) |
|
|
|
}, |
|
|
|
// var that = this |
|
|
|
fail(err) { |
|
|
|
// // 获取用户的当前设置,判断是否点击了“总是保持以上,不在询问” |
|
|
|
console.log(err) |
|
|
|
// wx.getSetting({ |
|
|
|
} |
|
|
|
// withSubscriptions:true, //是否获取用户订阅消息的订阅状态,默认false不返回 |
|
|
|
}); |
|
|
|
// success(res) { |
|
|
|
}else { // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息 |
|
|
|
// if(res.authSetting['scope.subscribeMessage'] || res.authSetting['scope.subscribeMessage'] == undefined) { //用户点击了“总是保持以上,不再询问” |
|
|
|
uni.requestSubscribeMessage({ |
|
|
|
// uni.openSetting({ // 打开设置页 |
|
|
|
tmplIds: 1, |
|
|
|
// success(res) { |
|
|
|
success (res) { |
|
|
|
// console.log(res.authSetting) |
|
|
|
console.log(res) |
|
|
|
// }, |
|
|
|
}, |
|
|
|
// fail(err) { |
|
|
|
fail:(res) => { |
|
|
|
// console.log(err) |
|
|
|
console.log(res) |
|
|
|
// } |
|
|
|
} |
|
|
|
// }); |
|
|
|
}) |
|
|
|
// }else { // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息 |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
// } |
|
|
|
}) |
|
|
|
// } |
|
|
|
|
|
|
|
// }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
//获取弹出或者弹窗 |
|
|
|
//获取弹出或者弹窗 |
|
|
|
getCmsContent() { |
|
|
|
getCmsContent() { |
|
|
|