Преглед на файлове

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

yukangzhe преди 3 години
родител
ревизия
1ecfefdaf5
променени са 2 файла, в които са добавени 3 реда и са изтрити 2 реда
  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>