From 375bd19c04bd5b7ba5407c0bc61c712f70acad43 Mon Sep 17 00:00:00 2001 From: ZhaoTongYao <531131322@qq.com> Date: Mon, 10 May 2021 17:20:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=BC=E5=9B=A2=E8=B4=AD=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=86=E4=BA=AB=E5=8A=9F=E8=83=BD=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/heartNew/heartNew.js | 54 ++++++++++--------- .../pages/groupBuyDetail/groupBuyDetail.js | 9 ++-- 2 files changed, 36 insertions(+), 27 deletions(-) diff --git a/pages/heartNew/heartNew.js b/pages/heartNew/heartNew.js index 3402473..57d24a0 100644 --- a/pages/heartNew/heartNew.js +++ b/pages/heartNew/heartNew.js @@ -58,6 +58,7 @@ Page({ gid: "", // indexNew isVolunteer: false, // 通过接口获取判断是否已注册过志愿者 defaultGridId: '', // 默认网格id 用于默认注册未注册的用户 + detailId: '', // 通过分享进入 团购详情的id }, /** @@ -571,16 +572,16 @@ Page({ //2021.04.07 志愿者独立小程序 indexNew indexNew (options) { this.getResidentConfig() - // if (options.shareType) { - // const para = { - // shareType: options.shareType, - // id: options.id, - // detailId: options.detailId, - // type: options.type ? options.type : "", - // defaultGridId: options.defaultGridId ? options.defaultGridId : "", - // } - // wx.setStorageSync("shareObj", JSON.stringify(para)) - // } + if (options.shareType) { + const para = { + shareType: options.shareType, + // id: options.id, + detailId: options.detailId, + // type: options.type ? options.type : "", + // defaultGridId: options.defaultGridId ? options.defaultGridId : "", + } + wx.setStorageSync("shareObj", JSON.stringify(para)) + } // if (options.scene) { // if (options.scene == 'module_ma_code_zyzqn' || options.scene == 'module_ma_code_lbzx') { // this.setData({ @@ -670,19 +671,24 @@ Page({ // } else if (that.data.sceneFrom == 'module_ma_code_lbzx') { // //that.toLaoBingZaiXian(1) // } - // if (wx.getStorageSync("shareObj")) { - // const para = JSON.parse(wx.getStorageSync("shareObj")) - // if (para.shareType === "heartDetail") { - // wx.navigateTo({ - // url: `/subpages/heart/pages/heartDetail/heartDetail?id=${para.id}` - // }) - // } else if (para.shareType === 'newsDetail') { - // wx.navigateTo({ - // url: `/subpages/home/pages/newsDetail/newsDetail?id=${para.detailId}` - // }) - // } - // wx.removeStorageSync("shareObj") - // } + if (wx.getStorageSync("shareObj")) { + const para = JSON.parse(wx.getStorageSync("shareObj")) + // if (para.shareType === "heartDetail") { + // wx.navigateTo({ + // url: `/subpages/heart/pages/heartDetail/heartDetail?id=${para.id}` + // }) + // } else if (para.shareType === 'newsDetail') { + // wx.navigateTo({ + // url: `/subpages/home/pages/newsDetail/newsDetail?id=${para.detailId}` + // }) + // } + if (para.shareType === 'groupBuyDetail') { + wx.navigateTo({ + url: `/subpages/heart/pages/groupBuyDetail/groupBuyDetail?id=${para.detailId}` + }) + } + wx.removeStorageSync("shareObj") + } that.onLoadConfig() } // } @@ -721,7 +727,7 @@ Page({ app.globalData.infoCompleted = state wx.removeStorageSync("token") wx.setStorageSync("token", res.data.token) - that.onLoadConfig() + that.getUserState() }) } } diff --git a/subpages/heart/pages/groupBuyDetail/groupBuyDetail.js b/subpages/heart/pages/groupBuyDetail/groupBuyDetail.js index e809786..8ab6416 100644 --- a/subpages/heart/pages/groupBuyDetail/groupBuyDetail.js +++ b/subpages/heart/pages/groupBuyDetail/groupBuyDetail.js @@ -92,9 +92,12 @@ Page({ /** * 用户点击右上角分享 */ - // onShareAppMessage: function () { - - // }, + onShareAppMessage: function () { + return { + title: '拼团购-团购详情', + path: `/pages/heartNew/heartNew?shareType=groupBuyDetail&detailId=${this.data.noticeId}` + } + }, //列表照片的放大查看 previewImage (e) {