tanyanfei 3 lat temu
commit
c5cc3e2286
100 zmienionych plików z 4183 dodań i 0 usunięć
  1. BIN
      .DS_Store
  2. 20 0
      app.js
  3. 76 0
      app.json
  4. 37 0
      app.wxss
  5. 250 0
      ec-canvas/ec-canvas.js
  6. 4 0
      ec-canvas/ec-canvas.json
  7. 4 0
      ec-canvas/ec-canvas.wxml
  8. 4 0
      ec-canvas/ec-canvas.wxss
  9. 16 0
      ec-canvas/echarts.js
  10. 105 0
      ec-canvas/wx-canvas.js
  11. BIN
      images/1.png
  12. BIN
      images/2.png
  13. BIN
      images/3.png
  14. BIN
      images/about.png
  15. BIN
      images/down.png
  16. BIN
      images/home_0.png
  17. BIN
      images/home_1.png
  18. BIN
      images/icon_down@2x.png
  19. BIN
      images/icon_rise@2x.png
  20. BIN
      images/img.png
  21. BIN
      images/jiangbei.png
  22. BIN
      images/jp.png
  23. BIN
      images/left.png
  24. BIN
      images/logo.png
  25. BIN
      images/msg.png
  26. BIN
      images/my_0.png
  27. BIN
      images/my_1.png
  28. BIN
      images/my_bg.png
  29. BIN
      images/order_0.png
  30. BIN
      images/order_1.png
  31. BIN
      images/page1.png
  32. BIN
      images/right.png
  33. BIN
      images/right_icon.png
  34. BIN
      images/search.png
  35. BIN
      images/ss.png
  36. BIN
      images/ss1.png
  37. BIN
      images/ss2.png
  38. BIN
      images/tttz.png
  39. BIN
      images/up.png
  40. BIN
      images/up_0.png
  41. BIN
      images/up_1.png
  42. BIN
      images/zan.png
  43. 66 0
      pages/aboutus/aboutus.js
  44. 3 0
      pages/aboutus/aboutus.json
  45. 11 0
      pages/aboutus/aboutus.wxml
  46. 22 0
      pages/aboutus/aboutus.wxss
  47. 81 0
      pages/apply/apply.js
  48. 3 0
      pages/apply/apply.json
  49. 43 0
      pages/apply/apply.wxml
  50. 68 0
      pages/apply/apply.wxss
  51. 113 0
      pages/change/change.js
  52. 3 0
      pages/change/change.json
  53. 28 0
      pages/change/change.wxml
  54. 96 0
      pages/change/change.wxss
  55. 103 0
      pages/comment/comment.js
  56. 3 0
      pages/comment/comment.json
  57. 28 0
      pages/comment/comment.wxml
  58. 69 0
      pages/comment/comment.wxss
  59. 113 0
      pages/day/day.js
  60. 3 0
      pages/day/day.json
  61. 31 0
      pages/day/day.wxml
  62. 45 0
      pages/day/day.wxss
  63. 92 0
      pages/detail/detail.js
  64. 3 0
      pages/detail/detail.json
  65. 5 0
      pages/detail/detail.wxml
  66. 19 0
      pages/detail/detail.wxss
  67. 95 0
      pages/follow/follow.js
  68. 3 0
      pages/follow/follow.json
  69. 19 0
      pages/follow/follow.wxml
  70. 51 0
      pages/follow/follow.wxss
  71. 66 0
      pages/games/games.js
  72. 3 0
      pages/games/games.json
  73. 14 0
      pages/games/games.wxml
  74. 25 0
      pages/games/games.wxss
  75. 364 0
      pages/homepage/homepage.js
  76. 6 0
      pages/homepage/homepage.json
  77. 125 0
      pages/homepage/homepage.wxml
  78. 282 0
      pages/homepage/homepage.wxss
  79. 273 0
      pages/index/index.js
  80. 3 0
      pages/index/index.json
  81. 197 0
      pages/index/index.wxml
  82. 293 0
      pages/index/index.wxss
  83. 141 0
      pages/list/list.js
  84. 3 0
      pages/list/list.json
  85. 40 0
      pages/list/list.wxml
  86. 98 0
      pages/list/list.wxss
  87. 95 0
      pages/message/message.js
  88. 3 0
      pages/message/message.json
  89. 20 0
      pages/message/message.wxml
  90. 89 0
      pages/message/message.wxss
  91. 69 0
      pages/myMatchDetail/myMatchDetail.js
  92. 3 0
      pages/myMatchDetail/myMatchDetail.json
  93. 2 0
      pages/myMatchDetail/myMatchDetail.wxml
  94. 1 0
      pages/myMatchDetail/myMatchDetail.wxss
  95. 79 0
      pages/mymatch/mymatch.js
  96. 3 0
      pages/mymatch/mymatch.json
  97. 3 0
      pages/mymatch/mymatch.wxml
  98. 9 0
      pages/mymatch/mymatch.wxss
  99. 139 0
      pages/rank/rank.js
  100. 0 0
      pages/rank/rank.json

BIN
.DS_Store


+ 20 - 0
app.js

@@ -0,0 +1,20 @@
+// app.js
+App({
+  onLaunch() {
+    // 展示本地存储能力
+    const logs = wx.getStorageSync('logs') || []
+    logs.unshift(Date.now())
+    wx.setStorageSync('logs', logs)
+
+    // 登录
+    wx.login({
+      success: res => {
+        // 发送 res.code 到后台换取 openId, sessionKey, unionId
+      }
+    })
+  },
+  globalData: {
+    userInfo: null,
+    follow:0
+  }
+})

+ 76 - 0
app.json

@@ -0,0 +1,76 @@
+{
+"pages": [
+  
+  "pages/user/user",
+  "pages/homepage/homepage",
+  "pages/today/today",
+  "pages/apply/apply",
+  "pages/rethink/rethink",
+  "pages/message/message",
+    "pages/rank/rank",
+    "pages/index/index",
+    
+    
+    
+    "pages/stock/stock",
+    "pages/upload/upload",
+    "pages/change/change",
+    "pages/myMatchDetail/myMatchDetail",
+    "pages/record/record",
+    "pages/aboutus/aboutus",
+    "pages/mymatch/mymatch",
+    "pages/follow/follow",
+    "pages/day/day",
+    "pages/games/games",
+    "pages/search/search",
+    
+    "pages/style/style",
+    "pages/detail/detail",
+    
+    
+    "pages/list/list",
+    
+    "pages/comment/comment"
+    
+    
+  ],
+  "window": {
+    "backgroundTextStyle": "light",
+    "navigationBarBackgroundColor": "#D94B24",
+    "navigationBarTitleText": "顽主杯",
+    "navigationBarTextStyle": "white"
+  },
+  "tabBar": {
+    "selectedColor": "#FF583D",
+    "color": "#333333",
+    "list": [
+      {
+        "pagePath": "pages/index/index",
+        "iconPath": "images/home_0.png",
+        "selectedIconPath": "images/home_1.png",
+        "text": "社区"
+      },
+      {
+        "pagePath": "pages/rank/rank",
+        "iconPath": "images/order_0.png",
+        "selectedIconPath": "images/order_1.png",
+        "text": "排名"
+      },
+      {
+        "pagePath": "pages/upload/upload",
+        "iconPath": "images/up_0.png",
+        "selectedIconPath": "images/up_1.png",
+        "text": "交作业"
+      },
+      {
+        "pagePath": "pages/user/user",
+        "iconPath": "images/my_0.png",
+        "selectedIconPath": "images/my_1.png",
+        "text": "我的"
+      }
+    ]
+  },
+  "style": "v2",
+  "sitemapLocation": "sitemap.json",
+  "lazyCodeLoading": "requiredComponents"
+}

+ 37 - 0
app.wxss

@@ -0,0 +1,37 @@
+/**app.wxss**/
+
+page,view,text,swiper,scroll-view{
+  box-sizing: border-box;
+  color: #333;
+}
+.up{
+  color: #E90001 !important;
+}
+.down{
+  color: #07B20B !important;
+}
+
+.post_btn:not([size='mini']){
+  width: 100%;
+  height: 88rpx;
+  background: #D94B24;
+  border-radius: 8rpx;
+  color: #fff;
+}
+.not_data{
+  margin: 30%;
+  text-align: center;
+  color: #999;
+}
+.loading{
+  text-align: center;
+  color: #999;
+  padding: 10rpx 0;
+  font-size: 26rpx;
+}
+.info{
+  width: 100%;
+}
+.info view{
+  font-size: 29rpx !important;
+}

+ 250 - 0
ec-canvas/ec-canvas.js

