| @@ -9,9 +9,10 @@ Page({ | |||||
| paramData:null | paramData:null | ||||
| }, | }, | ||||
| onLoad: function (options) { | onLoad: function (options) { | ||||
| if(options.path=='index'){ | |||||
| this.path = options.path | |||||
| } | |||||
| console.log(options,98888) | |||||
| this.setData({ | |||||
| path: options.path | |||||
| }) | |||||
| this.setData({ | this.setData({ | ||||
| paramData: options | paramData: options | ||||
| }) | }) | ||||
| @@ -62,20 +63,21 @@ Page({ | |||||
| /** | /** | ||||
| * 来自拼团详情 | * 来自拼团详情 | ||||
| */ | */ | ||||
| if (that.path == 'spell') { | |||||
| console.log(that.data, 98888) | |||||
| if (that.data.path == 'spell') { | |||||
| wx.redirectTo({ | wx.redirectTo({ | ||||
| url: "pages/spellGroup/mySpellGroup/index?couponChannelId=" + that.data.paramData.couponChannelId + "&couponId" + that.data.paramData.couponId | |||||
| url: "/pages/spellGroup/mySpellGroup/index?couponChannelId=" + that.data.paramData.couponChannelId + "&couponId=" + that.data.paramData.couponId | |||||
| }) | }) | ||||
| return; | return; | ||||
| } | } | ||||
| /** | /** | ||||
| * fromId若存在来自卡转赠 | * fromId若存在来自卡转赠 | ||||
| */ | */ | ||||
| if (that.path == 'index' && !that.data.paramData.cuserId) { | |||||
| if (that.data.path == 'index' && !that.data.paramData.cuserId) { | |||||
| wx.redirectTo({ | wx.redirectTo({ | ||||
| url: "/pages/game/index?url=" + that.data.paramData.url + "&id=" + that.data.paramData.id + "&gameId=" + that.data.paramData.gameId, | url: "/pages/game/index?url=" + that.data.paramData.url + "&id=" + that.data.paramData.id + "&gameId=" + that.data.paramData.gameId, | ||||
| }) | }) | ||||
| } else if (that.path == 'index' && that.data.paramData.cuserId){ | |||||
| } else if (that.data.path == 'index' && that.data.paramData.cuserId){ | |||||
| wx.reLaunch({ | wx.reLaunch({ | ||||
| url: "/pages/coupon/detail/index?cuserId=" + that.data.paramData.cuserId + '&couponChannelId=' + that.data.paramData.couponChannelId + '&coverImg=' + that.data.paramData.coverImg + '&avatarUrl=' + that.data.paramData.avatarUrl + '&userName=' + that.data.paramData.userName + '&couponOrderId=' + that.data.paramData.couponOrderId + "&updateDate=" + that.data.paramData.updateDate | url: "/pages/coupon/detail/index?cuserId=" + that.data.paramData.cuserId + '&couponChannelId=' + that.data.paramData.couponChannelId + '&coverImg=' + that.data.paramData.coverImg + '&avatarUrl=' + that.data.paramData.avatarUrl + '&userName=' + that.data.paramData.userName + '&couponOrderId=' + that.data.paramData.couponOrderId + "&updateDate=" + that.data.paramData.updateDate | ||||
| }) | }) | ||||
| @@ -22,6 +22,11 @@ Page({ | |||||
| this.setData({ | this.setData({ | ||||
| optionData:options | optionData:options | ||||
| }) | }) | ||||
| if (options&&options.path == 'index') { | |||||
| that.setData({ | |||||
| path: options.path | |||||
| }) | |||||
| } | |||||
| /** | /** | ||||
| * 来自转赠 | * 来自转赠 | ||||
| */ | */ | ||||
| @@ -36,9 +41,6 @@ Page({ | |||||
| couponOrderId: options.couponOrderId | couponOrderId: options.couponOrderId | ||||
| }) | }) | ||||
| } | } | ||||
| if (options.path == 'index') { | |||||
| that.path = options.path | |||||
| } | |||||
| Http.get({ | Http.get({ | ||||
| url: config.api.marketicon, | url: config.api.marketicon, | ||||
| data: { | data: { | ||||
| @@ -75,13 +77,14 @@ Page({ | |||||
| }) | }) | ||||
| .then( | .then( | ||||
| function (res) { | function (res) { | ||||
| console.log(res) | |||||
| console.log(res, that.data,6666666666) | |||||
| if (that.data.optionData.orderGroupId){ | if (that.data.optionData.orderGroupId){ | ||||
| wx.reLaunch({ | wx.reLaunch({ | ||||
| url: `/pages/joinFrDpell/index?couponId=${optionData.couponId}&orderGroupId=${optionData.orderGroupId}&couponChannelId=${optionData.couponChannelId}&orderId=${optionData.orderId}` | |||||
| url: `/pages/joinFrDpell/index?couponId=${that.data.optionData.couponId}&orderGroupId=${that.data.optionData.orderGroupId}&couponChannelId=${that.data.optionData.couponChannelId}&orderId=${that.data.optionData.orderId}` | |||||
| }); | }); | ||||
| return; | |||||
| } | } | ||||
| if (that.path == 'index') { | |||||
| if (that.data.path == 'index') { | |||||
| wx.reLaunch({ | wx.reLaunch({ | ||||
| url: "/pages/game/index" | url: "/pages/game/index" | ||||
| }); | }); | ||||
| @@ -13,6 +13,7 @@ Page({ | |||||
| * 生命周期函数--监听页面加载 | * 生命周期函数--监听页面加载 | ||||
| */ | */ | ||||
| onLoad: function(options) { | onLoad: function(options) { | ||||
| console.log(options,10001) | |||||
| let that = this; | let that = this; | ||||
| if (decodeURIComponent(options.scene) == "undefined") { | if (decodeURIComponent(options.scene) == "undefined") { | ||||
| that.setData({ | that.setData({ | ||||
| @@ -40,6 +41,7 @@ Page({ | |||||
| wx.setStorageSync('imgurl', imgurl) | wx.setStorageSync('imgurl', imgurl) | ||||
| app.getLocation(); | app.getLocation(); | ||||
| if (options.couponChannelId || options.orderId) { | if (options.couponChannelId || options.orderId) { | ||||
| console.log(options,33333333333) | |||||
| that.userLogin(options); | that.userLogin(options); | ||||
| // if (options.cuserId){ | // if (options.cuserId){ | ||||
| // /** | // /** | ||||
| @@ -127,6 +129,7 @@ Page({ | |||||
| * 用户登录 | * 用户登录 | ||||
| */ | */ | ||||
| userLogin: function (options) { | userLogin: function (options) { | ||||
| console.log(1111,options,2222222222) | |||||
| var that = this; | var that = this; | ||||
| // 登录 | // 登录 | ||||
| wx.login({ | wx.login({ | ||||
| @@ -168,8 +168,8 @@ Page({ | |||||
| let _this = this; | let _this = this; | ||||
| return { | return { | ||||
| title: '拼团', | title: '拼团', | ||||
| 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, | |||||
| path: `/pages/index/index?couponId=${_this.data.data.couponId}&orderGroupId=${_this.data.data.orderGroupId}&couponChannelId=${_this.data.paramData.couponChannelId}&orderId=${_this.data.data.orderId}`, | |||||
| imageUrl: _this.data.data.coverImg, | |||||
| success: function (res) { | success: function (res) { | ||||
| // 转发成功 | // 转发成功 | ||||
| }, | }, | ||||
| @@ -175,7 +175,7 @@ Page({ | |||||
| }) | }) | ||||
| .then(res => { | .then(res => { | ||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: `/pages/spellDetail/index?orderId=${orderId}&couponId=${_this.data.data.couponId}&orderGroupId=${res.data.orderGroupId}` | |||||
| url: `/pages/spellDetail/index?orderId=${orderId}&couponId=${_this.data.data.couponId}&orderGroupId=${res.data.orderGroupId}&couponChannelId=${_this.data.couponChannelId}` | |||||
| }); | }); | ||||
| }) | }) | ||||
| .catch(err => { | .catch(err => { | ||||
| @@ -51,7 +51,7 @@ Page({ | |||||
| console.log(e,333) | console.log(e,333) | ||||
| let data = e.currentTarget.dataset.data | let data = e.currentTarget.dataset.data | ||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: `/pages/spellDetail/index?orderId=${data.orderId}&couponId=${data.couponId}&orderGroupId=${data.orderGroupId}`, | |||||
| url: `/pages/spellDetail/index?orderId=${data.orderId}&couponId=${data.couponId}&orderGroupId=${data.orderGroupId}&couponChannelId=${data.couponChannelId}`, | |||||
| }) | }) | ||||
| }, | }, | ||||
| //切换我的拼团 | //切换我的拼团 | ||||