diff --git a/.gitignore b/.gitignore index 61e18fd..04df119 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .idea unpackage +node_modules \ No newline at end of file diff --git a/common/notifyMsg.js b/common/notifyMsg.js new file mode 100644 index 0000000..03ebdf4 --- /dev/null +++ b/common/notifyMsg.js @@ -0,0 +1,55 @@ +export default { + + openMsg(){ + var that = this + + + return console.log("test..."); + + wx.getSetting({ + withSubscriptions: true, //是否获取用户订阅消息的订阅状态,默认false不返回 + success(ret) { + // console.log(ret,'------------------') + // console.log(Object.keys(ret.subscriptionsSetting.itemSettings).length) + // if (JSON.stringify(ret.subscriptionsSetting.itemSettings).indexOf('accept')!=-1) { + if (ret.subscriptionsSetting.itemSettings) { + uni.setStorageSync('sendtaskMsg', true) + uni.openSetting({ // 打开设置页 + success(rea) { + console.log(rea.authSetting) + } + }); + } else { // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息 + uni.setStorageSync('sendtaskMsg', false) + uni.showModal({ + title: '提示', + content: '为了更好的体验,请绑定消息推送', + confirmText: '确定', + cancelText: '取消', + success: function(res) { + if (res.confirm) { + uni.requestSubscribeMessage({ + tmplIds: that.arr, + success(re) { + // console.log(re,'**********') + var datas = JSON.stringify(re); + if (datas.indexOf("accept") != -1) { + console.log(re) + } + }, + fail: (res) => { + console.log(res) + } + }) + that.showModal = false + } else if (res.cancel) { + that.showModal = true + } + } + }) + } + } + }) + } + +} \ No newline at end of file diff --git a/pages/activity/index.vue b/pages/activity/index.vue index b3369d6..dc24ca6 100644 --- a/pages/activity/index.vue +++ b/pages/activity/index.vue @@ -50,7 +50,7 @@ }, data() { return { - merchantLogo: '../../static/img/logo.jpg', + merchantLogo: 'https://download.cyjyyjy.com/fq-logo.jpg', colors: '#FF4701', title: '暂无店铺', merchantId: 0, diff --git a/pages/index/addShop.vue b/pages/index/addShop.vue index 9517b5f..b01910c 100644 --- a/pages/index/addShop.vue +++ b/pages/index/addShop.vue @@ -65,6 +65,7 @@