Ver código fonte

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

yukangzhe 3 anos atrás
pai
commit
1ecfefdaf5
2 arquivos alterados com 3 adições e 2 exclusões
  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;
     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({
         success: (res) => {
           wx.showToast({

+ 1 - 1
pages/makePiano/makePiano.wxml

@@ -71,7 +71,7 @@
                 <view class="class-stu-num">
                   {{ item.hasVisitNum}}/{{ item.maxNum}}
                 </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 ?  '预约' : '已约满'}}
                 </view>
               </view>