tanyanfei 3 سال پیش
والد
کامیت
1205efe6de
11فایلهای تغییر یافته به همراه92 افزوده شده و 54 حذف شده
  1. 4 0
      app.wxss
  2. BIN
      images/ss2.png
  3. 8 9
      pages/index/index.wxml
  4. 11 5
      pages/rank/rank.wxml
  5. 19 14
      pages/rank/rank.wxss
  6. 3 3
      pages/record/record.wxml
  7. 1 1
      pages/stock/stock.js
  8. 6 6
      pages/stock/stock.wxml
  9. 2 1
      pages/stock/stock.wxss
  10. 22 4
      pages/today/today.js
  11. 16 11
      pages/today/today.wxml

+ 4 - 0
app.wxss

@@ -27,7 +27,11 @@ page,view,text,swiper,scroll-view{
   text-align: center;
   color: #999;
   padding: 10rpx 0;
+  font-size: 26rpx;
 }
 .info{
   width: 100%;
+}
+.info view{
+  font-size: 29rpx !important;
 }

BIN
images/ss2.png


+ 8 - 9
pages/index/index.wxml

@@ -59,7 +59,7 @@
               </picker>
               <view class="hot">
                     <view class="tab1">热门持仓</view>
-                    <navigator url="../stock/stock?id={{item.id}}" class="gp" wx:for='{{hotbuyList}}' wx:if='{{index<3}}'>
+                    <navigator url="../stock/stock?id={{item.id}}&date={{date}}" class="gp" wx:for='{{hotbuyList}}' wx:if='{{index<3}}'>
                         <image wx:if='{{index==0}}' mode="widthFix" src="../../images/1.png"></image>
                         <image wx:if='{{index==1}}' mode="widthFix" src="../../images/2.png"></image>
                         <image wx:if='{{index==2}}' mode="widthFix" src="../../images/3.png"></image>
@@ -70,7 +70,7 @@
               </view>
               <view class="hot">
                     <view class="tab2">热门清仓</view>
-                    <navigator url="../stock/stock?id={{item.id}}" class="gp" wx:for='{{hotsellList}}' wx:if='{{index<3}}'>
+                    <navigator url="../stock/stock?id={{item.id}}&date={{date}}" class="gp" wx:for='{{hotsellList}}' wx:if='{{index<3}}'>
                         <image wx:if='{{index==0}}' mode="widthFix" src="../../images/1.png"></image>
                         <image wx:if='{{index==1}}' mode="widthFix" src="../../images/2.png"></image>
                         <image wx:if='{{index==2}}' mode="widthFix" src="../../images/3.png"></image>
@@ -85,7 +85,7 @@
   <swiper-item>
       <scroll-view  scroll-y='{{true}}' bindscrolltolower='next1'>
           <view class="item3">
-             <navigator class="win" wx:for='{{winList}}' url="">
+             <navigator class="win" wx:for='{{winList}}' url="../today/today?id={{item.match_id}}&player_id={{item.player_id}}">
                 <image wx:if='{{index==0}}' mode="widthFix" src="../../images/1.png"></image>
                 <image wx:if='{{index==1}}' mode="widthFix" src="../../images/2.png"></image>
                 <image wx:if='{{index==2}}' mode="widthFix" src="../../images/3.png"></image>
@@ -100,10 +100,10 @@
                 <label class="tag" wx:for='{{item.style}}' wx:for-item='i'>{{i}}</label></view>
                 <view class="info">
                     资产:  
-                    <view><label>{{item.today_fund}}w</label>总收益 <text class='up'> {{item.total_income}} </text> 
+                    <view><label>{{item.today_fund}}w</label>(总收益 <text class='up'> {{item.total_income}} </text> 
                       <text style="color:#F5F5F5;">  |  </text>
                       <text style="font-weight:500;color:#666;">最大回撤</text>
-                      <text class="{{item.badest_income[0]=='-' ?'down':'up'}}"> {{item.badest_income}} </text>
+                      <text class="{{item.badest_income[0]=='-' ?'down':'up'}}"> {{item.badest_income}} </text>)
                   </view>
                 </view>
              </navigator>
@@ -116,7 +116,7 @@
   <swiper-item>
       <scroll-view  scroll-y='{{true}}' bindscrolltolower='next2'>
           <view class="item4">
