Browse Source

小红花功能添加,通知功能调试

master
公司电脑 1 year ago
parent
commit
1136403f8c
  1. 24
      LekangGuard.xcodeproj/project.pbxproj
  2. BIN
      LekangGuard.xcworkspace/xcuserdata/ecell.xcuserdatad/UserInterfaceState.xcuserstate
  3. 160
      LekangGuard.xcworkspace/xcuserdata/ecell.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  4. 11
      LekangGuard/AppDelegate.m
  5. 7
      LekangGuard/Common/BaseViewController.m
  6. 3
      LekangGuard/Managers/APIManager.m
  7. 2
      LekangGuard/Managers/UIModel.h
  8. 11
      LekangGuard/Managers/UIURL.h
  9. 56
      LekangGuard/TabMessage/Model/RedFlowerModel.h
  10. 19
      LekangGuard/TabMessage/Model/RedFlowerModel.m
  11. 52
      LekangGuard/TabMessage/VC/CommMessageDetailsViewController.m
  12. 16
      LekangGuard/TabMessage/VC/MyChildViewController.h
  13. 152
      LekangGuard/TabMessage/VC/MyChildViewController.m
  14. 16
      LekangGuard/TabMessage/VC/OtherChildViewController.h
  15. 149
      LekangGuard/TabMessage/VC/OtherChildViewController.m
  16. 21
      LekangGuard/TabMessage/VC/ReadFlowerViewController.h
  17. 73
      LekangGuard/TabMessage/VC/ReadFlowerViewController.m
  18. 63
      LekangGuard/TabMessage/VC/SchAndJobMessageViewController.m
  19. 100
      LekangGuard/TabMessage/VC/TabMessageViewController.m
  20. 5
      LekangGuard/TabMessage/View/CommMessageTableViewCell.h
  21. 10
      LekangGuard/TabMessage/View/CommMessageTableViewCell.m
  22. 6
      LekangGuard/TabMessage/View/TabMessageTableViewCell.h
  23. 36
      LekangGuard/TabMessage/View/TabMessageTableViewCell.m

24
LekangGuard.xcodeproj/project.pbxproj

@ -202,6 +202,10 @@ @@ -202,6 +202,10 @@
615AD284293446A70066E20C /* PathView.m in Sources */ = {isa = PBXBuildFile; fileRef = 615AD27E293446A60066E20C /* PathView.m */; };
615AD285293446A70066E20C /* WSBezier.m in Sources */ = {isa = PBXBuildFile; fileRef = 615AD282293446A60066E20C /* WSBezier.m */; };
615AD286293446A70066E20C /* UILabel+BezierAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 615AD283293446A60066E20C /* UILabel+BezierAnimation.m */; };
6172BFFF2A7245A000B3247F /* ReadFlowerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6172BFFE2A7245A000B3247F /* ReadFlowerViewController.m */; };
6172C0022A72465B00B3247F /* MyChildViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6172C0012A72465B00B3247F /* MyChildViewController.m */; };
6172C0052A72467500B3247F /* OtherChildViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6172C0042A72467500B3247F /* OtherChildViewController.m */; };
6172C0082A72485B00B3247F /* RedFlowerModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6172C0072A72485B00B3247F /* RedFlowerModel.m */; };
6175597828DAE1C1008E5954 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6175597728DAE1C1008E5954 /* AppDelegate.m */; };
6175597E28DAE1C1008E5954 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6175597D28DAE1C1008E5954 /* ViewController.m */; };
6175598128DAE1C1008E5954 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6175597F28DAE1C1008E5954 /* Main.storyboard */; };
@ -827,6 +831,14 @@ @@ -827,6 +831,14 @@
615AD281293446A60066E20C /* PathView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PathView.h; sourceTree = "<group>"; };
615AD282293446A60066E20C /* WSBezier.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WSBezier.m; sourceTree = "<group>"; };
615AD283293446A60066E20C /* UILabel+BezierAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UILabel+BezierAnimation.m"; sourceTree = "<group>"; };
6172BFFD2A7245A000B3247F /* ReadFlowerViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ReadFlowerViewController.h; sourceTree = "<group>"; };
6172BFFE2A7245A000B3247F /* ReadFlowerViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ReadFlowerViewController.m; sourceTree = "<group>"; };
6172C0002A72465B00B3247F /* MyChildViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyChildViewController.h; sourceTree = "<group>"; };
6172C0012A72465B00B3247F /* MyChildViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MyChildViewController.m; sourceTree = "<group>"; };
6172C0032A72467500B3247F /* OtherChildViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OtherChildViewController.h; sourceTree = "<group>"; };
6172C0042A72467500B3247F /* OtherChildViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OtherChildViewController.m; sourceTree = "<group>"; };
6172C0062A72485B00B3247F /* RedFlowerModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RedFlowerModel.h; sourceTree = "<group>"; };
6172C0072A72485B00B3247F /* RedFlowerModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RedFlowerModel.m; sourceTree = "<group>"; };
6175597328DAE1C1008E5954 /* ECell care.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ECell care.app"; sourceTree = BUILT_PRODUCTS_DIR; };
6175597628DAE1C1008E5954 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
6175597728DAE1C1008E5954 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
@ -1353,6 +1365,12 @@ @@ -1353,6 +1365,12 @@
611551562A3060F100F451E5 /* SchAndJobMessageViewController.m */,
6115516B2A3071A300F451E5 /* CommMessageDetailsViewController.h */,
6115516C2A3071A300F451E5 /* CommMessageDetailsViewController.m */,
6172BFFD2A7245A000B3247F /* ReadFlowerViewController.h */,
6172BFFE2A7245A000B3247F /* ReadFlowerViewController.m */,
6172C0002A72465B00B3247F /* MyChildViewController.h */,
6172C0012A72465B00B3247F /* MyChildViewController.m */,
6172C0032A72467500B3247F /* OtherChildViewController.h */,
6172C0042A72467500B3247F /* OtherChildViewController.m */,
);
path = VC;
sourceTree = "<group>";
@ -1364,6 +1382,8 @@ @@ -1364,6 +1382,8 @@
611551692A30673300F451E5 /* SchModel.m */,
6115516E2A3072F600F451E5 /* JobModel.h */,
6115516F2A3072F700F451E5 /* JobModel.m */,
6172C0062A72485B00B3247F /* RedFlowerModel.h */,
6172C0072A72485B00B3247F /* RedFlowerModel.m */,
);
path = Model;
sourceTree = "<group>";
@ -3545,12 +3565,15 @@ @@ -3545,12 +3565,15 @@
61D478A3295C1713002FC2D4 /* TracingPoint.m in Sources */,
614F0D1B296571F0007A912A /* SETextMagnifierRanged.m in Sources */,
614F0D18296571F0007A912A /* SECompatibility.m in Sources */,
6172C0022A72465B00B3247F /* MyChildViewController.m in Sources */,
6115514A2A2F163B00F451E5 /* SelectCountryViewController.m in Sources */,
61D7AACF2987A28900E982AA /* QMUIRuntime.m in Sources */,
614F0D0B296571F0007A912A /* FLAnimatedImage.m in Sources */,
61D478CD295C3371002FC2D4 /* DLCustomSlideView.m in Sources */,
614F0D21296571F0007A912A /* UIImage+Resize.m in Sources */,
61D7AADC2987A28900E982AA /* UIControl+QMUI.m in Sources */,
6172C0082A72485B00B3247F /* RedFlowerModel.m in Sources */,
6172C0052A72467500B3247F /* OtherChildViewController.m in Sources */,
614F0D08296571F0007A912A /* XHMessageTextView.m in Sources */,
61D7AAD92987A28900E982AA /* UINavigationBar+QMUI.m in Sources */,
615AD2152930ACE90066E20C /* HAndTTableViewCell.m in Sources */,
@ -3652,6 +3675,7 @@ @@ -3652,6 +3675,7 @@
61D7AAD62987A28900E982AA /* QMUIWeakObjectContainer.m in Sources */,
614F0CFA296571F0007A912A /* XHDisplayEmotionViewController.m in Sources */,
614F0D01296571F0007A912A /* XHMessageBubbleView.m in Sources */,
6172BFFF2A7245A000B3247F /* ReadFlowerViewController.m in Sources */,
614F0CF8296571F0007A912A /* XHPhotographyHelper.m in Sources */,
614F0CE8296571F0007A912A /* XHMessageBubbleFactory.m in Sources */,
614F0CF2296571F0007A912A /* XHLocationHelper.m in Sources */,