@@ -0,0 +1,250 @@
+import WxCanvas from './wx-canvas';
+import * as echarts from './echarts';
+
+let ctx;
+
+function compareVersion(v1, v2) {
+  v1 = v1.split('.')
+  v2 = v2.split('.')
+  const len = Math.max(v1.length, v2.length)
+
+  while (v1.length < len) {
+    v1.push('0')
+  }
+  while (v2.length < len) {
+    v2.push('0')
+  }
+
+  for (let i = 0; i < len; i++) {
+    const num1 = parseInt(v1[i])
+    const num2 = parseInt(v2[i])
+
+    if (num1 > num2) {
+      return 1
+    } else if (num1 < num2) {
+      return -1
+    }
+  }
+  return 0
+}
+
+Component({
+  properties: {
+    canvasId: {
+      type: String,
+      value: 'ec-canvas'
+    },
+
+    ec: {
+      type: Object
+    },
+
+    forceUseOldCanvas: {
+      type: Boolean,
+      value: false
+    }
+  },
+
+  data: {
+    isUseNewCanvas: false
+  },
+
+  ready: function () {
+    // Disable prograssive because drawImage doesn't support DOM as parameter
+    // See https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.drawImage.html
+    echarts.registerPreprocessor(option => {
+      if (option && option.series) {
+        if (option.series.length > 0) {
+          option.series.forEach(series => {
+            series.progressive = 0;
+          });
+        }
+        else if (typeof option.series === 'object') {
+          option.series.progressive = 0;
+        }
+      }
+    });
+
+    if (!this.data.ec) {
+      console.warn('组件需绑定 ec 变量,例:<ec-canvas id="mychart-dom-bar" '
+        + 'canvas-id="mychart-bar" ec="{{ ec }}"></ec-canvas>');
+      return;
+    }
+
+    if (!this.data.ec.lazyLoad) {
+      this.init();
+    }
+  },
+
+  methods: {
+    init: function (callback) {
+      const version = wx.getSystemInfoSync().SDKVersion
+
+      const canUseNewCanvas = compareVersion(version, '2.9.0') >= 0;
+      const forceUseOldCanvas = this.data.forceUseOldCanvas;
+      const isUseNewCanvas = canUseNewCanvas && !forceUseOldCanvas;
+      this.setData({ isUseNewCanvas });
+
+      if (forceUseOldCanvas && canUseNewCanvas) {
+        console.warn('开发者强制使用旧canvas,建议关闭');
+      }
+
+      if (isUseNewCanvas) {
+        // console.log('微信基础库版本大于2.9.0,开始使用<canvas type="2d"/>');
+        // 2.9.0 可以使用 <canvas type="2d"></canvas>
+        this.initByNewWay(callback);
+      } else {
+        const isValid = compareVersion(version, '1.9.91') >= 0
+        if (!isValid) {
+          console.error('微信基础库版本过低,需大于等于 1.9.91。'
+            + '参见:https://github.com/ecomfe/echarts-for-weixin'
+            + '#%E5%BE%AE%E4%BF%A1%E7%89%88%E6%9C%AC%E8%A6%81%E6%B1%82');
+          return;
+        } else {
+          console.warn('建议将微信基础库调整大于等于2.9.0版本。升级后绘图将有更好性能');
+          this.initByOldWay(callback);
+        }
+      }
+    },
+
+    initByOldWay(callback) {
+      // 1.9.91 <= version < 2.9.0:原来的方式初始化
+      ctx = wx.createCanvasContext(this.data.canvasId, this);
+      const canvas = new WxCanvas(ctx, this.data.canvasId, false);
+
+      echarts.setCanvasCreator(() => {
+        return canvas;
+      });
+      // const canvasDpr = wx.getSystemInfoSync().pixelRatio // 微信旧的canvas不能传入dpr
+      const canvasDpr = 1
+      var query = wx.createSelectorQuery().in(this);
+      query.select('.ec-canvas').boundingClientRect(res => {
+        if (typeof callback === 'function') {
+          this.chart = callback(canvas, res.width, res.height, canvasDpr);
+        }
+        else if (this.data.ec && typeof this.data.ec.onInit === 'function') {
+          this.chart = this.data.ec.onInit(canvas, res.width, res.height, canvasDpr);
+        }
+        else {
+          this.triggerEvent('init', {
+            canvas: canvas,
+            width: res.width,
+            height: res.height,
+            canvasDpr: canvasDpr // 增加了dpr,可方便外面echarts.init
+          });
+        }
+      }).exec();
+    },
+
+    initByNewWay(callback) {
+      // version >= 2.9.0:使用新的方式初始化
+      const query = wx.createSelectorQuery().in(this)
+      query
+        .select('.ec-canvas')
+        .fields({ node: true, size: true })
+        .exec(res => {
+          const canvasNode = res[0].node
+          this.canvasNode = canvasNode
+
+          const canvasDpr = wx.getSystemInfoSync().pixelRatio
+          const canvasWidth = res[0].width
+          const canvasHeight = res[0].height
+
+          const ctx = canvasNode.getContext('2d')
+
+          const canvas = new WxCanvas(ctx, this.data.canvasId, true, canvasNode)
+          echarts.setCanvasCreator(() => {
+            return canvas
+          })
+
+          if (typeof callback === 'function') {
+            this.chart = callback(canvas, canvasWidth, canvasHeight, canvasDpr)
+          } else if (this.data.ec && typeof this.data.ec.onInit === 'function') {
+            this.chart = this.data.ec.onInit(canvas, canvasWidth, canvasHeight, canvasDpr)
+          } else {
+            this.triggerEvent('init', {
+              canvas: canvas,
+              width: canvasWidth,
+              height: canvasHeight,
+              dpr: canvasDpr
+            })
+          }
+        })
+    },
+    canvasToTempFilePath(opt) {
+      if (this.data.isUseNewCanvas) {
+        // 新版
+        const query = wx.createSelectorQuery().in(this)
+        query
+          .select('.ec-canvas')
+          .fields({ node: true, size: true })
+          .exec(res => {
+            const canvasNode = res[0].node
+            opt.canvas = canvasNode
+            wx.canvasToTempFilePath(opt)
+          })
+      } else {
+        // 旧的
+        if (!opt.canvasId) {
+          opt.canvasId = this.data.canvasId;
+        }
+        ctx.draw(true, () => {
+          wx.canvasToTempFilePath(opt, this);
+        });
+      }
+    },
+
+    touchStart(e) {
+      if (this.chart && e.touches.length > 0) {
+        var touch = e.touches[0];
+        var handler = this.chart.getZr().handler;
+        handler.dispatch('mousedown', {
+          zrX: touch.x,
+          zrY: touch.y
+        });
+        handler.dispatch('mousemove', {
+          zrX: touch.x,
+          zrY: touch.y
+        });
+        handler.processGesture(wrapTouch(e), 'start');
+      }
+    },
+
+    touchMove(e) {
+      if (this.chart && e.touches.length > 0) {
+        var touch = e.touches[0];
+        var handler = this.chart.getZr().handler;
+        handler.dispatch('mousemove', {
+          zrX: touch.x,
+          zrY: touch.y
+        });
+        handler.processGesture(wrapTouch(e), 'change');
+      }
+    },
+
+    touchEnd(e) {
+      if (this.chart) {
+        const touch = e.changedTouches ? e.changedTouches[0] : {};
+        var handler = this.chart.getZr().handler;
+        handler.dispatch('mouseup', {
+          zrX: touch.x,
+          zrY: touch.y
+        });
+        handler.dispatch('click', {
+          zrX: touch.x,
+          zrY: touch.y
+        });
+        handler.processGesture(wrapTouch(e), 'end');
+      }
+    }
+  }
+});
+
+function wrapTouch(event) {
+  for (let i = 0; i < event.touches.length; ++i) {
+    const touch = event.touches[i];
+    touch.offsetX = touch.x;
+    touch.offsetY = touch.y;
+  }
+  return event;
+}

+ 4 - 0
ec-canvas/ec-canvas.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "usingComponents": {}
+}

+ 4 - 0
ec-canvas/ec-canvas.wxml

@@ -0,0 +1,4 @@
+<!-- 新的:接口对其了H5 -->
+<canvas wx:if="{{isUseNewCanvas}}" type="2d" class="ec-canvas" canvas-id="{{ canvasId }}" bindinit="init" bindtouchstart="{{ ec.disableTouch ? '' : 'touchStart' }}" bindtouchmove="{{ ec.disableTouch ? '' : 'touchMove' }}" bindtouchend="{{ ec.disableTouch ? '' : 'touchEnd' }}"></canvas>
+<!-- 旧的 -->
+<canvas wx:else class="ec-canvas" canvas-id="{{ canvasId }}" bindinit="init" bindtouchstart="{{ ec.disableTouch ? '' : 'touchStart' }}" bindtouchmove="{{ ec.disableTouch ? '' : 'touchMove' }}" bindtouchend="{{ ec.disableTouch ? '' : 'touchEnd' }}"></canvas>

+ 4 - 0
ec-canvas/ec-canvas.wxss

@@ -0,0 +1,4 @@
+.ec-canvas {
+  width: 100%;
+  height: 100%;
+}

Plik diff jest za duży
+ 16 - 0
ec-canvas/echarts.js


+ 105 - 0
ec-canvas/wx-canvas.js

@@ -0,0 +1,105 @@
+export default class WxCanvas {
+  constructor(ctx, canvasId, isNew, canvasNode) {
+    this.ctx = ctx;
+    this.canvasId = canvasId;
+    this.chart = null;
+    this.isNew = isNew
+    if (isNew) {
+      this.canvasNode = canvasNode;
+    }
+    else {
+      this._initStyle(ctx);
+    }
+
+    // this._initCanvas(zrender, ctx);
+
+    this._initEvent();
+  }
+
+  getContext(contextType) {
+    if (contextType === '2d') {
+      return this.ctx;
+    }
+  }
+
+  // canvasToTempFilePath(opt) {
+  //   if (!opt.canvasId) {
+  //     opt.canvasId = this.canvasId;
+  //   }
+  //   return wx.canvasToTempFilePath(opt, this);
+  // }
+
+  setChart(chart) {
+    this.chart = chart;
+  }
+
+  attachEvent() {
+    // noop
+  }
+
+  detachEvent() {
+    // noop
+  }
+
+  _initCanvas(zrender, ctx) {
+    zrender.util.getContext = function () {
+      return ctx;
+    };
+
+    zrender.util.$override('measureText', function (text, font) {
+      ctx.font = font || '12px sans-serif';
+      return ctx.measureText(text);
+    });
+  }
+
+  _initStyle(ctx) {
+    ctx.createRadialGradient = () => {
+      return ctx.createCircularGradient(arguments);
+    };
+  }
+
+  _initEvent() {
+    this.event = {};
+    const eventNames = [{
+      wxName: 'touchStart',
+      ecName: 'mousedown'
+    }, {
+      wxName: 'touchMove',
+      ecName: 'mousemove'
+    }, {
+      wxName: 'touchEnd',
+      ecName: 'mouseup'
+    }, {
+      wxName: 'touchEnd',
+      ecName: 'click'
+    }];
+
+    eventNames.forEach(name => {
+      this.event[name.wxName] = e => {
+        const touch = e.touches[0];
+        this.chart.getZr().handler.dispatch(name.ecName, {
+          zrX: name.wxName === 'tap' ? touch.clientX : touch.x,
+          zrY: name.wxName === 'tap' ? touch.clientY : touch.y
+        });
+      };
+    });
+  }
+
+  set width(w) {
+    if (this.canvasNode) this.canvasNode.width = w
+  }
+  set height(h) {
+    if (this.canvasNode) this.canvasNode.height = h
+  }
+
+  get width() {
+    if (this.canvasNode)
+      return this.canvasNode.width
+    return 0
+  }
+  get height() {
+    if (this.canvasNode)
+      return this.canvasNode.height
+    return 0
+  }
+}

BIN
images/1.png


BIN
images/2.png


BIN
images/3.png


BIN
images/about.png


BIN
images/down.png


