xtz 4 tahun lalu
induk
melakukan
a1784356e0
2 mengubah file dengan 4 tambahan dan 4 penghapusan
  1. 1 1
      pages/contest/answer/answer.js
  2. 3 3
      pages/home/home.js

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

@@ -125,7 +125,7 @@ Page({
     let questionWrong  = []
     questionTotal.forEach((item,index) => {
       (chooseList[index]||chooseList[index]===0)&&item.options[chooseList[index]].optionAnswer
-      ? paperScore += 2
+      ? paperScore += item.score
       : questionWrong.push({[item.id]: (chooseList[index]||chooseList[index]===0)?item.options[chooseList[index]].optionId:''})
     })
     answer.submitUserAnswer({reqdata:{

+ 3 - 3
pages/home/home.js

@@ -403,7 +403,7 @@ Page({
     answer.checkPermission({reqdata:{
       userId: this.data.user.id
     }},r => {
-      r.object.status 
+      (r.object && r.object.status)
         ? this.data.user.isRegister
           ? wx.showModal({
               title: '答题须知:',
@@ -416,13 +416,13 @@ Page({
                     url: '/pages/contest/answer/answer'
                   })
                 }
-            }
+              }
             })
           : wx.navigateTo({
               url: '/pages/contest/info/info'
             })
         : wx.showToast({
-          title: '比赛期间最多答题三次!',
+          title: r.msg,
           icon:'none'
         })
     })