tanyanfei 4 years ago
parent
commit
a4de52782e
2 changed files with 9 additions and 1 deletions
  1. 7 0
      pages/index/index.js
  2. 2 1
      pages/subject/subject.js

+ 7 - 0
pages/index/index.js

@@ -93,6 +93,13 @@ Page({
               break;
             }
         }
+      },
+      fail:res=>{
+        wx.showToast({
+          title: '服务器开小差啦!',
+          icon: 'none',
+          duration: 2000
+        })
       }
     })
   }

+ 2 - 1
pages/subject/subject.js

@@ -69,7 +69,8 @@ Page({
   },
   next:function(){
     const idx=this.data.idx+1
-    if(this.data.ans.length!=this.data.idx){
+    const cur = this.data.idx -1
+    if (!this.data.ans[cur].answer){
       wx.showToast({
         title: '请选择答案',
         icon: 'none',