| @@ -40,39 +40,44 @@ Page({ | |||||
| wx.setStorageSync('imgurl', imgurl) | wx.setStorageSync('imgurl', imgurl) | ||||
| app.getLocation(); | app.getLocation(); | ||||
| if (options.couponChannelId || options.orderId) { | if (options.couponChannelId || options.orderId) { | ||||
| if (options.cuserId){ | |||||
| /** | |||||
| * 转赠判断 | |||||
| */ | |||||
| that.userLogin(options.couponChannelId, null, options.cuserId, options.coverImg, options.userName, options.avatarUrl, options.couponOrderId, options.updateDate); | |||||
| }else{ | |||||
| that.userLogin(options.couponChannelId, options.orderId); | |||||
| } | |||||
| that.userLogin(options); | |||||
| // if (options.cuserId){ | |||||
| // /** | |||||
| // * 转赠判断 | |||||
| // */ | |||||
| // // that.userLogin(options.couponChannelId, null, options.cuserId, options.coverImg, options.userName, options.avatarUrl, options.couponOrderId, options.updateDate); | |||||
| // that.userLogin(options.couponChannelId, null, options.cuserId, options.coverImg, options.userName, options.avatarUrl, options.couponOrderId, options.updateDate); | |||||
| // } else if (options.orderGroupId){ | |||||
| // // 来自于拼团 | |||||
| // that.userLogin(options.couponChannelId, null, options.orderGroupId); | |||||
| // }else{ | |||||
| // that.userLogin(options.couponChannelId, options.orderId); | |||||
| // } | |||||
| } else { | } else { | ||||
| that.userLogin() | that.userLogin() | ||||
| } | } | ||||
| }, | }, | ||||
| checkuerstatus(couponChannelId, orderId, cuserId, coverImg, userName, avatarUrl, couponOrderId, updateDate) { | |||||
| checkuerstatus(options) { | |||||
| let that = this; | let that = this; | ||||
| Http.post({ | Http.post({ | ||||
| url: config.api.checkUserStatus, | url: config.api.checkUserStatus, | ||||
| data: {} | data: {} | ||||
| }) | }) | ||||
| .then(res => { | .then(res => { | ||||
| if (couponChannelId && !cuserId) { | |||||
| if (options&&options.couponChannelId && !options.cuserId) { | |||||
| wx.redirectTo({ | wx.redirectTo({ | ||||
| url: `/pages/coupon/detail/index?couponChannelId=${couponChannelId}`, | |||||
| url: `/pages/coupon/detail/index?couponChannelId=${options.couponChannelId}`, | |||||
| }) | }) | ||||
| } else if (couponChannelId && cuserId){ | |||||
| } else if (options &&options.couponChannelId && options.cuserId){ | |||||
| /** | /** | ||||
| * 转赠判断 | * 转赠判断 | ||||
| */ | */ | ||||
| wx.redirectTo({ | wx.redirectTo({ | ||||
| url: `/pages/coupon/detail/index?couponChannelId=${couponChannelId}&cuserId=${cuserId}&coverImg=${coverImg}&userName=${userName}&avatarUrl=${avatarUrl}&couponOrderId=${couponOrderId}&updateDate=${updateDate}`, | |||||
| 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 (orderId) { | |||||
| } else if (options &&options.orderId) { | |||||
| wx.redirectTo({ | wx.redirectTo({ | ||||
| url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${orderId}&from='${"discount"}`, | |||||
| url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${options.orderId}&from='${"discount"}`, | |||||
| }) | }) | ||||
| }else{ | }else{ | ||||
| wx.switchTab({ | wx.switchTab({ | ||||
| @@ -109,7 +114,7 @@ Page({ | |||||
| /** | /** | ||||
| * 用户登录 | * 用户登录 | ||||
| */ | */ | ||||
| userLogin: function (couponChannelId, orderId, cuserId, coverImg, userName, avatarUrl, couponOrderId, updateDate) { | |||||
| userLogin: function (options) { | |||||
| var that = this; | var that = this; | ||||
| // 登录 | // 登录 | ||||
| wx.login({ | wx.login({ | ||||
| @@ -151,8 +156,8 @@ Page({ | |||||
| }) | }) | ||||
| app.globalData.token = res.data.token; | app.globalData.token = res.data.token; | ||||
| Http.setToken(res.data.token); | Http.setToken(res.data.token); | ||||
| if (couponChannelId || orderId){ | |||||
| that.checkuerstatus(couponChannelId, orderId, cuserId, coverImg, userName, avatarUrl, couponOrderId, updateDate); | |||||
| if (options&&(options.couponChannelId || options.orderId)){ | |||||
| that.checkuerstatus(options); | |||||
| }else{ | }else{ | ||||
| that.checkuerstatus(); | that.checkuerstatus(); | ||||
| } | } | ||||