fix(trae): 国际版移除签到卡,详情页按美元/月配额展示

- INTL 详细页不再显示每日签到卡(国际版无签到体系),改为说明卡
- Trae 账户信息卡在美元计费时显示套餐名 + Premium 快速/慢速、高级、自动补全月配额
- INTL 不再生成 0 积分权益包计数,避免残留“积分”字样
This commit is contained in:
Liuxinyu176 2026-10-09 22:31:20 +08:00
parent 0ca6ccd384
commit 8062a54252
6 changed files with 63 additions and 5 deletions

View File

@ -16,8 +16,8 @@ android {
applicationId = "com.rainy.token" applicationId = "com.rainy.token"
minSdk = 31 minSdk = 31
targetSdk = 35 targetSdk = 35
versionCode = 37 versionCode = 38
versionName = "1.7.17" versionName = "1.7.18"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables { vectorDrawables {

View File

@ -211,7 +211,7 @@ class TraeRepository constructor(
} }
} }
} }
if (packCount > 0) { if (packCount > 0 && !isDollarBilling) {
extras["pack_count"] = packCount.toString() extras["pack_count"] = packCount.toString()
extras["general_credits"] = trimNum(generalSum) extras["general_credits"] = trimNum(generalSum)
extras["work_credits"] = trimNum(workSum) extras["work_credits"] = trimNum(workSum)

View File

@ -235,9 +235,12 @@ fun ServiceDetailScreen(
item { OllamaUsageCard(uiState.state) } item { OllamaUsageCard(uiState.state) }
} }
ServiceType.TRAE -> { ServiceType.TRAE -> {
// 每日签到卡;未配置凭据时展示引导卡,避免暴露必然失败的签到按钮 // 每日签到卡;未配置凭据时展示引导卡,国际版无签到则展示说明卡
item { item {
if (uiState.hasCredential) { val intl = uiState.region != null && uiState.region.equals("INTL", ignoreCase = true)
if (intl) {
TraeIntlNoCheckinCard()
} else if (uiState.hasCredential) {
CheckinCard( CheckinCard(
state = checkinState, state = checkinState,
todayCheckedIn = checkinInfo?.todayCheckedIn == true, todayCheckedIn = checkinInfo?.todayCheckedIn == true,
@ -1504,6 +1507,26 @@ internal fun TraeAccountInfoCard(state: State) {
extras["pack_count"]?.toIntOrNull()?.takeIf { it > 0 }?.let { extras["pack_count"]?.toIntOrNull()?.takeIf { it > 0 }?.let {
add(stringResource(R.string.extra_label_pack_count) to it.toString()) add(stringResource(R.string.extra_label_pack_count) to it.toString())
} }
if (extras["billing_mode"] == "dollar") {
extras["intl.plan_name"]?.let {
add(stringResource(R.string.trae_intl_plan_title) to it)
}
extras["intl.premium_fast_limit"]?.let {
add(stringResource(R.string.trae_intl_premium_fast_title) to "$it " + stringResource(R.string.trae_intl_quota_unit))
}
extras["intl.premium_slow_limit"]?.let {
add(stringResource(R.string.trae_intl_premium_slow_title) to "$it " + stringResource(R.string.trae_intl_quota_unit))
}
extras["intl.advanced_limit"]?.let {
add(stringResource(R.string.trae_intl_advanced_title) to "$it " + stringResource(R.string.trae_intl_quota_unit))
}
extras["intl.auto_completion_limit"]?.let {
add(stringResource(R.string.trae_intl_auto_completion_title) to "$it " + stringResource(R.string.trae_intl_quota_unit))
}
extras["intl.basic_used"]?.let {
add(stringResource(R.string.trae_intl_basic_used_title) to it)
}
}
// 计费方式:两个英文布尔键合并为一行自然语言 // 计费方式:两个英文布尔键合并为一行自然语言
val billingLabel = when { val billingLabel = when {
extras["is_credits_billing"] == "true" -> stringResource(R.string.extra_value_billing_credits) extras["is_credits_billing"] == "true" -> stringResource(R.string.extra_value_billing_credits)
@ -1531,6 +1554,29 @@ internal fun TraeAccountInfoCard(state: State) {
* *
* 旧缓存无 wb_detail_raw 时回退为「资源 #007」简化行。无任何数据时整卡不渲染。 * 旧缓存无 wb_detail_raw 时回退为「资源 #007」简化行。无任何数据时整卡不渲染。
*/ */
@Composable
private fun TraeIntlNoCheckinCard() {
Card(
modifier = Modifier.fillMaxWidth(),
shape = RoundedCornerShape(20.dp),
colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surface),
elevation = CardDefaults.cardElevation(defaultElevation = 0.dp)
) {
Column(modifier = Modifier.padding(16.dp), verticalArrangement = Arrangement.spacedBy(4.dp)) {
Text(
text = stringResource(R.string.trae_intl_no_checkin_title),
style = MaterialTheme.typography.titleSmall,
fontWeight = FontWeight.SemiBold
)
Text(
text = stringResource(R.string.trae_intl_no_checkin_desc),
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.outline
)
}
}
}
@Composable @Composable
internal fun WorkBuddyResourcesCard(state: State) { internal fun WorkBuddyResourcesCard(state: State) {
val balance = when (state) { val balance = when (state) {

View File

@ -798,4 +798,8 @@
<string name="trae_intl_auto_completion_title">自动补全</string> <string name="trae_intl_auto_completion_title">自动补全</string>
<string name="trae_intl_quota_unit">次/月</string> <string name="trae_intl_quota_unit">次/月</string>
<string name="action_trae_recharge">充值 / 升级</string> <string name="action_trae_recharge">充值 / 升级</string>
<string name="trae_intl_plan_title">套餐</string>
<string name="trae_intl_basic_used_title">基础用量已用</string>
<string name="trae_intl_no_checkin_title">国际版没有每日签到</string>
<string name="trae_intl_no_checkin_desc">Trae 国际版按美元计费,使用月度请求额度,没有签到积分体系。</string>
</resources> </resources>

View File

@ -798,4 +798,8 @@
<string name="trae_intl_auto_completion_title">自動補全</string> <string name="trae_intl_auto_completion_title">自動補全</string>
<string name="trae_intl_quota_unit">次/月</string> <string name="trae_intl_quota_unit">次/月</string>
<string name="action_trae_recharge">儲值 / 升級</string> <string name="action_trae_recharge">儲值 / 升級</string>
<string name="trae_intl_plan_title">套餐</string>
<string name="trae_intl_basic_used_title">基礎用量已用</string>
<string name="trae_intl_no_checkin_title">國際版沒有每日簽到</string>
<string name="trae_intl_no_checkin_desc">Trae 國際版按美元計費,使用月度請求額度,沒有簽到積分體系。</string>
</resources> </resources>

View File

@ -803,4 +803,8 @@
<string name="trae_intl_auto_completion_title">Auto completion</string> <string name="trae_intl_auto_completion_title">Auto completion</string>
<string name="trae_intl_quota_unit">/mo</string> <string name="trae_intl_quota_unit">/mo</string>
<string name="action_trae_recharge">Upgrade / Top up</string> <string name="action_trae_recharge">Upgrade / Top up</string>
<string name="trae_intl_plan_title">Plan</string>
<string name="trae_intl_basic_used_title">Basic usage used</string>
<string name="trae_intl_no_checkin_title">International edition has no daily check-in</string>
<string name="trae_intl_no_checkin_desc">TRAE International uses USD billing with monthly request quotas instead of credit check-ins.</string>
</resources> </resources>