From 0c89e362069e2f97d18a01a3a82835ef37a34d18 Mon Sep 17 00:00:00 2001 From: 无故事王国 <841720330@qq.com> Date: 星期四, 20 六月 2024 14:23:59 +0800 Subject: [PATCH] fix --- DolphinEnglishLearnStudent/Moudle/Market/VC/MarketContentVC.swift | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/DolphinEnglishLearnStudent/Moudle/Market/VC/MarketContentVC.swift b/DolphinEnglishLearnStudent/Moudle/Market/VC/MarketContentVC.swift index 5daa03a..5c3d940 100644 --- a/DolphinEnglishLearnStudent/Moudle/Market/VC/MarketContentVC.swift +++ b/DolphinEnglishLearnStudent/Moudle/Market/VC/MarketContentVC.swift @@ -66,8 +66,15 @@ self?.label_categry.text = m.goodTypes.map({$0.name}).joined(separator: "|") var info_Array = Array<String>() - info_Array.append("剩余数量:\(m.good?.surplus ?? 0)") - info_Array.append("可换数量:\(m.good?.userCount ?? 0)") + + if m.good?.surplus != nil{ + info_Array.append("剩余数量:\(m.good?.surplus ?? 0)") + } + + if m.good?.userCount != nil{ + info_Array.append("可换数量:\(m.good?.userCount ?? 0)") + } + info_Array.append("\(m.exchangeNumber)人兑换") self?.label_info.text = info_Array.joined(separator: "|") @@ -105,6 +112,7 @@ @IBAction func exchangeAction(_ sender: UIButton) { + guard viewModel.detailModel.value?.good?.surplus != 0 else { CommonAlertView.show(isSinple: true, content: "兑换失败,当前剩余数量不足!") { -- Gitblit v1.7.1