BIN
images/home_0.png


BIN
images/home_1.png


BIN
images/icon_down@2x.png


BIN
images/icon_rise@2x.png


BIN
images/img.png


BIN
images/jiangbei.png


BIN
images/jp.png


BIN
images/left.png


BIN
images/logo.png


BIN
images/msg.png


BIN
images/my_0.png


BIN
images/my_1.png


BIN
images/my_bg.png


BIN
images/order_0.png


BIN
images/order_1.png


BIN
images/page1.png


BIN
images/right.png


BIN
images/right_icon.png


BIN
images/search.png


BIN
images/ss.png


BIN
images/ss1.png


BIN
images/ss2.png


BIN
images/tttz.png


BIN
images/up.png


BIN
images/up_0.png


BIN
images/up_1.png


BIN
images/zan.png


+ 66 - 0
pages/aboutus/aboutus.js

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

+ 3 - 0
pages/aboutus/aboutus.json

@@ -0,0 +1,3 @@
+{
+ "navigationBarTitleText": "关于我们"
+}

+ 11 - 0
pages/aboutus/aboutus.wxml

@@ -0,0 +1,11 @@
+<view class="bg">
+  <image style="width:100%;" mode="widthFix" src="../../images/about.png"></image>
+  <view>
+  <text>
+    天雨虽宽,不润无根之草;
+    佛法虽广,不度无缘之人。
+    
+    走进股市就是走进一个大熔炉,这里优胜劣汰,两极分化的速度是其他行业的十倍百倍。明白自己的天赋所在,明白自己的弱点所在,明白慢就是快,先确保自己长久地留在牌桌上,耐心等待属于自己的模式机会,时机成熟,积淀足够,你一个人就是千军万马。如果反复摸索困顿都无功而返,也请及早收手,毕竟人生不止是股市。
+  </text>
+  </view>
+</view>

+ 22 - 0
pages/aboutus/aboutus.wxss

@@ -0,0 +1,22 @@
+/* pages/aboutus/aboutus.wxss */
+page{
+  background: #F4F6F8;
+}
+.bg{
+  padding: 24rpx;
+}
+.bg image{
+  position: relative;
+  z-index: 3;
+}
+.bg view{
+  padding:48rpx 24rpx;
+  background: #fff;
+  font-size: 28rpx;
+  line-height: 48rpx;
+  border-radius: 16px;
+  position: relative;
+  top: -30rpx;
+  z-index: 2;
+  font-weight: 500;
+}

+ 81 - 0
pages/apply/apply.js

@@ -0,0 +1,81 @@
+// pages/apply/apply.js
+const app = getApp()
+const $api = require('../../utils/api.js').API;
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        page:2
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+
+    },
+    tab(e){
+        this.setData({
+            page:e.target.dataset.id
+        })
+    },
+    post(){
+        var data={
+            signup_type:1,
+            total_fee:218  
+        }
+        $api.wxpay(data).then(res=>{
+
+        })
+    },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 3 - 0
pages/apply/apply.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 43 - 0
pages/apply/apply.wxml

@@ -0,0 +1,43 @@
+<view class="tab">
+    <view bindtap="tab" data-id='2' class="{{page==2?'act':''}}">比赛报名 <text></text></view>
+    <view bindtap="tab" data-id='1' class="{{page==1?'act':''}}">游客报名<text></text></view>
+</view>
+
+<scroll-view scroll-y='{{true}}' wx:if='{{page==2}}'>
+        <view class="intro">想要和大佬一起同台竞技,想要近距离体验拥有海量比赛数据的比赛小程序,就来报名,一次参赛,终身使用。</view>
+
+        <view class="title">49届顽主杯实盘大赛</view>
+        <view class="date">比赛时间:2022-04-26至2022-06-24</view>
+        <view class="date">报名时间:2022-04-20至2022-04-26</view>
+
+        <view class="title title1">一、比赛分组</view>
+        <view class="date">千万组:300W以上;</view>
+        <view class="date">百万组:50W至200W;</view>
+        <view class="date">十万组:10W至50W;</view>
+        <view class="date">菜鸟组:10W以下;</view>
+        <view class="title title1">二、参赛费用</view>
+        <view class="date">参赛费用:<text>每届218元(此费用为参加49届顽主
+        杯实盘大赛)</text></view>
+        <view class="info">
+            想永久免费参赛请添加顽主微信sm,已有顽主微信的直接联系,无须再添加。历届小组第一,倒数第一,腰斩选手,种子选手永久免费参赛,直接联系顽主授权。
+        </view>
+        <view class="title title1">三、比赛规则</view>
+        <view class="date">
+            1.所有选手参赛账户真实比赛规则比赛规则比赛规则比赛规则比赛规则比赛规则比赛规则比赛规则比赛规则比赛规则;
+        </view>
+</scroll-view>
+<scroll-view wx:if='{{page==1}}'>
+    <view class="title">顽主杯实盘大赛</view>
+        <view class="title title1">一、观赛费用</view>
+        <view class="date">观赛费用:<text>218元(此费用为参加49届顽主
+        杯实盘大赛)</text></view>
+        <view class="date">使用期限:1年(365天)</view>
+        <view class="info">
+            想永久免费观看比赛,请联系顽主微信sm
+        </view>
+        <view class="title title1">二、使用权限</view>
+        <view class="date">
+            1.所有选手参赛账户真实比赛规则比赛规则比赛规则比赛规则比赛规则比赛规则比赛规则比赛规则比赛规则比赛规则;
+        </view>
+</scroll-view>
+<button bindtap="post" class="apply">立即报名</button>

+ 68 - 0
pages/apply/apply.wxss

@@ -0,0 +1,68 @@
+page{
+    padding: 0 35rpx;
+}
+view{
+    line-height: 56rpx;
+}
+.tab view{
+    line-height: 90rpx;
+    text-align: center;
+    width: 50%;
+    display: inline-block;
+    font-size: 30rpx;
+    position: relative;
+}
+.tab .act{
+    font-weight: bold;
+}
+.act text{
+    position: absolute;
+    width: 64rpx;
+    height: 6rpx;
+    top: 100%;
+    left: 0;
+    right: 0;
+    margin: auto;
+    background: rgba(217, 75, 36, 1);
+}
+.intro{
+    font-size: 32rpx;
+    line-height: 56rpx;
+    margin-top: 30rpx;
+}
+.title{
+    font-size: 40rpx;
+    line-height: 56rpx;
+    font-weight: bold;
+    margin: 50rpx 0 15rpx;
+}
+.date{
+    font-size: 32rpx;
+    line-height: 56rpx;
+}
+.title1{
+    font-size: 32rpx;
+    margin-bottom: 8rpx;
+}
+.date text{
+    color: rgba(233, 0, 1, 1);
+}
+.info{
+    font-size: 32rpx;
+    color: #666;
+    margin-top: 8rpx;
+}
+.apply:not([size='mini']){
+    background: #D94B24;
+    color: #fff;
+    width: 100%;
+    margin: 48rpx auto 0;
+    height: 88rpx;
+    line-height: 88rpx;
+    padding: 0;
+    font-size: 32rpx;
+    border-radius: 8rpx;
+  }
+  scroll-view{
+    height: calc(100vh - 250rpx);
+  }

+ 113 - 0
pages/change/change.js

@@ -0,0 +1,113 @@
+// pages/change/change.js
+const app = getApp()
+const $api = require('../../utils/api.js').API;
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        today_stock_img:[]
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+
+    },
+    uploadImg() {
+        var today_stock_img = this.data.today_stock_img;
+        wx.chooseImage({
+          success: res => {
+            wx.showLoading({
+              title: '正在上传',
+            })
+            const tempFilePaths = res.tempFiles
+            for (let i = 0; i < tempFilePaths.length; i++) {
+              $api.upload(tempFilePaths[i].path, 'file').then(res => {
+                wx.hideLoading()
+                if (res.code == 0) {
+                  today_stock_img.push(res.data.url)
+                  this.setData({
+                    today_stock_img: today_stock_img
+                  })
+                } else {
+                  wx.showToast({
+                    title: '上传失败',
+                  })
+                }
+              })
+                .catch(err => {
+                  wx.hideLoading()
+                })
+            }
+    
+          }
+        })
+      },
+      del(e) {
+        var i = e.target.dataset.id;
+        var today_stock_img = this.data.today_stock_img;
+        today_stock_img.splice(i, 1)
+        this.setData({
+          today_stock_img: today_stock_img
+        })
+      },
+      prview(e){
+        var src = e.target.dataset.src;
+        wx.previewImage({
+          current: src, // 当前显示图片的http链接
+          urls: [src] // 需要预览的图片http链接列表
+        })
+      },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 3 - 0
pages/change/change.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "初始资金修改"
+}

+ 28 - 0
pages/change/change.wxml

@@ -0,0 +1,28 @@
+<view class="item">
+    <label>今转出资金</label>
+    <input placeholder-style="color:rgba(203, 203, 203, 1)" type="text" placeholder="请填写"/>
+    <text>万 <text>(单位)</text></text>
+</view>
+<view class="item">
+    <label>今转入资金</label>
+    <input placeholder-style="color:rgba(203, 203, 203, 1)" type="text" placeholder="请填写"/>
+    <text>万 <text>(单位)</text></text>
+</view>
+<view class="item">
+    <label>账户截图</label>
+    <view wx:for='{{today_stock_img}}' class="stock_imgs">
+        <image  src="{{item}}" bindtap="prview" data-src="{{item}}"></image>
+        <view class="edit">
+            <text bindtap="del" data-id='{{index}}'>删除</text>
+        </view>
+    </view>
+    <view  class="upload" bindtap="uploadImg">
+          <image mode="widthFix" src="../../images/img.png"></image>
+            上传图片
+    </view>
+</view>
+<view class="item">
+    <label>规则</label>
+    <text style="margin: 0;">入金比赛成绩稀释,出金保持成绩不变</text>
+</view>
+<button bindtap="post">提交</button>

+ 96 - 0
pages/change/change.wxss

