|
|
@@ -811,44 +811,58 @@ Component({
|
|
|
card: item.card
|
|
|
})
|
|
|
},
|
|
|
+ /**
|
|
|
+ * @desc : 消息订阅
|
|
|
+ * @author : 刘尧
|
|
|
+ * @date : 2024/1/26 11:46
|
|
|
+ */
|
|
|
openRemindDatePopTime(e) {
|
|
|
const that = this
|
|
|
const tmplIds = Constants.miniMessageModelIds
|
|
|
- // 获取微信基础配置
|
|
|
- wx.getSetting({
|
|
|
- withSubscriptions: true,
|
|
|
+ wx.requestSubscribeMessage({
|
|
|
+ tmplIds: tmplIds,
|
|
|
success(res) {
|
|
|
- let bol = false
|
|
|
- // 适配存在多个订阅消息模板的情况
|
|
|
- if (res.subscriptionsSetting.itemSettings) {
|
|
|
- const obj = res.subscriptionsSetting.itemSettings
|
|
|
- Object.keys(obj).forEach((key) => {
|
|
|
- if (obj[key] !== 'accept') {
|
|
|
- bol = true
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- bol = true
|
|
|
- }
|
|
|
- if (bol) {
|
|
|
- // 如果配置中用户未订阅消息 则弹窗
|
|
|
- wx.requestSubscribeMessage({
|
|
|
- tmplIds: tmplIds,
|
|
|
- success(res) {
|
|
|
- that.openDatePopTime(e)
|
|
|
- },
|
|
|
- fail(res) {
|
|
|
- that.openDatePopTime(e)
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- that.openDatePopTime(e)
|
|
|
- }
|
|
|
+ that.openDatePopTime(e)
|
|
|
},
|
|
|
fail(res) {
|
|
|
that.openDatePopTime(e)
|
|
|
}
|
|
|
})
|
|
|
+ // 获取微信基础配置
|
|
|
+ // wx.getSetting({
|
|
|
+ // withSubscriptions: true,
|
|
|
+ // success(res) {
|
|
|
+ // let bol = false
|
|
|
+ // // 适配存在多个订阅消息模板的情况
|
|
|
+ // if (res.subscriptionsSetting.itemSettings) {
|
|
|
+ // const obj = res.subscriptionsSetting.itemSettings
|
|
|
+ // Object.keys(obj).forEach((key) => {
|
|
|
+ // if (obj[key] !== 'accept') {
|
|
|
+ // bol = true
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // } else {
|
|
|
+ // bol = true
|
|
|
+ // }
|
|
|
+ // if (bol) {
|
|
|
+ // // 如果配置中用户未订阅消息 则弹窗
|
|
|
+ // wx.requestSubscribeMessage({
|
|
|
+ // tmplIds: tmplIds,
|
|
|
+ // success(res) {
|
|
|
+ // that.openDatePopTime(e)
|
|
|
+ // },
|
|
|
+ // fail(res) {
|
|
|
+ // that.openDatePopTime(e)
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // } else {
|
|
|
+ // that.openDatePopTime(e)
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // fail(res) {
|
|
|
+ // that.openDatePopTime(e)
|
|
|
+ // }
|
|
|
+ // })
|
|
|
},
|
|
|
/**
|
|
|
* @desc : 关闭日期pop
|