BIN
LekangGuard.xcworkspace/xcuserdata/ecell.xcuserdatad/UserInterfaceState.xcuserstate generated

Binary file not shown.

160
LekangGuard.xcworkspace/xcuserdata/ecell.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@ -215,22 +215,6 @@ @@ -215,22 +215,6 @@
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "F831815A-9721-4161-9D10-7B3099DBEBCE"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "LekangGuard/AppDelegate.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "88"
endingLineNumber = "88"
landmarkName = "-pushRegistry:didUpdatePushCredentials:forType:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "625F4B24-E0AA-49D9-A7D6-5149D2C23ACA"
shouldBeEnabled = "Yes"
ignoreCount = "0"
@ -279,70 +263,6 @@ @@ -279,70 +263,6 @@
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "2A17EB24-9CF3-4EF0-9FEB-216E5E0E5264"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "LekangGuard/AppDelegate.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "576"
endingLineNumber = "576"
landmarkName = "-applicationWillEnterForeground:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "B0924A14-1832-4CF6-845C-02DB8B0A90B2"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "LekangGuard/AppDelegate.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "595"
endingLineNumber = "595"
landmarkName = "-applicationDidBecomeActive:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "8B277196-9D71-408C-87AE-E9D000A1C9C4"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "LekangGuard/AppDelegate.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "112"
endingLineNumber = "112"
landmarkName = "-pushRegistry:didReceiveIncomingPushWithPayload:forType:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "47381633-E08B-499B-A617-7A4CE863D98B"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "LekangGuard/AppDelegate.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "136"
endingLineNumber = "136"
landmarkName = "-pushRegistry:didReceiveIncomingPushWithPayload:forType:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "8C08A76E-0E8B-4357-8E2E-48DD8629A5AD"
shouldBeEnabled = "No"
ignoreCount = "0"
@ -471,22 +391,6 @@ @@ -471,22 +391,6 @@
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "12E58287-A7C3-4AC7-9998-85B7AA8820BA"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "LekangGuard/Map/VC/MapViewController.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "245"
endingLineNumber = "245"
landmarkName = "-UpdataMapViewLocation:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "048AA93A-A5D5-4D72-B884-68BB82054FF1"
shouldBeEnabled = "Yes"
ignoreCount = "0"
@ -503,22 +407,6 @@ @@ -503,22 +407,6 @@
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "331A16A3-2F68-4F54-9384-A56F543E18AC"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "LekangGuard/Home/Homes/HomeViewController.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "219"
endingLineNumber = "219"
landmarkName = "-GetDeviceList"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "0061FDD1-7DC4-479D-851D-BE7F8C1351B6"
shouldBeEnabled = "Yes"
ignoreCount = "0"
@ -612,5 +500,53 @@ @@ -612,5 +500,53 @@
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "E782D0B5-0F3E-42C9-B6BC-FAD4A5C95E32"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "LekangGuard/AppDelegate.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "112"
endingLineNumber = "112"
landmarkName = "-pushRegistry:didReceiveIncomingPushWithPayload:forType:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "5CF9A57E-A05C-48B1-9CA3-C40AD27E93AB"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "LekangGuard/AppDelegate.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "136"
endingLineNumber = "136"
landmarkName = "-pushRegistry:didReceiveIncomingPushWithPayload:forType:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "45E08455-F827-4700-9A7F-B7E3CC10D47C"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "LekangGuard/AppDelegate.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "168"
endingLineNumber = "168"
landmarkName = "-application:didReceiveRemoteNotification:fetchCompletionHandler:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>

