Commit 08b098d6 cgx

完成消息中心query_user_message_count和query_user_dynamic_notice接口

1 个父辈 b70a7427
正在显示 24 个修改的文件 包含 576 行增加88 行删除
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
39CC172FB610DA5F29120B56 /* Pods_DreamSleep.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D11699D88A7A7BDB6168B71 /* Pods_DreamSleep.framework */; settings = {ATTRIBUTES = (Required, ); }; }; 39CC172FB610DA5F29120B56 /* Pods_DreamSleep.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D11699D88A7A7BDB6168B71 /* Pods_DreamSleep.framework */; settings = {ATTRIBUTES = (Required, ); }; };
D00291892816CD4500C0573B /* DsCacheUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = D00291882816CD4500C0573B /* DsCacheUtils.m */; }; D00291892816CD4500C0573B /* DsCacheUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = D00291882816CD4500C0573B /* DsCacheUtils.m */; };
D003140628FD449E00E01A6A /* MessageCenterViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D003140528FD449E00E01A6A /* MessageCenterViewModel.m */; };
D003140928FD469B00E01A6A /* MessageComReplyModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D003140828FD469B00E01A6A /* MessageComReplyModel.m */; };
D0031549284DAC0D00CFE94D /* RelaxBodyView.m in Sources */ = {isa = PBXBuildFile; fileRef = D0031548284DAC0D00CFE94D /* RelaxBodyView.m */; }; D0031549284DAC0D00CFE94D /* RelaxBodyView.m in Sources */ = {isa = PBXBuildFile; fileRef = D0031548284DAC0D00CFE94D /* RelaxBodyView.m */; };
D003154C284DF46F00CFE94D /* RelaxTrainCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D003154B284DF46F00CFE94D /* RelaxTrainCell.m */; }; D003154C284DF46F00CFE94D /* RelaxTrainCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D003154B284DF46F00CFE94D /* RelaxTrainCell.m */; };
D0071C7028707BCC0035AD8A /* ScoreRulesView.m in Sources */ = {isa = PBXBuildFile; fileRef = D0071C6F28707BCC0035AD8A /* ScoreRulesView.m */; }; D0071C7028707BCC0035AD8A /* ScoreRulesView.m in Sources */ = {isa = PBXBuildFile; fileRef = D0071C6F28707BCC0035AD8A /* ScoreRulesView.m */; };
...@@ -99,8 +101,8 @@ ...@@ -99,8 +101,8 @@
D053D0DC28F3C23200BB2B84 /* ReportViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D053D0DB28F3C23200BB2B84 /* ReportViewModel.m */; }; D053D0DC28F3C23200BB2B84 /* ReportViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D053D0DB28F3C23200BB2B84 /* ReportViewModel.m */; };
D053D0DF28F40C6A00BB2B84 /* MessageController.m in Sources */ = {isa = PBXBuildFile; fileRef = D053D0DE28F40C6A00BB2B84 /* MessageController.m */; }; D053D0DF28F40C6A00BB2B84 /* MessageController.m in Sources */ = {isa = PBXBuildFile; fileRef = D053D0DE28F40C6A00BB2B84 /* MessageController.m */; };
D053D0E228F40CCC00BB2B84 /* MessageNotiView.m in Sources */ = {isa = PBXBuildFile; fileRef = D053D0E128F40CCC00BB2B84 /* MessageNotiView.m */; }; D053D0E228F40CCC00BB2B84 /* MessageNotiView.m in Sources */ = {isa = PBXBuildFile; fileRef = D053D0E128F40CCC00BB2B84 /* MessageNotiView.m */; };
D053D0E528F41F1300BB2B84 /* MessageNotiCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D053D0E428F41F1300BB2B84 /* MessageNotiCell.m */; }; D053D0E528F41F1300BB2B84 /* MessageOfficialNotiCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D053D0E428F41F1300BB2B84 /* MessageOfficialNotiCell.m */; };
D053D0E828F41FB300BB2B84 /* CommentReplyCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D053D0E728F41FB300BB2B84 /* CommentReplyCell.m */; }; D053D0E828F41FB300BB2B84 /* MessageComReplyCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D053D0E728F41FB300BB2B84 /* MessageComReplyCell.m */; };
D05416F7288A57BD0035060B /* AVAudioSession+SXAudioSession.m in Sources */ = {isa = PBXBuildFile; fileRef = D05416F6288A57BD0035060B /* AVAudioSession+SXAudioSession.m */; }; D05416F7288A57BD0035060B /* AVAudioSession+SXAudioSession.m in Sources */ = {isa = PBXBuildFile; fileRef = D05416F6288A57BD0035060B /* AVAudioSession+SXAudioSession.m */; };
D054CCB52830DE5600420DC4 /* NoisePlayerManager.m in Sources */ = {isa = PBXBuildFile; fileRef = D054CCB42830DE5600420DC4 /* NoisePlayerManager.m */; }; D054CCB52830DE5600420DC4 /* NoisePlayerManager.m in Sources */ = {isa = PBXBuildFile; fileRef = D054CCB42830DE5600420DC4 /* NoisePlayerManager.m */; };
D054CCB82830E3AC00420DC4 /* NoisePlayItem.m in Sources */ = {isa = PBXBuildFile; fileRef = D054CCB72830E3AC00420DC4 /* NoisePlayItem.m */; }; D054CCB82830E3AC00420DC4 /* NoisePlayItem.m in Sources */ = {isa = PBXBuildFile; fileRef = D054CCB72830E3AC00420DC4 /* NoisePlayItem.m */; };
...@@ -246,7 +248,7 @@ ...@@ -246,7 +248,7 @@
D0DB33A528204E7C00E15914 /* FirstLeadAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = D0DB33A428204E7C00E15914 /* FirstLeadAlertView.m */; }; D0DB33A528204E7C00E15914 /* FirstLeadAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = D0DB33A428204E7C00E15914 /* FirstLeadAlertView.m */; };
D0DB33A828224D5100E15914 /* PromotionModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D0DB33A728224D5100E15914 /* PromotionModel.m */; }; D0DB33A828224D5100E15914 /* PromotionModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D0DB33A728224D5100E15914 /* PromotionModel.m */; };
D0DF90AE2814390000FC0F64 /* BannerModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D0DF90AD2814390000FC0F64 /* BannerModel.m */; }; D0DF90AE2814390000FC0F64 /* BannerModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D0DF90AD2814390000FC0F64 /* BannerModel.m */; };
D0E3563A28F555B5007190EE /* MessageNotiModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D0E3563928F555B5007190EE /* MessageNotiModel.m */; }; D0E3563A28F555B5007190EE /* MessageOfficialModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D0E3563928F555B5007190EE /* MessageOfficialModel.m */; };
D0E3563D28F55A27007190EE /* OfficialNoticeController.m in Sources */ = {isa = PBXBuildFile; fileRef = D0E3563C28F55A27007190EE /* OfficialNoticeController.m */; }; D0E3563D28F55A27007190EE /* OfficialNoticeController.m in Sources */ = {isa = PBXBuildFile; fileRef = D0E3563C28F55A27007190EE /* OfficialNoticeController.m */; };
D0E3564028F55B50007190EE /* PraiseListController.m in Sources */ = {isa = PBXBuildFile; fileRef = D0E3563F28F55B50007190EE /* PraiseListController.m */; }; D0E3564028F55B50007190EE /* PraiseListController.m in Sources */ = {isa = PBXBuildFile; fileRef = D0E3563F28F55B50007190EE /* PraiseListController.m */; };
D0E3564928F56115007190EE /* BaseTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D0E3564828F56115007190EE /* BaseTableViewCell.m */; }; D0E3564928F56115007190EE /* BaseTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D0E3564828F56115007190EE /* BaseTableViewCell.m */; };
...@@ -318,6 +320,10 @@ ...@@ -318,6 +320,10 @@
9B4D4A8254C6E2872914AB4D /* Pods-DreamSleep.beta.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DreamSleep.beta.xcconfig"; path = "Target Support Files/Pods-DreamSleep/Pods-DreamSleep.beta.xcconfig"; sourceTree = "<group>"; }; 9B4D4A8254C6E2872914AB4D /* Pods-DreamSleep.beta.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DreamSleep.beta.xcconfig"; path = "Target Support Files/Pods-DreamSleep/Pods-DreamSleep.beta.xcconfig"; sourceTree = "<group>"; };
D00291872816CD4500C0573B /* DsCacheUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DsCacheUtils.h; sourceTree = "<group>"; }; D00291872816CD4500C0573B /* DsCacheUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DsCacheUtils.h; sourceTree = "<group>"; };
D00291882816CD4500C0573B /* DsCacheUtils.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DsCacheUtils.m; sourceTree = "<group>"; }; D00291882816CD4500C0573B /* DsCacheUtils.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DsCacheUtils.m; sourceTree = "<group>"; };
D003140428FD449E00E01A6A /* MessageCenterViewModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MessageCenterViewModel.h; sourceTree = "<group>"; };
D003140528FD449E00E01A6A /* MessageCenterViewModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MessageCenterViewModel.m; sourceTree = "<group>"; };
D003140728FD469B00E01A6A /* MessageComReplyModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MessageComReplyModel.h; sourceTree = "<group>"; };
D003140828FD469B00E01A6A /* MessageComReplyModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MessageComReplyModel.m; sourceTree = "<group>"; };
D0031547284DAC0D00CFE94D /* RelaxBodyView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RelaxBodyView.h; sourceTree = "<group>"; }; D0031547284DAC0D00CFE94D /* RelaxBodyView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RelaxBodyView.h; sourceTree = "<group>"; };
D0031548284DAC0D00CFE94D /* RelaxBodyView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RelaxBodyView.m; sourceTree = "<group>"; }; D0031548284DAC0D00CFE94D /* RelaxBodyView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RelaxBodyView.m; sourceTree = "<group>"; };
D003154A284DF46F00CFE94D /* RelaxTrainCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RelaxTrainCell.h; sourceTree = "<group>"; }; D003154A284DF46F00CFE94D /* RelaxTrainCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RelaxTrainCell.h; sourceTree = "<group>"; };
...@@ -488,10 +494,10 @@ ...@@ -488,10 +494,10 @@
D053D0DE28F40C6A00BB2B84 /* MessageController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MessageController.m; sourceTree = "<group>"; }; D053D0DE28F40C6A00BB2B84 /* MessageController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MessageController.m; sourceTree = "<group>"; };
D053D0E028F40CCC00BB2B84 /* MessageNotiView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MessageNotiView.h; sourceTree = "<group>"; }; D053D0E028F40CCC00BB2B84 /* MessageNotiView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MessageNotiView.h; sourceTree = "<group>"; };
D053D0E128F40CCC00BB2B84 /* MessageNotiView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MessageNotiView.m; sourceTree = "<group>"; }; D053D0E128F40CCC00BB2B84 /* MessageNotiView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MessageNotiView.m; sourceTree = "<group>"; };
D053D0E328F41F1300BB2B84 /* MessageNotiCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MessageNotiCell.h; sourceTree = "<group>"; }; D053D0E328F41F1300BB2B84 /* MessageOfficialNotiCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MessageOfficialNotiCell.h; sourceTree = "<group>"; };
D053D0E428F41F1300BB2B84 /* MessageNotiCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MessageNotiCell.m; sourceTree = "<group>"; }; D053D0E428F41F1300BB2B84 /* MessageOfficialNotiCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MessageOfficialNotiCell.m; sourceTree = "<group>"; };
D053D0E628F41FB300BB2B84 /* CommentReplyCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CommentReplyCell.h; sourceTree = "<group>"; }; D053D0E628F41FB300BB2B84 /* MessageComReplyCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MessageComReplyCell.h; sourceTree = "<group>"; };
D053D0E728F41FB300BB2B84 /* CommentReplyCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CommentReplyCell.m; sourceTree = "<group>"; }; D053D0E728F41FB300BB2B84 /* MessageComReplyCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MessageComReplyCell.m; sourceTree = "<group>"; };
D05416F5288A57BD0035060B /* AVAudioSession+SXAudioSession.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "AVAudioSession+SXAudioSession.h"; sourceTree = "<group>"; }; D05416F5288A57BD0035060B /* AVAudioSession+SXAudioSession.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "AVAudioSession+SXAudioSession.h"; sourceTree = "<group>"; };
D05416F6288A57BD0035060B /* AVAudioSession+SXAudioSession.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "AVAudioSession+SXAudioSession.m"; sourceTree = "<group>"; }; D05416F6288A57BD0035060B /* AVAudioSession+SXAudioSession.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "AVAudioSession+SXAudioSession.m"; sourceTree = "<group>"; };
D054CCB32830DE5600420DC4 /* NoisePlayerManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NoisePlayerManager.h; sourceTree = "<group>"; }; D054CCB32830DE5600420DC4 /* NoisePlayerManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NoisePlayerManager.h; sourceTree = "<group>"; };
...@@ -782,8 +788,8 @@ ...@@ -782,8 +788,8 @@
D0DF90AB28142F1300FC0F64 /* DreamSleepDebug.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = DreamSleepDebug.entitlements; sourceTree = "<group>"; }; D0DF90AB28142F1300FC0F64 /* DreamSleepDebug.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = DreamSleepDebug.entitlements; sourceTree = "<group>"; };
D0DF90AC2814390000FC0F64 /* BannerModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BannerModel.h; sourceTree = "<group>"; }; D0DF90AC2814390000FC0F64 /* BannerModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BannerModel.h; sourceTree = "<group>"; };
D0DF90AD2814390000FC0F64 /* BannerModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BannerModel.m; sourceTree = "<group>"; }; D0DF90AD2814390000FC0F64 /* BannerModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BannerModel.m; sourceTree = "<group>"; };
D0E3563828F555B5007190EE /* MessageNotiModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MessageNotiModel.h; sourceTree = "<group>"; }; D0E3563828F555B5007190EE /* MessageOfficialModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MessageOfficialModel.h; sourceTree = "<group>"; };
D0E3563928F555B5007190EE /* MessageNotiModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MessageNotiModel.m; sourceTree = "<group>"; }; D0E3563928F555B5007190EE /* MessageOfficialModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MessageOfficialModel.m; sourceTree = "<group>"; };
D0E3563B28F55A27007190EE /* OfficialNoticeController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OfficialNoticeController.h; sourceTree = "<group>"; }; D0E3563B28F55A27007190EE /* OfficialNoticeController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OfficialNoticeController.h; sourceTree = "<group>"; };
D0E3563C28F55A27007190EE /* OfficialNoticeController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OfficialNoticeController.m; sourceTree = "<group>"; }; D0E3563C28F55A27007190EE /* OfficialNoticeController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OfficialNoticeController.m; sourceTree = "<group>"; };
D0E3563E28F55B50007190EE /* PraiseListController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PraiseListController.h; sourceTree = "<group>"; }; D0E3563E28F55B50007190EE /* PraiseListController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PraiseListController.h; sourceTree = "<group>"; };
...@@ -1561,10 +1567,10 @@ ...@@ -1561,10 +1567,10 @@
D053D0D828F3BB0F00BB2B84 /* ReportView.m */, D053D0D828F3BB0F00BB2B84 /* ReportView.m */,
D053D0E028F40CCC00BB2B84 /* MessageNotiView.h */, D053D0E028F40CCC00BB2B84 /* MessageNotiView.h */,
D053D0E128F40CCC00BB2B84 /* MessageNotiView.m */, D053D0E128F40CCC00BB2B84 /* MessageNotiView.m */,
D053D0E328F41F1300BB2B84 /* MessageNotiCell.h */, D053D0E328F41F1300BB2B84 /* MessageOfficialNotiCell.h */,
D053D0E428F41F1300BB2B84 /* MessageNotiCell.m */, D053D0E428F41F1300BB2B84 /* MessageOfficialNotiCell.m */,
D053D0E628F41FB300BB2B84 /* CommentReplyCell.h */, D053D0E628F41FB300BB2B84 /* MessageComReplyCell.h */,
D053D0E728F41FB300BB2B84 /* CommentReplyCell.m */, D053D0E728F41FB300BB2B84 /* MessageComReplyCell.m */,
D0E3564A28F56181007190EE /* PraiseCell.h */, D0E3564A28F56181007190EE /* PraiseCell.h */,
D0E3564B28F56181007190EE /* PraiseCell.m */, D0E3564B28F56181007190EE /* PraiseCell.m */,
); );
...@@ -1619,8 +1625,10 @@ ...@@ -1619,8 +1625,10 @@
D0B836F128F11C77006E76C0 /* CommentModel.m */, D0B836F128F11C77006E76C0 /* CommentModel.m */,
D0B836F328F11CA0006E76C0 /* ReplyModel.h */, D0B836F328F11CA0006E76C0 /* ReplyModel.h */,
D0B836F428F11CA0006E76C0 /* ReplyModel.m */, D0B836F428F11CA0006E76C0 /* ReplyModel.m */,
D0E3563828F555B5007190EE /* MessageNotiModel.h */, D0E3563828F555B5007190EE /* MessageOfficialModel.h */,
D0E3563928F555B5007190EE /* MessageNotiModel.m */, D0E3563928F555B5007190EE /* MessageOfficialModel.m */,
D003140728FD469B00E01A6A /* MessageComReplyModel.h */,
D003140828FD469B00E01A6A /* MessageComReplyModel.m */,
D0E3564D28F5651C007190EE /* PraiseModel.h */, D0E3564D28F5651C007190EE /* PraiseModel.h */,
D0E3564E28F5651C007190EE /* PraiseModel.m */, D0E3564E28F5651C007190EE /* PraiseModel.m */,
); );
...@@ -1642,6 +1650,8 @@ ...@@ -1642,6 +1650,8 @@
D070A78D28DF02DE0039C5A7 /* DynamicViewModel.m */, D070A78D28DF02DE0039C5A7 /* DynamicViewModel.m */,
D053D0DA28F3C23200BB2B84 /* ReportViewModel.h */, D053D0DA28F3C23200BB2B84 /* ReportViewModel.h */,
D053D0DB28F3C23200BB2B84 /* ReportViewModel.m */, D053D0DB28F3C23200BB2B84 /* ReportViewModel.m */,
D003140428FD449E00E01A6A /* MessageCenterViewModel.h */,
D003140528FD449E00E01A6A /* MessageCenterViewModel.m */,
D06F2C4F28F6AEC50023921E /* PersonDynViewModel.h */, D06F2C4F28F6AEC50023921E /* PersonDynViewModel.h */,
D06F2C5028F6AEC50023921E /* PersonDynViewModel.m */, D06F2C5028F6AEC50023921E /* PersonDynViewModel.m */,
); );
...@@ -2572,6 +2582,7 @@ ...@@ -2572,6 +2582,7 @@
D0C09EE028007E5F00709D4C /* BreatheController.m in Sources */, D0C09EE028007E5F00709D4C /* BreatheController.m in Sources */,
D0A75108282E2A8500589B0E /* NoisePlayBar.m in Sources */, D0A75108282E2A8500589B0E /* NoisePlayBar.m in Sources */,
D0E3564F28F5651C007190EE /* PraiseModel.m in Sources */, D0E3564F28F5651C007190EE /* PraiseModel.m in Sources */,
D003140928FD469B00E01A6A /* MessageComReplyModel.m in Sources */,
D0078C6228E1425500054804 /* InteractView.m in Sources */, D0078C6228E1425500054804 /* InteractView.m in Sources */,
D0C50B4627FD66FB00DC68F0 /* DSConstUtil.m in Sources */, D0C50B4627FD66FB00DC68F0 /* DSConstUtil.m in Sources */,
D0E3565328F56CFE007190EE /* BaseViewController.m in Sources */, D0E3565328F56CFE007190EE /* BaseViewController.m in Sources */,
...@@ -2626,6 +2637,7 @@ ...@@ -2626,6 +2637,7 @@
D06F2C5128F6AEC50023921E /* PersonDynViewModel.m in Sources */, D06F2C5128F6AEC50023921E /* PersonDynViewModel.m in Sources */,
D0D5BB0D286D7A8D00D0507E /* TaskGroupModel.m in Sources */, D0D5BB0D286D7A8D00D0507E /* TaskGroupModel.m in Sources */,
D0E3564028F55B50007190EE /* PraiseListController.m in Sources */, D0E3564028F55B50007190EE /* PraiseListController.m in Sources */,
D003140628FD449E00E01A6A /* MessageCenterViewModel.m in Sources */,
D053D0DF28F40C6A00BB2B84 /* MessageController.m in Sources */, D053D0DF28F40C6A00BB2B84 /* MessageController.m in Sources */,
D043A8B6287EBA4000226176 /* ReadyItemView.m in Sources */, D043A8B6287EBA4000226176 /* ReadyItemView.m in Sources */,
D09BF331280E570D00E5F06C /* UserModel.m in Sources */, D09BF331280E570D00E5F06C /* UserModel.m in Sources */,
...@@ -2638,7 +2650,7 @@ ...@@ -2638,7 +2650,7 @@
D0A3BB9928D9B76C00F58781 /* EvaluateController.m in Sources */, D0A3BB9928D9B76C00F58781 /* EvaluateController.m in Sources */,
D0A3BB9C28D9BA3500F58781 /* EvaluateRequestModel.m in Sources */, D0A3BB9C28D9BA3500F58781 /* EvaluateRequestModel.m in Sources */,
D0071C7028707BCC0035AD8A /* ScoreRulesView.m in Sources */, D0071C7028707BCC0035AD8A /* ScoreRulesView.m in Sources */,
D053D0E528F41F1300BB2B84 /* MessageNotiCell.m in Sources */, D053D0E528F41F1300BB2B84 /* MessageOfficialNotiCell.m in Sources */,
D091BBBB2809079600487A50 /* NSString+Extras.m in Sources */, D091BBBB2809079600487A50 /* NSString+Extras.m in Sources */,
D053D0E228F40CCC00BB2B84 /* MessageNotiView.m in Sources */, D053D0E228F40CCC00BB2B84 /* MessageNotiView.m in Sources */,
D0691E0B287FFB54008BFFAB /* ReadyItem.m in Sources */, D0691E0B287FFB54008BFFAB /* ReadyItem.m in Sources */,
...@@ -2674,7 +2686,7 @@ ...@@ -2674,7 +2686,7 @@
D01814DC27FFD92200583D4E /* DSDataSource.m in Sources */, D01814DC27FFD92200583D4E /* DSDataSource.m in Sources */,
D0B8C3A128F94E4D00279AA6 /* OfficialMessageCell.m in Sources */, D0B8C3A128F94E4D00279AA6 /* OfficialMessageCell.m in Sources */,
D07DACA92810557D0067A1BF /* UIImage+RSKImageCropper.m in Sources */, D07DACA92810557D0067A1BF /* UIImage+RSKImageCropper.m in Sources */,
D053D0E828F41FB300BB2B84 /* CommentReplyCell.m in Sources */, D053D0E828F41FB300BB2B84 /* MessageComReplyCell.m in Sources */,
D01DC95A28702F270035B78B /* RankViewCell.m in Sources */, D01DC95A28702F270035B78B /* RankViewCell.m in Sources */,
D0B5ECC827F2E97A003EDFE3 /* MacroFuncUtil.m in Sources */, D0B5ECC827F2E97A003EDFE3 /* MacroFuncUtil.m in Sources */,
D055BEB928250D3400BC11A4 /* CourseCollectionCell.m in Sources */, D055BEB928250D3400BC11A4 /* CourseCollectionCell.m in Sources */,
...@@ -2689,7 +2701,7 @@ ...@@ -2689,7 +2701,7 @@
D0498874286E95F2000ACF55 /* DsTaskManager.m in Sources */, D0498874286E95F2000ACF55 /* DsTaskManager.m in Sources */,
D0691E05287FEA04008BFFAB /* SleepReadyRequestModel.m in Sources */, D0691E05287FEA04008BFFAB /* SleepReadyRequestModel.m in Sources */,
D0FAC41D281B817D00D4B859 /* GKPhotoBrowser.m in Sources */, D0FAC41D281B817D00D4B859 /* GKPhotoBrowser.m in Sources */,
D0E3563A28F555B5007190EE /* MessageNotiModel.m in Sources */, D0E3563A28F555B5007190EE /* MessageOfficialModel.m in Sources */,
D024CE89287D59FF00FB4320 /* SRMusicView.m in Sources */, D024CE89287D59FF00FB4320 /* SRMusicView.m in Sources */,
D07A4B2A280EA6B600BA0EC0 /* UserInfoTableView.m in Sources */, D07A4B2A280EA6B600BA0EC0 /* UserInfoTableView.m in Sources */,
D05416F7288A57BD0035060B /* AVAudioSession+SXAudioSession.m in Sources */, D05416F7288A57BD0035060B /* AVAudioSession+SXAudioSession.m in Sources */,
......
...@@ -13,11 +13,13 @@ ...@@ -13,11 +13,13 @@
@interface MessageController () <MessageNotiViewDelegate> @interface MessageController () <MessageNotiViewDelegate>
@property (nonatomic, strong) MessageNotiView *messageNotiView; @property (nonatomic, strong) MessageNotiView *messageNotiView;
@property (nonatomic, strong) MessageCenterViewModel *messageCenterVM;
@end @end
@implementation MessageController @implementation MessageController
- (void)loadView { - (void)loadView {
self.messageCenterVM = [MessageCenterViewModel new];
self.view = self.messageNotiView; self.view = self.messageNotiView;
} }
...@@ -25,6 +27,10 @@ ...@@ -25,6 +27,10 @@
[super viewDidLoad]; [super viewDidLoad];
self.navigationItem.title = @"消息中心"; self.navigationItem.title = @"消息中心";
[self.messageCenterVM muiltiRequestWithCompletion:^(BOOL isSuccess) {
if (isSuccess) { [self.messageNotiView reloadData]; }
}];
} }
#pragma mark - MessageNotiViewDelegate #pragma mark - MessageNotiViewDelegate
...@@ -46,7 +52,7 @@ ...@@ -46,7 +52,7 @@
#pragma mark - lazy #pragma mark - lazy
- (MessageNotiView *)messageNotiView { - (MessageNotiView *)messageNotiView {
if (!_messageNotiView) { if (!_messageNotiView) {
_messageNotiView = [[MessageNotiView alloc] initWithDelegate:self]; _messageNotiView = [[MessageNotiView alloc] initWithDelegate:self viewModel:self.messageCenterVM];
} }
return _messageNotiView; return _messageNotiView;
} }
......
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
[self.comDetailViewModel queryCommentRelpyListWithCommentID:self.commentID completion:^(ComDetailViewModel * _Nonnull requestModel) { [self.comDetailViewModel queryCommentRelpyListWithCommentID:self.commentID completion:^(ComDetailViewModel * _Nonnull requestModel) {
if (requestModel.resCode == DSResCodeSuccess) { if (requestModel.resCode == DSResCodeSuccess) {
[self.replyDetailView updateReplyDetailView:requestModel.replyGroupDatas]; [self.replyDetailView updateReplyDetailView:requestModel.replyGroupDatas];
} else {
[DSProgressHUD showToast:requestModel.errMessage];
} }
}]; }];
} }
......
//
// MessageComReplyModel.h
// DreamSleep
//
// Created by peter on 2022/10/17.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/// 消息中心评论和回复数据model
@interface MessageComReplyModel : NSObject
/// 动态或评论 id
@property (nonatomic, assign) NSInteger identifier;
/// 0:动态评论 1 评论回复
@property (nonatomic, assign) NSInteger type;
/// 发布评论或回复的用户 Id
@property (nonatomic, assign) NSInteger userID;
/// 被评论或被回复的用户 id
@property (nonatomic, assign) NSInteger preUserID;
/// 评论的内容或回复内容
@property (nonatomic, copy) NSString *content;
/// 动态内容或评论内容
@property (nonatomic, copy) NSString *preContent;
/// 阅读状态 0 未读 1 已读
@property (nonatomic, assign) NSInteger status;
/// 时间显示
@property (nonatomic, copy) NSString *publishTime;
/// 评论或者回复用户昵称
@property (nonatomic, copy) NSString *nickName;
/// 评论或者回复用户头像
@property (nonatomic, copy) NSString *userProfile;
+ (UIFont *)contentFont;
+ (UIFont *)preContentFont;
+ (CGFloat)contentLeftMargin;
+ (CGFloat)contentRightMargin;
- (CGFloat)contentHeight;
- (CGFloat)preContentHeight;
- (CGFloat)cellHeight;
@end
NS_ASSUME_NONNULL_END
//
// MessageComReplyModel.m
// DreamSleep
//
// Created by peter on 2022/10/17.
//
#import "MessageComReplyModel.h"
@implementation MessageComReplyModel
#pragma mark - YYModel
+ (nullable NSDictionary<NSString *, id> *)modelCustomPropertyMapper {
return @{@"identifier" : @"id",
@"userID" : @"user_id",
@"preUserID" : @"pre_user_id",
@"preContent" : @"pre_content",
@"publishTime" : @"publish_time",
@"nickName" : @"nick_name",
@"userProfile" : @"user_profile"
};
}
#pragma mark - public
+ (UIFont *)contentFont {
return SysFont(14);
}
+ (UIFont *)preContentFont {
return SysFont(14);
}
+ (CGFloat)contentLeftMargin {
return 67;
}
+ (CGFloat)contentRightMargin {
return 50;
}
- (CGFloat)contentHeight {
CGFloat contentW = kScreenWidth - [MessageComReplyModel contentLeftMargin] - [MessageComReplyModel contentRightMargin];
return [UILabel getHeightByWidth:contentW text:self.content font:[MessageComReplyModel contentFont]];
}
- (CGFloat)preContentHeight {
return 20;
}
- (CGFloat)cellHeight {
CGFloat iconH = 40;
CGFloat contentH = [self contentHeight];
CGFloat space = 6;
CGFloat preContentHeight = [self preContentHeight];
CGFloat bottomH = 72;
return iconH +contentH + space + preContentHeight + bottomH;
}
@end
// //
// MessageNotiModel.h // MessageOfficialModel.h
// DreamSleep // DreamSleep
// //
// Created by peter on 2022/10/11. // Created by peter on 2022/10/11.
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/// 消息中心官方通知和收到点赞数据model /// 消息中心官方通知和收到点赞数据model
@interface MessageNotiModel : NSObject @interface MessageOfficialModel : NSObject
@property (nonatomic, copy) NSString *iconName; @property (nonatomic, copy) NSString *iconName;
@property (nonatomic, copy) NSString *title; @property (nonatomic, copy) NSString *title;
@property (nonatomic, copy) NSString *detail; @property (nonatomic, copy) NSString *detail;
......
// //
// MessageNotiModel.m // MessageOfficialModel.m
// DreamSleep // DreamSleep
// //
// Created by peter on 2022/10/11. // Created by peter on 2022/10/11.
// //
#import "MessageNotiModel.h" #import "MessageOfficialModel.h"
@implementation MessageNotiModel @implementation MessageOfficialModel
@end @end
//
// CommentReplyCell.m
// DreamSleep
//
// Created by peter on 2022/10/10.
//
#import "CommentReplyCell.h"
@implementation CommentReplyCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
self.selectionStyle = UITableViewCellSelectionStyleNone;
self.backgroundColor = DSClearColor;
}
return self;
}
@end
// //
// CommentReplyCell.h // MessageComReplyCell.h
// DreamSleep // DreamSleep
// //
// Created by peter on 2022/10/10. // Created by peter on 2022/10/10.
// //
#import <UIKit/UIKit.h> #import "BaseTableViewCell.h"
#import "MessageComReplyModel.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/// 消息中心评论回复cell /// 回复按钮点击回调
@interface CommentReplyCell : UITableViewCell typedef void (^TapReplyBtnBlock)(void);
/// 消息中心评论回复cell
@interface MessageComReplyCell : BaseTableViewCell
@property (nonatomic, copy) TapReplyBtnBlock tapReplyBtnBlock;
@property (nonatomic, strong) MessageComReplyModel *comReplyModel;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
//
// MessageComReplyCell.m
// DreamSleep
//
// Created by peter on 2022/10/10.
//
#import "MessageComReplyCell.h"
@interface MessageComReplyCell ()
@property (nonatomic, strong) UIImageView *icon;
@property (nonatomic, strong) UILabel *nameLab;
@property (nonatomic, strong) UILabel *timeLab;
@property (nonatomic, strong) UILabel *detailLab;
@property (nonatomic, strong) UILabel *mesCountLab;
@property (nonatomic, strong) UILabel *contentLab;
@property (nonatomic, strong) UIView *lineView;
@property (nonatomic, strong) UILabel *preContentLab;
@property (nonatomic, strong) UIButton *replyBtn;
@end
@implementation MessageComReplyCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
self.backgroundColor = DSClearColor;
[self.contentView addSubview:self.icon];
[self.contentView addSubview:self.nameLab];
[self.contentView addSubview:self.timeLab];
[self.contentView addSubview:self.detailLab];
[self.contentView addSubview:self.mesCountLab];
[self.contentView addSubview:self.contentLab];
[self.contentView addSubview:self.lineView];
[self.contentView addSubview:self.preContentLab];
[self.contentView addSubview:self.replyBtn];
[self.icon mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.contentView).offset(15);
make.top.equalTo(self.contentView);
make.size.mas_equalTo(CGSizeMake(40, 40));
}];
[self.detailLab mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.icon.mas_right).offset(12);
make.bottom.equalTo(self.icon);
make.right.equalTo(self.contentView).offset(-12);
}];
}
return self;
}
- (void)setComReplyModel:(MessageComReplyModel *)comReplyModel {
_comReplyModel = comReplyModel;
[self.icon yy_setImageWithURL:[NSURL URLWithString:comReplyModel.userProfile] placeholder:[UIImage defaultPlaceholderWithSize:CGSizeMake(40, 40)]];
self.nameLab.text = comReplyModel.nickName;
self.timeLab.text = comReplyModel.publishTime;
self.detailLab.text = comReplyModel.type == 0 ? @"评论了你的动态" : @"回复你的评论";
self.contentLab.text = comReplyModel.content;
self.preContentLab.text = comReplyModel.preContent;
[self.timeLab sizeToFit];
[self.timeLab mas_remakeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.contentView).offset(-15);
make.top.equalTo(self.contentView).offset(3);
}];
[self.nameLab mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.detailLab);
make.top.equalTo(self.icon);
make.right.equalTo(self.timeLab.mas_left).offset(-12);
}];
[self.contentLab mas_remakeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.icon.mas_bottom).offset(3);
make.left.equalTo(self.contentView).offset([MessageComReplyModel contentLeftMargin]);
make.right.equalTo(self.contentView).offset(-[MessageComReplyModel contentRightMargin]);
make.height.equalTo(@([comReplyModel contentHeight]));
}];
[self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.contentLab);
make.top.equalTo(self.contentLab.mas_bottom).offset(9);
make.size.mas_equalTo(CGSizeMake(2, 14));
}];
[self.preContentLab mas_remakeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.contentLab.mas_bottom).offset(6);
make.left.equalTo(self.lineView.mas_right).offset(4);
make.right.equalTo(self.contentLab);
make.height.equalTo(@([comReplyModel preContentHeight]));
}];
[self.replyBtn mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.contentLab);
make.size.mas_equalTo(CGSizeMake(116, 30));
make.bottom.equalTo(self.contentView).offset(-30);
}];
}
#pragma mark - private
- (void)replyAction {
if (self.tapReplyBtnBlock) { self.tapReplyBtnBlock(); }
}
#pragma mark - lazy
- (UIImageView *)icon {
if (!_icon) {
_icon = [UIImageView new];
_icon.dk_alphaPicker = DKAlphaPickerWithAlphas(1, .5, .5);
[_icon cornerRadius:20];
}
return _icon;
}
- (UILabel *)nameLab {
if (!_nameLab) {
_nameLab = [UILabel labWithFont:BoldFont(15)];
_nameLab.dk_textColorPicker = DKColorPickerWithKey(Dk_TITLE);
}
return _nameLab;
}
- (UILabel *)timeLab {
if (!_timeLab) {
_timeLab = [UILabel labWithFont:SysFont(12)];
_timeLab.dk_textColorPicker = DKColorPickerWithColors(SmallTextColor, ColorFromHexA(0xFFFFFF, .3), DSWhite);
_timeLab.textAlignment = NSTextAlignmentRight;
}
return _timeLab;
}
- (UILabel *)detailLab {
if (!_detailLab) {
_detailLab = [UILabel labWithFont:SysFont(12)];
_detailLab.dk_textColorPicker = DKColorPickerWithColors(SmallTextColor, ColorFromHexA(0xFFFFFF, .3), DSWhite);
}
return _detailLab;
}
- (UILabel *)contentLab {
if (!_contentLab) {
_contentLab = [UILabel labWithFont:[MessageComReplyModel contentFont]];
_contentLab.dk_textColorPicker = DKColorPickerWithColors(SubTitleColor, ColorFromHexA(0xFFFFFF, .5), DSWhite);
_contentLab.numberOfLines = 0;
}
return _contentLab;
}
- (UILabel *)preContentLab {
if (!_preContentLab) {
_preContentLab = [UILabel labWithFont:[MessageComReplyModel preContentFont]];
_preContentLab.dk_textColorPicker = DKColorPickerWithColors(SmallTextColor, ColorFromHexA(0xFFFFFF, .4), DSWhite);
}
return _preContentLab;
}
- (UIView *)lineView {
if (!_lineView) {
_lineView = [UIView new];
_lineView.dk_backgroundColorPicker = DKColorPickerWithColors(ColorFromHex(0xF0F0F0), ColorFromHex(0x1F263F), DSWhite);
[_lineView cornerRadius:3];
}
return _lineView;
}
- (UIButton *)replyBtn {
if (!_replyBtn) {
_replyBtn = [UIButton btnWithTitle:@"回复评论" font:SysFont(12)];
[_replyBtn cornerRadius:15];
[_replyBtn dk_setImage:DKImagePickerWithNames(@"ic_shequ_pinlun", @"dk_ic_shequ_pinlun", @"ic_shequ_pinlun") forState:UIControlStateNormal];
[_replyBtn dk_setTitleColorPicker:DKColorPickerWithColors(SmallTextColor, ColorFromHexA(0xFFFFFF, .3), DSWhite) forState:UIControlStateNormal];
_replyBtn.dk_backgroundColorPicker = DKColorPickerWithColors(BGColor, AlertDarkColor, DSWhite);
[_replyBtn addTarget:self action:@selector(replyAction) forControlEvents:UIControlEventTouchUpInside];
_replyBtn.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 8);
}
return _replyBtn;
}
@end
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "MessageCenterViewModel.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
...@@ -18,7 +19,7 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -18,7 +19,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, weak) id<MessageNotiViewDelegate> messageDelegate; @property (nonatomic, weak) id<MessageNotiViewDelegate> messageDelegate;
- (instancetype)initWithDelegate:(id<MessageNotiViewDelegate>)messageDelegate; - (instancetype)initWithDelegate:(id<MessageNotiViewDelegate>)messageDelegate viewModel:(MessageCenterViewModel *)vm;
@end @end
......
...@@ -6,32 +6,31 @@ ...@@ -6,32 +6,31 @@
// //
#import "MessageNotiView.h" #import "MessageNotiView.h"
#import "MessageNotiCell.h" #import "MessageOfficialNotiCell.h"
#import "CommentReplyCell.h" #import "MessageComReplyCell.h"
static int secHeaderHeight = 52; static int secHeaderHeight = 52;
static int secFooterHeight = 8; static int secFooterHeight = 8;
@interface MessageNotiView () <UITableViewDelegate, UITableViewDataSource> @interface MessageNotiView () <UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) NSArray *messageListArr; @property (nonatomic, strong) MessageCenterViewModel *messageCenterVM;
@end @end
@implementation MessageNotiView @implementation MessageNotiView
- (instancetype)initWithDelegate:(id<MessageNotiViewDelegate>)messageDelegate { - (instancetype)initWithDelegate:(id<MessageNotiViewDelegate>)messageDelegate viewModel:(MessageCenterViewModel *)vm {
if (self = [super initWithFrame:CGRectZero style:UITableViewStyleGrouped]) { if (self = [super initWithFrame:CGRectZero style:UITableViewStyleGrouped]) {
self.messageDelegate = messageDelegate; self.messageDelegate = messageDelegate;
self.messageCenterVM = vm;
self.dk_backgroundColorPicker = DKColorPickerWithColors(DSWhite, DarkColor, DSWhite); self.dk_backgroundColorPicker = DKColorPickerWithColors(DSWhite, DarkColor, DSWhite);
self.messageListArr = @[@"1", @"2"];
self.delegate = self; self.delegate = self;
self.dataSource = self; self.dataSource = self;
self.showsVerticalScrollIndicator = NO; self.showsVerticalScrollIndicator = NO;
self.separatorStyle = UITableViewCellSeparatorStyleNone; self.separatorStyle = UITableViewCellSeparatorStyleNone;
[self registerClass:[MessageNotiCell class] forCellReuseIdentifier:NSStringFromClass([MessageNotiCell class])]; [self registerClass:[MessageOfficialNotiCell class] forCellReuseIdentifier:NSStringFromClass([MessageOfficialNotiCell class])];
[self registerClass:[CommentReplyCell class] forCellReuseIdentifier:NSStringFromClass([CommentReplyCell class])]; [self registerClass:[MessageComReplyCell class] forCellReuseIdentifier:NSStringFromClass([MessageComReplyCell class])];
self.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; self.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
UIView *footView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, CGFLOAT_MIN)]; UIView *footView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, CGFLOAT_MIN)];
self.tableFooterView = footView; self.tableFooterView = footView;
...@@ -41,22 +40,21 @@ static int secFooterHeight = 8; ...@@ -41,22 +40,21 @@ static int secFooterHeight = 8;
#pragma mark - UITableViewDelegate, UITableViewDataSource #pragma mark - UITableViewDelegate, UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return self.messageListArr.count; return self.messageCenterVM.messageListArr.count;
} }
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if (section == 0) { NSArray *sectionArr = self.messageCenterVM.messageListArr[section];
return 2; return sectionArr.count;
} else {
return 10;
}
} }
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0) { if (indexPath.section == 0) {
return 77; return 77;
} else { } else {
return 100; NSArray *userNotiList = self.messageCenterVM.messageListArr[indexPath.section];
MessageComReplyModel *model = userNotiList[indexPath.row];
return [model cellHeight];
} }
} }
...@@ -72,11 +70,12 @@ static int secFooterHeight = 8; ...@@ -72,11 +70,12 @@ static int secFooterHeight = 8;
header.height = 0; header.height = 0;
} else { } else {
header.height = secHeaderHeight; header.height = secHeaderHeight;
NSArray *userNotiList = self.messageCenterVM.messageListArr[section];
UILabel *totalReplyCountLab = [UILabel labWithFont:BoldFont(15)]; UILabel *totalReplyCountLab = [UILabel labWithFont:BoldFont(15)];
totalReplyCountLab.dk_textColorPicker = DKColorPickerWithKey(Dk_TITLE); totalReplyCountLab.dk_textColorPicker = DKColorPickerWithKey(Dk_TITLE);
totalReplyCountLab.origin = CGPointMake(15, 15); totalReplyCountLab.origin = CGPointMake(15, 15);
totalReplyCountLab.text = @"评论和回复"; totalReplyCountLab.text = userNotiList.count ? @"评论和回复" : @"暂无评论回复";
[totalReplyCountLab sizeToFit]; [totalReplyCountLab sizeToFit];
[header addSubview:totalReplyCountLab]; [header addSubview:totalReplyCountLab];
} }
...@@ -85,21 +84,29 @@ static int secFooterHeight = 8; ...@@ -85,21 +84,29 @@ static int secFooterHeight = 8;
} }
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
return section == self.messageListArr.count - 1 ? CGFLOAT_MIN : secFooterHeight; return section == self.messageCenterVM.messageListArr.count - 1 ? CGFLOAT_MIN : secFooterHeight;
} }
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, section == self.messageListArr.count - 1 ? CGFLOAT_MIN : secFooterHeight)]; UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, section == self.messageCenterVM.messageListArr.count - 1 ? CGFLOAT_MIN : secFooterHeight)];
footer.dk_backgroundColorPicker = DKColorPickerWithColors(BGColor, AlertDarkColor, DSWhite); footer.dk_backgroundColorPicker = DKColorPickerWithColors(BGColor, AlertDarkColor, DSWhite);
return footer; return footer;
} }
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0) { if (indexPath.section == 0) {
MessageNotiCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([MessageNotiCell class]) forIndexPath:indexPath]; MessageOfficialNotiCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([MessageOfficialNotiCell class]) forIndexPath:indexPath];
NSArray *officialNotiList = self.messageCenterVM.messageListArr[indexPath.section];
cell.officialModel = officialNotiList[indexPath.row];
return cell; return cell;
} else { } else {
CommentReplyCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([CommentReplyCell class]) forIndexPath:indexPath]; MessageComReplyCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([MessageComReplyCell class]) forIndexPath:indexPath];
NSArray *userNotiList = self.messageCenterVM.messageListArr[indexPath.section];
cell.comReplyModel = userNotiList[indexPath.row];
cell.tapReplyBtnBlock = ^{
#warning 回复功能逻辑未完成...
};
return cell; return cell;
} }
} }
......
// //
// MessageNotiCell.h // MessageOfficialNotiCell.h
// DreamSleep // DreamSleep
// //
// Created by peter on 2022/10/10. // Created by peter on 2022/10/10.
// //
#import <UIKit/UIKit.h> #import "BaseTableViewCell.h"
#import "MessageNotiModel.h" #import "MessageOfficialModel.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/// 消息中心顶部官方通知和点赞通知cell /// 消息中心顶部官方通知和点赞通知cell
@interface MessageNotiCell : UITableViewCell @interface MessageOfficialNotiCell : BaseTableViewCell
@property (nonatomic, strong) MessageNotiModel *messageNotiModel; @property (nonatomic, strong) MessageOfficialModel *officialModel;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
// //
// MessageNotiCell.m // MessageOfficialNotiCell.m
// DreamSleep // DreamSleep
// //
// Created by peter on 2022/10/10. // Created by peter on 2022/10/10.
// //
#import "MessageNotiCell.h" #import "MessageOfficialNotiCell.h"
@interface MessageNotiCell () @interface MessageOfficialNotiCell ()
@property (nonatomic, strong) UIImageView *icon; @property (nonatomic, strong) UIImageView *icon;
@property (nonatomic, strong) UILabel *titleLab; @property (nonatomic, strong) UILabel *titleLab;
@property (nonatomic, strong) UILabel *detailLab; @property (nonatomic, strong) UILabel *detailLab;
@property (nonatomic, strong) UILabel *mesCountLab; @property (nonatomic, strong) UILabel *mesCountLab;
@end @end
@implementation MessageNotiCell @implementation MessageOfficialNotiCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
self.selectionStyle = UITableViewCellSelectionStyleNone;
self.backgroundColor = DSClearColor; self.backgroundColor = DSClearColor;
[self.contentView addSubview:self.icon]; [self.contentView addSubview:self.icon];
[self.contentView addSubview:self.titleLab]; [self.contentView addSubview:self.titleLab];
[self.contentView addSubview:self.detailLab]; [self.contentView addSubview:self.detailLab];
[self.contentView addSubview:self.mesCountLab]; [self.contentView addSubview:self.mesCountLab];
[self.icon mas_makeConstraints:^(MASConstraintMaker *make) { [self.icon mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.contentView).offset(15); make.left.equalTo(self.contentView).offset(15);
make.top.equalTo(self.contentView).offset(18); make.top.equalTo(self.contentView).offset(18);
...@@ -50,14 +49,14 @@ ...@@ -50,14 +49,14 @@
return self; return self;
} }
- (void)setMessageNotiModel:(MessageNotiModel *)messageNotiModel { - (void)setOfficialModel:(MessageOfficialModel *)officialModel {
_messageNotiModel = messageNotiModel; _officialModel = officialModel;
self.icon.image = [UIImage imageNamed:messageNotiModel.iconName]; [self.icon yy_setImageWithURL:[NSURL URLWithString:officialModel.iconName] placeholder:[UIImage defaultPlaceholderWithSize:CGSizeMake(40, 40)]];
self.titleLab.text = messageNotiModel.title; self.titleLab.text = officialModel.title;
self.detailLab.text = messageNotiModel.detail; self.detailLab.text = officialModel.detail;
self.mesCountLab.hidden = !messageNotiModel.messageCount; self.mesCountLab.hidden = !officialModel.messageCount;
self.mesCountLab.text = [NSString stringWithFormat:@"%d", messageNotiModel.messageCount]; self.mesCountLab.text = [NSString stringWithFormat:@"%d", officialModel.messageCount];
} }
#pragma mark - lazy #pragma mark - lazy
......
//
// MessageCenterViewModel.h
// DreamSleep
//
// Created by peter on 2022/10/17.
//
#import "DSNetworkTool.h"
NS_ASSUME_NONNULL_BEGIN
/// 消息中心viewModel
@interface MessageCenterViewModel : DSNetworkTool
/// 官方消息列表和评论回复列表数据
@property (nonatomic, strong) NSArray *messageListArr;
/// 官方通知和用户通知合并请求
/// @param completion completion
- (void)muiltiRequestWithCompletion:(void (^)(BOOL isSuccess))completion;
@end
NS_ASSUME_NONNULL_END
//
// MessageCenterViewModel.m
// DreamSleep
//
// Created by peter on 2022/10/17.
//
#import "MessageCenterViewModel.h"
#import "MessageOfficialModel.h"
#import "MessageComReplyModel.h"
@interface MessageCenterViewModel ()
/// 官方通知列表数据
@property (nonatomic, strong) NSArray<MessageOfficialModel *> *offNotiArr;
/// 用户动态通知列表数据
@property (nonatomic, strong) NSArray<MessageComReplyModel *> *userNotiArr;
@end
@implementation MessageCenterViewModel
#pragma mark - YYModel
+ (nullable NSDictionary<NSString *, id> *)modelCustomPropertyMapper {
return @{@"userNotiArr" : @"result"
};
}
+ (NSDictionary *)modelContainerPropertyGenericClass {
return @{@"userNotiArr":[MessageComReplyModel class]};
}
#pragma mark - 初始化
- (instancetype)init {
if (self = [super init]) {
self.offNotiArr = @[];
self.userNotiArr = @[];
}
return self;
}
#pragma mark - public
- (void)muiltiRequestWithCompletion:(void (^)(BOOL isSuccess))completion {
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
dispatch_group_t group = dispatch_group_create();
dispatch_group_async(group, queue, ^{
[self queryUserMessageCountWithCompletion:^(MessageCenterViewModel *requestModel) {
if (requestModel.resCode == DSResCodeSuccess) {
DSLog(@"获取社区动态消息中心官方和点赞统计未读通知数据成功...");
dispatch_semaphore_signal(semaphore);
} else {
completion(NO);
}
}];
});
dispatch_group_async(group, queue, ^{
[self queryUserDynamicNoticeWithCompletion:^(MessageCenterViewModel *requestModel) {
if (requestModel.resCode == DSResCodeSuccess) {
DSLog(@"社区动态消息中心接口数据成功...");
dispatch_semaphore_signal(semaphore);
} else {
completion(NO);
}
}];
});
dispatch_group_notify(group, queue, ^{
// 2个请求对应2次信号等待
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
// 在这里进行请求后的方法,回到主线程
dispatch_async(dispatch_get_main_queue(), ^{
self.messageListArr = @[self.offNotiArr, self.userNotiArr];
completion(YES);
});
});
}
#pragma mark - private
- (NSURLSessionDataTask *)queryUserMessageCountWithCompletion:(void (^)(MessageCenterViewModel *requestModel))completion {
MessageCenterViewModel *requestModel = [MessageCenterViewModel new];
NSString *api = @"query_user_message_count";
NSString *argStr = [NSString stringWithFormat:@"query{%@}", api];
return [MessageCenterViewModel httpPostBodyRequestWithAPI:api params:@{@"query" : argStr} view:nil hasNetActivity:YES loadingInfo:nil hasFailInfo:NO success:^(NSDictionary * _Nonnull apiDic) {
DSLog(@"社区动态消息中心官方和点赞统计未读通知接口apiDic:%@", apiDic);
requestModel.resCode = DSResCodeSuccess;
NSDictionary *resutDic = apiDic[@"result"];
NSArray *titleArr = @[@"官方通知", @"收到的赞"];
NSArray *detailArr = @[@"暂无消息", @"好高好高好高好高好高好"];
NSArray *messageCountArr = @[resutDic[@"message_count"], resutDic[@"praise_count"]];
NSMutableArray *tmpArr = [NSMutableArray array];
for (int i = 0; i < 2; i++) {
MessageOfficialModel *officialModel = [MessageOfficialModel new];
officialModel.iconName = @"";
officialModel.title = titleArr[i];
officialModel.detail = detailArr[i];
officialModel.messageCount = [messageCountArr[i] intValue];
[tmpArr addObject:officialModel];
}
self.offNotiArr = tmpArr.copy;
completion(requestModel);
} failure:^(id _Nonnull failureInfo) {
requestModel.resCode = [failureInfo[@"errorCode"] integerValue];
requestModel.errMessage = failureInfo[@"errMessage"];
completion(requestModel);
}];
}
- (NSURLSessionDataTask *)queryUserDynamicNoticeWithCompletion:(void (^)(MessageCenterViewModel *viewModel))completion {
MessageCenterViewModel *requestModel = [MessageCenterViewModel new];
NSString *api = @"query_user_dynamic_notice";
NSString *argStr = [NSString stringWithFormat:@"query{%@}", api];
return [MessageCenterViewModel httpPostBodyRequestWithAPI:api params:@{@"query" : argStr} view:nil hasNetActivity:YES loadingInfo:nil hasFailInfo:NO success:^(NSDictionary * _Nonnull apiDic) {
DSLog(@"社区动态消息中心接口apiDic:%@", apiDic);
MessageCenterViewModel *vm = [MessageCenterViewModel yy_modelWithDictionary:apiDic];
requestModel.resCode = DSResCodeSuccess;
self.userNotiArr = vm.userNotiArr.copy;
completion(requestModel);
} failure:^(id _Nonnull failureInfo) {
requestModel.resCode = [failureInfo[@"errorCode"] integerValue];
requestModel.errMessage = failureInfo[@"errMessage"];
completion(requestModel);
}];
}
@end
{
"images" : [
{
"filename" : "dk_ic_shequ_pinlun.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "dk_ic_shequ_pinlun@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "dk_ic_shequ_pinlun@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ic_shequ_pinlun.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_shequ_pinlun@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_shequ_pinlun@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!