update pay function

This commit is contained in:
2025-11-20 08:02:34 +08:00
parent 27cdf0aecd
commit d5a55c4e02
2 changed files with 10 additions and 7 deletions

4
app.py
View File

@@ -579,7 +579,7 @@ class User(UserMixin, db.Model):
'billing_cycle': subscription.billing_cycle, 'billing_cycle': subscription.billing_cycle,
'start_date': subscription.start_date.isoformat() if subscription.start_date else None, 'start_date': subscription.start_date.isoformat() if subscription.start_date else None,
'end_date': subscription.end_date.isoformat() if subscription.end_date else None, 'end_date': subscription.end_date.isoformat() if subscription.end_date else None,
'auto_renew': subscription.auto_renew 'auto_renewal': subscription.auto_renewal
}) })
else: else:
# 无订阅时使用默认值 # 无订阅时使用默认值
@@ -589,7 +589,7 @@ class User(UserMixin, db.Model):
'billing_cycle': None, 'billing_cycle': None,
'start_date': None, 'start_date': None,
'end_date': None, 'end_date': None,
'auto_renew': False 'auto_renewal': False
}) })
# 敏感信息只在需要时包含 # 敏感信息只在需要时包含

View File

@@ -634,11 +634,14 @@ export default function SubscriptionContentNew() {
<Text color="white" fontSize="lg" fontWeight="bold"> <Text color="white" fontSize="lg" fontWeight="bold">
: {user.subscription_type === 'max' ? 'Max 旗舰版' : 'Pro 专业版'} : {user.subscription_type === 'max' ? 'Max 旗舰版' : 'Pro 专业版'}
</Text> </Text>
{user.billing_cycle && (
<Text color="rgba(255, 255, 255, 0.6)" fontSize="xs"> <Text color="rgba(255, 255, 255, 0.6)" fontSize="xs">
{user.billing_cycle === 'monthly' ? '月付' : {user.billing_cycle === 'monthly' ? '月付' :
user.billing_cycle === 'quarterly' ? '季付' : user.billing_cycle === 'quarterly' ? '季付' :
user.billing_cycle === 'semiannual' ? '半年付' : '年付'} user.billing_cycle === 'semiannual' ? '半年付' :
user.billing_cycle === 'yearly' ? '年付' : user.billing_cycle}
</Text> </Text>
)}
</VStack> </VStack>
</HStack> </HStack>
<Badge <Badge