fix(trae): 详情页主余额改为 Free plan 月配额展示
- 详情页顶部「当前余额」在 INTL 美元计费时显示套餐名 + 月配额明细,不再显示 0 Credits - 设备已实测:Free plan / 10次/月 / 50次/月 / 1000次/月 / 5000次/月
This commit is contained in:
parent
8e22d1ab9f
commit
6dfb9ecb71
@ -16,8 +16,8 @@ android {
|
||||
applicationId = "com.rainy.token"
|
||||
minSdk = 31
|
||||
targetSdk = 35
|
||||
versionCode = 38
|
||||
versionName = "1.7.18"
|
||||
versionCode = 39
|
||||
versionName = "1.7.19"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
vectorDrawables {
|
||||
|
||||
@ -1094,6 +1094,42 @@ private fun MainBalanceCard(state: State, service: ServiceType) {
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun TraeIntlBigNumber(extras: Map<String, String>) {
|
||||
val planName = extras["intl.plan_name"] ?: "Free plan"
|
||||
Text(
|
||||
text = planName,
|
||||
style = MaterialTheme.typography.displayLarge,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = MaterialTheme.colorScheme.onSurface
|
||||
)
|
||||
Spacer(modifier = Modifier.width(6.dp))
|
||||
Text(
|
||||
text = stringResource(R.string.trae_intl_monthly_quota),
|
||||
style = MaterialTheme.typography.titleLarge,
|
||||
color = inkMuted(),
|
||||
modifier = Modifier.padding(bottom = 8.dp)
|
||||
)
|
||||
Spacer(modifier = Modifier.height(6.dp))
|
||||
val quotaUnit = stringResource(R.string.trae_intl_quota_unit)
|
||||
InfoRow(
|
||||
label = stringResource(R.string.trae_intl_premium_fast_title),
|
||||
value = (extras["intl.premium_fast_limit"] ?: "—") + " $quotaUnit"
|
||||
)
|
||||
InfoRow(
|
||||
label = stringResource(R.string.trae_intl_premium_slow_title),
|
||||
value = (extras["intl.premium_slow_limit"] ?: "—") + " $quotaUnit"
|
||||
)
|
||||
InfoRow(
|
||||
label = stringResource(R.string.trae_intl_advanced_title),
|
||||
value = (extras["intl.advanced_limit"] ?: "—") + " $quotaUnit"
|
||||
)
|
||||
InfoRow(
|
||||
label = stringResource(R.string.trae_intl_auto_completion_title),
|
||||
value = (extras["intl.auto_completion_limit"] ?: "—") + " $quotaUnit"
|
||||
)
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun BalanceBigNumber(balance: ServiceBalance?, service: ServiceType) {
|
||||
if (balance == null) {
|
||||
@ -1104,6 +1140,9 @@ private fun BalanceBigNumber(balance: ServiceBalance?, service: ServiceType) {
|
||||
)
|
||||
return
|
||||
}
|
||||
if (service == ServiceType.TRAE && balance.extras?.get("billing_mode") == "dollar") {
|
||||
TraeIntlBigNumber(balance.extras)
|
||||
} else {
|
||||
Row(verticalAlignment = Alignment.Bottom) {
|
||||
Text(
|
||||
text = formatAmount(balance.amount),
|
||||
@ -1119,6 +1158,7 @@ private fun BalanceBigNumber(balance: ServiceBalance?, service: ServiceType) {
|
||||
modifier = Modifier.padding(bottom = 8.dp)
|
||||
)
|
||||
}
|
||||
}
|
||||
if (!balance.isAvailable) {
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
Text(
|
||||
|
||||
@ -802,4 +802,5 @@
|
||||
<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>
|
||||
<string name="trae_intl_monthly_quota">月配额</string>
|
||||
</resources>
|
||||
@ -802,4 +802,5 @@
|
||||
<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>
|
||||
<string name="trae_intl_monthly_quota">月額度</string>
|
||||
</resources>
|
||||
@ -807,4 +807,5 @@
|
||||
<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>
|
||||
<string name="trae_intl_monthly_quota">Monthly quota</string>
|
||||
</resources>
|
||||
Loading…
Reference in New Issue
Block a user