Browse Source

报名相关修改

xjc 3 years ago
parent
commit
a69bde2a14
6 changed files with 39 additions and 10 deletions
  1. 8 1
      pages/apply/apply.js
  2. 6 4
      pages/apply/apply.wxml
  3. 1 1
      pages/index/index.js
  4. 15 3
      pages/login/user.js
  5. 1 1
      pages/login/user.wxml
  6. 8 0
      pages/signup/signup.js

+ 8 - 1
pages/apply/apply.js

@@ -8,7 +8,9 @@ Page({
      * 页面的初始数据
      */
     data: {
-      type:2
+      type:2,
+      info:{},
+      authinfo:{}
     },
 
     /**
@@ -23,6 +25,11 @@ Page({
                 info:res.data.data
             })
         })
+        $api.getAuthinfo().then(res=>{
+          this.setData({
+            authinfo: res.data.data,
+          })
+        })
     },
     tab(e){
         this.setData({

+ 6 - 4
pages/apply/apply.wxml

@@ -10,8 +10,8 @@
         <!-- <view class="date">比赛时间:{{info.start_time}}至{{info.end_time}}</view> -->
         <!-- <view class="date">报名时间:2022-04-20至2022-04-26</view> -->
         <view class="title title1">1、比赛时间</view>
-        <view class="date">开赛时间:7月6日到9月9日结束 </view>
-        <view class="date">报名时间:6月27日到7月5日 </view>
+        <view class="date">开赛时间:{{info.start_time}}到{{info.end_time}}结束 </view>
+        <view class="date">报名时间:{{info.signup_start_time}}到{{info.signup_end_time}}</view>
         <view class="title title1">2、比赛分组</view>
         <!-- <view class="date" wx:for="{{info.groups}}">{{item.name}}</view>
          -->
@@ -49,7 +49,7 @@
 </scroll-view>
 <scroll-view wx:if='{{type==1}}' scroll-y='{{true}}'>
   
-  <view class="title">顽主杯比赛系统-游客使用须知</view>
+  <view class="title">顽主杯比赛系统-{{info.name}}-游客使用须知</view>
   <view class="title title1">1、 浏览内容</view>
   <view class="date">
   <text>历届叁赛选手的每日持仓图-个人风格简介-比赛数据统计-每日比赛留言-前排选手在比赛结束后上传的完整交割单和冠军心得,还有每日备受关注的《顽主杯热票榜》\n
@@ -66,4 +66,6 @@
 <view class="title title1">4、声明</view>
 <view class="date">比赛只做学习交流,不做任何投资建议,比赛系统内的选手操作与言论,仅代表选手个人意见,与比赛举办方无关,请勿跟风模仿,盈亏自负。如您发现比赛系统内有人发表不当言论,有任何割韭菜的嫌疑,请及时跟比赛方反应。\n\n\n</view>
 </scroll-view>
-<button bindtap="post" class="apply">立即报名</button>
+<button bindtap="post" class="apply" wx:if="{{authinfo.match_id==info.id}}" disabled>已报名</button>
+<button bindtap="post" class="apply" wx:elif="{{type==2&&info.signup_status==0}}" disabled>立即报名(选手报名已结束)</button>
+<button bindtap="post" class="apply" wx:else >立即报名</button>

+ 1 - 1
pages/index/index.js

@@ -290,7 +290,7 @@ Page({
     $api.getAuthinfo().then(res=>{
       if(res.data.data.role==0){
         wx.navigateTo({
-          url: '../login/user?type=3',
+          url: '../login/user?type=3&player_type='+res.data.data.player_type,
         })
       }
     })

+ 15 - 3
pages/login/user.js

@@ -18,7 +18,9 @@ Page({
     todayinfo:{},
     todayMoney:'',
     status:0,
-    text:'获取验证码'
+    text:'获取验证码',
+    player_type:0,
+    signinfo:{}
   },
 
   /**
@@ -27,9 +29,18 @@ Page({
   onLoad: function (options) {
     if(options.type){
       this.setData({
-        status:options.type
+        status:options.type,
+        player_type:options.player_type
       })
     }
+    $api.getsignup().then(res=>{
+      this.setData({
+        signinfo:res.data.data
+      })
+    })
+  },
+  onShow: function () {
+    wx.hideHomeButton();
   },
   zx(){
     wx.navigateTo({
@@ -148,7 +159,8 @@ Page({
                 }
                 //新用户选择报名
                 _this.setData({
-                  status:3
+                  status:3,
+                  player_type:0
                 })
                 wx.hideLoading();
                 wx.setNavigationBarTitle({

+ 1 - 1
pages/login/user.wxml

@@ -46,7 +46,7 @@
             <image src="../../images/logo.png"></image>
     </view>
   <navigator url="../apply/apply?type=2"><image style="width: 24px;" mode="widthFix" src="../../images/bs.png"></image>选手报名</navigator>
-  <navigator style="background: none;color:#D94B24;" url="../apply/apply?type=1"><image style="width: 24px;" mode="widthFix" src="../../images/yk.png"></image>游客报名</navigator>
+  <navigator wx:if="{{player_type==0}}"  style="background: none;color:#D94B24;" url="../apply/apply?type=1"><image style="width: 24px;" mode="widthFix" src="../../images/yk.png"></image>游客报名</navigator>
   <navigator style="background: none;color:#D94B24;" url="../message/message"><image style="width: 18px;" mode="widthFix" src="../../images/zx.png"></image>顽主咨询</navigator>
 </view>
 

+ 8 - 0
pages/signup/signup.js

@@ -135,6 +135,14 @@ Page({
         return
       }
       $api.wxpay(data).then(res=>{
+          if(res.data.data.free){
+              wx.showToast({
+                title: '报名成功',
+              })
+              wx.switchTab({
+                url: '../index/index'
+              });
+          }
           var timestamp = Math.round(new Date().getTime() / 1000).toString();
           var paySign = md5('appId=' + res.data.data.appid + '&nonceStr=' + res.data.data.nonce_str + '&package=prepay_id=' + res.data.data.prepay_id + '&signType=MD5&timeStamp=' + timestamp + '&key=' + res.data.data.key).toUpperCase();
           console.log(paySign)