|
|
@@ -28,6 +28,8 @@ Page({ |
|
|
|
*/ |
|
|
|
onLoad: function(options) { |
|
|
|
var that = this; |
|
|
|
console.log(options); |
|
|
|
console.log("这是options") |
|
|
|
var scene = decodeURIComponent(options.scene); |
|
|
|
that.setData({ |
|
|
|
scene:scene |
|
|
@@ -35,7 +37,11 @@ Page({ |
|
|
|
console.log(that.data.scene) |
|
|
|
console.log(scene); |
|
|
|
app.getLocation(); |
|
|
|
that.userLogin(); |
|
|
|
if (options.couponChannelId && options.couponId){ |
|
|
|
that.userLogin(options.couponChannelId, options.couponId); |
|
|
|
}else{ |
|
|
|
that.userLogin() |
|
|
|
} |
|
|
|
Http.get({ |
|
|
|
url: config.api.getWeapNote, |
|
|
|
data: { |
|
|
@@ -88,7 +94,7 @@ Page({ |
|
|
|
/** |
|
|
|
* 用户登录 |
|
|
|
*/ |
|
|
|
userLogin: function() { |
|
|
|
userLogin: function (couponChannelId,couponId) { |
|
|
|
var that = this; |
|
|
|
// 登录 |
|
|
|
wx.login({ |
|
|
@@ -127,6 +133,11 @@ Page({ |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
app.globalData.token = res.data.token; |
|
|
|
if (res.data.token && couponChannelId && couponId){ |
|
|
|
wx.navigateTo({ |
|
|
|
url: `/pages/coupon/detail/index?couponChannelId=${couponChannelId}&couponId=${couponId}`, |
|
|
|
}) |
|
|
|
} |
|
|
|
if (res.data.token){ |
|
|
|
that.setData({ |
|
|
|
showGame: true |
|
|
|