From 339502e7555890edb6e7763b31115c8fb070dc98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=99=96?= Date: Thu, 7 Mar 2019 19:01:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=BC=E5=9B=A2=E5=88=86=E4=BA=AB=E6=8E=88?= =?UTF-8?q?=E6=9D=83=E8=B7=B3=E8=BD=AC=E5=88=A4=E6=96=AD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/getphoneInfo/index.js | 16 +++++++++------- pages/getuserinfo/index.js | 15 +++++++++------ pages/index/index.js | 3 +++ pages/spellDetail/index.js | 4 ++-- pages/spellGroup/mySpellGroup/index.js | 2 +- pages/spellGroup/spellGroup.js | 2 +- 6 files changed, 25 insertions(+), 17 deletions(-) diff --git a/pages/getphoneInfo/index.js b/pages/getphoneInfo/index.js index b3985f4..1d72e69 100755 --- a/pages/getphoneInfo/index.js +++ b/pages/getphoneInfo/index.js @@ -9,9 +9,10 @@ Page({ paramData:null }, onLoad: function (options) { - if(options.path=='index'){ - this.path = options.path - } + console.log(options,98888) + this.setData({ + path: options.path + }) this.setData({ paramData: options }) @@ -62,20 +63,21 @@ Page({ /** * 来自拼团详情 */ - if (that.path == 'spell') { + console.log(that.data, 98888) + if (that.data.path == 'spell') { 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; } /** * fromId若存在来自卡转赠 */ - if (that.path == 'index' && !that.data.paramData.cuserId) { + if (that.data.path == 'index' && !that.data.paramData.cuserId) { wx.redirectTo({ 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({ 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 }) diff --git a/pages/getuserinfo/index.js b/pages/getuserinfo/index.js index 55a7b7a..d8a7e02 100755 --- a/pages/getuserinfo/index.js +++ b/pages/getuserinfo/index.js @@ -22,6 +22,11 @@ Page({ this.setData({ optionData:options }) + if (options&&options.path == 'index') { + that.setData({ + path: options.path + }) + } /** * 来自转赠 */ @@ -36,9 +41,6 @@ Page({ couponOrderId: options.couponOrderId }) } - if (options.path == 'index') { - that.path = options.path - } Http.get({ url: config.api.marketicon, data: { @@ -75,13 +77,14 @@ Page({ }) .then( function (res) { - console.log(res) + console.log(res, that.data,6666666666) if (that.data.optionData.orderGroupId){ 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({ url: "/pages/game/index" }); diff --git a/pages/index/index.js b/pages/index/index.js index 856ab9e..4298907 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -13,6 +13,7 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function(options) { + console.log(options,10001) let that = this; if (decodeURIComponent(options.scene) == "undefined") { that.setData({ @@ -40,6 +41,7 @@ Page({ wx.setStorageSync('imgurl', imgurl) app.getLocation(); if (options.couponChannelId || options.orderId) { + console.log(options,33333333333) that.userLogin(options); // if (options.cuserId){ // /** @@ -127,6 +129,7 @@ Page({ * 用户登录 */ userLogin: function (options) { + console.log(1111,options,2222222222) var that = this; // 登录 wx.login({ diff --git a/pages/spellDetail/index.js b/pages/spellDetail/index.js index 00dfb48..3b5ee37 100644 --- a/pages/spellDetail/index.js +++ b/pages/spellDetail/index.js @@ -168,8 +168,8 @@ Page({ let _this = this; return { 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) { // 转发成功 }, diff --git a/pages/spellGroup/mySpellGroup/index.js b/pages/spellGroup/mySpellGroup/index.js index 01bb501..eb45621 100644 --- a/pages/spellGroup/mySpellGroup/index.js +++ b/pages/spellGroup/mySpellGroup/index.js @@ -175,7 +175,7 @@ Page({ }) .then(res => { 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 => { diff --git a/pages/spellGroup/spellGroup.js b/pages/spellGroup/spellGroup.js index 8ba30ef..eccac13 100644 --- a/pages/spellGroup/spellGroup.js +++ b/pages/spellGroup/spellGroup.js @@ -51,7 +51,7 @@ Page({ console.log(e,333) let data = e.currentTarget.dataset.data 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}`, }) }, //切换我的拼团