更新初次设置消息失败
This commit is contained in:
@@ -12,6 +12,7 @@ import 'package:vbvs_app/common/util/MyUtils.dart';
|
|||||||
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
||||||
import 'package:vbvs_app/component/base/GradientSwitch.dart';
|
import 'package:vbvs_app/component/base/GradientSwitch.dart';
|
||||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||||
|
import 'package:vbvs_app/component/tool/NewTopSlideNotification.dart';
|
||||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||||
import 'package:vbvs_app/controller/message/common_message_setting_controller.dart';
|
import 'package:vbvs_app/controller/message/common_message_setting_controller.dart';
|
||||||
import 'package:vbvs_app/controller/message/message_setting_controller.dart';
|
import 'package:vbvs_app/controller/message/message_setting_controller.dart';
|
||||||
@@ -181,6 +182,8 @@ class _MessageSettingPageState extends State<MessageSettingPage> {
|
|||||||
if (datalist['device_type_setting'] != null) {
|
if (datalist['device_type_setting'] != null) {
|
||||||
messageSettingController.model.device_type_setting =
|
messageSettingController.model.device_type_setting =
|
||||||
datalist['device_type_setting'];
|
datalist['device_type_setting'];
|
||||||
|
} else {
|
||||||
|
messageSettingController.model.device_type_setting.clear();
|
||||||
}
|
}
|
||||||
messageSettingController.updateAll();
|
messageSettingController.updateAll();
|
||||||
}
|
}
|
||||||
@@ -319,15 +322,21 @@ class _MessageSettingPageState extends State<MessageSettingPage> {
|
|||||||
.model.serviceSetting,
|
.model.serviceSetting,
|
||||||
};
|
};
|
||||||
requestWithLog(
|
requestWithLog(
|
||||||
logTitle: "更新消息推送状态",
|
logTitle: "更新消息推送状态",
|
||||||
method: MyHttpMethod.put,
|
method: MyHttpMethod.put,
|
||||||
queryUrl: queryUrl,
|
queryUrl: queryUrl,
|
||||||
data: data,
|
data: data,
|
||||||
onSuccess: (res) {
|
onSuccess: (res) {
|
||||||
_fetchDeviceMessageSetting();
|
_fetchDeviceMessageSetting();
|
||||||
messageSettingController
|
messageSettingController.updateAll();
|
||||||
.updateAll();
|
},
|
||||||
});
|
onFailure: (res) {
|
||||||
|
NewTopSlideNotification.show(
|
||||||
|
text: '操作失败'.tr,
|
||||||
|
textColor: themeController
|
||||||
|
.currentColor.sc9);
|
||||||
|
},
|
||||||
|
);
|
||||||
},
|
},
|
||||||
activeGradient: LinearGradient(
|
activeGradient: LinearGradient(
|
||||||
colors: [
|
colors: [
|
||||||
|
|||||||
Reference in New Issue
Block a user