1.添加首页 订阅消息

yj-dev
杨杰 3 years ago
parent 4feb309e5c
commit b8364e1fbb
  1. 32
      pages/tabBar/home/home.vue

@ -316,6 +316,7 @@
},
onLoad() {
let that = this;
// that.openMsg();
// 1.wxcode
// #ifdef MP
uni.login({
@ -360,6 +361,37 @@
// #endif
},
methods: {
//
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({
tmplIds: 1,
success (res) {
console.log(res)
},
fail:(res) => {
console.log(res)
}
})
}
}
})
},
//
getCmsContent() {
let params = {

Loading…
Cancel
Save