|
|
@@ -14,19 +14,38 @@ Page({
|
|
|
today_stock_img:[],
|
|
|
value:[-1],
|
|
|
is_markt:0,
|
|
|
- today_fund:''
|
|
|
+ today_fund:'',
|
|
|
+ change:0
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onShow(){
|
|
|
- console.log(233)
|
|
|
- if (!this.data.userInfo.token) {
|
|
|
- wx.switchTab({
|
|
|
- url: '../user/user',
|
|
|
+
|
|
|
+ setTimeout(()=>{
|
|
|
+ if (!this.data.userInfo.token) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ wx.request({
|
|
|
+ url: host + '/api/wx/player/currecord',
|
|
|
+ header: {
|
|
|
+ 'Authorization': this.data.userInfo.token
|
|
|
+ },
|
|
|
+ success: res => {
|
|
|
+ console.log(res)
|
|
|
+ if (res.data.data) {
|
|
|
+ this.setData({
|
|
|
+ stock: res.data.data.today_stock,
|
|
|
+ today_stock_img: res.data.data.today_stock_img,
|
|
|
+ today_fund: res.data.data.today_fund,
|
|
|
+ is_markt: res.data.data.is_markt,
|
|
|
+ change:1
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
})
|
|
|
- }
|
|
|
+ },500)
|
|
|
},
|
|
|
onLoad: function (options) {
|
|
|
var y=new Date().getFullYear()
|
|
|
@@ -259,12 +278,7 @@ Page({
|
|
|
|
|
|
},
|
|
|
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面显示
|
|
|
- */
|
|
|
- onShow: function () {
|
|
|
|
|
|
- },
|
|
|
|
|
|
/**
|
|
|
* 生命周期函数--监听页面隐藏
|