@@ -0,0 +1,96 @@
+/* pages/change/change.wxss */
+page{
+    padding: 30rpx;
+}
+.item{
+    display: flex;
+    margin-bottom: 16rpx;
+}
+.item label{
+    font-size: 30rpx;
+    line-height: 88rpx;
+    width: 150rpx;
+    color: #333;
+    margin-right: 30rpx;
+}
+.item input{
+    width: 40%;
+    height: 88rpx;
+    border: 1px solid rgba(224, 224, 224, 1);
+    border-radius: 8rpx;
+    padding: 0 24rpx;
+    font-size: 30rpx;
+}
+.item>text{
+    font-size: 30rpx;
+    line-height: 88rpx;
+    color: #333;
+    margin-left: 20rpx;
+}
+.item>text text{
+    color: rgba(153, 153, 153, 1);
+}
+.upload{
+    width: 240rpx;
+    height: 240rpx;
+    background: #F7F7F7;
+    border-radius: 8rpx;
+    text-align: center;
+    font-size: 30rpx;
+    padding-top: 74rpx;
+    display: inline-block;
+    vertical-align: top;
+  }
+  .upload image{
+    width: 50rpx;
+    display: block;
+    margin: 0 auto 8rpx;
+  }
+  .stock_imgs{
+    display: inline-block;
+    width: 240rpx;
+    height:240rpx;
+    vertical-align: top;
+    position: relative;
+    margin-right: 10rpx;
+    margin-bottom: 10rpx;
+  }
+  .stock_imgs icon{
+    position: absolute;
+    right: 10rpx;
+    top: 10rpx;
+  }
+  .stock_imgs image{
+    border-radius: 8rpx;
+    width:240rpx;height:240rpx;
+  }
+  .edit{
+    text-align: center;
+    position: absolute;
+    bottom: 2px;
+    left: 0;
+    width: 100%;
+  }
+  .edit text{
+    display: inline-block;
+    color: #fff;
+    background: #D94B24;
+    border-radius: 32rpx;
+    width: 100rpx;
+    line-height: 48rpx;
+    text-align: center;
+    font-size: 28rpx;
+    margin: 0 2px;
+  }
+  button:not([size='mini']){
+    background: #D94B24;
+    color: #fff;
+    width: 100% !important;
+    height: 88rpx;
+    line-height: 88rpx;
+    padding: 0;
+    font-size: 32rpx;
+    border-radius: 8rpx;
+    margin-top: 50rpx;
+    font-weight: 400;
+  }

+ 103 - 0
pages/comment/comment.js

@@ -0,0 +1,103 @@
+// pages/follow/follow.js
+const $api = require('../../utils/api.js').API;
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    list: [],
+    page:1,
+    total:0,
+    show:0
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    this.setData({
+      id:options.id
+    })
+    this.getData();
+  },
+  next: function () {
+    if (this.data.list.length < this.data.total) {
+      const page = this.data.page + 1
+      this.setData({
+        page: page
+      })
+      this.getData()
+    }
+  },
+  getData(){
+    wx.showLoading({
+      title: '正在加载',
+    })
+    var list = this.data.list
+    $api.getComment({
+      page: this.data.page, page_size: 20,
+      group_id: this.data.id
+    }).then(res => {
+      wx.hideLoading()
+      res.data.data.list.forEach(item => {
+        list.push(item)
+      })
+      this.setData({
+        list: list,
+        total: res.data.data.total,
+        show:1
+      })
+    })
+  },
+
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 3 - 0
pages/comment/comment.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "顽主点评"
+}

+ 28 - 0
pages/comment/comment.wxml

@@ -0,0 +1,28 @@
+<!--pages/comment/comment.wxml-->
+<scroll-view scroll-y='{{true}}' bindscrolltolower='next'>
+  <navigator hover-class="none" class="list" wx:for='{{list}}' url="../today/today?id={{item.match_id}}&record_id={{item.id}}&player_id={{item.player_id}}">
+        <view class="name">{{item.username}}  <text>选手</text> <view>TOP <text>{{item.group_rank}}</text></view></view> 
+        <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.init_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="comment">
+            <text>顽主点评</text>
+            {{item.wanzhu_comment}}
+        </view>
+  </navigator>
+  <block wx:if='{{total >= 20}}'>
+    <view class='loading' wx:if='{{list.length < total}}'>上拉加载更多...</view>
+  </block>
+  <view wx:if="{{list.length<=0&&show}}" class="not_data">-暂无数据-</view>
+</scroll-view>

+ 69 - 0
pages/comment/comment.wxss

@@ -0,0 +1,69 @@
+/* pages/comment/comment.wxss */
+page{
+  padding: 0 30rpx;
+}
+scroll-view{
+  height: 100vh;
+}
+.name{
+  font-size: 32rpx;
+  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: #CE994F;
+  font-size: 22rpx;
+  text-align: center;
+  position: relative;
+  top: -5rpx;
+}
+.name view text{
+  display: block;
+  font-size: 32rpx;
+  color: #CE994F;
+  position: relative;
+  top: -8rpx;
+}
+.info{
+  font-size: 30rpx;
+  padding: 10rpx 0;
+  display: flex;
+}
+.info view{
+  color: #666;
+  width: 85%;
+  vertical-align: top;
+}
+.info label{
+  font-weight: 500;
+  color: #333;
+}
+.list{
+  border-bottom: 1px solid #F5F5F5;
+  padding: 30rpx 0;
+}
+.comment{
+  font-size: 30rpx;
+  line-height: 50rpx;
+  margin-top: 20rpx;
+}
+.comment text{
+  color: #2383E5;
+  font-size: 28rpx;
+  background: #F2F9FF;
+  display: inline-block;
+  width: 128rpx;
+  text-align: center;
+  border-radius: 4rpx;
+}

+ 113 - 0
pages/day/day.js

@@ -0,0 +1,113 @@
+// pages/follow/follow.js
+const $api = require('../../utils/api.js').API;
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    list: [],
+    page: 1,
+    total: 0,
+    show: 0
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    this.setData({
+      id: options.id,
+      player_id: options.player_id
+    })
+    this.getData();
+  },
+  next: function () {
+    if (this.data.list.length < this.data.total) {
+      const page = this.data.page + 1
+      this.setData({
+        page: page
+      })
+      this.getData()
+    }
+  },
+  getData() {
+    wx.showLoading({
+      title: '正在加载',
+    })
+    var list = this.data.list
+    //每日持股
+    var parm = {
+      id: this.data.id, player_id: this.data.player_id,
+      page: this.data.page, page_size: 20
+    }
+    $api.getRecordList(parm).then(res => {
+      wx.hideLoading()
+      res.data.data.list.forEach(item => {
+        list.push(item)
+      })
+      this.setData({
+        list: list,
+        total: res.data.data.total,
+        show: 1
+      })
+    })
+  },
+  //预览
+  preview(e) {
+    wx.previewImage({
+      urls: e.target.dataset.urls,
+      current: e.target.dataset.src
+    })
+  },
+
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 3 - 0
pages/day/day.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "每日持股"
+}

+ 31 - 0
pages/day/day.wxml

@@ -0,0 +1,31 @@
+<scroll-view scroll-y='{{true}}' bindscrolltolower='next'>
+  <view class="stock" wx:for='{{list}}'>
+  <navigator hover-class="none" url="../record/record?id={{item.id}}" >
+    <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>
+        <block wx:for='{{item.today_stock}}' wx:for-item='i'>
+          {{i.name}}({{i.fund}}w)
+        </block>
+    </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>
+  <block wx:if='{{total >= 20}}'>
+    <view class='loading' wx:if='{{followList.length < total}}'>上拉加载更多...</view>
+  </block>
+  <view wx:if="{{list.length<=0&&show}}" class="not_data">-暂无数据-</view>
+</scroll-view>

+ 45 - 0
pages/day/day.wxss

@@ -0,0 +1,45 @@
+/* pages/day/day.wxss */
+page{
+  padding:  30rpx;
+}
+scroll-view{
+  height: 100vh;
+}
+.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;
+}
+.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;
+}
+.imgs{
+  padding: 30rpx 0 0;
+  margin: 0;
+}
+.img{
+  display: inline-block;
+  width: 224rpx;
+  height: 224rpx;
+  border-radius: 8rpx;
+  margin-right: 8rpx;
+  margin-bottom: 8rpx;
+}

+ 92 - 0
pages/detail/detail.js

@@ -0,0 +1,92 @@
+// pages/detail/detail.js
+// 29014
+const $api = require('../../utils/api.js').API;
+Page({
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    name:'',
+    articleid:'',
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    $api.getArticle({id:options.id}).then(res=>{
+      this.setData({
+        info:res.data.data,
+        name:res.data.data.name,
+        articleid:options.id,
+      })
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+
+  onShareAppMessage() {
+    // const promise = new Promise(resolve => {
+    //   setTimeout(() => {
+    //     resolve({
+    //       title: this.data.name
+    //     })
+    //   }, 2000)
+    // }),
+    return{
+      title:this.data.name,
+      path:'/pages/detail/detail?id=' + this.data.articleid
+    }
+  },
+
+  // onShareTimeline: function() {
+  //   return {
+  //   title: this.data.name,
+  //   query: {'id':this.data.articleid}
+  //   }
+  // }
+})

+ 3 - 0
pages/detail/detail.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "详情"
+}

+ 5 - 0
pages/detail/detail.wxml

@@ -0,0 +1,5 @@
+<view class='title'>{{info.name}}</view>
+<view class="date">{{info.ctime}}</view>
+<view class="content">
+  <rich-text nodes="{{info.content}}"></rich-text>
+</view>

+ 19 - 0
pages/detail/detail.wxss

@@ -0,0 +1,19 @@
+/* pages/detail/detail.wxss */
+page{
+  padding: 36rpx;
+}
+.title{
+  font-weight: 500;
+  font-size: 40rpx;
+  line-height: 56rpx;
+  margin-bottom: 10rpx;
+}
+.date{
+  color: #999;
+  font-size: 28rpx;
+  margin-bottom: 30rpx;
+}
+.content{
+  font-size: 32rpx;
+  line-height: 56rpx;
+}

+ 95 - 0
pages/follow/follow.js

@@ -0,0 +1,95 @@
+// pages/follow/follow.js
+const $api = require('../../utils/api.js').API;
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    list:[],
+    page: 1,
+    total: 0,
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    wx.showLoading({
+      title: '正在加载',
+    })
+    this.getFollow()
+  },
+  next: function () {
+    if (this.data.list.length < this.data.total) {
+      const page = this.data.page + 1
+      this.setData({
+        page: page
+      })
+      this.getFollow()
+    }
+  },
+  getFollow() {
+    var list = this.data.list
+    $api.getMyFollow({
+      page: this.data.page, page_size: 20
+    }).then(res => {
+      wx.hideLoading()
+      res.data.data.list.forEach(item => {
+        list.push(item)
+      })
+      this.setData({
+        list: list,
+        total: res.data.data.total
+      })
+    })
+  },
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 3 - 0
pages/follow/follow.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "我的关注"
+}

