From 615f731c381392a2eb2020dacc651644053a47b7 Mon Sep 17 00:00:00 2001 From: mixtan <424491071@qq.com> Date: Fri, 10 Oct 2025 14:32:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 6 +++- member/order/detail.vue | 69 +++++++++++++++++++++-------------------- pages/index/index.vue | 39 ++++++++++++++++++++--- 3 files changed, 75 insertions(+), 39 deletions(-) diff --git a/main.js b/main.js index e115c5a..83624e6 100644 --- a/main.js +++ b/main.js @@ -38,7 +38,11 @@ Vue.prototype.sprintf = $.sprintf Vue.prototype.number_format = $.number_format Vue.prototype.mf = $.mf Vue.prototype.statecode = Statecode -Vue.prototype.bdMapAk = "j2XbIbapUzLD0ycnJa6Cc5T7lppsxvMJ" +Vue.prototype.bdMapAk = "j2XbIbapUzLD0ycnJa6Cc5T7lppsxvMJ"; +Vue.prototype.tmplIds = [ + "kiDj_hSF_ASwD-Dlgxnypi6IJBQZ12a-hEpd3zZ-Uxc", + "Lq6_OHOemtmBoWGrd9zvyJ3ultzXB5metmqPtYeV0pc", + ]; //Vue.prototype.$mysocket = mysocket; Vue.prototype.$Socket = Socket; Vue.prototype.$apiconfig = apiconfig; diff --git a/member/order/detail.vue b/member/order/detail.vue index 3dd1312..c9518f1 100644 --- a/member/order/detail.vue +++ b/member/order/detail.vue @@ -1201,10 +1201,10 @@ export default { time: null, isReminderOrder: false, subscribe: 0, - tmplIds: [ - "kiDj_hSF_ASwD-Dlgxnypi6IJBQZ12a-hEpd3zZ-Uxc", - "Lq6_OHOemtmBoWGrd9zvyJ3ultzXB5metmqPtYeV0pc", - ], + // tmplIds: [ + // "kiDj_hSF_ASwD-Dlgxnypi6IJBQZ12a-hEpd3zZ-Uxc", + // "Lq6_OHOemtmBoWGrd9zvyJ3ultzXB5metmqPtYeV0pc", + // ], }; }, components: { @@ -1259,36 +1259,37 @@ export default { onShow: function () { const _this = this; this.InitPage(this.options); - // setTimeout(() => { - // try { - // if (this.subscribe == 1) { - // $.showModal({ - // title: "订阅提示", - // content: "是否订阅活动消息通知?", - // cancelText: "暂不订阅", - // confirmText: "立即订阅", - // success: function (n) { - // if (n.confirm) { - // wx.requestSubscribeMessage({ - // tmplIds: _this.tmplIds, - // success(res) { - // console.log("success res====", res); - // uni.showToast({ - // title: "消息已订阅", - // }); - // }, - // fail(res) { - // uni.showToast({ - // title: "稍后再试", - // }); - // }, - // }); - // } - // }, - // }); - // } - // } catch (error) {} - // }, 500); + setTimeout(() => { + try { + if (this.subscribe == 1) { + $.showModal({ + title: "订阅提示", + content: "是否订阅活动消息通知?", + cancelText: "暂不订阅", + confirmText: "立即订阅", + success: function (n) { + if (n.confirm) { + wx.requestSubscribeMessage({ + tmplIds: _this.tmplIds, + success(res) { + console.log("success res====", res); + // uni.showToast({ + // title: "消息已订阅", + // }); + }, + fail(res) { + console.log("fail res====", res); + // uni.showToast({ + // title: "稍后再试", + // }); + }, + }); + } + }, + }); + } + } catch (error) {} + }, 500); }, onUnload: function () { //移除通知 diff --git a/pages/index/index.vue b/pages/index/index.vue index fb69634..8086f93 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -526,6 +526,7 @@ export default { borderColor: "#dfdfdf", fontColor: "#fff", backgroundColor: "transparent", + provinceData: [], cityData: [], areaData: [], @@ -625,6 +626,36 @@ export default { ); that.notice.addNotification("RefreshSubsite", that.RefreshSubsite, that); that.notice.addNotification("ScanCode", that.onScanCode, that); + + setTimeout(() => { + try { + $.showModal({ + title: "订阅提示", + content: "是否订阅活动消息通知?", + cancelText: "暂不订阅", + confirmText: "立即订阅", + success: function (n) { + if (n.confirm) { + wx.requestSubscribeMessage({ + tmplIds: that.tmplIds, + success(res) { + console.log("success res====", res); + // uni.showToast({ + // title: "消息已订阅", + // }); + }, + fail(res) { + console.log("fail res====", res); + // uni.showToast({ + // title: "稍后再试", + // }); + }, + }); + } + }, + }); + } catch (error) {} + }, 1000); }, /** @@ -636,9 +667,9 @@ export default { * 生命周期函数--监听页面显示 */ onShow: function () { - let that = this; + let _this = this; this.getAppDistrict(); - //that.$.isNull(that.plantformInfo) || uni.setNavigationBarTitle({title: that.plantformInfo.name}); + //_this.$.isNull(_this.plantformInfo) || uni.setNavigationBarTitle({title: _this.plantformInfo.name}); //this.refresh || this.setData({refresh: true}) this.showCartNum(); @@ -653,10 +684,10 @@ export default { if (currentAddress) { this.address = currentAddress.name; } else { - that.isPhoneLocationEnabled(); + _this.isPhoneLocationEnabled(); } - that.resetLang(); + _this.resetLang(); }, /**