feat(ui): 调整个人中心和会员购买界面布局

- 将推送通知设置移至开发者选项section
- 移除会员购买按钮的协议接受状态限制
- 优化购买按钮的禁用条件逻辑
This commit is contained in:
richarjiang
2025-10-28 11:16:32 +08:00
parent 71a8bb9740
commit eaa7f7275c
2 changed files with 12 additions and 12 deletions

View File

@@ -347,12 +347,7 @@ export default function PersonalScreen() {
type: 'switch' as const, type: 'switch' as const,
switchValue: notificationEnabled, switchValue: notificationEnabled,
onSwitchChange: handleNotificationToggle, onSwitchChange: handleNotificationToggle,
}, }
{
icon: 'settings-outline' as const,
title: '推送通知设置',
onPress: () => pushIfAuthedElseLogin('/push-notification-settings'),
},
], ],
}, },
// 开发者section需要连续点击三次用户名激活 // 开发者section需要连续点击三次用户名激活
@@ -364,6 +359,11 @@ export default function PersonalScreen() {
title: '开发者选项', title: '开发者选项',
onPress: () => pushIfAuthedElseLogin(ROUTES.DEVELOPER), onPress: () => pushIfAuthedElseLogin(ROUTES.DEVELOPER),
}, },
{
icon: 'settings-outline' as const,
title: '推送通知设置',
onPress: () => pushIfAuthedElseLogin('/push-notification-settings'),
},
], ],
}] : []), }] : []),
{ {

View File

@@ -1082,7 +1082,7 @@ export function MembershipModal({ visible, onClose, onPurchaseSuccess }: Members
<GlassView <GlassView
style={[ style={[
styles.purchaseButton, styles.purchaseButton,
(loading || products.length === 0 || !agreementAccepted) && styles.disabledButton (loading || products.length === 0) && styles.disabledButton
]} ]}
glassEffectStyle="clear" glassEffectStyle="clear"
tintColor="rgba(21, 21, 21, 0.8)" tintColor="rgba(21, 21, 21, 0.8)"
@@ -1090,7 +1090,7 @@ export function MembershipModal({ visible, onClose, onPurchaseSuccess }: Members
> >
<TouchableOpacity <TouchableOpacity
onPress={handlePurchase} onPress={handlePurchase}
disabled={loading || products.length === 0 || !agreementAccepted} disabled={loading || products.length === 0}
accessible={true} accessible={true}
accessibilityLabel={loading ? '正在处理购买' : '购买会员'} accessibilityLabel={loading ? '正在处理购买' : '购买会员'}
accessibilityHint={ accessibilityHint={
@@ -1102,7 +1102,7 @@ export function MembershipModal({ visible, onClose, onPurchaseSuccess }: Members
? '请选择会员套餐后再进行购买' ? '请选择会员套餐后再进行购买'
: `点击购买${selectedProduct.title || '已选'}会员套餐` : `点击购买${selectedProduct.title || '已选'}会员套餐`
} }
accessibilityState={{ disabled: loading || products.length === 0 || !agreementAccepted }} accessibilityState={{ disabled: loading || products.length === 0 }}
style={styles.purchaseButtonContent} style={styles.purchaseButtonContent}
> >
{loading ? ( {loading ? (
@@ -1120,12 +1120,12 @@ export function MembershipModal({ visible, onClose, onPurchaseSuccess }: Members
style={[ style={[
styles.purchaseButton, styles.purchaseButton,
styles.fallbackPurchaseButton, styles.fallbackPurchaseButton,
(loading || products.length === 0 || !agreementAccepted) && styles.disabledButton (loading || products.length === 0) && styles.disabledButton
]} ]}
> >
<TouchableOpacity <TouchableOpacity
onPress={handlePurchase} onPress={handlePurchase}
disabled={loading || products.length === 0 || !agreementAccepted} disabled={loading || products.length === 0}
accessible={true} accessible={true}
accessibilityLabel={loading ? '正在处理购买' : '购买会员'} accessibilityLabel={loading ? '正在处理购买' : '购买会员'}
accessibilityHint={ accessibilityHint={
@@ -1137,7 +1137,7 @@ export function MembershipModal({ visible, onClose, onPurchaseSuccess }: Members
? '请选择会员套餐后再进行购买' ? '请选择会员套餐后再进行购买'
: `点击购买${selectedProduct.title || '已选'}会员套餐` : `点击购买${selectedProduct.title || '已选'}会员套餐`
} }
accessibilityState={{ disabled: loading || products.length === 0 || !agreementAccepted }} accessibilityState={{ disabled: loading || products.length === 0 }}
style={styles.purchaseButtonContent} style={styles.purchaseButtonContent}
> >
{loading ? ( {loading ? (