|
@@ -6,10 +6,10 @@ Page({ |
|
|
canIUse: wx.canIUse("button.open-type.getPhoneNumber"), |
|
|
canIUse: wx.canIUse("button.open-type.getPhoneNumber"), |
|
|
couponChannelId: "", |
|
|
couponChannelId: "", |
|
|
path:null, |
|
|
path:null, |
|
|
paramData:null |
|
|
|
|
|
|
|
|
paramData:null, |
|
|
|
|
|
signActivity:"" |
|
|
}, |
|
|
}, |
|
|
onLoad: function (options) { |
|
|
onLoad: function (options) { |
|
|
console.log(options,98888) |
|
|
|
|
|
this.setData({ |
|
|
this.setData({ |
|
|
path: options.path |
|
|
path: options.path |
|
|
}) |
|
|
}) |
|
@@ -23,6 +23,11 @@ Page({ |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (options.signActivity){ |
|
|
|
|
|
that.setData({ |
|
|
|
|
|
signActivity: options.signActivity |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
Http.get({ |
|
|
Http.get({ |
|
|
url: config.api.marketicon, |
|
|
url: config.api.marketicon, |
|
@@ -57,73 +62,72 @@ Page({ |
|
|
encryptedData: encryptedData, |
|
|
encryptedData: encryptedData, |
|
|
iv: iv |
|
|
iv: iv |
|
|
} |
|
|
} |
|
|
}).then( |
|
|
|
|
|
function (res) { |
|
|
|
|
|
app.globalData.phone = res.data.phone; |
|
|
|
|
|
/** |
|
|
|
|
|
* 来自积分兑换 |
|
|
|
|
|
*/ |
|
|
|
|
|
if (that.data.path == 'jifen') { |
|
|
|
|
|
|
|
|
}).then(res=>{ |
|
|
|
|
|
app.globalData.phone = res.data.phone; |
|
|
|
|
|
/** |
|
|
|
|
|
* 来自积分兑换 |
|
|
|
|
|
*/ |
|
|
|
|
|
if (that.data.path == 'jifen') { |
|
|
|
|
|
wx.redirectTo({ |
|
|
|
|
|
url: `/pages/integralmall/payIntegcoupondetail/index?couponChannelId=${that.data.paramData.couponChannelId}&couponId=${that.data.paramData.couponId}` |
|
|
|
|
|
}) |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
/** |
|
|
|
|
|
* 来自拼团详情 |
|
|
|
|
|
*/ |
|
|
|
|
|
if (that.data.path == 'spell') { |
|
|
|
|
|
if (that.data.paramData.avatarUrl) { |
|
|
wx.redirectTo({ |
|
|
wx.redirectTo({ |
|
|
url: `/pages/integralmall/payIntegcoupondetail/index?couponChannelId=${that.data.paramData.couponChannelId}&couponId=${that.data.paramData.couponId}` |
|
|
|
|
|
|
|
|
url: `/pages/joinFrDpell/index?couponId=${that.data.paramData.couponId}&orderGroupId=${that.data.paramData.orderGroupId}&couponChannelId=${that.data.paramData.couponChannelId}&orderId=${that.data.paramData.orderId}&avatarUrl=${that.data.paramData.avatarUrl}&nickName=${that.data.paramData.nickName}` |
|
|
}) |
|
|
}) |
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
/** |
|
|
|
|
|
* 来自拼团详情 |
|
|
|
|
|
*/ |
|
|
|
|
|
console.log(that.data, 98888) |
|
|
|
|
|
if (that.data.path == 'spell') { |
|
|
|
|
|
if (that.data.paramData.avatarUrl){ |
|
|
|
|
|
wx.redirectTo({ |
|
|
|
|
|
url: `/pages/joinFrDpell/index?couponId=${that.data.paramData.couponId}&orderGroupId=${that.data.paramData.orderGroupId}&couponChannelId=${that.data.paramData.couponChannelId}&orderId=${that.data.paramData.orderId}&avatarUrl=${that.data.paramData.avatarUrl}&nickName=${that.data.paramData.nickName}` |
|
|
|
|
|
}) |
|
|
|
|
|
}else{ |
|
|
|
|
|
wx.redirectTo({ |
|
|
|
|
|
url: `/pages/spellGroup/mySpellGroup/index?couponId=${that.data.paramData.couponId}&couponChannelId=${that.data.paramData.couponChannelId}` |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
/** |
|
|
|
|
|
* fromId若存在来自卡转赠 |
|
|
|
|
|
*/ |
|
|
|
|
|
if (that.data.path == 'index' && !that.data.paramData.cuserId) { |
|
|
|
|
|
|
|
|
} else { |
|
|
wx.redirectTo({ |
|
|
wx.redirectTo({ |
|
|
url: "/pages/game/index?url=" + that.data.paramData.url + "&id=" + that.data.paramData.id + "&gameId=" + that.data.paramData.gameId, |
|
|
|
|
|
}) |
|
|
|
|
|
} 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 |
|
|
|
|
|
|
|
|
url: `/pages/spellGroup/mySpellGroup/index?couponId=${that.data.paramData.couponId}&couponChannelId=${that.data.paramData.couponChannelId}` |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
|
|
|
wx.showToast({ |
|
|
|
|
|
title: res.data.msg, |
|
|
|
|
|
icon: "success", |
|
|
|
|
|
success: function (res) { |
|
|
|
|
|
if (that.data.couponChannelId) { |
|
|
|
|
|
wx.redirectTo({ |
|
|
|
|
|
url: "/pages/coupon/detail/index?couponChannelId=" +that.data.couponChannelId +"&flag=pay" |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
wx.switchTab({ |
|
|
|
|
|
url: '/pages/passCar/passCar', |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
} |
|
|
}, |
|
|
|
|
|
function (error) { |
|
|
|
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
/** |
|
|
|
|
|
* fromId若存在来自卡转赠 |
|
|
|
|
|
*/ |
|
|
|
|
|
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.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 |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
/** |
|
|
|
|
|
* 活动报名 |
|
|
|
|
|
*/ |
|
|
|
|
|
else if (that.data.signActivity) { |
|
|
|
|
|
wx.redirectTo({ |
|
|
|
|
|
url: `/pages/radetail/joinActivity/edit?activityId=${that.data.signActivity}` |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
wx.showToast({ |
|
|
wx.showToast({ |
|
|
title: "请重新授权手机号", |
|
|
|
|
|
icon: "none" |
|
|
|
|
|
|
|
|
title: res.data.msg, |
|
|
|
|
|
icon: "success", |
|
|
|
|
|
success: function (res) { |
|
|
|
|
|
if (that.data.couponChannelId) { |
|
|
|
|
|
wx.redirectTo({ |
|
|
|
|
|
url: "/pages/coupon/detail/index?couponChannelId=" + that.data.couponChannelId + "&flag=pay" |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
wx.switchTab({ |
|
|
|
|
|
url: '/pages/passCar/passCar', |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
) |
|
|
|
|
|
|
|
|
}) |
|
|
.catch(err => { |
|
|
.catch(err => { |
|
|
wx.showToast({ |
|
|
wx.showToast({ |
|
|
title: err.errMsg, |
|
|
|
|
|
|
|
|
title: err.message, |
|
|
icon: 'none', |
|
|
icon: 'none', |
|
|
duration: 2000, |
|
|
duration: 2000, |
|
|
mask: false |
|
|
mask: false |
|
|