浏览代码

折线图优化

zjh 5 年之前
父节点
当前提交
e0d1e47137
共有 5 个文件被更改,包括 137 次插入406 次删除
  1. 40 182
      pages/index/index.js
  2. 2 1
      pages/index/index.json
  3. 46 70
      pages/index/index.wxml
  4. 2 108
      pages/index/index.wxss
  5. 47 45
      pages/item/item.wxml

+ 40 - 182
pages/index/index.js

@@ -9,6 +9,7 @@ Page({
     url:'../../images/timg.jpg',
     motto: '',
     currentTab: 0,
+    winheight:0,
     userInfo: {},
     hasUserInfo: false,
     canIUse: wx.canIUse('button.open-type.getUserInfo'),
@@ -16,145 +17,21 @@ Page({
     pages:0,//每页条数
     total:0,//总条数
     aa:[],//列表
-
+    loading: false,
     imagewidth: 0,//缩放后的宽 
     imageheight: 0,//缩放后的高 
     chartData:{
-      // actual:[552,586,3555,4454,552,556,4455],
-      // prediction:[552,546,3585,4424,542,546,35,44,524,56,355,444,2224,421],
-      // timeData : [
-      //   '2020/6/1', '2020/6/2', '2020/6/3', '2020/6/4', '2020/6/5', '2020/6/6', '2020/6/7', '2020/6/8', '2020/6/9', '2020/6/10','2020/6/11',
-      //   '2020/6/12','2020/6/13','2020/6/14',
-      // ]
+
     },
       chartDatas:{
-        // actual:[572,556,3555,4744,552,576,3555],
-        // prediction:[352,246,385,2424,542,546,255],
-        // timeData : [
-        //   '2020/6/1', '2020/6/2', '2020/6/3', '2020/6/4', '2020/6/5', '2020/6/6', '2020/6/7'
-        // ]
+
       },
       ec: {
         onInit: true,
         // lazyLoad: true // 延迟加载
       },
-    // ec: {
-    //   onInit: function (canvas, width, height) {
-    //     chart = echarts.init(canvas, null, {
-    //       width: width,
-    //       height: height
-    //     });
-    //     canvas.setChart(chart);
-    //     return chart;
-    //   },
-    //   lazyLoad: true // 延迟加载
-    // },
+
     aa:[
-      // {
-      //   id:'0',
-      //   from:"Investing.com 中文",
-      //   nickName:"买入波音(BA.US)好时机?两个问题没解决之前劝你住手",
-      //   reward:"今年迄今,美股航空板块受到公共卫生事件的冲击.....",
-      //   time:"6天前"
-      // },
-      // { 
-      //   id:'1',
-      //   from:"chinese.aljazeera.net",
-      //   nickName: "波音裁员超1.2万人与警惕最坏时刻尚未到来",
-      //   reward: "波音公司当地时间27日宣布,将在美国裁减超1...",
-      //   time:"6天前"
-      // },
-      // {
-      //   id:'2',
-      //   from:"Investing.com 中文",
-      //   nickName: "美股异动|波音737MAX客机恢复生产,盘前涨逾5%",
-      //   reward: "Reuters.美股异动|波音(BA.US)737MAX客...",
-      //   time:"5天前"
-      // },
-      // {
-      //   id:'3',
-      //   from:"Investing.com 中文",
-      //   nickName:"买入波音(BA.US)好时机?两个问题没解决之前劝你住手",
-      //   reward:"今年迄今,美股航空板块受到公共卫生事件的冲击.....",
-      //   time:"6天前"
-      // },
-      // { 
-      //   id:'4',
-      //   from:"chinese.aljazeera.net",
-      //   nickName: "波音裁员超1.2万人与警惕最坏时刻尚未到来",
-      //   reward: "波音公司当地时间27日宣布,将在美国裁减超1...",
-      //   time:"6天前"
-      // },
-      // {
-      //   id:'5',
-      //   from:"Investing.com 中文",
-      //   nickName: "美股异动|波音737MAX客机恢复生产,盘前涨逾5%",
-      //   reward: "Reuters.美股异动|波音(BA.US)737MAX客...",
-      //   time:"5天前"
-      // },
-      // {
-      //   id:'6',
-      //   from:"Investing.com 中文",
-      //   nickName:"买入波音(BA.US)好时机?两个问题没解决之前劝你住手",
-      //   reward:"今年迄今,美股航空板块受到公共卫生事件的冲击.....",
-      //   time:"6天前"
-      // },
-      // { 
-      //   id:'7',
-      //   from:"chinese.aljazeera.net",
-      //   nickName: "波音裁员超1.2万人与警惕最坏时刻尚未到来",
-      //   reward: "波音公司当地时间27日宣布,将在美国裁减超1...",
-      //   time:"6天前"
-      // },
-      // {
-      //   id:'8',
-      //   from:"Investing.com 中文",
-      //   nickName: "美股异动|波音737MAX客机恢复生产,盘前涨逾5%",
-      //   reward: "Reuters.美股异动|波音(BA.US)737MAX客...",
-      //   time:"5天前"
-      // },
-      // {
-      //   id:'9',
-      //   from:"Investing.com 中文",
-      //   nickName:"买入波音(BA.US)好时机?两个问题没解决之前劝你住手",
-      //   reward:"今年迄今,美股航空板块受到公共卫生事件的冲击.....",
-      //   time:"6天前"
-      // },
-      // { 
-      //   id:'10',
-      //   from:"chinese.aljazeera.net",
-      //   nickName: "波音裁员超1.2万人与警惕最坏时刻尚未到来",
-      //   reward: "波音公司当地时间27日宣布,将在美国裁减超1...",
-      //   time:"6天前"
-      // },
-      // {
-      //   id:'11',
-      //   from:"Investing.com 中文",
-      //   nickName: "美股异动|波音737MAX客机恢复生产,盘前涨逾5%",
-      //   reward: "Reuters.美股异动|波音(BA.US)737MAX客...",
-      //   time:"5天前"
-      // },
-      // {
-      //   id:'12',
-      //   from:"Investing.com 中文",
-      //   nickName:"买入波音(BA.US)好时机?两个问题没解决之前劝你住手",
-      //   reward:"今年迄今,美股航空板块受到公共卫生事件的冲击.....",
-      //   time:"6天前"
-      // },
-      // { 
-      //   id:'13',
-      //   from:"chinese.aljazeera.net",
-      //   nickName: "波音裁员超1.2万人与警惕最坏时刻尚未到来",
-      //   reward: "波音公司当地时间27日宣布,将在美国裁减超1...",
-      //   time:"6天前"
-      // },
-      // {
-      //   id:'14',
-      //   from:"Investing.com 中文",
-      //   nickName: "美股异动|波音737MAX客机恢复生产,盘前涨逾5%",
-      //   reward: "Reuters.美股异动|波音(BA.US)737MAX客...",
-      //   time:"5天前"
-      // },
     ],
   },
  
@@ -168,7 +45,9 @@ Page({
   getHz:function(){
     apiServer.getHz().then((res) =>{
       if(res.statusCode == 200){
-
+        this.setData({
+          loading:false
+         })
         this.onComponent.init((canvas, width, height,dpr) => {
           // 初始化图表
           const Chart = echarts.init(canvas, null, {
@@ -187,6 +66,9 @@ Page({
     apiServer.getSz().then((res) =>{
       if(res.statusCode == 200){
         console.log(res);
+        this.setData({
+          loading:false
+         })
         this.deppComponnet.init((canvas, width, height,dpr) => {
           // 初始化图表
           const Chart = echarts.init(canvas, null, {
@@ -472,6 +354,16 @@ Page({
     //    console.log(res.top);
     // }).exec();
  },
+ //下拉刷新
+ onRefresh: function(e) {
+  this.setData({
+    currentPage: 1,
+    loading:true
+  })
+  this.getHz();
+  this.getSz();
+  getNewsList(this);
+},
   onLoad: function (options) {
     this.onComponent = this.selectComponent('#mychart-dom-line-on');
     this.deppComponnet = this.selectComponent('#mychart-dom-line-depp');
@@ -490,44 +382,9 @@ Page({
     }
     let height = windowHeight-statusHeight-navHeight;
     this.setData({
-      height:height
+      winheight:height
     })
-    // this.echartsComponnet = this.selectComponent('#mychart');
-    // console.log(this.echartsComponnet);
-    // //如果是第一次绘制
-    // if (!Chart) {
-    //   this.init_echarts(); //初始化图表
-    // } else {
-    //   this.setOption(Chart); //更新数据
-    // }
 
-    // this.computeScrollViewHeight();
-    // if (app.globalData.userInfo) {
-    //   this.setData({
-    //     userInfo: app.globalData.userInfo,
-    //     hasUserInfo: true
-    //   })
-    // } else if (this.data.canIUse){
-    //   // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
-    //   // 所以此处加入 callback 以防止这种情况
-    //   app.userInfoReadyCallback = res => {
-    //     this.setData({
-    //       userInfo: res.userInfo,
-    //       hasUserInfo: true
-    //     })
-    //   }
-    // } else {
-    //   // 在没有 open-type=getUserInfo 版本的兼容处理
-    //   wx.getUserInfo({
-    //     success: res => {
-    //       app.globalData.userInfo = res.userInfo
-    //       this.setData({
-    //         userInfo: res.userInfo,
-    //         hasUserInfo: true
-    //       })
-    //     }
-    //   })
-    // }
   },
    /**
      * 页面相关事件处理函数--监听用户下拉动作
@@ -563,22 +420,22 @@ Page({
 
 },
   computeScrollViewHeight() {
-    var that = this
-    let query = wx.createSelectorQuery().in(that)
-    query.select('.swiper-tab').boundingClientRect()
-    query.select('.chart').boundingClientRect()
-    query.select('.news').boundingClientRect()
-    query.exec(res => {
-      let topHeight = res[0].height
-      let searchHeight = res[1].height
-      let titleHeight = res[2].height
-      let windowHeight = wx.getSystemInfoSync().windowHeight
-      let windowWidth = wx.getSystemInfoSync().windowWidth
-      let height = windowHeight - topHeight - searchHeight - titleHeight
-      let ratio = 750 / windowWidth
-      let scrollHeight = height * ratio
-      that.setData({ scrollHeight: scrollHeight})
-    })
+    // var that = this
+    // let query = wx.createSelectorQuery().in(that)
+    // query.select('.swiper-tab').boundingClientRect()
+    // query.select('.chart').boundingClientRect()
+    // query.select('.news').boundingClientRect()
+    // query.exec(res => {
+    //   let topHeight = res[0].height
+    //   let searchHeight = res[1].height
+    //   let titleHeight = res[2].height
+    //   let windowHeight = wx.getSystemInfoSync().windowHeight
+    //   let windowWidth = wx.getSystemInfoSync().windowWidth
+    //   let height = windowHeight - topHeight - searchHeight - titleHeight
+    //   let ratio = 750 / windowWidth
+    //   let scrollHeight = height * ratio
+    //   that.setData({ scrollHeight: scrollHeight})
+    // })
   },
   imageLoad: function (e) { 
     var imageSize = imageUtil.imageUtil(e) 
@@ -689,7 +546,8 @@ if(!isMerge){
         aa,
         currPage:res.data.data.current,
         pages: res.data.data.pages,
-        total: res.data.data.total
+        total: res.data.data.total,
+        loading:false
       })    
     }
     // that.isLoading = false

+ 2 - 1
pages/index/index.json

@@ -5,5 +5,6 @@
     "ec-canvas": "../../ec-canvas/ec-canvas"
   },
   "onReachBottomDistance":50,
-  "enablePullDownRefresh": true
+  "enablePullDownRefresh": true,
+  "disableScroll":true
 }

+ 46 - 70
pages/index/index.wxml

@@ -3,85 +3,61 @@
   <component-tag-name inner-text="Some text"></component-tag-name>
 </view> -->
 <navBar></navBar>
-<view class="container" style="height:{{height}}px" >
+
   <view class="swiper-tab">
     <view class="swiper-tab-list {{currentTab==0 ? 'on' : ''}}" data-current="0" bindtap="swichNav">上证</view>
     <view class="swiper-tab-list {{currentTab==1 ? 'on' : ''}}" data-current="1" bindtap="swichNav">深证</view>
-    <!-- <view class="swiper-tab-list">沪深</view> -->
-    <!-- <image class="image" src="./images/001.png" bindtap='choose'></image> -->
   </view>
-  <!-- <view class="userinfo">
-    <button wx:if="{{!hasUserInfo && canIUse}}" open-type="getUserInfo" bindgetuserinfo="getUserInfo"> 获取头像昵称 </button>
-    <block wx:else>
-      <image bindtap="bindViewTap" class="userinfo-avatar" src="{{userInfo.avatarUrl}}" mode="cover"></image>
-      <text class="userinfo-nickname">{{userInfo.nickName}}</text>
-    </block>
-    <image class="imageSize" src="{{url}}" mode="widthFix"></image>
-    <image class="image" style="width: {{imagewidth}}px; height: {{imageheight}}px;" src="{{url}}" bindload="imageLoad"></image> 
-  </view> -->
-  <!-- <view class="search">
-    <input class="weui-input" placeholder="请输入板块代码"/>
-    <view class="weui-search-bar__cancel-btn" bindtap='方法名a'>
-      <icon class="weui-icon-search_in-box" type="search" size="20"></icon>
-    </view>
-  </view> -->
-  <view class="chart">
-         <!-- <view class="top">
-            <view class="topTitle">
-              <text class="titleBig">DOWN J</text>
-              <text class="titleSmall">xxxxxxxxxxxxxxx</text>
-            </view>
-            <view class="line"></view>
-            <view class="topText">
-              <text class="textOne">1111111</text>
-              <text class="textTwo">+527.4</text>
-            </view>
-          </view> -->
-    <swiper current="{{currentTab}}" class="swiper-box" duration="300"  style="height:700rpx;background:#1C1C1C" bindchange="bindChange">
-    <swiper-item catchtouchmove='catchTouchMove'>
-     <view style="width:100%;height:100%">
-       <ec-canvas  id="mychart-dom-line-on" canvas-id="mychart-line-on" tuData="{{ chartDatas }}" ec="{{ ec }}"></ec-canvas>
-     </view>
-    </swiper-item>
-    <swiper-item catchtouchmove='catchTouchMove'>
-      <ec-canvas  id="mychart-dom-line-depp" canvas-id="mychart-line-depp" tuData="{{ chartData }}" ec="{{ ec }}"></ec-canvas>
-    </swiper-item>
-   </swiper>
-        <!-- <view class="middleCharts">
-          <ec-canvas id="mychart-dom-line" canvas-id="mychart-line" tuData=" {{ chartData }}" ec="{{ ec }}"></ec-canvas>
-          <ec-canvas id="mychart-dom-line" canvas-id="mychart-line" tuData="{{ chartDatas }}" ec="{{ ec }}"></ec-canvas>
-        </view> -->
-  </view>
-  <view class="news">
-    <text class="news-today">今日快讯</text>
-  </view>
-  <!-- <view class="line">
-    1
-  </view> -->
-    <!-- <swiper class="tab-right"  id="test" vertical="true" autoplay="true" circular="true" interval="2000" display-multiple-items='6'>
-      <view class="right-item">
-        <block wx:for-index="idx" wx:for='{{aa}}'>
-          <swiper-item>
-            <view class='content-item'>
-              <text class='name'>{{item.nickName}}</text>
-              <text class='wawa'>获得奖金{{item.reward}}元</text>
+
+<swiper current="{{currentTab}}" class="swiper-box" duration="300" style="height:{{winheight - 48}}px"  bindchange="bindChange">
+  <swiper-item catchtouchmove='catchTouchMove'>
+    <scroll-view scroll-y="true" bindscrolltolower="scrolltolower" style="height: 100%;" refresher-default-style='white' bindrefresherrefresh="onRefresh" refresher-triggered="{{loading}}" refresher-enabled="{{true}}"  lower-threshold="1">
+      <view style="height:700rpx;background:#1C1C1C">
+        <ec-canvas  id="mychart-dom-line-on" canvas-id="mychart-line-on" tuData="{{ chartDatas }}" ec="{{ ec }}"></ec-canvas>
+      </view>
+      <view class="news">
+        <text class="news-today">今日快讯</text>
+      </view>
+      <view class="tab">
+        <block wx:for-index="idx" wx:for='{{aa}}' wx:key="key" >
+          <view class='content-item' bindtap="onFold" data-id="{{item.newsId}}" >
+            <view>
+              <text class='from' >{{item.newsFrom}}</text>
+              <text class='tag' >{{item.newsTag}}</text>
             </view>
-          </swiper-item>
+            <text class='name'>{{item.newsTitle}}</text>
+            <text class='wawa'>{{item.newsMiniContent}}</text>
+            <text class='time'>{{item.newsDate}}</text>
+          </view>
         </block> 
       </view>
-    </swiper> -->
-    <!-- <scroll-view scroll-y style='height:500rpx' class="tab"> -->
-    <scroll-view scroll-y="true" bindscrolltolower="scrolltolower" style='height: {{scrollHeight}}rpx' class="tab">
-            <block wx:for-index="idx" wx:for='{{aa}}' wx:key="key" >
-            <view class='content-item' bindtap="onFold" data-id="{{item.newsId}}" >
+    </scroll-view>
+  </swiper-item>
+  
+  <swiper-item catchtouchmove='catchTouchMove'>
+   <scroll-view scroll-y="true" bindscrolltolower="scrolltolower" style="height: 100%;"  refresher-default-style='white' bindrefresherrefresh="onRefresh" refresher-triggered="{{loading}}" refresher-enabled="{{true}}"  lower-threshold="1">
+    <view style="height:700rpx;background:#1C1C1C">
+      <ec-canvas  id="mychart-dom-line-depp" canvas-id="mychart-line-depp" tuData="{{ chartData }}" ec="{{ ec }}"></ec-canvas>
+    </view>
+      <view class="news">
+        <text class="news-today">今日快讯</text>
+      </view>
+      <view class="tab">
+        <block wx:for-index="idx" wx:for='{{aa}}' wx:key="key" >
+          <view class='content-item' bindtap="onFold" data-id="{{item.newsId}}" >
             <view>
               <text class='from' >{{item.newsFrom}}</text>
               <text class='tag' >{{item.newsTag}}</text>
             </view>
-              <text class='name'>{{item.newsTitle}}</text>
-              <text class='wawa'>{{item.newsMiniContent}}</text>
-              <text class='time'>{{item.newsDate}}</text>
-            </view>
-          </block> 
+            <text class='name'>{{item.newsTitle}}</text>
+            <text class='wawa'>{{item.newsMiniContent}}</text>
+            <text class='time'>{{item.newsDate}}</text>
+          </view>
+        </block> 
+    </view>
     </scroll-view>
-</view>
+  </swiper-item>
+</swiper>
+
+
+

+ 2 - 108
pages/index/index.wxss

@@ -1,47 +1,9 @@
 /**index.wxss**/
-.chart{
-  background:#000;
-  color:white;
-  /* height:500rpx; */
-  width:100%;
-  padding: 10px;
-  /* position:fixed;
-  top:100rpx;
-  left:0;
-  right:0; */
-}
-.middleCharts{
-  width:100%;
-  height:90%;
-  background:#1C1C1C;
-  /* position:relative;
-  top:50px; */
-  margin:5% auto; 
-  border-radius:3px;
-}
+
 ec-canvas {
   width: 100%;
   height: 100%;
 }
-#mychart{
-  margin:0 auto;
-}
-.buttonText{
-  width:95%;
-  height:20%;
-  background:#1C1C1C;
-  /* position:relative;
-  top:50px; */
-  margin:5% auto; 
-  border-radius:3px;
-}
-.nextText{
-  /* width:90%; */
-  /* height:5%; */
-  background:#1C1C1C;  
-  border-radius:3px;
-  margin:0 auto;
-}
 .swiper-tab {
   width: 100%;
   /* margin-left: 80rpx; */
@@ -61,82 +23,14 @@ ec-canvas {
   color: #D81E06;
   border-bottom: 5rpx solid #D81E06;
 }
-.image{
-  position:absolute;
-  width: 40rpx;
-  height:40rpx;
-  right: 20rpx;
-  top:20rpx;
-}
-.userinfo {
-  width:100%;
-  /* display: flex;
-  flex-direction: column;
-  align-items: center; */
-}
-.imageSize{
-  width: 100%; 
-}
-.search{
-  margin-top: -50rpx;
-  background-color: #fff;
-  border: 1rpx solid #fff;
-  border-radius: 10rpx;
-  align-items: center;
-  width:90%;
-  height: 80rpx;
-  position: relative;
-  /* display: flex; */
-  /* flex-direction: row; */
-  justify-content:space-between;
-}
-.weui-input{
-  margin-left: 30rpx;
-  height: 100%;
-}
-.weui-search-bar__cancel-btn{
-  position: absolute;
-  top:20rpx;
-  right:20rpx;
-}
 .news{
   width:90%;
-  margin-bottom: 20rpx;
-}
-.line{
-  background: #E0E3DA;
-  width: 100%;
-  height: 2rpx;
-  margin-top: 5rpx;
+  margin: 20rpx 10rpx;
 }
 .news-today{
   color: #fff;
   font-size: 40rpx;
 }
-.today{
-  width: 90%;
-  background-color:#1C1C1C ;
-  color:#F2F2F2;
-}
-.userinfo-avatar {
-  width: 128rpx;
-  height: 128rpx;
-  margin: 20rpx;
-  border-radius: 50%;
-}
-.userinfo-nickname {
-  color: #aaa;
-}
-.usermotto {
-  margin-top: 200px;
-}
-.avater {
-  height: 50rpx;
-  width: 50rpx;
-  border-radius: 100rpx;
-  margin-top: 25rpx;
-  float: left;
-}
 .tab{
   width: 100%;
   background-color:#1C1C1C ;

+ 47 - 45
pages/item/item.wxml

@@ -1,49 +1,51 @@
-<view class="title">
- <view class="title-button">
-  <button type="default" size="mini" bindtap="postfollow">{{follow}}</button>
- </view>
- <view class="title-name">
-   <text class="title-name-Big">{{object.Name}}</text>
-    <!-- <text class="title-name-small">{{object.Withtitle}}</text> -->
- </view>
- <view class="tile-number">
-   <!-- <text class="tile-number-Volume">{{object.va}}</text> -->
-    <text class="tile-number-float" style="color:{{object.color}}">{{object.value}}</text>
- </view>
-</view>
-<view class="swiper-tab">
-  <view class="swiper-tab-list {{currentTab==0 ? 'on' : ''}}" data-current="0" bindtap="swichNav">实际数据</view>
-  <view class="swiper-tab-list {{currentTab==1 ? 'on' : ''}}" data-current="1" bindtap="swichNav">下周预测</view>
-</view>
-<view class="map">
-  <!-- <view class="map-line">
-     <text class="map-line-red"></text>
-      <text class="map-line-redname">实际</text>
-       <text class="map-line-blue"></text>
-        <text class="map-line-bluename">预测</text>
-  </view>    -->
-  <swiper current="{{currentTab}}" class="swiper-box" duration="300"  style="height:700rpx" bindchange="bindChange">
+<scroll-view scroll-y style="height:100%">
+  <view class="title">
+  <view class="title-button">
+    <button type="default" size="mini" bindtap="postfollow">{{follow}}</button>
+  </view>
+  <view class="title-name">
+    <text class="title-name-Big">{{object.Name}}</text>
+      <!-- <text class="title-name-small">{{object.Withtitle}}</text> -->
+  </view>
+  <view class="tile-number">
+    <!-- <text class="tile-number-Volume">{{object.va}}</text> -->
+      <text class="tile-number-float" style="color:{{object.color}}">{{object.value}}</text>
+  </view>
+  </view>
+  <view class="swiper-tab">
+    <view class="swiper-tab-list {{currentTab==0 ? 'on' : ''}}" data-current="0" bindtap="swichNav">实际数据</view>
+    <view class="swiper-tab-list {{currentTab==1 ? 'on' : ''}}" data-current="1" bindtap="swichNav">下周预测</view>
+  </view>
+  <view class="map">
+    <!-- <view class="map-line">
+      <text class="map-line-red"></text>
+        <text class="map-line-redname">实际</text>
+        <text class="map-line-blue"></text>
+          <text class="map-line-bluename">预测</text>
+    </view>    -->
+    <swiper current="{{currentTab}}" class="swiper-box" duration="300"  style="height:700rpx" bindchange="bindChange">
 
-    <swiper-item catchtouchmove='catchTouchMove'>
-     <view style="width:100%;height:100%">
-       <ec-canvas  id="mychart-dom-line-actual" canvas-id="mychart-line-actual" bind:init="echartInit" data-record="{{realchartData}}" tuData="{{ realchartData }}" ec="{{ ec }}"></ec-canvas>
-     </view>
-    </swiper-item>
+      <swiper-item catchtouchmove='catchTouchMove'>
+      <view style="width:100%;height:100%">
+        <ec-canvas  id="mychart-dom-line-actual" canvas-id="mychart-line-actual" bind:init="echartInit" data-record="{{realchartData}}" tuData="{{ realchartData }}" ec="{{ ec }}"></ec-canvas>
+      </view>
+      </swiper-item>
 
-    <swiper-item catchtouchmove='catchTouchMove'>
-    <ec-canvas  id="mychart-dom-line-under" canvas-id="mychart-line-under" bind:init="echartInitunder" data-record="{{nextchartData}}" tuData="{{ nextchartData }}" ec="{{ ec }}"></ec-canvas>
-    </swiper-item>
-  </swiper>
-</view>
-  <view class="news">
-    <text class="news-today">今日快讯</text>
+      <swiper-item catchtouchmove='catchTouchMove'>
+      <ec-canvas  id="mychart-dom-line-under" canvas-id="mychart-line-under" bind:init="echartInitunder" data-record="{{nextchartData}}" tuData="{{ nextchartData }}" ec="{{ ec }}"></ec-canvas>
+      </swiper-item>
+    </swiper>
   </view>
-
-  <block wx:for-index="idx" wx:for='{{newsData}}' wx:key="key" >
-    <view class='content-item' bindtap="onFold" data-id="{{item.newsId}}" >
-      <text class='from' >{{item.newsFrom}}</text>
-      <text class='name'>{{item.newsTitle}}</text>
-      <text class='wawa'>{{item.newsMiniContent}}</text>
-      <text class='time'>{{item.newsDate}}</text>
+    <view class="news">
+      <text class="news-today">今日快讯</text>
     </view>
-</block> 
+
+    <block wx:for-index="idx" wx:for='{{newsData}}' wx:key="key" >
+      <view class='content-item' bindtap="onFold" data-id="{{item.newsId}}" >
+        <text class='from' >{{item.newsFrom}}</text>
+        <text class='name'>{{item.newsTitle}}</text>
+        <text class='wawa'>{{item.newsMiniContent}}</text>
+        <text class='time'>{{item.newsDate}}</text>
+      </view>
+  </block> 
+</scroll-view>