From 7d9ac631257e39fe08a399cc45d3ddbce820525e Mon Sep 17 00:00:00 2001 From: xpz2018 <107107461@qq.com> Date: Fri, 15 Oct 2021 10:32:09 +0800 Subject: [PATCH] no message --- pages/moment/fragment/index.js | 14 ++++++++++++-- pages/moment/fragment/index.wxml | 15 +++++++-------- 2 files changed, 19 insertions(+), 10 deletions(-) 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 @@ - + - + - + - + - +