tanyanfei 3 년 전
부모
커밋
800aad97b2

+ 6 - 3
app.json

@@ -1,10 +1,13 @@
 {
 "pages": [
-  
-    "pages/user/user",
+  "pages/today/today",
+  "pages/user/user",
+  "pages/rethink/rethink",
+    "pages/message/message",
+    "pages/homepage/homepage",
     "pages/index/index",
     "pages/rank/rank",
-    "pages/today/today",
+    
     "pages/apply/apply",
     "pages/stock/stock",
     "pages/upload/upload",

BIN
images/jp.png


+ 349 - 0
pages/homepage/homepage.js

@@ -0,0 +1,349 @@
+// pages/today/today.js
+const app = getApp()
+import * as echarts from '../../ec-canvas/echarts';
+const $api = require('../../utils/api.js').API;
+var id, record_id, records = [], today_stock=[];
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    date:'2021-11',
+    days:[],
+    ec: {
+      onInit: null
+    },
+    ec1: {
+      onInit: null
+    }
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    
+
+    // options.id = 7, options.record_id = 29014
+    id = options.id, record_id = options.record_id
+    this.setData({
+      id: id,
+      record_id: record_id,
+      player_id: options.player_id ? options.player_id:''
+    })
+    this.getData();
+    
+  },
+  getDays(){
+    // match_id   player_id  month: "2021-12"
+    $api.getCalendar({
+      player_id: this.data.player_id,
+      match_id:this.data.id,
+      month: this.data.date
+    }).then(res=>{
+      var days = [], w = new Date(this.data.date + '-01').getDay();
+      for (let i = 0; i < w; i++) {
+        days.push({
+          day: '',
+          income: ''
+        })
+      }
+      for (let i = 0; i < res.data.data.length; i++) {
+        days.push({
+          day: i+1,
+          income: res.data.data[i].today_income
+        })
+      }
+      this.setData({
+        days: days
+      })
+    })
+  },
+  getData(){
+    wx.showNavigationBarLoading();
+    var data = {}
+    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
+    }
+    $api.getPlayerMatch(data).then(res=>{
+      let stock_date=res.data.data.today_record.stock_date.split('-')
+      this.setData({
+        datas: res.data.data,
+        date: stock_date[0] + '-' + stock_date[1],
+        is_follow: res.data.data.is_follow,
+        player_id: res.data.data.today_record.player_id,
+        ec: {
+          onInit: initChart
+        },
+        ec1: {
+          onInit: initChart1
+        }
+      })
+      records = res.data.data.records
+      today_stock = res.data.data.today_record.today_stock
+      this.getDays()
+      wx.hideNavigationBarLoading()
+    })
+    .catch(err=>{
+      wx.hideNavigationBarLoading()
+    })
+    //每日持股
+    var parm={
+      id: data.id, player_id: this.data.player_id
+    }
+    $api.getRecordList(parm).then(res=>{
+        this.setData({
+          stockList:res.data.data.list
+        })
+    })
+  },
+  bindDateChange(e){
+    this.setData({
+      date: e.detail.value
+    })
+    this.getDays()
+  },
+  prev(){
+    var date=this.data.date.split('-'),y=date[0],m=date[1];
+    if(m>1){
+      m--
+    }else{
+      m=12
+      y--
+    }
+    m=(m>9)?m:'0'+m
+    this.setData({
+      date: y+'-'+m
+    })
+    this.getDays()
+  },
+  next() {
+    var date = this.data.date.split('-'), y = date[0], m = date[1];
+    if (m < 12) {
+      m++
+    } else {
+      m = 1
+      y++
+    }
+    m = (m > 9) ? m : '0' + m
+    this.setData({
+      date: y + '-' + m
+    })
+    this.getDays()
+  },
+  //预览
+  preview(e) {
+    wx.previewImage({
+      urls: e.target.dataset.urls,
+      current: e.target.dataset.src
+    })
+  },
+  followPlayer(e){
+    let action = e.target.dataset.action;
+    $api.follow({ follow_id: this.data.player_id, action:action}).then(res=>{
+      wx.showToast({
+        title: action?'取消成功':'已关注',
+      })
+      this.setData({
+        is_follow: !this.data.is_follow
+      })
+      app.globalData.follow=1
+
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})
+
+
+/**折线图 */
+function initChart(canvas, width, height, dpr) {
+    var xdata = [], ydata = [];
+    for (let i = 0; i < records.length; i++) {
+      let date = records[i].stock_date.split('-');
+      xdata.push(date[1] + '/' + date[2])
+      let y = records[i].total_income.replace('%', '')
+      ydata.push(Number(y))
+    }
+    xdata = xdata.reverse()
+    ydata = ydata.reverse()
+    const chart = echarts.init(canvas, null, {
+      width: width,
+      height: height,
+      devicePixelRatio: dpr // new
+    });
+    canvas.setChart(chart);
+    var option = {
+      legend: {
+        show: false
+      },
+      grid: {
+        x: 50,
+        y: 40,
+        x2: 10,
+        y2: 35
+      },
+      tooltip: {
+        show: true,
+        trigger: 'axis',
+        formatter: '{b0}: {c0}%'
+      },
+      xAxis: {
+        type: 'category',
+        data: xdata,
+        axisLabel: {
+          interval: 0,
+          rotate: 40,
+          color: '#999999',
+          interval: 2
+        }
+      },
+      yAxis: {
+        axisLine: {
+          show: true
+        },
+        type: 'value',
+        name: '收益曲线',
+        axisLabel: {
+          formatter: function (value, index) {//隐藏 0
+            let texts = [];
+            texts.push(value + '%')
+            return texts;
+          },
+          show: true
+        },
+      },
+      series: [{
+        name: 'A',
+        type: 'line',
+        smooth: true,
+        symbolSize: 8,
+        lineStyle: {
+          color: '#FF2D68'
+          // color: new echarts.graphic.LinearGradient(1, 0, 0, 0, [{
+          //   offset: 0,
+          //   color: '#FF2D68'
+          // }, {
+          //   offset: 1,
+          //   color: '#4C4BFF'
+          // }]),
+        },
+        itemStyle: {
+          borderWidth: 5,
+          borderColor: '#FFAD52',
+          color: '#FFAD52'
+        },
+        data: ydata
+      }]
+    };
+
+    chart.setOption(option);
+    return chart;
+}
+
+
+
+
+function initChart1(canvas, width, height, dpr) {
+  const chart = echarts.init(canvas, null, {
+    width: width,
+    height: height,
+    devicePixelRatio: dpr // new
+  });
+  canvas.setChart(chart);
+  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',
+      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: {
+          show: true,
+          fontSize: 12,
+          formatter: function (a) {
+            return Math.round(a.percent)+'%'
+          }
+        }
+      },
+      type: 'pie',
+      center: ['37%', '40%'],
+      radius: ['0%', radius],
+      data: today_stock
+      
+    }]
+  };
+
+  chart.setOption(option);
+  return chart;
+}

