更新消息设置

This commit is contained in:
wyf
2025-12-05 17:37:01 +08:00
parent 1cc26aa46d
commit db51c42664
44 changed files with 7510 additions and 1059 deletions

View File

@@ -1106,7 +1106,6 @@ class _HomePageState extends State<HomePage> {
if (currentIndex >= device_bind_process.length) return;
String code = device_bind_process[currentIndex]['mac'];
showUnBindTipDialog(
context,
Column(
@@ -1145,6 +1144,7 @@ class _HomePageState extends State<HomePage> {
),
],
),
textAlign: TextAlign.center, // 添加这一行
),
],
),
@@ -1208,6 +1208,12 @@ class _HomePageState extends State<HomePage> {
device_bind_process.removeAt(currentIndex);
showNextDialog();
},
onNoTipChanged: (value) {
updateDeviceTipStatus(
code, device_bind_process[currentIndex], value);
// device_bind_process.removeAt(currentIndex);
// showNextDialog();
},
);
}
@@ -1252,9 +1258,11 @@ class _HomePageState extends State<HomePage> {
bool celibration = res.data['celibration'];
bool person_info = res.data['person_info'];
bool wifi = res.data['wifi'];
if (!celibration || !person_info || !wifi) {
res.data['device_info'] = element;
userInfoController.device_bind_status.add(res.data);
if (res.data['noTip'] == null || res.data['noTip'] == false) {
if (!celibration || !person_info || !wifi) {
res.data['device_info'] = element;
userInfoController.device_bind_status.add(res.data);
}
}
}
} catch (e) {
@@ -1267,4 +1275,43 @@ class _HomePageState extends State<HomePage> {
print("查询设备绑定列表失败: $e");
}
}
void updateDeviceTipStatus(String mac, Map config, bool noTip) {
try {
String serviceAddress = ServiceConstant.service_address;
String serviceName = ServiceConstant.server_service;
String serviceApi = ServiceConstant.user_setting;
String type = "device_bind_status_$mac";
String queryUrl =
"${serviceAddress}${serviceName}${serviceApi}?type=${type}";
requestWithLog(
logTitle: "查询绑定流程",
method: MyHttpMethod.get,
queryUrl: queryUrl,
onSuccess: (res) {
print(res);
Map<String, dynamic> data = {
"type": type,
"mac": mac,
"wifi": res.data['wifi'],
"celibration": res.data['celibration'],
"person_info": res.data['person_info'],
"noTip": noTip,
"time": DateTime.now().millisecondsSinceEpoch,
};
requestWithLog(
logTitle: "更新绑定流程",
method: MyHttpMethod.put,
queryUrl: queryUrl,
data: data,
onSuccess: (res) {},
onFailure: (res) {},
);
},
onFailure: (res) {},
);
} catch (e) {
ef.log("$e");
}
}
}