+ 19 - 0
pages/follow/follow.wxml

@@ -0,0 +1,19 @@
+<scroll-view  scroll-y='{{true}}' bindscrolltolower='next'>
+  <navigator hover-class="none" class="follow" wx:for='{{list}}' url="../today/today?id={{item.match_id}}&record_id={{item.id}}&player_id={{item.player_id}}">
+    <view class="name">{{item.username}}  <text>选手</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>
+  </navigator>
+  <block wx:if='{{total >= 20}}'>
+    <view class='loading' wx:if='{{list.length < total}}'>上拉加载更多...</view>
+  </block>
+  <view wx:if="{{list.length<=0}}" class="not_data">-暂无数据-</view>
+</scroll-view>
+

+ 51 - 0
pages/follow/follow.wxss

@@ -0,0 +1,51 @@
+/* pages/follow/follow.wxss */
+page{
+  padding: 30rpx;
+}
+.follow{
+  border-bottom: 1px solid #F5F5F5;
+  margin-bottom: 30rpx;
+}
+.name{
+  font-size: 32rpx;
+  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: #CE994F;
+  font-size: 22rpx;
+  text-align: center;
+  position: relative;
+  top: -5rpx;
+}
+.name view text{
+  display: block;
+  font-size: 32rpx;
+  color: #CE994F;
+  position: relative;
+  top: -8rpx;
+}
+.info{
+  font-size: 30rpx;
+  padding: 10rpx 0;
+  display: flex;
+}
+.info view{
+  color: #666;
+  width: 85%;
+  vertical-align: top;
+}
+scroll-view{
+  height: 100vh;
+}

+ 66 - 0
pages/games/games.js

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

+ 3 - 0
pages/games/games.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "比赛届数"
+}

+ 14 - 0
pages/games/games.wxml

@@ -0,0 +1,14 @@
+<navigator hover-class="none" class="list">
+    <image mode="widthFix" src="../../images/jiangbei.png"></image>
+    <view>
+        第48届顽主杯实盘大赛
+        <text>2021-10-11至2021-12-11</text>
+    </view>
+</navigator>
+<navigator hover-class="none" class="list">
+    <image mode="widthFix" src="../../images/jiangbei.png"></image>
+    <view>
+        第48届顽主杯实盘大赛
+        <text>2021-10-11至2021-12-11</text>
+    </view>
+</navigator>

+ 25 - 0
pages/games/games.wxss

@@ -0,0 +1,25 @@
+/* pages/games/games.wxss */
+page{
+  padding: 0 30rpx;
+}
+.list{
+  position: relative;
+  border-bottom: 1px solid #F5F5F5;
+  padding: 30rpx 0;
+  padding-left: 64rpx;
+}
+.list view{
+  font-size: 32rpx;
+}
+.list text{
+  color: #666;
+  font-size: 30rpx;
+  display: block;
+  margin-top: 5rpx;
+}
+.list image{
+  width: 48rpx;
+  position: absolute;
+  top: 34rpx;
+  left: 0;
+}

+ 364 - 0
pages/homepage/homepage.js

@@ -0,0 +1,364 @@
+// 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: {
+    mydata:{},
+    date:'2021-11',
+    days:[],
+    ec: {
+      onInit: null
+    },
+    ec1: {
+      onInit: null
+    }
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    
+
+    // options.id = 7, options.record_id = 29014
+    // options.id = 9, options.player_id = 3520
+    id = options.id, record_id = options.record_id
+    this.setData({
+      type:options.type?options.type:'',
+      id: id,
+      record_id: record_id,
+      player_id: options.player_id ? options.player_id:''
+    })
+    if(options.type){
+        wx.setNavigationBarTitle({
+          title: '我的主页',
+        })
+    }
+    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()
+  },
+  logout() {
+    wx.removeStorage({
+      key: 'userInfo'
+    })
+    wx.switchTab({
+      url: '../user/user',
+    })
+  },
+  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": "Ta的主页",
+  "usingComponents": {
+    "ec-canvas": "../../ec-canvas/ec-canvas"
+  }
+}

+ 125 - 0
pages/homepage/homepage.wxml

@@ -0,0 +1,125 @@
+<view class="per_top">
+    <image src="{{datas.today_record.avatar}}" ></image>
+    <view class="name">
+      {{datas.today_record.username}}
+      <view class="fans">
+          <text>2626</text>粉丝
+          <text style="margin-left: 20rpx;">2626</text>关注
+      </view>
+    </view>
+    <block wx:if='{{type!=1}}'>
+    <view class="follow" style="width:140rpx;" wx:if='{{is_follow}}' data-action='cancel' bindtap="followPlayer">取消关注</view>
+    <view class="follow" wx:else  bindtap="followPlayer">+ 关注</view>
+    </block>
+    <navigator class="follow" url="../change/change" wx:else>编辑</navigator>
+</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="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 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>
+      </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>
+
+<view wx:if="type==1" class="content" style="margin-top: 100rpx;"><view bindtap="logout" class="logout">退出登录</view></view>
+

+ 282 - 0
pages/homepage/homepage.wxss