+ 6 - 0
pages/homepage/homepage.json

@@ -0,0 +1,6 @@
+{
+  "navigationBarTitleText": "今日持仓",
+  "usingComponents": {
+    "ec-canvas": "../../ec-canvas/ec-canvas"
+  }
+}

+ 146 - 0
pages/homepage/homepage.wxml

@@ -0,0 +1,146 @@
+
+<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>  
+      <view class="infos">
+          <view class="info" wx:if='{{datas.today_record.style.length>0}}'>风格:
+          <label wx:for='{{datas.today_record.style}}' class="tag">{{item}}</label>
+          </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">
+                  胜率: <view>{{datas.today_record.win_rate}}(最大回撤 <text class="{{datas.today_record.badest_income[0]=='-' ?'down':'up'}}"> {{datas.today_record.badest_income}} </text>)</view>
+          </view>
+          <view class="info">
+                  日期: <view>{{datas.today_record.stock_date}}(今日收益
+               <text  class="{{datas.today_record.today_income[0]=='-' ?'down':'up'}}">{{datas.today_record.today_income}}</text>)</view>
+          </view>
+          <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">初始资产:
+                <label>{{datas.today_record.init_fund}}w</label>
+          </view>
+          <view class="bottom" wx:if='{{datas.today_record.today_record.is_markt}}'>
+            开超市
+          </view>
+          <view class="bottom" wx:elif='{{datas.today_record.today_stock_total>0}}'>
+
+              今日持仓 <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&&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 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="container" wx:if='{{datas.records.length>0}}'>
+          <ec-canvas   ec="{{ ec }}">
+          </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>
+      <view wx:else   class="{{item.income[0]=='-' ? 'down1':'up1'}}"> 
+        {{item.day}}
+        <text>{{item.income}}</text>
+      </view>
+    </view>
+  </view>
+</view>
+
+<view class="days_stock">
+  <view class="title">每日持股
+  </view>
+  <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>
+      <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 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 class="info" wx:if='{{item.experience}}'>
+        今日反思:{{item.experience}}
+      </view>
+      <view class="info" wx:if='{{item.wanzhu_comment}}'>
+        顽主点评:{{item.wanzhu_comment}}
+      </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}}'
+                 class="img" src="{{i}}"></image>
+    </view>
+  </view>
+  <view class="look_all">
+    <navigator hover-class="none" url="../day/day?id={{id}}&player_id={{player_id}}">
+          查看全部
+    </navigator>
+  </view>
+</view>
+

