From 137adad6807b6d64df79870130719f211fc72e0f Mon Sep 17 00:00:00 2001 From: Loki <654612@qq.com> Date: Fri, 12 Nov 2021 14:49:30 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + common/notifyMsg.js | 55 +++++++++++++++++++++++++++++++++++++++ pages/activity/index.vue | 2 +- pages/index/addShop.vue | 52 +++--------------------------------- pages/index/addTask.vue | 46 +------------------------------- pages/index/shopIndex.vue | 55 +++------------------------------------ pages/member/chongzhi.vue | 2 +- pages/my/index.vue | 2 +- pages/my/ranking.vue | 2 +- pages/my/toExamine.vue | 2 +- pages/my/withdrawal.vue | 53 +++---------------------------------- pages/public/login.vue | 4 +-- pages/public/mobile.vue | 2 +- 13 files changed, 75 insertions(+), 203 deletions(-) create mode 100644 common/notifyMsg.js 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 @@