Browse Source

Signed-off-by: yukangzhe <382985154@qq.com>

yukangzhe 3 years atrás
parent
commit
6481df571a
1 changed files with 15 additions and 0 deletions
  1. 15 0
      pages/makePiano/makePiano.js

+ 15 - 0
pages/makePiano/makePiano.js

@@ -289,6 +289,21 @@ Page({
       mask: true
     })
     let id = e.currentTarget.dataset.id;
+    const index = e.currentTarget.dataset.index
+
+    if(this.data.schoolList[index].hasVisitNum + 1 >= this.data.schoolList[index].maxNum){
+      wx.hideLoading({
+        success: (res) => {
+          wx.showToast({
+            title: '预约上限已满',
+            icon: 'none'
+          })
+        },
+      })
+      return
+    }
+
+
     const urls = urlDef.urls;
     let w = this.data.weekList[this.data.curIndex];
     let sid = this.data.schoolList[this.data.schoolIndex].id