更新默认本地语言

This commit is contained in:
wyf
2025-08-11 14:55:09 +08:00
parent 50e1ebea20
commit da6da14d6a
16 changed files with 1468 additions and 1290 deletions

View File

@@ -7,6 +7,7 @@ import 'package:vbvs_app/component/tool/ClickableContainer.dart';
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
import 'package:vbvs_app/controller/main_bottom/global_controller.dart';
import 'package:vbvs_app/controller/user_info_controller.dart';
import 'package:vbvs_app/enum/LoginStatus.dart';
class EPage extends StatefulWidget {
const EPage({super.key});
@@ -69,7 +70,17 @@ class _EPageState extends State<EPage> {
highlightColor: Colors.transparent,
padding: EdgeInsets.all(0.rpx),
onTap: () {
TopSlideNotification.show(context, text: "待开发功能".tr);
UserInfoController userInfoController = Get.find();
bool isLoggedIn =
userInfoController.model.login == LoginStatus.LOGIN.code;
if (!isLoggedIn) {
TopSlideNotification.show(context,
text: "必须登录提示".tr,
textColor: themeController.currentColor.sc9);
Get.toNamed("/otherLoginPage");
} else {
TopSlideNotification.show(context, text: "待开发功能".tr);
}
},
child: Container(
// child: widget.webView,

View File

@@ -995,86 +995,80 @@ class _HomePageState extends State<HomePage> {
}
return Expanded(
child: SingleChildScrollView(child:
Column(
children: [
SizedBox(height: 26.rpx), // 第一个上方间距
...List.generate(deviceList.length, (i) {
String mac = macList[i];
List<dynamic> dailyDataList =
reportData[mac]!;
Map? targetDevice =
deviceList.firstWhereOrNull(
(device) => device['mac'] == mac,
);
List stateModule = [];
String currentTime = "";
String goalMac = targetDevice?['mac'];
var person = targetDevice?['person'];
child: SingleChildScrollView(
child: Column(
children: [
SizedBox(height: 26.rpx), // 第一个上方间距
...List.generate(deviceList.length, (i) {
String mac = macList[i];
List<dynamic> dailyDataList = reportData[mac]!;
Map? targetDevice = deviceList.firstWhereOrNull(
(device) => device['mac'] == mac,
);
List stateModule = [];
String currentTime = "";
String goalMac = targetDevice?['mac'];
var person = targetDevice?['person'];
return Column(
children: [
DynamicReportDetailWidget(
key: ValueKey(
'${targetDevice!['mac']}_${homeController.model.type}'),
targetDevice: targetDevice!,
sleepDateWidgets: List.generate(
dailyDataList.length, (j) {
var dayData = dailyDataList[j];
DateTime date = DateTime
.fromMillisecondsSinceEpoch(
dayData['time'] is String
? int.parse(dayData['time'])
: dayData['time'],
);
if (dayData['selected'] == true &&
dayData['state'] != null) {
stateModule = dayData['state'];
currentTime = dayData['time'];
}
return SleepDateWidget(
mac: mac,
time: dayData['time'],
date: date,
score: dayData['score']?['socre']
?.toString() ??
'',
comment: dayData['score']?['name'],
textColor: dayData['score']
?['color'] ==
null
? null
: stringToColor(
dayData['score']?['color']),
isSelected: dayData['selected'],
);
}),
sleepDataModuleWidgets: stateModule
.isNotEmpty
? List.generate(stateModule.length,
(j) {
stateModule[j]['onto'] = true;
stateModule[j]['time'] =
currentTime;
stateModule[j]['mac'] = goalMac;
stateModule[j]['person'] =
person;
return SleepDataModuleWidget(
data: stateModule[j]);
})
: [],
),
SizedBox(
height:
26.rpx), // 每个 widget 下方间距(包括最后一个)
],
);
}),
],
)
),
return Column(
children: [
DynamicReportDetailWidget(
key: ValueKey(
'${targetDevice!['mac']}_${homeController.model.type}'),
targetDevice: targetDevice!,
sleepDateWidgets: List.generate(
dailyDataList.length, (j) {
var dayData = dailyDataList[j];
DateTime date =
DateTime.fromMillisecondsSinceEpoch(
dayData['time'] is String
? int.parse(dayData['time'])
: dayData['time'],
);
if (dayData['selected'] == true &&
dayData['state'] != null) {
stateModule = dayData['state'];
currentTime = dayData['time'];
}
return SleepDateWidget(
mac: mac,
time: dayData['time'],
date: date,
score: dayData['score']?['socre']
?.toString() ??
'',
comment: dayData['score']?['name'],
textColor: dayData['score']
?['color'] ==
null
? null
: stringToColor(
dayData['score']?['color']),
isSelected: dayData['selected'],
);
}),
sleepDataModuleWidgets: stateModule
.isNotEmpty
? List.generate(stateModule.length,
(j) {
stateModule[j]['onto'] = true;
stateModule[j]['time'] =
currentTime;
stateModule[j]['mac'] = goalMac;
stateModule[j]['person'] = person;
return SleepDataModuleWidget(
data: stateModule[j]);
})
: [],
),
SizedBox(
height:
26.rpx), // 每个 widget 下方间距(包括最后一个)
],
);
}),
],
)),
);
}),
],

View File

@@ -141,7 +141,8 @@ class MainPageBottomChange extends GetView<MainPageController> {
bool isLoggedIn = userInfoController.model.login ==
LoginStatus.LOGIN.code;
if ((index == 1 || index == 2) && !isLoggedIn) {
// if ((index == 1 || index == 2) && !isLoggedIn) {
if ((index == 2) && !isLoggedIn) {
TopSlideNotification.show(
context,
text: "必须登录提示".tr,