diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 5b724c0..523e747 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -67,6 +67,13 @@
+
+
diff --git a/assets/img/followus.png b/assets/img/followus.png
index edc8b3f..aef184a 100644
Binary files a/assets/img/followus.png and b/assets/img/followus.png differ
diff --git a/assets/img/icon/explain.svg b/assets/img/icon/explain.svg
new file mode 100644
index 0000000..b258c59
--- /dev/null
+++ b/assets/img/icon/explain.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/langs/zh_CN.json b/assets/langs/zh_CN.json
index 7d7f8f0..4efe637 100644
--- a/assets/langs/zh_CN.json
+++ b/assets/langs/zh_CN.json
@@ -353,5 +353,11 @@
"版本":"版本:",
"日报":"日报",
"月报":"月报",
- "周报":"周报"
+ "周报":"周报",
+ "4g设备配置wifi提示":"该设备为4G设备,无需配置wifi",
+ "微信客服提示":"请先安装微信APP,再联系客服",
+ "打开微信客服提示":"正在打开微信客服...",
+ "身高":"身高",
+ "身高输入提示":"请输入身高"
+
}
\ No newline at end of file
diff --git a/assets/langs/zh_Hant.json b/assets/langs/zh_TW.json
similarity index 100%
rename from assets/langs/zh_Hant.json
rename to assets/langs/zh_TW.json
diff --git a/lib/common/util/CommonVariables.dart b/lib/common/util/CommonVariables.dart
index 583badc..f7cbaf4 100644
--- a/lib/common/util/CommonVariables.dart
+++ b/lib/common/util/CommonVariables.dart
@@ -3,9 +3,9 @@ class CommonVariables {
// 企业微信客服拉起的url地址
- static String wxKfUrl = "https://work.weixin.qq.com/kfid/kfc7d2337b9c07b1269";
+ static String wxKfUrl = "https://work.weixin.qq.com/kfid/kfcab6a07e8aac68945";
// 企业微信ID
- static String wxCorpId = "ww51feda6026280cd0";
+ static String wxCorpId = "wwc17348c75dbde1dc";
//ICP备案号
static String ICPRightCode = "皖ICP备2024068219号-1A";
//公司名称
diff --git a/lib/common/util/MyUtils.dart b/lib/common/util/MyUtils.dart
index f1a47e9..db9f71b 100644
--- a/lib/common/util/MyUtils.dart
+++ b/lib/common/util/MyUtils.dart
@@ -163,16 +163,20 @@ class MyUtils {
return '${twoDigits(date.month)}/${twoDigits(date.day)}';
}
- static String getFormatChineseTime(date) {
- DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(date);
- // 格式化年月日
- String dateStr = DateFormat('yyyy年MM月dd日').format(dateTime);
- // 获取星期
- const weekDays = ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日'];
- String weekStr = weekDays[dateTime.weekday - 1];
+ static String getFormatChineseTime(int date, {bool showWeekday = true}) {
+ DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(date);
+ // 格式化年月日
+ String dateStr = DateFormat('yyyy年MM月dd日').format(dateTime);
+
+ if (!showWeekday) return dateStr;
+
+ // 获取星期
+ const weekDays = ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日'];
+ String weekStr = weekDays[dateTime.weekday - 1];
+
+ return '$dateStr $weekStr';
+}
- return '$dateStr $weekStr';
- }
}
Color stringToColor(String hexColor) {
diff --git a/lib/component/base/SleepCalendarWidget.dart b/lib/component/base/SleepCalendarWidget.dart
index 4883880..b23fcf3 100644
--- a/lib/component/base/SleepCalendarWidget.dart
+++ b/lib/component/base/SleepCalendarWidget.dart
@@ -10,11 +10,15 @@ import 'SleepdateWidget.dart';
class SleepCalendarWidget extends StatefulWidget {
final int? timestamp;
final ValueChanged? onDateSelected;
+ final int? type; // 新增参数,默认日历类型为日
+ final Color highlightColor; // ✅ 新增
const SleepCalendarWidget({
super.key,
this.timestamp,
this.onDateSelected,
+ this.type = 1,
+ this.highlightColor = Colors.black, // ✅ 默认值
});
@override
@@ -55,172 +59,233 @@ class _SleepCalendarWidgetState extends State {
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
- Container(
- width: double.infinity,
- constraints: BoxConstraints(minHeight: 90.rpx),
- decoration: BoxDecoration(
- color: const Color(0xFF313541),
- borderRadius: BorderRadius.only(
- topLeft: Radius.circular(20.rpx),
- topRight: Radius.circular(20.rpx),
- ),
- ),
- child: Padding(
- padding:
- EdgeInsetsDirectional.fromSTEB(65.rpx, 0.rpx, 65.rpx, 0.rpx),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- ClickableContainer(
- backgroundColor: Colors.transparent,
- highlightColor: Colors.grey,
- padding: EdgeInsetsDirectional.fromSTEB(
- 8.rpx, 8.rpx, 8.rpx, 8.rpx),
- onTap: () => calendarController.previousMonth(),
- child: Icon(
- Icons.arrow_back_ios_new,
- color: const Color(0xFF6D6F73),
- size: 24.rpx,
- ),
- ),
- Obx(() => Text(
- '${calendarController.displayedMonth.value.year}年${calendarController.displayedMonth.value.month}月',
- style: TextStyle(
- color: Colors.white,
- fontSize: 30.rpx,
- letterSpacing: 0.0,
- ),
- )),
- ClickableContainer(
- backgroundColor: Colors.transparent,
- highlightColor: Colors.grey,
- padding: EdgeInsetsDirectional.fromSTEB(
- 8.rpx, 8.rpx, 8.rpx, 8.rpx),
- onTap: () => calendarController.nextMonth(),
- child: Icon(
- Icons.arrow_forward_ios,
- color: const Color(0xFF6D6F73),
- size: 24.rpx,
- ),
- ),
- ],
- ),
- ),
- ),
- Container(
- width: double.infinity,
- constraints: BoxConstraints(minHeight: 720.rpx),
- decoration: const BoxDecoration(color: Color(0xFF242835)),
- child: Padding(
- padding: EdgeInsetsDirectional.fromSTEB(
- 65.rpx, 13.rpx, 65.rpx, 38.rpx),
- child: Obx(() {
- final daysInMonth = calendarController.getDaysInMonth();
- final calendarRows =
- calendarController.getCalendarRows(daysInMonth);
- final selectedDate = calendarController.selectedDate.value;
-
- return Column(
- mainAxisSize: MainAxisSize.max,
- children: [
- // Weekdays Header
- Container(
- constraints: BoxConstraints(minHeight: 90.rpx),
- child: Row(
- children: [
- for (var day in ["一", "二", "三", "四", "五", "六", "日"])
- Expanded(
- child: Center(
- child: Text(
- day,
- style: TextStyle(
- color: stringToColor("#FFFFFF"),
- fontSize:
- AppConstants().normal_text_fontSize,
- ),
- ),
- ),
- ),
- ],
- ),
- ),
- // Calendar days
- Column(
- children: calendarRows.map((week) {
- return Row(
- mainAxisAlignment: MainAxisAlignment.start,
- children: week.map((date) {
- if (date.year == 0) {
- return Expanded(
- child: Padding(
- padding: EdgeInsets.all(0.rpx),
- child: SizedBox.shrink(),
- ),
- );
- }
- final isSelected = selectedDate != null &&
- date.year == selectedDate.year &&
- date.month == selectedDate.month &&
- date.day == selectedDate.day;
- return Expanded(
- child: SleepdateWidget(
- date: date,
- isSelected: isSelected,
- onTap: () {
- calendarController.selectDate(date);
- if (widget.onDateSelected != null) {
- widget.onDateSelected!(date);
- }
- print(date);
- Get.back();
- },
- ),
- );
- }).toList(),
- );
- }).toList(),
- ),
- SizedBox(height: 55.rpx),
- Wrap(
- spacing: 20.rpx,
- runSpacing: 20.rpx,
- children: showLabel.map((item) {
- return Container(
- padding: EdgeInsets.all(5.rpx),
- child: Row(
- mainAxisSize: MainAxisSize.min,
- children: [
- Container(
- width: 20.rpx,
- height: 20.rpx,
- decoration: BoxDecoration(
- color: item["color"],
- borderRadius: BorderRadius.circular(10.rpx),
- ),
- ),
- SizedBox(width: 8.rpx),
- Text(
- item["name"],
- style: TextStyle(
- color: Colors.white,
- fontSize: 24.rpx,
- ),
- ),
- ],
- ),
- );
- }).toList(),
- ),
-
- ],
- );
- }),
- ),
- ),
+ _buildHeader(),
+ _buildCalendarBody(showLabel),
],
),
);
}
+
+ Widget _buildHeader() {
+ return Container(
+ width: double.infinity,
+ constraints: BoxConstraints(minHeight: 90.rpx),
+ decoration: BoxDecoration(
+ color: const Color(0xFF313541),
+ borderRadius: BorderRadius.only(
+ topLeft: Radius.circular(20.rpx),
+ topRight: Radius.circular(20.rpx),
+ ),
+ ),
+ child: Padding(
+ padding: EdgeInsets.symmetric(horizontal: 65.rpx),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ ClickableContainer(
+ backgroundColor: Colors.transparent,
+ highlightColor: Colors.grey,
+ padding: EdgeInsets.all(8.rpx),
+ onTap: () => calendarController.previousMonth(),
+ child: Icon(
+ Icons.arrow_back_ios_new,
+ color: const Color(0xFF6D6F73),
+ size: 24.rpx,
+ ),
+ ),
+ Obx(() => Text(
+ '${calendarController.displayedMonth.value.year}年${calendarController.displayedMonth.value.month}月',
+ style: TextStyle(
+ color: Colors.white,
+ fontSize: 30.rpx,
+ ),
+ )),
+ ClickableContainer(
+ backgroundColor: Colors.transparent,
+ highlightColor: Colors.grey,
+ padding: EdgeInsets.all(8.rpx),
+ onTap: () => calendarController.nextMonth(),
+ child: Icon(
+ Icons.arrow_forward_ios,
+ color: const Color(0xFF6D6F73),
+ size: 24.rpx,
+ ),
+ ),
+ ],
+ ),
+ ),
+ );
+ }
+
+ Widget _buildCalendarBody(List