xiaoyi 6 mesiacov pred
rodič
commit
7fe894082b

+ 70 - 40
pages/avg/avg.js

@@ -18,7 +18,7 @@ Page({
       onInit: null
     },
     datas:[],
-    date:'',
+    days:[],
   },
 
   /**
@@ -54,30 +54,44 @@ Page({
     $api.getAllDay(param).then(res => {
       // console.log(res.data.data.list)
       if(res.data.code == 0){
+      var week=['一','二','三','四','五','六','七','八','九','十','十一','十二','十三','十四','十五']
+        var days=res.data.data.list,weeks=[[]]
+        days=days.reverse()
+        week.forEach((item,index)=>{
+          weeks[index]={
+            name:'第'+item+'周',
+            data:[],
+            total:0
+          }
+        })
+        var i=0
+        days.forEach(item=>{
+          var w=new Date(item.stock_date).getDay() 
+          item.day=w
+          if(w==1){
+            i++
+          }
+          weeks[i].data.push(item)
+        })
+        weeks.forEach(item=>{
+          if(item.data.length>0){
+            var total=0
+            var money = 10000.0
+            item.data.forEach(i=>{
+              var incom=Number(i.today_income.replace('%',''))
+              money += money*incom/100.0
+              i.date=(new Date(i.stock_date).getMonth()+1)+'/'+(new Date(i.stock_date).getDate())
+            })
+            total = (money-10000)*100.0/10000.0
+            item.total=total.toFixed(2)
+          }
+        })
         records = res.data.data.list
-
-        var data = records[0]
-        var date = data.stock_date.substring(0,7)
-        var days = [], w = new Date(date + '-01').getDay();
-        for (let i = 0; i < w; i++) {
-          days.push({
-            day: '',
-            income: ''
-          })
-        }
-        for (let i = 0; i < records.length; i++) {
-          days.push({
-            day: i+1,
-            income: records[i].today_income,
-          })
-        }
-
         this.setData({
           ec: {
             onInit: initChart
           },
-          days: days,
-          date:date,
+          days:weeks.reverse()
         })
       }
     })
@@ -90,32 +104,47 @@ Page({
     }
     $api.getAvg(param).then(res => {
       if(res.data.code == 0){
-        records = res.data.data.list
-
-        var data = records[0]
-        var date = data.stock_date.substring(0,7)
-        var days = [], w = new Date(date + '-01').getDay();
-        for (let i = 0; i < w; i++) {
-          days.push({
-            day: '',
-            income: ''
-          })
-        }
-        for (let i = 0; i < records.length; i++) {
-          days.push({
-            day: i+1,
-            income: records[i].today_income,
-          })
-        }
-
+        records = res.data.data.list.reverse()
+      var week=['一','二','三','四','五','六','七','八','九','十','十一','十二','十三','十四','十五']
+        var days=res.data.data.list.reverse(),weeks=[[]]
+        days=days.reverse()
+        week.forEach((item,index)=>{
+          weeks[index]={
+            name:'第'+item+'周',
+            data:[],
+            total:0
+          }
+        })
+        var i=0
+        days.forEach(item=>{
+          var w=new Date(item.stock_date).getDay() 
+          item.day=w
+          if(w==1){
+            i++
+          }
+          weeks[i].data.push(item)
+        })
+        weeks.forEach(item=>{
+          if(item.data.length>0){
+            var total=0
+            var money = 10000.0
+            item.data.forEach(i=>{
+              var incom=Number(i.today_income.replace('%',''))
+              money += money*incom/100.0
+              i.date=(new Date(i.stock_date).getMonth()+1)+'/'+(new Date(i.stock_date).getDate())
+            })
+            total = (money-10000)*100.0/10000.0
+            item.total=total.toFixed(2)
+          }
+        })
         this.setData({
           ec: {
             onInit: initChart
           },
-          days: days,
-          date:date,
+          days:weeks.reverse()
         })
       }
+      
     })
   },
 
@@ -187,6 +216,7 @@ Page({
 /**折线图 */
 function initChart(canvas, width, height, dpr) {
   var xdata = [], ydata = [];
+  records = records.reverse()
   for (let i = 0; i < records.length; i++) {
     let date = records[i].stock_date.split('-');
     xdata.push(date[1] + '/' + date[2])

+ 24 - 30
pages/avg/avg.wxml

@@ -1,47 +1,41 @@
 <!--pages/avg/avg.wxml-->
 <view class="title"><text>{{match_name}}</text></view>
-<view class="info">当日人均盈亏(算术平均)
-</view>
-
 <view wx:if="{{cur >= 0}}" class="tab">
     <view wx:for='{{list}}' bindtap="tabChange" data-id='{{index}}' class="{{index==cur?'act':''}}">
     {{index==0 ? '全体选手':item.name}}
    </view>
 </view>
-
+<view class="title_1">
+总收益
+</view>
+<view class="info">
+当日提交作业选手的单日平均盈亏累积,不含当日缺席选手
+</view>
 <view class="content">
     <view class="container" wx:if="{{days.length > 1}}">
           <ec-canvas   ec="{{ ec }}">
           </ec-canvas>
     </view>
 </view>
+<view class="title_1">当日人均盈亏
+</view>
+<view class="info">算数平均
+</view>
 
-<view class="content">
-  <view>每日指数</view>
-  <view class="month">
-    <image bindtap="prev" mode="heightFix"  src="../../images/left.png"></image>
-    <picker mode="date" fields="month" value="{{date}}"  bindchange="bindDateChange">
-                <view class="date-picker">
-                   {{date}}
-                   <image  mode="heightFix"  src="../../images/icon_down@2x.png"></image>
-                </view>
-    </picker>
-    <image bindtap="next" mode="heightFix"  src="../../images/right.png"></image>
-  </view>
-  <view class="day">
-    <text>日</text><text>一</text><text>二</text>
-    <text>三</text><text>四</text><text>五</text><text>六</text>
-  </view>
-  <view class="days">
-    <view wx:for='{{days}}'>
-      <view wx:if='{{!item.income}}' style="color:#999;">
-        {{item.day}}
-        <text>{{item.income}}</text>
-      </view>
-      <view   class="{{item.income[0]=='-' ? 'down1':'up1'}}"> 
-        {{item.day}}
-        <text>{{item.income}}</text>
+<view class="week_view">
+  <view wx:if='{{days.length>0}}' class=" ">
+      <view wx:for='{{days}}' wx:if='{{item.data.length>0}}' class="yk">
+        <view class="week_name">{{item.name}}</view>
+        <view class="week_incom">
+          <view wx:for='{{item.data}}' wx:for-item='week' class="{{week.today_income=='0.0%' ?'none':''}} {{week.today_income[0]=='-' ?'down':'up'}}">
+            {{week.date}}
+            <text>{{week.today_income}}</text>
+        </view>
+        </view>
+        <view class="week_total">
+          周收益
+          <text class="{{item.total < 0 ?'down':'up'}}">{{item.total}}%</text>
+        </view>
       </view>
-    </view>
   </view>
 </view>

+ 61 - 4
pages/avg/avg.wxss

@@ -5,27 +5,34 @@
   font-size: 34rpx;
 }
 
+.title_1{
+  margin-left: 20rpx;
+  margin-top: 20rpx;
+  font-size: 30rpx;
+}
+
 .info{
   margin-top: 5rpx;
   margin-left: 20rpx;
-  font-size: 28rpx;
+  font-size: 26rpx;
   color: rgb(128, 128, 128);
 }
 
 .tab{
   background: #fff;
   margin-top: 16rpx;
-  padding:0 20rpx;
+  /* padding:0 10rpx; */
+  margin-left: 20rpx;
   display: flex;
   border-bottom: 1px solid #f2f2f2;
   
 }
 .tab view{
-  font-size: 28rpx;
+  font-size: 30rpx;
   color: #333;
   line-height: 80rpx;
   transition: all .1s linear;
-  margin-right: 30rpx;
+  margin-right:20rpx;
 }
 .tab .act{
   color: #FF583D;
@@ -138,3 +145,53 @@ picker{
   color: #fff;
 }
 
+.week_view{
+  padding-top: 50rpx;
+  /* padding: 20rpx; */
+  padding-left: 20rpx;
+  padding-bottom: 200rpx;
+}
+
+.yk{
+  display: flex;
+  justify-content: space-between;
+  font-size: 24rpx;
+}
+
+.week_name{
+  width: 15%;
+  padding: 12px 0;
+  font-size: 26rpx;
+}
+.week_total{
+  width: 15%;
+  text-align: center;
+  padding: 10rpx 0;
+}
+.week_incom{
+  width: 70%;
+  display: flex;
+}
+.week_incom>view{
+  padding: 10rpx 0;
+  width: 100rpx;
+  text-align: center;
+  /* border: 1px solid red; */
+}
+.week_incom text{
+  display: block;
+  color: #fff;
+}
+.week_incom .down{
+  background-color: #07B20B;
+  color: #fff !important;
+}
+.week_incom .up{
+  background-color: #E90001;
+  color: #fff !important;
+}
+.week_incom .none{
+  background-color: #a3a3a3;
+  /* color: #fff !important; */
+}
+

+ 2 - 1
pages/homepage/homepage.wxml

@@ -57,7 +57,8 @@
       <view class="match_ratio">
         总收益<label class="{{item.today_record.total_income[0]=='-' ?'down':'up'}}">{{item.today_record.total_income}}</label>
         胜率<label class="{{item.today_record.total_income[0]=='-' ?'down':'up'}}">{{item.today_record.win_rate}}</label>
-        排名<label class="{{item.today_record.total_income[0]=='-' ?'down':'up'}}">{{item.today_record.group_rank}}</label>
+        排名<label wx:if="{{item.today_record.stock_date==item.match_info.end_time}}" class="{{item.today_record.total_income[0]=='-' ?'down':'up'}}">{{item.today_record.group_rank}}</label>
+        <label wx:else style="color: rgb(150, 150, 150);"> 未完赛</label>
       </view>
     </view>
     

+ 1 - 1
pages/hotuser/hotuser.wxml

@@ -4,7 +4,7 @@
               <image wx:if="{{index<3}}" class="number" mode="widthFix" src="../../xiao/{{index+1}}.png"></image>
               <text wx:else class="number">{{index+1}}</text>
                 <view class="name">
-                  {{item.player_name}}  <text>{{item.badge}}</text>
+                  {{item.player_name}}
                   <view>关注
                     <text>{{item.count}}</text>
                   </view>

+ 5 - 3
pages/index/index.js

@@ -9,7 +9,7 @@ Page({
     loading:0,
     notices:[],
     tabs:['今日留言','我的关注'],
-    tabs1:['收益榜','盈利榜','亏损榜'],
+    tabs1:['收益榜','盈利榜','亏损榜','跌幅榜'],
     cur:0,
     cur1:0,
     date:'2022-04-27',
@@ -95,11 +95,13 @@ Page({
         weeks.forEach(item=>{
           if(item.data.length>0){
             var total=0
+            var money = 10000.0
             item.data.forEach(i=>{
               var incom=Number(i.today_income.replace('%',''))
-              total+=incom
+              money += money*incom/100.0
               i.date=(new Date(i.stock_date).getMonth()+1)+'/'+(new Date(i.stock_date).getDate())
             })
+            total = (money-10000)*100.0/10000.0
             item.total=total.toFixed(2)
           }
         })
@@ -118,7 +120,7 @@ Page({
         baikeList:res.data.data
       })
     })
-    $api.getChampionlList({category:'游资专场',page:1}).then(res=>{
+    $api.getChampionlList({category:'每日点评',page:1}).then(res=>{
       this.setData({
         articleList1:res.data.data.list
       })

+ 17 - 3
pages/index/index.wxml

@@ -34,9 +34,9 @@
       <image mode="widthFix" src="../../xiao/wdgz@2x.png"></image>
       我的关注
     </navigator>
-    <navigator url="../article/article?type=游资专场">
+    <navigator url="../article/article?type=每日点评">
       <image mode="widthFix" src="../../xiao/yzzc@2x.png"></image>
-      游资专场
+      每日点评
     </navigator>
     <navigator url="../article/article?type=冠军交割">
       <image mode="widthFix" src="../../xiao/gjjg@2x.png"></image>
@@ -176,6 +176,20 @@
             <text class="text down">{{ filters.toFix2(item.total_income*100)}}%</text>
     </navigator>
   </swiper-item>
+  <swiper-item class="up-down">
+    <view class="title_1">
+      <text>收益率</text><text>资产(w)</text><text>盈利(w)</text>
+    </view>
+    <navigator wx:for="{{winLost.total_income_down}}" hover-class="none"  url="../today/today?id={{item.match_id}}&record_id={{item.id}}&user_id={{item.user_id}}">
+            <image wx:if="{{index<3}}" class="number" mode="widthFix" src="../../xiao/{{index+1}}.png"></image>
+            <text wx:else class="number">{{index+1}}</text>
+            <text class="usm">{{item.username}}</text>
+            
+            <text class="text down">{{ filters.toFix2(item.total_income*100)}}%</text>
+            <text class="text">{{item.today_fund}}</text>
+            <text class="text down">{{filters.toFix2(item.today_fund - item.init_fund)}}</text>
+    </navigator>
+  </swiper-item>
 </swiper>
 </view>
 
@@ -183,7 +197,7 @@
   <scroll-view scroll-x='{{true}}'>
     <view class="content-list">
       <view class="up-down">
-        <view class="article-title"> <navigator url="../article/article?type=游资专场">more<image class="more-image" mode="widthFix" src="../../images/right_icon.png"></image></navigator>游资专场</view>
+        <view class="article-title"> <navigator url="../article/article?type=每日点评">more<image class="more-image" mode="widthFix" src="../../images/right_icon.png"></image></navigator>每日点评</view>
         <navigator wx:for="{{articleList1}}" wx:if="{{index<5}}" hover-class="none" url="../detail/detail?id={{item.id}}" >
           <text class="article-name">{{item.name}}</text>
           <image class="article-img" mode="aspectFill" src="{{item.img}}"></image>

+ 1 - 1
pages/index/index.wxss

@@ -115,7 +115,7 @@ image.number{
   font-size: 30rpx;
 }
 .up-down .text{
-  width: 18%;
+  width: 20%;
   /* font-weight: 500; */
   margin-left: 10rpx;
 }

+ 41 - 1
pages/matchdetail/matchdetail.js

@@ -112,6 +112,7 @@ Page({
       today_stock   = res.data.data.today_record.today_stock
       console.log(records,2323)
       let tmoney = ((res.data.data.today_record.today_fund - res.data.data.today_record.init_fund)*10000).toFixed(0)
+      this.getWeek(records)
       this.setData({
         datas: res.data.data,
         total_money:tmoney,
@@ -125,7 +126,7 @@ Page({
       })
 
     
-      this.getDays()
+      // this.getDays()
       wx.hideNavigationBarLoading()
       wx.setNavigationBarTitle({
         title: res.data.data.userinfo.username,
@@ -154,6 +155,44 @@ Page({
     return (+num || 0).toString().replace(/^-?\d+/g, m => m.replace(/(?=(?!\b)(\d{3})+$)/g, ','))
   },
 
+  getWeek(list){
+    var week=['一','二','三','四','五','六','七','八','九','十','十一','十二','十三','十四','十五']
+        var days=list,weeks=[[]]
+        days=days.reverse()
+        week.forEach((item,index)=>{
+          weeks[index]={
+            name:'第'+item+'周',
+            data:[],
+            total:0
+          }
+        })
+        var i=0
+        days.forEach(item=>{
+          var w=new Date(item.stock_date).getDay() 
+          item.day=w
+          if(w==1){
+            i++
+          }
+          weeks[i].data.push(item)
+        })
+        weeks.forEach(item=>{
+          if(item.data.length>0){
+            var total=0
+            var money = 10000.0
+            item.data.forEach(i=>{
+              var incom=Number(i.today_income.replace('%',''))
+              money += money*incom/100.0
+              i.date=(new Date(i.stock_date).getMonth()+1)+'/'+(new Date(i.stock_date).getDate())
+            })
+            total = (money-10000)*100.0/10000.0
+            item.total=total.toFixed(2)
+          }
+        })
+        this.setData({
+          days:weeks.reverse()
+        })
+  },
+  
   getDays(){
     $api.getCalendar({
       user_id:this.data.user_id,
@@ -228,6 +267,7 @@ Page({
 
 function initChart(canvas, width, height, dpr) {
   var xdata = [], ydata = [];
+  records = records.reverse()
   for (let i = 0; i < records.length; i++) {
     let date = records[i].stock_date.split('-');
     xdata.push(date[1] + '/' + date[2])

+ 19 - 29
pages/matchdetail/matchdetail.wxml

@@ -7,7 +7,8 @@
   <view class="head_money">{{total_money}}</view>
   <view class="head_ratio" >
     收益: <label>{{datas.today_record.total_income}}</label>
-    排名: <label>第{{datas.today_record.group_rank}}名</label>
+    排名: <label wx:if="{{datas.today_record.stock_date==datas.match.end_time}}">第{{datas.today_record.group_rank}}名</label>
+    <label wx:else > 未完赛</label>
   </view>
 </view>
 <view class="style" style="margin: 0;">
@@ -34,37 +35,26 @@
           </ec-canvas>
     </view>
 </view>
-<view class="content">
-  <view class="title">每月盈亏</view>
-  <view class="month">
-    <image bindtap="prev" mode="heightFix"  src="../../images/left.png"></image>
-    <picker mode="date" fields="month" value="{{date}}"  bindchange="bindDateChange">
-                <view class="date-picker">
-                   {{date}}
-                   <image  mode="heightFix"  src="../../images/icon_down@2x.png"></image>
-                </view>
-    </picker>
-    <image bindtap="next" mode="heightFix"  src="../../images/right.png"></image>
-  </view>
-  <view class="day">
-    <text>日</text><text>一</text><text>二</text>
-    <text>三</text><text>四</text><text>五</text><text>六</text>
-  </view>
-  <view class="days">
-    <view wx:for='{{days}}'>
-      <view wx:if='{{!item.income}}' style="color:#999;">
-        {{item.day}}
-        <text>{{item.income}}</text>
-      </view>
-      <navigator wx:else bind:tap="pushToday" data-match_id="{{match_id}}" data-record_id="{{item.record_id}}" data-user_id = "{{user_id}}" >
-      <view   class="{{item.income[0]=='-' ? 'down1':'up1'}}"> 
-        {{item.day}}
-        <text>{{item.income}}</text>
+
+<view class="title">每日收益</view>
+<view class="week_view">
+  <view wx:if='{{days.length>0}}'>
+      <view wx:for='{{days}}' wx:if='{{item.data.length>0}}' class="yk">
+        <view class="week_name">{{item.name}}</view>
+        <view class="week_incom">
+          <view wx:for='{{item.data}}' wx:for-item='week' class="{{week.today_income=='0.0%' ?'none':''}} {{week.today_income[0]=='-' ?'down':'up'}}">
+            {{week.date}}
+            <text>{{week.today_income}}</text>
+        </view>
+        </view>
+        <view class="week_total">
+          周收益
+          <text class="{{item.total < 0 ?'week_incom down':'up'}}">{{item.total}}%</text>
+        </view>
       </view>
-      </navigator>
-    </view>
   </view>
 </view>
+
 <view class="title">每日持股</view>
 <view class="days_stock">
   <view  class="stock" wx:for='{{datas.records}}'>

+ 51 - 11
pages/matchdetail/matchdetail.wxss

@@ -317,17 +317,6 @@ picker{
   padding-top: 10rpx;
 }
 
-.up{
-  font-size: 36rpx;
-  color: #E90001 !important;
-  margin-left: 5rpx;
-}
-.down{
-  font-size: 36rpx;
-  color: #07B20B !important;
-  margin-left: 5rpx;
-}
-
 .head{
   background-color: #D94B24;
   height: 360rpx;
@@ -425,4 +414,55 @@ picker{
   color: #999;
   font-size: 28rpx;
   margin-right: 40rpx;
+}
+
+.week_view{
+  padding-top: 50rpx;
+  padding-left: 20rpx;
+  padding-bottom: 50rpx;
+  font-size: 24rpx;
+}
+
+.yk{
+  display: flex;
+  justify-content: space-between;
+  font-size: 24rpx;
+}
+
+.week_name{
+  width: 15%;
+  padding: 12px 0;
+  font-size: 26rpx;
+}
+.week_total{
+  width: 15%;
+  text-align: center;
+  padding: 10rpx 0;
+}
+.week_incom{
+  width: 70%;
+  display: flex;
+  font-size: 26rpx;
+}
+.week_incom>view{
+  padding: 10rpx 0;
+  width: 100rpx;
+  text-align: center;
+  /* border: 1px solid red; */
+}
+.week_incom text{
+  display: block;
+  color: #fff;
+}
+.week_incom .down{
+  background-color: #07B20B;
+  color: #fff !important;
+}
+.week_incom .up{
+  background-color: #E90001;
+  color: #fff !important;
+}
+.week_incom .none{
+  background-color: #a3a3a3;
+  /* color: #fff !important; */
 }

+ 29 - 1
pages/signup/signup.js

@@ -135,6 +135,14 @@ Page({
         return
       }
 
+      if (data.signup_name.length>7){
+        wx.showToast({
+          icon: 'none',
+          title: '名字小于7个字',
+        })
+        return
+      }
+
       if (data.phone.length<11){
         wx.showToast({
           icon: 'none',
@@ -191,7 +199,27 @@ Page({
                 url: '../index/index'
               });
             },
-            fail(res) { console.log(res)}
+            fail(res) {
+              console.log(res)
+              wx.showModal({
+                title: '支付错误',
+                content: '请重新登录',
+                complete: (res) => {
+                  if (res.cancel) {
+                    
+                  }
+              
+                  if (res.confirm) {
+                    wx.removeStorage({
+                      key: 'userInfo'
+                    })
+                    wx.navigateTo({
+                      url: '../login/user',
+                    })
+                  }
+                }
+              })
+            }
           })
       })
   },

+ 1 - 1
pages/signup/signup.wxml

@@ -19,7 +19,7 @@
    <label wx:if='{{type==2}}'>参赛名</label>
    <label wx:else>观赛名</label>
    <view class="tags"> 
-      <input  bindinput="inputchange1" placeholder-style="color:#999;" placeholder="请填写"></input> 
+      <input  bindinput="inputchange1" placeholder-style="color:#999;" placeholder="名字小于7个字"></input> 
   </view>
 </view>
 <view class="item"> 

+ 1 - 2
pages/stock/stock.wxml

@@ -81,13 +81,12 @@
       </view>
     </view>
     <scroll-view  scroll-y='{{true}}' bindscrolltolower='next' style="background: #fff;padding:0 30rpx;">
-        <navigator wx:if='{{todaynb>0}}' url="../nrcomments/nrcomments" class="nbcomment">今日牛人点评</navigator>
         <navigator hover-class="none" class="list" url="../stock/stock?id={{item.id}}&&stock_date={{stock_date}}&type=1" wx:for='{{list}}'>
           <image wx:if="{{index<3}}" class="number" mode="widthFix" src="../../xiao/{{index+1}}.png"></image>
           <text wx:else class="number">{{index+1}}</text>
           <view class="stock-name">
             {{item.stock_name}} <text class="cc">{{filters.toFix2(item.total_fund)}}w</text>
-            <text class="code">6000000 飞行汽车</text>
+            <text class="code">{{item.stock_code}} {{item.stock_desc}}</text>
           </view>
         <view class="num"> <text>{{item.count}}</text> 人持仓 
           <image class="more-image" mode="widthFix" src="../../images/right_icon.png"></image>

+ 2 - 2
pages/stock/stock.wxss

@@ -180,7 +180,7 @@ image.number{
   padding-top: 5rpx;
 }
 .num{
-  font-size: 28rpx;
+  font-size: 32rpx;
   color: #666;
   text-align: right;
   float: right;
@@ -203,7 +203,7 @@ image.number{
 }
 .cc{
   color: #E90001;
-  font-size: 24rpx;
+  font-size: 26rpx;
 }
 .stock_name text{
   color: #999;

+ 2 - 1
pages/upload/upload.js

@@ -251,6 +251,7 @@ Page({
                   that.setData({
                     today_stock_img: today_stock_img
                   })
+                  that.loadOcr(imgs[0],data.data.url)
                 } else {
                   // 返回错误信息
                   console.log('error')
@@ -269,7 +270,7 @@ Page({
 
   loadOcr(path,url){
     var _this = this
-
+    console.log(path,url)
     wx.getImageInfo({
       src:path,
       success:function(ires){

+ 2 - 2
pages/winloseRank/winloseRank.js

@@ -18,12 +18,12 @@ Page({
     var user_id=options.user_id,match_id=options.match_id
     $api.getWinlossRank({user_id:user_id,rank_type:'win',match_id:match_id}).then(res=>{
       this.setData({
-        win:res.data.data
+        win:res.data.data.slice(0,10)
       })
     })
     $api.getWinlossRank({user_id:1888,rank_type:'loss',match_id:20}).then(res=>{
       this.setData({
-        loss:res.data.data
+        loss:res.data.data.slice(0,10)
       })
     })
   },

+ 2 - 0
pages/winloseRank/winloseRank.wxml

@@ -1,6 +1,8 @@
 <wxs module="filters" src="../../utils/toFixed.wxs" />
 
 <view class="up-down-view" >
+  <view class="title">因截图不全,清仓票不显示等原因,统计有偏差,仅供参考
+  </view>
   <view class="up-title">
        个股盈利榜单
   </view>

+ 7 - 0
pages/winloseRank/winloseRank.wxss

@@ -3,6 +3,13 @@
   background-color: #fff;
   padding: 20rpx;
 }
+
+.title{
+  font-size: 28rpx;
+  color: #999;
+  margin-bottom: 20rpx;
+}
+
 .content-list{
   display: flex;
   width: 300vw;

+ 2 - 2
pages/winlost/winlost.js

@@ -9,7 +9,7 @@ Page({
    */
   data: {
     winLost:[],
-    tabs1:['收益榜','盈利榜','亏损榜'],
+    tabs1:['收益榜','盈利榜','亏损榜','亏损榜'],
     cur1:0
   },
 
@@ -23,7 +23,7 @@ Page({
       })
       var tabs=[],curs=[]
       res.data.data.forEach((item,index)=>{
-        tabs.push(['收益榜','盈利榜','亏损榜'])
+        tabs.push(['收益榜','盈利榜','亏损榜','跌幅榜'])
         curs.push(0)
       })
       this.setData({

+ 14 - 0
pages/winlost/winlost.wxml

@@ -49,6 +49,20 @@
             <text class="text down">{{ filters.toFix2(item.total_income*100)}}%</text>
     </navigator>
   </swiper-item>
+  <swiper-item class="up-down">
+    <view class="title_1">
+      <text>收益率</text><text>资产(w)</text><text>盈利(w)</text>
+    </view>
+    <navigator wx:for="{{list.total_income_down}}" hover-class="none"  url="../today/today?id={{item.match_id}}&record_id={{item.id}}&user_id={{item.user_id}}">
+            <image wx:if="{{index<3}}" class="number" mode="widthFix" src="../../xiao/{{index+1}}.png"></image>
+            <text wx:else class="number">{{index+1}}</text>
+            <text class="usm">{{item.username}}</text>
+            
+            <text class="text down">{{ filters.toFix2(item.total_income*100)}}%</text>
+            <text class="text">{{item.today_fund}}</text>
+            <text class="text down">{{filters.toFix2(item.today_fund - item.init_fund)}}</text>
+    </navigator>
+  </swiper-item>
 </swiper>
 
 </view>

+ 2 - 2
utils/api.js

@@ -6,8 +6,8 @@ const DELETE = 'DELETE';
 // wxb299e10e65157301
 // wx2938132b773c7b5a
 // const baseURL = 'https://wx.scxjc.club';
-const baseURL = 'https://test.hunanwanzhu.com';
-// const baseURL = 'https://api.hunanwanzhu.com';
+// const baseURL = 'https://test.hunanwanzhu.com';
+const baseURL = 'https://api.hunanwanzhu.com';
 
 function request(method, url, data) {
   var token='';