zjh 5 éve
szülő
commit
41c062da1a

+ 7 - 0
pages/drop/drop.js

@@ -123,6 +123,13 @@ Page({
         digital:"33",
         data:[52,56,355,444]
       },
+      {
+        title:'AppL',
+        subtitle:"APPL INC",
+        Increase:"1.22",
+        digital:"33",
+        data:[52,56,355,44554]
+      },
       {
         title:'AppL',
         subtitle:"APPL INC",

+ 2 - 1
pages/drop/drop.json

@@ -1,6 +1,7 @@
 {
-  "navigationBarTitleText": "跌幅",
+  "navigationStyle": "custom",
   "usingComponents": {
+    "navBar": "/components/navBar/navBar",
     "ec-canvas": "../../ec-canvas/ec-canvas"
   }
 }

+ 28 - 8
pages/drop/drop.wxml

@@ -1,7 +1,8 @@
+<navBar></navBar>
 <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 {{currentTab==2 ? 'on' : ''}}" data-current="1" bindtap="swichNav">下周预测数据</view>
+  <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 {{currentTab==2 ? 'on' : ''}}" data-current="2" bindtap="swichNav">上周预测榜</view>
 </view>
 
 <swiper current="{{currentTab}}" class="swiper-box" duration="300"  style="height:{{winHeight - 48}}px" bindchange="bindChange">
@@ -13,11 +14,11 @@
           <view class="swiper-box-subtitle">{{item.subtitle}}</view>
         </view>
         <view class="swiper-box-right">
-          <view class="swiper-box-canvas">
+          <!-- <view class="swiper-box-canvas">
             <ec-canvas  id="mychart-dom-line" canvas-id="mychart-line" tuData="{{ item.data }}" ec="{{ ec }}"></ec-canvas>
-          </view>
+          </view> -->
           <view class="swiper-box-button">
-            <view>{{item.digital}}</view>
+            <!-- <view>{{item.digital}}</view> -->
             <button  class="mini-btn" type="primary" size="mini" >-{{item.Increase}}</button>
           </view>
         </view>
@@ -32,11 +33,30 @@
           <view class="swiper-box-subtitle">{{item.subtitle}}</view>
         </view>
         <view class="swiper-box-right">
-          <view class="swiper-box-canvas">
+          <!-- <view class="swiper-box-canvas">
             <ec-canvas  id="mychart-dom-line" canvas-id="mychart-line" tuData="{{ item.data }}" ec="{{ ec }}"></ec-canvas>
+          </view> -->
+          <view class="swiper-box-button">
+            <!-- <view>{{item.digital}}</view> -->
+            <button class="mini-btn" type="primary" size="mini">-{{item.Increase}}</button>
           </view>
+        </view>
+      </view>
+    </scroll-view>
+  </swiper-item>
+    <swiper-item>
+    <scroll-view scroll-y style="height: 100%;">
+      <view wx:for="{{array}}"class="swiper-box-view" wx:key="index" bindtap="open" data-index="{{index}}">
+        <view class="swiper-box-left">
+          <view>{{item.title}}</view>
+          <view class="swiper-box-subtitle">{{item.subtitle}}</view>
+        </view>
+        <view class="swiper-box-right">
+          <!-- <view class="swiper-box-canvas">
+            <ec-canvas  id="mychart-dom-line" canvas-id="mychart-line" tuData="{{ item.data }}" ec="{{ ec }}"></ec-canvas>
+          </view> -->
           <view class="swiper-box-button">
-            <view>{{item.digital}}</view>
+            <!-- <view>{{item.digital}}</view> -->
             <button class="mini-btn" type="primary" size="mini">-{{item.Increase}}</button>
           </view>
         </view>

+ 3 - 3
pages/filter/filter.wxss

@@ -6,7 +6,7 @@ page{
   position: relative;
   width: 100%;
   height: 100%;
-  color: #939393;
+  color: #fff;
 }
  
 /*左侧栏主盒子*/
@@ -34,7 +34,7 @@ page{
 /*左侧栏list的item被选中时*/
 .nav_left .nav_left_items.active{
   /*背景色变成白色*/
-  background: rgb(58, 58, 58);
+  background: #1C1C1C;
 }
  
 /*右侧栏主盒子*/
@@ -49,7 +49,7 @@ page{
   height: 100%;
   padding: 10px;
   box-sizing: border-box;
-  background: rgb(58, 58, 58);
+  background: #1C1C1C;
 }
 /*右侧栏list的item*/
 .nav_right .nav_right_items{

+ 143 - 15
pages/item/item.js

@@ -60,13 +60,13 @@ function initChart(canvas, width, height, dpr, data) {
 
       type: 'category',
 
-      nameTextStyle: {//在name值存在下,设置name的样式
+      // nameTextStyle: {//在name值存在下,设置name的样式
 
-        color: 'white',
+      //   color: 'white',
 
-        fontStyle: 'normal'
+      //   fontStyle: 'normal'
 
-      },
+      // },
 
       nameLocation:'end',
 
@@ -84,7 +84,7 @@ function initChart(canvas, width, height, dpr, data) {
 
       boundaryGap: false,//1.true 数据点在2个刻度直接  2.fals 数据点在分割线上,即刻度值上
 
-      data: timeData,
+      data: data.timeData,
       axisLine: {onZero: true},
       axisLabel: {
 
@@ -113,13 +113,13 @@ function initChart(canvas, width, height, dpr, data) {
 
       position:'right',
 
-      nameTextStyle:{//在name值存在下,设置name的样式
+      // nameTextStyle:{//在name值存在下,设置name的样式
 
-        color:'red',
+      //   color:'red',
 
-        fontStyle:'normal'
+      //   fontStyle:'normal'
 
-      },
+      // },
 
       splitNumber: 5,//坐标轴的分割段数
 
@@ -179,9 +179,9 @@ function initChart(canvas, width, height, dpr, data) {
 
       },
 
-      min: 0,
+      // min: 0,
 
-      max: 100,
+      // max: 100,
 
     },
 
@@ -193,7 +193,7 @@ function initChart(canvas, width, height, dpr, data) {
     
       // smooth:true,
 
-      data: [18, 36, 65, 30, 78, 40, 33],
+      data:data.actual,
 
       symbol: 'none',
       areaStyle: {
@@ -226,7 +226,7 @@ function initChart(canvas, width, height, dpr, data) {
 
       type: 'line',
 
-      data: [10, 30, 31, 50, 40, 20, 10],
+      data: data.prediction,
 
       symbol: 'none',
 
@@ -266,13 +266,134 @@ Page({
           ec: {
       onInit: initChart
     },
-      chartData:[52,56,355,444,52,56,355,444,52,56,355,444,2],
+    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'
+        ]
+      },
       object:{
         title:"appl",
         Withtitle:"appl inc",
         Volume:"545455",
         float:"-5555"
-      }
+      },
+      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天前"
+        },
+      ],
   },
   catchTouchMove:function(res){
     return false
@@ -284,6 +405,13 @@ Page({
       currentTab: e.detail.current
     });
   },
+  //点击新闻
+  onFold:function(e){
+    console.log( e.currentTarget.dataset.id);
+    wx.navigateTo({
+      url:"../news/news"
+      });
+  },
   // 点击tab切换 
   swichNav: function(e) {
     var that = this;

+ 16 - 4
pages/item/item.wxml

@@ -16,22 +16,34 @@
   <view class="swiper-tab-list {{currentTab==1 ? 'on' : ''}}" data-current="1" bindtap="swichNav">下周预测</view>
 </view>
 <view class="map">
-  <view class="map-line">
+  <!-- <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>
+  </view>    -->
   <swiper current="{{currentTab}}" class="swiper-box" duration="300"  style="height:400px" bindchange="bindChange">
 
     <swiper-item catchtouchmove='catchTouchMove'>
      <view style="width:100%;height:100%">
-       <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>
     </swiper-item>
 
     <swiper-item catchtouchmove='catchTouchMove'>
-
+ <ec-canvas  id="mychart-dom-line" canvas-id="mychart-line" tuData="{{ chartData }}" ec="{{ ec }}"></ec-canvas>
     </swiper-item>
   </swiper>
 </view>
+  <view class="news">
+    <text class="news-today">今日快讯</text>
+  </view>
+
+  <block wx:for-index="idx" wx:for='{{aa}}' wx:key="key" >
+    <view class='content-item' bindtap="onFold" data-id="{{item.id}}" >
+      <text class='from' >{{item.from}}</text>
+      <text class='name'>{{item.nickName}}</text>
+      <text class='wawa'>{{item.reward}}</text>
+      <text class='time'>{{item.time}}</text>
+    </view>
+</block> 

+ 54 - 1
pages/item/item.wxss

@@ -105,4 +105,57 @@ ec-canvas {
   width: 30px;
   height: 2px;
   background:#80CDF8;
-}
+}
+
+.news{
+  width:90%;
+  margin: 10px 0 20px 10px;
+}
+
+.news-today{
+  color: #fff;
+  font-size: 40rpx;
+
+}
+
+.content-item {
+  /* height: 50rpx; */
+  /* border-bottom: 1rpx solid #ede1d4; */
+  width: 100%;
+  display: flex;
+  flex-direction: column;
+  background: #1C1C1C;
+  /* margin-bottom: 10rpx; */
+}
+.from{
+  font-size: 24rpx;
+  margin-left: 20rpx;
+  color: #999;
+  margin-top:10rpx;
+}
+.name {
+  font-size: 30rpx;
+  /* line-height: 100rpx; */
+  color: #fff;
+  margin:10rpx 20rpx;
+  /* width: 100%; */
+  height:100%;
+  overflow: hidden;
+  /* border: 1rpx solid red; */
+}
+.wawa {
+  font-size: 26rpx;
+  margin-left:20rpx;
+  /* float: right; */
+  /* line-height: 100rpx; */
+  /* margin-right: 20rpx; */
+  color: #999;
+}
+.time{
+  font-size: 24rpx;
+  margin-left:20rpx;
+  color: #999;
+  margin-top:10rpx;
+  margin-bottom: 10rpx;
+}
+

+ 8 - 1
pages/rise/rise.js

@@ -115,6 +115,13 @@ Page({
         digital:"33",
         data:[52,56,355,444]
       },
+      {
+        title:'AppL',
+        subtitle:"APPL INC",
+        Increase:"1.22",
+        digital:"33",
+        data:[52,56,355,44554]
+      },
       {
         title:'AppL',
         subtitle:"APPL INC",
@@ -159,7 +166,7 @@ Page({
   open: function (e) {
     console.log(e)
     wx.navigateTo({
-      url: '../filter/filter'
+      url: '../item/item'
     });
   }
 })

+ 2 - 1
pages/rise/rise.json

@@ -1,6 +1,7 @@
 {
-  "navigationBarTitleText": "涨幅",
+  "navigationStyle": "custom",
   "usingComponents": {
+    "navBar": "/components/navBar/navBar",
     "ec-canvas": "../../ec-canvas/ec-canvas"
   }
 }

+ 28 - 8
pages/rise/rise.wxml

@@ -1,7 +1,8 @@
+<navBar></navBar>
 <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 {{currentTab==2 ? 'on' : ''}}" data-current="1" bindtap="swichNav">下周预测数据</view>
+  <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 {{currentTab==2 ? 'on' : ''}}" data-current="2" bindtap="swichNav">上周预测榜</view>
 </view>
 
 <swiper current="{{currentTab}}" class="swiper-box" duration="300"  style="height:{{winHeight - 48}}px" bindchange="bindChange">
@@ -13,11 +14,11 @@
           <view class="swiper-box-subtitle">{{item.subtitle}}</view>
         </view>
         <view class="swiper-box-right">
-          <view class="swiper-box-canvas">
+          <!-- <view class="swiper-box-canvas">
             <ec-canvas  id="mychart-dom-line" canvas-id="mychart-line" tuData="{{ item.data }}" ec="{{ ec }}"></ec-canvas>
-          </view>
+          </view> -->
           <view class="swiper-box-button">
-            <view>{{item.digital}}</view>
+            <!-- <view>{{item.digital}}</view> -->
             <button  class="mini-btn" type="warn" size="mini" >+{{item.Increase}}</button>
           </view>
         </view>
@@ -32,11 +33,30 @@
           <view class="swiper-box-subtitle">{{item.subtitle}}</view>
         </view>
         <view class="swiper-box-right">
-          <view class="swiper-box-canvas">
+          <!-- <view class="swiper-box-canvas">
             <ec-canvas  id="mychart-dom-line" canvas-id="mychart-line" tuData="{{ item.data }}" ec="{{ ec }}"></ec-canvas>
+          </view> -->
+          <view class="swiper-box-button">
+            <!-- <view>{{item.digital}}</view> -->
+            <button class="mini-btn" type="warn" size="mini">+{{item.Increase}}</button>
           </view>
+        </view>
+      </view>
+    </scroll-view>
+  </swiper-item>
+    <swiper-item>
+    <scroll-view scroll-y style="height: 100%;">
+      <view wx:for="{{array}}"class="swiper-box-view" wx:key="index" bindtap="open" data-index="{{index}}">
+        <view class="swiper-box-left">
+          <view>{{item.title}}</view>
+          <view class="swiper-box-subtitle">{{item.subtitle}}</view>
+        </view>
+        <view class="swiper-box-right">
+          <!-- <view class="swiper-box-canvas">
+            <ec-canvas  id="mychart-dom-line" canvas-id="mychart-line" tuData="{{ item.data }}" ec="{{ ec }}"></ec-canvas>
+          </view> -->
           <view class="swiper-box-button">
-            <view>{{item.digital}}</view>
+            <!-- <view>{{item.digital}}</view> -->
             <button class="mini-btn" type="warn" size="mini">+{{item.Increase}}</button>
           </view>
         </view>