+ 249 - 0
pages/homepage/homepage.wxss

@@ -0,0 +1,249 @@
+/* pages/today/today.wxss */
+page{
+  background: #F7F7F7;
+}
+.page_top{
+  background: #fff;
+  margin-bottom: 20rpx;
+  position: relative;
+}
+.container {
+  position: relative;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: space-between;
+  box-sizing: border-box; 
+  height: 50vh;
+  background: #fff;
+  z-index: 9;
+} 
+
+ec-canvas {
+  width: 100%;
+  height: 100%;
+  position: relative;
+  z-index: 99;
+}
+
+.name{
+  font-size:36rpx;
+  font-weight: 500;
+  margin-bottom: 20rpx;
+}
+.name>text{
+  color: #AAAAAA;
+  font-size: 22rpx;
+  border: 1px solid #AAAAAA;
+  border-radius: 4rpx;
+  font-weight: 400;
+  padding: 0 4rpx;
+  position: relative;
+  top: -3rpx;
+}
+.name view{
+  float: right;
+  color: #D94B24;
+  font-size: 28rpx;
+  text-align: center;
+  position: relative;
+  top: -5rpx;
+  border:1px solid #D94B24;
+  line-height: 48rpx;
+  width: 120rpx;
+  border-radius: 8rpx;
+}
+
+.info{
+  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;
+}
+.info .tag{
+  font-size: 28rpx;
+  color: #CE994F;
+  border: 1px solid #CE994F;
+  border-radius: 8rpx;
+  margin-right: 8rpx;
+  font-weight: 400;
+  padding: 0 8rpx;
+}
+.infos{
+  background: #FFF4F5;
+  border-radius: 16rpx;
+  padding-top: 24rpx;
+ 
+}
+.bottom{
+  line-height: 92rpx;
+  padding: 0 24rpx;
+  border-radius: 0px 0px 8px 8px;
+  margin-top: 20rpx;
+  font-size: 28rpx;
+  background: linear-gradient(124deg, #FEEAEC 0%, #FFAEAF 100%);
+}
+.bottom text{
+  font-size: 36rpx;
+  margin-right: 30rpx;
+  font-weight: 500;
+}
+.legend{
+  position: absolute;
+  right: 30rpx;
+  top: 0;
+  z-index: 999999;
+}
+.legend view{
+  width: 230rpx;
+  line-height: 64rpx;
+  background: #F7F7F7;
+  border-radius: 8rpx;
+  text-align: center;
+  font-size: 28rpx;
+  margin-bottom: 10rpx;
+}
+
+.imgs,.content{
+  margin-bottom: 20rpx;
+  background: #fff;
+  padding: 30rpx;
+  position: relative;
+}
+.img{
+  display: inline-block;
+  width: 224rpx;
+  height: 224rpx;
+  border-radius: 8rpx;
+  margin-right: 8rpx;
+  margin-bottom: 8rpx;
+}
+.title{
+  font-weight: 500;
+  font-size: 32rpx;
+  margin-bottom: 24rpx;
+}
+.content{
+  font-size: 30rpx;
+  margin-bottom: 24rpx;
+  line-height: 48rpx;
+}
+.days_stock{
+  background: #fff;
+  padding: 30rpx;
+}
+
+.look_all{
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  background-color: #E90001;
+  height: 88rpx;
+  color: #fff;
+}
+
+.stock{
+  border-bottom: 1px solid #f5f5f5;
+  padding-bottom: 30rpx;
+  margin-bottom: 30rpx;
+}
+.stock .info{
+  padding: 10rpx 0;
+}
+.stock .imgs{
+  padding: 30rpx 0 0;
+  margin: 0;
+}
+.title navigator{
+  float: right;
+  color: #999;
+  font-size: 28rpx;
+}
+.title image{
+  width: 32rpx;
+  position: relative;
+  top: 7rpx;
+}
+
+.month{
+  text-align: right;
+  position: absolute;
+  right: 30rpx;
+  top: 30rpx;
+}
+.month>image{
+  height: 40rpx;
+  display: inline-block;
+  vertical-align: middle;
+}
+picker{
+  display: inline-block;
+  vertical-align: middle;
+  margin: 0 20rpx;
+}
+.date-picker{
+  font-size: 36rpx;
+  font-weight: 500;
+}
+.date-picker image{
+  height: 24rpx;
+}
+.day{
+  display: flex;
+  justify-content: space-between;
+  padding: 10rpx;
+  background: #f5f5f5;
+  margin: 20rpx 0;
+}
+.day text{
+  color: #999;
+  width: 14%;
+  text-align: center;
+}
+.days{
+  display: flex;
+  flex-wrap: wrap;
+  /* justify-content: space-between; */
+}
+.days view{
+  width: 14%;
+  text-align: center;
+  font-weight: 500;
+  height: 96rpx;
+  /* margin-bottom: 10rpx; */
+}
+.days text{
+  display: block;
+  color: #666;
+  font-size: 20rpx;
+  position: relative;
+  top: -5rpx;
+  font-weight: 400;
+}
+.days view view{
+  width: 100% !important;
+}
+.days view view text{
+   color: #fff;
+}
+.down1{
+  background: #07B20B;
+  color: #fff;
+  
+}
+.up1{
+  background: #E90001;
+  color: #fff;
+}

+ 71 - 0
pages/message/message.js

@@ -0,0 +1,71 @@
+// pages/message/message.js
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        focus:false
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+
+    },
+    answer(){
+        this.setData({
+            focus:true
+        })
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 3 - 0
pages/message/message.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "我的咨询"
+}

