Explorar el Código

Merge branch 'iteration-20241011' into iteration-20241126

lex-xin hace 3 meses
padre
commit
74a3126925
Se han modificado 1 ficheros con 14 adiciones y 11 borrados
  1. 14 11
      src/student/teacher-dependent/components/group.tsx

+ 14 - 11
src/student/teacher-dependent/components/group.tsx

@@ -60,6 +60,11 @@ export default defineComponent({
         if (this.list.length > 0 && result.pageNo === 1) {
           return
         }
+        const rows = result.rows || []
+        rows.forEach((item: any) => {
+          const num = item.maxStudentNum - item.studentCount
+          item.studentLastCount = num <= 0 ? 0 : num
+        })
         this.list = this.list.concat(result.rows || [])
         this.finished = result.pageNo >= result.totalPage
         this.params.page = result.pageNo + 1
@@ -120,20 +125,18 @@ export default defineComponent({
                   </div>
                   <div class={styles.users}>
                     <div class={styles.lean}>
-                      <span class={styles.num}>
-                        {item.studentCount}人学习
-                      </span>
+                      {item.studentLastCount > 0 ? (<span class={styles.num}>
+                        剩余{item.studentLastCount}个名额
+                      </span>) : ""}
                     </div>
                     <div class={styles.price}>
                       {item.coursePrice > 0 && (
-                        <>
-                          <span class={styles.priceNum}>
-                            <i>¥</i>
-                            {(this as any).$filters.moneyFormat(
-                              item.coursePrice
-                            )}
-                          </span>
-                        </>
+                        <span class={styles.priceNum}>
+                          <i>¥</i>
+                          {(this as any).$filters.moneyFormat(
+                            item.coursePrice
+                          )}
+                        </span>
                       )}
                       <span class={styles.label}>
                         {item.coursePrice > 0 && '/'}