11
LekangGuard/AppDelegate.m

@ -163,21 +163,12 @@ @@ -163,21 +163,12 @@
/**
收到推送的时候触发的
**/
-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
{
[self setNotificationData:userInfo];
completionHandler(UIBackgroundFetchResultNewData);
}
///**
//在前台时推送消息才会调用的接口 ios 10 以上的新接口
// **/
//- (void)userNotificationCenter:(UNUserNotificationCenter *)center
// willPresentNotification:(UNNotification *)notification
// withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler
//{
// [self setNotificationData:notification.request.content.userInfo];
//}
/**
MARK: APP 挂后台的情况下 点击 通知栏跳转到响应页面

7
LekangGuard/Common/BaseViewController.m

@ -272,7 +272,12 @@ @@ -272,7 +272,12 @@
return ;
}
if([msgType isEqualToString:@"redFlower"] || [msgType isEqualToString:@"ZYTZ"] || [msgType isEqualToString:@"XYTZ"])
{
[[NSNotificationCenter defaultCenter] postNotificationName:@"XIAOHONGHUA" object:nil];
return;
}
if([msgType isEqualToString:@"battery"] || [msgType isEqualToString:@"deviceNowLocation"])
{
/// 电量推送和地理位置推送

3
LekangGuard/Managers/APIManager.m

@ -12,7 +12,8 @@ @@ -12,7 +12,8 @@
#ifdef DEBUG
//测试环境
//NSString *const dHostUrl = @"http://api.oversea.ecellsz.com:9876";
NSString *const dHostUrl = @"http://1.13.186.145:8822";
//NSString *const dHostUrl = @"http://1.13.186.145:8822";
NSString *const dHostUrl = @"http://120.77.209.176:8822";
#else
//正式环境
NSString *const dHostUrl = @"http://api.oversea.ecellsz.com:9876";

2
LekangGuard/Managers/UIModel.h

@ -38,7 +38,7 @@ @@ -38,7 +38,7 @@
#import "JobModel.h"
#import "FamilyModel.h"
#import "FeedbackModel.h"
//#import "TihuModel.h"
#import "RedFlowerModel.h"
//#import "BairuiModel.h"

11
LekangGuard/Managers/UIURL.h

@ -304,6 +304,17 @@ @@ -304,6 +304,17 @@
/// 分页查询作业接口
#define HomeWorkPage_GET_URL @"/home-work/query/homeWorkPage"
/// 查询小红花未读总数
#define ReadFlowerCount_GET_URL @"/app/device/query/readFlowerCount"
/// 查询小红花通知列表
#define ReadFlowerList_GET_URL @"/app/device/query/readFlowerList"
/// 修改小红花未读状态接口后面拼接id
#define ReadOwnFlowerStatus_GET_URL @"/app/device/edit/readOwnFlowerStatus/"
/// 查询亲情号
#define FamilyNumber_URL @"/family-number-info/query/familyNumber"

56
LekangGuard/TabMessage/Model/RedFlowerModel.h

@ -0,0 +1,56 @@ @@ -0,0 +1,56 @@
//
// RedFlowerModel.h
// LekangGuard
//
// Created by ecell on 2023/7/27.
//
#import "BaseModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface RedFlowerModel : BaseModel
/// string($date-time) 创建时间
@property (nonatomic ,copy) NSString *createTime;
/// integer($int32) 小红花个数
@property (nonatomic ,assign) NSInteger flowerNumber;
/// string 主键id
@property (nonatomic ,copy) NSString *Id;
/// string imei
@property (nonatomic ,copy) NSString *imei;
/// string 发布内容
@property (nonatomic ,copy) NSString *pushContent;
/// string 发布人id
@property (nonatomic ,copy) NSString *pushId;
/// string 发布人姓名
@property (nonatomic ,copy) NSString *pushName;
/// string 接收人id
@property (nonatomic ,copy) NSString *receiveId;
/// string 是否已读(0.未读,1.是已读)
@property (nonatomic ,assign) NSInteger receiveStatus;
/// string 奖励人id
@property (nonatomic ,copy) NSString *rewardId;
/// string 奖励人姓名
@property (nonatomic ,copy) NSString *rewardName;
/// string 小红花记录id
@property (nonatomic ,copy) NSString *stuRedFlowerId;
/// string($date-time) 更新时间
@property (nonatomic ,copy) NSString *updateTime;
@end
NS_ASSUME_NONNULL_END

19
LekangGuard/TabMessage/Model/RedFlowerModel.m

@ -0,0 +1,19 @@ @@ -0,0 +1,19 @@
//
// RedFlowerModel.m
// LekangGuard
//
// Created by ecell on 2023/7/27.
//
#import "RedFlowerModel.h"
@implementation RedFlowerModel
+ (NSDictionary<NSString *, id> *)modelCustomPropertyMapper
{
return @{
@"Id":@"id"
};
}
@end

52
LekangGuard/TabMessage/VC/CommMessageDetailsViewController.m

@ -51,35 +51,35 @@ @@ -51,35 +51,35 @@
make.top.equalTo(textsLabel.mas_bottom).offset(30);
}];
[self setMessageRead];
// [self setMessageRead];
}
#pragma mark 消息已读
/// 消息已读
- (void)setMessageRead
{
[UICommon MessageUpload:@"加载中"];
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
NSString *url;
if (self.viewType == 0)
{
url = F(@"%@%@", IsReade_GET_URL,self.schModel.noticeId);
}
else
{
url = HomeworkIsReade_GET_URL;
[parameters setValue:self.jobModel.Id forKey:@"homeWorkId"];
[parameters setValue:APIManager.sharedManager.userModel.userId forKey:@"stuOrFatherId"];
}
[[[APIManager sharedManager] APGET:url parameters:parameters resultClass:BaseModel.class] subscribeNext:^(id _Nullable x) {
[UICommon HidenLoading];
} error:^(NSError * _Nullable error) {
NSDictionary *dic = error.userInfo;
[UICommon MessageErrorText:dic[NSLocalizedDescriptionKey]];
}];
}
//#pragma mark 消息已读
///// 消息已读
//- (void)setMessageRead
//{
// [UICommon MessageUpload:@"加载中"];
// NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
// NSString *url;
// if (self.viewType == 0)
// {
// url = F(@"%@%@", IsReade_GET_URL,self.schModel.noticeId);
// }
// else
// {
// url = HomeworkIsReade_GET_URL;
// [parameters setValue:self.jobModel.Id forKey:@"homeWorkId"];
// [parameters setValue:APIManager.sharedManager.userModel.userId forKey:@"stuOrFatherId"];
// }
// [[[APIManager sharedManager] APGET:url parameters:parameters resultClass:BaseModel.class] subscribeNext:^(id _Nullable x) {
// [UICommon HidenLoading];
//
// } error:^(NSError * _Nullable error) {
// NSDictionary *dic = error.userInfo;
// [UICommon MessageErrorText:dic[NSLocalizedDescriptionKey]];
// }];
//}
- (UIScrollView *)bgScrollView
{

16
LekangGuard/TabMessage/VC/MyChildViewController.h

@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
//
// MyChildViewController.h
// LekangGuard
//
// Created by ecell on 2023/7/27.
//
#import "BaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface MyChildViewController : BaseViewController
@end
NS_ASSUME_NONNULL_END

152
LekangGuard/TabMessage/VC/MyChildViewController.m

@ -0,0 +1,152 @@ @@ -0,0 +1,152 @@
//
// MyChildViewController.m
// LekangGuard
//
// Created by ecell on 2023/7/27.
//
#import "MyChildViewController.h"
#import "CommMessageTableViewCell.h"
#import "CommMessageDetailsViewController.h"
@interface MyChildViewController ()<DZNEmptyDataSetSource,DZNEmptyDataSetDelegate>
@property (nonatomic ,strong) CommonTableView *msgTable;
@property (nonatomic ,assign) NSInteger page;
@end
@implementation MyChildViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.page = 1;
self.view.backgroundColor = KKBackgroundGrey;
[self.view addSubview:self.msgTable];
[self.msgTable mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.view);
}];
[UICommon MessageUpload:@"加载中"];
[self getMessageList:TableisReload_h];
}
- (CommonTableView *)msgTable
{
if (!_msgTable)
{
kWeakSelf(self)
_msgTable = [[CommonTableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain cellHeight:50 cellRow:0 isAdaptive:YES isLine:NO commonCell:CommMessageTableViewCell.class createCell:^(ZZTableViewCell * _Nonnull cells, NSIndexPath * _Nonnull indexPath) {
CommMessageTableViewCell *cell = (CommMessageTableViewCell *)cells;
cell.redModel = self.modelListArr[indexPath.row];
} selectedCell:^(UITableView * _Nonnull tableView, NSIndexPath * _Nonnull indexPath) {
RedFlowerModel *redModel = self.modelListArr[indexPath.row];
if (redModel.receiveStatus == 0)
[weakself setMessageRead:redModel IndexPath:indexPath];
} DidscrollView:^(UIScrollView * _Nonnull scrollView) {
}];
_msgTable.backgroundColor = KKClearColor;
_msgTable.emptyDataSetSource = self;
_msgTable.emptyDataSetDelegate = self;
[_msgTable bindHeadRefreshHandler:^{
[UICommon feedbackGenerator];
[weakself getMessageList:TableisReload_h];
} themeColor:KKMainColor refreshStyle:KafkaRefreshStyleReplicatorWoody];
[_msgTable bindFootRefreshHandler:^{
[weakself getMessageList:TableisReload_f];
} themeColor:KKMainColor refreshStyle:KafkaRefreshStyleReplicatorWoody];
}
return _msgTable;
}
#pragma mark 获取校园通知
/// 获取校园通知
- (void)getMessageList:(TableisReload)isReload
{
kWeakSelf(self)
if (isReload == TableisReload_h)
{
self.page = 1;
[self.modelListArr removeAllObjects];
}
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
[parameters setValue:@(self.page) forKey:@"current"];
[parameters setValue:@(20) forKey:@"pageSize"];
[parameters setValue:@(1) forKey:@"flag"];
[[[APIManager sharedManager] APGET:ReadFlowerList_GET_URL parameters:parameters resultClass:BaseModel.class] subscribeNext:^(BaseModel *obj) {
[UICommon HidenLoading];
if (ARRAYHASVALUE(obj.records))
{
[weakself.msgTable.headRefreshControl endRefreshingWithAlertText:@"已为你加载最新数据~" completion:^{
}];
[weakself.msgTable.footRefreshControl endRefreshing];
[obj.records enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
RedFlowerModel *model = [RedFlowerModel yy_modelWithJSON:obj];
[self.modelListArr addObject:model];
}];
weakself.page++;
weakself.msgTable.footRefreshControl.hidden = obj.records.count < KSizeNO ? YES : NO;
weakself.msgTable.cellRow = self.modelListArr.count;
[weakself.msgTable reloadData];
}
} error:^(NSError * _Nullable error) {
NSDictionary *dic = error.userInfo;
[UICommon MessageErrorText:dic[NSLocalizedDescriptionKey]];
}];
}
#pragma mark 消息已读
/// 消息已读
- (void)setMessageRead:(RedFlowerModel *)redModel IndexPath:(NSIndexPath *_Nonnull)indexPath
{
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
NSString *url = F(@"%@%@", ReadOwnFlowerStatus_GET_URL,redModel.Id);
[[[APIManager sharedManager] APGET:url parameters:parameters resultClass:BaseModel.class] subscribeNext:^(id _Nullable x) {
[UICommon HidenLoading];
for (int i = 0; i < self.modelListArr.count; i++)
{
RedFlowerModel *model = self.modelListArr[i];
if (model.Id == redModel.Id)
{
[self.modelListArr removeObject:model];
redModel.receiveStatus = 1;
[self.modelListArr replaceObjectAtIndex:i withObject:redModel];
break;
}
}
[self.msgTable reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath, nil] withRowAnimation:UITableViewRowAnimationNone];
} error:^(NSError * _Nullable error) {
NSDictionary *dic = error.userInfo;
[UICommon MessageErrorText:dic[NSLocalizedDescriptionKey]];
}];
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end

16
LekangGuard/TabMessage/VC/OtherChildViewController.h

@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
//
// OtherChildViewController.h
// LekangGuard
//
// Created by ecell on 2023/7/27.
//
#import "BaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface OtherChildViewController : BaseViewController
@end
NS_ASSUME_NONNULL_END

149
LekangGuard/TabMessage/VC/OtherChildViewController.m

@ -0,0 +1,149 @@ @@ -0,0 +1,149 @@
//
// OtherChildViewController.m
// LekangGuard
//
// Created by ecell on 2023/7/27.
//
#import "OtherChildViewController.h"
#import "CommMessageTableViewCell.h"
#import "CommMessageDetailsViewController.h"
@interface OtherChildViewController ()<DZNEmptyDataSetSource,DZNEmptyDataSetDelegate>
@property (nonatomic ,strong) CommonTableView *msgTable;
@property (nonatomic ,assign) NSInteger page;
@end
@implementation OtherChildViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.page = 1;
self.view.backgroundColor = KKBackgroundGrey;
[self.view addSubview:self.msgTable];
[self.msgTable mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.view);
}];
[UICommon MessageUpload:@"加载中"];
[self getMessageList:TableisReload_h];
}
- (CommonTableView *)msgTable
{
if (!_msgTable)
{
kWeakSelf(self)
_msgTable = [[CommonTableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain cellHeight:50 cellRow:0 isAdaptive:YES isLine:NO commonCell:CommMessageTableViewCell.class createCell:^(ZZTableViewCell * _Nonnull cells, NSIndexPath * _Nonnull indexPath) {
CommMessageTableViewCell *cell = (CommMessageTableViewCell *)cells;
cell.redModel = self.modelListArr[indexPath.row];
} selectedCell:^(UITableView * _Nonnull tableView, NSIndexPath * _Nonnull indexPath) {
RedFlowerModel *redModel = self.modelListArr[indexPath.row];
if (redModel.receiveStatus == 0)
[weakself setMessageRead:redModel IndexPath:indexPath];
} DidscrollView:^(UIScrollView * _Nonnull scrollView) {
}];
_msgTable.backgroundColor = KKClearColor;
_msgTable.emptyDataSetSource = self;
_msgTable.emptyDataSetDelegate = self;
[_msgTable bindHeadRefreshHandler:^{
[UICommon feedbackGenerator];
[weakself getMessageList:TableisReload_h];
} themeColor:KKMainColor refreshStyle:KafkaRefreshStyleReplicatorWoody];
[_msgTable bindFootRefreshHandler:^{
[weakself getMessageList:TableisReload_f];
} themeColor:KKMainColor refreshStyle:KafkaRefreshStyleReplicatorWoody];
}
return _msgTable;
}
#pragma mark 获取校园通知
/// 获取校园通知
- (void)getMessageList:(TableisReload)isReload
{
kWeakSelf(self)
if (isReload == TableisReload_h)
{
self.page = 1;
[self.modelListArr removeAllObjects];
}
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
[parameters setValue:@(self.page) forKey:@"current"];
[parameters setValue:@(20) forKey:@"pageSize"];
[parameters setValue:@(0) forKey:@"flag"];
[[[APIManager sharedManager] APGET:ReadFlowerList_GET_URL parameters:parameters resultClass:BaseModel.class] subscribeNext:^(BaseModel *obj) {
[UICommon HidenLoading];
if (ARRAYHASVALUE(obj.records))
{
[weakself.msgTable.headRefreshControl endRefreshingWithAlertText:@"已为你加载最新数据~" completion:^{
}];
[weakself.msgTable.footRefreshControl endRefreshing];
[obj.records enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
RedFlowerModel *model = [RedFlowerModel yy_modelWithJSON:obj];
[self.modelListArr addObject:model];
}];
weakself.page++;
weakself.msgTable.footRefreshControl.hidden = obj.records.count < KSizeNO ? YES : NO;
weakself.msgTable.cellRow = self.modelListArr.count;
[weakself.msgTable reloadData];
}
} error:^(NSError * _Nullable error) {
NSDictionary *dic = error.userInfo;
[UICommon MessageErrorText:dic[NSLocalizedDescriptionKey]];
}];
}
#pragma mark 消息已读
/// 消息已读
- (void)setMessageRead:(RedFlowerModel *)redModel IndexPath:(NSIndexPath *_Nonnull)indexPath
{
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
NSString *url = F(@"%@%@", ReadOwnFlowerStatus_GET_URL,redModel.Id);
[[[APIManager sharedManager] APGET:url parameters:parameters resultClass:BaseModel.class] subscribeNext:^(id _Nullable x) {
[UICommon HidenLoading];
for (int i = 0; i < self.modelListArr.count; i++)
{
RedFlowerModel *model = self.modelListArr[i];
if (model.Id == redModel.Id)
{
[self.modelListArr removeObject:model];
redModel.receiveStatus = 1;
[self.modelListArr replaceObjectAtIndex:i withObject:redModel];
break;
}
}
[self.msgTable reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath, nil] withRowAnimation:UITableViewRowAnimationNone];
} error:^(NSError * _Nullable error) {
NSDictionary *dic = error.userInfo;
[UICommon MessageErrorText:dic[NSLocalizedDescriptionKey]];
}];
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end

21
LekangGuard/TabMessage/VC/ReadFlowerViewController.h

@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
//
// ReadFlowerViewController.h
// LekangGuard
//
// Created by ecell on 2023/7/27.
//
#import "BaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface ReadFlowerViewController : BaseViewController
/**
*/
@property (assign , nonatomic)NSInteger selectedIndex;
@end
NS_ASSUME_NONNULL_END