+ 55 - 0
pages/message/message.wxml

@@ -0,0 +1,55 @@
+<view class="list">
+    <image src="../../images/page1.png" ></image>
+    <view class="msg">
+        <text class="name">茂名哥</text>
+        <view class="content">北交所11月12日宣布,目前各项准备工作均已就绪,定于11月15日正式开市。截至11月12日,累计有210万户投资者预约开通北交所合格投资者权限,开市后合计可参与北交所交易的投资者超400万户。</view>
+        <view class="answer">
+            <text>湖南顽主:</text>一定要注意我的回复我的回复我的
+                回复我的回复我的回复我的回复我的回复我的
+                回复我的回复我的回复
+        </view>
+        <view class="addr">
+            <text>04-29 18:12</text><text>来自北京</text>
+            <image bindtap="answer" mode="widthFix" src="../../images/msg.png"></image>
+        </view>
+    </view>
+</view>
+
+<view class="list">
+    <image src="../../images/page1.png" ></image>
+    <view class="msg">
+        <text class="name">茂名哥</text>
+        <view class="content">北交所11月12日宣布,目前各项准备工作均已就绪,定于11月15日正式开市。截至11月12日,累计有210万户投资者预约开通北交所合格投资者权限,开市后合计可参与北交所交易的投资者超400万户。</view>
+        <view class="answer">
+            <text>湖南顽主:</text>一定要注意我的回复我的回复我的
+                回复我的回复我的回复我的回复我的回复我的
+                回复我的回复我的回复
+        </view>
+        <view class="addr">
+            <text>04-29 18:12</text><text>来自北京</text>
+            <image mode="widthFix" src="../../images/msg.png"></image>
+        </view>
+    </view>
+</view>
+<view class="list">
+    <image src="../../images/page1.png" ></image>
+    <view class="msg">
+        <text class="name">茂名哥</text>
+        <view class="content">北交所11月12日宣布,目前各项准备工作均已就绪,定于11月15日正式开市。截至11月12日,累计有210万户投资者预约开通北交所合格投资者权限,开市后合计可参与北交所交易的投资者超400万户。</view>
+        <view class="answer">
+            <text>湖南顽主:</text>一定要注意我的回复我的回复我的
+                回复我的回复我的回复我的回复我的回复我的
+                回复我的回复我的 回复
+        </view>
+        <view class="addr">
+            <text>04-29 18:12</text><text>来自北京</text>
+            <image mode="widthFix" src="../../images/msg.png"></image>
+        </view>
+    </view>
+</view>
+
+
+<view class="post">
+    <input focus='{{focus}}' type="text" placeholder="我要咨询"/>
+    <button>提交</button>
+</view>

