|
|
@ -4,6 +4,7 @@ const event = require('../../../utils/event') |
|
|
const util = require('../../../utils/util') |
|
|
const util = require('../../../utils/util') |
|
|
const math = require('../../../utils/math') |
|
|
const math = require('../../../utils/math') |
|
|
const app = getApp() |
|
|
const app = getApp() |
|
|
|
|
|
const list = [ '推荐', '关注', '全部' , '行情'] |
|
|
var params = {byQueryType: 2, pageNum: 1} |
|
|
var params = {byQueryType: 2, pageNum: 1} |
|
|
|
|
|
|
|
|
Component({ |
|
|
Component({ |
|
|
@ -27,6 +28,7 @@ Component({ |
|
|
noticeList: [], |
|
|
noticeList: [], |
|
|
tabList: [ '推荐', '关注', '全部' , '行情'], |
|
|
tabList: [ '推荐', '关注', '全部' , '行情'], |
|
|
tabIndex: 0, |
|
|
tabIndex: 0, |
|
|
|
|
|
mHeight: 0, |
|
|
}, |
|
|
}, |
|
|
lifetimes: { |
|
|
lifetimes: { |
|
|
attached: function () { |
|
|
attached: function () { |
|
|
@ -39,7 +41,9 @@ Component({ |
|
|
methods: { |
|
|
methods: { |
|
|
onRestart: function () { |
|
|
onRestart: function () { |
|
|
if(!this.data.firstShow){ |
|
|
if(!this.data.firstShow){ |
|
|
setTimeout(() => { this.setData({ tabIndex: this.data.tabIndex, tabList: [ '推荐', '关注', '全部' , '行情'] }) }, 100) |
|
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
this.setData({ tabIndex: this.data.tabIndex, tabList: list, mHeight: this.data.height - 87 - this.data.customHeight }) |
|
|
|
|
|
}, 100) |
|
|
params.date = util.formatDate(new Date(), 'Y-M-D') |
|
|
params.date = util.formatDate(new Date(), 'Y-M-D') |
|
|
} |
|
|
} |
|
|
this.data.firstShow = true |
|
|
this.data.firstShow = true |
|
|
@ -112,9 +116,15 @@ Component({ |
|
|
for (let index = 0; index < result.data.records.length; index++) { |
|
|
for (let index = 0; index < result.data.records.length; index++) { |
|
|
this.handResult(result.data.records[index]) |
|
|
this.handResult(result.data.records[index]) |
|
|
} |
|
|
} |
|
|
this.setData({noticeList: this.data.noticeList}) |
|
|
|
|
|
|
|
|
if(this.data.noticeList.length > 0){ |
|
|
|
|
|
this.data.mHeight = this.data.height - 167 - this.data.customHeight |
|
|
|
|
|
} else { |
|
|
|
|
|
this.data.mHeight = this.data.height - 87 - this.data.customHeight |
|
|
|
|
|
} |
|
|
|
|
|
this.setData({noticeList: this.data.noticeList, mHeight: this.data.mHeight}) |
|
|
} |
|
|
} |
|
|
}).catch(err => { |
|
|
}).catch(err => { |
|
|
|
|
|
this.setData({noticeList: this.data.noticeList, mHeight: this.data.height - 87 - this.data.customHeight}) |
|
|
this.data.loopRequesting = false |
|
|
this.data.loopRequesting = false |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|