73
LekangGuard/TabMessage/VC/ReadFlowerViewController.m

@ -0,0 +1,73 @@ @@ -0,0 +1,73 @@
//
// ReadFlowerViewController.m
// LekangGuard
//
// Created by ecell on 2023/7/27.
//
#import "ReadFlowerViewController.h"
#import "MCPageView.h"
#import "MyChildViewController.h"
#import "OtherChildViewController.h"
@interface ReadFlowerViewController ()<MCPageViewDelegate>
@property (nonatomic , strong) MCPageView * PageView;
@property (nonatomic ,strong) NSMutableArray *controllers;
@end
@implementation ReadFlowerViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.zx_navTitle = GJText(@"小红花");
self.controllers = [NSMutableArray array];
NSMutableArray *titles = [NSMutableArray array];
[titles addObject:GJText(@"我的小孩")];
[titles addObject:GJText(@"其他小孩")];
MyChildViewController *vc = [MyChildViewController new];
OtherChildViewController *vc1 = [OtherChildViewController new];
[self.controllers addObject:vc];
[self.controllers addObject:vc1];
self.PageView = [[MCPageView alloc]initWithFrame:CGRectMake(0, iPhoneX_NavHeight, SCREEN_WIDTH,SCREEN_HEIGHT-iPhoneX_NavHeight) titles:titles controllers:self.controllers];
self.PageView.delegate = self;
//self.PageView.titleButtonWidth = Adapted(94);
self.PageView.backgroundColor = KKWhiteColorColor;
self.PageView.lineWitdhScale = 0.65;
self.PageView.lineColor = KKMainColor;
self.PageView.selectTitleFont = FontBoldADA_(16);
self.PageView.defaultTitleFont = FontADA_(14);
self.PageView.defaultTitleColor = KKTextBlackColor;
self.PageView.selectTitleColor = KKMainColor;
self.PageView.lastItemBackgroundColor = KKClearColor;
[self.view addSubview:self.PageView];
[self zx_setPopGestureCompatibleScrollViews:@[self.PageView.titleScroll,self.PageView.contentCollection]];
[self.PageView selectIndex:self.selectedIndex];
}
- (void)MCPageView:(MCPageView *)MCPageView didSelectIndex:(NSInteger)Index
{
NSLog(@"%ld",Index);
//MarketEntrustTableView *vc = self.controllers[Index];
self.selectedIndex = Index;
//self.viewPage = Index;
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end

63
LekangGuard/TabMessage/VC/SchAndJobMessageViewController.m

@ -59,6 +59,8 @@ @@ -59,6 +59,8 @@
vc.jobModel = self.modelListArr[indexPath.row];
[self.navigationController pushViewController:vc animated:YES];
[self setMessageRead:self.modelListArr[indexPath.row] IndexPath:indexPath];
} DidscrollView:^(UIScrollView * _Nonnull scrollView) {
}];
@ -126,6 +128,67 @@ @@ -126,6 +128,67 @@
}];
}
#pragma mark 消息已读
/// 消息已读
- (void)setMessageRead:(id)Models IndexPath:(NSIndexPath *_Nonnull)indexPath
{
[UICommon MessageUpload:@"加载中"];
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
NSString *url;
if (self.viewType == 0)
{
SchModel *schModel = Models;
url = F(@"%@%@", IsReade_GET_URL,schModel.noticeId);
}
else
{
JobModel *jobModel = Models;
url = HomeworkIsReade_GET_URL;
[parameters setValue:jobModel.Id forKey:@"homeWorkId"];
[parameters setValue:APIManager.sharedManager.userModel.userId forKey:@"stuOrFatherId"];
}
[[[APIManager sharedManager] APGET:url parameters:parameters resultClass:BaseModel.class] subscribeNext:^(id _Nullable x) {
[UICommon HidenLoading];
for (int i = 0; i < self.modelListArr.count; i++)
{
if (self.viewType == 0)
{
SchModel *schModel = Models;
SchModel *model = self.modelListArr[i];
if (model.noticeId == schModel.noticeId)
{
[self.modelListArr removeObject:model];
schModel.sendReadStatus = 3;
[self.modelListArr replaceObjectAtIndex:i withObject:schModel];
break;
}
}
else
{
JobModel *jobModel = Models;
JobModel *model = self.modelListArr[i];
if (model.Id == jobModel.Id)
{
[self.modelListArr removeObject:model];
jobModel.receiveStatus = 3;
[self.modelListArr replaceObjectAtIndex:i withObject:jobModel];
break;
}
}
}
[self.schMsgTable reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath, nil] withRowAnimation:UITableViewRowAnimationNone];
} error:^(NSError * _Nullable error) {
NSDictionary *dic = error.userInfo;
[UICommon MessageErrorText:dic[NSLocalizedDescriptionKey]];
}];
}
/*
#pragma mark - Navigation

100
LekangGuard/TabMessage/VC/TabMessageViewController.m

@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
#import "TabMessageTableViewCell.h"
#import "MessageViewController.h"
#import "SchAndJobMessageViewController.h"
#import "ReadFlowerViewController.h"
@interface TabMessageViewController ()
@ -17,6 +18,10 @@ @@ -17,6 +18,10 @@
@property (nonatomic ,strong) NSArray *titleArr;
@property (nonatomic ,strong) NSArray *imageArr;
@property (nonatomic ,strong) NSMutableArray *msgNumArr;
@property (nonatomic ,strong) NSNumber *msgTotalCount;///消息未读总数
@end
@implementation TabMessageViewController
@ -26,14 +31,19 @@ @@ -26,14 +31,19 @@
// Do any additional setup after loading the view.
self.zx_navTitle = @"消息";
self.view.backgroundColor = KKBackgroundGrey;
self.titleArr = @[@"校园通知",@"班级作业",@"设备消息"];
self.imageArr = @[@"msg_sch_icon",@"msg_job_icon",@"msg_device_icon"];
self.titleArr = @[@"校园通知",@"班级作业",@"设备消息",@"小红花"];
self.imageArr = @[@"msg_sch_icon",@"msg_job_icon",@"msg_device_icon",@"msg_device_icon"];
[self.view addSubview:self.msgTable];
[self.msgTable mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self.view);
make.top.equalTo(self.view).offset(iPhoneX_NavHeight);
make.bottom.equalTo(self.view);
}];
[[[NSNotificationCenter defaultCenter] rac_addObserverForName:@"XIAOHONGHUA" object:nil] subscribeNext:^(NSNotification *x) {
[self getHomeWorkCount];
[self getReadFlowerCount];
}];
}
- (CommonTableView *)msgTable
@ -45,6 +55,7 @@ @@ -45,6 +55,7 @@
TabMessageTableViewCell *cell = (TabMessageTableViewCell *)cells;
cell.titleStr = self.titleArr[indexPath.row];
cell.imageStr = self.imageArr[indexPath.row];
cell.msgTotalCount = self.msgNumArr[indexPath.row];
} selectedCell:^(UITableView * _Nonnull tableView, NSIndexPath * _Nonnull indexPath) {
if (indexPath.row < 2)
@ -60,6 +71,11 @@ @@ -60,6 +71,11 @@
vc.selectedIndex = 0;
[self.navigationController pushViewController:vc animated:YES];
}
else
{
ReadFlowerViewController *vc = [[ReadFlowerViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
}
} DidscrollView:^(UIScrollView * _Nonnull scrollView) {
@ -70,6 +86,86 @@ @@ -70,6 +86,86 @@
return _msgTable;
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[self getHomeWorkCount];
[self getUnReadTotal];
[self getReadFlowerCount];
}
#pragma mark 查询未读作业总数
/// 查询未读作业总数
- (void)getHomeWorkCount
{
kWeakSelf(self)
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
[[[APIManager sharedManager] APGET:HomeWorkCount_GET_URL parameters:parameters resultClass:nil] subscribeNext:^(id _Nullable x) {
[UICommon HidenLoading];
NSNumber *campusCount = x[@"campusCount"];
NSNumber *homeWokeCount = x[@"homeWokeCount"];
[weakself.msgNumArr replaceObjectAtIndex:0 withObject:campusCount];
[weakself.msgNumArr replaceObjectAtIndex:1 withObject:homeWokeCount];
[weakself.msgTable reloadData];
} error:^(NSError * _Nullable error) {
NSDictionary *dic = error.userInfo;
[UICommon MessageErrorText:dic[NSLocalizedDescriptionKey]];
}];
}
#pragma mark 查询未读消息数
/// 查询未读消息数
- (void)getUnReadTotal
{
kWeakSelf(self)
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
[[[APIManager sharedManager] APGET:UnReadTotal_URL parameters:parameters resultClass:nil] subscribeNext:^(NSArray *arr) {
[UICommon HidenLoading];
if (ARRAYHASVALUE(arr))
{
[arr enumerateObjectsUsingBlock:^(NSDictionary *obj, NSUInteger idx, BOOL * _Nonnull stop) {
weakself.msgTotalCount = obj[@"total"];
}];
[weakself.msgNumArr replaceObjectAtIndex:2 withObject:weakself.msgTotalCount];
[weakself.msgTable reloadData];
}
} error:^(NSError * _Nullable error) {
NSDictionary *dic = error.userInfo;
[UICommon MessageErrorText:dic[NSLocalizedDescriptionKey]];
}];
}
#pragma mark 查询小红花未读总数
/// 查询小红花未读总数
- (void)getReadFlowerCount
{
kWeakSelf(self)
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
[[[APIManager sharedManager] APGET:ReadFlowerCount_GET_URL parameters:parameters resultClass:nil] subscribeNext:^(id _Nullable x) {
[UICommon HidenLoading];
NSNumber *redTotalCount = x[@"totalCount"];
[weakself.msgNumArr replaceObjectAtIndex:3 withObject:redTotalCount];
[weakself.msgTable reloadData];
} error:^(NSError * _Nullable error) {
NSDictionary *dic = error.userInfo;
[UICommon MessageErrorText:dic[NSLocalizedDescriptionKey]];
}];
}
- (NSMutableArray *)msgNumArr
{
if (!_msgNumArr)
{
_msgNumArr = [NSMutableArray new];
[_msgNumArr addObject:@"0"];
[_msgNumArr addObject:@"0"];
[_msgNumArr addObject:@"0"];
[_msgNumArr addObject:@"0"];
}
return _msgNumArr;
}
/*
#pragma mark - Navigation

5
LekangGuard/TabMessage/View/CommMessageTableViewCell.h

@ -17,6 +17,11 @@ NS_ASSUME_NONNULL_BEGIN @@ -17,6 +17,11 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic ,strong) JobModel *jobModel;
/// 小红花
@property (nonatomic ,strong) RedFlowerModel *redModel;
@end
NS_ASSUME_NONNULL_END

10
LekangGuard/TabMessage/View/CommMessageTableViewCell.m

@ -36,6 +36,16 @@ @@ -36,6 +36,16 @@
return self;
}
- (void)setRedModel:(RedFlowerModel *)redModel
{
_redModel = redModel;
self.titleLabel.text = @"小红花奖励";
self.textsLabel.text = F(@"%@因%@获得%ld朵小红花以兹鼓励.", redModel.rewardName,redModel.pushContent,redModel.flowerNumber);
self.commLabel.text = redModel.pushName;
self.timeLabel.text = redModel.createTime;
self.statusLabel.hidden = redModel.receiveStatus == 0 ? NO : YES;
}
- (void)setSchModel:(SchModel *)schModel
{
_schModel = schModel;

6
LekangGuard/TabMessage/View/TabMessageTableViewCell.h

@ -17,6 +17,12 @@ NS_ASSUME_NONNULL_BEGIN @@ -17,6 +17,12 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic ,strong) NSString *imageStr;
@property (nonatomic ,strong) NSNumber *campusCount;///校园通知未读总数
@property (nonatomic ,strong) NSNumber *homeWokeCount;///作业通知未读总数
@property (nonatomic ,strong) NSNumber *redTotalCount;///小红花未读总数
@property (nonatomic ,strong) NSNumber *msgTotalCount;///消息未读总数
@end
NS_ASSUME_NONNULL_END

36
LekangGuard/TabMessage/View/TabMessageTableViewCell.m

@ -9,11 +9,15 @@ @@ -9,11 +9,15 @@
@interface TabMessageTableViewCell ()
/// <#arguments#>
@property (nonatomic ,weak) UIView *bgView;
@property (nonatomic ,weak) UIImageView *iconImg;
@property (nonatomic ,weak) UILabel *titleLabel;
@property (nonatomic ,weak) UILabel *msgNumLabel;
@end
@implementation TabMessageTableViewCell
@ -31,6 +35,23 @@ @@ -31,6 +35,23 @@
return self;
}
-(void)setMsgTotalCount:(NSNumber *)msgTotalCount
{
_msgTotalCount = msgTotalCount;
self.msgNumLabel.hidden = msgTotalCount.integerValue > 0 ? NO : YES;
self.msgNumLabel.text = F(@"%@", msgTotalCount);
if (msgTotalCount.integerValue > 0)
{
CGFloat ww = msgTotalCount.integerValue > 9 && msgTotalCount.integerValue < 100 ? 25 : msgTotalCount.integerValue > 99 ? 32 : 20;
[self.msgNumLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.bgView.mas_right).inset(15);
make.centerY.equalTo(self.bgView);
make.size.mas_equalTo(CGSizeMake(ww, 20));
}];
}
}
- (void)setTitleStr:(NSString *)titleStr
{
_titleStr = titleStr;
@ -46,6 +67,7 @@ @@ -46,6 +67,7 @@
- (void)subCellView
{
UIView *bgView = [UICommon ui_view:CGRectZero backgroundColor:KKWhiteColorColor cornerRadius:10 borderWidth:0 borderColor:KKWhiteColorColor];
self.bgView = bgView;
[self.contentView addSubview:bgView];
[bgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self.contentView).inset(15);
@ -69,6 +91,20 @@ @@ -69,6 +91,20 @@
make.left.equalTo(iconImg.mas_right).offset(10);
make.centerY.equalTo(bgView);
}];
UILabel *msgNumLabel = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentCenter font:Font_(13) textColor:KKWhiteColorColor text:@"" Radius:10];
msgNumLabel.layer.borderWidth = 1.5;
msgNumLabel.layer.borderColor = KKWhiteColorColor.CGColor;
msgNumLabel.backgroundColor = RGB(254, 83, 71);
msgNumLabel.hidden = YES;
self.msgNumLabel = msgNumLabel;
[bgView addSubview:msgNumLabel];
[msgNumLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(bgView.mas_right).inset(15);
make.centerY.equalTo(bgView);
make.size.mas_equalTo(CGSizeMake(20, 20));
}];
}
- (void)awakeFromNib {

Loading…
Cancel
Save