xiaoyi 10 月之前
父节点
当前提交
dd5d379f41

二进制
pages/.DS_Store


+ 20 - 6
pages/apply/apply.js

@@ -10,6 +10,7 @@ Page({
     data: {
       type:2,
       info:{},
+      signdone:{},
     },
 
     /**
@@ -19,11 +20,7 @@ Page({
       this.setData({
         type:options.type
       })
-        $api.getsignup().then(res=>{
-            this.setData({
-                info:res.data.data
-            })
-        })
+      this.getInfo()
     },
     tab(e){
         this.setData({
@@ -31,9 +28,26 @@ Page({
         })
     },
     post(){
+      if($api.checkUser()){
         wx.navigateTo({
           url: '../signup/signup?type='+this.data.type,
         })
+      }
+        
+    },
+    getInfo(){
+      $api.getsignupweb().then(res=>{
+        this.setData({
+            info:res.data.data
+        })
+    })
+    },
+    getSigndone(){
+      $api.getsignup().then(res=>{
+        this.setData({
+            signdone:res.data.data
+        })
+    })
     },
     /**
      * 生命周期函数--监听页面初次渲染完成
@@ -46,7 +60,7 @@ Page({
      * 生命周期函数--监听页面显示
      */
     onShow: function () {
-
+      this.getSigndone()
     },
 
     /**

+ 11 - 5
pages/apply/apply.wxml

@@ -16,13 +16,11 @@
         <!-- <view class="date" wx:for="{{info.groups}}">{{item.name}}</view> -->
         
         <view class="date">
-          <text>冠军组:历届小组前三,10W以上</text>
           <text>千万组:300W以上</text>
           <text>百万组:50W到300W</text>
           <text>十万组:10W到50W</text>
           <text>菜鸟组:10W以下</text>
           <text>{{info.awards_content}}</text>
-          
         </view>
         <view class="title title1">3、交作业</view>
         <view class="date">
@@ -78,6 +76,14 @@
 <view class="title title1">5、声明</view>
 <view class="date">比赛只做学习交流,不做任何投资建议,比赛系统内的选手操作与言论,仅代表选手个人意见,与比赛举办方无关,请勿跟风模仿,盈亏自负。如您发现比赛系统内有人发表不当言论,有任何割韭菜的嫌疑,请及时跟比赛方反应。\n\n\n</view>
 </scroll-view>
-<button bindtap="post" class="apply" wx:if="{{info.signup_done}}" 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>
+<!-- <button bindtap="post" class="apply" wx:if="{{info.signup_done}}" disabled>已报名</button> -->
+<view class="bmover" wx:if="{{signdone.signup_done}}">
+  <view>已报名</view>
+  <label>请于{{info.post_start_time}}收盘后开始交作业</label>
+</view>
+
+<view class="bmover" wx:elif="{{type==2&&info.signup_status==0}}">
+  <view>报名已结束</view>
+  <label>下一届关注公众号(顽主杯实盘大赛)通知</label>
+</view>
+<button bind:tap="post" class="apply" wx:else >立即报名</button>

+ 13 - 3
pages/apply/apply.wxss

@@ -1,5 +1,5 @@
 page{
-    padding: 0 35rpx;
+    /* padding: 0 35rpx; */
 }
 view{
     line-height: 56rpx;
@@ -56,7 +56,7 @@ view{
 .apply:not([size='mini']){
     background: #D94B24;
     color: #fff;
-    width: 100%;
+    width: 90%;
     margin: 48rpx auto 0;
     height: 88rpx;
     line-height: 88rpx;
@@ -65,11 +65,21 @@ view{
     border-radius: 8rpx;
   }
   scroll-view{
-    height: calc(100vh - 250rpx);
+    height: calc(105vh - 250rpx);
+    background-color: rgb(243, 243, 243);
+    padding: 0 30rpx;
   }
   .change{
     color: #D94B24;
     /* font-size: 28rpx; */
     text-decoration: underline;
     display: inline;
+  }
+  .bmover{
+    margin: 30rpx;
+    text-align: center;
+  }
+
+  .bmover label{
+    font-size: 32rpx;
   }

+ 7 - 0
pages/article/article.js

@@ -45,6 +45,13 @@ Page({
       this.getData()
     }
   },
+  pushArticleWeb(e){
+    if($api.checkUserRole()){
+      wx.navigateTo({
+        url: '../articleweb/articleweb?id=' + e.currentTarget.dataset.id,
+      })
+    }
+  },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 1 - 1
pages/article/article.wxml

@@ -1,6 +1,6 @@
 <scroll-view  scroll-y='{{true}}'  bindscrolltolower='next'>
 <view class="up-down">
-        <navigator wx:for="{{list}}"  hover-class="none" url="../articleweb/articleweb?id={{item.id}}" >
+        <navigator wx:for="{{list}}"  hover-class="none" bind:tap="pushArticleWeb" data-id="{{item.id}}" >
           <view class="article-name">
           {{item.name}}
           <text>{{item.ctime}}</text>

+ 11 - 1
pages/articleweb/articleweb.wxml

@@ -1,2 +1,12 @@
 <!--pages/articleweb/articleweb.wxml-->
-<web-view src="{{info.web}}"></web-view>
+<web-view src="{{info.web}}"></web-view>
+<view class="bmover" wx:if="{{info.signup_done}}">
+  <view>已报名</view>
+  <label>请于{{info.post_start_time}}收盘后开始交作业</label>
+</view>
+
+<view class="bmover" wx:elif="{{type==2&&info.signup_status==0}}">
+  <view>报名已结束</view>
+  <label>下一届关注公众号(顽主杯实盘大赛)通知</label>
+</view>
+<button bind:tap="post" class="apply" wx:else >立即报名</button>

+ 8 - 0
pages/baike/baike.js

@@ -58,6 +58,14 @@ Page({
       this.getData()
     }
   },
+
+  pushArticle(e){
+    if($api.checkUserRole()){
+      wx.navigateTo({
+        url: '../detail/detail?type=百科&id=' + e.currentTarget.dataset.id,
+      })
+    }
+  },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 1 - 1
pages/baike/baike.wxml

@@ -7,7 +7,7 @@
   <view wx:for="{{cat}}" bindtap="tab"   data-id='{{item.id}}' class="{{cur==item.id?'act':''}}">{{item.name}}</view>
 </view>
 <scroll-view scroll-y="{{true}}" bindscrolltolower='next'>
-  <navigator wx:for="{{list}}" class="list" url="../detail/detail?id={{item.category_id}}&type=百科">
+  <navigator wx:for="{{list}}" class="list" bind:tap="pushArticle" data-id="{{item.category_id}}">
     <view>{{item.name}}</view>
     <view class="info">
       <image wx:if='{{item.img}}' mode="aspectFill" src="{{item.img}}"></image>

+ 66 - 0
pages/baoming/baoming.js

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

+ 2 - 0
pages/baoming/baoming.wxml

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

+ 15 - 1
pages/change/change.js

@@ -13,13 +13,21 @@ Page({
         today_fund:'',
         today_income:'',
         total_income:'',
+        stock_date:'',
     },
 
     /**
      * 生命周期函数--监听页面加载
      */
     onLoad: function (options) {
-
+      var y=new Date().getFullYear() 
+      var m=Number(new Date().getMonth() + 1)
+      var d = new Date().getDate()
+      m=m>9?m:'0'+m;
+      d=d>9?d:'0'+d
+      this.setData({
+        stock_date:y+'-'+m+'-'+d
+      })
     },
     uploadImg() {
         var today_stock_img = this.data.today_stock_img;
@@ -178,6 +186,12 @@ Page({
    
         $api.update(data).then(res=>{
           if(res.data.code == 0){
+            let key = 'change' + this.data.stock_date
+            wx.setStorage({
+              key: key,
+              data: '1',
+            })
+
             wx.showToast({
               title: '提交成功',
               success:function(){

+ 7 - 0
pages/hotuser/hotuser.js

@@ -45,6 +45,13 @@ Page({
       this.getData()
     }
   },
+  pushHome(e){
+    if($api.checkUserRole()){
+      wx.navigateTo({
+        url: '../homepage/homepage?user_id=' + e.currentTarget.dataset.user_id,
+      })
+    }
+  },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 1 - 1
pages/hotuser/hotuser.wxml

@@ -1,6 +1,6 @@
 <scroll-view  scroll-y='{{true}}' bindscrolltolower='next'>
           <view class="item3">
-             <navigator hover-class="none" class="win" wx:for='{{list}}' url="../homepage/homepage?id={{item.match_id}}&user_id={{item.id}}">
+             <navigator hover-class="none" class="win" wx:for='{{list}}' bind:tap="pushHome" data-user_id="{{item.user_id}}">
               <image wx:if="{{index<3}}" class="number" mode="widthFix" src="../../xiao/{{index+1}}.png"></image>
               <text wx:else class="number">{{index+1}}</text>
                 <view class="name">

+ 92 - 5
pages/index/index.js

@@ -12,7 +12,7 @@ Page({
     tabs1:['收益榜','盈利榜','亏损榜','跌幅榜'],
     cur:0,
     cur1:0,
-    date:'2022-04-27',
+    date:'2024-09-09',
     explist:[],   //留言
     total1:0,
     page1:1,
@@ -29,10 +29,22 @@ Page({
     groups:{},
     role:0,
     match_day:0,
-    socore:[10,9,8,7,6,5,4,3,2,1],
+    socore:[
+      { name: '10',  checked: false },
+      { name: '9',  checked: false },
+      { name: '8',  checked: false },
+      { name: '7',  checked: false },
+      { name: '6',  checked: false },
+      { name: '5',  checked: false },
+      { name: '4',  checked: false },
+      { name: '3',  checked: false },
+      { name: '2',  checked: false },
+      { name: '1',  checked: false }
+    ],
     isScore:0,
     isWeek:0,
-    scoredays:[]
+    scoredays:[],
+    nochoose:false,
   },
   onLoad() {
     var w=new Date().getDay()
@@ -41,7 +53,6 @@ Page({
         isWeek:1
       })
     }
-    wx.showNavigationBarLoading()
     wx.getStorage({
       key: 'user',
       complete: res => {
@@ -125,6 +136,24 @@ Page({
 
   },
   radioChange:function(e){
+    if(!$api.checkUser()){
+      this.setData({
+        socore:[
+          { name: '10',  checked: false },
+          { name: '9',  checked: false },
+          { name: '8',  checked: false },
+          { name: '7',  checked: false },
+          { name: '6',  checked: false },
+          { name: '5',  checked: false },
+          { name: '4',  checked: false },
+          { name: '3',  checked: false },
+          { name: '2',  checked: false },
+          { name: '1',  checked: false }
+        ],
+      })
+      return
+    }
+    
     var y=new Date().getFullYear() 
     var m=Number(new Date().getMonth() + 1)
     var d = new Date().getDate()
@@ -277,7 +306,6 @@ Page({
     $api.getMyFollowV3({
       page: this.data.page2, page_size: 20
     }).then(res => {
-      wx.hideNavigationBarLoading()
       res.data.data.list.forEach(item => {
         followList.push(item)
       })
@@ -372,7 +400,66 @@ tapAvg(e){
   pushToday(e){
     $push.pushToday(e.currentTarget.dataset)
   },
+  
+  pushArticleWeb(e){
+    if($api.checkUserRole()){
+      wx.navigateTo({
+        url: '../articleweb/articleweb?id=' + e.currentTarget.dataset.id,
+      })
+    }
+  },
+
+  pushBaike(e){
+    if($api.checkUserRole()){
+      wx.navigateTo({
+        url: '../detail/detail?type=百科&id=' + e.currentTarget.dataset.id,
+      })
+    }
+  },
+
+  pushOther(e){
+    switch(e.currentTarget.dataset.id){
+      case "0":{
+        wx.navigateTo({
+          url: '../stock/stock?type=1&stock_date='+this.data.date,
+        })
+      }
+      break;
+      case "1":{
+        wx.navigateTo({
+          url: '../hotuser/hotuser',
+        })
+      }
+        break;
+      case "2":{
+        wx.navigateTo({
+          url: '../tlb/tlb?match_id='+this.data.winLost.match_id,
+        })
+      }
+        break;
+      case "3":{
+        wx.navigateTo({
+          url: '../baike/baike',
+        })
+      }
+      break;
 
+      case "4":{
+        wx.navigateTo({
+          url: '../todayExp/todayExp',
+        })
+      }
+      break;
+
+      case "5":{
+        wx.navigateTo({
+          url: '../myfollow/myfollow',
+        })
+      }
+      break;
+
+    }
+  },
   onShow: function (e) {
     $api.initUser()
     

+ 22 - 21
pages/index/index.wxml

@@ -10,27 +10,27 @@
   </view> -->
 
 <view class="list-top">
-    <navigator url="../stock/stock?type=1&stock_date={{date}}">
+    <navigator bind:tap="pushOther" data-id="0">
       <image mode="widthFix" src="../../xiao/rmgp@2x.png"></image>
       热门股票
     </navigator>
-    <navigator url="../hotuser/hotuser">
+    <navigator bind:tap="pushOther" data-id="1">
       <image mode="widthFix" src="../../xiao/rmxs@2x.png"></image>
       热门选手
     </navigator>
-    <navigator url="../tlb/tlb?match_id={{winLost.match_id}}">
+    <navigator bind:tap="pushOther" data-id="2">
       <image mode="widthFix" src="../../xiao/jryk@2x.png"></image>
       屠龙榜
     </navigator>
-    <navigator url="../baike/baike">
+    <navigator bind:tap="pushOther" data-id="3">
       <image mode="widthFix" src="../../xiao/baike@2x.png"></image>
       短线百科
     </navigator>
-    <navigator url="../todayExp/todayExp">
+    <navigator bind:tap="pushOther" data-id="4">
       <image mode="widthFix" src="../../xiao/jrly@2x.png"></image>
       今日留言
     </navigator>
-    <navigator url="../myfollow/myfollow">
+    <navigator bind:tap="pushOther" data-id="5">
       <image mode="widthFix" src="../../xiao/wdgz@2x.png"></image>
       我的关注
     </navigator>
@@ -78,12 +78,12 @@
     <text>公告:</text>
   </view>
   <view class="notice-list">
-        <navigator hover-class="none" url="../articleweb/articleweb?id={{item.id}}" wx:for="{{notices}}">{{item.name}}</navigator>
+        <navigator hover-class="none" bind:tap="pushArticleWeb" data-id="{{item.id}}" wx:for="{{notices}}">{{item.name}}</navigator>
   </view>
 </view>
 <view class="up-down-view" style="padding: 0 25rpx;">
   <view class="article-title" style="padding: 20rpx 0;"> 
-      <navigator url="">每天
+      <navigator data-index='0' bind:tap="tapGroup">每天
       <image class="more-image" mode="widthFix" src="../../images/right_icon.png"></image>
       </navigator>
       短线盈亏效应
@@ -105,6 +105,7 @@
         <text class="fund {{item.today_income_avg[0]=='-' ?'down':'up'}}">{{item.today_fund}}</text>
         <text class="{{item.today_income_avg[0]=='-' ?'down':'up'}}">{{item.today_income_avg}}</text>
       </view>
+      <view class="g_list"></view>
     </view>
 </view>
 <view class="up-down-view" style="padding: 25rpx;">
@@ -145,11 +146,11 @@
   <view class="article-title" > 请给今日市场打分</view>
   <radio-group bindchange="radioChange">
     <view  class="score" wx:for="{{socore}}">
-      <text>{{item}}分</text>
+      <text>{{item.name}}分</text>
       <view>
-        <view style="background-color: {{filters.getColor()}};width:{{item/10*100}}%"></view>
+        <view style="background-color: {{filters.getColor()}};width:{{item.name/10*100}}%"></view>
       </view>
-      <radio value="{{item}}"></radio>
+      <radio value="{{item.name}}" checked="{{item.checked}}"></radio>
     </view>
   </radio-group>
 </view>
@@ -169,7 +170,7 @@
     <view class="title_1">
       <text>收益率</text><text>资产(w)</text><text>盈利(w)</text>
     </view>
-    <navigator wx:for="{{winLost.total_income_up}}" hover-class="none"  url="../today/today?id={{item.match_id}}&record_id={{item.id}}&user_id={{item.user_id}}">
+    <navigator wx:for="{{winLost.total_income_up}}" hover-class="none"  bind:tap="pushToday" data-match_id="{{item.match_id}}" data-record_id="{{item.id}}" data-user_id = "{{item.user_id}}">
             <image wx:if="{{index<3}}" class="number" mode="widthFix" src="../../xiao/{{index+1}}.png"></image>
             <text wx:else class="number">{{index+1}}</text>
             <text class="usm">{{item.username}}</text>
@@ -183,7 +184,7 @@
     <view class="title_1">
       <text>盈利(w)</text><text>资产(w)</text><text>收益率</text>
     </view>
-    <navigator wx:for="{{winLost.total_win_up}}" hover-class="none"  url="../today/today?id={{item.match_id}}&record_id={{item.id}}&user_id={{item.user_id}}">
+    <navigator wx:for="{{winLost.total_win_up}}" hover-class="none" bind:tap="pushToday" data-match_id="{{item.match_id}}" data-record_id="{{item.id}}" data-user_id = "{{item.user_id}}">
             <image wx:if="{{index<3}}" class="number" mode="widthFix" src="../../xiao/{{index+1}}.png"></image>
             <text wx:else class="number">{{index+1}}</text>
             <text class="usm">{{item.username}}</text>
@@ -197,7 +198,7 @@
     <view class="title_1">
       <text>亏损(w)</text><text>资产(w)</text><text>收益率</text>
     </view>
-    <navigator wx:for="{{winLost.total_win_down}}" hover-class="none"  url="../today/today?id={{item.match_id}}&record_id={{item.id}}&user_id={{item.user_id}}">
+    <navigator wx:for="{{winLost.total_win_down}}" hover-class="none"  bind:tap="pushToday" data-match_id="{{item.match_id}}" data-record_id="{{item.id}}" data-user_id = "{{item.user_id}}">
             <image wx:if="{{index<3}}" class="number" mode="widthFix" src="../../xiao/{{index+1}}.png"></image>
             <text wx:else class="number">{{index+1}}</text>
             <text class="usm">{{item.username}}</text>
@@ -210,7 +211,7 @@
     <view class="title_1">
       <text>收益率</text><text>资产(w)</text><text>盈利(w)</text>
     </view>
-    <navigator wx:for="{{winLost.total_income_down}}" hover-class="none"  url="../today/today?id={{item.match_id}}&record_id={{item.id}}&user_id={{item.user_id}}">
+    <navigator wx:for="{{winLost.total_income_down}}" hover-class="none" bind:tap="pushToday" data-match_id="{{item.match_id}}" data-record_id="{{item.id}}" data-user_id = "{{item.user_id}}">
             <image wx:if="{{index<3}}" class="number" mode="widthFix" src="../../xiao/{{index+1}}.png"></image>
             <text wx:else class="number">{{index+1}}</text>
             <text class="usm">{{item.username}}</text>
@@ -228,28 +229,28 @@
     <view class="content-list">
       <view class="up-down">
         <view class="article-title"> <navigator url="../article/article?type=每日点评">more<image class="more-image" mode="widthFix" src="../../images/right_icon.png"></image></navigator>每日点评</view>
-        <navigator wx:for="{{articleList1}}" wx:if="{{index<5}}" hover-class="none" url="../articleweb/articleweb?id={{item.id}}" >
+        <navigator wx:for="{{articleList1}}" wx:if="{{index<5}}" hover-class="none" bind:tap="pushArticleWeb" data-id="{{item.id}}" >
           <text class="article-name">{{item.name}}</text>
           <image class="article-img" mode="aspectFill" src="{{item.img}}"></image>
         </navigator>
       </view>
       <view class="up-down">
         <view class="article-title"> <navigator url="../article/article?type=冠军交割">more<image class="more-image" mode="widthFix" src="../../images/right_icon.png"></image></navigator>冠军交割</view>
-        <navigator wx:for="{{articleList2}}" wx:if="{{index<5}}" hover-class="none" url="../articleweb/articleweb?id={{item.id}}" >
+        <navigator wx:for="{{articleList2}}" wx:if="{{index<5}}" hover-class="none" bind:tap="pushArticleWeb" data-id="{{item.id}}" >
           <text class="article-name">{{item.name}}</text>
           <image class="article-img" mode="aspectFill" src="{{item.img}}"></image>
         </navigator>
       </view>
       <view class="up-down">
         <view class="article-title"> <navigator url="../article/article?type=牛人专场">more<image class="more-image" mode="widthFix" src="../../images/right_icon.png"></image></navigator>牛人专场</view>
-        <navigator wx:for="{{articleList3}}" wx:if="{{index<5}}" hover-class="none" url="../articleweb/articleweb?id={{item.id}}" >
+        <navigator wx:for="{{articleList3}}" wx:if="{{index<5}}" hover-class="none" bind:tap="pushArticleWeb" data-id="{{item.id}}" >
           <text class="article-name">{{item.name}}</text>
           <image class="article-img" mode="aspectFill" src="{{item.img}}"></image>
         </navigator>
       </view>
       <view class="up-down">
         <view class="article-title"> <navigator url="../article/article?type=妖股列传">more<image class="more-image" mode="widthFix" src="../../images/right_icon.png"></image></navigator>妖股列传</view>
-        <navigator wx:for="{{articleList4}}" wx:if="{{index<5}}" hover-class="none" url="../articleweb/articleweb?id={{item.id}}" >
+        <navigator wx:for="{{articleList4}}" wx:if="{{index<5}}" hover-class="none" bind:tap="pushArticleWeb" data-id="{{item.id}}">
           <text class="article-name">{{item.name}}</text>
           <image class="article-img" mode="aspectFill" src="{{item.img}}"></image>
         </navigator>
@@ -260,8 +261,8 @@
 
 
 <view class="baike">
-        <view class="article-title"> <navigator url="../baike/baike">更多<image class="more-image" mode="widthFix" src="../../images/right_icon.png"></image></navigator>短线百科</view>
-        <navigator wx:for="{{baikeList}}" class="baike-list" url="../detail/detail?id={{item.category_id}}&type=百科">
+        <view class="article-title"> <navigator bind:tap="pushOther" data-id="3">更多<image class="more-image" mode="widthFix" src="../../images/right_icon.png"></image></navigator>短线百科</view>
+        <navigator wx:for="{{baikeList}}" class="baike-list" bind:tap="pushBaike" data-id="{{item.category_id}}">
           <view>{{item.name}}</view>
           <view class="baike-info">
             <image wx:if='{{item.img}}' mode="aspectFill" src="{{item.img}}"></image>

+ 34 - 11
pages/login/user.js

@@ -27,7 +27,6 @@ Page({
     nickName:'',
     openid:'',
     unionid:'',
-
   },
 
   /**
@@ -148,7 +147,19 @@ Page({
       return
     }
 
-    this.wxlogin()
+    $api.contentCheck({content:this.data.nickName,openid:this.data.openid}).then(res=>{
+      var result = res.data.data.result
+      if(result.suggest == 'pass'){
+        this.wxlogin()
+      } else{
+        wx.showToast({
+          icon: 'none',
+          title: '昵称含违规信息'
+        })
+      }
+    })
+
+    
   },
   
   islogin(){
@@ -258,15 +269,17 @@ Page({
         wx.switchTab({
           url: '../index/index',
         })
-        
-        return;
-      }
-
-      //新用户选择报名
-      _this.setData({
-        status:3,
-        player_type:0
-      })
+      } else{
+        wx.navigateBack()
+      }  
+      //   return;
+      // }
+
+      // //新用户选择报名
+      // _this.setData({
+      //   status:3,
+      //   player_type:0
+      // })
       
       wx.setNavigationBarTitle({
         title: '',
@@ -337,6 +350,9 @@ Page({
       }
     })
   },
+  cancel(){
+    wx.navigateBack();
+  },
   
   onCustomerService(){
     wx.openCustomerServiceChat({
@@ -346,6 +362,13 @@ Page({
     })
   },
  
+  pushMessage(e){
+    if($api.checkUser()){
+      wx.navigateTo({
+        url: '../message/message',
+      })
+    }
+  },
 
   /**
    * 生命周期函数--监听页面初次渲染完成

+ 10 - 6
pages/login/user.wxml

@@ -1,18 +1,22 @@
 
 <!-- 未登录 -->
 <view class="no_login" wx:if='{{status == 0}}'>
-    <view class="title">欢迎来到湖南顽主杯实盘大赛</view>
+    <view class="title">看更多内容请注册报名</view>
     <view class='avatar'>
             <image src="../../images/logo.png"></image>
     </view>
     <view class="login">
         <!-- <input bindinput='inputchange' placeholder="请输入您的代码" value="{{usercode}}"></input> -->
-        <button bindtap="login">登录</button>
+        <button bind:tap="login">注册</button>
+        
       </view>
+    <view class="cancel">
+      <button  bind:tap="cancel">取消</button>
+    </view>
       <!-- <button class="contactus" open-type="contact">咨询</button> -->
 </view>
 <view class="no_login" wx:if='{{status == 1}}'>
-    <view class="title">欢迎来到湖南顽主杯实盘大赛</view>
+    <view class="title">欢迎来到顽主杯实盘大赛</view>
     <view class='avatar'>
           <image src="../../images/logo.png"></image>
     </view>
@@ -41,13 +45,13 @@
 
 
 <view class="no_login" wx:if='{{status == 3}}'>
-  <view class="title">顽主杯实盘大赛报名</view>
+  <view class="title">看更多内容请注册报名</view>
     <view class='avatar'>
             <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 style="background: none;color:#D94B24;" url="../message/message"><image style="width: 18px;" mode="widthFix" src="../../images/zx.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 style="background: none;color:#D94B24;" bind:tap="pushMessage"><image style="width: 18px;" mode="widthFix" src="../../images/zx.png"></image>  联系客服</navigator>
 </view>
 
 <!-- 上传头像和昵称 -->

+ 13 - 0
pages/login/user.wxss

@@ -91,6 +91,19 @@ page{
   font-size: 32rpx;
   border-radius: 8rpx;
 }
+
+.cancel button:not([size='mini']){
+  background: #a7a7a7;
+  color: #fff;
+  width: 100%;
+  margin-top: 48rpx;
+  height: 88rpx;
+  line-height: 88rpx;
+  padding: 0;
+  font-size: 32rpx;
+  border-radius: 8rpx;
+}
+
 .no_login navigator{
   background: #D94B24;
   border: 1px solid #D94B24;

+ 1 - 1
pages/matchdetail/matchdetail.js

@@ -135,7 +135,7 @@ Page({
       })
       if(this.data.total_money >= 0){
         wx.setNavigationBarColor({
-          backgroundColor: '#D94B24',
+          backgroundColor: '#ff0f03',
           frontColor: '#ffffff',
         })
       } else{

+ 2 - 2
pages/matchdetail/matchdetail.wxss

@@ -30,7 +30,7 @@ ec-canvas {
   height: 138rpx;
   position: relative;
   padding:24rpx;
-  background: #D94B24;
+  background: #E90001;
 }
 .per_top>image{
   width: 90rpx;
@@ -318,7 +318,7 @@ picker{
 }
 
 .head{
-  background-color: #D94B24;
+  background-color: #ff0f03;
   height: 360rpx;
 }
 

+ 7 - 0
pages/myfollow/myfollow.js

@@ -52,6 +52,13 @@ Page({
       current: e.target.dataset.src
     })
   },
+  pushHome(e){
+    if($api.checkUserRole()){
+      wx.navigateTo({
+        url: '../homepage/homepage?id=' + e.currentTarget.dataset.match_id + '&user_id=' + e.currentTarget.dataset.user_id,
+      })
+    }
+  },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 1 - 1
pages/myfollow/myfollow.wxml

@@ -1,7 +1,7 @@
 <wxs module="filters" src="../../utils/toFixed.wxs" />
 <scroll-view  scroll-y='{{true}}'  bindscrolltolower='next'>
 <view class="up-down">
-  <navigator wx:for="{{list}}" hover-class="none"  url="../homepage/homepage?id={{item.match_id}}&record_id={{item.id}}&user_id={{item.user_id}}">
+  <navigator wx:for="{{list}}" hover-class="none" bind:tap="pushHome" data-match_id="{{item.match_id}}" data-user_id = "{{item.user_id}}">
               <view class="relist">
                 <image  src="{{filters.defaultImg(item.avatar)}}"></image>
                   <view class="msg">

+ 21 - 9
pages/rank/rank.js

@@ -15,6 +15,7 @@ Page({
     match_id:'',
     match_day:0,
     matchData:{},
+    isLogin:0,
   },
 
   /**
@@ -91,6 +92,13 @@ Page({
   pushToday(e){
     $push.pushToday(e.currentTarget.dataset)
   },
+  pushSearch(e){
+    if($api.checkUserRole()){
+      wx.navigateTo({
+        url: '../search/search?match_id='+e.currentTarget.dataset.id,
+      })
+    }
+  },
 
 
   /**
@@ -103,9 +111,12 @@ Page({
   /**
    * 生命周期函数--监听页面显示
    */
-  onShow: function () {
-    $api.initUser()
-    
+  onShow: function () {   
+    let user = wx.getStorageSync('user') 
+    console.log('user:',user)
+    this.setData({
+      isLogin:user ? 1:0
+    })
     $api.getsignup().then(res => {
       this.setData({
         info: res.data.data
@@ -113,19 +124,20 @@ Page({
     })
     wx.hideNavigationBarLoading()
     
-    if (!this.data.datas.groups){
+    // if (!this.data.datas || !this.data.datas.groups ){
       $api.getMatchList().then(res => {
         this.setData({
           match: res.data.data,
           index: 0,
-          match_id: res.data.data[0].id
+          match_id: res.data.data[0].id,
+          matchData:res.data.data[0],
         })
         this.getDate()
       })
-    }else{
-      wx.showNavigationBarLoading()
-      this.getData()
-    }
+    // }else{
+    //   wx.showNavigationBarLoading()
+    //   this.getData()
+    // }
     
   },
 

+ 1 - 1
pages/rank/rank.wxml

@@ -44,7 +44,7 @@
                    <image style="width:24rpx;" mode="widthFix" src="../../images/icon_down@2x.png"></image>
                 </view>
     </picker>
-    <navigator hover-class="none" class="search" url="../search/search?match_id={{match[index].id}}"><image  mode="heightFix" src="../../images/ss2.png"></image></navigator>
+    <navigator hover-class="none" class="search" bind:tap="pushSearch" data-id="{{match[index].id}}"><image  mode="heightFix" src="../../images/ss2.png"></image></navigator>
 </view>
 <view class="top">
     <text>排名</text><text style="width:25%;text-align:center;">选手</text>

+ 27 - 0
pages/rank/rank.wxss

@@ -220,4 +220,31 @@ page{
 }
 .date-picker{
   color: #666;
+}
+
+.login{
+  /* height: 100vh; */
+  background: #fff;
+  text-align: center;
+  padding: 20% 70rpx 0;
+}
+.avatar image{
+  width: 160rpx;
+  height: 160rpx;
+  margin: 50rpx auto 100rpx;
+}
+.title{
+  font-size: 32rpx;
+}
+
+.login button:not([size='mini']){
+  background: #D94B24;
+  color: #fff;
+  width: 100%;
+  margin-top: 48rpx;
+  height: 88rpx;
+  line-height: 88rpx;
+  padding: 0;
+  font-size: 32rpx;
+  border-radius: 8rpx;
 }

+ 7 - 0
pages/search/search.js

@@ -132,6 +132,13 @@ Page({
     })
     this.getData(this.data.match_id)
   },
+  pushHome(e){
+    if($api.checkUserRole()){
+      wx.navigateTo({
+        url: '../homepage/homepage?user_id=' + e.currentTarget.dataset.user_id,
+      })
+    }
+  },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 1 - 1
pages/search/search.wxml

@@ -27,7 +27,7 @@
   </picker>
 </view>
 <scroll-view scroll-y='{{true}}' bindscrolltolower='next'>
-  <navigator hover-class="none" url="../homepage/homepage?user_id={{item.user_id}}" class="player" wx:for='{{list}}'>
+  <navigator hover-class="none" bind:tap="pushHome" data-user_id="{{item.user_id}}" class="player" wx:for='{{list}}'>
     <view class="name">{{item.username}}  <text>{{item.badge}}</text></view>
     <view class="info" wx:if='{{item.style.length>0}}'>风格:
                 <label class="tag" wx:for='{{item.style}}' wx:for-item='i'>{{i}}</label>

+ 5 - 0
pages/signup/signup.js

@@ -48,6 +48,8 @@ Page({
       complete: res => {
         this.setData({
           userinfo: res.data,
+          signup_name:res.data.username,
+          phone:res.data.phone,
         })
       }
     })
@@ -203,6 +205,9 @@ Page({
                     wx.removeStorage({
                       key: 'userInfo'
                     })
+                    wx.removeStorage({
+                      key: 'user'
+                    })
                     wx.navigateTo({
                       url: '../login/user',
                     })

+ 3 - 3
pages/signup/signup.wxml

@@ -12,20 +12,20 @@
     </picker>
   </view>
 </view>
-<view class="message" wx:if='{{type==2}}'><label>注:按资金量选择分组,冠军组需历届小组前三,十万以上</label></view>
+<view class="message" wx:if='{{type==2}}'><label>注:按资金量选择分组,融资账户按净资产</label></view>
 <view class="title" wx:if='{{type==1}}'><label>游客报名</label></view>
 
 <view class="item"> 
    <label wx:if='{{type==2}}'>参赛名</label>
    <label wx:else>观赛名</label>
    <view class="tags"> 
-      <input  bindinput="inputchange1" placeholder-style="color:#999;" placeholder="名字小于7个字"></input> 
+      <input  bindinput="inputchange1" placeholder-style="color:#999;" placeholder="名字小于7个字" value="{{userinfo.username}}"></input> 
   </view>
 </view>
 <view class="item"> 
    <label>手机号</label>
    <view class="tags"> 
-      <input  bindinput="inputchange" placeholder-style="color:#999;" placeholder="请填写"></input> 
+      <input  bindinput="inputchange" placeholder-style="color:#999;" placeholder="请填写" value="{{userinfo.phone}}"></input> 
   </view>
 </view>
 <view class="item"> 

+ 10 - 3
pages/stock/stock.js

@@ -34,7 +34,6 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-    console.log('112',options)
     this.setData({
       type:options.type,
       stock_date:options.stock_date,
@@ -66,7 +65,7 @@ Page({
           info: res.data.data
         })
         wx.setNavigationBarTitle({
-          title: res.data.data.name,
+          title: this.data.info.stock_date,
         })
       })
       $api.getStockNbcomments({stock_id:options.id,date:this.data.stock_date}).then(res=>{
@@ -290,6 +289,14 @@ Page({
   pushToday(e){
     $push.pushToday(e.currentTarget.dataset)
   },
+  pushStocks(e){
+    if($api.checkUserRole()){
+      wx.navigateTo({
+        url: '../stock/stock?id=' + e.currentTarget.dataset.id + '&stock_date=' + this.data.stock_date + '&type=1',
+      })
+    }
+
+  },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
@@ -301,7 +308,7 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
-
+    
   },
 
   /**

+ 7 - 10
pages/stock/stock.wxml

@@ -4,16 +4,13 @@
     <view class="stock_name">{{info.name}} 
     <text>{{info.code}}</text>
     </view>
-    <block wx:if='{{info.last_nb_comments}}'>
-      <image mode="withFix" src="{{info.last_nb_comments.img}}"></image>
-      <view class="desc">{{info.last_nb_comments.content}}</view>
-      <view class="nr">@牛人点评 {{filters.getDate(info.last_nb_comments.ctime)}}</view>
-    </block>
+    <view class="stock_desc">{{info.desc}}</view>
     <view class="tab">
-        <view bindtap="tab"   data-id='1' class="{{cur==1?'act':''}}">今日持仓<text></text></view>
+        <view bindtap="tab"   data-id='1' class="{{cur==1?'act':''}}">持仓选手<text></text></view>
         <!-- <view bindtap="tab" data-id='0' class="{{cur==0?'act':''}}">我要解读<text></text></view>
         <view bindtap="tab" data-id='2' class="{{cur==2?'act':''}}">牛人点评<text></text></view> -->
     </view>
+
     <view bindtap="blur" style="background: #fff;padding: 20rpx 0rpx 0rpx 20rpx;">
         <view class="content" wx:if='{{cur==0}}'>
           <view class="_list" wx:for="{{comment_list}}">
@@ -89,7 +86,7 @@
     </view>
 
     <scroll-view  scroll-y='{{true}}' bindscrolltolower='next' style="background: #fff;padding:0 20rpx;">
-        <navigator hover-class="none" class="list" url="../stock/stock?id={{item.id}}&&stock_date={{stock_date}}&type=1" wx:for='{{list}}'>
+        <navigator hover-class="none" class="list" bind:tap="pushStocks" data-id="{{item.id}}" wx:for='{{list}}'>
           <image wx:if="{{index<3}}" class="number" mode="widthFix" src="../../xiao/{{index+1}}.png"></image>
           <text wx:else class="number">{{index+1}}</text>
           <view class="stock-name">
@@ -115,12 +112,12 @@
     </view>
   </view>
   <scroll-view  scroll-y='{{true}}' bindscrolltolower='next' style="background: #fff;padding:0 30rpx;">
-        <navigator hover-class="none" class="list" url="../stock/stock?id={{item.id}}&stock_date={{stock_date}}&type=1" wx:for='{{searchList}}'>
+        <navigator hover-class="none" class="list" bind:tap="pushStocks" data-id="{{item.id}}" wx:for='{{searchList}}'>
           <image wx:if="{{index<3}}" class="number" mode="widthFix" src="../../xiao/{{index+1}}.png"></image>
           <text wx:else class="number">{{index+1}}</text>
           <view class="stock-name">
-            {{item.stock_name}}
-            <text>持仓金额:{{filters.toFix2(item.total_fund)}}w</text>
+            {{item.stock_name}} <text class="cc">{{filters.toFix2(item.total_fund)}}w</text>
+            <text class="code">{{item.stock_code}}</text>
           </view>
         <view class="num"> <text>{{item.count}}</text> 人持仓</view>
         </navigator>

+ 14 - 5
pages/stock/stock.wxss

@@ -198,6 +198,12 @@ image.number{
   color: #666;
   padding-top: 5rpx;
 }
+
+.stock_desc{
+  margin-left: 20rpx;
+  font-size: 32rpx;
+  margin-bottom: 20rpx;
+}
 .num{
   font-size: 32rpx;
   color: #666;
@@ -213,9 +219,10 @@ image.number{
   color: red;
 }
 .stock_name{
-  line-height: 100rpx;
+  line-height: 50rpx;
   padding: 0 20rpx;
-  font-size: 32rpx;
+  margin-top: 20rpx;
+  font-size: 36rpx;
   color: #333;
   background: #fff;
   position: relative;
@@ -225,11 +232,13 @@ image.number{
   font-size: 26rpx;
 }
 .stock_name text{
-  color: #999;
+  color: rgb(106, 106, 106);
   font-weight: 400;
-  font-size: 26rpx;
-  padding: 5rpx 10rpx;
+  font-size: 28rpx;
+  padding: 0rpx 10rpx;
 }
+
+
 .tab{
   background: #fff;
   border-bottom: 1px solid #f2f2f2;

+ 28 - 15
pages/style/style.js

@@ -155,20 +155,34 @@ Page({
       })
       return
     }
-    // if (!form.init_fund) {
-    //   wx.showToast({
-    //     title: '请输入参赛金额',
-    //     icon: 'none'
-    //   })
-    //   return
-    // }
-    // if (!form.account_img) {
-    //   wx.showToast({
-    //     title: '请上传账号截图',
-    //     icon: 'none'
-    //   })
-    //   return
-    // }
+
+    if (!form.username){
+      wx.showToast({
+        title: '请填写参赛名',
+        icon: 'none'
+      })
+      return
+    }
+
+    let user = wx.getStorageSync('user')
+    
+    $api.contentCheck({content:form.username,openid:user.openid}).then(res=>{
+     console.log(res.data.data,'check')
+      var result = res.data.data.result
+      if(result.suggest == 'pass'){
+        this.updateData(form)
+      } else{
+        wx.showToast({
+          icon: 'none',
+          title: '参赛名含违规信息'
+        })
+      }
+    })
+
+    
+  },
+
+  updateData(form){
     wx.showLoading({
       title: '正在提交',
     })
@@ -193,7 +207,6 @@ Page({
   },
 
 
-
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 7 - 0
pages/tlb/tlb.js

@@ -57,6 +57,13 @@ Page({
       this.getData()
     }
   },
+  pushHome(e){
+    if($api.checkUserRole()){
+      wx.navigateTo({
+        url: '../homepage/homepage?id=' + e.currentTarget.dataset.match_id + '&user_id=' + e.currentTarget.dataset.user_id,
+      })
+    }
+  },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 1 - 1
pages/tlb/tlb.wxml

@@ -10,7 +10,7 @@
   <view bindtap="tab"   data-id='total_loss' class="{{cur=='total_loss'?'act':''}}">总亏损榜</view>
 </view>
 <scroll-view scroll-y="{{true}}" bindscrolltolower='next'>
-  <navigator wx:for="{{list}}" class="list" url="../homepage/homepage?id={{item.match_id}}&record_id={{item.id}}&user_id={{item.user_id}}">
+  <navigator wx:for="{{list}}" class="list" bind:tap="pushHome" data-match_id="{{item.match_id}}" data-user_id="{{item.user_id}}">
     <image wx:if="{{index<3}}" class="number" mode="widthFix" src="../../xiao/{{index+1}}.png"></image>
     <text wx:else class="number">{{index+1}}</text>
     <text class="usn">{{item.username}}</text>

+ 34 - 14
pages/today/today.js

@@ -233,23 +233,43 @@ Page({
     })
   },
   sendmsg(){
-    var data={
-      record_id:this.data.record_id,
-      cotent:this.data.comment,
-      pid:this.data.pid,
-      match_id:this.data.id
+    let user = wx.getStorageSync('user')
+    var cdata={
+      content:this.data.comment,
+      openid:user.openid
     }
-    if(!data.cotent){
-        return
+  
+    if(!cdata.content){
+      return
     }
-    $api.postcomment(data).then(res=>{
-      this.getComment()
-      this.setData({
-        comment:'',
-        pid:null,
-        text:'留言'
-      })
+
+    $api.contentCheck(cdata).then(res=>{
+      var result = res.data.data.result
+      console.log(res.data.data,cdata)
+      if(result.suggest == 'pass'){
+        var data={
+          record_id:this.data.record_id,
+          cotent:this.data.comment,
+          pid:this.data.pid,
+          match_id:this.data.id
+        }
+    
+        $api.postcomment(data).then(res=>{
+          this.getComment()
+          this.setData({
+            comment:'',
+            pid:null,
+            text:'留言'
+          })
+        })
+      } else{
+        wx.showToast({
+          icon: 'none',
+          title: '留言含违规信息'
+        })
+      }
     })
+    
   },
   delmsg(e){
     var data={

+ 21 - 3
pages/upload/upload.js

@@ -418,7 +418,9 @@ Page({
       return
     }
 
-    if (this.data.lastdata && !this.data.id){
+    let cdata = wx.getStorageSync('change'+this.data.stock_date);
+
+    if (this.data.lastdata && !this.data.id && cdata==0){
       var lastfund = this.data.lastdata.today_fund;
       if((this.data.today_fund - lastfund)/lastfund > 0.15){
         const that = this
@@ -440,9 +442,24 @@ Page({
       }
       
     }
+    if(parm.experience){
+      let user = wx.getStorageSync('user')
+      $api.contentCheck({content:parm.experience,openid:user.openid}).then(res=>{
+        var result = res.data.data.result
+        if(result.suggest == 'pass'){
+          this.uploadData(parm)
+        } else{
+          wx.showToast({
+            icon: 'none',
+            title: '交易日记含违规信息'
+          })
+        }
+      })
+    } else{
+      this.uploadData(parm)
+    }
+    
 
-    this.uploadData(parm)
-       
   },
   
   uploadData(param){
@@ -452,6 +469,7 @@ Page({
     this.setData({
       disable: true
     })
+    
     $api.updateRecord(param).then(res => {
       wx.hideLoading()
       wx.showToast({

+ 1 - 1
pages/upload/upload.wxml

@@ -37,7 +37,7 @@
     <view class="info" wx:for='{{stock}}' >
       <input bindinput='stockSearch'   data-id='{{index}}'  value="{{item.name}}" placeholder="股票名称"></input>
       <input type='digit' bindinput="fundChange" data-id='{{index}}' value="{{item.fund}}" placeholder="持仓"></input>
-      <input class="{{item.money[0]=='-' ?'down':'up'}}" type='digit' bindinput="moneyChange" data-id='{{index}}' value="{{item.money}}" placeholder="盈亏"></input>
+      <input class="{{item.money[0]=='-' ?'down':'up'}}" type='text' bindinput="moneyChange" data-id='{{index}}' value="{{item.money}}" placeholder="盈亏"></input>
       <!-- <text style="color:#E90001;font-size: 34rpx;">万</text>     -->
       <view  style="width:17%;">
         <icon bindtap="del" data-id='{{index}}' style="margin-top:25rpx; margin-left: 10rpx;" class="icon-small" type="cancel" size="20"></icon>

+ 13 - 3
pages/user/user.js

@@ -68,13 +68,16 @@ Page({
     wx.removeStorage({
       key: 'userInfo'
     })
+    wx.removeStorage({
+      key: 'user'
+    })
     this.setData({
       userinfo: {},
       usercode: ''
     })
-    wx.navigateTo({
-      url: '../login/user',
-    })
+    // wx.navigateTo({
+    //   url: '../login/user',
+    // })
   },
   
   onCustomerService(){
@@ -88,6 +91,13 @@ Page({
   pushToday(e){
     $push.pushToday(e.currentTarget.dataset)
   },
+  pushMessage(e){
+    if($api.checkUser()){
+      wx.navigateTo({
+        url: '../message/message',
+      })
+    }
+  },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 4 - 4
pages/user/user.wxml

@@ -56,11 +56,11 @@
 </view>
 
 <view class="no_login" wx:if="{{!userinfo.id}}">
-  <view class="title">欢迎来到湖南顽主杯实盘大赛</view>
+  <view class="title">看更多内容请注册报名</view>
     <view class='avatar'>
             <image src="../../images/logo.png"></image>
     </view>
-  <navigator url="../login/user"><image style="width: 24px;" mode="widthFix" src="../../images/bs.png"></image>报名参赛(做选手)</navigator>
-  <navigator style="background: none;color:#D94B24;" url="../login/user"><image style="width: 24px;" mode="widthFix" src="../../images/yk.png"></image>访问系统(不参赛)</navigator>
-  <navigator style="background: none;color:#D94B24;" url="../login/user"><image style="width: 18px;" mode="widthFix" src="../../images/zx.png"></image>咨询顽主</navigator>
+  <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 style="background: none;color:#D94B24;" bind:tap="pushMessage"><image style="width: 18px;" mode="widthFix" src="../../images/zx.png"></image>咨询顽主</navigator>
 </view>

+ 37 - 31
utils/api.js

@@ -36,14 +36,6 @@ function request(method, url, data) {
             } else if (res.data.code == 403) {
               //未登录
               reject(403)
-              if (url.indexOf('authinfo')>=0){
-                // wx.switchTab({
-                //   url: '../user/user',
-                // })
-                wx.navigateTo({
-                  url: '../login/user?type=0',
-                })
-              }
             }else{
               wx.hideNavigationBarLoading()
               wx.hideLoading()
@@ -102,39 +94,50 @@ function uploadFile(url, filePath, name, formData, isSubDomain) {
   })
 }
 
+function checkUser(){
+  console.log('check is user')
+  let user = wx.getStorageSync('user')
+  if(!user){
+    wx.navigateTo({
+      url: '../login/user?type=0',
+    })
+  }
+  return user
+}
+
+function checkUserRole(){
+  let user = wx.getStorageSync('user')
+
+  if (!user || user.role == 0) {
+    wx.navigateTo({
+      url: '../login/user?type=3',
+    })
+
+    return false
+  }
+
+  return true
+}
+
+
+
 function pushToday(e){
-  wx.getStorage({
-    key: 'user',
-    complete: res => {
-      if (res.data.role == 0) {
-        wx.navigateTo({
-          url: '../login/user?type=3',
-        })
-      } else{
-        wx.navigateTo({
-          url: '../today/today?id=' + e.match_id + '&record_id=' + e.record_id + '&user_id=' + e.user_id,
-        })
-      }
-    }
-  })
-  
+  if(checkUserRole()){
+    wx.navigateTo({
+      url: '../today/today?id=' + e.match_id + '&record_id=' + e.record_id + '&user_id=' + e.user_id,
+    })
+  }
 }
 
 function initUser(){
   API.getAuthinfo().then(res=>{
-    console.log(res.data.data,'user')
+    console.log(res.data.data,'user11')
     if(res.data.code==0){
       wx.setStorage({
         key: 'user',
         data: res.data.data,
       })
     }
-
-    if(res.data.data.role==0){
-      wx.navigateTo({
-        url: '../login/user?type=3&player_type='+res.data.data.player_type,
-      })
-    }
   })
 }
 
@@ -196,6 +199,7 @@ const API = {
   wxpay: (data) => request(POST, `/api/wx/v3/signup/wxpay`, data),
   consult: (data) => request(POST, `/api/wx/v3/user/consult`, data),
   getsignup: (data) => request(GET, `/api/wx/v3/signup/info`, data),
+  getsignupweb: (data) => request(GET, `/api/wx/v3/signup/web`, data),
   update: (data) => request(PUT, `/api/wx/v3/user/fund/modify`, data),
   getChoice: (data) => request(GET, `/api/wx/v3/user/choice/list`, data),
   addchoice: (data) => request(POST, `/api/wx/v3/user/choice`, data),
@@ -220,8 +224,10 @@ const API = {
   markScore: (data) => request(POST, `/api/wx/v3/user/markscore`, data),
   checkMark: (data) => request(GET, `/api/wx/v3/user/markscore/check`, data),
   getMark: (data) => request(GET, `/api/wx/v3/user/markscore/weekavg`, data),
+  contentCheck: (data) => request(POST, `/api/wx/v3/msg/content/check`, data),
   initUser:() => initUser(),
-
+  checkUser:() => checkUser(),
+  checkUserRole:() => checkUserRole(),
 };
 
 const PUSH = {