Browse Source

bug修改

master
公司电脑 2 years ago
parent
commit
76a9ef1bff
  1. 6
      LekangGuard.xcodeproj/project.pbxproj
  2. BIN
      LekangGuard.xcworkspace/xcuserdata/ecell.xcuserdatad/UserInterfaceState.xcuserstate
  3. 116
      LekangGuard.xcworkspace/xcuserdata/ecell.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  4. 2
      LekangGuard/AppDelegate.m
  5. 8
      LekangGuard/Common/BaseViewController.m
  6. 2
      LekangGuard/Home/Contacts(电话本)/AmendContactsViewController.m
  7. 1
      LekangGuard/Home/Contacts(电话本)/ContactsViewController.m
  8. 19
      LekangGuard/Home/Contacts(电话本)/View/FamilyTableViewCell.h
  9. 116
      LekangGuard/Home/Contacts(电话本)/View/FamilyTableViewCell.m
  10. 2
      LekangGuard/Home/Contacts(电话本)/View/OtherTableViewCell.m
  11. 2
      LekangGuard/Home/Homes/AddWatchViewController.m
  12. 4
      LekangGuard/Home/Homes/HomeViewController.m
  13. 154
      LekangGuard/Home/Homes/View/HomeTableViewCell.m
  14. 2
      LekangGuard/Home/MoreService (更多功能)/EditDeviceViewController.m
  15. 21
      LekangGuard/Login/RegisterViewController.m
  16. 12
      LekangGuard/Managers/APIManager.h
  17. 119
      LekangGuard/Managers/APIManager.m
  18. 4
      LekangGuard/Map/VC/MapViewController.m
  19. 29
      LekangGuard/My/VC/Message(消息)/AttentionMessageViewController.m
  20. 50
      LekangGuard/My/VC/Message(消息)/RemindMessageViewController.m
  21. 54
      LekangGuard/My/VC/Message(消息)/SystermMessageViewController.m
  22. 11
      LekangGuard/My/VC/ModifyDataViewController.m
  23. 4
      LekangGuard/en.lproj/Localizable.strings
  24. 2
      LekangGuard/zh-Hans.lproj/Localizable.strings

6
LekangGuard.xcodeproj/project.pbxproj

