tanyanfei 3 lat temu
rodzic
commit
34217c04da

+ 5 - 2
pages/comment/comment.wxml

@@ -9,9 +9,12 @@
                   资产:  <view><label>{{item.init_fund}}w</label> (收益 <text  class="{{item.total_income[0]=='-' ?'down':'up'}}">{{item.total_income}}</text>)</view>
         </view>
         <view class="info">
-                  持仓: <view>
-                  <block wx:for="{{item.today_stock}}" wx:for-item='i'>{{i.name}}</block>
+                  持仓: 
+                  <view wx:if='{{item.is_markt}}'>开超市</view>
+                  <view wx:elif='{{item.today_stock.length>0}}'>
+                      <block wx:for="{{item.today_stock}}" wx:for-item='i'>{{i.name}}</block>
                   </view>
+                  <view wx:else>空仓</view>
         </view>
         <view class="comment">
             <text>顽主点评</text>

+ 15 - 1
pages/index/index.js

@@ -4,6 +4,7 @@ const app = getApp()
 const $api = require('../../utils/api.js').API;
 Page({
   data: {
+    loading:0,
     notices:[],
     tabs:['关注','热门股票','胜率榜','防守榜','冠军心得'],
     cur:0,
@@ -37,6 +38,15 @@ Page({
       })
     })
   },
