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