xjc %!s(int64=4) %!d(string=hai) anos
pai
achega
d6ae7d6b41

+ 5 - 3
app.json

@@ -1,5 +1,6 @@
 {
   "pages":[
+    
     "pages/index/index",
     "pages/upload/upload",
     "pages/user/user",
@@ -7,11 +8,12 @@
     "pages/gameDetail/gameDetail",
     "pages/game/game",
     "pages/day/day",
-    
+    "pages/list/list",
     "pages/rank/rank",
     
+    
     "pages/detail/detail",
-    "pages/list/list",
+    
     "pages/aboutus/aboutus"
   ],
   "window":{
@@ -39,7 +41,7 @@
         "pagePath": "pages/upload/upload",
         "iconPath": "pages/images/up_0.png",
         "selectedIconPath": "pages/images/up_1.png",
-        "text": "上传"
+        "text": "交作业"
       },
       {
         "pagePath": "pages/user/user",

+ 12 - 12
pages/detail/detail.wxml

@@ -1,5 +1,5 @@
 <view class="part top">
-    <image mode="widthFix" src="../images/bank.png"></image>
+    <image  src="../images/bank.png"></image>
     <view class="rank"> <text>{{datas.group_rank?datas.group_rank:0}}</text>当前排名 </view>  
 
     <view class='label'>
@@ -25,12 +25,12 @@
         <block  wx:if='{{!datas.is_markt && datas.today_stock.length>0}}'>
             <view wx:for='{{datas.today_stock}}' wx:for-item='stock' >
             {{stock.name}}  <text wx:if='{{stock.fund>0}}'>{{stock.fund}}万</text></view>
-             <view style="width:100%;background:none;" wx:if='{{datas.today_stock_img.length>0}}'>
-             <text wx:if='{{datas.yesterday_stock_img.length>0}}'>点击查看完整交割单</text>
-              <image style="width:100rpx;height:100rpx;margin-right:10rpx;" mode="scaleToFill" wx:for='{{datas.today_stock_img}}' wx:for-item='img' 
-            src='{{img}}' data-src="{{img}}"  bindtap="prview"></image>
-             </view>
         </block>
+        <view style="width:100%;background:none;" wx:if='{{datas.today_stock_img.length>0}}'>
+          <text wx:if='{{datas.today_stock_img.length>0}}'>点击查看完整交割单</text>
+          <image style="width:100rpx;height:100rpx;margin-right:10rpx;" mode="scaleToFill" wx:for='{{datas.today_stock_img}}' wx:for-item='img' 
+        src='{{img}}' data-src="{{img}}"  bindtap="prview"></image>
+        </view>
         <view wx:if='{{!datas.is_markt && datas.today_stock.length<=0 && datas.auto_complete<=0}}'>空仓</view>
         <view wx:if='{{!datas.is_markt && datas.today_stock.length<=0 && datas.auto_complete>0}}'>请假</view>
 
@@ -42,12 +42,12 @@
           <block wx:if='{{!datas.yesterday_is_markt && datas.yesterday_stock.length>0}}'>
               <view wx:for='{{datas.yesterday_stock}}' wx:for-item='stock' >
               {{stock.name}}  <text wx:if='{{stock.fund>0}}'>{{stock.fund}}万</text></view>
-              <view style="width:100%;background:none;" wx:if='{{datas.yesterday_stock_img.length>0}}'>
-              <text wx:if='{{datas.yesterday_stock_img.length>0}}'>点击查看完整交割单</text>
-                <image style="width:100rpx;height:100rpx;margin-right:10rpx;"  mode="scaleToFill" wx:for='{{datas.yesterday_stock_img}}' wx:for-item='img' 
-              src='{{img}}' data-src="{{img}}" bindtap="prview"></image>
-              </view>
-          </block>  
+          </block>
+          <view style="width:100%;background:none;" wx:if='{{datas.yesterday_stock_img.length>0}}'>
+            <text wx:if='{{datas.yesterday_stock_img.length>0}}'>点击查看完整交割单</text>
+            <image style="width:100rpx;height:100rpx;margin-right:10rpx;"  mode="scaleToFill" wx:for='{{datas.yesterday_stock_img}}' wx:for-item='img' 
+          src='{{img}}' data-src="{{img}}" bindtap="prview"></image>
+          </view>  
           <view wx:if='{{!datas.yesterday_is_markt && datas.yesterday_stock.length<=0 && datas.yesterday_auto_complete<=0}}'>空仓</view>
           <view wx:if='{{!datas.yesterday_is_markt && datas.yesterday_stock.length<=0 && datas.yesterday_auto_complete>0}}'>请假</view>
 

+ 8 - 4
pages/detail/detail.wxss

@@ -11,7 +11,8 @@ page{
   position: absolute;
   right: 0;
   top: 20rpx;
-  width: 210rpx;
+  width: 240rpx;
+  height: 70rpx;
 }
 .rank{
   position: absolute;
@@ -21,11 +22,14 @@ page{
   padding-right: 24rpx;
 }
 .rank text{
-  font-size: 48rpx;
-  margin-right: 20rpx;
+  font-size: 44rpx;
+  margin-right: 10rpx;
   color: #FF5151;
   position: relative;
   top: 6rpx;
+  display: inline-block;
+  width: 70rpx;
+  text-align: center;
 }
 .label{
     font-size: 32rpx;
@@ -79,7 +83,7 @@ page{
   background: #F4F6F8;
   border-radius: 8rpx;
   margin-bottom: 16rpx;
-  margin-right: 16rpx;
+  margin-right: 16rpx 0rpx;
 }
 .list text{
   display: block;

+ 3 - 2
pages/index/index.wxml

@@ -1,5 +1,6 @@
 <!--index.wxml-->
-  <view wx:if="{{datas.notices.length>0}}" class="marquee_container" style="--marqueeWidth--:-12em">
+  <view wx:if="{{datas.notices.length>0}}" class="marquee_container" 
+  style="{{'--marqueeWidth--:'+-12*datas.notices.length+'em'}}">
     <view class="zd"></view>
     <image src="../images/tttz.png" mode="widthFix"></image>
       <view class="marquee_text">
@@ -9,7 +10,7 @@
 <view class="part" wx:if='{{datas.match_name}}' style="margin-bottom:0;">
   <view class="title">
     {{datas.match_name}}    
-    <image mode="widthFix" src="../images/bank.png"></image>
+    <image  src="../images/bank.png"></image>
     <view class="rank"> <text>{{datas.cur_rank?datas.cur_rank:''}}</text>当前排名 </view>  
   </view>
 </view>

+ 9 - 5
pages/index/index.wxss

@@ -36,7 +36,8 @@ ec-canvas {
   position: absolute;
   right: 0;
   top: -15rpx;
-  width: 210rpx;
+  width: 240rpx;
+  height: 75rpx;
 }
 .rank{
   position: absolute;
@@ -46,11 +47,14 @@ ec-canvas {
   padding-right: 24rpx;
 }
 .rank text{
-  font-size: 48rpx;
-  margin-right: 20rpx;
+  font-size: 44rpx;
+  margin-right: 10rpx;
   color: #FF5151;
   position: relative;
   top: 6rpx;
+  display: inline-block;
+  width: 70rpx;
+  text-align: center;
 }
 
 .part1{
@@ -141,7 +145,7 @@ ec-canvas {
 .marquee_text{
   color:#333;
   font-size: 28rpx;
-  display: inline-block;
+  display: flex;
   white-space: nowrap;
   animation-name: around;
   animation-duration: 10s;  /*过渡时间*/
@@ -149,7 +153,7 @@ ec-canvas {
   animation-timing-function:linear;
 }
 .marquee_text navigator{
-  margin-right: 200px;
+  margin-right: 20px;
 }
 .marquee_container image{
   width: 53px;

+ 33 - 6
pages/list/list.js

@@ -7,13 +7,20 @@ Page({
    * 页面的初始数据
    */
   data: {
-
-  },
+    total:0,
+    page:1,
+    group:{},
+    list:[]
+  },  
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
+    // options.id=29
+    this.setData({
+      id: options.id 
+    })
     wx.showNavigationBarLoading()
     /**获取token */
     wx.getStorage({
@@ -22,7 +29,7 @@ Page({
         this.setData({
           userInfo: res.data
         })
-        this.getData(options.id);
+        this.getData();
       },
       fail: error => {
         //跳转到登陆页面
@@ -32,16 +39,36 @@ Page({
       }
     })
   },
-  getData(id) {
+  next: function () {
+    if (this.data.list.length < this.data.total) {
+      const page = this.data.page + 1
+      this.setData({
+        page: page
+      })
+      this.getData()
+    }
+  },
+  getData() {
+    const list = this.data.list;
     wx.request({
       url: host + '/api/wx/group/rank',
-      data: { id: id },
+      data: { 
+        id: this.data.id ,
+        page: this.data.page,
+        page_size:20
+      },
       header: {
         'Authorization': this.data.userInfo.token
       },
       success: res => {
+        const players = res.data.data.players;
+        for (let i = 0; i < players.length; i++) {
+          list.push(players[i])
+        }
         this.setData({
-          datas: res.data.data
+          group: res.data.data.group,
+          list:list,
+          total: res.data.data.total
         })
         wx.setNavigationBarTitle({
           title: res.data.data.group.name,

+ 13 - 8
pages/list/list.wxml

@@ -1,19 +1,24 @@
 <view class="top">
-    <text>排名</text><text>选手</text><text>初始资产</text>
+    <text>排名</text><text style="width:25%;text-align:center;">选手</text><text>初始资产</text>
     <text>今日资产</text><text>总盈亏</text>
 </view>
-<view class="list">
-    <navigator class="item" wx:for='{{datas.players}}'  url="../gameDetail/gameDetail?id={{item.match_id}}&record_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 style="width:36rpx;text-align:center;" wx:if='{{index>2}}'>{{index+1}}</text>
+<scroll-view scroll-y="true" class="list" bindscrolltolower='next'>
+    <navigator class="item" wx:for='{{list}}'  url="../gameDetail/gameDetail?id={{item.match_id}}&record_id={{item.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;" wx:if='{{item.group_rank>3}}'>{{item.group_rank}}</text>
         <text class="name">{{item.username}}</text>
         <text>{{item.fund}}w</text>
         <text>{{item.today_fund}}w</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>
-</view>
+</scroll-view>

+ 18 - 3
pages/list/list.wxss

@@ -11,6 +11,7 @@ page{
   margin-bottom: 20rpx;
   justify-content: space-between;
 }
+
 .item{
   display: flex;
   justify-content: space-between;
@@ -19,6 +20,8 @@ page{
 }
 .item text{
   color: #333;
+  width: 21%;
+  text-align: right;
 }
 .item .red{
   color: #FF5151;
@@ -36,8 +39,10 @@ page{
 }
 .list{
   background: #fff;
-  padding: 40rpx 0;
+  padding: 20rpx 0;
   margin-bottom: 20rpx;
+  height: calc(100vh - 120rpx);
+  box-sizing: border-box;
 }
 .list .note{
   font-size:22rpx;
@@ -61,9 +66,19 @@ page{
 .item text{
   display: block;
 }
-.name{
-  width: 112rpx;
+.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;
 }

+ 1 - 0
pages/rank/rank.js

@@ -52,6 +52,7 @@ Page({
   getData() {
     wx.request({
       url: host + '/api/wx/group/rank/list',
+      
       header: {
         'Authorization': this.data.userInfo.token
       },

+ 1 - 1
pages/rank/rank.wxml

@@ -1,6 +1,6 @@
 <!--pages/rank/rank.wxml-->
 <view class="top">
-    <text>排名</text><text>选手</text><text>初始资产</text>
+    <text>排名</text><text style="width:25%;text-align:center;">选手</text><text>初始资产</text>
     <text>今日资产</text><text>总盈亏</text>
 </view>
 <view class="list" wx:for="{{datas.groups}}" >

+ 6 - 2
pages/rank/rank.wxss

@@ -18,6 +18,8 @@ page{
 }
 .item text{
   color: #333;
+  width: 21%;
+  text-align: right;
 }
 .item .red{
   color: #FF5151;
@@ -60,9 +62,11 @@ page{
 .item text{
   display: block;
 }
-.name{
-  width: 112rpx;
+.item .name{
+  width: 25%;
   overflow: hidden;
   text-overflow: ellipsis;
   white-space: nowrap;
+  text-align: left;
+  margin-left: 5%;
 }

+ 33 - 19
pages/upload/upload.js

@@ -16,7 +16,8 @@ Page({
     is_markt:0,
     today_fund:'',
     change:0,
-    freshen:true
+    freshen:true,
+    disable:false
   },
 
   /**
@@ -172,23 +173,32 @@ Page({
     var today_stock_img = this.data.today_stock_img;
     wx.chooseImage({
       success: res=> {
-        const tempFilePaths = res.tempFilePaths
+        console.log(res)
+        const tempFilePaths = res.tempFiles
         for (let i = 0; i < tempFilePaths.length;i++){
-          wx.uploadFile({
-            url: host + '/api/wx/uploadfile',
-            filePath: tempFilePaths[i],
-            name: 'file',
-            header: {
-              'Authorization': this.data.userInfo.token
-            },
-            success: res => {
-              const data = JSON.parse(res.data)
-              today_stock_img.push(data.data.url)
-              this.setData({
-                today_stock_img: today_stock_img
-              })
-            }
-          })
+          // if(tempFilePaths[i].size > 1024){
+          //   wx.showToast({
+          //     icon: 'none',
+          //     title: '图片大小不能超过1M'
+          //   })
+          // }else{
+            wx.uploadFile({
+              url: host + '/api/wx/uploadfile',
+              filePath: tempFilePaths[i].path,
+              name: 'file',
+              header: {
+                'Authorization': this.data.userInfo.token
+              },
+              success: res => {
+                const data = JSON.parse(res.data)
+                today_stock_img.push(data.data.url)
+                this.setData({
+                  today_stock_img: today_stock_img
+                })
+              }
+            })
+          // }
+          
         }
         
       }
@@ -243,6 +253,9 @@ Page({
     wx.showLoading({
       title: '正在提交',
     })
+    this.setData({
+      disable:true
+    })
     wx.request({
       url: host + '/api/wx/player/record',
       data:parm,
@@ -263,7 +276,7 @@ Page({
           title: '提交成功',
         })
         this.setData({
-          freshen: true
+          freshen: true,
         })
         setTimeout(()=>{
           this.setData({
@@ -272,7 +285,8 @@ Page({
             today_stock_img: [],
             value: [-1],
             is_markt: 0,
-            today_fund: ''
+            today_fund: '',
+            disable:false
           })
           wx.switchTab({
             url: '../index/index',

+ 4 - 4
pages/upload/upload.wxml

@@ -3,7 +3,7 @@
     <view class="note">交作业时间:15:00-15:30</view>
     <view class="label">今日净资产<text class="note">(单位:万)</text></view>
     <input type='digit' value="{{today_fund}}" bindinput="fundChange1" placeholder="请输入今日净资产"></input>
-    <text>万</text>
+    <text style="color:red;font-weight:500">万</text>
      
     <block wx:if='{{!is_markt}}'>
     <view class="label">今日持股<text class="note">(空仓请留空不填)</text></view>
@@ -16,7 +16,7 @@
         </view>
       </picker> -->
       <input type='digit' bindinput="fundChange" data-id='{{index}}' value="{{item.fund}}" placeholder="资金额"></input>
-      <text>万</text>
+      <text style="color:red;font-weight:500">万</text>
       <view bindtap="add" wx:if='{{index==stock.length-1}}' class="add">添加持股</view>
       <view   wx:else style="width:28%;">
         <icon bindtap="del" data-id='{{index}}' style="margin-top:20rpx;" class="icon-small" type="cancel" size="25"></icon>
@@ -44,6 +44,6 @@
         <text>6、重新归赛请跟副主编申请,并提供请假期间的银证记录。</text>
     </view>
 
-    <button wx:if='{{!change}}' bindtap="post">提交</button>
-    <button wx:else  bindtap="post">修改</button>
+    <button wx:if='{{!change}}' disable='{{disable}}' bindtap="post">提交</button>
+    <button wx:else  bindtap="post" disable='{{disable}}'>修改</button>
 </form>

+ 12 - 2
pages/user/user.js

@@ -37,7 +37,8 @@ Page({
         },
         success:res=>{
           this.setData({
-            usercode: res.data.data.usercode
+            usercode: res.data.data.usercode,
+            userinfo: res.data.data
           })
         },
         fail:error=>{
@@ -96,6 +97,14 @@ Page({
               },
               success(res) {
                 //获取openid
+                if(res.data.code != 0){
+                  wx.showToast({
+                    icon: 'none',
+                    title: res.data.message,
+                  })
+                  wx.hideLoading();
+                  return;
+                }
                 data.openid=res.data.data.openid
                 wx.request({
                   url: host + '/api/wx/login',
@@ -112,7 +121,7 @@ Page({
                       })
                       return;
                     }
-                      
+                    
                       _this.setData({
                         userInfo : res.data.data
                       })
@@ -120,6 +129,7 @@ Page({
                         key: 'userInfo',
                         data: res.data.data,
                       })
+                      _this.getUserData()
                   },
                   fail(error){
                     console.log(error)

+ 7 - 2
pages/user/user.wxml

@@ -2,10 +2,15 @@
     <image style="width:100%;height:15vh;" mode="scaleToFill" src="../images/my_bg.png"></image>
       <view class="info">
         <view class='avatar'>
-            <open-data  type="userAvatarUrl"></open-data>
+            <open-data wx:if='{{!userinfo.avatar}}' type="userAvatarUrl">
+            </open-data>
+            <image style="width:100%;height:100%;" wx:else src="{{userinfo.avatar}}"></image>
         </view>
         <view class="name">
-            <open-data  type="userNickName"></open-data>
+            <open-data wx:if='{{!userinfo.username}}' type="userNickName">
+            </open-data>
+            <view wx:else>{{userinfo.username}}</view>
+            
             <view  wx:if='{{userInfo.id}}'>代码:{{usercode}}</view>
             <view wx:else style="margin-top:20rpx;">欢迎来到湖南顽主杯实盘大赛</view>
         </view>

+ 54 - 54
project.config.json

@@ -1,56 +1,56 @@
 {
-  "description": "ECharts 图表示例",
-  "setting": {
-    "urlCheck": false,
-    "es6": true,
-    "enhance": false,
-    "postcss": false,
-    "preloadBackgroundData": false,
-    "minified": false,
-    "newFeature": true,
-    "coverView": true,
-    "nodeModules": false,
-    "autoAudits": false,
-    "showShadowRootInWxmlPanel": true,
-    "scopeDataCheck": false,
-    "uglifyFileName": false,
-    "checkInvalidKey": true,
-    "checkSiteMap": true,
-    "uploadWithSourceMap": true,
-    "compileHotReLoad": false,
-    "useMultiFrameRuntime": true,
-    "useApiHook": true,
-    "useApiHostProcess": true,
-    "babelSetting": {
-      "ignore": [],
-      "disablePlugins": [],
-      "outputPath": ""
-    },
-    "enableEngineNative": false,
-    "bundle": false,
-    "useIsolateContext": true,
-    "useCompilerModule": false,
-    "userConfirmedUseCompilerModuleSwitch": false,
-    "userConfirmedBundleSwitch": false,
-    "packNpmManually": false,
-    "packNpmRelationList": [],
-    "minifyWXSS": true
-  },
-  "compileType": "miniprogram",
-  "libVersion": "2.15.0",
-  "appid": "wxb299e10e65157301",
-  "projectname": "wanzhubei",
-  "simulatorType": "wechat",
-  "simulatorPluginLibVersion": {},
-  "condition": {
-    "search": {
-      "list": []
-    },
-    "conversation": {
-      "list": []
-    },
-    "miniprogram": {
-      "list": []
-    }
-  }
+	"description": "ECharts 图表示例",
+	"setting": {
+		"urlCheck": false,
+		"es6": true,
+		"enhance": false,
+		"postcss": false,
+		"preloadBackgroundData": false,
+		"minified": false,
+		"newFeature": true,
+		"coverView": true,
+		"nodeModules": false,
+		"autoAudits": false,
+		"showShadowRootInWxmlPanel": true,
+		"scopeDataCheck": false,
+		"uglifyFileName": false,
+		"checkInvalidKey": true,
+		"checkSiteMap": true,
+		"uploadWithSourceMap": true,
+		"babelSetting": {
+			"ignore": [],
+			"disablePlugins": [],
+			"outputPath": ""
+		},
+		"bundle": false,
+		"useCompilerModule": false,
+		"userConfirmedUseCompilerModuleSwitch": false,
+		"compileHotReLoad": false,
+		"useMultiFrameRuntime": true,
+		"useApiHook": true,
+		"useApiHostProcess": false,
+		"enableEngineNative": false,
+		"useIsolateContext": true,
+		"userConfirmedBundleSwitch": false,
+		"packNpmManually": false,
+		"packNpmRelationList": [],
+		"minifyWXSS": true
+	},
+	"compileType": "miniprogram",
+	"libVersion": "2.15.0",
+	"appid": "wxb299e10e65157301",
+	"projectname": "wanzhubei",
+	"simulatorType": "wechat",
+	"simulatorPluginLibVersion": {},
+	"condition": {
+		"search": {
+			"list": []
+		},
+		"conversation": {
+			"list": []
+		},
+		"miniprogram": {
+			"list": []
+		}
+	}
 }