|
@@ -10,6 +10,9 @@ Page({ |
|
|
desc:'', |
|
|
desc:'', |
|
|
scrollTop: 0, |
|
|
scrollTop: 0, |
|
|
showGame:false, |
|
|
showGame:false, |
|
|
|
|
|
gamedata:{}, |
|
|
|
|
|
couponId:'',//游戏返回时传回的字段 |
|
|
|
|
|
played:false,//从游戏页面跳回首页返回true |
|
|
page: 1 // 刷新进入页面时已经加载了第一页数据,onReachBottom时 page++,从第2页开始加载 |
|
|
page: 1 // 刷新进入页面时已经加载了第一页数据,onReachBottom时 page++,从第2页开始加载 |
|
|
}, |
|
|
}, |
|
|
swiperChange: function(e) { |
|
|
swiperChange: function(e) { |
|
@@ -27,6 +30,12 @@ Page({ |
|
|
* 生命周期函数--监听页面初次渲染完成 |
|
|
* 生命周期函数--监听页面初次渲染完成 |
|
|
*/ |
|
|
*/ |
|
|
onLoad: function(options) { |
|
|
onLoad: function(options) { |
|
|
|
|
|
console.log(options,2222222) |
|
|
|
|
|
if(options.played=="true"){ |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
played:true |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
var that = this; |
|
|
var that = this; |
|
|
console.log(options); |
|
|
console.log(options); |
|
|
console.log("这是options") |
|
|
console.log("这是options") |
|
@@ -34,8 +43,8 @@ Page({ |
|
|
that.setData({ |
|
|
that.setData({ |
|
|
scene:scene |
|
|
scene:scene |
|
|
}); |
|
|
}); |
|
|
console.log(that.data.scene) |
|
|
|
|
|
console.log(scene); |
|
|
|
|
|
|
|
|
// console.log(that.data.scene) |
|
|
|
|
|
// console.log(scene); |
|
|
app.getLocation(); |
|
|
app.getLocation(); |
|
|
if (options.couponChannelId && options.couponId){ |
|
|
if (options.couponChannelId && options.couponId){ |
|
|
that.userLogin(options.couponChannelId, options.couponId); |
|
|
that.userLogin(options.couponChannelId, options.couponId); |
|
@@ -49,9 +58,9 @@ Page({ |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
.then(res=>{ |
|
|
.then(res=>{ |
|
|
console.log(res.data.weapNote); |
|
|
|
|
|
|
|
|
// console.log(res.data.weapNote); |
|
|
let weapNote = JSON.parse(res.data.weapNote); |
|
|
let weapNote = JSON.parse(res.data.weapNote); |
|
|
console.log(weapNote.firstpage); |
|
|
|
|
|
|
|
|
// console.log(weapNote.firstpage); |
|
|
that.setData({ |
|
|
that.setData({ |
|
|
desc: weapNote.firstpage.desc, |
|
|
desc: weapNote.firstpage.desc, |
|
|
title: weapNote.firstpage.title |
|
|
title: weapNote.firstpage.title |
|
@@ -72,11 +81,11 @@ Page({ |
|
|
onPullDownRefresh: function(e) { |
|
|
onPullDownRefresh: function(e) { |
|
|
let that = this; |
|
|
let that = this; |
|
|
that.userLogin(); |
|
|
that.userLogin(); |
|
|
console.log(this.data.code); |
|
|
|
|
|
|
|
|
// console.log(this.data.code); |
|
|
if (that.data.code == 0 || that.data.code == undefined) { |
|
|
if (that.data.code == 0 || that.data.code == undefined) { |
|
|
that.selectComponent("#lists").getList(0, 1); |
|
|
that.selectComponent("#lists").getList(0, 1); |
|
|
wx.stopPullDownRefresh(); |
|
|
wx.stopPullDownRefresh(); |
|
|
console.log("下拉刷新"); |
|
|
|
|
|
|
|
|
// console.log("下拉刷新"); |
|
|
} else { |
|
|
} else { |
|
|
that.selectComponent("#lists").getList(that.data.code, 1); |
|
|
that.selectComponent("#lists").getList(that.data.code, 1); |
|
|
wx.stopPullDownRefresh(); |
|
|
wx.stopPullDownRefresh(); |
|
@@ -103,7 +112,7 @@ Page({ |
|
|
}) => { |
|
|
}) => { |
|
|
wx.getSystemInfo({ |
|
|
wx.getSystemInfo({ |
|
|
success: function (res) { |
|
|
success: function (res) { |
|
|
console.log(JSON.stringify(res)) |
|
|
|
|
|
|
|
|
// console.log(JSON.stringify(res)) |
|
|
that.setData({ |
|
|
that.setData({ |
|
|
systemInfo: JSON.stringify(res) |
|
|
systemInfo: JSON.stringify(res) |
|
|
}) |
|
|
}) |
|
@@ -142,6 +151,7 @@ Page({ |
|
|
that.setData({ |
|
|
that.setData({ |
|
|
showGame: true |
|
|
showGame: true |
|
|
}) |
|
|
}) |
|
|
|
|
|
that.getGameOne(res.data.token) |
|
|
} |
|
|
} |
|
|
Http.setToken(res.data.token); |
|
|
Http.setToken(res.data.token); |
|
|
that.checkUserCarStatus(); |
|
|
that.checkUserCarStatus(); |
|
@@ -176,7 +186,20 @@ Page({ |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getGameOne:function(token){ |
|
|
|
|
|
let _this=this; |
|
|
|
|
|
Http.get({ |
|
|
|
|
|
url: config.api.getGame, |
|
|
|
|
|
data:{ |
|
|
|
|
|
token: token |
|
|
|
|
|
} |
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
console.log(res.data,77777) |
|
|
|
|
|
_this.setData({ |
|
|
|
|
|
gamedata:res.data |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
/** |
|
|
/** |
|
|
* banner |
|
|
* banner |
|
|
*/ |
|
|
*/ |
|
@@ -189,7 +212,6 @@ Page({ |
|
|
pageSize: 7 |
|
|
pageSize: 7 |
|
|
} |
|
|
} |
|
|
}).then(res => { |
|
|
}).then(res => { |
|
|
console.log(res); |
|
|
|
|
|
that.setData({ |
|
|
that.setData({ |
|
|
list: res.data.list |
|
|
list: res.data.list |
|
|
}); |
|
|
}); |
|
@@ -231,7 +253,6 @@ Page({ |
|
|
app.globalData.parkVendor = res.data.vendor; |
|
|
app.globalData.parkVendor = res.data.vendor; |
|
|
if (res.data.token != "undefined") { |
|
|
if (res.data.token != "undefined") { |
|
|
app.globalData.etcpToken = res.data.token; |
|
|
app.globalData.etcpToken = res.data.token; |
|
|
console.log("etcpToken", app.globalData.etcpToken); |
|
|
|
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
@@ -243,7 +264,6 @@ Page({ |
|
|
// 获取用户信息 |
|
|
// 获取用户信息 |
|
|
wx.getSetting({ |
|
|
wx.getSetting({ |
|
|
success: res => { |
|
|
success: res => { |
|
|
console.log("getSetting", res); |
|
|
|
|
|
if (res.authSetting["scope.userInfo"]) { |
|
|
if (res.authSetting["scope.userInfo"]) { |
|
|
// 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框 |
|
|
// 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框 |
|
|
wx.getUserInfo({ |
|
|
wx.getUserInfo({ |
|
@@ -263,7 +283,7 @@ Page({ |
|
|
that.setData({ |
|
|
that.setData({ |
|
|
page: that.data.page |
|
|
page: that.data.page |
|
|
}); |
|
|
}); |
|
|
console.log("我是第" + that.data.page + "几页") |
|
|
|
|
|
|
|
|
// console.log("我是第" + that.data.page + "几页") |
|
|
//父组件获得子组件的方法 |
|
|
//父组件获得子组件的方法 |
|
|
//如果code == 0 |
|
|
//如果code == 0 |
|
|
if (that.data.code == 0 || that.data.code == undefined) { |
|
|
if (that.data.code == 0 || that.data.code == undefined) { |
|
|