diff --git a/assets/langs/en_US.json b/assets/langs/en_US.json index ecbb97b..e79235b 100644 --- a/assets/langs/en_US.json +++ b/assets/langs/en_US.json @@ -74,7 +74,7 @@ "绑定全部": "Bind all", "主设备": "Primary device:", "从设备": "Secondary device:", - "确定": "Confirm", + "确定": "OK", "取消": "Cancel", "无法绑定": "Cannot bind!", "无法绑定1": "Detected that this device", @@ -362,6 +362,7 @@ "删除": "Delete", "校准未完成提示": "Calibration incomplete, confirm exit?", "确定": "Confirm", + "取消": "Cancel", "查看": "View", "报修成功标题": "Repair request submitted", "报修成功": "Repair request successful!", @@ -427,12 +428,12 @@ "周五": "Fri", "周六": "Sat", "周日": "Sun", - "无报告": "none", + "无报告": "None", "姓名": "Name", "年龄": "Age", "设备ID": "Device ID", "体重": "Weight", - "分": "", + "分": "Points", "位置权限说明": "Location Permission Description", "获得位置信息,连接附近的蓝牙设备与推荐附近门店": "Obtain location information, connect to nearby Bluetooth devices, and recommend nearby stores", "蓝牙权限说明": "Bluetooth Permission Description", @@ -454,5 +455,52 @@ "是否确认注销?": "Are you sure you want to delete your account?", "注销账号成功": "Account deletion successful", "注销账号失败": "Account deletion failed", - "已知晓,确定注销": "Understood, confirm deletion" + "已知晓,确定注销": "Understood, confirm deletion", + "最低分": "Min", + "本周平均分": "Weekly Avg", + "最高分": "Max", + "心率数据": "Heart Rate Data", + "心率变异性(HRV)": "Heart Rate Variability (HRV)", + "测量值": "Value", + "趋势": "Trend", + "参考范围": "Range", + "与昨日对比分析": "Comparison with Yesterday", + "基于时间维度的横向比较分析方法,通过将当前(今日)的数据、状态、行为等与前一日(昨日)的同类信息进行对照,识别差异、趋势或变化规律,查看用户短期时间序列的动态变化。": "A time-based horizontal comparison method that contrasts current (today's) data, status, and behaviors with those of the previous day (yesterday) to identify differences, trends, or patterns, enabling observation of short-term dynamic changes in the user's time series.", + "心电散点图是用非线性的图形方法描记的连续心冲击图的RR间期图,因图形由散点组成,又称散点图。": "The electrocardiogram scatter plot is a nonlinear graphical representation of continuous heartbeats showing RR intervals. Since the plot consists of scattered points, it is also called a scatter plot.", + "心率数据是指用户在睡眠过程中基本心率数据,可初步判断睡眠中的心血管负荷及自主神经功能状态,为睡眠健康评估提供重要依据。": "Heart rate data refers to the basic heart rate measurements collected during a user's sleep. It helps preliminarily assess cardiovascular load and autonomic nervous system function during sleep, providing important insights for sleep health evaluation.", + "正常范围": "Normal Range", + "心率变异性(HRV)是指心脏每次跳动间隔时间的差异程度,反映自主神经系统(交感神经和副交感神经)对心脏的调节能力,是评估心血管健康和压力状态的重要指标。": "Heart Rate Variability (HRV) refers to the variation in time intervals between heartbeats. It reflects the autonomic nervous system’s (sympathetic and parasympathetic) regulation of the heart and is an important indicator for assessing cardiovascular health and stress levels.", + "呼吸数据是指用户在睡眠过程中呼吸的基本数据,是评估睡眠呼吸质量、筛查睡眠呼吸障碍的核心指标。": "Respiratory data refers to the user's basic breathing information during sleep. It is a key indicator for evaluating sleep breathing quality and screening for sleep-related breathing disorders.", + "打鼾监测是指用户在睡眠过程中打鼾频次的图表说明。": "Snoring monitoring refers to the charted analysis of snoring frequency during the user's sleep.", + "呼吸暂停监测是指用户在睡眠过程中产生的呼吸暂停的图表说明。": "Apnea monitoring refers to the charted analysis of breathing pauses during the user's sleep.", + "心率健康评估主要通过用户睡眠报告中的时间点、体征数据及HRV数据等信息,来判断其心理健康水平、疲劳程度。": "Mental health assessment is based on sleep report data such as timestamps, vital signs, and HRV to evaluate the user's psychological well-being and fatigue level.", + "慢性病风险指数是通过整合个体的生理指标、生活方式等多维度数据,构建的量化评估模型,用于预测用户未来患慢性非传染性疾病(如高血压、糖尿病、冠心病、癌症等)的风险概率。": "The Chronic Disease Risk Index is a quantitative model that integrates physiological indicators and lifestyle factors to estimate the likelihood of developing chronic non-communicable diseases such as hypertension, diabetes, coronary heart disease, and cancer.", + "自主神经平衡指数 是评估人体自主神经系统(ANS)功能状态的重要指标,主要反映交感神经和副交感神经的活性平衡关系。": "The Autonomic Nervous System Balance Index is an important metric for assessing ANS function, reflecting the balance between sympathetic and parasympathetic nervous activity.", + "皮肤指数通过用户睡眠过程中的体征数据,计算皮肤电反应,生成综合评估指标,用于睡眠中的生理应激状态或自主神经活动。": "The Skin Index is a composite metric derived from physiological data during sleep by measuring skin conductance. It evaluates physiological stress and autonomic nervous activity during sleep.", + "睡眠规律性是指个体睡眠模式在时间、时长、环境等方面呈现出的稳定性和一致性,是衡量睡眠质量的重要指标之一。": "Sleep regularity reflects how consistent your sleep time, duration, and habits are — a key factor in overall sleep quality.", + "本周": "Week", + "上周": "L.Week", + "范围": "Range", + "本月": "Month", + "上月": "L.Month", + "与上月对比": "VS Last Month", + "每日得分": "Day Score", + "本周睡眠时长": "Weekly Sleep", + "用户本周睡眠分数的汇总": "Weekly Sleep Score Summary", + "用户本月睡眠分数的汇总": "Monthly Sleep Score Summary", + "与上周对比": "VS Last Week", + "本月平均分": "Monthly Avg", + "选择月份": "Select Month", + "选择身高": "Select Height", + "选择体重": "Select Weight", + "本周睡眠时长是指从周一到周日内,每天实际睡眠的时间总和。": "Weekly sleep duration refers to the total actual sleep time from Monday to Sunday.", + "次/分": "times/min", + "毫秒": "ms", + "起床时间:": "Wake Up:", + "入睡时间:": "Sleep Time", + "睡眠分数与上月分数进行对比,是通过量化分析近期睡眠质量变化,可了解自身睡眠状态的波动情况,进而调整用户的作息习惯。": "The sleep score is compared with last month’s score to analyze recent changes in sleep quality, helping you understand fluctuations and adjust your routine accordingly.", + "睡眠分数与上周分数进行对比,是通过量化分析近期睡眠质量变化,可了解自身睡眠状态的波动情况,进而调整用户的作息习惯。": "The sleep score is compared with last week's score to analyze changes in sleep quality, helping you understand fluctuations and adjust your routine.", + "本月睡眠时长": "Monthly Sleep Duration", + "知道了": "Back", + "本月睡眠时长是指从月初到月末,用户每天实际睡眠的时间总和": "The monthly sleep duration refers to the total actual sleep time of the user from the beginning to the end of the month.", "选择生日": "Select Birthday" } \ No newline at end of file diff --git a/assets/langs/zh_CN.json b/assets/langs/zh_CN.json index d09130e..85f4950 100644 --- a/assets/langs/zh_CN.json +++ b/assets/langs/zh_CN.json @@ -467,5 +467,53 @@ "是否确认注销?": "是否确认注销?", "注销账号成功": "注销账号成功", "注销账号失败": "注销账号失败", - "已知晓,确定注销": "已知晓,确定注销" + "已知晓,确定注销": "已知晓,确定注销", + "最低分": "最低分", + "本周平均分": "本周平均分", + "最高分": "最高分", + "与昨日对比分析": "与昨日对比分析", + "心率数据": "心率数据", + "心率变异性(HRV)": "心率变异性(HRV)", + "测量值": "测量值", + "趋势": "趋势", + "参考范围": "参考范围", + "睡眠规律性是指个体睡眠模式在时间、时长、环境等方面呈现出的稳定性和一致性,是衡量睡眠质量的重要指标之一。": "睡眠规律性是指个体睡眠模式在时间、时长、环境等方面呈现出的稳定性和一致性,是衡量睡眠质量的重要指标之一。", + "当前属于": "当前属于", + "基于时间维度的横向比较分析方法,通过将当前(今日)的数据、状态、行为等与前一日(昨日)的同类信息进行对照,识别差异、趋势或变化规律,查看用户短期时间序列的动态变化。": "基于时间维度的横向比较分析方法,通过将当前(今日)的数据、状态、行为等与前一日(昨日)的同类信息进行对照,识别差异、趋势或变化规律,查看用户短期时间序列的动态变化。", + "心电散点图是用非线性的图形方法描记的连续心冲击图的RR间期图,因图形由散点组成,又称散点图。": "心电散点图是用非线性的图形方法描记的连续心冲击图的RR间期图,因图形由散点组成,又称散点图。", + "心率数据是指用户在睡眠过程中基本心率数据,可初步判断睡眠中的心血管负荷及自主神经功能状态,为睡眠健康评估提供重要依据。": "心率数据是指用户在睡眠过程中基本心率数据,可初步判断睡眠中的心血管负荷及自主神经功能状态,为睡眠健康评估提供重要依据。", + "正常范围": "正常范围", + "心率变异性(HRV)是指心脏每次跳动间隔时间的差异程度,反映自主神经系统(交感神经和副交感神经)对心脏的调节能力,是评估心血管健康和压力状态的重要指标。": "心率变异性(HRV)是指心脏每次跳动间隔时间的差异程度,反映自主神经系统(交感神经和副交感神经)对心脏的调节能力,是评估心血管健康和压力状态的重要指标。", + "呼吸数据是指用户在睡眠过程中呼吸的基本数据,是评估睡眠呼吸质量、筛查睡眠呼吸障碍的核心指标。": "呼吸数据是指用户在睡眠过程中呼吸的基本数据,是评估睡眠呼吸质量、筛查睡眠呼吸障碍的核心指标。", + "打鼾监测是指用户在睡眠过程中打鼾频次的图表说明。": "打鼾监测是指用户在睡眠过程中打鼾频次的图表说明。", + "呼吸暂停监测是指用户在睡眠过程中产生的呼吸暂停的图表说明。": "呼吸暂停监测是指用户在睡眠过程中产生的呼吸暂停的图表说明。", + "心率健康评估主要通过用户睡眠报告中的时间点、体征数据及HRV数据等信息,来判断其心理健康水平、疲劳程度。": "心率健康评估主要通过用户睡眠报告中的时间点、体征数据及HRV数据等信息,来判断其心理健康水平、疲劳程度。", + "慢性病风险指数是通过整合个体的生理指标、生活方式等多维度数据,构建的量化评估模型,用于预测用户未来患慢性非传染性疾病(如高血压、糖尿病、冠心病、癌症等)的风险概率。": "慢性病风险指数是通过整合个体的生理指标、生活方式等多维度数据,构建的量化评估模型,用于预测用户未来患慢性非传染性疾病(如高血压、糖尿病、冠心病、癌症等)的风险概率。", + "自主神经平衡指数 是评估人体自主神经系统(ANS)功能状态的重要指标,主要反映交感神经和副交感神经的活性平衡关系。": "自主神经平衡指数 是评估人体自主神经系统(ANS)功能状态的重要指标,主要反映交感神经和副交感神经的活性平衡关系。", + "皮肤指数通过用户睡眠过程中的体征数据,计算皮肤电反应,生成综合评估指标,用于睡眠中的生理应激状态或自主神经活动。": "皮肤指数通过用户睡眠过程中的体征数据,计算皮肤电反应,生成综合评估指标,用于睡眠中的生理应激状态或自主神经活动。", + "本周": "本周", + "上周": "上周", + "范围": "范围", + "本月": "本月", + "上月": "上月", + "与上月对比": "与上月对比", + "每日得分": "每日得分", + "本周睡眠时长": "本周睡眠时长", + "用户本周睡眠分数的汇总": "用户本周睡眠分数的汇总", + "用户本月睡眠分数的汇总": "用户本月睡眠分数的汇总", + "与上周对比": "与上周对比", + "本月平均分": "本月平均分", + "选择月份": "选择月份", + "选择身高": "选择身高", + "选择体重": "选择体重", + "本周睡眠时长是指从周一到周日内,每天实际睡眠的时间总和。": "本周睡眠时长是指从周一到周日内,每天实际睡眠的时间总和。", + "起床时间:": "起床时间:", + "入睡时间:": "入睡时间:", + "次/分": "次/分", + "毫秒": "毫秒", + "睡眠分数与上月分数进行对比,是通过量化分析近期睡眠质量变化,可了解自身睡眠状态的波动情况,进而调整用户的作息习惯。": "睡眠分数与上月分数进行对比,是通过量化分析近期睡眠质量变化,可了解自身睡眠状态的波动情况,进而调整用户的作息习惯。", + "睡眠分数与上周分数进行对比,是通过量化分析近期睡眠质量变化,可了解自身睡眠状态的波动情况,进而调整用户的作息习惯。": "睡眠分数与上周分数进行对比,是通过量化分析近期睡眠质量变化,可了解自身睡眠状态的波动情况,进而调整用户的作息习惯。", + "本月睡眠时长": "本月睡眠时长", + "知道了": "返回", + "本月睡眠时长是指从月初到月末,用户每天实际睡眠的时间总和": "本月睡眠时长是指从月初到月末,用户每天实际睡眠的时间总和", "选择生日": "选择生日" } \ No newline at end of file diff --git a/assets/langs/zh_TW.json b/assets/langs/zh_TW.json index bd7059e..663512a 100644 --- a/assets/langs/zh_TW.json +++ b/assets/langs/zh_TW.json @@ -453,5 +453,52 @@ "是否确认注销?": "是否確認註銷?", "注销账号成功": "註銷帳號成功", "注销账号失败": "註銷帳號失敗", - "已知晓,确定注销": "已知曉,確定註銷" + "已知晓,确定注销": "已知曉,確定註銷", + "最低分": "最低分", + "本周平均分": "本週平均分", + "最高分": "最高分", + "与昨日对比分析": "與昨日對比分析", + "心率数据": "心率數據", + "心率变异性(HRV)": "心率變異性(HRV)", + "测量值": "測量值", + "趋势": "趨勢", + "参考范围": "參考範圍", + "心电散点图是用非线性的图形方法描记的连续心冲击图的RR间期图,因图形由散点组成,又称散点图。": "心電散點圖是用非線性的圖形方法描記的連續心衝擊圖的RR間期圖,因圖形由散點組成,又稱散點圖。", + "心率数据是指用户在睡眠过程中基本心率数据,可初步判断睡眠中的心血管负荷及自主神经功能状态,为睡眠健康评估提供重要依据。": "心率數據是指用戶在睡眠過程中基本心率數據,可初步判斷睡眠中的心血管負荷及自主神經功能狀態,為睡眠健康評估提供重要依據。", + "正常范围": "Normal Range", + "心率变异性(HRV)是指心脏每次跳动间隔时间的差异程度,反映自主神经系统(交感神经和副交感神经)对心脏的调节能力,是评估心血管健康和压力状态的重要指标。": "心率變異性(HRV)是指心臟每次跳動間隔時間的差異程度,反映自主神經系統(交感神經和副交感神經)對心臟的調節能力,是評估心血管健康和壓力狀態的重要指標。", + "呼吸数据是指用户在睡眠过程中呼吸的基本数据,是评估睡眠呼吸质量、筛查睡眠呼吸障碍的核心指标。": "呼吸數據是指用戶在睡眠過程中呼吸的基本數據,是評估睡眠呼吸質量、篩查睡眠呼吸障礙的核心指標。", + "打鼾监测是指用户在睡眠过程中打鼾频次的图表说明。": "打鼾監測是指用戶在睡眠過程中打鼾頻次的圖表說明。", + "呼吸暂停监测是指用户在睡眠过程中产生的呼吸暂停的图表说明。": "呼吸暫停監測是指用戶在睡眠過程中產生的呼吸暫停的圖表說明。", + "心率健康评估主要通过用户睡眠报告中的时间点、体征数据及HRV数据等信息,来判断其心理健康水平、疲劳程度。": "心率健康評估主要通過用戶睡眠報告中的時間點、體徵數據及HRV數據等信息,來判斷其心理健康水平、疲勞程度。", + "慢性病风险指数是通过整合个体的生理指标、生活方式等多维度数据,构建的量化评估模型,用于预测用户未来患慢性非传染性疾病(如高血压、糖尿病、冠心病、癌症等)的风险概率。": "慢性病風險指數是透過整合個體的生理指標、生活方式等多維度資料,構建的量化評估模型,用於預測用戶未來患慢性非傳染性疾病(如高血壓、糖尿病、冠心病、癌症等)的風險機率。", + "自主神经平衡指数 是评估人体自主神经系统(ANS)功能状态的重要指标,主要反映交感神经和副交感神经的活性平衡关系。": "自主神經平衡指數 是評估人體自主神經系統(ANS)功能狀態的重要指標,主要反映交感神經和副交感神經的活性平衡關係。", + "皮肤指数通过用户睡眠过程中的体征数据,计算皮肤电反应,生成综合评估指标,用于睡眠中的生理应激状态或自主神经活动。": "皮膚指數透過用戶睡眠過程中的體徵資料,計算皮膚電反應,生成綜合評估指標,用於睡眠中的生理應激狀態或自主神經活動。", + "睡眠规律性是指个体睡眠模式在时间、时长、环境等方面呈现出的稳定性和一致性,是衡量睡眠质量的重要指标之一。": "睡眠規律性是指個體睡眠模式在時間、時長、環境等方面呈現出的穩定性和一致性,是衡量睡眠質量的重要指標之一。", + "本周": "本週", + "上周": "上週", + "范围": "範圍", + "本月": "本月", + "上月": "上月", + "与上月对比": "與上月對比", + "每日得分": "每日得分", + "本周睡眠时长": "本週睡眠時長", + "用户本周睡眠分数的汇总": "用戶本週睡眠分數的匯總", + "用户本月睡眠分数的汇总": "用戶本月睡眠分數的匯總", + "与上周对比": "與上週對比", + "本月平均分": "本月平均分", + "选择月份": "選擇月份", + "选择身高": "選擇身高", + "选择体重": "選擇體重", + "本周睡眠时长是指从周一到周日内,每天实际睡眠的时间总和。": "本週睡眠時長是指從週一到週日內,每天實際睡眠的時間總和。", + "起床时间:": "起床時間:", + "入睡时间:": "入睡時間:", + "次/分": "次/分", + "毫秒": "毫秒", + "睡眠分数与上月分数进行对比,是通过量化分析近期睡眠质量变化,可了解自身睡眠状态的波动情况,进而调整用户的作息习惯。": "睡眠分數與上月分數進行對比,是通過量化分析近期睡眠質量變化,可了解自身睡眠狀態的波動情況,進而調整用戶的作息習慣。", + "睡眠分数与上周分数进行对比,是通过量化分析近期睡眠质量变化,可了解自身睡眠状态的波动情况,进而调整用户的作息习惯。": "睡眠分數與上週分數進行對比,是通過量化分析近期睡眠質量變化,可了解自身睡眠狀態的波動情況,進而調整用戶的作息習慣。", + "本月睡眠时长": "本月睡眠時長", + "知道了": "返回", + "本月睡眠时长是指从月初到月末,用户每天实际睡眠的时间总和": "本月睡眠時長是指從月初到月末,用戶每天實際睡眠的時間總和", + "选择生日": "選擇生日" } \ No newline at end of file diff --git a/lib/pages/common/selectDialog.dart b/lib/pages/common/selectDialog.dart index 70873bf..94a4cb1 100644 --- a/lib/pages/common/selectDialog.dart +++ b/lib/pages/common/selectDialog.dart @@ -753,141 +753,6 @@ Future showHeightPickerDialog( ); } -// Future showDayTimeSelectionDialog(BuildContext context, -// {required List dayTimeArr, Function? checkChange, String title = ""}) { -// ThemeController themeController = Get.find(); - -// final hours = List.generate(24, (i) => i); -// final minutes = List.generate(60, (i) => i); - -// final RxInt hoursIndex = RxInt(hours.indexOf(dayTimeArr[0])); -// final RxInt minutesIndex = RxInt(minutes.indexOf(dayTimeArr[1])); - -// return showDialog( -// context: context, -// barrierDismissible: true, -// builder: (BuildContext context) { -// return Stack( -// children: [ -// Positioned( -// bottom: 0, -// left: 0, -// right: 0, -// child: Material( -// color: Colors.transparent, -// child: Dialog( -// backgroundColor: stringToColor("#182B7C"), -// insetPadding: EdgeInsets.zero, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0), -// ), -// child: Container( -// width: double.infinity, -// padding: EdgeInsets.fromLTRB(30.rpx, 10.rpx, 30.rpx, 90.rpx), -// child: Column( -// mainAxisSize: MainAxisSize.min, -// crossAxisAlignment: CrossAxisAlignment.center, -// children: [ -// Row( -// mainAxisAlignment: MainAxisAlignment.spaceBetween, -// children: [ -// Text( -// title, -// style: FlutterFlowTheme.of(context) -// .bodyMedium -// .override( -// fontFamily: 'Readex Pro', -// color: themeController.currentColor.sc3, -// fontSize: 30.rpx, -// ), -// ), -// closeIconWhite, -// ], -// ), -// Container( -// height: 240.rpx, -// margin: EdgeInsets.only(top: 60.rpx, bottom: 60.rpx), -// padding: EdgeInsets.only(left: 30.rpx, right: 30.rpx), -// child: Row( -// children: [ -// Expanded( -// child: Padding( -// padding: -// EdgeInsets.symmetric(horizontal: 10.rpx), -// child: getOnePickers(context, hours, hoursIndex, -// unit: ''), -// ), -// ), -// Text( -// "时", -// style: FlutterFlowTheme.of(context) -// .bodyMedium -// .override( -// fontFamily: 'Readex Pro', -// color: themeController.currentColor.sc3, -// fontSize: 30.rpx, -// ), -// ), -// Expanded( -// child: Padding( -// padding: -// EdgeInsets.symmetric(horizontal: 10.rpx), -// child: getOnePickers( -// context, minutes, minutesIndex, -// unit: ''), -// ), -// ), -// Text( -// "分", -// style: FlutterFlowTheme.of(context) -// .bodyMedium -// .override( -// fontFamily: 'Readex Pro', -// color: themeController.currentColor.sc3, -// fontSize: 30.rpx, -// ), -// ), -// ], -// ), -// ), -// InkWell( -// onTap: () { -// checkChange?.call([ -// hours[hoursIndex.value], -// minutes[minutesIndex.value] -// ]); -// Get.back(); -// }, -// child: Container( -// height: 68.rpx, -// alignment: Alignment.center, -// decoration: BoxDecoration( -// color: stringToColor("#D3B684"), -// borderRadius: BorderRadius.circular(10.rpx), -// ), -// child: Text( -// "确定", -// style: FlutterFlowTheme.of(context) -// .bodyMedium -// .override( -// fontFamily: 'Readex Pro', -// color: themeController.currentColor.sc3, -// fontSize: 30.rpx, -// ), -// ), -// ), -// ) -// ], -// ), -// ), -// ), -// ), -// ), -// ], -// ); -// }, -// ); -// } Future showDayTimeSelectionDialog( BuildContext context, { diff --git a/lib/pages/main_bottom/mine_page.dart b/lib/pages/main_bottom/mine_page.dart index f57eec7..4e00454 100644 --- a/lib/pages/main_bottom/mine_page.dart +++ b/lib/pages/main_bottom/mine_page.dart @@ -82,8 +82,6 @@ class _MinePageState extends State { mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.end, children: [ - - ClickableContainer( backgroundColor: Colors.transparent, // 容器背景色 @@ -107,7 +105,7 @@ class _MinePageState extends State { }, child: Padding( padding: EdgeInsetsDirectional.fromSTEB( - 0.rpx, 0.rpx, 0.rpx, 0.rpx), + 10.rpx, 10.rpx, 10.rpx, 10.rpx), child: SvgPicture.asset( 'assets/img/icon/setting.svg', width: 29.rpx, diff --git a/lib/pages/person/person_page.dart b/lib/pages/person/person_page.dart index 83ee585..3bb1741 100644 --- a/lib/pages/person/person_page.dart +++ b/lib/pages/person/person_page.dart @@ -392,7 +392,7 @@ class _EPageState extends State { MyUtils.formatBindTime(d); personController.dateTime = d; personController.updateAll(); - }, title: "生日".tr); + }, title: "选择生日".tr); }); }, child: Center( @@ -418,9 +418,8 @@ class _EPageState extends State { ), Padding( padding: EdgeInsetsDirectional.fromSTEB( - 70.rpx, 18.rpx, 70.rpx, 0), + 70.rpx, 50.rpx, 70.rpx, 0), child: Container( - width: double.infinity, height: 100.rpx, decoration: BoxDecoration( borderRadius: BorderRadius.circular(50.rpx), @@ -430,108 +429,58 @@ class _EPageState extends State { width: AppConstants().border_width, ), ), - child: Align( - alignment: AlignmentDirectional(0, 0), - child: Stack( - alignment: Alignment.center, - children: [ - // 实际输入框(输入逻辑保留) - TextFormField( - keyboardType: TextInputType.number, - inputFormatters: [ - FilteringTextInputFormatter - .digitsOnly, - ], - initialValue: personController - .height.value - .toString(), - onChanged: (value) { - personController.height.value = value; + child: InkWell( + onTap: () { + final currentHeight = + personController.height.value; + final initialHeight = currentHeight != null + ? int.tryParse( + currentHeight.toString()) ?? + 170 + : 170; + + FocusScope.of(context) + .requestFocus(FocusNode()); + Future.delayed( + const Duration(milliseconds: 250), () { + showHeightPickerDialog( + context, + title: "选择身高".tr, + initialHeight: initialHeight, + onConfirm: (int selectedHeight) { + personController.height.value = + selectedHeight.toString(); + personController.updateAll(); + print("身高: $selectedHeight cm"); }, - autofocus: false, - obscureText: false, - style: TextStyle( - fontFamily: 'Inter', - color: Colors.transparent, // 隐藏输入文字 - letterSpacing: 0.0, - ), - textAlign: TextAlign.center, - cursorColor: - themeController.currentColor.sc3, - decoration: InputDecoration( - fillColor: Colors.transparent, - isDense: true, - hintText: '身高输入提示'.tr, - hintStyle: TextStyle( - fontFamily: 'Inter', - color: themeController - .currentColor.sc4, - fontSize: AppConstants() - .normal_text_fontSize, - letterSpacing: 0.0, - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Color(0x00000000), - width: 1.rpx, - ), - borderRadius: - BorderRadius.circular(8.rpx), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Color(0x00000000), - width: 1.rpx, - ), - borderRadius: - BorderRadius.circular(8.rpx), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - width: 1.rpx, - ), - borderRadius: - BorderRadius.circular(8.rpx), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: BorderSide( - width: 1.rpx, - ), - borderRadius: - BorderRadius.circular(8.rpx), - ), - filled: true, - ), + ); + }); + }, + child: Center( + child: Text( + personController.height.value != "" + ? personController.height.value + : '身高输入提示'.tr, + textAlign: TextAlign.right, + style: TextStyle( + fontFamily: 'Readex Pro', + color: personController.height.value != + "" + ? themeController.currentColor.sc3 + : themeController.currentColor.sc4, + fontSize: + AppConstants().normal_text_fontSize, + letterSpacing: 0, ), - Obx(() { - final height = - personController.height.value; - return (height == null || - height.isEmpty) - ? const SizedBox.shrink() // 不显示任何内容 - : Text( - '${height}cm', - textAlign: TextAlign.center, - style: TextStyle( - fontFamily: 'Inter', - color: themeController - .currentColor.sc3, - fontSize: AppConstants() - .normal_text_fontSize, - ), - ); - }), - ], + ), ), ), ), ), Padding( padding: EdgeInsetsDirectional.fromSTEB( - 70.rpx, 18.rpx, 70.rpx, 0), + 70.rpx, 50.rpx, 70.rpx, 0), child: Container( - width: double.infinity, height: 100.rpx, decoration: BoxDecoration( borderRadius: BorderRadius.circular(50.rpx), @@ -541,98 +490,43 @@ class _EPageState extends State { width: AppConstants().border_width, ), ), - child: Align( - alignment: AlignmentDirectional(0, 0), - child: Stack( - alignment: Alignment.center, - children: [ - // 实际输入框(输入逻辑保留) - TextFormField( - keyboardType: TextInputType.number, - inputFormatters: [ - FilteringTextInputFormatter - .digitsOnly, - ], - initialValue: - personController.weight.value, - onChanged: (value) { - personController.weight.value = value; + child: InkWell( + onTap: () { + FocusScope.of(context) + .requestFocus(FocusNode()); + Future.delayed( + const Duration(milliseconds: 250), () { + showWeightPickerDialog( + context, + title: "选择体重".tr, + initialWeight: + personController.weight.value ?? "", + onConfirm: (int selectedWeight) { + personController.weight.value = + selectedWeight + .toString(); // ✅ 转成字符串 + personController.updateAll(); }, - autofocus: false, - obscureText: false, - style: TextStyle( - fontFamily: 'Inter', - color: Colors.transparent, // 隐藏输入文字 - letterSpacing: 0.0, - ), - textAlign: TextAlign.center, - cursorColor: - themeController.currentColor.sc3, - decoration: InputDecoration( - fillColor: Colors.transparent, - isDense: true, - hintText: '人员资料.体重输入提示'.tr, - hintStyle: TextStyle( - fontFamily: 'Inter', - color: themeController - .currentColor.sc4, - fontSize: AppConstants() - .normal_text_fontSize, - letterSpacing: 0.0, - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Color(0x00000000), - width: 1.rpx, - ), - borderRadius: - BorderRadius.circular(8.rpx), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Color(0x00000000), - width: 1.rpx, - ), - borderRadius: - BorderRadius.circular(8.rpx), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - width: 1.rpx, - ), - borderRadius: - BorderRadius.circular(8.rpx), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: BorderSide( - width: 1.rpx, - ), - borderRadius: - BorderRadius.circular(8.rpx), - ), - filled: true, - ), + ); + }); + }, + child: Center( + child: Text( + personController.weight.value != "" + ? personController.weight.value + : '体重输入提示'.tr, + textAlign: TextAlign.right, + style: TextStyle( + fontFamily: 'Readex Pro', + color: personController.weight.value != + "" + ? themeController.currentColor.sc3 + : themeController.currentColor.sc4, + fontSize: + AppConstants().normal_text_fontSize, + letterSpacing: 0, ), - Obx(() { - final weight = - personController.weight.value; - return (weight == null || - weight.isEmpty) - ? const SizedBox.shrink() // 不显示任何内容 - : Text( - '${weight}kg', - textAlign: TextAlign.center, - style: TextStyle( - fontFamily: 'Inter', - color: themeController - .currentColor.sc3, - fontSize: AppConstants() - .normal_text_fontSize, - ), - ); - }), - ], + ), ), ), ), diff --git a/lib/pages/person/select_time.dart b/lib/pages/person/select_time.dart index 4eccd68..5892855 100644 --- a/lib/pages/person/select_time.dart +++ b/lib/pages/person/select_time.dart @@ -4,7 +4,9 @@ import 'package:flutter/material.dart'; import 'package:vbvs_app/common/color/appConstants.dart'; import 'package:vbvs_app/common/util/FitTool.dart'; import 'package:vbvs_app/common/util/MyUtils.dart'; +import 'package:vbvs_app/component/tool/ClickableContainer.dart'; import 'package:vbvs_app/controller/theme_controller/ThemeController.dart'; +import 'package:vbvs_app/pages/common/selectDialog.dart'; Future showDateSelectionDialog(BuildContext context, {required DateTime checkDate, Function? checkChange, String title = "生日"}) { @@ -250,3 +252,271 @@ getOnePicker(BuildContext context, List arr, int checkIndex, }), ); } + +Future showHeightPickerDialog( + BuildContext context, { + required int initialHeight, // 初始身高(单位:cm) + required Function(int selectedHeight) onConfirm, + String title = "选择身高", +}) async { + List heights = List.generate(101, (index) => 120 + index); // 120~220cm + int selectedIndex = heights.indexOf(initialHeight); + // int tempIndex = selectedIndex; + final RxInt tempIndex = RxInt(selectedIndex); // ✅ 改为 RxInt + ThemeController themeController = Get.find(); + + await showDialog( + context: context, + barrierDismissible: true, + builder: (BuildContext context) { + return Stack( + children: [ + Positioned( + bottom: 0, + left: 0, + right: 0, + child: Material( + color: Colors.transparent, + child: Dialog( + backgroundColor: themeController.currentColor.sc17, + insetPadding: EdgeInsets.zero, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(0), + ), + child: Container( + padding: EdgeInsets.fromLTRB(0.rpx, 0.rpx, 0.rpx, 90.rpx), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + padding: + EdgeInsets.fromLTRB(30.rpx, 0.rpx, 30.rpx, 0.rpx), + color: themeController.currentColor.sc5, + height: 80.rpx, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + ClickableContainer( + backgroundColor: Colors.transparent, + highlightColor: Colors.transparent, + padding: EdgeInsets.only(top: 0), + onTap: () { + Get.back(); + }, + child: Container( + alignment: Alignment.center, + width: 110.rpx, + height: 60.rpx, + child: Text( + "取消".tr, + style: TextStyle( + fontSize: 30.rpx, + color: Colors.white, + ), + ), + )), + Text(title, + style: TextStyle( + fontFamily: 'Readex Pro', + color: themeController.currentColor.sc3, + fontSize: 30.rpx, + )), + ClickableContainer( + backgroundColor: Colors.transparent, + highlightColor: Colors.transparent, + padding: EdgeInsets.only(top: 0), + onTap: () { + onConfirm( + heights[tempIndex.value]); // ✅ 使用 .value + Get.back(); + }, + child: Container( + alignment: Alignment.center, + width: 110.rpx, + height: 60.rpx, + child: Text( + "确定".tr, + style: TextStyle( + fontSize: 30.rpx, + color: themeController.currentColor.sc2, + ), + ), + )), + ], + ), + ), + SizedBox(height: 20.rpx), + Stack( + children: [ + Positioned.fill( + child: IgnorePointer( + child: Center( + child: Container( + height: 90.rpx, + margin: + EdgeInsets.symmetric(horizontal: 95.rpx), + decoration: BoxDecoration( + color: themeController.currentColor.sc2, + borderRadius: BorderRadius.circular(16.rpx), + ), + ), + ), + ), + ), + SizedBox( + height: 240.rpx, + child: getOnePickers( + context, + heights, + tempIndex, // ✅ 传入 RxInt + unit: "cm", + ), + ), + ], + ), + ], + ), + ), + ), + ), + ), + ], + ); + }, + ); +} + +Future showWeightPickerDialog( + BuildContext context, { + required String initialWeight, // 初始体重(单位:kg) + required Function(int selectedWeight) onConfirm, + String title = "选择体重", +}) async { + List weights = List.generate(151, (index) => 30 + index); // 30~180kg + int selectedIndex = weights.indexOf(int.tryParse(initialWeight) ?? 50); + final RxInt tempIndex = RxInt(selectedIndex); // ✅ 改为 RxInt + + ThemeController themeController = Get.find(); + + await showDialog( + context: context, + barrierDismissible: true, + builder: (BuildContext context) { + return Stack( + children: [ + Positioned( + bottom: 0, + left: 0, + right: 0, + child: Material( + color: Colors.transparent, + child: Dialog( + backgroundColor: themeController.currentColor.sc17, + insetPadding: EdgeInsets.zero, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(0), + ), + child: Container( + padding: EdgeInsets.fromLTRB(0.rpx, 0.rpx, 0.rpx, 90.rpx), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + // 标题 + 按钮 + Container( + padding: + EdgeInsets.fromLTRB(30.rpx, 0.rpx, 30.rpx, 0.rpx), + color: themeController.currentColor.sc5, + height: 80.rpx, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + ClickableContainer( + backgroundColor: Colors.transparent, + highlightColor: Colors.transparent, + padding: EdgeInsets.only(top: 0), + onTap: () { + Navigator.of(context).pop(); + }, + child: Container( + alignment: Alignment.center, + width: 110.rpx, + height: 60.rpx, + child: Text( + "取消".tr, + style: TextStyle( + fontSize: 30.rpx, + color: Colors.white, + ), + ), + )), + Text(title.tr, + style: TextStyle( + fontFamily: 'Readex Pro', + color: themeController.currentColor.sc3, + fontSize: 30.rpx, + )), + ClickableContainer( + backgroundColor: Colors.transparent, + highlightColor: Colors.transparent, + padding: EdgeInsets.only(top: 0), + onTap: () { + onConfirm( + weights[tempIndex.value]); // ✅ 回调返回选中值 + Get.back(); + }, + child: Container( + alignment: Alignment.center, + width: 110.rpx, + height: 60.rpx, + child: Text( + "确定".tr, + style: TextStyle( + fontSize: 30.rpx, + color: themeController.currentColor.sc2, + ), + ), + )), + ], + ), + ), + + SizedBox(height: 20.rpx), + Stack( + children: [ + Positioned.fill( + child: IgnorePointer( + child: Center( + child: Container( + height: 90.rpx, + margin: + EdgeInsets.symmetric(horizontal: 95.rpx), + decoration: BoxDecoration( + color: themeController.currentColor.sc2, + borderRadius: BorderRadius.circular(16.rpx), + ), + ), + ), + ), + ), + SizedBox( + height: 240.rpx, + child: getOnePickers( + context, + weights, + tempIndex, // ✅ 传入 RxInt + unit: "kg", + ), + ), + ], + ), + ], + ), + ), + ), + ), + ), + ], + ); + }, + ); +} diff --git a/lib/pages/person/update_person_page.dart b/lib/pages/person/update_person_page.dart index 3565051..ccaca29 100644 --- a/lib/pages/person/update_person_page.dart +++ b/lib/pages/person/update_person_page.dart @@ -393,7 +393,7 @@ class _UpdatePageState extends State { personController.dateTime = d; personController.updateAll(); }, - title: "生日".tr, + title: "选择生日".tr, ); }); }, @@ -420,9 +420,8 @@ class _UpdatePageState extends State { ), Padding( padding: EdgeInsetsDirectional.fromSTEB( - 70.rpx, 18.rpx, 70.rpx, 0), + 70.rpx, 50.rpx, 70.rpx, 0), child: Container( - width: double.infinity, height: 100.rpx, decoration: BoxDecoration( borderRadius: BorderRadius.circular(50.rpx), @@ -432,107 +431,59 @@ class _UpdatePageState extends State { width: AppConstants().border_width, ), ), - child: Align( - alignment: AlignmentDirectional(0, 0), - child: Stack( - alignment: Alignment.center, - children: [ - TextFormField( - keyboardType: TextInputType.number, - inputFormatters: [ - FilteringTextInputFormatter - .digitsOnly, - ], - initialValue: personController - .height.value - .toString(), - onChanged: (value) { - personController.height.value = value; + child: InkWell( + onTap: () { + final currentHeight = + personController.height.value; + final initialHeight = currentHeight != null + ? int.tryParse( + currentHeight.toString()) ?? + 170 + : 170; + + FocusScope.of(context) + .requestFocus(FocusNode()); + Future.delayed( + const Duration(milliseconds: 250), () { + showHeightPickerDialog( + context, + title: "选择身高".tr, + initialHeight: initialHeight, + onConfirm: (int selectedHeight) { + personController.height.value = + selectedHeight.toString(); + personController.updateAll(); + print("身高: $selectedHeight cm"); }, - autofocus: false, - obscureText: false, - style: TextStyle( - fontFamily: 'Inter', - color: Colors.transparent, // 隐藏输入文字 - letterSpacing: 0.0, - ), - textAlign: TextAlign.center, - cursorColor: - themeController.currentColor.sc3, - decoration: InputDecoration( - fillColor: Colors.transparent, - isDense: true, - hintText: '身高输入提示'.tr, - hintStyle: TextStyle( - fontFamily: 'Inter', - color: themeController - .currentColor.sc4, - fontSize: AppConstants() - .normal_text_fontSize, - letterSpacing: 0.0, - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Color(0x00000000), - width: 1.rpx, - ), - borderRadius: - BorderRadius.circular(8.rpx), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Color(0x00000000), - width: 1.rpx, - ), - borderRadius: - BorderRadius.circular(8.rpx), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - width: 1.rpx, - ), - borderRadius: - BorderRadius.circular(8.rpx), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: BorderSide( - width: 1.rpx, - ), - borderRadius: - BorderRadius.circular(8.rpx), - ), - filled: true, - ), + ); + }); + }, + child: Center( + child: Text( + personController.height.value != "" + ? personController.height.value + : '身高输入提示'.tr, + textAlign: TextAlign.right, + style: TextStyle( + fontFamily: 'Readex Pro', + color: personController.height.value != + "" + ? themeController.currentColor.sc3 + : themeController.currentColor.sc4, + fontSize: + AppConstants().normal_text_fontSize, + letterSpacing: 0, ), - Obx(() { - final height = - personController.height.value; - return (height == null || - height.isEmpty) - ? const SizedBox.shrink() // 不显示任何内容 - : Text( - '${height}cm', - textAlign: TextAlign.center, - style: TextStyle( - fontFamily: 'Inter', - color: themeController - .currentColor.sc3, - fontSize: AppConstants() - .normal_text_fontSize, - ), - ); - }), - ], + ), ), ), ), ), + Padding( padding: EdgeInsetsDirectional.fromSTEB( - 70.rpx, 18.rpx, 70.rpx, 0), + 70.rpx, 50.rpx, 70.rpx, 0), child: Container( - width: double.infinity, height: 100.rpx, decoration: BoxDecoration( borderRadius: BorderRadius.circular(50.rpx), @@ -542,103 +493,48 @@ class _UpdatePageState extends State { width: AppConstants().border_width, ), ), - child: Align( - alignment: AlignmentDirectional(0, 0), - child: Stack( - alignment: Alignment.center, - children: [ - // 实际输入框(输入逻辑保留) - TextFormField( - keyboardType: TextInputType.number, - inputFormatters: [ - FilteringTextInputFormatter - .digitsOnly, - ], - initialValue: personController - .weight.value - .toString(), - onChanged: (value) { - personController.weight.value = value; + child: InkWell( + onTap: () { + FocusScope.of(context) + .requestFocus(FocusNode()); + Future.delayed( + const Duration(milliseconds: 250), () { + showWeightPickerDialog( + context, + title: "选择体重".tr, + initialWeight: + personController.weight.value ?? "", + onConfirm: (int selectedWeight) { + personController.weight.value = + selectedWeight + .toString(); // ✅ 转成字符串 + personController.updateAll(); }, - autofocus: false, - obscureText: false, - style: TextStyle( - fontFamily: 'Inter', - color: Colors.transparent, // 隐藏输入文字 - letterSpacing: 0.0, - ), - textAlign: TextAlign.center, - cursorColor: - themeController.currentColor.sc3, - decoration: InputDecoration( - fillColor: Colors.transparent, - isDense: true, - hintText: '人员资料.体重输入提示'.tr, - hintStyle: TextStyle( - fontFamily: 'Inter', - color: themeController - .currentColor.sc4, - fontSize: AppConstants() - .normal_text_fontSize, - letterSpacing: 0.0, - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Color(0x00000000), - width: 1.rpx, - ), - borderRadius: - BorderRadius.circular(8.rpx), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Color(0x00000000), - width: 1.rpx, - ), - borderRadius: - BorderRadius.circular(8.rpx), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - width: 1.rpx, - ), - borderRadius: - BorderRadius.circular(8.rpx), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: BorderSide( - width: 1.rpx, - ), - borderRadius: - BorderRadius.circular(8.rpx), - ), - filled: true, - ), + ); + }); + }, + child: Center( + child: Text( + personController.weight.value != "" + ? personController.weight.value + : '体重输入提示'.tr, + textAlign: TextAlign.right, + style: TextStyle( + fontFamily: 'Readex Pro', + color: personController.weight.value != + "" + ? themeController.currentColor.sc3 + : themeController.currentColor.sc4, + fontSize: + AppConstants().normal_text_fontSize, + letterSpacing: 0, ), - Obx(() { - final weight = - personController.weight?.value; - return (weight == null || - weight.isEmpty) - ? const SizedBox.shrink() // 不显示任何内容 - : Text( - '${weight}kg', - textAlign: TextAlign.center, - style: TextStyle( - fontFamily: 'Inter', - color: themeController - .currentColor.sc3, - fontSize: AppConstants() - .normal_text_fontSize, - ), - ); - }), - ], + ), ), ), ), ), + Padding( padding: EdgeInsetsDirectional.fromSTEB( 0, 117.rpx, 0, 0), diff --git a/lib/pages/sleep_report/component/MonthDataWidget.dart b/lib/pages/sleep_report/component/MonthDataWidget.dart index bcfe0ce..ff8fd92 100644 --- a/lib/pages/sleep_report/component/MonthDataWidget.dart +++ b/lib/pages/sleep_report/component/MonthDataWidget.dart @@ -564,7 +564,7 @@ List buildValueTexts( // 中文年月日格式 DateTime date = DateTime.fromMillisecondsSinceEpoch(item['st']); - final dateStr = "${date.year}年 ${date.month}月 ${date.day}日"; + final dateStr = "${date.year}/ ${date.month}/ ${date.day}"; return "$prefix$val$suffix\n$dateStr"; }).toList(); diff --git a/lib/pages/user/setting_page.dart b/lib/pages/user/setting_page.dart index efbf04d..244f76d 100644 --- a/lib/pages/user/setting_page.dart +++ b/lib/pages/user/setting_page.dart @@ -45,7 +45,7 @@ class _SettingPageState extends State { decoration: BoxDecoration( image: DecorationImage( image: AssetImage('assets/img/bgNoImg.png'), // 本地图片 - fit: BoxFit.fill, // 填满整个 Container + fit: BoxFit.fill, // 填满个 Container ), ), child: Scaffold(