xjc 2 years ago
parent
commit
907b48d1a9
6 changed files with 113 additions and 76 deletions
  1. 3 3
      pages/index/index.js
  2. 13 9
      pages/rank/rank.js
  3. 12 1
      pages/user/user.wxml
  4. 22 0
      pages/user/user.wxss
  5. 58 58
      project.config.json
  6. 5 5
      utils/api.js

+ 3 - 3
pages/index/index.js

@@ -314,8 +314,8 @@ Page({
       }
     })
     
-    if(this.data.followList.length<=0){
-      this.getFollow()
-    }
+    // if(this.data.followList.length<=0){
+    //   this.getFollow()
+    // }
   },
 })

+ 13 - 9
pages/rank/rank.js

@@ -23,11 +23,7 @@ Page({
     // this.setData({
     //   date: y + '-' + m + '-' + d
     // })
-    $api.getsignup().then(res=>{
-        this.setData({
-            info:res.data.data
-        })
-    })
+    
     $api.getMatchList().then(res=>{
       let l = res.data.data.length - 1;
       this.setData({
@@ -91,14 +87,22 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
- 
+    $api.getsignup().then(res => {
+      this.setData({
+        info: res.data.data
+      })
+    })
     wx.hideNavigationBarLoading()
+    
     if (!this.data.datas.groups){
-      $api.getDate().then(res => {
+      $api.getMatchList().then(res => {
+        let l = res.data.data.length - 1;
         this.setData({
-          date: res.data.data
+          match: res.data.data,
+          index: l,
+          match_id: res.data.data[l].id
         })
-        this.getData()
+        this.getDate()
       })
     }else{
       wx.showNavigationBarLoading()

+ 12 - 1
pages/user/user.wxml

@@ -1,4 +1,4 @@
-<view class="bg">
+<view class="bg" wx:if="{{userinfo.id}}">
       <view class="info">
         <view class='avatar'>
             <image style="width:100%;height:100%;"  src="{{userinfo.avatar}}"></image>
@@ -65,3 +65,14 @@
   
 </view>
 
+
+
+<view class="no_login" wx:else>
+  <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>
+</view>

+ 22 - 0
pages/user/user.wxss

@@ -224,3 +224,25 @@ page{
 }
 
 
+
+
+.no_login navigator{
+  background: #D94B24;
+  border: 1px solid #D94B24;
+  color: #fff;
+  width: 100%;
+  margin-top: 48rpx;
+  height: 88rpx;
+  line-height: 88rpx;
+  padding: 0;
+  font-size: 32rpx;
+  border-radius: 8rpx;
+  position: relative;
+}
+.no_login navigator image{
+  position: absolute;
+  top: 0;
+  bottom: 0;
+  margin: auto;
+  left: 30%;
+}

+ 58 - 58
project.config.json

@@ -1,60 +1,60 @@
 {
-  "description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
-  "packOptions": {
-    "ignore": [],
-    "include": []
-  },
-  "setting": {
-    "urlCheck": true,
-    "es6": true,
-    "enhance": true,
-    "postcss": true,
-    "preloadBackgroundData": false,
-    "minified": true,
-    "newFeature": true,
-    "coverView": true,
-    "nodeModules": false,
-    "autoAudits": false,
-    "showShadowRootInWxmlPanel": true,
-    "scopeDataCheck": false,
-    "uglifyFileName": false,
-    "checkInvalidKey": true,
-    "checkSiteMap": true,
-    "uploadWithSourceMap": true,
-    "babelSetting": {
-      "ignore": [],
-      "disablePlugins": [],
-      "outputPath": ""
-    },
-    "useCompilerModule": false,
-    "userConfirmedUseCompilerModuleSwitch": false,
-    "compileHotReLoad": false,
-    "lazyloadPlaceholderEnable": false,
-    "useMultiFrameRuntime": true,
-    "useApiHook": true,
-    "useApiHostProcess": true,
-    "enableEngineNative": false,
-    "useIsolateContext": false,
-    "userConfirmedBundleSwitch": false,
-    "packNpmManually": false,
-    "packNpmRelationList": [],
-    "minifyWXSS": true,
-    "disableUseStrict": false,
-    "minifyWXML": true,
-    "showES6CompileOption": false,
-    "useCompilerPlugins": false,
-    "useStaticServer": true,
-    "ignoreUploadUnusedFiles": true
-  },
-  "compileType": "miniprogram",
-  "libVersion": "2.15.0",
-  "appid": "wxb299e10e65157301",
-  "projectname": "newwzb_xcx",
-  "simulatorType": "wechat",
-  "simulatorPluginLibVersion": {},
-  "editorSetting": {
-    "tabIndent": "insertSpaces",
-    "tabSize": 2
-  },
-  "condition": {}
+	"description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
+	"packOptions": {
+		"ignore": [],
+		"include": []
+	},
+	"setting": {
+		"urlCheck": true,
+		"es6": true,
+		"enhance": true,
+		"postcss": true,
+		"preloadBackgroundData": false,
+		"minified": true,
+		"newFeature": true,
+		"coverView": true,
+		"nodeModules": false,
+		"autoAudits": false,
+		"showShadowRootInWxmlPanel": true,
+		"scopeDataCheck": false,
+		"uglifyFileName": false,
+		"checkInvalidKey": true,
+		"checkSiteMap": true,
+		"uploadWithSourceMap": true,
+		"babelSetting": {
+			"ignore": [],
+			"disablePlugins": [],
+			"outputPath": ""
+		},
+		"useCompilerModule": false,
+		"userConfirmedUseCompilerModuleSwitch": false,
+		"compileHotReLoad": false,
+		"lazyloadPlaceholderEnable": false,
+		"useMultiFrameRuntime": true,
+		"useApiHook": true,
+		"useApiHostProcess": true,
+		"enableEngineNative": false,
+		"useIsolateContext": false,
+		"userConfirmedBundleSwitch": false,
+		"packNpmManually": false,
+		"packNpmRelationList": [],
+		"minifyWXSS": true,
+		"disableUseStrict": false,
+		"minifyWXML": true,
+		"showES6CompileOption": false,
+		"useCompilerPlugins": false,
+		"useStaticServer": true,
+		"ignoreUploadUnusedFiles": true
+	},
+	"compileType": "miniprogram",
+	"libVersion": "2.15.0",
+	"appid": "wxb299e10e65157301",
+	"projectname": "newwzb_xcx",
+	"simulatorType": "wechat",
+	"simulatorPluginLibVersion": {},
+	"editorSetting": {
+		"tabIndent": "insertSpaces",
+		"tabSize": 2
+	},
+	"condition": {}
 }

+ 5 - 5
utils/api.js

@@ -30,19 +30,19 @@ function request(method, url, data) {
           success(res) {
             //请求成功
             //判断状态码---errCode状态根据后端定义来判断
-
+            x.hideNavigationBarLoading()
             if (res.data.code == 0||res.data.pass==1) {
               resolve(res);
             } else if (res.data.code == 403) {
               //未登录
               reject(403)
-              if(url.indexOf('authinfo')>=0){
-                wx.navigateTo({
-                  url: '../login/user',
+              if (url.indexOf('authinfo')>=0){
+                wx.switchTab({
+                  url: '../user/user',
                 })
               }
             }else{
-              wx.hideNavigationBarLoading()
+              
               wx.hideLoading()
               wx.showToast({
                 title: res.data.message,