@@ -0,0 +1,282 @@
+/* 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;
+}
+
+.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:32rpx;
+  font-weight: 500;
+  margin-left: 110rpx;
+  color: #fff;
+}
+.fans{
+  color: rgba(255, 255, 255, 0.75);
+  font-size: 28rpx;
+  margin-top: 10rpx;
+}
+.fans text{
+  color: #FFF;
+  font-weight: bold;
+  margin-right: 10rpx;
+}
+.per_top .follow {
+  color: #fff;
+  font-size: 28rpx;
+  position: absolute;
+  right: 24rpx;
+  top: 32rpx;
+  border: 1px solid #fff;
+  border-radius: 8rpx;
+  padding: 5rpx 8rpx;
+}
+.style{
+  background: #fff;
+  padding: 30rpx;
+  margin-bottom: 20rpx;
+  font-size: 30rpx;
+  color: #333;
+}
+.style view{
+  padding: 6rpx 0;
+}
+.style text{
+  display: inline-block;
+  color: #999;
+  font-size: 30rpx;
+  width: 180rpx;
+}
+.style .tag{
+  font-size: 28rpx;
+  color: #CE994F;
+  border: 1px solid #CE994F;
+  border-radius: 8rpx;
+  margin-right: 8rpx;
+  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;
+  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;
+}
+.logout{
+  width: 100%;
+  line-height: 88rpx;
+  color: #666;
+  font-size: 32rpx;
+  text-align: center;
+  border: 1px solid rgba(224, 224, 224, 1);
+  border-radius: 8rpx;
+  background: #fff;
+}

+ 273 - 0
pages/index/index.js

@@ -0,0 +1,273 @@
+// index.js
+// 获取应用实例
+const app = getApp()
+const $api = require('../../utils/api.js').API;
+Page({
+  data: {
+    loading:0,
+    notices:[],
+    tabs:['关注','热门股票','热门选手','胜率榜','冠军心得'],
+    cur:0,
+    date:'2021-11-09',
+    followList:[],
+    defendList:[],
+    winList:[],
+    hotFollowList:[],
+    page:1,
+    total:-1,
+    page1: 1,
+    total1: 0,
+    page2: 1,
+    total2: 0,
+    page3: 1,
+    total3: 0,
+    error:0
+  },
+  onLoad() {
+    wx.showNavigationBarLoading()
+    var y = new Date().getFullYear(), m = (new Date().getMonth() + 1), d = new Date().getDate();
+    m = m > 9 ? m : '0' + m;
+    d = d > 9 ? d : '0' + d;
+    this.setData({
+      date: y + '-' + m + '-' + d
+    })
+
+    this.getFollow()
+   
+    $api.getNotoice().then(res=>{
+      this.setData({
+        notices:res.data.data
+      })
+    })
+  },
+  fresh: function () {
+    this.setData({
+      page:1,
+      total:-1,
+      loading:1
+    })
+    this.getFollow()
+  },
+  //关注分页
+  next: function () {
+    if (this.data.followList.length < this.data.total) {
+      const page = this.data.page + 1
+      this.setData({
+        page: page
+      })
+      this.getFollow()
+    }
+  },
+  getFollow(){
+    var followList = this.data.followList
+    if(this.data.loading){
+      followList=[]
+    }
+    $api.getMyFollow({
+      page: this.data.page, page_size: 20
+    }).then(res => {
+      wx.hideNavigationBarLoading()
+      res.data.data.list.forEach(item=>{
+        followList.push(item)
+      })
+      this.setData({
+        followList: followList,
+        total:res.data.data.total,
+        error:0,
+        loading: 0
+      })
+    })
+    .catch(err=>{
+      this.setData({
+        error:1
+      })
+      // console.log(err)
+    })
+  },
+  //胜率分页
+  next1: function () {
+    if (this.data.winList.length < this.data.total1) {
+      const page = this.data.page1 + 1
+      this.setData({
+        page1: page
+      })
+      this.getWin()
+    }
+  },
+  getWin() {
+    var winList = this.data.winList
+    $api.getRinrate({
+      page: this.data.page1, page_size: 20
+    }).then(res => {
+      res.data.data.list.forEach(item => {
+        winList.push(item)
+      })
+      this.setData({
+        winList: winList,
+        total1: res.data.data.total
+      })
+    })
+  },
+  //防守分页  防守榜去掉
+  // next2: function () {
+  //   if (this.data.defendList.length < this.data.total2) {
+  //     const page = this.data.page2 + 1
+  //     this.setData({
+  //       page2: page
+  //     })
+  //     this.getDefen()
+  //   }
+  // },
+  // getDefen() {
+  //   var defendList = this.data.defendList
+  //   $api.getDefend({
+  //     page: this.data.page2, page_size: 20
+  //   }).then(res => {
+  //     res.data.data.list.forEach(item => {
+  //       defendList.push(item)
+  //     })
+  //     this.setData({
+  //       defendList: defendList,
+  //       total2: res.data.data.total
+  //     })
+  //   })
+  // },
+
+  getData(){
+    //心得
+    $api.getChampionlList().then(res => {
+      this.setData({
+        championList: res.data.data.list
+      })
+    })
+    
+    // $api.getDate().then(res=>{
+    //   this.setData({
+    //     date:res.data.data
+    //   })
+    //   this.getHot()
+    //   this.getHotFollowList()
+    // })
+  }, 
+  //热门选手分页
+  next3: function () {
+    if (this.data.hotFollowList.length < this.data.total3) {
+      const page = this.data.page3 + 1
+      this.setData({
+        page3: page
+      })
+      this.getHotFollowList()
+    }
+  },
+  getHotFollowList() {
+    var hotFollowList = this.data.hotFollowList
+    let stock_date = this.data.date
+    $api.getHotFollow({
+      page: this.data.page3, page_size: 20, stock_date: stock_date
+    }).then(res => {
+      
+      res.data.data.list.forEach(item => {
+        hotFollowList.push(item)
+      })
+      this.setData({
+        hotFollowList: hotFollowList,
+        total3: res.data.data.total
+      })
+    })
+  },
+  getHot(){
+    //热门
+    let stock_date = this.data.date
+    $api.getHotFollow({ stock_date: stock_date }).then(res => {
+      this.setData({
+        hotFollowList: res.data.data.list
+      })
+    })
+    $api.getHotbuyList({ stock_date: stock_date }).then(res => {
+      
+      this.setData({
+        hotbuyList: res.data.data.list
+      })
+      wx.hideNavigationBarLoading()
+    })
+    $api.getHotsellList({ stock_date: stock_date }).then(res => {
+      this.setData({
+        hotsellList: res.data.data.list
+      })
+    })
+  },
+  tabChange(e){
+      this.setData({
+        cur:e.target.dataset.id
+      })
+
+      switch(e.target.dataset.id){
+        case 0:
+          this.getFollow()
+        case 1:
+          this.getHot()
+        case 2:
+          this.getHotFollowList()
+        case 3:
+          this.getWin()
+        case 4:
+          this.getData()
+      }
+      
+
+
+  },
+  //预览
+  preview(e){
+    console.log(e)
+    wx.previewImage({
+      urls: e.target.dataset.urls,
+      current: e.target.dataset.src
+    })
+  },
+  curChange(e){
+    if (e.detail.source == "touch"){
+        this.setData({
+          cur: e.detail.current
+        })
+
+        switch(e.detail.current){
+          case 0:
+            this.getFollow()
+          case 1:
+            this.getHot()
+          case 2:
+            this.getHotFollowList()
+          case 3:
+            this.getWin()
+          case 4:
+            this.getData()
+        }
+    }
+  
+
+  },
+  //热门股票
+  bindDateChange(e){
+    this.setData({
+      date:e.detail.value
+    })
+    wx.showNavigationBarLoading()
+    this.getHot()
+  },
+  onShow: function (e) {
+    if (app.globalData.follow){
+      this.setData({
+        page: 1,
+        total: -1,
+        followList: [],
+      })
+      app.globalData.follow=0
+      this.getFollow()
+    }
+    
+    if (this.data.error) {
+      this.onLoad()
+    }
+  },
+})

+ 3 - 0
pages/index/index.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 197 - 0
pages/index/index.wxml

@@ -0,0 +1,197 @@
+<!--index.wxml-->
+<view   class="marquee_container"  
+  style="{{'--marqueeWidth--:'+-12*notices.length+'em'}}">
+    <view class="zd"></view>
+    <image src="../../images/tttz.png" mode="widthFix"></image>
+      <view class="marquee_text">
+        <navigator hover-class="none" url="../detail/detail?id={{item.id}}" wx:for="{{notices}}">{{item.name}}</navigator>
+      </view>
+  </view>
+
+<view class="tab">
+    <view wx:for='{{tabs}}' bindtap="tabChange" data-id='{{index}}' class="{{index==cur?'act':''}}">{{item}}</view>
+</view>
+
+<swiper current='{{cur}}'  bindchange='curChange'>
+  <swiper-item>
+      <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 hover-class="none"  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> 
+              <view>TOP <text>{{item.group_rank}}</text></view></view> 
+              <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>
+                胜率<text  class="{{item.win_rate[0]=='-' ?'down':'up'}}"> {{item.win_rate}}</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>
+                </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>
+          <block wx:if='{{total >= 20}}'>
+            <view class='loading' wx:if='{{followList.length < total}}'>上拉加载更多...</view>
+          </block>
+          <block wx:if='{{total == 0}}'>
+            <view class='loading' style="margin-top:200rpx;">暂无关注选手</view>
+          </block>
+      </scroll-view>
+  </swiper-item>
+  <swiper-item>
+      <scroll-view style="padding:0;" scroll-y='{{true}}'>
+          <view class="item2">
+              <picker mode="date" value="{{date}}"  bindchange="bindDateChange">
+                <view class="date-picker">
+                   {{date}}
+                   <image style="width:24rpx;" mode="widthFix" src="../../images/icon_down@2x.png"></image>
+                </view>
+              </picker>
+              <view class="hot">
+                    <view class="tab1">热门持仓</view>
+                    <navigator hover-class="none" url="../stock/stock?id={{item.id}}&date={{date}}" class="gp" wx:for='{{hotbuyList}}' wx:if='{{index<10}}'>
+                        <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>
+                        <text class="rank" wx:if='{{index>2}}'>{{index+1}}</text>
+                        <view class="gp-name">{{item.stock_name}}</view>
+                        <view class="num">持仓 <text>{{item.count}}</text> 人</view>
+                    </navigator>
+                    <navigator hover-class="none" url="../stock/stock?date={{date}}&type=1"  class="more">查看更多 <image mode="widthFix" src="../../images/right_icon.png"></image></navigator>
+              </view>
+              <!-- <view class="hot">
+                    <view class="tab2">热门清仓</view>
+                    <navigator hover-class="none" url="../stock/stock?id={{item.id}}&date={{date}}&type=2" 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>
+                        <view class="gp-name">{{item.stock_name}}</view>
+                        <view class="num">清仓 <text>{{item.count}}</text> 人</view>
+                    </navigator>
+                    <navigator hover-class="none"  url="../stock/stock?date={{date}}&type=2" class="more">查看更多 <image mode="widthFix" src="../../images/right_icon.png"></image></navigator>
+              </view> -->
+          </view>
+      </scroll-view>
+  </swiper-item>
+  <swiper-item>
+      <scroll-view  scroll-y='{{true}}' bindscrolltolower='next3'>
+          <view class="item3">
+             <navigator hover-class="none" class="win" wx:for='{{hotFollowList}}' url="../today/today?id={{item.match_id}}&player_id={{item.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>
+                <text class="rank" wx:if='{{index>2}}'>{{index+1}}</text>
+                <view class="name">
+                  {{item.player_name}}  <text>{{item.badge}}</text>
+                  <view>关注 
+                    <text>{{item.count}}</text>
+                  </view>
+                </view>
+                <view class="info" wx:if='{{item.style.length>0}}'>风格:
+                <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> 
+                      <text style="color:#F5F5F5;">  |  </text>
+                      <text style="color:#666;">胜率</text>
+                      <text class="{{item.win_rate[0]=='-' ?'down':'up'}}"> {{item.win_rate}} </text>)
+                  </view>
+                </view>
+             </navigator>
+          </view>
+          <block wx:if='{{total3 >= 20}}'>
+            <view class='loading' wx:if='{{hotFollowList.length < total3}}'>上拉加载更多...</view>
+          </block>
+      </scroll-view>
+  </swiper-item>
+  <swiper-item>
+      <scroll-view  scroll-y='{{true}}' bindscrolltolower='next1'>
+          <view class="item3">
+          <view class="exp">释义:开赛以来选手单日收益为正天数占总天数比重,检验进攻稳定性</view>
+             <navigator hover-class="none" 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>
+                <text class="rank" wx:if='{{index>2}}'>{{index+1}}</text>
+                <view class="name">
+                  {{item.username}}  <text>{{item.badge}}</text>
+                  <view>胜率 
+                    <text class="{{item.win_rate[0]=='-' ?'down':'up'}}">{{item.win_rate}}</text>
+                  </view>
+                </view>
+                <view class="info" wx:if='{{item.style.length>0}}'>风格:
+                <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> 
+                      <text style="color:#F5F5F5;">  |  </text>
+                      <text style="color:#666;">最大回撤</text>
+                      <text class="{{item.badest_income[0]=='-' ?'down':'up'}}"> {{item.badest_income}} </text>)
+                  </view>
+                </view>
+             </navigator>
+          </view>
+          <block wx:if='{{total1 >= 20}}'>
+            <view class='loading' wx:if='{{winList.length < total1}}'>上拉加载更多...</view>
+          </block>
+      </scroll-view>
+  </swiper-item>
+  <!-- <swiper-item>
+      <scroll-view  scroll-y='{{true}}' bindscrolltolower='next2'>
+          <view class="item4">
+          <view class="exp">释义:开赛以来选手最大单日回撤,检验防守稳固性</view>
+            <navigator hover-class="none" 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>
+                <text class="rank" wx:if='{{index>2}}'>{{index+1}}</text>
+                <view class="name">
+                  {{item.username}}  <text>{{item.badge}}</text>
+                  <view>最大回撤  
+                  <text class="{{item.badest_income[0]=='-' ?'down':'up'}}">{{item.badest_income}}</text></view>
+                </view>
+                <view class="info" wx:if='{{item.style.length>0}}'>风格:
+                <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> 
+                      <text style="color:#F5F5F5;">  |  </text>
+                      胜率
+                      <text class="{{item.win_rate[0]=='-' ?'down':'up'}}">{{item.win_rate}}</text> )
+                  </view>
+                </view>
+            </navigator>
+          </view>
+          <block wx:if='{{total2 >= 20}}'>
+            <view class='loading' wx:if='{{defendList.length < total2}}'>上拉加载更多...</view>
+          </block>
+      </scroll-view>
+  </swiper-item> -->
+  <swiper-item>
+      <scroll-view  scroll-y='{{true}}'>
+          <navigator hover-class="none" url="../detail/detail?id={{item.id}}" class="list" wx:for='{{championList}}'>
+             <view>
+                <view class="title">
+                   {{item.name}}
+                </view>
+                <text>{{item.ctime}}</text>
+             </view>
+             <image src="{{item.img}}"></image>
+          </navigator>
+      </scroll-view>
+  </swiper-item>
+</swiper>

+ 293 - 0
pages/index/index.wxss

@@ -0,0 +1,293 @@
+/**index.wxss**/
+/*首页跑马灯效果*/
+@keyframes around {
+  from {
+   margin-left: 90%;
+  }
+  to {
+   /* var接受传入的变量 */
+   margin-left: -100%;
+  }
+ }
+ .zd{
+   width: 80px;
+   height: 100%;
+   position: absolute;
+   left: 0;
+   top: 0;
+   background: #fff;
+
+ }
+.marquee_container{
+  width: 100%;
+  background: #fff;
+  /* box-shadow:0px 4px 12px 0px rgba(0,0,0,0.08); */
+  border-radius:4px;
+  padding: 12.5px 12px;
+  position: relative;
+  overflow: hidden;
+  height: 90rpx;
+}
+.marquee_container:hover{
+  /* 不起作用 */
+  animation-play-state: paused;
+}
+.marquee_text{
+  color:#333;
+  font-size: 28rpx;
+  display: flex;
+  white-space: nowrap;
+  animation-name: around;
+  animation-duration: 15s;  /*过渡时间*/
+  animation-iteration-count: infinite;
+  animation-timing-function:linear;
+}
+.marquee_text navigator{
+  margin-right: 20px;
+}
+.marquee_container image{
+  width: 60px;
+  max-height: 30px;
+  position: absolute;
+  left: 10px;
+  top: 30rpx;
+}
+page{
+  background: #F7F7F7;
+}
+.tab{
+  background: #fff;
+  margin-top: 16rpx;
+  padding:0 25rpx;
+  display: flex;
+  justify-content: space-between;
+  
+}
+.tab view{
+  font-size: 28rpx;
+  color: #333;
+  line-height: 90rpx;
+  transition: all .1s linear;
+}
+.tab .act{
+  font-size: 38rpx;
+  font-weight: 500;
+  line-height: 88rpx;
+}
+swiper{
+  background: #fff;
+  height: calc(100vh - 92rpx - 100rpx);
+}
+scroll-view{
+  height: 100%;
+  padding: 20rpx 25rpx 0;
+}
+.item1{
+  border-bottom: 1px solid #F5F5F5;
+  margin-bottom: 30rpx;
+}
+.name{
+  font-size: 32rpx;
+  font-weight: 500;
+  margin-bottom: 20rpx;
+}
+.name>text{
+  color: #AAAAAA;
+  font-size: 20rpx;
+  border: 1px solid #AAAAAA;
+  border-radius: 4rpx;
+  font-weight: 400;
+  padding: 0 4rpx;
+  position: relative;
+  top: -3rpx;
+}
+.name view{
+  float: right;
+  color: #CE994F;
+  font-size: 22rpx;
+  text-align: center;
+  position: relative;
+  top: -5rpx;
+}
+.name view text{
+  display: block;
+  font-size: 32rpx;
+  color: #CE994F;
+  position: relative;
+  top: -8rpx;
+}
+.info{
+  font-size: 30rpx;
+  padding: 10rpx 0;
+  display: flex;
+  flex-wrap: wrap;
+}
+.info view{
+  color: #666;
+  width: 85%;
+  vertical-align: top;
+}
+.info label{
+  font-weight: 500;
+  color: #333;
+}
+.imgs{
+  margin: 30rpx 0;
+}
+.img{
+  display: inline-block;
+  width: 224rpx;
+  height: 224rpx;
+  border-radius: 8rpx;
+  margin-right: 8rpx;
+  margin-bottom: 8rpx;
+}
+
+/* //热门股票 */
+.item2{
+  padding: 20rpx 25rpx 0;
+}
+.date-picker{
+  text-align: center;
+  font-weight: 500;
+  font-size: 32rpx;
+}
+.hot{
+  border-radius: 16rpx;
+  margin-top: 30rpx;
+  box-shadow: 0px 0px 12px 0px rgba(218, 217, 217, 0.5);
+}
+.tab1{
+  color: #D94B24;
+  padding: 0 24rpx;
+  font-weight: 500;
+  font-size: 40rpx;
+  line-height: 88rpx;
+  border-radius: 16rpx 16rpx 0px 0px;
+  background: linear-gradient(124deg, #FEEAEC 0%, #FFAEAF 100%);
+}
+.tab2{
+  color: #2383E5;
+  padding: 0 24rpx;
+  font-weight: 500;
+  font-size: 40rpx;
+  line-height: 88rpx;
+  border-radius: 16rpx 16rpx 0px 0px;
+  background: linear-gradient(124deg, #ECF6FF 0%, #B4D9FF 100%);
+}
+.hot image{
+  width: 54rpx;
+  position: relative;
+  top:3rpx;
+}
+.gp{
+  display: flex;
+  justify-content: space-between;
+  padding: 24rpx;
+}
+.gp-name{
+  font-weight: 500;
+  font-size: 32rpx;
+  width: 70%;
+  padding-left: 8rpx;
+}
+.num{
+  font-size: 28rpx;
+  color: #666;
+  text-align: right;
+  width: 200rpx;
+}
+.num text{
+  font-size: 36rpx;
+  font-weight: 500;
+}
+.more{
+  display: block;
+  border-top: 1px solid #F5F5F5;
+  line-height: 94rpx;
+  text-align: center;
+  font-size: 28rpx;
+  color: #333;
+}
+.more image{
+  width: 24rpx;
+  position: relative;
+  top: 3rpx;
+}
+
+/* 胜率 */
+.win{
+  position: relative;
+  padding: 30rpx 0;
+  padding-left: 59rpx;
+  border-bottom: 1px solid #F5F5F5;
+}
+.win image{
+  width: 50rpx;
+  position: absolute;
+  top: 33rpx;
+  left: 0;
+}
+.hot .rank{
+  width:50rpx;text-align:center;color:#CE994F;
+  display: inline-block;
+}
+.win .rank{
+  position: absolute;
+  top: 32rpx;
+  left: 0;
+  width:50rpx;text-align:center;color:#CE994F;
+}
+.win .name view{
+  float: right;
+  color: #666;
+  font-size: 28rpx;
+  text-align: center;
+  position: relative;
+  top: 0;
+  font-weight: 400;
+}
+.win .name view text{
+  font-size: 36rpx;
+  color: #E90001;
+  display: inline;
+  top: 0;
+}
+.win .tag{
+  font-size: 28rpx;
+  color: #CE994F;
+  border: 1px solid #CE994F;
+  border-radius: 8rpx;
+  margin-right: 8rpx;
+  font-weight: 400;
+  padding: 0 8rpx;
+  margin-bottom: 10rpx;
+}
+
+/* 冠军心得 */
+.list{
+  display: flex;
+  justify-content: space-between;
+  border-bottom: 1px solid #F5F5F5;
+  padding: 24rpx 0;
+}
+.list image{
+  width: 174rpx;
+  height: 120rpx;
+  border-radius: 8rpx;
+}
+.list>view{
+  width: 70%;
+  font-size: 32rpx;
+}
+.list .title{
+  height: 88rpx;
+}
+.list text{
+  font-size: 28rpx;
+  color: #999;
+}
+.exp{
+  color: #D94B24;
+  font-size: 24rpx;
+}

+ 141 - 0
pages/list/list.js

@@ -0,0 +1,141 @@
+// pages/list/list.js
+const $api = require('../../utils/api.js').API;
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    id:'',
+    page:1,
+    total:0,
+    order1:1,
+    order2: 1,
+    order_by:'',
+    list:[],
+    date:''
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    this.setData({
+      id: options.id,
+      date:options.stock_date
+    })
+    this.getData();
+  },
+  getData(){
+    var data={
+      id: this.data.id,
+      page: this.data.page,
+      page_size:20,
+      order_by: this.data.order_by,
+      stock_date:this.data.date
+    }
+    
+    const list = this.data.list;
+    wx.showNavigationBarLoading();
+    $api.getRankList(data).then(res=>{
+          const players = res.data.data.players;
+          for (let i = 0; i < players.length; i++) {
+            list.push(players[i])
+          }
+          this.setData({
+            group: res.data.data.group,
+            list: list,
+            total: res.data.data.total,
+            actual_person: res.data.data.actual_person,
+            leave_person: res.data.data.leave_person,
+            total_person: res.data.data.total_person,
+            win_person: res.data.data.win_person,
+            loss_person: res.data.data.loss_person
+          })
+          wx.setNavigationBarTitle({
+            title: res.data.data.group.name,
+          })
+          wx.hideNavigationBarLoading()
+    })
+  },
+  next: function () {
+    if (this.data.list.length < this.data.total) {
+      const page = this.data.page + 1
+      this.setData({
+        page: page
+      })
+      this.getData()
+    }
+  },
+  //排序
+  changeOrder1(){
+    this.setData({
+      order1:!this.data.order1,
+      order_by: this.data.order1 ? 'today_income__asc' :'today_income__desc',
+      page:1,
+      total:0,
+      list:[]
+    })
+    this.getData()
+  },
+  changeOrder2() {
+    this.setData({
+      order2: !this.data.order2,
+      order_by: this.data.order2 ? 'total_income__asc' : 'total_income__desc',
+      page: 1,
+      total: 0,
+      list: []
+    })
+    this.getData()
+  },
+
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 3 - 0
pages/list/list.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "排名"
+}

