|
|
@@ -32,22 +32,36 @@ Page({ |
|
|
|
} |
|
|
|
app.getLocation(); |
|
|
|
if (options.couponChannelId && options.couponId || options.orderId) { |
|
|
|
that.userLogin(options.couponChannelId, options.couponId, options.orderId); |
|
|
|
if (options.cuserId){ |
|
|
|
/** |
|
|
|
* 转赠判断 |
|
|
|
*/ |
|
|
|
that.userLogin(options.couponChannelId, options.couponId, null, options.cuserId, options.coverImg); |
|
|
|
}else{ |
|
|
|
that.userLogin(options.couponChannelId, options.couponId, options.orderId); |
|
|
|
} |
|
|
|
} else { |
|
|
|
that.userLogin() |
|
|
|
} |
|
|
|
}, |
|
|
|
checkuerstatus(couponChannelId, couponId, orderId) { |
|
|
|
checkuerstatus(couponChannelId, couponId, orderId, cuserId, coverImg) { |
|
|
|
let that = this; |
|
|
|
Http.post({ |
|
|
|
url: config.api.checkUserStatus, |
|
|
|
data: {} |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
if (couponChannelId && couponId) { |
|
|
|
if (couponChannelId && couponId && !cuserId) { |
|
|
|
wx.redirectTo({ |
|
|
|
url: `/pages/coupon/detail/index?couponChannelId=${couponChannelId}&couponId=${couponId}`, |
|
|
|
}) |
|
|
|
} else if (couponChannelId && couponId && cuserId){ |
|
|
|
/** |
|
|
|
* 转赠判断 |
|
|
|
*/ |
|
|
|
wx.redirectTo({ |
|
|
|
url: `/pages/coupon/detail/index?couponChannelId=${couponChannelId}&couponId=${couponId}&cuserId=${cuserId}&coverImg=${coverImg}`, |
|
|
|
}) |
|
|
|
} else if (orderId) { |
|
|
|
wx.redirectTo({ |
|
|
|
url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${orderId}&from='${"discount"}`, |
|
|
@@ -80,7 +94,7 @@ Page({ |
|
|
|
/** |
|
|
|
* 用户登录 |
|
|
|
*/ |
|
|
|
userLogin: function(couponChannelId, couponId, orderId) { |
|
|
|
userLogin: function (couponChannelId, couponId, orderId, cuserId) { |
|
|
|
var that = this; |
|
|
|
// 登录 |
|
|
|
wx.login({ |
|
|
@@ -123,7 +137,7 @@ Page({ |
|
|
|
app.globalData.token = res.data.token; |
|
|
|
Http.setToken(res.data.token); |
|
|
|
if (couponChannelId&&couponId || orderId){ |
|
|
|
that.checkuerstatus(couponChannelId, couponId, orderId); |
|
|
|
that.checkuerstatus(couponChannelId, couponId, orderId, cuserId, coverImg); |
|
|
|
}else{ |
|
|
|
that.checkuerstatus(); |
|
|
|
} |
|
|
|