diff --git a/pages/moment/fragment/index.js b/pages/moment/fragment/index.js
index fcdde0d..4126ceb 100644
--- a/pages/moment/fragment/index.js
+++ b/pages/moment/fragment/index.js
@@ -4,6 +4,7 @@ const event = require('../../../utils/event')
const util = require('../../../utils/util')
const math = require('../../../utils/math')
const app = getApp()
+const list = [ '推荐', '关注', '全部' , '行情']
var params = {byQueryType: 2, pageNum: 1}
Component({
@@ -27,6 +28,7 @@ Component({
noticeList: [],
tabList: [ '推荐', '关注', '全部' , '行情'],
tabIndex: 0,
+ mHeight: 0,
},
lifetimes: {
attached: function () {
@@ -39,7 +41,9 @@ Component({
methods: {
onRestart: function () {
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')
}
this.data.firstShow = true
@@ -112,9 +116,15 @@ Component({
for (let index = 0; index < result.data.records.length; 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 => {
+ this.setData({noticeList: this.data.noticeList, mHeight: this.data.height - 87 - this.data.customHeight})
this.data.loopRequesting = false
})
},
diff --git a/pages/moment/fragment/index.wxml b/pages/moment/fragment/index.wxml
index 929791c..e028130 100644
--- a/pages/moment/fragment/index.wxml
+++ b/pages/moment/fragment/index.wxml
@@ -1,4 +1,3 @@
-
@@ -16,8 +15,8 @@
-
-
+
+
@@ -31,18 +30,18 @@
-
+
-
+
-
+
-
+
-
+