-            <navigator class="win" wx:for='{{defendList}}' url="">
+            <navigator class="win" wx:for='{{defendList}}' url="../today/today?id={{item.match_id}}&player_id={{item.player_id}}">
                 <image wx:if='{{index==0}}' mode="widthFix" src="../../images/1.png"></image>
                 <image wx:if='{{index==1}}' mode="widthFix" src="../../images/2.png"></image>
                 <image wx:if='{{index==2}}' mode="widthFix" src="../../images/3.png"></image>
@@ -130,11 +130,10 @@
                 <label class="tag" wx:for='{{item.style}}' wx:for-item='i'>{{i}}</label></view>
                 <view class="info">
                     资产:  
-                    <view><label>{{item.today_fund}}w</label> 
-                    (总收益 <text class="{{item.total_income[0]=='-' ?'down':'up'}}">{{item.total_income}}</text> 
+                    <view><label>{{item.today_fund}}w</label>(总收益 <text class="{{item.total_income[0]=='-' ?'down':'up'}}">{{item.total_income}}</text> 
                       <text style="color:#F5F5F5;">  |  </text>
                       胜率
-                      <text class="{{item.win_rate[0]=='-' ?'down':'up'}}">{{item.win_rate}}</text> 
+                      <text class="{{item.win_rate[0]=='-' ?'down':'up'}}">{{item.win_rate}}</text> )
                   </view>
                 </view>
             </navigator>

+ 11 - 5
pages/rank/rank.wxml

@@ -1,6 +1,5 @@
-<view class="_top">
+<!-- <view class="_top">
   <navigator url="../search/search"><image class="search" mode="heightFix" src="../../images/ss.png"></image></navigator>
-  <!-- {{date}} -->
   <picker mode="date" value="{{date}}"  bindchange="bindDateChange">
                 <view class="date-picker">
                    {{date}}
@@ -8,12 +7,19 @@
                 </view>
   </picker>
   
-</view>
+</view> -->
 
 <view class="game_info" wx:if='{{datas.match.name}}'>
-    <image   mode="widthFix" src="../../images/jiangbei.png"></image>
+    <!-- <image   mode="widthFix" src="../../images/jiangbei.png"></image> -->
     <text>{{datas.match.name}}</text>
-    {{datas.match.start_time}}至{{datas.match.end_time}}
+    <!-- {{datas.match.start_time}}至{{datas.match.end_time}} -->
+    <picker mode="date" value="{{date}}"  bindchange="bindDateChange">
+                <view class="date-picker">
+                   {{date}}
+                   <!-- <image  mode="heightFix"  src="../../images/icon_rise@2x.png"></image> -->
+                </view>
+    </picker>
+    <navigator class="search" url="../search/search"><image  mode="heightFix" src="../../images/ss2.png"></image></navigator>
 </view>
 
 <view class="top">

+ 19 - 14
pages/rank/rank.wxss

@@ -10,40 +10,45 @@ page{
   position: relative;
   line-height: 80rpx;
 }
-._top image{
+.date-picker{
+  margin-top: 20rpx;
+}
+.date-picker image{
   height: 30rpx;
   position: relative;
   top: 4rpx;
 }
-._top .search{
+.search{
   height: 45rpx;
   position: absolute;
-  left: 30rpx;
-  top: 0;
-  bottom: 0;
-  margin: auto;
+  right: 30rpx;
+  bottom: 0rpx;
+}
+.search image{
+  height: 45rpx;
 }
 .game_info{
   position: relative;
-  padding: 40rpx;
-  padding-left: 150rpx;
-  background: #D94B24;
-  color: rgba(255, 255, 255, 0.85);
+  padding: 20rpx 20rpx 0;
+  /* padding-left: 150rpx; */
+  background: #fff;
+  color: #333;
   font-size: 28rpx;
+  text-align: center;
 }
 .game_info image{
-  width: 80rpx;
+  /* width: 80rpx;
   position: absolute;
   left: 50rpx;
   top: 0;
   bottom: 0;
-  margin: auto;
+  margin: auto; */
 }
 .game_info text{
   display: block;
   font-size: 36rpx;
   font-weight: 500;
-  color: #FFF;
+  color: #333;
   line-height: 50rpx;
 }
 
@@ -137,5 +142,5 @@ page{
   top: 30rpx;
 }
 .date-picker{
-  color: #fff;
+  color: #666;
 }

+ 3 - 3
pages/record/record.wxml

@@ -4,7 +4,7 @@
                   日期: <view>{{info.stock_date}}</view>
   </view>
   <view class="info">
-                资产:<view><label>{{info.today_fund}}w</label>今日收益 <text  class="{{info.today_income[0]=='-' ?'down':'up'}}">{{info.today_income}}%</text><text style="color:#F5F5F5;">  |  </text>总收益<text  class="{{info.total_income[0]=='-' ?'down':'up'}}">{{info.total_income}}%</text>)</view>
+                资产:<view><label>{{info.today_fund}}w</label>(今日收益 <text  class="{{info.today_income[0]=='-' ?'down':'up'}}">{{info.today_income}}</text><text style="color:#F5F5F5;">  |  </text>总收益<text  class="{{info.total_income[0]=='-' ?'down':'up'}}">{{info.total_income}}</text>)</view>
   </view>
   <view class="info">
                 持仓: <view>
@@ -20,8 +20,8 @@
 </view>
 
 <view class="content">
-    <text>操盘总结</text>{{info.experience}}
+    <text>操盘总结</text>{{info.experience?info.experience:'无'}}
 </view>
 <view class="content comment">
-    <text>顽主点评</text>{{info.wanzhu_comment}} 
+    <text>顽主点评</text>{{info.wanzhu_comment?info.wanzhu_comment:'无'}} 
 </view>

+ 1 - 1
pages/stock/stock.js

@@ -25,7 +25,7 @@ Page({
     })
     if (options.id){
       this.setData({id:options.id})
-      $api.getStock({ id: options.id}).then(res=>{
+      $api.getStock({ id: options.id, stock_date: this.data.stock_date}).then(res=>{
             this.setData({
               info:res.data.data
             })

+ 6 - 6
pages/stock/stock.wxml

@@ -6,22 +6,22 @@
 </view>
 
 <view wx:if='{{id}}'>
-  <image wx:show='{{info.img}}' mode="withFix" src="{{info.img}}"></image>
-  <view class="desc">{{info.desc}}</view>
-  <view class="player" wx:for='{{info.list}}'>
+  <image wx:if='{{info.img}}' mode="withFix" src="{{info.img}}"></image>
+  <view wx:if='{{info.desc}}' class="desc">{{info.desc}}</view>
+  <navigator class="player" wx:for='{{info.list}}' url="../today/today?id={{item.match_id}}&player_id={{item.player_id}}">
     <view class="name">{{item.username}}  <text>{{item.badge}}</text> 
     <view>TOP <text>{{item.group_rank}}</text></view></view> 
     <view class="info">
-                资产:<view><label>{{item.today_fund}}w</label>今日收益 <text  class="{{item.today_income[0]=='-' ?'down':'up'}}">{{item.today_income}}</text><text style="color:#F5F5F5;">  |  </text>总收益<text  class="{{item.total_income[0]=='-' ?'down':'up'}}">{{item.total_income}}</text></view>
+                资产:<view><label>{{item.today_fund}}w</label>(今日收益 <text  class="{{item.today_income[0]=='-' ?'down':'up'}}">{{item.today_income}}</text><text style="color:#F5F5F5;">  |  </text>总收益<text  class="{{item.total_income[0]=='-' ?'down':'up'}}">{{item.total_income}}</text>)</view>
     </view>
     <view class="info">
-                持仓: <view>
+                持仓:<view>
                 <block wx:for='{{item.today_stock}}' wx:for-item='i'>
                   {{i.name}}({{i.fund}}w)
                 </block>
                 </view>
     </view>
-  </view>
+  </navigator>
 </view>
 <scroll-view wx:else scroll-y='{{true}}' bindscrolltolower='next'>
     <navigator class="list" url="../stock/stock?id={{item.id}}" wx:for='{{list}}'>{{item.stock_name}}

+ 2 - 1
pages/stock/stock.wxss

@@ -38,7 +38,7 @@ image{
   top: -5rpx;
 }
 .info{
-  font-size: 30rpx;
+  font-size: 29rpx;
   padding: 10rpx 0;
   display: flex;
 }
@@ -46,6 +46,7 @@ image{
   color: #666;
   width: 85%;
   vertical-align: top;
+  /* font-size: 27rpx; */
 }
 .info label{
   font-weight: 500;

+ 22 - 4
pages/today/today.js

@@ -35,6 +35,9 @@ Page({
     if (this.data.id) {
       data.id = this.data.id
     }
+    if (this.data.player_id) {
+      data.player_id = this.data.player_id
+    }
     if (this.data.record_id) {
       data.record_id = this.data.record_id
     }
@@ -234,22 +237,37 @@ function initChart1(canvas, width, height, dpr) {
   today_stock.forEach(item=>{
     item.value = item.fund
   })
+  var radius = today_stock.length<9?'65%':'50%';
   var option = {
     backgroundColor: "#ffffff",
     legend: {
       show: true,
       orient: 'vertical',
-      left: '70%'
+      right: '1%',
+      formatter: function (name){
+        var index = 0;
+        today_stock.forEach(function (value, i) {
+          if (value.name == name) {
+            index = i;
+          }
+        });
+        return name + "  " + today_stock[index].value;
+      }
     },
     series: [{
       label: {
+        
         normal: {
-          fontSize: 14
+          show: true,
+          fontSize: 12,
+          formatter: function (a) {
+            return Math.round(a.percent)+'%'
+          }
         }
       },
       type: 'pie',
-      center: ['40%', '40%'],
-      radius: ['0%', '65%'],
+      center: ['37%', '40%'],
+      radius: ['0%', radius],
       data: today_stock
       
     }]

+ 16 - 11
pages/today/today.wxml

@@ -19,22 +19,27 @@
           </view>
           <view class="info">
               资产: 
-               <view><label>{{datas.today_record.today_fund}}w</label> 
-              (今日收益 
-              <text  class="{{datas.today_record.today_income[0]=='-' ?'down':'up'}}">{{datas.today_record.today_income}}</text>
-              <text style="color:#F5F5F5;">  |  </text>
-              总收益 
+               <view><label>{{datas.today_record.today_fund}}w</label>(今日收益
+               <text  class="{{datas.today_record.today_income[0]=='-' ?'down':'up'}}">{{datas.today_record.today_income}}</text>
+              <text style="color:#F5F5F5;display:block;height:0;"> </text>
+              总收益
               <text  class="{{datas.today_record.total_income[0]=='-' ?'down':'up'}}">{{datas.today_record.total_income}}</text>
               )</view>
           </view>
-          <view class="bottom">
+          <view class="bottom" wx:if='{{!datas.today_record.is_markt}}'>
               今日持仓 <text>{{datas.today_record.today_stock_total}}W</text>
               仓位 <text>{{datas.today_record.cangwei}}</text>
           </view>
+          <view class="bottom" wx:else>
+            开超市
+          </view>
       </view>          
 </view>
 <view class="page_top">
-  <view wx:if='{{datas.today_record.today_stock.length>0}}' class="container" style="height:400rpx;">
+  <view wx:if='{{datas.today_record.today_stock.length>0&&datas.today_record.today_stock.length<9}}' class="container" style="height:400rpx;">
+    <ec-canvas id="mychart-dom-pie" canvas-id="mychart-pie" ec="{{ ec1 }}"></ec-canvas>
+  </view>
+  <view wx:if='{{datas.today_record.today_stock.length>8}}' class="container" style="height:550rpx;">
     <ec-canvas id="mychart-dom-pie" canvas-id="mychart-pie" ec="{{ ec1 }}"></ec-canvas>
   </view>
   <!-- <view class="legend">
@@ -49,13 +54,13 @@
     <image wx:for='{{datas.today_record.today_stock_img}}' wx:for-item='i'  bindtap="preview" data-src='{{i}}' data-urls='{{datas.today_record.today_stock_img}}'
                  class="img" src="{{i}}"></image>
 </view>
-<view class="content" wx:if='{{datas.today_record.experience}}'>
+<view class="content">
     <view class="title">操盘总结</view>
-     {{datas.today_record.experience}}
+     {{datas.today_record.experience?datas.today_record.experience:'无'}}
 </view>
-<view class="content" wx:if='{{datas.today_record.wanzhu_comment}}'>
+<view class="content">
     <view class="title">顽主点评</view>
-    {{datas.today_record.wanzhu_comment}}
+    {{datas.today_record.wanzhu_comment?datas.today_record.wanzhu_comment:'无'}}
 </view>
 <view class="content">
     <view class="title">收益曲线</view>