tanyanfei 3 vuotta sitten
vanhempi
commit
e66b6089ec

+ 1 - 1
pages/gameDetail/gameDetail.json

@@ -1,5 +1,5 @@
 {
-  "navigationBarTitleText": "参资料",
+  "navigationBarTitleText": "参资料",
   "usingComponents": {
     "ec-canvas": "../../ec-canvas/ec-canvas"
   }

+ 1 - 1
pages/index/index.wxml

@@ -11,7 +11,7 @@
   <view class="title">
     {{datas.match_name}}    
     <image  src="../images/bank.png"></image>
-    <view class="rank"> <text>{{datas.cur_rank?datas.cur_rank:''}}</text>当前排名 </view>  
+    <view class="rank"> <text>{{datas.cur_rank?datas.cur_rank:'   '}}</text>当前排名 </view>  
   </view>
 </view>
 

+ 2 - 1
pages/index/index.wxss

@@ -55,6 +55,7 @@ ec-canvas {
   display: inline-block;
   width: 70rpx;
   text-align: center;
+  height: 60rpx;
 }
 
 .part1{
@@ -115,7 +116,7 @@ ec-canvas {
   }
   to {
    /* var接受传入的变量 */
-   margin-left: var(--marqueeWidth--);
+   margin-left: -100%;
   }
  }
  .zd{

+ 34 - 2
pages/user/user.js

@@ -54,6 +54,11 @@ Page({
       usercode:e.detail.value
     })
   },
+  fundchange(e){
+    this.setData({
+      init_fund: e.detail.value
+    })
+  },
   logout(){
     wx.removeStorage({
       key: 'userInfo'
@@ -147,7 +152,34 @@ Page({
     })
     
   },
-  
+  save(){
+    if (!this.data.init_fund) {
+      wx.showToast({
+        icon: 'none',
+        title: '请输入初始资金',
+      })
+      return;
+    }
+      wx.request({
+        url: host + '/api/wx/player/fund',
+        data: {
+          init_fund: this.data.init_fund
+        },
+        header: {
+          'Authorization': this.data.userInfo.token
+        },
+        method: 'PUT',
+        success: res => {   
+          wx.showToast({
+            title: '提交成功',
+          })      
+          this.getUserData()
+        },
+        fail: error => {
+        }
+      })
+    
+  },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
@@ -159,7 +191,7 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
-
+    // this.getUserData()
   },
 
   /**

+ 9 - 0
pages/user/user.wxml

@@ -29,4 +29,13 @@
         <input bindinput='inputchange' placeholder="请输入您的代码" value="{{usercode}}"></input>
         <button bindtap="login">登录</button>
       </view>
+</view>
+
+<view class="modal" wx:if='{{userinfo.need_fill}}'>
+  <view class="fund_modal">
+    <view>请先输入初始资金</view>
+    <input type='digit' bindinput="fundchange"></input>
+    <text>W</text>
+    <button bindtap="save">确定</button>
+  </view>
 </view>

+ 34 - 0
pages/user/user.wxss

@@ -59,4 +59,38 @@ page{
   padding: 0;
   font-size: 32rpx;
   border-radius: 16rpx;
+}
+.modal{
+  position: fixed;
+  width: 100%;
+  height: 100vh;
+  background: rgba(0,0,0,.5);
+  top: 0;
+  left: 0;
+  z-index: 99;
+}
+.fund_modal{
+  width: 80%;
+  padding: 50rpx;
+  /* height: 20vh; */
+  background: #fff;
+  border-radius: 16rpx;
+  margin: 30vh auto;
+  text-align: center;
+  position: relative;
+}
+.fund_modal view{
+  font-size: 30rpx;
+  
+}
+.fund_modal input{
+  border: 1px solid #ccc;
+  height: 80rpx;
+  border-radius: 8rpx;
+  margin: 20rpx 0;
+}
+.fund_modal text{
+  position: absolute;
+  right: 65rpx;
+  top: 40%;
 }