feat(ui): 统一应用主题色为天空蓝并优化渐变背景
将应用主色调从 '#BBF246' 更改为 '#87CEEB'(天空蓝),并更新所有相关组件和页面中的颜色引用。同时为多个页面添加统一的渐变背景,提升视觉效果和用户体验。新增压力分析模态框组件,并优化压力计组件的交互与显示逻辑。更新应用图标和启动图资源。
This commit is contained in:
@@ -1,20 +1,21 @@
|
||||
import { Colors } from '@/constants/Colors';
|
||||
import { useAuthGuard } from '@/hooks/useAuthGuard';
|
||||
import {
|
||||
BMI_CATEGORIES,
|
||||
canCalculateBMI,
|
||||
getBMIResult,
|
||||
type BMIResult
|
||||
BMI_CATEGORIES,
|
||||
canCalculateBMI,
|
||||
getBMIResult,
|
||||
type BMIResult
|
||||
} from '@/utils/bmi';
|
||||
import { Ionicons } from '@expo/vector-icons';
|
||||
import React, { useState } from 'react';
|
||||
import {
|
||||
Dimensions,
|
||||
Modal,
|
||||
Pressable,
|
||||
StyleSheet,
|
||||
Text,
|
||||
TouchableOpacity,
|
||||
View
|
||||
Dimensions,
|
||||
Modal,
|
||||
Pressable,
|
||||
StyleSheet,
|
||||
Text,
|
||||
TouchableOpacity,
|
||||
View
|
||||
} from 'react-native';
|
||||
import Toast from 'react-native-toast-message';
|
||||
|
||||
@@ -62,7 +63,7 @@ export function BMICard({ weight, height, style, compact = false }: BMICardProps
|
||||
if (!canCalculate) {
|
||||
// 缺少数据的情况
|
||||
return (
|
||||
<TouchableOpacity
|
||||
<TouchableOpacity
|
||||
style={[styles.incompleteContent, compact && styles.compactIncompleteContent]}
|
||||
onPress={handleShowInfoModal}
|
||||
activeOpacity={0.8}
|
||||
@@ -118,8 +119,8 @@ export function BMICard({ weight, height, style, compact = false }: BMICardProps
|
||||
|
||||
// 有完整数据的情况
|
||||
return (
|
||||
<TouchableOpacity
|
||||
style={[styles.completeContent, { backgroundColor: bmiResult?.backgroundColor }, compact && styles.compactCompleteContent]}
|
||||
<TouchableOpacity
|
||||
style={styles.completeContent}
|
||||
onPress={handleShowInfoModal}
|
||||
activeOpacity={0.8}
|
||||
>
|
||||
@@ -193,7 +194,7 @@ export function BMICard({ weight, height, style, compact = false }: BMICardProps
|
||||
style={styles.modalBackdrop}
|
||||
onPress={handleHideInfoModal}
|
||||
>
|
||||
<Pressable
|
||||
<Pressable
|
||||
style={styles.modalContainer}
|
||||
onPress={(e) => e.stopPropagation()}
|
||||
>
|
||||
@@ -234,7 +235,7 @@ export function BMICard({ weight, height, style, compact = false }: BMICardProps
|
||||
<View style={styles.categoriesGrid}>
|
||||
{BMI_CATEGORIES.map((category, index) => {
|
||||
const colors = index === 0 ? { bg: '#FEF3C7', text: '#B45309' } :
|
||||
index === 1 ? { bg: '#E8F5E8', text: '#2D5016' } :
|
||||
index === 1 ? { bg: '#E8F5E8', text: Colors.light.accentGreenDark } :
|
||||
index === 2 ? { bg: '#FEF3C7', text: '#B45309' } :
|
||||
{ bg: '#FEE2E2', text: '#B91C1C' };
|
||||
|
||||
@@ -289,6 +290,7 @@ const styles = StyleSheet.create({
|
||||
padding: 18,
|
||||
marginBottom: 16,
|
||||
overflow: 'hidden',
|
||||
backgroundColor: '#FFFFFF',
|
||||
},
|
||||
cardHeader: {
|
||||
flexDirection: 'row',
|
||||
@@ -320,7 +322,7 @@ const styles = StyleSheet.create({
|
||||
|
||||
// 缺少数据时的样式
|
||||
incompleteContent: {
|
||||
minHeight: 120,
|
||||
minHeight: 80,
|
||||
backgroundColor: '#FFFFFF',
|
||||
borderRadius: 22,
|
||||
padding: 18,
|
||||
@@ -345,7 +347,7 @@ const styles = StyleSheet.create({
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
backgroundColor: '#F3F4F6',
|
||||
backgroundColor: '#ffffff',
|
||||
borderRadius: 12,
|
||||
paddingVertical: 12,
|
||||
paddingHorizontal: 16,
|
||||
@@ -359,7 +361,7 @@ const styles = StyleSheet.create({
|
||||
|
||||
// 有完整数据时的样式
|
||||
completeContent: {
|
||||
minHeight: 120,
|
||||
minHeight: 80,
|
||||
borderRadius: 22,
|
||||
padding: 18,
|
||||
margin: -18,
|
||||
@@ -398,12 +400,12 @@ const styles = StyleSheet.create({
|
||||
|
||||
// 紧凑模式样式
|
||||
compactIncompleteContent: {
|
||||
minHeight: 110,
|
||||
minHeight: 80,
|
||||
padding: 14,
|
||||
margin: -14,
|
||||
},
|
||||
compactCompleteContent: {
|
||||
minHeight: 110,
|
||||
minHeight: 80,
|
||||
padding: 14,
|
||||
margin: -14,
|
||||
},
|
||||
@@ -427,7 +429,7 @@ const styles = StyleSheet.create({
|
||||
flex: 1,
|
||||
},
|
||||
compactBMIValue: {
|
||||
fontSize: 28,
|
||||
fontSize: 24,
|
||||
fontWeight: '800',
|
||||
marginBottom: 4,
|
||||
},
|
||||
@@ -491,13 +493,13 @@ const styles = StyleSheet.create({
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
},
|
||||
|
||||
|
||||
// 内容区域样式
|
||||
modalContent: {
|
||||
paddingHorizontal: 20,
|
||||
paddingBottom: 24,
|
||||
},
|
||||
|
||||
|
||||
// 介绍部分
|
||||
introSection: {
|
||||
marginBottom: 20,
|
||||
@@ -522,7 +524,7 @@ const styles = StyleSheet.create({
|
||||
fontWeight: '600',
|
||||
textAlign: 'center',
|
||||
},
|
||||
|
||||
|
||||
// 分类部分
|
||||
categoriesSection: {
|
||||
marginBottom: 18,
|
||||
@@ -567,7 +569,7 @@ const styles = StyleSheet.create({
|
||||
fontWeight: '500',
|
||||
opacity: 0.9,
|
||||
},
|
||||
|
||||
|
||||
// 健康提示
|
||||
healthTips: {
|
||||
backgroundColor: '#F9FAFB',
|
||||
@@ -593,7 +595,7 @@ const styles = StyleSheet.create({
|
||||
color: '#374151',
|
||||
lineHeight: 18,
|
||||
},
|
||||
|
||||
|
||||
// 免责声明紧凑版
|
||||
disclaimerCompact: {
|
||||
flexDirection: 'row',
|
||||
|
||||
Reference in New Issue
Block a user