yll пре 4 година
родитељ
комит
d3aef4810e

+ 3 - 3
docs/通信协议/board.md

@@ -14,7 +14,9 @@ params
 returns
 ```json
 {
-  "daily": [{
+  "banner": "http://banner.png",
+  "name": "",
+  "board": [{
     "uid": 12343,   // 不使用
     "nickname": "fdsf",
     "avatar": "http://fdsf.png",
@@ -22,8 +24,6 @@ returns
     "level": 1,     // crmeb 中等级
     "vip": 0,       // 是否是 vip, 暂不使用
     "value": 102.14 // 上榜数据
-  }],
-  "weekly": [{  // 当请求周榜单为 weekly 
   }]
 }
 ```

+ 59 - 0
view/xcx/pages/leader_board/index.js

@@ -0,0 +1,59 @@
+// pages/leader_board/index.js
+Page({
+  data: {
+    parameter: {
+      'navbar': '1',
+      'return': '1',
+      'title': '排行榜',
+      'color': true,
+      'class':'0'
+    },
+    banner: "http://twongstatic.shotshock.shop/banner_bargin.jpg",
+    name: "",
+    board: [{
+      "uid": 12343,
+      "nickname": "fdsf",
+      "avatar": "http://twongstatic.shotshock.shop/tmp/23fe31842b.jpg",
+      "border": 1,
+      "level": 1, 
+      "vip": 0,
+      "value": 102.14
+    },{
+      "uid": 12343,
+      "nickname": "fdsf",
+      "avatar": "http://twongstatic.shotshock.shop/tmp/23fe31842b.jpg",
+      "border": 1,
+      "level": 1, 
+      "vip": 0,
+      "value": 102.14
+    },{
+      "uid": 12343,
+      "nickname": "司马当成活马伊发",
+      "avatar": "http://twongstatic.shotshock.shop/tmp/23fe31842b.jpg",
+      "border": 1,
+      "level": 1, 
+      "vip": 0,
+      "value": 102
+    },{
+      "uid": 12343,
+      "nickname": "国强乱书生",
+      "avatar": "http://twongstatic.shotshock.shop/tmp/23fe31842b.jpg",
+      "border": 1,
+      "level": 1, 
+      "vip": 0,
+      "value": 1.14
+    },{
+      "uid": 12343,
+      "nickname": "fdsf",
+      "avatar": "http://twongstatic.shotshock.shop/tmp/23fe31842b.jpg",
+      "border": 1,
+      "level": 1, 
+      "vip": 0,
+      "value": 102.14
+    }]
+  },
+
+  onLoad: function (options) {
+
+  },
+})

+ 5 - 0
view/xcx/pages/leader_board/index.json

@@ -0,0 +1,5 @@
+{
+  "usingComponents": {
+    "navbar": "/components/navbar/index"
+  }
+}

+ 26 - 0
view/xcx/pages/leader_board/index.wxml

@@ -0,0 +1,26 @@
+<navbar parameter='{{ parameter }}'></navbar>
+<view class="board">
+  <view class="banner">
+    <image src="{{ banner }}"></image>
+  </view>
+  <view class="head">
+    <text class="h1">排名</text>
+    <text class="h2">名单</text>
+    <text class="h3">返金</text>
+  </view>
+  <scroll-view class="list">
+    <view wx:for="{{ board }}" wx:key="index" class="item">
+      <view class="seq">
+        <text class="{{ index < 3 ? 'color-' + index : 'color-gray'}}">{{ index + 1 }}</text> 
+      </view>
+     
+      <view class="header">
+        <image src="{{ item.avatar }}"></image>
+        <text class="name">{{ item.nickname }}</text>
+      </view>
+      <view  class="amount">
+        <text>¥{{ item.value }}</text>
+      </view>
+    </view>
+  </scroll-view>
+</view>

+ 117 - 0
view/xcx/pages/leader_board/index.wxss

@@ -0,0 +1,117 @@
+.board {
+    display: flex;
+    flex-direction: column;
+    justify-content: flex-start;
+    width: 100%;
+    background-color: #fff;
+}
+
+.board .banner {
+    display: flex;
+    flex-direction: row;
+    justify-content: center;
+    align-items: center;
+    width: 100%;
+}
+
+.board .banner image {
+    width: 100%;
+    height: 124rpx;
+}
+
+.board .head {
+    display: flex;
+    flex-direction: row;
+    justify-content: flex-start;
+    align-items: flex-start;
+    margin: 36rpx;
+}
+
+.h1 {
+    display: flex;
+    flex-grow: 1;
+}
+.h2 {
+    flex-grow: 2;
+}
+.h3 {
+    flex-grow: 1;
+}
+
+.board .list {
+    display: flex;
+    flex-direction: column;
+    justify-content: flex-start;
+}
+
+.board .list .item {
+    display: flex;
+    flex-direction: row;
+    justify-content: flex-start;
+    align-items: center;
+    height: 100rpx;
+    margin: 0 20rpx;
+}
+
+.board .list .item .seq {
+    display: flex;
+    justify-content: flex-start;
+    width: 20%;
+}
+
+.board .list .item .seq text {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    width: 48rpx;
+    height: 48rpx;
+    border-radius: 50%;
+    color: white;
+}
+
+.color-0 {
+    background-color:rgb(247, 81, 81);
+}
+
+.color-1 {
+    background-color: yellowgreen;
+}
+
+.color-2 {
+    background-color: rgb(151, 74, 223);
+}
+
+.color-gray {
+    background-color: gray;
+}
+
+.board .list .item .header {
+    display: flex;
+    flex-direction: row;
+    justify-content: flex-start;
+    align-items: center;
+    width: 50%;
+}
+
+.board .list .item .header image {
+    width: 72rpx;
+    height: 72rpx;
+    border-radius: 50%;
+}
+
+.board .list .item .name {
+    display: flex;
+    flex-direction: row;
+    flex-wrap: nowrap;
+    margin-left: 24rpx;
+    font-size: 32rpx;
+}
+
+.board .list .item .amount {
+    display: flex;
+    flex-direction: row;
+    justify-content: flex-end;
+}
+.board .list .item .amount text {
+    color:rgb(247, 81, 81);
+}