xtz 4 anni fa
parent
commit
85d3f4d87b

+ 3 - 0
api/api.js

@@ -143,6 +143,9 @@ module.exports = {
     attendContest(d, cb) {
       post('/mCompetition/attendContest', d).then(resolver(cb).done).catch(resolver(cb).fail)
     },
+    checkPermission(d, cb) {
+      post('/mCompetition/checkPermission', d).then(resolver(cb).done).catch(resolver(cb).fail)
+    },
     getLeaderBoard(d, cb) {
       post('/mCompetition/getLeaderBoard', d).then(resolver(cb).done).catch(resolver(cb).fail)
     },

+ 1 - 1
pages/contest/info/info.js

@@ -181,7 +181,7 @@ Page({
         this.loadMyinformation()
         wx.showModal({
           title: '答题须知:',
-          content: '1.每人每天最多答题三次\n\n 2.排行榜以得分情况计算',
+          content: '1.比赛期间每人最多答题三次\n\n 2.排行榜以得分情况计算',
           confirmColor: '#ff0000',
           cancelText: '返回',
           success (res) {

+ 1 - 1
pages/contest/ranking/ranking.wxml

@@ -33,7 +33,7 @@
       <image src="../../../imgs/contest/ranking/test-area.png"></image>
       <view class="message">
         <view class="message-title">{{['','个人','区','学校'][page]}}排名说明</view> 
-        <view class="message-test">以竞赛时间范围内个人最好成绩排序高低,如分数并列,则按照答题时间的快慢平均值排序;</view>
+        <view class="message-test">以竞赛时间范围内{{['','个人','区域','学校'][page]}}{{['','最好成绩排序高低','成绩平均分高低排序','平均分高低排序'][page]}},如分数并列,则按照答题时间的快慢平均值排序;</view>
       </view>
     </view>
   </view>

+ 6 - 0
pages/contest/score/score.js

@@ -10,6 +10,12 @@ Page({
     rank: 0,
     statusBar: 0
   },
+  
+  goHome (e) {
+    wx.reLaunch({
+      url: '/pages/home/home',
+    })
+  },
 
   toLink (e) {
     wx.navigateTo({

+ 1 - 0
pages/contest/score/score.wxml

@@ -1,6 +1,7 @@
 <!--pages/contest/score/score.wxml-->
 <view>
   <image class="bg" src="../../../imgs/contest/score/bg.png"></image>
+  <image src="../../../imgs/contest/ranking/home.png" class="home" style="top:{{statusBar}}px" bindtap="goHome"></image>
   <view class="page-title" style="top:{{statusBar}}px">排行榜</view>
   <view class="content">
     <image mode="widthFix" class="kuang" src="../../../imgs/contest/score/kuang.png"></image>

+ 8 - 0
pages/contest/score/score.wxss

@@ -2,6 +2,14 @@
 page {
   background: #fff;
 }
+.home {
+  width: 40rpx;
+  height: 40rpx;
+  position: absolute;
+  top: 70rpx;
+  left: 50rpx;
+  z-index: 99;
+}
 .page-title {
   position: absolute;
   z-index: 1;

+ 29 - 19
pages/home/home.js

@@ -3,7 +3,8 @@ import {
   ihome,
   iactivity,
   icommunity,
-  imine
+  imine,
+  answer
 } from '../../api/api.js'
 const app = getApp()
 
@@ -395,28 +396,37 @@ Page({
         linkState: true
       })
     }
-    console.log(111)
     this.setData({
       linkState: false
     })
-    // user.isRegister?'/pages/contest/answer/answer':'/pages/contest/info/info'
-    this.data.user.isRegister
-    ? wx.showModal({
-        title: '答题须知:',
-        content: '1.每人每天最多答题三次\n\n 2.排行榜以得分情况计算',
-        confirmColor: '#ff0000',
-        cancelText: '返回',
-        success (res) {
-          if (res.confirm) {
-            wx.navigateTo({
-              url: '/pages/contest/answer/answer'
+    
+    answer.checkPermission({reqdata:{
+      userId: this.data.user.id
+    }},r => {
+      r.object.status 
+        ? this.data.user.isRegister
+          ? wx.showModal({
+              title: '答题须知:',
+              content: '1.比赛期间每人最多答题三次\n\n 2.排行榜以得分情况计算',
+              confirmColor: '#ff0000',
+              cancelText: '返回',
+              success (res) {
+                if (res.confirm) {
+                  wx.navigateTo({
+                    url: '/pages/contest/answer/answer'
+                  })
+                }
+            }
             })
-          }
-       }
-      })
-    : wx.navigateTo({
-        url: '/pages/contest/info/info'
-      })
+          : wx.navigateTo({
+              url: '/pages/contest/info/info'
+            })
+        : wx.showToast({
+          title: '比赛期间最多答题三次!',
+          icon:'none'
+        })
+    })
+    
   },
   clickStudy () {
     wx.showToast({