diff --git a/pages/getuserinfo/index.js b/pages/getuserinfo/index.js index 6d2124f..55a7b7a 100755 --- a/pages/getuserinfo/index.js +++ b/pages/getuserinfo/index.js @@ -8,7 +8,8 @@ Page({ couponChannelId: null, cuserId:null, coverImg:null, - couponOrderId:null + couponOrderId:null, + optionData:null }, onLoad: function(options) { var that = this; @@ -18,6 +19,9 @@ Page({ orderId:options.orderId }) } + this.setData({ + optionData:options + }) /** * 来自转赠 */ @@ -72,6 +76,11 @@ Page({ .then( function (res) { console.log(res) + if (that.data.optionData.orderGroupId){ + wx.reLaunch({ + url: `/pages/joinFrDpell/index?couponId=${optionData.couponId}&orderGroupId=${optionData.orderGroupId}&couponChannelId=${optionData.couponChannelId}&orderId=${optionData.orderId}` + }); + } if (that.path == 'index') { wx.reLaunch({ url: "/pages/game/index" diff --git a/pages/index/index.js b/pages/index/index.js index 65b0cbe..856ab9e 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -64,6 +64,12 @@ Page({ data: {} }) .then(res => { + if (options && options.orderGroupId) { + wx.redirectTo({ + url: `/pages/joinFrDpell/index?couponId=${options.couponId}&orderGroupId=${options.orderGroupId}&couponChannelId=${options.couponChannelId}&orderId=${options.orderId}` + }) + return; + } if (options&&options.couponChannelId && !options.cuserId) { wx.redirectTo({ url: `/pages/coupon/detail/index?couponChannelId=${options.couponChannelId}`, @@ -88,18 +94,24 @@ Page({ .catch(err => { if (err.code == 11004) { // 用户昵称未授权 - if (options.couponChannelId && !options.cuserId) { + if (options && options.orderGroupId) { + wx.redirectTo({ + url: `/pages/getuserinfo/index?couponId=${options.couponId}&orderGroupId=${options.orderGroupId}&couponChannelId=${options.couponChannelId}&orderId=${options.orderId}` + }) + return; + } + if (options && options.couponChannelId && !options.cuserId) { wx.redirectTo({ url: `/pages/getuserinfo/index?couponChannelId=${options.couponChannelId}` }); - } else if (options.couponChannelId && options.cuserId){ + } else if (options &&options.couponChannelId && options.cuserId){ /** * 转赠判断 */ wx.redirectTo({ url: `/pages/getuserinfo/index?couponChannelId=${options.couponChannelId}&cuserId=${options.cuserId}&coverImg=${options.coverImg}&userName=${options.userName}&avatarUrl=${options.avatarUrl}&couponOrderId=${options.couponOrderId}&updateDate=${options.updateDate}` }); - } else if (options.orderId) { + } else if (options && options.orderId) { wx.redirectTo({ url: `/pages/getuserinfo/index?orderId=${options.orderId}&from='${"discount"}` }); diff --git a/pages/spellDetail/index.js b/pages/spellDetail/index.js index fcb434f..00dfb48 100644 --- a/pages/spellDetail/index.js +++ b/pages/spellDetail/index.js @@ -168,7 +168,7 @@ Page({ let _this = this; return { title: '拼团', - path: `/pages/index/index?couponId=${this.data.couponId}&orderGroupId=${this.data.orderGroupId}&couponChannelId=${this.data.couponChannelId}`, + path: `/pages/index/index?couponId=${this.data.couponId}&orderGroupId=${this.data.orderGroupId}&couponChannelId=${this.data.couponChannelId}&orderId=${this.data.orderId}`, imageUrl: this.data.data.coverImg, success: function (res) { // 转发成功