|
@@ -150,6 +150,20 @@ Page({
|
|
|
},
|
|
|
|
|
|
onLoad: function () {
|
|
|
+ let sysinfo = wx.getSystemInfoSync(),
|
|
|
+ windowHeight = sysinfo.windowHeight,
|
|
|
+ statusHeight = sysinfo.statusBarHeight,
|
|
|
+ isiOS = sysinfo.system.indexOf('iOS') > -1,
|
|
|
+ navHeight;
|
|
|
+ if (!isiOS) {
|
|
|
+ navHeight = 48;
|
|
|
+ } else {
|
|
|
+ navHeight = 44;
|
|
|
+ }
|
|
|
+ let height = windowHeight-statusHeight-navHeight;
|
|
|
+ this.setData({
|
|
|
+ height:height
|
|
|
+ })
|
|
|
this.echartsComponnet = this.selectComponent('#mychart');
|
|
|
console.log(this.echartsComponnet);
|
|
|
//如果是第一次绘制
|
|
@@ -194,13 +208,16 @@ Page({
|
|
|
query.select('.news').boundingClientRect()
|
|
|
query.exec(res => {
|
|
|
let topHeight = res[0].height
|
|
|
+ console.log(topHeight);
|
|
|
let searchHeight = res[1].height
|
|
|
+ console.log(searchHeight);
|
|
|
let titleHeight = res[2].height
|
|
|
+ console.log(titleHeight);
|
|
|
let windowHeight = wx.getSystemInfoSync().windowHeight
|
|
|
let windowWidth = wx.getSystemInfoSync().windowWidth
|
|
|
let height = windowHeight - topHeight - searchHeight - titleHeight
|
|
|
let ratio = 750 / windowWidth
|
|
|
- let scrollHeight = height * ratio + 20
|
|
|
+ let scrollHeight = height * ratio
|
|
|
that.setData({ scrollHeight: scrollHeight})
|
|
|
})
|
|
|
},
|