Browse Source

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

yukangzhe 3 years ago
parent
commit
1ecfefdaf5
2 changed files with 3 additions and 2 deletions
  1. 2 1
      pages/makePiano/makePiano.js
  2. 1 1
      pages/makePiano/makePiano.wxml

+ 2 - 1
pages/makePiano/makePiano.js

@@ -290,8 +290,9 @@ Page({
     })
     })
     let id = e.currentTarget.dataset.id;
     let id = e.currentTarget.dataset.id;
     const index = e.currentTarget.dataset.index
     const index = e.currentTarget.dataset.index
+    const cIndex = e.currentTarget.dataset.cindex
 
 
-    if(this.data.schoolList[index].hasVisitNum >= this.data.schoolList[index].maxNum){
+    if(this.data.schoolList[index].items[cIndex].hasVisitNum >= this.data.schoolList[index].items[cIndex].maxNum){
       wx.hideLoading({
       wx.hideLoading({
         success: (res) => {
         success: (res) => {
           wx.showToast({
           wx.showToast({

+ 1 - 1
pages/makePiano/makePiano.wxml

@@ -71,7 +71,7 @@
                 <view class="class-stu-num">
                 <view class="class-stu-num">
                   {{ item.hasVisitNum}}/{{ item.maxNum}}
                   {{ item.hasVisitNum}}/{{ item.maxNum}}
                 </view>
                 </view>
-                <view class="class-get-btn" bindtap="doAppointment" data-index="{{index}}" data-id="{{item.id}}">
+                <view class="class-get-btn" bindtap="doAppointment" data-index="{{index}}" data-cindex="{{cItem}}" data-id="{{item.id}}">
                  {{ item.hasVisitNum < item.maxNum ?  '预约' : '已约满'}}
                  {{ item.hasVisitNum < item.maxNum ?  '预约' : '已约满'}}
                 </view>
                 </view>
               </view>
               </view>