+  fresh: function () {
+    console.log(233)
+    this.setData({
+      page:1,
+      total:0,
+      loading:1
+    })
+    this.getFollow()
+  },
   //关注分页
   next: function () {
     if (this.data.followList.length < this.data.total) {
@@ -49,6 +59,9 @@ Page({
   },
   getFollow(){
     var followList = this.data.followList
+    if(this.data.loading){
+      followList=[]
+    }
     $api.getMyFollow({
       page: this.data.page, page_size: 20
     }).then(res => {
@@ -58,7 +71,8 @@ Page({
       this.setData({
         followList: followList,
         total:res.data.data.total,
-        error:0
+        error:0,
+        loading: 0
       })
     })
     .catch(err=>{

+ 11 - 9
pages/index/index.wxml

@@ -14,7 +14,8 @@
 
 <swiper current='{{cur}}'  bindchange='curChange'>
   <swiper-item>
-      <scroll-view  scroll-y='{{true}}' bindscrolltolower='next'>
+      <scroll-view   upper-threshold="0" bindscrolltoupper='fresh' scroll-y='{{true}}' bindscrolltolower='next'>
+          <view wx:if='{{loading}}' class="loading">下拉刷新</view>
           <view  class="item1" wx:for='{{followList}}'>
             <navigator  url="../today/today?id={{item.match_id}}&record_id={{item.id}}&player_id={{item.player_id}}">
               <view class="name">{{item.username}}  <text wx:if='{{item.badge}}'>{{item.badge}}</text> 
@@ -29,14 +30,15 @@
                 胜率<text  class="{{item.win_rate[0]=='-' ?'down':'up'}}"> {{item.win_rate}}</text>
                 )</view>
               </view>
-              <view class="info">
-                持仓: <view>
-                <block wx:for='{{item.today_stock}}' wx:for-item='i'>
-                  {{i.name}}({{i.fund}}w)
-                </block>
+               <view class="info">
+                  持仓: 
+                    <view wx:if='{{item.is_markt}}'>开超市</view>
+                    <view wx:elif='{{item.today_stock.length>0}}'>
+                        <block wx:for="{{item.today_stock}}" wx:for-item='i'> {{i.name}}({{i.fund}}w) </block>
+                    </view>
+                    <view wx:else>空仓</view>
                 </view>
-              </view>
-              </navigator>
+                </navigator>
               <view class="imgs">
                 <image wx:for='{{item.today_stock_img}}' wx:for-item='i'  bindtap="preview" data-src='{{i}}' data-urls='{{item.today_stock_img}}'
                  class="img" src="{{i}}"></image>
@@ -101,7 +103,7 @@
                     资产:  
                     <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 style="color:#666;">最大回撤</text>
                       <text class="{{item.badest_income[0]=='-' ?'down':'up'}}"> {{item.badest_income}} </text>)
                   </view>
                 </view>

+ 2 - 2
pages/list/list.wxml

@@ -1,6 +1,6 @@
 <view class="total">
   应到 {{total_person}}人 | 实到 {{actual_person}} 人 | 请假 {{leave_person}} 人    
-  <text>盈亏比  {{loss_person}}:{{win_person}}</text>
+  <view>盈亏比  <text class="up">{{loss_person}}</text> : <text class="down">{{win_person}}</text></view>
 </view>
 <view class="top">
     <text>排名</text>
@@ -18,7 +18,7 @@
     </view>
 </view>
 <scroll-view scroll-y="true" class="list" bindscrolltolower='next'>
-    <navigator class="item" wx:for='{{list}}'  url="../today/today?id={{item.match_id}}&record_id={{item.id}}&player_id={{player.player_id}}">
+    <navigator class="item" wx:for='{{list}}'  url="../today/today?id={{item.match_id}}&record_id={{item.id}}&player_id={{item.player_id}}">
         <image wx:if='{{item.group_rank==1}}' mode="widthFix" src="../../images/1.png"></image>
         <image wx:if='{{item.group_rank==2}}' mode="widthFix" src="../../images/2.png"></image>
         <image wx:if='{{item.group_rank==3}}' mode="widthFix" src="../../images/3.png"></image>

+ 1 - 1
pages/list/list.wxss

@@ -91,7 +91,7 @@ page{
   color: #666;
   font-size: 28rpx;
 }
-.total text{
+.total view{
   color: #666;
   font-size: 28rpx;
   float: right;

+ 11 - 6
pages/stock/stock.wxml

@@ -11,20 +11,25 @@
   <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>{{item.stock_date}}</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>
+
     <view class="info">
-                持仓:<view>
-                <block wx:for='{{item.today_stock}}' wx:for-item='i'>
-                  {{i.name}}({{i.fund}}w)
-                </block>
-                </view>
+                  持仓: 
+                    <view wx:if='{{item.is_markt}}'>开超市</view>
+                    <view wx:elif='{{item.today_stock.length>0}}'>
+                        <block wx:for="{{item.today_stock}}" wx:for-item='i'> {{i.name}}({{i.fund}}w) </block>
+                    </view>
+                    <view wx:else>空仓</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}}
+    <navigator class="list" url="../stock/stock?id={{item.id}}&&date={{stock_date}}" wx:for='{{list}}'>{{item.stock_name}}
     <view class="num">持仓 <text>{{item.count}}</text> 人</view>
     </navigator>
     <block wx:if='{{total >= 20}}'>

+ 2 - 1
pages/stock/stock.wxss

@@ -108,7 +108,8 @@ image{
   margin: auto;
 }
 .list{
-  padding: 20rpx 0;
+  padding: 40rpx 0;
+  border-bottom: 1px solid #F5F5F5;
 }
 .num{
   font-size: 28rpx;

+ 12 - 4
pages/today/today.wxml

@@ -54,11 +54,11 @@
     <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">
+<view class="content" wx:if='{{datas.today_record.experience}}'>
     <view class="title">操盘总结</view>
      {{datas.today_record.experience?datas.today_record.experience:'无'}}
 </view>
-<view class="content">
+<view class="content" wx:if='{{datas.today_record.wanzhu_comment}}'>
     <view class="title">顽主点评</view>
     {{datas.today_record.wanzhu_comment?datas.today_record.wanzhu_comment:'无'}}
 </view>
@@ -84,11 +84,19 @@
       <view class="info">
         资产:  <view><label>{{item.today_fund}}w</label> (收益 <text  class="{{item.total_income[0]=='-' ?'down':'up'}}">{{item.total_income}}</text>)</view>
       </view>
-      <view class="info">持仓: <view>
+      <!-- <view class="info">持仓: <view>
           <block wx:for='{{item.today_stock}}' wx:for-item='i'>
             {{i.name}}({{i.fund}}w)
           </block>
-      </view></view>
+      </view></view> -->
+      <view class="info">
+                  持仓: 
+                    <view wx:if='{{item.is_markt}}'>开超市</view>
+                    <view wx:elif='{{item.today_stock.length>0}}'>
+                        <block wx:for="{{item.today_stock}}" wx:for-item='i'> {{i.name}}({{i.fund}}w) </block>
+                    </view>
+                    <view wx:else>空仓</view>
+      </view>
     </navigator>
     <view class="imgs">
           <image wx:for='{{item.today_stock_img}}' wx:for-item='i'  bindtap="preview" data-src='{{i}}' data-urls='{{item.today_stock_img}}'

+ 1 - 1
pages/upload/upload.wxml

@@ -16,7 +16,7 @@
       </view>
       
       <view class="stock_list" wx:if='{{stockList.length>0 && cur==index}}'>
-        <view wx:for='{{stockList}}' catchtap="bindPickerChange" wx:for-item='s' wx:for-index='i'  data-name='{{s.name}}' wx:key='{{index+""+i}}'>{{s.name}}</view>
+        <view wx:for='{{stockList}}' catchtap="bindPickerChange" wx:for-item='s' wx:for-index='i'  data-name='{{s.name}}' wx:key='{{index+""+i}}'>{{s.label}})</view>
       </view>
     </view>
     <view bindtap="add" class="add"> + 添加持股</view>