提交 b717a87f authored 作者: 张国庆's avatar 张国庆

修改

上级 e59e15cf
...@@ -129,9 +129,9 @@ abstract class BaseMessageConfig with NotificationManager, NoticeManager { ...@@ -129,9 +129,9 @@ abstract class BaseMessageConfig with NotificationManager, NoticeManager {
// 构造方法 // 构造方法
BaseMessageConfig() { BaseMessageConfig() {
//通过getx 注入 NotificationLayoutController //通过getx 注入 NotificationLayoutController
notificationLayoutController = Get.put(NotificationLayoutController()); notificationLayoutController = NotificationLayoutController();
//通过getx 注入 NoticeDialogWidgetController //通过getx 注入 NoticeDialogWidgetController
noticeDialogWidgetController = Get.put(NoticeDialogWidgetController()); noticeDialogWidgetController = NoticeDialogWidgetController();
} }
//刷新消息、获取未处理消息,重新连接websocket //刷新消息、获取未处理消息,重新连接websocket
......
...@@ -176,6 +176,7 @@ class NoticeDialogWidget extends GetView<NoticeDialogWidgetController> { ...@@ -176,6 +176,7 @@ class NoticeDialogWidget extends GetView<NoticeDialogWidgetController> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return GetBuilder<NoticeDialogWidgetController>( return GetBuilder<NoticeDialogWidgetController>(
init: messageConfig.messageManagement?.noticeDialogWidgetController,
id: "NoticeDialogWidget", id: "NoticeDialogWidget",
builder: (_) { builder: (_) {
return _buildView(); return _buildView();
...@@ -186,7 +187,6 @@ class NoticeDialogWidget extends GetView<NoticeDialogWidgetController> { ...@@ -186,7 +187,6 @@ class NoticeDialogWidget extends GetView<NoticeDialogWidgetController> {
class NoticeDialogWidgetController extends GetxController { class NoticeDialogWidgetController extends GetxController {
NoticeDialogWidgetController(); NoticeDialogWidgetController();
BaseMessageConfig? messageDeal = messageConfig.messageManagement;
_initData() { _initData() {
update(["NoticeDialogWidget"]); update(["NoticeDialogWidget"]);
} }
...@@ -206,7 +206,7 @@ class NoticeDialogWidgetController extends GetxController { ...@@ -206,7 +206,7 @@ class NoticeDialogWidgetController extends GetxController {
/// 处理公告 /// 处理公告
gotoDealMessage(MessageData? data) { gotoDealMessage(MessageData? data) {
messageDeal?.gotoDealMessage(data); messageConfig.messageManagement?.gotoDealMessage(data);
} }
void _insertNode(MessageData data) { void _insertNode(MessageData data) {
...@@ -250,13 +250,13 @@ class NoticeDialogWidgetController extends GetxController { ...@@ -250,13 +250,13 @@ class NoticeDialogWidgetController extends GetxController {
void ignore() { void ignore() {
/// 标记已展示 /// 标记已展示
messageDeal?.setMessageShowed(headNode?.data); messageConfig.messageManagement?.setMessageShowed(headNode?.data);
messageDeal?.markReadAction(headNode?.data); messageConfig.messageManagement?.markReadAction(headNode?.data);
next(); next();
} }
void dismiss() { void dismiss() {
messageDeal?.setMessageShowed(headNode?.data); messageConfig.messageManagement?.setMessageShowed(headNode?.data);
next(); next();
} }
......
...@@ -14,6 +14,7 @@ class NotificationLayoutWidget extends GetView<NotificationLayoutController> { ...@@ -14,6 +14,7 @@ class NotificationLayoutWidget extends GetView<NotificationLayoutController> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return GetBuilder<NotificationLayoutController>( return GetBuilder<NotificationLayoutController>(
init: messageConfig.messageManagement?.notificationLayoutController,
id: "NotificationLayoutWidget", id: "NotificationLayoutWidget",
builder: (_) { builder: (_) {
if (controller.headNode == null) { if (controller.headNode == null) {
...@@ -103,7 +104,6 @@ class NotificationLayoutController extends GetxController { ...@@ -103,7 +104,6 @@ class NotificationLayoutController extends GetxController {
MessageNode? headNode; MessageNode? headNode;
BaseMessageConfig? messageDeal = messageConfig.messageManagement;
_initData() { _initData() {
update(["NotificationLayoutWidget"]); update(["NotificationLayoutWidget"]);
...@@ -128,10 +128,10 @@ class NotificationLayoutController extends GetxController { ...@@ -128,10 +128,10 @@ class NotificationLayoutController extends GetxController {
} }
void next() { void next() {
messageDeal?.setMessageShowed(headNode?.data); messageConfig.messageManagement?.setMessageShowed(headNode?.data);
if (headNode?.next == null) { if (headNode?.next == null) {
headNode = null; headNode = null;
messageDeal?.hideNotification(); messageConfig.messageManagement?.hideNotification();
return; return;
} }
headNode = headNode?.next; headNode = headNode?.next;
...@@ -141,20 +141,20 @@ class NotificationLayoutController extends GetxController { ...@@ -141,20 +141,20 @@ class NotificationLayoutController extends GetxController {
} }
void ignore() { void ignore() {
messageDeal?.markReadAction(headNode?.data); messageConfig.messageManagement?.markReadAction(headNode?.data);
messageDeal?.setMessageShowed(headNode?.data); messageConfig.messageManagement?.setMessageShowed(headNode?.data);
next(); next();
} }
void dismiss() { void dismiss() {
messageDeal?.setMessageShowed(headNode?.data); messageConfig.messageManagement?.setMessageShowed(headNode?.data);
next(); next();
} }
void confirm(MessageData data) { void confirm(MessageData data) {
messageDeal?.gotoDealMessage(data); messageConfig.messageManagement?.gotoDealMessage(data);
messageDeal?.markReadAction(headNode?.data); messageConfig.messageManagement?.markReadAction(headNode?.data);
messageDeal?.setMessageShowed(headNode?.data); messageConfig.messageManagement?.setMessageShowed(headNode?.data);
next(); next();
} }
...@@ -169,7 +169,7 @@ class NotificationLayoutController extends GetxController { ...@@ -169,7 +169,7 @@ class NotificationLayoutController extends GetxController {
void clear() { void clear() {
headNode = null; headNode = null;
messageDeal?.hideNotification(); messageConfig.messageManagement?.hideNotification();
update(); update();
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论