diff --git a/pages/topicDetail/index.js b/pages/topicDetail/index.js index 067c8dc..5f118f0 100644 --- a/pages/topicDetail/index.js +++ b/pages/topicDetail/index.js @@ -4,7 +4,9 @@ const Http = require("../../utils/HttpBasics"); const util = require("../../utils/util"); Page({ data: { - data: {}, + data: { + bgColor:"#fff" + }, couponId: null, orderId: "", day: "", @@ -14,7 +16,7 @@ Page({ }, onShow() { let that = this; - that.topicShow(); + that.topicShow() }, topicShow(){ let that = this; @@ -29,7 +31,22 @@ Page({ that.setData({ data: res.data }); - console.log(that.data.data) + /** + * 获取屏幕的高度 + * + */ + let query = wx.createSelectorQuery(); + query.select('.coupons').boundingClientRect(); + query.selectViewport().scrollOffset(); + query.exec((res) => { + let listHeight = res[0].height; // 获取list高度 + let windowHeight = wx.getSystemInfoSync().windowHeight; + if (windowHeight >= listHeight){ + that.setData({ + winHeight:'100%' + }) + } + }) } }).catch(err => { wx.showToast({ diff --git a/pages/topicDetail/index.wxml b/pages/topicDetail/index.wxml index 6cb0d6c..e1a9cce 100644 --- a/pages/topicDetail/index.wxml +++ b/pages/topicDetail/index.wxml @@ -1,5 +1,5 @@ - +