diff --git a/pages/getuserinfo/index.js b/pages/getuserinfo/index.js index bda8a3e..156071b 100755 --- a/pages/getuserinfo/index.js +++ b/pages/getuserinfo/index.js @@ -90,7 +90,7 @@ Page({ }); } else { //返回主页 - if (that.data.couponChannelId && !that.data.cuserId) { + if (that.data.couponChannelId && !that.data.cuserId&&app.globalData.type == 'cd') { wx.navigateTo({ url: `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelId}}` }); @@ -101,10 +101,34 @@ Page({ wx.reLaunch({ url: `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelId}&cuserId=${that.data.cuserId}&coverImg=${that.data.coverImg}&userName=${that.data.userName}&avatarUrl=${that.data.avatarUrl}&couponOrderId=${that.data.couponOrderId}&updateDate=${that.data.updateDate}` }); - } else if (that.data.orderId) { + } else if (that.data.orderId&&app.globalData.type=='bg') { wx.navigateTo({ url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${that.data.orderId}&from=${"friend"}` }); + } else if (app.globalData.type == 'uc') { + wx.switchTab({ + url: '/pages/user/index' + }); + } else if (app.globalData.type == 'pc') { + wx.switchTab({ + url: '/pages/passCar/passCar' + }); + } else if (app.globalData.type == 'co') { + wx.redirectTo({ + url: '/pages/couponorder/index/index' + }); + } else if (app.globalData.type == 'or') { + wx.redirectTo({ + url: '/pages/couponorder/index/index' + }); + } else if (app.globalData.type == 'sc') { + wx.redirectTo({ + url: '/pages/specialcourtesy/specialcourtesy' + }); + } else if (app.globalData.type == 'rb') { + wx.redirectTo({ + url: '/pages/rushToBuy/index' + }); } else { wx.switchTab({ url: "/pages/main/index" diff --git a/pages/index/index.js b/pages/index/index.js index 2374188..32268e5 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -13,8 +13,16 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function(options) { - console.log(options,10001) + console.log(options); let that = this; + /** + * 根据接收到的值,判断跳转到哪个页面 + */ + if(options&&options.type){ + app.globalData.type = options.type; + console.log(app.globalData.type) + } + // app.globalData.type = 'pc'; if (decodeURIComponent(options.scene) == "undefined") { that.setData({ scene: 0 @@ -40,7 +48,6 @@ Page({ options.path='daping' } } - console.log(options.couponChannelId) wx.showToast({ title: '加载中', icon: "loading", @@ -89,7 +96,7 @@ Page({ }); return; } - if (options&&options.couponChannelId && !options.cuserId) { + if (options && options.couponChannelId && !options.cuserId &&app.globalData.type == 'cd') { wx.redirectTo({ url: `/pages/coupon/detail/index?couponChannelId=${options.couponChannelId}`, }) @@ -100,10 +107,34 @@ Page({ wx.redirectTo({ url: `/pages/coupon/detail/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 &&options.orderId) { + } else if (options&&options.orderId&&app.globalData.type=='bg') { wx.redirectTo({ url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${options.orderId}&from='${"discount"}`, }) + } else if (app.globalData.type == 'uc'){ + wx.switchTab({ + url: '/pages/user/index' + }); + } else if (app.globalData.type == 'pc') { + wx.switchTab({ + url: '/pages/passCar/passCar' + }); + } else if (app.globalData.type == 'co') { + wx.redirectTo({ + url: '/pages/couponorder/index/index' + }); + } else if (app.globalData.type == 'or') { + wx.redirectTo({ + url: '/pages/couponorder/index/index' + }); + } else if (app.globalData.type == 'sc') { + wx.redirectTo({ + url: '/pages/specialcourtesy/specialcourtesy' + }); + }else if (app.globalData.type == 'rb') { + wx.redirectTo({ + url: '/pages/rushToBuy/index' + }); }else{ wx.switchTab({ url: '/pages/main/index'