+ 40 - 0
pages/list/list.wxml

@@ -0,0 +1,40 @@
+<!-- <view class="total">
+  应到 {{total_person}}人 | 实到 {{actual_person}} 人 | 请假 {{leave_person}} 人    
+  <view>盈亏比  <text class="up">{{win_person}}</text>:<text class="down">{{loss_person}}</text></view>
+</view> -->
+<view class="top">
+    <text>排名</text>
+    <text style="width:25%;">选手</text>
+    <text>今日资产</text>
+    <view style="color:#D94B24;" bindtap="changeOrder1">
+      今日收益 
+      <image  wx:if='{{order1}}' mode="widthFix" src="../../images/up.png"></image>
+      <image  wx:else mode="widthFix" src="../../images/down.png"></image>
+    </view>
+    <view style="color:#D94B24;" bindtap="changeOrder2">
+      总盈亏
+      <image  wx:if='{{order2}}' mode="widthFix" src="../../images/up.png"></image>
+      <image  wx:else mode="widthFix" src="../../images/down.png"></image>
+    </view>
+</view>
+<scroll-view scroll-y="true" class="list" bindscrolltolower='next'>
+    <navigator hover-class="none" 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>
+        <text style="width:36rpx;text-align:center;color:#CE994F;" wx:if='{{item.group_rank>3}}'>{{item.group_rank}}</text>
+        <text class="name">{{item.username}}</text>
+        <text>{{item.today_fund}}w</text>
+        <text  class="{{item.today_income[0]=='-'?'down':'up'}}">{{item.today_income}}</text>
+        <text  class="{{item.total_income[0]=='-'?'down':'up'}}">{{item.total_income}}</text>
+        
+    </navigator>
+    
+    <block wx:if='{{total >= 20}}'>
+                  <view class='more' wx:if='{{list.length < total}}'>上拉加载更多...</view>
+                  <!-- <view class='more' wx:else>已加载全部数据!</view> -->
+    </block>
+    <!-- <view>
+        <text class="note">点击选手,查看每日持股与交割单...</text>
+    </view> -->
+</scroll-view>