@ -274,7 +274,6 @@ @@ -274,7 +274,6 @@
61BE9D282963BF2800962512 /* wav.mm in Sources */ = {isa = PBXBuildFile; fileRef = 61BE9D212963BF2800962512 /* wav.mm */; };
61BE9D292963BF2800962512 /* amrFileCodec.mm in Sources */ = {isa = PBXBuildFile; fileRef = 61BE9D222963BF2800962512 /* amrFileCodec.mm */; };
61CA2BB72934876100605022 /* ContactsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 61CA2BB62934876100605022 /* ContactsViewController.m */; };
61CA2BBA29349D4E00605022 /* FamilyTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 61CA2BB929349D4E00605022 /* FamilyTableViewCell.m */; };
61CA2BBE29349D6F00605022 /* OtherTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 61CA2BBD29349D6F00605022 /* OtherTableViewCell.m */; };
61CA2BC229349E0300605022 /* ContactsModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 61CA2BC129349E0300605022 /* ContactsModel.m */; };
61CA2BC529359AB600605022 /* ChoosePersonAddressVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 61CA2BC429359AB600605022 /* ChoosePersonAddressVC.m */; };
@ -1017,8 +1016,6 @@ @@ -1017,8 +1016,6 @@
61BE9D242963BF2800962512 /* wav.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wav.h; sourceTree = "<group>"; };
61CA2BB52934876100605022 /* ContactsViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ContactsViewController.h; sourceTree = "<group>"; };
61CA2BB62934876100605022 /* ContactsViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ContactsViewController.m; sourceTree = "<group>"; };
61CA2BB829349D4E00605022 /* FamilyTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FamilyTableViewCell.h; sourceTree = "<group>"; };
61CA2BB929349D4E00605022 /* FamilyTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FamilyTableViewCell.m; sourceTree = "<group>"; };
61CA2BBC29349D6F00605022 /* OtherTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OtherTableViewCell.h; sourceTree = "<group>"; };
61CA2BBD29349D6F00605022 /* OtherTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OtherTableViewCell.m; sourceTree = "<group>"; };
61CA2BC029349E0300605022 /* ContactsModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ContactsModel.h; sourceTree = "<group>"; };
@ -2624,8 +2621,6 @@ @@ -2624,8 +2621,6 @@
61CA2BBB29349D5300605022 /* View */ = {
isa = PBXGroup;
children = (
61CA2BB829349D4E00605022 /* FamilyTableViewCell.h */,
61CA2BB929349D4E00605022 /* FamilyTableViewCell.m */,
61CA2BBC29349D6F00605022 /* OtherTableViewCell.h */,
61CA2BBD29349D6F00605022 /* OtherTableViewCell.m */,
61CA2BC629359C8F00605022 /* ChooseContactTableViewCell.h */,
@ -3705,7 +3700,6 @@ @@ -3705,7 +3700,6 @@
614F0CF8296571F0007A912A /* XHPhotographyHelper.m in Sources */,
614F0CE8296571F0007A912A /* XHMessageBubbleFactory.m in Sources */,
614F0CF2296571F0007A912A /* XHLocationHelper.m in Sources */,
61CA2BBA29349D4E00605022 /* FamilyTableViewCell.m in Sources */,
61D7AAE22987A28900E982AA /* UITraitCollection+QMUI.m in Sources */,
61D478CC295C3371002FC2D4 /* DLUtility.m in Sources */,
6133637328E2ECD200BF4A14 /* TabBarViewController.m in Sources */,

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

Binary file not shown.

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

@ -199,22 +199,6 @@ @@ -199,22 +199,6 @@
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "ECC08AB3-455B-4233-883B-57906F39DA8D"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "LekangGuard/Managers/APIManager.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "652"
endingLineNumber = "652"
landmarkName = "-PostBodyWithApi:json:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "202FABB2-7891-4201-A825-A3894F9D868B"
shouldBeEnabled = "Yes"
ignoreCount = "0"
@ -302,8 +286,8 @@ @@ -302,8 +286,8 @@
filePath = "LekangGuard/AppDelegate.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "577"
endingLineNumber = "577"
startingLineNumber = "575"
endingLineNumber = "575"
landmarkName = "-applicationWillEnterForeground:"
landmarkType = "7">
</BreakpointContent>
@ -318,8 +302,8 @@ @@ -318,8 +302,8 @@
filePath = "LekangGuard/AppDelegate.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "596"
endingLineNumber = "596"
startingLineNumber = "594"
endingLineNumber = "594"
landmarkName = "-applicationDidBecomeActive:"
landmarkType = "7">
</BreakpointContent>
@ -414,8 +398,8 @@ @@ -414,8 +398,8 @@
filePath = "LekangGuard/Home/Contacts(&#x7535;&#x8bdd;&#x672c;)/ContactsViewController.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "202"
endingLineNumber = "202"
startingLineNumber = "201"
endingLineNumber = "201"
landmarkName = "-tableView:didSelectRowAtIndexPath:"
landmarkType = "7">
</BreakpointContent>
@ -423,65 +407,113 @@ @@ -423,65 +407,113 @@
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "E51AC97B-1E74-4E6D-BADE-5BDFD3DF130C"
uuid = "78EB7462-D0E1-4C44-A9AA-5BB0A2F739DD"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "LekangGuard/Home/MoreService (&#x66f4;&#x591a;&#x529f;&#x80fd;)/EditDeviceViewController.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "531"
endingLineNumber = "531"
landmarkName = "-UpdateDeviceInfo"
startingLineNumber = "480"
endingLineNumber = "480"
landmarkName = "-imagePickerController:didFinishPickingMediaWithInfo:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "78EB7462-D0E1-4C44-A9AA-5BB0A2F739DD"
uuid = "88DAE6D8-1A40-463F-9520-DEE1184A3778"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "LekangGuard/Home/MoreService (&#x66f4;&#x591a;&#x529f;&#x80fd;)/EditDeviceViewController.m"
filePath = "LekangGuard/Login/RegisterViewController.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "480"
endingLineNumber = "480"
landmarkName = "-imagePickerController:didFinishPickingMediaWithInfo:"
startingLineNumber = "222"
endingLineNumber = "222"
landmarkName = "-UserRegister"
landmarkType = "7">
<Locations>
<Location
uuid = "88DAE6D8-1A40-463F-9520-DEE1184A3778 - feae137b449f49ea"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "-[RegisterViewController UserRegister]"
moduleName = "ECell care"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/ecell/LekangGuard/LekangGuard/Login/RegisterViewController.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "222"
endingLineNumber = "222"
offsetFromSymbolStart = "1700">
</Location>
<Location
uuid = "88DAE6D8-1A40-463F-9520-DEE1184A3778 - bdfc930f80ca2fc"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "__38-[RegisterViewController UserRegister]_block_invoke"
moduleName = "ECell care"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/ecell/LekangGuard/LekangGuard/Login/RegisterViewController.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "223"
endingLineNumber = "223"
offsetFromSymbolStart = "52">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "95518CD8-B77F-491C-92AA-5D2F3553EF07"
uuid = "E24D1FE3-9638-47E9-9056-BCDD41072F58"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "LekangGuard/My/VC/ModifyDataViewController.m"
filePath = "LekangGuard/Login/RegisterViewController.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "139"
endingLineNumber = "139"
landmarkName = "-UpdateInfo"
startingLineNumber = "230"
endingLineNumber = "230"
landmarkName = "-UserRegister"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "B0C46858-94C7-4F36-A868-836B3B4AFE1E"
uuid = "D822600E-7CC2-463F-A765-BB582E46B702"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "LekangGuard/Common/BaseViewController.m"
filePath = "LekangGuard/My/VC/Message(&#x6d88;&#x606f;)/RemindMessageViewController.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "276"
endingLineNumber = "276"
landmarkName = "-pusMessage"
landmarkType = "7">
startingLineNumber = "266"
endingLineNumber = "266"
landmarkName = "RemindMessageViewController"
landmarkType = "3">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "4E9B91CE-F395-4872-89AD-E8E87E7EC363"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "LekangGuard/My/VC/Message(&#x6d88;&#x606f;)/AttentionMessageViewController.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "257"
endingLineNumber = "257"
landmarkName = "AttentionMessageViewController"
landmarkType = "3">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>

2
LekangGuard/AppDelegate.m

@ -256,8 +256,6 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response @@ -256,8 +256,6 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
//其他的消息 , 比如 主动定位推送的消息,群解散 等 的f
[[NSNotificationCenter defaultCenter] postNotificationName:dict[@"type"] object:dict];
}
}
}

8
LekangGuard/Common/BaseViewController.m

