Przeglądaj źródła

Merge branch 'master' of http://git.ringzle.com:3000/yangen/SxsnWechat

x 5 dni temu
rodzic
commit
1031c58beb
1 zmienionych plików z 14 dodań i 12 usunięć
  1. 14 12
      components/pages/nonprofitActivety/index.vue

+ 14 - 12
components/pages/nonprofitActivety/index.vue

@@ -24,10 +24,10 @@
 				</view>
 			</view>
 		</view>
-		<view class="na-bottom adfacjb" v-if="item.activeState!==-1">
-			<view class="na-bottom-left adf">
-				{{ statusCfg[item.activeState] }} · 已报{{ item.recruitmentNow || 0 }}{{ item.recruitmentMax ? '/' + item.recruitmentMax : '' }}人
-			</view>
+		<view class="na-bottom adfacjb" v-if="item.activeState!==-1">
+			<view class="na-bottom-left adf">
+				{{ signupText }}
+			</view>
 			<!-- <view class="na-bottom-right" @click.stop="toApply">立即报名</view> -->
 		</view>
 	</view>
@@ -57,13 +57,15 @@
 		3:'已结束'
 	})
 
-	// 「报名中 · 已报 X 人」或「已报 X/Y 人」
-	const signupText = computed(() => {
-		const it = props.item || {}
-		const now = it.recruitmentNow || 0
-		const max = it.recruitmentMax
-		return `报名中 · 已报${now}${max ? '/' + max : ''}人`
-	})
+	// 报名未满时只显示状态,避免出现「报名中 · 已报0/12人」
+	const signupText = computed(() => {
+		const it = props.item || {}
+		const status = statusCfg.value[it.activeState] || ''
+		const now = Number(it.recruitmentNow) || 0
+		const max = Number(it.recruitmentMax) || 0
+		if (it.activeState === 1 && (!max || now < max)) return status
+		return `${status} · 已报${now}${max ? '/' + max : ''}人`
+	})
 
 	const handleDetail = item => {
 		if(!isLogin()) return
@@ -183,4 +185,4 @@
 			}
 		}
 	}
-</style>
+</style>