+ 98 - 0
pages/list/list.wxss

@@ -0,0 +1,98 @@
+/* pages/list/list.wxss */
+page{
+  background: #F4F6F8;
+}
+.top{
+  display: flex;
+  font-size: 28rpx;
+  padding: 24rpx 32rpx;
+  background: #fff;
+  justify-content: space-between;
+}
+.top image{
+  width: 24rpx;
+}
+
+.item{
+  display: flex;
+  justify-content: space-between;
+  font-size: 28rpx;
+  padding: 16rpx 32rpx;
+}
+.item text{
+  color: #333;
+  width: 21%;
+  text-align: right;
+}
+.item .red{
+  color: #FF5151;
+}
+.top text{
+  color: #999;
+}
+.item image{
+  width: 36rpx;
+}
+.title image{
+  width: 32rpx;
+  position: relative;
+  top: 7rpx;
+}
+.list{
+  background: #fff;
+  /* padding: 20rpx 0;
+  margin-bottom: 20rpx; */
+  padding-bottom: 20rpx;
+  height: calc(100vh - 180rpx);
+  box-sizing: border-box;
+}
+.list .note{
+  font-size:22rpx;
+  padding:10rpx 30rpx;
+  color:#999;
+}
+.title{
+  border-left: 4px solid #FF5151;
+  color: #FF5151;
+  font-size: 32rpx;
+  font-weight: 500;
+  padding-left: 20rpx;
+  padding-right: 40rpx;
+  margin-bottom: 20rpx;
+}
+.title navigator{
+  float: right;
+  color: #999;
+  font-size: 28rpx;
+}
+.item text{
+  display: block;
+}
+.item .name{
+  width: 25%;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  text-align: left;
+  margin-left: 5%;
+}
+.item text:last-child{
+  text-align: right;
+}
+.more{
+  text-align:center;
+  color:#999;
+  padding:10rpx 0;
+}
+.total{
+  line-height: 80rpx;
+  background: #F7F7F7;
+  padding: 0 28rpx;
+  color: #666;
+  font-size: 28rpx;
+}
+.total view{
+  color: #666;
+  font-size: 28rpx;
+  float: right;
+}

+ 95 - 0
pages/message/message.js

@@ -0,0 +1,95 @@
+// pages/message/message.js
+const app = getApp()
+var host = app.globalData.host;
+const $api = require('../../utils/api.js').API;
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        focus:false
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        this.getData()
+    },
+    getData(){
+        $api.getconsult().then(res=>{
+            this.setData({
+                list:res.data.data.list
+            })
+        })
+    },
+    inputchange(e) {
+        this.setData({
+            comment: e.detail.value
+        })
+    },
+    post(){
+        var data={
+          cotent:this.data.comment
+        }
+        if(!data.cotent){
+            return
+        }
+        $api.consult(data).then(res=>{
+          this.getData()
+          this.setData({
+            comment:''
+          })
+        })
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    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": "我的咨询"
+}

+ 20 - 0
pages/message/message.wxml

@@ -0,0 +1,20 @@
+<view class="list" wx:for="{{list}}">
+    <view class="me" wx:if='{{item.user_id}}'>
+        <image src="{{item.user_avatar}}" ></image>
+        <view class="content">{{item.content}}</view>
+    </view>
+    <view class="wz" wx:else>
+        <image src="{{item.user_avatar}}" ></image>
+        <view>
+            <text class="name">{{item.user_name}}</text>
+            <view class="content">{{item.content}}</view>
+        </view>
+    </view>
+</view>
+
+
+
+<view class="post">
+    <input  value="{{comment}}" placeholder-style="color:#999" maxlength="500" bindinput="inputchange" type="text" placeholder="我要咨询"/>
+    <button bindtap="post">提交</button>
+</view>

+ 89 - 0
pages/message/message.wxss

@@ -0,0 +1,89 @@
+/* pages/message/message.wxss */
+page{
+    padding: 30rpx 30rpx 160rpx;
+    background: #F7F7F7;
+}
+.list{
+    position: relative;
+    margin-bottom: 24rpx;
+}
+.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: #333;
+    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;
+}
+.list{
+    float: left;
+    width: 100%;
+}
+.wz image{
+    width: 64rpx;
+    height: 64rpx;
+    border-radius: 100%;
+    float: left;
+}
+.wz .content{
+    background: #fff;
+    padding: 20rpx;
+    font-size: 30rpx;
+    line-height: 48rpx;
+    
+    margin-left: 20rpx;
+    border-radius: 8rpx;
+    
+}
+.wz>view{
+    max-width: 80%;
+    float: left;
+}
+.me image{
+    width: 64rpx;
+    height: 64rpx;
+    border-radius: 100%;
+    float: right;
+}
+
+.me .content{
+    background: #fff;
+    padding: 20rpx;
+    font-size: 30rpx;
+    line-height: 48rpx;
+    float: right;
+    margin-right: 20rpx;
+    border-radius: 8rpx;
+    max-width: 80%;
+}
+.name{
+    display: block;
+    font-size: 28rpx;
+    margin-left: 20rpx;
+    margin-bottom: 20rpx;
+}

+ 69 - 0
pages/myMatchDetail/myMatchDetail.js

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

+ 3 - 0
pages/myMatchDetail/myMatchDetail.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "参赛资料"
+}

+ 2 - 0
pages/myMatchDetail/myMatchDetail.wxml

@@ -0,0 +1,2 @@
+<!--pages/myMatchDetail/myMatchDetail.wxml-->
+<text>pages/myMatchDetail/myMatchDetail.wxml</text>

+ 1 - 0
pages/myMatchDetail/myMatchDetail.wxss

@@ -0,0 +1 @@
+/* pages/myMatchDetail/myMatchDetail.wxss */

+ 79 - 0
pages/mymatch/mymatch.js

@@ -0,0 +1,79 @@
+// pages/follow/follow.js
+const $api = require('../../utils/api.js').API;
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    list: []
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    wx.getStorage({
+      key: 'userInfo',
+      success: res=> {
+        this.setData({
+          player_id: res.data.id
+        })
+      },
+    })
+    $api.getMyMatch().then(res => {
+      this.setData({
+        list: res.data.data
+      })
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 3 - 0
pages/mymatch/mymatch.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "我的比赛"
+}

+ 3 - 0
pages/mymatch/mymatch.wxml

@@ -0,0 +1,3 @@
+<!--pages/mymatch/mymatch.wxml-->
+<navigator hover-class="none" wx:for="{{list}}" url="../today/today?id={{item.id}}&player_id={{item.player_id}}">{{item.name}}</navigator>
+<view wx:if="{{list.length<=0}}" class="not_data">-暂无数据-</view>

+ 9 - 0
pages/mymatch/mymatch.wxss

@@ -0,0 +1,9 @@
+/* pages/mymatch/mymatch.wxss */
+page{
+  padding:0 30rpx;
+}
+navigator{
+  font-size: 32rpx;
+  border-bottom: 1px solid #F5F5F5;
+  line-height: 100rpx;
+}

+ 139 - 0
pages/rank/rank.js

@@ -0,0 +1,139 @@
+// pages/rank/rank.js
+const $api = require('../../utils/api.js').API;
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    datas:{},
+    date:'',
+    match:[],
+    index:0,
+    match_id:''
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    // var y = new Date().getFullYear(), m = (new Date().getMonth() + 1), d = new Date().getDate();
+    // m = m > 9 ? m : '0' + m;
+    // d = d > 9 ? d : '0' + d;
+    // this.setData({
+    //   date: y + '-' + m + '-' + d
+    // })
+    $api.getMatchList().then(res=>{
+      let l = res.data.data.length - 1;
+      this.setData({
+        match:res.data.data,
+        index: l,
+        match_id: res.data.data[l].id
+      })
+      this.getDate()
+    })
+    
+  },
+  getDate(){
+    $api.getDate({ match_id: this.data.match_id }).then(res => {
+      this.setData({
+        date: res.data.data
+      })
+      this.getData()
+    })
+  },
+  getData() {
+    wx.showNavigationBarLoading()
+    if (!this.data.match_id){
+      return
+    }
+    $api.getRank({ stock_date: this.data.date, match_id: this.data.match_id}).then(res => {
+        wx.hideNavigationBarLoading()
+        this.setData({
+          datas:res.data.data,
+          
+        })
+    })
+    .catch(err=>{
+      wx.hideNavigationBarLoading()
+    })
+  },
+  bindChange(e) {
+    let match=this.data.match;
+    this.setData({
+      index: e.detail.value,
+      match_id: match[e.detail.value].id
+    })
+    this.getDate()
+  },
+  bindDateChange(e) {
+    this.setData({
+      date: e.detail.value
+    })
+    this.getData()
+  },
+
+
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+    
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+    console.log('show')
+    wx.hideNavigationBarLoading()
+    if (!this.data.datas.groups){
+      $api.getDate().then(res => {
+        this.setData({
+          date: res.data.data
+        })
+        this.getData()
+      })
+    }else{
+      wx.showNavigationBarLoading()
+      this.getData()
+    }
+    
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 0 - 0
pages/rank/rank.json


Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików