98b7600797
对标安卓正式版、对接 app-server(8770)的 SwiftUI 客户端。iOS 无障碍受限、无比价核心,做自成一体:美团 CPS 导购 + 福利(签到/任务/金币)+ 查看(比价记录/省钱战绩)。 功能完整 M0-M5:脚手架、短信登录(JWT+Keychain+401 自动刷新)、首页券 feed 导购、比价记录+省钱战绩、福利、我的(资料/反馈/设置/注销)。 单 target、0 三方依赖、XcodeGen 生成工程;Debug/Release 双 plist 分流 ATS。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
31 lines
1022 B
Swift
31 lines
1022 B
Swift
import Foundation
|
|
|
|
/// 后端只给 task_key / biz_type,前端做中文文案映射。任务现仅 enable_notification。
|
|
enum WelfareCatalog {
|
|
static func taskTitle(_ key: String) -> String {
|
|
switch key {
|
|
case "enable_notification": return "开启推送通知"
|
|
default: return key
|
|
}
|
|
}
|
|
|
|
static func taskDesc(_ key: String) -> String {
|
|
switch key {
|
|
case "enable_notification": return "接收降价提醒与省钱攻略"
|
|
default: return ""
|
|
}
|
|
}
|
|
|
|
/// 金币流水的业务文案:remark 优先,否则按 biz_type 映射。
|
|
static func coinBizText(_ tx: CoinTransactionDTO) -> String {
|
|
if let remark = tx.remark, !remark.isEmpty { return remark }
|
|
switch tx.bizType {
|
|
case "signin": return "每日签到"
|
|
case "ad_reward": return "看广告奖励"
|
|
case "exchange": return "兑换现金"
|
|
default:
|
|
return tx.bizType.hasPrefix("task_") ? "任务奖励" : tx.bizType
|
|
}
|
|
}
|
|
}
|