+ 81 - 0
pages/message/message.wxss

@@ -0,0 +1,81 @@
+/* pages/message/message.wxss */
+page{
+    padding: 30rpx 30rpx 160rpx;
+}
+.list{
+    position: relative;
+    padding-left: 80rpx;
+    margin-bottom: 24rpx;
+}
+.list>image{
+    width: 64rpx;
+    height: 64rpx;
+    position: absolute;
+    left: 0;
+    top: 0;
+    border-radius: 100%;
+}
+.content,.name{
+    font-size: 30rpx;
+    line-height: 48rpx;
+}
+.answer{
+    background: rgba(247, 247, 247, 1);
+    padding: 20rpx;
+    color: #666;
+    margin: 20rpx 0;
+    font-size: 28rpx;
+    line-height: 36rpx;
+}
+.answer text{
+    color: #2383e5;
+}
+.addr{
+    position: relative;
+    padding-bottom: 16px;
+    border-bottom: 1px solid rgba(245, 245, 245, 1);
+}
+.addr text{
+    font-size: 28rpx;
+    margin-right: 24rpx;
+    color: #666666;
+}
+.addr image{
+    width: 34rpx;
+    position: absolute;
+    right: 0;
+    top: 12rpx;
+}
+.post{
+    position: fixed;
+    padding: 24rpx 30rpx 80rpx;
+    bottom: 0;
+    left: 0;
+    background: #fff;
+    z-index: 9;
+    border-top: 1px solid rgba(245, 245, 245, 1);
+    display: flex;
+    justify-content: space-between;
+    width: 100%;
+}
+.post input{
+    width: 75%;
+    height: 64rpx;
+    border: 1px solid rgba(224, 224, 224, 1);
+    border-radius: 9rpx;
+    font-size: 30rpx;
+    color: #CBCBCB;
+    padding: 0 16rpx;
+}
+.post button:not([size='mini']){
+    height: 64rpx;
+    width: 124rpx !important;
+    background: #D94B24;
+    border-radius: 8rpx;
+    line-height: 64rpx;
+    font-size: 30rpx;
+    color: #fff;
+    padding: 0;
+    font-weight: 400;
+    margin: 0;
+}

+ 66 - 0
pages/rethink/rethink.js

@@ -0,0 +1,66 @@
+// pages/rethink/rethink.js
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 3 - 0
pages/rethink/rethink.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "今日反思"
+}

+ 14 - 0
pages/rethink/rethink.wxml

@@ -0,0 +1,14 @@
+<view class="list">
+    <image src="../../images/page1.png" ></image>
+    <view class="msg">
+        <text class="name">茂名哥</text>
+        <view>资产:187w(总收益 <label class="up">80%</label>  |  今日收益 <label class="up">80%</label>)</view>
+    </view>
+</view>
+<view class="content">北交所11月12日宣布,目前各项准备工作均已就绪,定于11月15日正式开市。截至11月12日,累计有210万户投资者预约开通北交所合格投资者权限,开市后合计可参与北交所交易的投资者超400万户。</view>
+<view class="comment">
+    <image mode="widthFix" src="../../images/msg.png"></image>
+    <text>2365</text>
+    <image mode="widthFix" src="../../images/zan.png"></image>
+    <text>2365</text>
+</view>

+ 44 - 0
pages/rethink/rethink.wxss

