多语言
This commit is contained in:
@@ -77,7 +77,7 @@ class MHTBlueToothController extends GetControllerEx<MHTBlueToothModel> {
|
||||
if (res.code == HttpStatusCodes.ok) {
|
||||
updateAll();
|
||||
} else {
|
||||
safeShowNotification(res.msg ?? "获取设备状态异常");
|
||||
safeShowNotification(res.msg ?? "获取设备状态异常".tr);
|
||||
EasyDartModule.logger.info("获取设备状态异常: $res");
|
||||
DailyLogUtils.writeLog("获取设备状态异常: $res");
|
||||
}
|
||||
@@ -89,13 +89,13 @@ class MHTBlueToothController extends GetControllerEx<MHTBlueToothModel> {
|
||||
if (res.code == HttpStatusCodes.ok) {
|
||||
updateAll();
|
||||
} else {
|
||||
safeShowNotification(res.msg ?? "获取设备状态异常");
|
||||
safeShowNotification(res.msg ?? "获取设备状态异常".tr);
|
||||
EasyDartModule.logger.info("获取设备状态异常: $res");
|
||||
DailyLogUtils.writeLog("获取设备状态异常: $res");
|
||||
}
|
||||
}).catchError((e, stack) {
|
||||
print("updateDeviceStatus 执行异常: $e\n$stack");
|
||||
safeShowNotification("设备状态请求失败");
|
||||
safeShowNotification("设备状态请求失败".tr);
|
||||
EasyDartModule.logger.info("设备状态异常: $e");
|
||||
DailyLogUtils.writeLog("设备状态异常: $e");
|
||||
});
|
||||
@@ -165,7 +165,7 @@ class MHTBlueToothController extends GetControllerEx<MHTBlueToothModel> {
|
||||
// 新建一个 Map,便于快速通过 mac 查找返回的设备状态
|
||||
final Map<String, dynamic> responseMap = {
|
||||
for (var item in responseList)
|
||||
item['mac'].toString().toUpperCase(): item
|
||||
item['mac'.tr].toString().toUpperCase(): item
|
||||
};
|
||||
|
||||
// 遍历 blueRawData,更新 bind 状态
|
||||
@@ -214,7 +214,7 @@ class MHTBlueToothController extends GetControllerEx<MHTBlueToothModel> {
|
||||
String queryUrl = "$serviceAddress$serviceName$serviceApi";
|
||||
var data = {
|
||||
"deviceType": model.deviceType,
|
||||
"mac": bleDevice.mac,
|
||||
"mac".tr: bleDevice.mac,
|
||||
"macA": bleDevice.macA,
|
||||
if (bleDevice.macB != null && bleDevice.macB!.isNotEmpty)
|
||||
"macB": bleDevice.macB,
|
||||
@@ -266,12 +266,12 @@ class MHTBlueToothController extends GetControllerEx<MHTBlueToothModel> {
|
||||
String queryUrl = "${serviceAddress}${serviceName}${serviceApi}";
|
||||
var data = {
|
||||
"type": type,
|
||||
"mac": sleepData['mac'],
|
||||
"mac".tr: sleepData['mac'.tr],
|
||||
"time": DateTime.now().millisecondsSinceEpoch,
|
||||
"data": sleepData,
|
||||
};
|
||||
await requestWithLog(
|
||||
logTitle: "更新睡眠习惯",
|
||||
logTitle: "更新睡眠习惯".tr,
|
||||
method: MyHttpMethod.put,
|
||||
queryUrl: queryUrl,
|
||||
data: data,
|
||||
@@ -290,7 +290,7 @@ class MHTBlueToothController extends GetControllerEx<MHTBlueToothModel> {
|
||||
Map<String, dynamic> result = {};
|
||||
|
||||
await requestWithLog(
|
||||
logTitle: "更新睡眠习惯",
|
||||
logTitle: "更新睡眠习惯".tr,
|
||||
method: MyHttpMethod.get,
|
||||
queryUrl: queryUrl,
|
||||
onSuccess: (res) {
|
||||
@@ -319,7 +319,7 @@ void safeShowNotification(String msg) {
|
||||
textColor: themeController.currentColor.sc9,
|
||||
);
|
||||
} else {
|
||||
print("TopSlideNotification 未显示:context 不可用或未挂载");
|
||||
print("TopSlideNotification 未显示:context 不可用或未挂载".tr);
|
||||
}
|
||||
} catch (e, stack) {
|
||||
// print("TopSlideNotification 显示异常: $e\n$stack");
|
||||
|
||||
Reference in New Issue
Block a user