diff --git a/pages/coupon/detail/index.js b/pages/coupon/detail/index.js index 99dc24f..8112c4e 100644 --- a/pages/coupon/detail/index.js +++ b/pages/coupon/detail/index.js @@ -101,7 +101,6 @@ Page({ isshowposter: false, }) }, - /** * 显示分享海报 */ @@ -590,46 +589,18 @@ Page({ } }) }, - checkPhoneStatus: function() { - let that = this; - Http.get({ - url: config.api.checkPhoneStatus, - data: {} - }) - .then(res => { - console.log(666, '授权成功!') - that.receiveCard() - }) - .catch(err => { - if (err.code == 11005) { - /** - * 手机号没有授权,将值传到用户手机号授权的页面 - * - */ - wx.redirectTo({ - url: "/pages/getphoneInfo/index?path=index&cuserId=" + that.data.cardData.cuserId + "&couponChannelId=" + that.data.cardData.couponChannelId + "&userName=" + that.data.cardData.userName + "&coverImg=" + that.data.cardData.coverImg + "&avatarUrl=" + that.data.cardData.avatarUrl + "&couponOrderId=" + that.data.cardData.couponOrderId + "&updateDate=" + that.data.cardData.updateDate, - }); - } else if (err.code == 11006) { - // 用户手机已加密 - wx.redirectTo({ - url: "/pages/phoneinput/phoneinput?path=index&cuserId=" + that.data.cardData.cuserId + "&couponChannelId=" + that.data.cardData.couponChannelId + "&userName=" + that.data.cardData.userName + "&coverImg=" + that.data.cardData.coverImg + "&avatarUrl=" + that.data.cardData.avatarUrl + "&couponOrderId=" + that.data.cardData.couponOrderId + "&updateDate=" + that.data.cardData.updateDate, - }); - } else { - wx.showToast({ - title: err.message, - icon: 'none', - duration: 2000, - mask: false - }); - } - }) - }, /** * 发起支付 */ orderFunc(discount) { let that = this; Http.get({ + url: config.api.checkUserStatus, + data: { + token: app.globalData.token + } + }).then(res => { + Http.get({ url: config.api.checkPhoneStatus, data: {} }) @@ -854,6 +825,20 @@ Page({ } } }) + }).catch(err => { + console.log(err) + if(err.code == 11004){ + wx.redirectTo({ + url: `/pages/getuserinfo/index?fromflag=coupondetail&couponChannelIdflag=${that.data.couponChannelId}`, + }) + }else{ + wx.showToast({ + title: err.message, + icon:"none", + duration:2500 + }) + } + }) }, // 获得未支付的订单 getUnPaidOrder(couponId){ diff --git a/pages/getphoneInfo/index.js b/pages/getphoneInfo/index.js index 12f0916..ecf514e 100755 --- a/pages/getphoneInfo/index.js +++ b/pages/getphoneInfo/index.js @@ -25,6 +25,7 @@ Page({ couponChannelId: options.couponChannelId }); } + if (options && options.mineFlag) { that.setData({ mineFlag: options.mineFlag diff --git a/pages/getuserinfo/index.js b/pages/getuserinfo/index.js index 083cec2..b47e34b 100755 --- a/pages/getuserinfo/index.js +++ b/pages/getuserinfo/index.js @@ -11,10 +11,25 @@ Page({ cuserId:null, coverImg:null, couponOrderId:null, - optionData:null + optionData:null, + fromflag:'', + couponChannelIdflag:'' }, onLoad: function(options) { var that = this; + // options.fromflag == 'coupondetail'; + // 来自优惠券详情页面 + if (options && options.fromflag){ + that.setData({ + fromflag: options.fromflag + }) + } + // 来自优惠券列表券详情页面的 couponChannelId + if (options && options.couponChannelIdflag) { + that.setData({ + couponChannelIdflag: options.couponChannelIdflag + }) + } if (options && options.spellGroup){ that.setData({ spellGroup: options.spellGroup @@ -256,7 +271,15 @@ Page({ wx.switchTab({ url: '/pages/index/searchbar/index' }); - } else { + } else if (that.data.fromflag == 'coupondetail' && that.data.couponChannelIdflag){ + wx.navigateTo({ + url: `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelIdflag}` + }); + } else if (that.data.fromflag == 'spellcoupondetail' && that.data.couponChannelIdflag) { + wx.navigateTo({ + url: `/pages/spellGroup/mySpellGroup/index?couponChannelId=${that.data.couponChannelIdflag}` + }); + }else { wx.switchTab({ url: "/pages/main/index" }); diff --git a/pages/getuserinfo/index.wxml b/pages/getuserinfo/index.wxml index 29bddca..d44cbff 100755 --- a/pages/getuserinfo/index.wxml +++ b/pages/getuserinfo/index.wxml @@ -1,4 +1,4 @@ - +