tanyanfei 3 lat temu
rodzic
commit
ee3071a95a

+ 2 - 1
app.json

@@ -1,10 +1,11 @@
 {
 "pages": [
+  "pages/homepage/homepage",
   "pages/today/today",
   "pages/user/user",
   "pages/rethink/rethink",
     "pages/message/message",
-    "pages/homepage/homepage",
+    
     "pages/index/index",
     "pages/rank/rank",
     

+ 1 - 0
pages/homepage/homepage.js

@@ -26,6 +26,7 @@ Page({
     
 
     // options.id = 7, options.record_id = 29014
+    options.id = 9, options.player_id = 3520
     id = options.id, record_id = options.record_id
     this.setData({
       id: id,

+ 1 - 1
pages/homepage/homepage.json

@@ -1,5 +1,5 @@
 {
-  "navigationBarTitleText": "今日持仓",
+  "navigationBarTitleText": "Ta的主页",
   "usingComponents": {
     "ec-canvas": "../../ec-canvas/ec-canvas"
   }

+ 50 - 35
pages/homepage/homepage.wxml

@@ -1,5 +1,48 @@
-
-<view class="player">
+<view class="per_top">
+    <image src="../../images/page1.png" ></image>
+    <view class="name">
+      {{datas.today_record.username}}
+      <view class="fans">
+          <text>2626</text>粉丝
+          <text style="margin-left: 20rpx;">2626</text>关注
+      </view>
+    </view>
+    <view class="follow" style="width:140rpx;" wx:if='{{is_follow}}' data-action='cancel' bindtap="followPlayer">取消关注</view>
+    <view class="follow" wx:else  bindtap="followPlayer">+ 关注</view>
+</view>
+<view class="style">
+  <view wx:if='{{datas.today_record.style.length>0}}'>
+    <text>风格</text><label wx:for='{{datas.today_record.style}}' class="tag">{{item}}</label>
+  </view>
+  <view>
+    <text>股龄</text>6年 
+  </view>
+  <view>
+    <text>城市</text>重庆
+  </view>
+  <view>
+    <text>跟踪股票</text>金刚玻璃、国机汽车、华夏银行
+  </view>
+</view>
+<view class="style" style="margin: 0;">
+    <view class="game">参赛  <picker>第49届顽主杯实盘大赛</picker></view>
+    <view>
+      <text>时间</text>{{datas.today_record.stock_date}}
+    </view>
+    <view>
+      <text>排名</text>{{datas.today_record.group_rank}}({{datas.today_record.match_group_name}})
+    </view>
+    <view>
+      <text>初始资产</text>{{datas.today_record.today_fund}}W
+    </view>
+    <view>
+      <text>结束资产</text>{{datas.today_record.today_fund}}W( 收益<label  class="{{datas.today_record.today_income[0]=='-' ?'down':'up'}}">{{datas.today_record.today_income}}</label>)
+    </view>
+    <view>
+      <text>胜率</text>{{datas.today_record.win_rate}}(最大回撤 <label class="{{datas.today_record.badest_income[0]=='-' ?'down':'up'}}"> {{datas.today_record.badest_income}} </label>)
+    </view>
+</view>
+<!-- <view class="player">
       <view class="name">{{datas.today_record.username}}  <text>{{datas.today_record.badge}}</text>
       <view style="width:140rpx;" wx:if='{{is_follow}}' data-action='cancel' bindtap="followPlayer">取消关注</view>
       <view wx:else  bindtap="followPlayer">+关注</view></view>  
@@ -9,7 +52,6 @@
           </view>
           <view class="info">
                   排名: <view>{{datas.today_record.group_rank}}
-                  <!-- /{{datas.today_record.players_num}} -->
                   ({{datas.today_record.match_group_name}})</view>
           </view>
           <view class="info">
@@ -22,7 +64,6 @@
           <view class="info">
               今日资产: 
                 <label> {{datas.today_record.today_fund}}w</label>
-              <!-- <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 class="info">初始资产:
@@ -40,36 +81,10 @@
             空仓
           </view>
       </view>          
-</view>
-<view class="page_top">
-  <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">
-      <view>久盛电气  80w</view>
-      <view>久盛电气  80w</view>
-      <view>久盛电气  80w</view>
-  </view> -->
-</view>
+</view> -->
 
-<view class="imgs" wx:if='{{datas.today_record.today_stock_img.length>0}}'>
-    <view class="title">交割单</view>
-    <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="title">今日反思</view>
-     {{datas.today_record.experience?datas.today_record.experience:'无'}}
-</view>
-<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>
 <view class="content">
-    <view class="title">收益曲线</view>
+    <!-- <view class="title">收益曲线</view> -->
     <view class="container" wx:if='{{datas.records.length>0}}'>
           <ec-canvas   ec="{{ ec }}">
           </ec-canvas>
@@ -111,7 +126,7 @@
   <view  class="stock" wx:for='{{stockList}}' wx:if="{{index<3}}">
     <navigator hover-class="none">
       <view class="info">
-        <view>{{item.stock_date}}(今日收益 <text  class="{{item.today_income[0]=='-' ?'down':'up'}}">{{item.today_income}}</text>)</view>
+        <view class="date">{{item.stock_date}}(今日收益 <text  class="{{item.today_income[0]=='-' ?'down':'up'}}">{{item.today_income}}</text>)</view>
       </view>
       <view class="info">
         资产:  <view><label>{{item.today_fund}}w</label> (总收益 <text  class="{{item.total_income[0]=='-' ?'down':'up'}}">{{item.total_income}}</text>)</view>
@@ -128,9 +143,9 @@
       <view class="info" wx:if='{{item.experience}}'>
         今日反思:{{item.experience}}
       </view>
-      <view class="info" wx:if='{{item.wanzhu_comment}}'>
+      <!-- <view class="info" wx:if='{{item.wanzhu_comment}}'>
         顽主点评:{{item.wanzhu_comment}}
-      </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}}'

+ 59 - 36
pages/homepage/homepage.wxss

@@ -26,53 +26,64 @@ ec-canvas {
   z-index: 99;
 }
 
+.per_top{
+  height: 138rpx;
+  position: relative;
+  padding:24rpx;
+  background: #D94B24;
+}
+.per_top>image{
+  width: 90rpx;
+  height: 90rpx;
+  position: absolute;
+  left: 24rpx;
+  top: 24rpx;
+  border-radius: 100%;
+}
+
 .name{
-  font-size:36rpx;
+  font-size:32rpx;
   font-weight: 500;
-  margin-bottom: 20rpx;
+  margin-left: 110rpx;
+  color: #fff;
 }
-.name>text{
-  color: #AAAAAA;
-  font-size: 22rpx;
-  border: 1px solid #AAAAAA;
-  border-radius: 4rpx;
-  font-weight: 400;
-  padding: 0 4rpx;
-  position: relative;
-  top: -3rpx;
+.fans{
+  color: rgba(255, 255, 255, 0.75);
+  font-size: 28rpx;
+  margin-top: 10rpx;
 }
-.name view{
-  float: right;
-  color: #D94B24;
+.fans text{
+  color: #FFF;
+  font-weight: bold;
+  margin-right: 10rpx;
+}
+.per_top .follow {
+  color: #fff;
   font-size: 28rpx;
-  text-align: center;
-  position: relative;
-  top: -5rpx;
-  border:1px solid #D94B24;
-  line-height: 48rpx;
-  width: 120rpx;
+  position: absolute;
+  right: 24rpx;
+  top: 32rpx;
+  border: 1px solid #fff;
   border-radius: 8rpx;
+  padding: 5rpx 8rpx;
 }
-
-.info{
+.style{
+  background: #fff;
+  padding: 30rpx;
+  margin-bottom: 20rpx;
   font-size: 30rpx;
-  padding: 10rpx 24rpx;
-  display: flex;
-}
-.info view{
-  color: #666;
-  width: 85%;
-  vertical-align: top;
-}
-.info label{
-  font-weight: 500;
   color: #333;
 }
-.player{
-  background: #fff;
-  padding: 30rpx;
+.style view{
+  padding: 6rpx 0;
 }
-.info .tag{
+.style text{
+  display: inline-block;
+  color: #999;
+  font-size: 30rpx;
+  width: 180rpx;
+}
+.style .tag{
   font-size: 28rpx;
   color: #CE994F;
   border: 1px solid #CE994F;
@@ -81,6 +92,18 @@ ec-canvas {
   font-weight: 400;
   padding: 0 8rpx;
 }
+.game{
+  color: 32rpx;
+  font-weight: bold;
+  margin-bottom: 20rpx;
+}
+.date{
+  border-left: 4px solid #D94B24;
+  padding-left: 4rpx;
+}
+.game picker{
+  float: right;
+}
 .infos{
   background: #FFF4F5;
   border-radius: 16rpx;

+ 2 - 3
pages/today/today.js

@@ -10,6 +10,7 @@ Page({
    */
   data: {
     page:0,
+    focus:false,
     date:'2021-11',
     days:[],
     ec: {
@@ -24,9 +25,7 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-    
-    // id=9&player_id=3520
-    options.id = 9, options.player_id = 3520
+    // options.id = 9, options.player_id = 3520
     id = options.id, record_id = options.record_id
     this.setData({
       id: id,