|
@@ -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 && '/'}
|