|
|
@@ -4,13 +4,14 @@ const app = getApp()
|
|
|
const $api = require('../../utils/api.js').API;
|
|
|
Page({
|
|
|
data: {
|
|
|
- notices:[{}],
|
|
|
+ notices:[],
|
|
|
tabs:['关注','热门股票','胜率榜','防守榜','冠军心得'],
|
|
|
cur:0,
|
|
|
date:'2021-11-09',
|
|
|
followList:[],
|
|
|
page:1,
|
|
|
- total:0
|
|
|
+ total:0,
|
|
|
+ error:0
|
|
|
},
|
|
|
onLoad() {
|
|
|
var y = new Date().getFullYear(), m = (new Date().getMonth() + 1), d = new Date().getDate();
|
|
|
@@ -51,6 +52,12 @@ Page({
|
|
|
total:res.data.data.total
|
|
|
})
|
|
|
})
|
|
|
+ .catch(err=>{
|
|
|
+ this.setData({
|
|
|
+ error:1
|
|
|
+ })
|
|
|
+ // console.log(err)
|
|
|
+ })
|
|
|
},
|
|
|
getData(){
|
|
|
//胜率
|
|
|
@@ -113,5 +120,10 @@ Page({
|
|
|
date:e.detail.value
|
|
|
})
|
|
|
this.getHot()
|
|
|
- }
|
|
|
+ },
|
|
|
+ onShow: function () {
|
|
|
+ if (this.data.error) {
|
|
|
+ this.onLoad()
|
|
|
+ }
|
|
|
+ },
|
|
|
})
|