@@ -0,0 +1,44 @@
+/* pages/rethink/rethink.wxss */
+page{
+    padding: 30rpx 30rpx 160rpx;
+}
+.list{
+    position: relative;
+    padding-left: 80rpx;
+    margin-bottom: 24rpx;
+}
+.list>image{
+    width: 64rpx;
+    height: 64rpx;
+    position: absolute;
+    left: 0;
+    top: 0;
+    border-radius: 100%;
+}
+.content,.name{
+    font-size: 30rpx;
+    line-height: 48rpx;
+    color: #333;
+}
+.msg view{
+    color: #666;
+    font-size: 28rpx;
+}
+.msg view label{
+    font-size: 28rpx;
+}
+.comment{
+    padding:  24rpx 0;
+    border-bottom: 1px solid rgba(245, 245, 245, 1);
+}
+.comment image{
+    width: 32rpx;
+    margin-right: 10rpx;
+    position: relative;
+    top: 5rpx;
+}
+.comment text{
+    color: #999;
+    font-size: 28rpx;
+    margin-right: 40rpx;
+}

+ 8 - 2
pages/today/today.js

@@ -9,6 +9,7 @@ Page({
    * 页面的初始数据
    */
   data: {
+    page:0,
     date:'2021-11',
     days:[],
     ec: {
@@ -24,8 +25,8 @@ Page({
    */
   onLoad: function (options) {
     
-
-    // options.id = 7, options.record_id = 29014
+    // id=9&player_id=3520
+    options.id = 9, options.player_id = 3520
     id = options.id, record_id = options.record_id
     this.setData({
       id: id,
@@ -35,6 +36,11 @@ Page({
     this.getData();
     
   },
+  tab(e){
+    this.setData({
+        page:e.target.dataset.id
+    })
+},
   getDays(){
     // match_id   player_id  month: "2021-12"
     $api.getCalendar({

+ 68 - 112
pages/today/today.wxml

@@ -1,46 +1,46 @@
-
-<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>  
-      <view class="infos">
-          <view class="info" wx:if='{{datas.today_record.style.length>0}}'>风格:
-          <label wx:for='{{datas.today_record.style}}' class="tag">{{item}}</label>
-          </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">
-                  胜率: <view>{{datas.today_record.win_rate}}(最大回撤 <text class="{{datas.today_record.badest_income[0]=='-' ?'down':'up'}}"> {{datas.today_record.badest_income}} </text>)</view>
-          </view>
-          <view class="info">
-                  日期: <view>{{datas.today_record.stock_date}}(今日收益
-               <text  class="{{datas.today_record.today_income[0]=='-' ?'down':'up'}}">{{datas.today_record.today_income}}</text>)</view>
-          </view>
-          <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">初始资产:
-                <label>{{datas.today_record.init_fund}}w</label>
-          </view>
-          <view class="bottom" wx:if='{{datas.today_record.today_record.is_markt}}'>
+<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>
+    <navigator>Ta的主页</navigator>
+</view>
+<view class="per_info">
+    <view class="rank">
+      <view class="jp"><image src="../../images/jp.png" ></image></view>
+      <view class="num">{{datas.today_record.group_rank}}</view>
+      排名
+    </view>
+    <view class="today_income">{{datas.today_record.today_fund}} 
+      <text  class="{{datas.today_record.today_income[0]=='-' ?'down':'up'}}">{{datas.today_record.today_income}}</text>
+    </view>
+    <view class="label">今日收益</view>
+    <view class="data" style="padding-right:30rpx;border-right: 1px solid rgba(245, 245, 245, 1);">
+      <text class="label">日期</text><text>{{datas.today_record.stock_date}}</text>
+      <text class="label">今日资产</text><text>{{datas.today_record.today_fund}}W</text>
+      <view wx:if='{{datas.today_record.today_record.is_markt}}'>
             开超市
-          </view>
-          <view class="bottom" wx:elif='{{datas.today_record.today_stock_total>0}}'>
-
-              今日持仓 <text>{{datas.today_record.today_stock_total}}W</text>
-              仓位 <text>{{datas.today_record.cangwei}}</text>
-          </view>
-          <view class="bottom" wx:else>
+      </view>
+      <block wx:elif='{{datas.today_record.today_stock_total>0}}'>
+        <text class="label">今日持仓</text><text>{{datas.today_record.today_stock_total}}W</text>
+      </block>
+      <view  wx:else>
             空仓
-          </view>
-      </view>          
+      </view>
+    </view>
+    <view class="data" style="padding-left:30rpx;">
+      <text class="label">胜率</text><text>{{datas.today_record.win_rate}}</text>
+      <text class="label">总收益</text><text  class="{{datas.today_record.total_income[0]=='-' ?'down':'up'}}"> {{datas.today_record.total_income}}</text>
+      <block wx:if='{{datas.today_record.today_stock_total>0}}'>
+        <text class="label">仓位</text><text>{{datas.today_record.cangwei}}</text>
+      </block>
+    </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>
@@ -64,83 +64,39 @@
     <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="container" wx:if='{{datas.records.length>0}}'>
-          <ec-canvas   ec="{{ ec }}">
-          </ec-canvas>
-    </view>
+
+<view class="tab">
+    <view bindtap="tab" data-id='0' class="{{page==0?'act':''}}">评论 123 <text></text></view>
+    <view bindtap="tab" data-id='1' class="{{page==1?'act':''}}">点赞 123<text></text></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>
-      <view wx:else   class="{{item.income[0]=='-' ? 'down1':'up1'}}"> 
-        {{item.day}}
-        <text>{{item.income}}</text>
+  <view class="list">
+    <image src="../../images/page1.png" ></image>
+      <view class="msg">
+          <text class="_name">茂名哥</text>
+          <view class="_content">北交所11月12日宣布,目前各项准备工作均已就绪,定于11月15日正式开市。截至11月12日,累计有210万户投资者预约开通北交所合格投资者权限,开市后合计可参与北交所交易的投资者超400万户。</view>
+          <view class="answer">
+              <text>湖南顽主:</text>一定要注意我的回复我的回复我的
+                  回复我的回复我的回复我的回复我的回复我的
+                  回复我的回复我的回复
+          </view>
+          <view class="addr">
+              <text>04-29 18:12</text><text>来自北京</text>
+              <image bindtap="answer" mode="widthFix" src="../../images/msg.png"></image>
+          </view>
       </view>
-    </view>
   </view>
 </view>
 
-<view class="days_stock">
-  <view class="title">每日持股
-  </view>
-  <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>
-      <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 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 class="info" wx:if='{{item.experience}}'>
-        今日反思:{{item.experience}}
-      </view>
-      <view class="info" wx:if='{{item.wanzhu_comment}}'>
-        顽主点评:{{item.wanzhu_comment}}
-      </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}}'
-                 class="img" src="{{i}}"></image>
-    </view>
-  </view>
-  <view class="look_all">
-    <navigator hover-class="none" url="../day/day?id={{id}}&player_id={{player_id}}">
-          查看全部
-    </navigator>
-  </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="post">
+    <image  mode="widthFix" src="../../images/zan.png"></image>
+    <input focus='{{focus}}' type="text" placeholder="留言"/>
+    <button>提交</button>
 </view>
 
+

+ 212 - 41
pages/today/today.wxss

@@ -1,6 +1,7 @@
 /* pages/today/today.wxss */
 page{
   background: #F7F7F7;
+  padding-bottom: 180rpx;
 }
 .page_top{
   background: #fff;
@@ -25,62 +26,123 @@ ec-canvas {
   position: relative;
   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 navigator{
+  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{
-  font-size: 30rpx;
-  padding: 10rpx 24rpx;
-  display: flex;
+.per_info{
+  padding: 24rpx;
+  position: relative;
+  background: #fff;
 }
-.info view{
-  color: #666;
-  width: 85%;
-  vertical-align: top;
+.today_income{
+  color: #D43030;
+  font-size: 40rpx;
+  font-weight: bold;
+  margin-bottom: 10rpx;
 }
-.info label{
-  font-weight: 500;
-  color: #333;
+.today_income text{
+  font-weight: 400;
+  font-size: 28rpx;
 }
-.player{
-  background: #fff;
-  padding: 30rpx;
+.label{
+  color: #999;
+  font-size: 28rpx;
+}
+.rank{
+  position: absolute;
+  height: 80rpx;
+  color: #FFE7C7;
+  background: linear-gradient(270deg, rgba(230, 170, 88, 1) 0%, rgba(230, 170, 88, 0.7) 100%);
+  right: 0;
+  top: 24rpx;
+  padding: 0 15rpx 0 90rpx; 
+  border-radius: 72rpx 0 0 72rpx;
+  overflow: hidden;
+  font-size: 24rpx;
+  text-align: right;
+}
+.jp{
+    width: 72rpx;
+    height: 72rpx;
+    position: absolute;
+    left: 4rpx;
+    top: 0;
+    bottom: 0;
+    margin: auto;
+    border-radius: 100%;
+    background: #fff;
+}
+.rank image{
+  width: 52rpx;
+  height: 52rpx;
+  position: absolute;
+  top: 0;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  margin: auto;
 }
-.info .tag{
+.rank .num{
+  color: #fff;
+  font-size: 32rpx;
+  height: 40rpx;
+}
+.data{
+  width: 50%;
+  display: inline-flex;
+  flex-wrap: wrap;
+  margin-top: 40rpx;
+}
+.data text{
   font-size: 28rpx;
-  color: #CE994F;
-  border: 1px solid #CE994F;
-  border-radius: 8rpx;
-  margin-right: 8rpx;
+  width: 50%;
+  line-height: 48rpx;
+  text-align: right;
+  font-weight: 500;
+}
+.data .label{
+  text-align: left;
   font-weight: 400;
-  padding: 0 8rpx;
 }
+
 .infos{
   background: #FFF4F5;
   border-radius: 16rpx;
@@ -246,4 +308,113 @@ picker{
 .up1{
   background: #E90001;
   color: #fff;
+}
+.tab{
+  background: #fff;
+}
+.tab view{
+  line-height: 90rpx;
+  text-align: center;
+  /* width: 50%; */
+  display: inline-block;
+  font-size: 30rpx;
+  position: relative;
+  padding: 0 30rpx;
+}
+.tab .act{
+  font-weight: bold;
+}
+.act text{
+  position: absolute;
+  width: 64rpx;
+  height: 6rpx;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  margin: auto;
+  background: rgba(217, 75, 36, 1);
+  border-radius: 40rpx;
+}
+
+.list{
+  position: relative;
+  padding-left: 80rpx;
+  margin-bottom: 24rpx;
+}
+.list>image{
+  width: 64rpx;
+  height: 64rpx;
+  position: absolute;
+  left: 0;
+  top: 0;
+  border-radius: 100%;
+}
+._content,._name{
+  font-size: 30rpx;
+  line-height: 48rpx;
+}
+.answer{
+  background: rgba(247, 247, 247, 1);
+  padding: 20rpx;
+  color: #666;
+  margin: 20rpx 0;
+  font-size: 28rpx;
+  line-height: 36rpx;
+}
+.answer text{
+  color: #2383e5;
+}
+.addr{
+  position: relative;
+  padding-bottom: 16px;
+  border-bottom: 1px solid rgba(245, 245, 245, 1);
+}
+.addr text{
+  font-size: 28rpx;
+  margin-right: 24rpx;
+  color: #666666;
+}
+.addr image{
+  width: 34rpx;
+  position: absolute;
+  right: 0;
+  top: 12rpx;
+}
+.post{
+  position: fixed;
+  padding: 24rpx 30rpx 80rpx;
+  bottom: 0;
+  left: 0;
+  background: #fff;
+  z-index: 9;
+  border-top: 1px solid rgba(245, 245, 245, 1);
+  display: flex;
+  justify-content: space-between;
+  width: 100%;
+}
+.post input{
+  width: 65%;
+  height: 64rpx;
+  border: 1px solid rgba(224, 224, 224, 1);
+  border-radius: 9rpx;
+  font-size: 30rpx;
+  color: #CBCBCB;
+  padding: 0 16rpx;
+}
+.post button:not([size='mini']){
+  height: 64rpx;
+  width: 124rpx !important;
+  background: #D94B24;
+  border-radius: 8rpx;
+  line-height: 64rpx;
+  font-size: 30rpx;
+  color: #fff;
+  padding: 0;
+  font-weight: 400;
+  margin: 0;
+}
+.post image{
+  width: 48rpx;
+  position: relative;
+  top: 10rpx;
 }