@ -291,11 +291,14 @@ @@ -291,11 +291,14 @@
}
if([NSStringFromClass([viewController class]) isEqualToString:@"WatchHomeViewController"] ||
[NSStringFromClass([viewController class]) isEqualToString:@"HAndTViewController"] ){
[NSStringFromClass([viewController class]) isEqualToString:@"HAndTViewController"] )
{
//在首页或者是 心率/体温页面 刷新数据
[self viewWillAppear:YES];
return;
}else{
}
else
{
return;
}
}
@ -826,6 +829,7 @@ @@ -826,6 +829,7 @@
[[NSNotificationCenter defaultCenter] removeObserver:self name:AccountMessageNotification object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:PUSH_type_chatGroupDisband object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:PUSH_type_chatGroupRemove object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:@"updateBatteryAndLocation" object:nil];
}
/*

2
LekangGuard/Home/Contacts(电话本)/AmendContactsViewController.m

@ -228,7 +228,7 @@ @@ -228,7 +228,7 @@
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
[parameters setValue:self.conModel.Id forKey:@"id"];
[parameters setValue:@(self.relationshipId) forKey:@"image"];
[parameters setValue:self.relationship forKey:@"relation"];
[parameters setValue:self.contactField.text forKey:@"relation"];
[parameters setValue:self.contactField.text forKey:@"name"];
[parameters setValue:self.phoneField.text forKey:@"phone"];
[parameters setValue:APIManager.sharedManager.deviceModel.imei forKey:@"imei"];

1
LekangGuard/Home/Contacts(电话本)/ContactsViewController.m

@ -7,7 +7,6 @@ @@ -7,7 +7,6 @@
#import "ContactsViewController.h"
#import "OtherTableViewCell.h"
#import "FamilyTableViewCell.h"
#import "ChoosePersonAddressVC.h"
#import "AmendContactsViewController.h"

19
LekangGuard/Home/Contacts(电话本)/View/FamilyTableViewCell.h

@ -1,19 +0,0 @@ @@ -1,19 +0,0 @@
//
// FamilyTableViewCell.h
// LekangGuard
//
// Created by ecell on 2022/11/28.
//
#import "ZZTableViewCell.h"
NS_ASSUME_NONNULL_BEGIN
@class ContactsModel;
@interface FamilyTableViewCell : ZZTableViewCell
@property (nonatomic ,strong) ContactsModel *contactsModel;
@end
NS_ASSUME_NONNULL_END

116
LekangGuard/Home/Contacts(电话本)/View/FamilyTableViewCell.m

@ -1,116 +0,0 @@ @@ -1,116 +0,0 @@
//
// FamilyTableViewCell.m
// LekangGuard
//
// Created by ecell on 2022/11/28.
//
#import "FamilyTableViewCell.h"
@interface FamilyTableViewCell ()
/// 头像
@property (nonatomic ,weak) UIImageView *iconImg;
@property (nonatomic ,weak) UILabel *typeLabel;
/// 姓名
@property (nonatomic ,weak) UILabel *nameLabel;
/// 手机号
@property (nonatomic ,weak) UILabel *phoneLabel;
@end
@implementation FamilyTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self)
{
self.selectionStyle = UITableViewCellSelectionStyleNone;
self.backgroundColor = KKWhiteColorColor;
[self subCellView];
}
return self;
}
- (void)setContactsModel:(ContactsModel *)contactsModel
{
_contactsModel = contactsModel;
self.iconImg.image = [UICommon getClickRelationshipImageWithCodeID:contactsModel.image deviceType:APIManager.sharedManager.deviceModel.deviceType];
self.nameLabel.text = GJText(contactsModel.name);
self.phoneLabel.text = contactsModel.phone;
NSString *str;
if ([contactsModel.openId isEqualToString:APIManager.sharedManager.loginModel.openid] )
{
str = contactsModel.identity == 2 ? GJText(@"() 管理员") : GJText(@"()");
}
else
{
str = contactsModel.identity == 2 ? GJText(@"管理员") : @"";
}
self.typeLabel.text = str;
}
- (void)subCellView
{
UIImageView *iconImg = [UICommon ui_imageView:CGRectZero fileName:@""];
self.iconImg = iconImg;
[self.contentView addSubview:iconImg];
[iconImg mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.contentView).offset(15);
make.centerY.equalTo(self.contentView);
make.size.mas_equalTo(CGSizeMake(Adapted(40), Adapted(40)));
}];
UILabel *nameLabel = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentCenter font:FontADA_(15) textColor:KKTextBlackColor text:@"" Radius:0];
self.nameLabel = nameLabel;
[self.contentView addSubview:nameLabel];
[nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(iconImg.mas_right).offset(10);
make.top.equalTo(iconImg);
}];
UILabel *phoneLabel = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentCenter font:FontADA_(13) textColor:KKGrey102 text:@"" Radius:0];
self.phoneLabel = phoneLabel;
[self.contentView addSubview:phoneLabel];
[phoneLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(nameLabel);
make.bottom.equalTo(iconImg.mas_bottom);
}];
UILabel *typeLabel = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentCenter font:FontADA_(15) textColor:KKMainColor text:@"" Radius:0];
self.typeLabel = typeLabel;
[self.contentView addSubview:typeLabel];
[typeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(nameLabel.mas_right).offset(5);
make.centerY.equalTo(nameLabel);
}];
UIImageView *rightImg = [UICommon ui_imageView:CGRectZero fileName:@"icon_enter_gray"];
[self.contentView addSubview:rightImg];
[rightImg mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.contentView.mas_right).inset(15);
make.centerY.equalTo(self.contentView);
make.size.mas_equalTo(rightImg.image.size);
}];
}
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end

2
LekangGuard/Home/Contacts(电话本)/View/OtherTableViewCell.m

@ -58,7 +58,7 @@ @@ -58,7 +58,7 @@
//NSLog(@"-->%@",contactsModel);
_contactsModel = contactsModel;
self.iconImg.image = [UICommon getClickRelationshipImageWithCodeID:contactsModel.image deviceType:APIManager.sharedManager.deviceModel.deviceType];
self.nameLabel.text = contactsModel.name;
self.nameLabel.text = contactsModel.relation;
self.phoneLabel.text = contactsModel.phone;
self.selectImg.image = contactsModel.isSelect ? ImageName_(@"icon_selectImg_Yes") : ImageName_(@"icon_selectImg_No");

2
LekangGuard/Home/Homes/AddWatchViewController.m

@ -310,7 +310,7 @@ @@ -310,7 +310,7 @@
[parameters setValue:@(self.relationshipId) forKey:@"relationshipId"];
[parameters setValue:@(self.sex) forKey:@"sex"];
[parameters setValue:self.weightBtn.currentTitle forKey:@"weight"];
[[[APIManager sharedManager] uploadFileWithURL:AddDevice_URL parameters:parameters filePath:@"" fileData:self.iconFile] subscribeNext:^(id _Nullable x) {
[[[APIManager sharedManager] uploadImageWithURL:AddDevice_URL parameters:parameters images:@[self.iconBtn.currentImage]] subscribeNext:^(id _Nullable x) {
[UICommon HidenLoading];
[UICommon MessageSuccessText:@"添加成功"];
[[NSNotificationCenter defaultCenter] postNotificationName:UPDATA_DeviceList object:nil];

4
LekangGuard/Home/Homes/HomeViewController.m

@ -65,6 +65,10 @@ @@ -65,6 +65,10 @@
{
[self GetLatest:APIManager.sharedManager.deviceModel.imei];
}];
[[[NSNotificationCenter defaultCenter] rac_addObserverForName:@"deviceNowLocation" object:nil] subscribeNext:^(NSNotification *x)
{
[self GetLatest:APIManager.sharedManager.deviceModel.imei];
}];
[self.view addSubview:self.homeTable];
[self.homeTable mas_makeConstraints:^(MASConstraintMaker *make) {

154
LekangGuard/Home/Homes/View/HomeTableViewCell.m

@ -7,6 +7,29 @@ @@ -7,6 +7,29 @@
#import "HomeTableViewCell.h"
@interface NSTimer (XRTimer)
+ (NSTimer *)xr_timerWithTimeInterval:(NSTimeInterval)interval repeats:(BOOL)repeats block:(void (^)(NSTimer *))block;
@end
@implementation NSTimer (XRTimer)
+ (NSTimer *)xr_timerWithTimeInterval:(NSTimeInterval)interval repeats:(BOOL)repeats block:(void (^)(NSTimer *))block {
if ([self respondsToSelector:@selector(timerWithTimeInterval:repeats:block:)]) {
return [self timerWithTimeInterval:interval repeats:repeats block:block];
}
return [self timerWithTimeInterval:interval target:self selector:@selector(timerAction:) userInfo:block repeats:repeats];
}
+ (void)timerAction:(NSTimer *)timer {
void (^block)(NSTimer *timer) = timer.userInfo;
if (block) block(timer);
}
@end
//倒计时时间
#define DefineCountdownTime 60
@interface HomeTableViewCell ()
/// 背景图片
@ -18,7 +41,7 @@ @@ -18,7 +41,7 @@
@property (nonatomic ,weak) UILabel *timeLabel;
/// 右边 fed0df
@property (nonatomic ,weak) UILabel *rightLabel;
@property (nonatomic ,weak) UIButton *rightBtn;
/// 温度或者心率
@property (nonatomic ,weak) UILabel *commLabel;
@ -26,6 +49,9 @@ @@ -26,6 +49,9 @@
@property (nonatomic ,weak) UILabel *tiLabel;
///定时器
@property (nonatomic, strong) NSTimer *timer;
@end
@implementation HomeTableViewCell
@ -50,14 +76,14 @@ @@ -50,14 +76,14 @@
if ([titleStr isEqualToString:GJText(@"心率")])
{
self.bgimg.image = ImageName_(@"img_heart_rate_bg");
self.rightLabel.layer.borderColor = RGB(254, 74, 102).CGColor;
self.rightLabel.textColor = RGB(254, 74, 102);
self.rightBtn.layer.borderColor = RGB(254, 74, 102).CGColor;
[self.rightBtn setTitleColor:RGB(254, 74, 102) forState:0];
}
if ([titleStr isEqualToString:GJText(@"体温")])
{
self.bgimg.image = ImageName_(@"img_body_temperature_bg");
self.rightLabel.layer.borderColor = KKMainColor.CGColor;
self.rightLabel.textColor = KKMainColor;
self.rightBtn.layer.borderColor = KKMainColor.CGColor;
[self.rightBtn setTitleColor:KKMainColor forState:0];
}
}
@ -110,16 +136,45 @@ @@ -110,16 +136,45 @@
}];
/// 右边 fed0df
UILabel *rightLabel = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentCenter font:FontADA_(12) textColor:KKMainColor text:GJText(@"开始测量") Radius:Adapted(15)];
CGSize titlesize = [rightLabel.text sizeWithFont:FontADA_(12) constrainedToSize:CGSizeMake(MAXFLOAT, 30)];
rightLabel.layer.borderWidth = 1;
rightLabel.layer.borderColor = KKMainColor.CGColor;
self.rightLabel = rightLabel;
[self.contentView addSubview:rightLabel];
[rightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
UIButton *rightBtn = [UICommon ui_buttonSimple:CGRectZero font:FontADA_(12) normalColor:KKMainColor normalText:GJText(@"开始测量") click:^(UIButton *btn){
kWeakSelf(self)
NSLog(@"%@",self.titleLabel.text);
@try {
[HeartAndTempModel postHeartAndTempDataWithType:[self.titleLabel.text isEqualToString:GJText(@"心率")] ? 1 : 2 cmd:2 obj:@"-1" success:^(id responseObject) {
NSString * tempKey;
if([self.titleLabel.text isEqualToString:GJText(@"心率")])
{
//心率
tempKey = [NSString stringWithFormat:@"%@&%@",HeartMeasurementTimeKey,APIManager.sharedManager.deviceModel.imei];
}else{
//体温
tempKey = [NSString stringWithFormat:@"%@&%@",TempMeasurementTimeKey,APIManager.sharedManager.deviceModel.imei];
}
//设置 倒计时时间后的 时间戳
[UserDefaults setValue:[NSDate dateWithTimeIntervalSince1970:([NSDate date].timeIntervalSince1970 + DefineCountdownTime)] forKey:tempKey];
//先调用一次
[weakself calculateFun];
[weakself startTimer];
} failure:^(NSError * _Nonnull error) {
}];
} @catch (NSException *exception) {
} @finally {
}
}];
rightBtn.layer.borderWidth = 1;
rightBtn.layer.borderColor = KKMainColor.CGColor;
rightBtn.layer.cornerRadius = Adapted(15);
self.rightBtn = rightBtn;
[self.contentView addSubview:rightBtn];
CGRect titlesize = [UICommon GetTextWidth:rightBtn.currentTitle ViewHeight:Adapted(30) fontSize:FontADA_(12) type:@"w"];
[rightBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(bgimg.mas_right).inset(20);
make.centerY.equalTo(bgimg);
make.size.mas_equalTo(CGSizeMake(Adapted(titlesize.width+12 ), Adapted(30)));
make.size.mas_equalTo(CGSizeMake(Adapted(titlesize.size.width+20), Adapted(30)));
}];
/// 温度或心率
@ -139,8 +194,79 @@ @@ -139,8 +194,79 @@
make.left.equalTo(commLabel.mas_right).offset(5);
make.bottom.equalTo(commLabel.mas_bottom);
}];
}
#pragma mark- --------定时器相关方法--------
- (void)startTimer
{
//如果定时器已开启,先停止再重新开启
if (self.timer) [self stopTimer];
__weak typeof(self) weakSelf = self;
self.timer = [NSTimer xr_timerWithTimeInterval:1 repeats:YES block:^(NSTimer * _Nonnull timer) {
[weakSelf calculateFun];
}];
[[NSRunLoop currentRunLoop] addTimer:self.timer forMode:NSRunLoopCommonModes];
}
- (void)stopTimer
{
[self.timer invalidate];
self.timer = nil;
}
/// 倒计时计算方法
- (void)calculateFun
{
NSString *tempKey;
if([self.titleLabel.text isEqualToString:GJText(@"心率")])
{
//心率
tempKey = [NSString stringWithFormat:@"%@&%@",HeartMeasurementTimeKey,APIManager.sharedManager.deviceModel.imei];
}
else
{
//体温
tempKey = [NSString stringWithFormat:@"%@&%@",TempMeasurementTimeKey,APIManager.sharedManager.deviceModel.imei];
}
NSDate *tempDate = [UserDefaults valueForKey:tempKey];
if(tempDate)
{
NSTimeInterval tempTime = tempDate.timeIntervalSince1970;
if ( (tempTime - [NSDate date].timeIntervalSince1970) < 1 )
{
[UserDefaults removeObjectForKey:tempKey];
[self stopTimer];
[self.rightBtn setTitle:GJText(@"开始测量") forState:0];
//MARK: 这里倒计时结束时需要回调刷新页面的数据
// if(self.measurementEndBlock)
// {
// self.measurementEndBlock();
// }
}
else
{
[UserDefaults setValue:[NSDate dateWithTimeIntervalSince1970:tempTime] forKey:tempKey];
[self.rightBtn setTitle:[NSString stringWithFormat:GJText(@"测量中(%ds)"),(int)(tempTime - [NSDate date].timeIntervalSince1970)] forState:0];
}
}
else
{
[self stopTimer];
[self.rightBtn setTitle:GJText(@"开始测量") forState:0];
//MARK: 这里倒计时结束时需要回调刷新页面的数据
// if(self.measurementEndBlock)
// {
// self.measurementEndBlock();
// }
}
CGRect titlesize = [UICommon GetTextWidth:self.rightBtn.currentTitle ViewHeight:Adapted(30) fontSize:FontADA_(12) type:@"w"];
[self.rightBtn mas_remakeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.bgimg.mas_right).inset(20);
make.centerY.equalTo(self.bgimg);
make.size.mas_equalTo(CGSizeMake(Adapted(titlesize.size.width+20), Adapted(30)));
}];
}

2
LekangGuard/Home/MoreService (更多功能)/EditDeviceViewController.m

@ -529,7 +529,7 @@ @@ -529,7 +529,7 @@
[parameters setValue:@(self.devModel.relationImageId) forKey:@"relationImageId"];
[parameters setValue:@(self.Sex) forKey:@"sex"];
[parameters setValue:self.Weight forKey:@"weight"];
[[[APIManager sharedManager] uploadFileWithURL:UpdateDeviceInfo_URL parameters:parameters filePath:@"" fileData:self.iconFile] subscribeNext:^(id _Nullable x) {
[[[APIManager sharedManager] uploadImageWithURL:UpdateDeviceInfo_URL parameters:parameters images:@[self.iconBtn.currentImage]] subscribeNext:^(id _Nullable x) {
[super updataNotificat];
[UICommon HidenLoading];
[UICommon MessageSuccessText:@"修改成功"];

21
LekangGuard/Login/RegisterViewController.m

@ -200,12 +200,12 @@ @@ -200,12 +200,12 @@
}
else if (self.passField.text.length < 6 || self.passField.text.length > 16)
{
[UICommon MessageErrorText:@"请输入密码"];
[UICommon MessageErrorText:@"密码应该为6-16位数"];
return;
}
else if (self.passIField.text.length < 6 || self.passIField.text.length > 16)
{
[UICommon MessageErrorText:@"请输入密码"];
[UICommon MessageErrorText:@"密码应该为6-16位数"];
return;
}
else if (![self.passField.text isEqualToString:self.passIField.text])
@ -220,13 +220,16 @@ @@ -220,13 +220,16 @@
[parameters setValue:self.emailField.text forKey:@"email"];
[parameters setValue:self.passIField.text forKey:@"password"];
[[[APIManager sharedManager] APPOST:self.isViewType == 0 ? Register_URL : UpdatePwd_URL parameters:parameters isJson:YES resultClass:nil] subscribeNext:^(id _Nullable x) {
NSMutableDictionary *userDic = [NSMutableDictionary dictionary];
[userDic setValue:self.emailField.text forKey:@"email"];
[userDic setValue:@"" forKey:@"password"];
[userDic setValue:@"0" forKey:@"isRememberPWD"];
YYCache *userCache = [YYCache cacheWithName:UserCacheName];
[userCache setObject:userDic forKey:UserCacheKey];
self.isRegisterSuccess();
if (self.isViewType == 0)
{
NSMutableDictionary *userDic = [NSMutableDictionary dictionary];
[userDic setValue:self.emailField.text forKey:@"email"];
[userDic setValue:@"" forKey:@"password"];
[userDic setValue:@"0" forKey:@"isRememberPWD"];
YYCache *userCache = [YYCache cacheWithName:UserCacheName];
[userCache setObject:userDic forKey:UserCacheKey];
self.isRegisterSuccess();
}
[UICommon MessageSuccessText:self.isViewType == 0 ? GJText(@"注册成功,请登录账号") : GJText(@"密码重置成功,请登录账号")];
AfterDispatch(1, ^{

12
LekangGuard/Managers/APIManager.h

@ -76,10 +76,6 @@ extern NSString *const sDeviceKey; @@ -76,10 +76,6 @@ extern NSString *const sDeviceKey;
/// 上传单张或多张图片
/// @param ImgArr 图片数组
- (RACSignal *)updateFile:(NSArray *)ImgArr;
/// 下载文件
/// @param url url
/// @param path 下载目标路径
@ -89,6 +85,14 @@ extern NSString *const sDeviceKey; @@ -89,6 +85,14 @@ extern NSString *const sDeviceKey;
/// 使用body传数据
- (RACSignal *)PostBodyWithApi:(NSString *)api json:(id)json;
/// 上传图片文件
/// @param url 接口名
/// @param parameters 参数
/// @param images 图片数组
- (RACSignal *)uploadImageWithURL:(NSString *)url
parameters:(NSDictionary *)parameters
images:(NSArray * __nullable)images;
@end

119
LekangGuard/Managers/APIManager.m

@ -283,34 +283,25 @@ NSInteger const kErrorException = 500; @@ -283,34 +283,25 @@ NSInteger const kErrorException = 500;
}
/// 上传单张或多张图片
/// @param ImgArr 图片数组
- (RACSignal *)updateFile:(NSArray *)ImgArr
/// 下载文件
/// @param url url
/// @param path 下载目标路径
- (RACSignal *)downloadWithURL:(NSString *)url filePath:(NSString *)path
{
NSString *const kHostUrl = dHostUrl;
[MSNetwork openLog];
//[MSNetwork setBaseURL:kHostUrl];
NSDictionary *dic = [NSDictionary new];
RACSignal *requestSignal = [RACSignal createSignal:^RACDisposable * _Nullable(id<RACSubscriber> _Nonnull subscriber) {
[MSNetwork uploadImageURL:F(@"%@%@", kHostUrl,@"/file/upload") parameters:dic headers:[self setHttpHeader] images:ImgArr name:@"file" fileName:[UICommon getRandomEightCode] imageScale:1 imageType:@"png" progress:^(NSProgress * _Nonnull progress) {
} success:^(id _Nonnull responseObject) {
[MSNetwork downloadWithURL:url fileDir:path progress:^(NSProgress * _Nonnull progress) {
} success:^(NSString * _Nonnull path) {
[UICommon HidenLoading];
[UICommon MessageSuccessText:@"上传成功"];
NSLog(@"上传成功:%@",responseObject);
[subscriber sendNext:responseObject];
[subscriber sendNext:path];
[subscriber sendCompleted];
} failure:^(NSError * _Nonnull error) {
NSLog(@"上传错误:%@",error);
[subscriber sendError:error];
[UICommon HidenLoading];
[UICommon MessageErrorText:F(@"上传错误:%@",error)];
}];
return [RACDisposable disposableWithBlock:^{
NSLog(@"6 订阅流程结束,可清理资源");
}];
@ -331,62 +322,45 @@ NSInteger const kErrorException = 500; @@ -331,62 +322,45 @@ NSInteger const kErrorException = 500;
return [RACSignal createSignal:^RACDisposable *(id<RACSubscriber> subscriber)
{
[UICommon HidenLoading];
//@strongify(self);
NSString *status = F(@"%@", data[@"code"]);
id resultObj = data[@"data"];
if ([status isKindOfClass:[NSString class]] && [status isEqualToString:@"200"])
{
[subscriber sendNext:resultObj];
}
else
{
//有网络
NSString *content = data[@"message"];
NSString *message = [content isNotBlank] ? content : @"";
NSDictionary *userInfo = @{NSLocalizedDescriptionKey : message,@"detail":status};
//其他错误
NSError *error = [NSError errorWithDomain:kErrorDomain code:kErrorException userInfo:userInfo];
[subscriber sendError:error];
}
[subscriber sendCompleted];
if ([status isEqualToString:@"401"]) {
[[NSNotificationCenter defaultCenter] postNotificationName:sRelogin object:nil];
}
[subscriber sendNext:data];
return nil;
}];
}] doNext:extraHandlerSingal];
}
/// 下载文件
/// @param url url
/// @param path 下载目标路径
- (RACSignal *)downloadWithURL:(NSString *)url filePath:(NSString *)path
/// 上传图片文件
/// @param url 接口名
/// @param parameters 参数
/// @param images 图片数组
- (RACSignal *)uploadImageWithURL:(NSString *)url
parameters:(NSDictionary *)parameters
images:(NSArray * __nullable)images
{
[MSNetwork openLog];
RACSignal *requestSignal = [RACSignal createSignal:^RACDisposable * _Nullable(id<RACSubscriber> _Nonnull subscriber) {
[MSNetwork downloadWithURL:url fileDir:path progress:^(NSProgress * _Nonnull progress) {
} success:^(NSString * _Nonnull path) {
RACSignal *requestSignal;
requestSignal = [RACSignal createSignal:^RACDisposable * _Nullable(id<RACSubscriber> _Nonnull subscriber) {
[MSNetwork uploadImageURL:[NSString stringWithFormat:@"%@%@",dHostUrl,url] parameters:parameters headers:[self setHttpHeader] images:images name:@"file" fileName:@"image" imageScale:0.3 imageType:@"png" progress:^(NSProgress * _Nonnull progress) {
} success:^(id _Nonnull responseObject) {
[UICommon HidenLoading];
[subscriber sendNext:path];
[subscriber sendNext:responseObject];
[subscriber sendCompleted];
} failure:^(NSError * _Nonnull error) {
[subscriber sendError:error];
[UICommon HidenLoading];
[UICommon MessageErrorText:F(@"上传错误:%@",error)];
}];
return [RACDisposable disposableWithBlock:^{
NSLog(@"6 订阅流程结束,可清理资源");
}];
}];
void (^extraHandlerSingal)(id value) = ^(RACTuple * value) {
};
@ -401,15 +375,35 @@ NSInteger const kErrorException = 500; @@ -401,15 +375,35 @@ NSInteger const kErrorException = 500;
return [RACSignal createSignal:^RACDisposable *(id<RACSubscriber> subscriber)
{
[UICommon HidenLoading];
[subscriber sendNext:data];
//@strongify(self);
NSString *status = F(@"%@", data[@"code"]);
id resultObj = data[@"data"];
if ([status isKindOfClass:[NSString class]] && [status isEqualToString:@"200"])
{
[subscriber sendNext:resultObj];
}
else
{
//有网络
NSString *content = data[@"msg"];
NSString *message = [content isNotBlank] ? content : @"";
NSDictionary *userInfo = @{NSLocalizedDescriptionKey : message,@"detail":status};
//其他错误
NSError *error = [NSError errorWithDomain:kErrorDomain code:kErrorException userInfo:userInfo];
[subscriber sendError:error];
}
[subscriber sendCompleted];
if ([status isEqualToString:@"401"]) {
[[NSNotificationCenter defaultCenter] postNotificationName:sRelogin object:nil];
}
return nil;
}];
}] doNext:extraHandlerSingal];
}
/// 上传文件
/// @param url 接口名
/// @param parameters 参数
@ -446,6 +440,13 @@ NSInteger const kErrorException = 500; @@ -446,6 +440,13 @@ NSInteger const kErrorException = 500;
else
{
requestSignal = [RACSignal createSignal:^RACDisposable * _Nullable(id<RACSubscriber> _Nonnull subscriber) {
[MSNetwork uploadImageURL:[NSString stringWithFormat:@"%@%@",dHostUrl,url] parameters:parameters headers:[self setHttpHeader] images:@[] name:@"file" fileName:@"image" imageScale:0.5 imageType:@"png" progress:^(NSProgress * _Nonnull progress) {
} success:^(id _Nonnull responseObject) {
} failure:^(NSError * _Nonnull error) {
}];
[MSNetwork uploadFileDataWithURL:[NSString stringWithFormat:@"%@%@",dHostUrl,url] parameters:parameters headers:[self setHttpHeader] name:@"file" fileData:fileData progress:^(NSProgress * _Nonnull progress) {
} success:^(id _Nonnull responseObject) {
@ -491,7 +492,7 @@ NSInteger const kErrorException = 500; @@ -491,7 +492,7 @@ NSInteger const kErrorException = 500;
else
{
//有网络
NSString *content = data[@"message"];
NSString *content = data[@"msg"];
NSString *message = [content isNotBlank] ? content : @"";
NSDictionary *userInfo = @{NSLocalizedDescriptionKey : message,@"detail":status};
//其他错误
@ -639,7 +640,7 @@ NSInteger const kErrorException = 500; @@ -639,7 +640,7 @@ NSInteger const kErrorException = 500;
else
{
//有网络
NSString *content = dictFromData[@"message"];
NSString *content = dictFromData[@"msg"];
NSString *message = [content isNotBlank] ? content : @"";
NSDictionary *userInfo = @{NSLocalizedDescriptionKey : message,@"detail":status};
//其他错误

4
LekangGuard/Map/VC/MapViewController.m

@ -55,6 +55,10 @@ @@ -55,6 +55,10 @@
[[[NSNotificationCenter defaultCenter] rac_addObserverForName:@"updateBatteryAndLocation" object:nil] subscribeNext:^(NSNotification *x){
[self UpdataLatestlocation:APIManager.sharedManager.deviceModel.imei];
}];
[[[NSNotificationCenter defaultCenter] rac_addObserverForName:@"deviceNowLocation" object:nil] subscribeNext:^(NSNotification *x)
{
[self UpdataLatestlocation:APIManager.sharedManager.deviceModel.imei];
}];
}

29
LekangGuard/My/VC/Message(消息)/AttentionMessageViewController.m

@ -20,9 +20,6 @@ @@ -20,9 +20,6 @@
@implementation AttentionMessageViewController
- (void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
}
- (UITableView *)myTableView
{
@ -120,6 +117,7 @@ @@ -120,6 +117,7 @@
[UICommon HidenLoading];
[UICommon MessageSuccessText:@"删除成功"];
[self GetQueryFollowInfo:TableisReload_h];
[[NSNotificationCenter defaultCenter] postNotificationName:KK_UPDATE_ALL_NEWS_MESSAGE object:nil];
} error:^(NSError * _Nullable error) {
NSDictionary *dic = error.userInfo;
@ -251,8 +249,31 @@ @@ -251,8 +249,31 @@
AttentionModel *dMessage = self.modelListArr[indexPath.row];
[UICommon MessageUpload:@"加载中"];
[self updateInfoStatus:dMessage];
}
//- (void)viewWillAppear:(BOOL)animated
//{
// [super viewWillAppear:animated];
// [self xiaoxiyidu];
//}
- (void)xiaoxiyidu
{
[self.modelListArr enumerateObjectsUsingBlock:^(AttentionModel *model, NSUInteger idx, BOOL * _Nonnull stop) {
if (model.read && model.read == 0)
{
[self updateInfoStatus:model];
}
}];
}
- (void)updateInfoStatus:(AttentionModel *)model
{
kWeakSelf(self)
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
[[[APIManager sharedManager] APGET:F(@"%@%@/1", UpdateInfoStatus_URL,dMessage.Id) parameters:parameters resultClass:nil] subscribeNext:^(id _Nullable x) {
[[[APIManager sharedManager] APGET:F(@"%@%@/1", UpdateInfoStatus_URL,model.Id) parameters:parameters resultClass:nil] subscribeNext:^(id _Nullable x) {
[UICommon HidenLoading];
[[NSNotificationCenter defaultCenter] postNotificationName:KK_UPDATE_ALL_NEWS_MESSAGE object:nil];
} error:^(NSError * _Nullable error) {

50
LekangGuard/My/VC/Message(消息)/RemindMessageViewController.m

@ -18,11 +18,6 @@ @@ -18,11 +18,6 @@
@implementation RemindMessageViewController
- (void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
//[self loadMoreDataWithDMessage:nil];
}
- (UITableView *)myTableView
{
@ -118,6 +113,7 @@ @@ -118,6 +113,7 @@
[UICommon HidenLoading];
[UICommon MessageSuccessText:@"删除成功"];
[self GetRemindList:TableisReload_h];
[[NSNotificationCenter defaultCenter] postNotificationName:KK_UPDATE_ALL_NEWS_MESSAGE object:nil];
} error:^(NSError * _Nullable error) {
NSDictionary *dic = error.userInfo;
@ -259,27 +255,45 @@ @@ -259,27 +255,45 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
kWeakSelf(self)
RemindModel *dMessage = self.modelListArr[indexPath.row];
if (dMessage.messageRead && [dMessage.messageRead intValue] == 0) {
[UICommon MessageUpload:@"加载中"];
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
[parameters setValue:dMessage.Id forKey:@"id"];
[parameters setValue:@"1" forKey:@"messageRead"];
[[[APIManager sharedManager] APPOST:UpdateRemind_URL parameters:parameters isJson:YES resultClass:nil] subscribeNext:^(id _Nullable x) {
[UICommon HidenLoading];
dMessage.messageRead = @"1";
[weakself.myTableView reloadData];
[[NSNotificationCenter defaultCenter] postNotificationName:KK_UPDATE_ALL_NEWS_MESSAGE object:nil];
} error:^(NSError * _Nullable error) {
NSDictionary *dic = error.userInfo;
[UICommon MessageErrorText:dic[NSLocalizedDescriptionKey]];
}];
[self updateRemind:dMessage];
}
}
//- (void)viewWillDisappear:(BOOL)animated
//{
// [super viewWillDisappear:animated];
// [self xiaoxiyidu];
//}
- (void)xiaoxiyidu
{
[self.modelListArr enumerateObjectsUsingBlock:^(RemindModel *model, NSUInteger idx, BOOL * _Nonnull stop) {
if (model.messageRead && model.messageRead == 0)
{
[self updateRemind:model];
}
}];
}
- (void)updateRemind:(RemindModel *)model
{
kWeakSelf(self)
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
[parameters setValue:model.Id forKey:@"id"];
[parameters setValue:@"1" forKey:@"messageRead"];
[[[APIManager sharedManager] APPOST:UpdateRemind_URL parameters:parameters isJson:YES resultClass:nil] subscribeNext:^(id _Nullable x) {
[UICommon HidenLoading];
model.messageRead = @"1";
[weakself.myTableView reloadData];
[[NSNotificationCenter defaultCenter] postNotificationName:KK_UPDATE_ALL_NEWS_MESSAGE object:nil];
} error:^(NSError * _Nullable error) {
NSDictionary *dic = error.userInfo;
[UICommon MessageErrorText:dic[NSLocalizedDescriptionKey]];
}];
}
- (CGFloat)getLineHeight:(NSString *)string withWidth:(CGFloat)width withFont:(UIFont *)font

54
LekangGuard/My/VC/Message(消息)/SystermMessageViewController.m

@ -20,11 +20,6 @@ @@ -20,11 +20,6 @@
@implementation SystermMessageViewController
- (void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
}
- (UITableView *)myTableView
{
if (!_myTableView)
@ -119,6 +114,7 @@ @@ -119,6 +114,7 @@
[UICommon HidenLoading];
[UICommon MessageSuccessText:@"删除成功"];
[self GetNotifyList:TableisReload_h];
[[NSNotificationCenter defaultCenter] postNotificationName:KK_UPDATE_ALL_NEWS_MESSAGE object:nil];
} error:^(NSError * _Nullable error) {
NSDictionary *dic = error.userInfo;
@ -261,23 +257,45 @@ @@ -261,23 +257,45 @@
SystermModel *dMessage = self.modelListArr[indexPath.row];
if (dMessage.messageRead && [dMessage.messageRead intValue] == 0)
{
kWeakSelf(self)
[UICommon MessageUpload:@"加载中"];
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
[parameters setValue:dMessage.Id forKey:@"id"];
[parameters setValue:@"1" forKey:@"messageRead"];
[[[APIManager sharedManager] APPOST:UpdateNotify_URL parameters:parameters isJson:YES resultClass:nil] subscribeNext:^(id _Nullable x) {
[UICommon HidenLoading];
dMessage.messageRead = @"1";
[[NSNotificationCenter defaultCenter] postNotificationName:KK_UPDATE_ALL_NEWS_MESSAGE object:nil];
[weakself.myTableView reloadData];
} error:^(NSError * _Nullable error) {
NSDictionary *dic = error.userInfo;
[UICommon MessageErrorText:dic[NSLocalizedDescriptionKey]];
}];
[self updateNotify:dMessage];
}
}
//- (void)viewWillAppear:(BOOL)animated
//{
// [super viewWillAppear:animated];
// [self xiaoxiyidu];
//}
- (void)xiaoxiyidu
{
[self.modelListArr enumerateObjectsUsingBlock:^(SystermModel *model, NSUInteger idx, BOOL * _Nonnull stop) {
if (model.messageRead && model.messageRead == 0)
{
[self updateNotify:model];
}
}];
}
- (void)updateNotify:(SystermModel *)model
{
kWeakSelf(self)
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
[parameters setValue:model.Id forKey:@"id"];
[parameters setValue:@"1" forKey:@"messageRead"];
[[[APIManager sharedManager] APPOST:UpdateNotify_URL parameters:parameters isJson:YES resultClass:nil] subscribeNext:^(id _Nullable x) {
[UICommon HidenLoading];
model.messageRead = @"1";
[[NSNotificationCenter defaultCenter] postNotificationName:KK_UPDATE_ALL_NEWS_MESSAGE object:nil];
[weakself.myTableView reloadData];
} error:^(NSError * _Nullable error) {
NSDictionary *dic = error.userInfo;
[UICommon MessageErrorText:dic[NSLocalizedDescriptionKey]];
}];
}

11
LekangGuard/My/VC/ModifyDataViewController.m

@ -64,7 +64,7 @@ @@ -64,7 +64,7 @@
UIImageView *iconImg = [UIImageView new];
iconImg.layer.cornerRadius = 5;
iconImg.layer.masksToBounds = YES;
[iconImg sd_setImageWithURL:[NSURL URLWithString:self.model.image] placeholderImage:ImageName_(@"icon_unclick_waigong_head_portrait")];
[iconImg sd_setImageWithURL:[NSURL URLWithString:self.model.image] placeholderImage:ImageName_(@"icon_adults_occupies_the_head")];
self.iconImg = iconImg;
[bgView addSubview:iconImg];
[iconImg mas_makeConstraints:^(MASConstraintMaker *make) {
@ -135,15 +135,11 @@ @@ -135,15 +135,11 @@
return;
}
[UICommon MessageUpload:@"加载中"];
if (self.model.image.length > 0 || self.isSelectIcon)
self.iconFile = UIImageJPEGRepresentation(self.iconImg.image, 1.0f);
else
self.iconFile = [NSData new];
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
[parameters setValue:self.model.imei forKey:@"imei"];
[parameters setValue:self.nameStr forKey:@"name"];
[parameters setValue:self.phoneStr forKey:@"phone"];
[[[APIManager sharedManager] uploadFileWithURL:UpdateInfo_URL parameters:parameters filePath:@"" fileData:self.iconFile] subscribeNext:^(id _Nullable x) {
[[[APIManager sharedManager] uploadImageWithURL:UpdateInfo_URL parameters:parameters images:self.isSelectIcon ? @[self.iconImg.image] : nil] subscribeNext:^(id _Nullable x) {
NSLog(@"%@",x);
[UICommon HidenLoading];
[UICommon MessageSuccessText:@"保存成功"];
@ -151,7 +147,8 @@ @@ -151,7 +147,8 @@
[self.navigationController popViewControllerAnimated:YES];
});
} error:^(NSError * _Nullable error) {
NSDictionary *dic = error.userInfo;
[UICommon MessageErrorText:dic[NSLocalizedDescriptionKey]];
}];

4
LekangGuard/en.lproj/Localizable.strings

@ -163,7 +163,7 @@ @@ -163,7 +163,7 @@
"奶奶" = "Grandma";
"外公" = "Grandpa";
"外公" = "Grandfather";
"外婆" = "Grandmother";
@ -811,3 +811,5 @@ @@ -811,3 +811,5 @@
"设备已被%@绑定,请选择关系后向管理员申请关注!" = "The device has been bound with %@. Please select the relationship and apply to the administrator for attention!";
"手机号不能为空" = "The mobile phone number cannot be empty";
"密码应该为6-16位数" = "The password should be 6 to 16 digits long";

2
LekangGuard/zh-Hans.lproj/Localizable.strings

@ -810,6 +810,6 @@ @@ -810,6 +810,6 @@
"手机号不能为空" = "手机号不能为空";
"" = "";
"密码应该为6-16位数" = "密码应该为6-16位数";
"" = "";

Loading…
Cancel
Save