Browse Source

bug修改

master
公司电脑 2 years ago
parent
commit
83f8f627e7
  1. 4
      LekangGuard.xcodeproj/project.pbxproj
  2. BIN
      LekangGuard.xcworkspace/xcuserdata/ecell.xcuserdatad/UserInterfaceState.xcuserstate
  3. 128
      LekangGuard.xcworkspace/xcuserdata/ecell.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  4. 21
      LekangGuard/Assets.xcassets/Common/LocationMode_icon.imageset/Contents.json
  5. BIN
      LekangGuard/Assets.xcassets/Common/LocationMode_icon.imageset/LocationMode_icon@2x.png
  6. 4
      LekangGuard/Common/BaseViewController.h
  7. 18
      LekangGuard/Common/BaseViewController.m
  8. 3
      LekangGuard/Common/UICommon.h
  9. 8
      LekangGuard/Common/UICommon.m
  10. 6
      LekangGuard/Common/tabBar/TabBarViewController.m
  11. 7
      LekangGuard/Home/Chat(微聊)/ChatViewController.m
  12. 2
      LekangGuard/Home/Chat(微聊)/MessageDisplayKit/Classes/Controllers/XHMessageTableViewController/XHMessageTableViewController.m
  13. 6
      LekangGuard/Home/Contacts(电话本)/AmendContactsViewController.m
  14. 17
      LekangGuard/Home/Contacts(电话本)/ChoosePersonAddressVC.m
  15. 45
      LekangGuard/Home/Contacts(电话本)/ContactsViewController.m
  16. 2
      LekangGuard/Home/Contacts(电话本)/View/ChooseContactTableViewCell.m
  17. 26
      LekangGuard/Home/Homes/AddWatchViewController.m
  18. 6
      LekangGuard/Home/Homes/HomeViewController.m
  19. 4
      LekangGuard/Home/Homes/Model/HeartAndTempModel.m
  20. 16
      LekangGuard/Home/Homes/ScanCodeViewController.m
  21. 86
      LekangGuard/Home/MoreService (更多功能)/EditDeviceViewController.m
  22. 92
      LekangGuard/Home/MoreService (更多功能)/LocationModeViewController.m
  23. 36
      LekangGuard/Home/MoreService (更多功能)/MoreServiceViewController.m
  24. 14
      LekangGuard/Home/MoreService (更多功能)/View/DeviceSetView.m
  25. 1
      LekangGuard/Home/VideoChat(视频聊天)/Agora/CallViewController.m
  26. 2
      LekangGuard/LekangGuard.pch
  27. 18
      LekangGuard/Login/EmailLoginViewController.m
  28. 14
      LekangGuard/Login/LoginViewController.m
  29. 46
      LekangGuard/Login/RegisterViewController.m
  30. 3
      LekangGuard/Managers/UIURL.h
  31. 14
      LekangGuard/Map/VC/MapViewController.m
  32. 2
      LekangGuard/Map/VC/View/MapMessageView.m
  33. 4
      LekangGuard/My/VC/Message(消息)/AttentionMessageViewController.m
  34. 35
      LekangGuard/My/VC/Message(消息)/MessageViewController.m
  35. 1
      LekangGuard/My/VC/Message(消息)/RemindMessageViewController.m
  36. 1
      LekangGuard/My/VC/Message(消息)/SystermMessageViewController.m
  37. 3
      LekangGuard/My/VC/Message(消息)/View/MessageTableViewCell.m
  38. 8
      LekangGuard/My/VC/Message(消息)/View/MessageTableViewCell.xib
  39. 33
      LekangGuard/My/VC/ModifyDataViewController.m
  40. 55
      LekangGuard/My/VC/MyViewController.m
  41. 31
      LekangGuard/en.lproj/Localizable.strings
  42. 30
      LekangGuard/zh-Hans.lproj/Localizable.strings

4
LekangGuard.xcodeproj/project.pbxproj

@ -4191,7 +4191,7 @@ @@ -4191,7 +4191,7 @@
"$(PROJECT_DIR)/LekangGuard/Common/VoiceConvert/lib",
"$(PROJECT_DIR)/LekangGuard/sdk/lib/ios",
);
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 1.1;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.ecellsz.lekang.guard;
PRODUCT_NAME = "ECell care";
@ -4277,7 +4277,7 @@ @@ -4277,7 +4277,7 @@
"$(PROJECT_DIR)/LekangGuard/Common/VoiceConvert/lib",
"$(PROJECT_DIR)/LekangGuard/sdk/lib/ios",
);
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 1.1;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.ecellsz.lekang.guard;
PRODUCT_NAME = "ECell care";

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

Binary file not shown.

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

@ -215,22 +215,6 @@ @@ -215,22 +215,6 @@
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "35503321-0007-4C2F-AB94-78AF0CE18F55"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "LekangGuard/My/VC/MyViewController.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "293"
endingLineNumber = "293"
landmarkName = "-UserCancel"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "202FABB2-7891-4201-A825-A3894F9D868B"
shouldBeEnabled = "Yes"
ignoreCount = "0"
@ -311,22 +295,6 @@ @@ -311,22 +295,6 @@
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "C77F6E85-955C-46A9-AF65-E2408FF6E0ED"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "LekangGuard/Home/Contacts(&#x7535;&#x8bdd;&#x672c;)/ChoosePersonAddressVC.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "85"
endingLineNumber = "85"
landmarkName = "-UpdataAddressImport"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "2A17EB24-9CF3-4EF0-9FEB-216E5E0E5264"
shouldBeEnabled = "Yes"
ignoreCount = "0"
@ -420,5 +388,101 @@ @@ -420,5 +388,101 @@
landmarkType = "3">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "5EC2DFBA-095F-4A9B-8988-1E6AE2EA26B6"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "LekangGuard/Home/Chat(&#x5fae;&#x804a;)/ChatViewController.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "96"
endingLineNumber = "96"
landmarkName = "-pusChatMessage:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "8C08A76E-0E8B-4357-8E2E-48DD8629A5AD"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "LekangGuard/Home/Contacts(&#x7535;&#x8bdd;&#x672c;)/ContactsViewController.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "202"
endingLineNumber = "202"
landmarkName = "-tableView:didSelectRowAtIndexPath:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "E51AC97B-1E74-4E6D-BADE-5BDFD3DF130C"
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"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
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 = "480"
endingLineNumber = "480"
landmarkName = "-imagePickerController:didFinishPickingMediaWithInfo:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "95518CD8-B77F-491C-92AA-5D2F3553EF07"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "LekangGuard/My/VC/ModifyDataViewController.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "139"
endingLineNumber = "139"
landmarkName = "-UpdateInfo"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "B0C46858-94C7-4F36-A868-836B3B4AFE1E"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "LekangGuard/Common/BaseViewController.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "276"
endingLineNumber = "276"
landmarkName = "-pusMessage"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>

21
LekangGuard/Assets.xcassets/Common/LocationMode_icon.imageset/Contents.json vendored

@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "LocationMode_icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

BIN
LekangGuard/Assets.xcassets/Common/LocationMode_icon.imageset/LocationMode_icon@2x.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

4
LekangGuard/Common/BaseViewController.h

@ -35,6 +35,7 @@ typedef NS_ENUM(NSInteger,BgImageType){ @@ -35,6 +35,7 @@ typedef NS_ENUM(NSInteger,BgImageType){
@interface BaseViewController : ZXNavigationBarController
/// 获取最新设备列表信息
- (void)updateAllMessage;
/// 空白页显示图片种类
@ -64,8 +65,11 @@ typedef NS_ENUM(NSInteger,BgImageType){ @@ -64,8 +65,11 @@ typedef NS_ENUM(NSInteger,BgImageType){
/// 更新数据通知
- (void)updataNotificat;
/// 微聊消息推送
- (void)pusChatMessage:(NSDictionary *)chatModel;
/// 推送通知,获取最新设备电量格位置信息;
- (void)updateBatteryAndLocation;
@end

18
LekangGuard/Common/BaseViewController.m

@ -71,16 +71,23 @@ @@ -71,16 +71,23 @@
}
/// 微聊消息推送
- (void)pusChatMessage:(NSDictionary *)chatModel
{
}
/// 获取最新设备列表信息
- (void)updateAllMessage
{
}
/// 推送通知,获取最新设备电量格位置信息
- (void)updateBatteryAndLocation
{
}
/// 更新数据
@ -266,8 +273,11 @@ @@ -266,8 +273,11 @@
}
if([msgType isEqualToString:@"wifi"] || [msgType isEqualToString:@"battery"]) {
//Wi-Fi列表获取界面
if([msgType isEqualToString:@"battery"] || [msgType isEqualToString:@"deviceNowLocation"])
{
/// 电量推送和地理位置推送
[self updateBatteryAndLocation];
[[NSNotificationCenter defaultCenter] postNotificationName:@"updateBatteryAndLocation" object:nil];
return;
}
@ -444,8 +454,8 @@ @@ -444,8 +454,8 @@
return;
}
else if ([msgType isEqualToString:@"identityTransfer"] /// 管理员管让进来类型
|| [msgType isEqualToString:@"identityTransfered"])/// 管理员管让出去类型
else if ([msgType isEqualToString:@"identityTransfer"]/// 管理员管让出去类型
|| [msgType isEqualToString:@"identityTransfered"])/// 管理员管让进来类型
{
//身份变更消息【管理员转让进来】
content = msgDic[@"body"];

3
LekangGuard/Common/UICommon.h

@ -353,6 +353,9 @@ void AfterDispatch(double delayInSeconds, dispatch_block_t _Nullable block); @@ -353,6 +353,9 @@ void AfterDispatch(double delayInSeconds, dispatch_block_t _Nullable block);
+ (CGRect)GetTextWidth:(NSString *)text ViewHeight:(CGFloat)heights fontSize:(UIFont *)size type:(NSString *)type;
+ (NSDate*)getTimeStrWithString:(NSString*)str;
/// 图片质量压缩
+(UIImage *)reduceImage:(UIImage *)image percent:(float)percent;
@end

8
LekangGuard/Common/UICommon.m

@ -1222,4 +1222,12 @@ void AfterDispatch(double delayInSeconds, dispatch_block_t _Nullable block) { @@ -1222,4 +1222,12 @@ void AfterDispatch(double delayInSeconds, dispatch_block_t _Nullable block) {
return rect;
}
/// 图片质量压缩
+(UIImage *)reduceImage:(UIImage *)image percent:(float)percent
{
NSData *imageData = UIImageJPEGRepresentation(image, percent);
UIImage *newImage = [UIImage imageWithData:imageData];
return newImage;
}
@end

6
LekangGuard/Common/tabBar/TabBarViewController.m

@ -86,9 +86,9 @@ @@ -86,9 +86,9 @@
- (void)addTabarItems
{
NSArray *titleNames = @[NSLocalizedString(@"首页", nil),
NSLocalizedString(@"定位", nil),
NSLocalizedString(@"我的", nil)];
NSArray *titleNames = @[GJText(@"首页"),
GJText(@"定位"),
GJText(@"我的")];
NSArray *normalImages = @[@"tabBar_home_normal",
@"tabBar_map_normal",

7
LekangGuard/Home/Chat(微聊)/ChatViewController.m

@ -89,7 +89,11 @@ @@ -89,7 +89,11 @@
/// 收到推送聊天信息
- (void)pusChatMessage:(NSDictionary *)chatModel
{
[self QueryChatListModel:TableisReload_f pageSize:1 current:1];
NSDictionary *dic = chatModel[@"message"];
NSString *uid = dic[@"senderID"];
/// 防止同设备两个不同账号切换后,消息推送重复拉取数据
if (![uid isEqualToString:APIManager.sharedManager.loginModel.openid])
[self QueryChatListModel:TableisReload_f pageSize:1 current:1];
}
#pragma mark 查询微聊数据
@ -188,6 +192,7 @@ kWeakSelf(self) @@ -188,6 +192,7 @@ kWeakSelf(self)
weakself.messages = weakself.modelListArr;
[self reloadTable:weakself.modelListArr.count-1];
//[weakself addMessage:model];
self.zx_navRightBtn.hidden = weakself.modelListArr.count > 0 ? NO : YES;
[weakself finishSendMessageWithBubbleMessageType:XHBubbleMessageMediaTypeVoice];
} error:^(NSError * _Nullable error) {
NSDictionary *dic = error.userInfo;

2
LekangGuard/Home/Chat(微聊)/MessageDisplayKit/Classes/Controllers/XHMessageTableViewController/XHMessageTableViewController.m

@ -399,7 +399,7 @@ static CGPoint delayOffset = {0.0}; @@ -399,7 +399,7 @@ static CGPoint delayOffset = {0.0};
holdDown.highlighted = NO;
weakSelf.isMaxTimeStop = YES;
[[JSToastDialogs shareInstance] makeToast:@"语音最长15秒" duration:3.0];
[[JSToastDialogs shareInstance] makeToast:GJText(@"语音最长15秒") duration:3.0];
[weakSelf finishRecorded];
};

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

@ -66,7 +66,7 @@ @@ -66,7 +66,7 @@
make.height.mas_equalTo(Adapted(50));
}];
UILabel *titleLabel = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentLeft font:FontADA_(13) textColor:KKTextBlackColor text:i == 0 ? NSLocalizedString(@"与我的关系", nil) : NSLocalizedString(@"我的号码", nil) Radius:0];
UILabel *titleLabel = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentLeft font:FontADA_(13) textColor:KKTextBlackColor text:i == 0 ? GJText(@"与我的关系") : GJText(@"我的号码") Radius:0];
CGFloat width = [(NSString *)titleLabel.text boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, 18) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:FontADA_(13)} context:nil].size.width;
[bgView addSubview:titleLabel];
[titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
@ -75,7 +75,7 @@ @@ -75,7 +75,7 @@
make.width.mas_equalTo(Adapted(width));
}];
UITextField *textfield = [UICommon ui_textField:CGRectZero textColor:KKTextBlackColor backColor:KKClearColor font:FontADA_(13) maxTextNum:i == 0 ? 20 : 25 placeholderColor:KKGrey143 placeholder:i == 0 ? NSLocalizedString(@"请输入关系", nil) : NSLocalizedString(@"请输入号码", nil) toMaxNum:^(UITextField *textField) {
UITextField *textfield = [UICommon ui_textField:CGRectZero textColor:KKTextBlackColor backColor:KKClearColor font:FontADA_(13) maxTextNum:i == 0 ? 20 : 25 placeholderColor:KKGrey143 placeholder:i == 0 ? GJText(@"请输入关系") : GJText(@"请输入号码") toMaxNum:^(UITextField *textField) {
} change:^(UITextField *textField) {
@ -97,7 +97,7 @@ @@ -97,7 +97,7 @@
}];
}
UILabel *titleLabel = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentLeft font:FontADA_(14) textColor:KKTextBlackColor text:NSLocalizedString(@"选择头像", nil) Radius:0];
UILabel *titleLabel = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentLeft font:FontADA_(14) textColor:KKTextBlackColor text:GJText(@"选择头像") Radius:0];
[self.view addSubview:titleLabel];
[titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.view).offset(15);

17
LekangGuard/Home/Contacts(电话本)/ChoosePersonAddressVC.m

@ -107,16 +107,19 @@ @@ -107,16 +107,19 @@
}
if (newArr.count > 50)
{
EasyAlertView *alertV = [EasyAlertView alertViewWithTitle:GJText(@"提示") subtitle:GJText(@"上传联系人不能超过50个") AlertViewType:AlertViewTypeSystemAlert config:nil];
[alertV addAlertItem:^EasyAlertItem *{
return [EasyAlertItem itemWithTitle:GJText(@"确定") type:AlertItemTypeSystemDefault callback:nil];
LGAlertView *alertView = [[LGAlertView alloc] initWithTitle:GJText(@"提示") message:GJText(@"上传联系人不能超过50个") style:LGAlertViewStyleAlert buttonTitles:nil cancelButtonTitle:GJText(@"确定") destructiveButtonTitle:nil actionHandler:^(LGAlertView * _Nonnull alertView, NSUInteger index, NSString * _Nullable title) {
} cancelHandler:^(LGAlertView * _Nonnull alertView) {
} destructiveHandler:^(LGAlertView * _Nonnull alertView) {
}];
[alertV showAlertView];
[alertView showAnimated:YES completionHandler:nil];
return;
}
[UICommon MessageUpload:@"加载中"];
[[[APIManager sharedManager] PostBodyWithApi:AddressImport_URL json:[newArr yy_modelToJSONString]] subscribeNext:^(id _Nullable x) {
[UICommon HidenLoading];
[UICommon MessageSuccessText:@"添加成功"];
@ -124,7 +127,7 @@ @@ -124,7 +127,7 @@
self.isAddSucceed();
[self.navigationController popViewControllerAnimated:YES];
});
} error:^(NSError * _Nullable error) {
NSDictionary *dic = error.userInfo;
[UICommon MessageErrorText:dic[NSLocalizedDescriptionKey]];
@ -232,7 +235,7 @@ @@ -232,7 +235,7 @@
_addressTable.delegate = self;
_addressTable.dataSource = self;
_addressTable.rowHeight = Adapted(60);
_addressTable.separatorStyle = UITableViewCellSeparatorStyleNone;
//_addressTable.separatorStyle = UITableViewCellSeparatorStyleNone;
[_addressTable registerClass:ChooseContactTableViewCell.class forCellReuseIdentifier:NSStringFromClass(ChooseContactTableViewCell.class)];
}
return _addressTable;

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

@ -85,7 +85,7 @@ @@ -85,7 +85,7 @@
_contactsTabel.tableHeaderView.height = Adapted(rect.size.height+20);
_contactsTabel.tableHeaderView = self.topView;
}
_contactsTabel.separatorStyle = UITableViewCellSeparatorStyleNone;
// _contactsTabel.separatorStyle = UITableViewCellSeparatorStyleNone;
[_contactsTabel registerClass:OtherTableViewCell.class forCellReuseIdentifier:NSStringFromClass(OtherTableViewCell.class)];
}
return _contactsTabel;
@ -157,7 +157,8 @@ @@ -157,7 +157,8 @@
//MARK: 设置cell 的 交互 样式
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView
editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath{
editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
/**
UITableViewCellEditingStyleNone,
UITableViewCellEditingStyleDelete,
@ -169,7 +170,8 @@ @@ -169,7 +170,8 @@
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
ContactsModel *contacts = self.modelListArr[indexPath.section][indexPath.row];
if(self.isDeletMode)
{
@ -198,28 +200,29 @@ @@ -198,28 +200,29 @@
}
else
{
if(self.identity == 2)
if(self.identity == 2)/// 如果自己是管理员可操作其他联系人
{
//如果自己是管理员
kWeakSelf(self)
NSMutableArray* buttonArr = [NSMutableArray array];
if(contacts.openId)
{
//是成员
if(contacts.identity != 2){
[buttonArr addObject:GJText(@"设置为管理员")];
}
// NSMutableArray* buttonArr = [NSMutableArray array];
// if(contacts.openId)/// 判断当前点击的是否是家庭成员
// {
// //是成员
// if(contacts.identity != 2)
// {
// [buttonArr addObject:GJText(@"设置为管理员")];
// }
//是自己---直接跳
if([contacts.openId isEqualToString:APIManager.sharedManager.loginModel.openid]){
[self jumpContactVCWith:contacts];
return;
}
}
else
{
//普通
[buttonArr addObject:GJText(@"编辑联系人")];
}
// }
// else
// {
// //普通
// [buttonArr addObject:GJText(@"编辑联系人")];
// }
EasyAlertView *alertV = [EasyAlertView alertViewWithTitle:nil subtitle:F(@"%@ %@",GJText(@"联系人"),contacts.name) AlertViewType:AlertViewTypeSystemActionSheet config:nil];
[alertV addAlertItem:^EasyAlertItem *{
@ -228,7 +231,7 @@ @@ -228,7 +231,7 @@
[alertV addAlertItemWithTitle:GJText(@"删除") type:AlertItemTypeSystemDestructive callback:^(EasyAlertView *showview, long index) {
}];
if(contacts.identity != 2)
if(contacts.identity != 2 && contacts.openId)
{
[alertV addAlertItemWithTitle:GJText(@"设置为管理员") type:AlertItemTypeSystemDefault callback:^(EasyAlertView *showview, long index) {
@ -245,7 +248,7 @@ @@ -245,7 +248,7 @@
[alertV showAlertView];
}];
}
//else
if(contacts.setBind == 0)
{
[alertV addAlertItemWithTitle:GJText(@"编辑联系人") type:AlertItemTypeSystemDefault callback:^(EasyAlertView *showview, long index) {
[weakself jumpContactVCWith:contacts];
@ -314,7 +317,7 @@ @@ -314,7 +317,7 @@
return;
}
LGAlertView *alertView = [[LGAlertView alloc] initWithTitle:GJText(@"注意") message:F(@"%@%ld%@?",GJText(@"确认要删除"),IdArr.count,GJText(@"个联系人")) style:LGAlertViewStyleAlert buttonTitles:@[GJText(@"确定")] cancelButtonTitle:GJText(@"取消") destructiveButtonTitle:nil actionHandler:^(LGAlertView * _Nonnull alertView, NSUInteger index, NSString * _Nullable title) {
LGAlertView *alertView = [[LGAlertView alloc] initWithTitle:GJText(@"注意") message:F(GJText(@"确认要删除%ld个联系人?"),IdArr.count) style:LGAlertViewStyleAlert buttonTitles:@[GJText(@"确定")] cancelButtonTitle:GJText(@"取消") destructiveButtonTitle:nil actionHandler:^(LGAlertView * _Nonnull alertView, NSUInteger index, NSString * _Nullable title) {
[UICommon MessageUpload:@"加载中"];
[[[APIManager sharedManager] PostBodyWithApi:F(@"%@?imei=%@", DelBatchAddress_URL,APIManager.sharedManager.deviceModel.imei) json:[IdArr yy_modelToJSONString]] subscribeNext:^(id _Nullable x) {
@ -454,7 +457,7 @@ @@ -454,7 +457,7 @@
/// 查询通讯录成员
- (void)GetQueryAddressList
{
[UICommon MessageUpload:NSLocalizedString(@"加载中", nil)];
[UICommon MessageUpload:@"加载中"];
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
[parameters setValue:APIManager.sharedManager.deviceModel.imei forKey:@"imei"];
[[[APIManager sharedManager] APGET:QueryAddressList_URL parameters:parameters resultClass:nil] subscribeNext:^(NSArray *arr) {

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

@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
if (self)
{
self.selectionStyle = UITableViewCellSelectionStyleNone;
self.backgroundColor = KKClearColor;
//self.backgroundColor = KKClearColor;
[self subCellView];
}

26
LekangGuard/Home/Homes/AddWatchViewController.m

@ -42,9 +42,9 @@ @@ -42,9 +42,9 @@
[super viewDidLoad];
// Do any additional setup after loading the view.
self.view.backgroundColor = KKBackgroundGrey;
self.zx_navTitle = NSLocalizedString(@"添加设备", nil);
self.zx_navTitle = GJText(@"添加设备");
self.sex = 2;
[self zx_setRightBtnWithText:NSLocalizedString(@"添加", nil) clickedBlock:^(ZXNavItemBtn * _Nonnull btn) {
[self zx_setRightBtnWithText:GJText(@"添加") clickedBlock:^(ZXNavItemBtn * _Nonnull btn) {
[self SetAddDevice];
}];
[self DeviceMsgView];
@ -108,7 +108,7 @@ @@ -108,7 +108,7 @@
else if (i == 1 || i == titleArr.count-1)
{
/// 姓名和电话号码
UITextField *textfield = [UICommon ui_textField:CGRectZero textColor:KKTextBlackColor backColor:KKClearColor font:FontADA_(13) maxTextNum:i == titleArr.count-1 ? 11 : 20 placeholderColor:KKGrey143 placeholder:i == 1 ? NSLocalizedString(@"请输入姓名", nil) : NSLocalizedString(@"请输入设备电话号码", nil) toMaxNum:^(UITextField *textField) {
UITextField *textfield = [UICommon ui_textField:CGRectZero textColor:KKTextBlackColor backColor:KKClearColor font:FontADA_(13) maxTextNum:i == titleArr.count-1 ? 11 : 20 placeholderColor:KKGrey143 placeholder:i == 1 ? GJText(@"请输入姓名") : GJText(@"请输入设备电话号码") toMaxNum:^(UITextField *textField) {
} change:^(UITextField *textField) {
@ -133,11 +133,11 @@ @@ -133,11 +133,11 @@
else
{
/// 性别
NSArray *sexArr = @[NSLocalizedString(@"男", nil),
NSLocalizedString(@"女", nil),
NSLocalizedString(@"保密", nil)];
UIButton *sexBtn = [UICommon ui_buttonSimple:CGRectZero font:FontADA_(13) normalColor:KKTextBlackColor normalText:NSLocalizedString(@"女", nil) click:^(UIButton *btn) {
[BRStringPickerView showPickerWithTitle:NSLocalizedString(@"请选择性别", nil) dataSourceArr:sexArr selectIndex:1 resultBlock:^(BRResultModel * _Nullable resultModel) {
NSArray *sexArr = @[GJText(@"男"),
GJText(@"女"),
GJText(@"保密")];
UIButton *sexBtn = [UICommon ui_buttonSimple:CGRectZero font:FontADA_(13) normalColor:KKTextBlackColor normalText:GJText(@"女") click:^(UIButton *btn) {
[BRStringPickerView showPickerWithTitle:GJText(@"请选择性别") dataSourceArr:sexArr selectIndex:1 resultBlock:^(BRResultModel * _Nullable resultModel) {
[UICommon resignKeyboard];
[btn setTitle:resultModel.value forState:0];
self.sex = resultModel.index+1;
@ -227,19 +227,19 @@ @@ -227,19 +227,19 @@
[UICommon resignKeyboard];
if (btn.tag == 1)
{
[BRDatePickerView showDatePickerWithMode:BRDatePickerModeYMD title:NSLocalizedString(@"请选择生日", nil) selectValue:[UICommon getSysTime] minDate:nil maxDate:nil isAutoSelect:NO resultBlock:^(NSDate * _Nullable selectDate, NSString * _Nullable selectValue) {
[BRDatePickerView showDatePickerWithMode:BRDatePickerModeYMD title:GJText(@"请选择生日") selectValue:[UICommon getSysTime] minDate:nil maxDate:nil isAutoSelect:NO resultBlock:^(NSDate * _Nullable selectDate, NSString * _Nullable selectValue) {
[self.birthdayBtn setTitle:selectValue forState:0];
}];
}
else if (i == 2)
{
[BRStringPickerView showPickerWithTitle:NSLocalizedString(@"请选择身高", nil) dataSourceArr:hArr selectIndex:2 resultBlock:^(BRResultModel * _Nullable resultModel) {
[BRStringPickerView showPickerWithTitle:GJText(@"请选择身高") dataSourceArr:hArr selectIndex:2 resultBlock:^(BRResultModel * _Nullable resultModel) {
[self.heightBtn setTitle:resultModel.value forState:0];
}];
}
else
{
[BRStringPickerView showPickerWithTitle:NSLocalizedString(@"请选择体重", nil) dataSourceArr:wArr selectIndex:2 resultBlock:^(BRResultModel * _Nullable resultModel) {
[BRStringPickerView showPickerWithTitle:GJText(@"请选择体重") dataSourceArr:wArr selectIndex:2 resultBlock:^(BRResultModel * _Nullable resultModel) {
[self.weightBtn setTitle:resultModel.value forState:0];
}];
}
@ -260,7 +260,7 @@ @@ -260,7 +260,7 @@
// else
// {
// /// 姓名和电话号码
// UITextField *textfield = [UICommon ui_textField:CGRectZero textColor:KKTextBlackColor backColor:KKClearColor font:FontADA_(13) maxTextNum:20 placeholderColor:KKGrey143 placeholder:i == 2 ? NSLocalizedString(@"请输入身高", nil) : NSLocalizedString(@"请输入体重", nil) toMaxNum:^(UITextField *textField) {
// UITextField *textfield = [UICommon ui_textField:CGRectZero textColor:KKTextBlackColor backColor:KKClearColor font:FontADA_(13) maxTextNum:20 placeholderColor:KKGrey143 placeholder:i == 2 ? GJText(@"请输入身高") : GJText(@"请输入体重") toMaxNum:^(UITextField *textField) {
//
// } change:^(UITextField *textField) {
//
@ -372,7 +372,7 @@ @@ -372,7 +372,7 @@
{
UIImage *curImg = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
[picker dismissViewControllerAnimated:YES completion:nil];
[self.iconBtn setImage:curImg forState:0];
[self.iconBtn setImage:[UICommon reduceImage:curImg percent:0.5] forState:0];
}

6
LekangGuard/Home/Homes/HomeViewController.m

@ -61,6 +61,10 @@ @@ -61,6 +61,10 @@
[[[NSNotificationCenter defaultCenter] rac_addObserverForName:UPDATA_DeviceList object:nil] subscribeNext:^(NSNotification *x) {
[self GetDeviceList];
}];
[[[NSNotificationCenter defaultCenter] rac_addObserverForName:@"updateBatteryAndLocation" object:nil] subscribeNext:^(NSNotification *x)
{
[self GetLatest:APIManager.sharedManager.deviceModel.imei];
}];
[self.view addSubview:self.homeTable];
[self.homeTable mas_makeConstraints:^(MASConstraintMaker *make) {
@ -318,7 +322,7 @@ @@ -318,7 +322,7 @@
/// 主动请求位置下发
- (void)GetLatestInstructions:(NSString *)imei
{
[UICommon MessageUpload:NSLocalizedString(@"加载中", nil)];
[UICommon MessageUpload:@"加载中"];
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
[[[APIManager sharedManager] APGET:F(@"%@/%@", Latest_location_app_instructions_URL,imei) parameters:parameters resultClass:nil] subscribeNext:^(id _Nullable x) {
[UICommon HidenLoading];

4
LekangGuard/Home/Homes/Model/HeartAndTempModel.m

@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
success:(void (^)(HeartAndTempModel *model))success
failure:(void (^)(NSError *error))failure
{
[UICommon MessageUpload:NSLocalizedString(@"加载中", nil)];
[UICommon MessageUpload:@"加载中"];
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
[parameters setValue:dateTime forKey:@"date"];
[parameters setValue:APIManager.sharedManager.deviceModel.imei forKey:@"imei"];
@ -51,7 +51,7 @@ @@ -51,7 +51,7 @@
success:(void (^)(id responseObject))success
failure:(void (^)(NSError *error))failure
{
[UICommon MessageUpload:NSLocalizedString(@"加载中", nil)];
[UICommon MessageUpload:@"加载中"];
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
[parameters setValue:APIManager.sharedManager.deviceModel.imei forKey:@"imei"];
[parameters setValue:@(type) forKey:@"type"];

16
LekangGuard/Home/Homes/ScanCodeViewController.m

@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
// Do any additional setup after loading the view.
self.view.backgroundColor = UIColor.darkTextColor;
self.zx_navTitle = GJText(@"添加设备");
[self zx_setRightBtnWithText:NSLocalizedString(@"二维码/条码丢失?", nil) clickedBlock:^(ZXNavItemBtn * _Nonnull btn) {
[self zx_setRightBtnWithText:GJText(@"二维码/条码丢失?") clickedBlock:^(ZXNavItemBtn * _Nonnull btn) {
commWebViewController *vc = [commWebViewController new];
vc.url = QRcodeLostURLStr;
vc.navTitle = GJText(@"二维码/条码丢失");
@ -47,11 +47,11 @@ @@ -47,11 +47,11 @@
{
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"提示", nil) message:F(NSLocalizedString(@"请为%@打开相机权限", nil),APPName) preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"取消", nil) style:(UIAlertActionStyleCancel) handler:^(UIAlertAction * _Nonnull action) {
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:GJText(@"提示") message:F(GJText(@"请为%@打开相机权限"),APPName) preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:GJText(@"取消") style:(UIAlertActionStyleCancel) handler:^(UIAlertAction * _Nonnull action) {
[self.navigationController popViewControllerAnimated:YES];
}];
UIAlertAction *confrmAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"设置", nil) style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) {
UIAlertAction *confrmAction = [UIAlertAction actionWithTitle:GJText(@"设置") style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
}];
[alertController addAction:cancelAction];
@ -84,7 +84,7 @@ @@ -84,7 +84,7 @@
}];
UIButton *btn = [UICommon ui_buttonSimple:CGRectZero font:FontADA_(15) normalColor:KKWhiteColorColor normalText:NSLocalizedString(@"手动输入IMEI/MEID", nil) click:^(id x) {
UIButton *btn = [UICommon ui_buttonSimple:CGRectZero font:FontADA_(15) normalColor:KKWhiteColorColor normalText:GJText(@"手动输入IMEI/MEID") click:^(id x) {
[self stop];
[self enterIMEIClick];
}];
@ -172,19 +172,19 @@ @@ -172,19 +172,19 @@
- (void)enterIMEIClick
{
kWeakSelf(self)
UIAlertController *alert = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"请输入IMEI/MEID号", nil)message:@""preferredStyle:UIAlertControllerStyleAlert];
UIAlertController *alert = [UIAlertController alertControllerWithTitle:GJText(@"请输入IMEI/MEID号")message:@""preferredStyle:UIAlertControllerStyleAlert];
[alert addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
textField.keyboardType = UIKeyboardTypeNumberPad; //设置 UIKeyboardTypeNamePhonePad
textField.delegate = self;
}];
[alert addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"取消", nil)
[alert addAction:[UIAlertAction actionWithTitle:GJText(@"取消")
style:UIAlertActionStyleCancel
handler:^(UIAlertAction * _Nonnull action) {
[self start];
}]];
[alert addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"确定", nil)
[alert addAction:[UIAlertAction actionWithTitle:GJText(@"确定")
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * _Nonnull action)
{

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

@ -43,6 +43,14 @@ @@ -43,6 +43,14 @@
/// 是否编辑
@property (nonatomic ,assign) BOOL isEdit;
@property (nonatomic ,assign) NSInteger Sex;
@property (nonatomic ,strong) NSString *Weight;
@property (nonatomic ,strong) NSString *Height;
@property (nonatomic ,assign) BOOL isSelectIcon;
@end
@implementation EditDeviceViewController
@ -64,6 +72,7 @@ @@ -64,6 +72,7 @@
// Do any additional setup after loading the view.
self.zx_navTitle = GJText(@"设备资料");
self.isEdit = NO;
self.isSelectIcon = NO;
[self zx_setRightBtnWithImg:ImageName_(@"icon_or_code") clickedBlock:^(ZXNavItemBtn * _Nonnull btn) {
QRCodeMsgViewController *vc = [QRCodeMsgViewController new];
[self.navigationController pushViewController:vc animated:YES];
@ -80,6 +89,31 @@ @@ -80,6 +89,31 @@
[self zx_leftClickedBlock:^(ZXNavItemBtn * _Nonnull btn) {
if (self.isEdit)
{
if (APIManager.sharedManager.deviceModel.identity == 2)
{
if (!self.isEditing &&
[self.nameField.text isEqualToString:self.devModel.name] &&
self.Sex == self.devModel.sex &&
[self.phoneField.text isEqualToString:self.devModel.phone] &&
[self.relationLabel.text isEqualToString:self.devModel.relation] &&
[self.Height isEqualToString:self.devModel.height] &&
[self.Weight isEqualToString:self.devModel.weight])
{
[self.navigationController popViewControllerAnimated:YES];
return;
}
}
else
{
if ([self.relationLabel.text isEqualToString:self.devModel.relation] &&
[self.Height isEqualToString:self.devModel.height] &&
[self.Weight isEqualToString:self.devModel.weight])
{
[self.navigationController popViewControllerAnimated:YES];
return;
}
}
EasyAlertView *alertV = [EasyAlertView alertViewWithTitle:nil subtitle:GJText(@"是否保存修改") AlertViewType:AlertViewTypeSystemAlert config:nil];
[alertV addAlertItem:^EasyAlertItem *{
return [EasyAlertItem itemWithTitle:GJText(@"取消") type:AlertItemTypeSystemCancel callback:^(EasyAlertView *showview, long index) {
@ -162,6 +196,8 @@ @@ -162,6 +196,8 @@
/// 头像
UIButton *iconBtn = [UICommon ui_buttonSimple:CGRectZero font:FontADA_(0) normalColor:KKWhiteColorColor normalText:@"" click:^(id x) {
[UICommon resignKeyboard];
if (self.devModel.identity != 2)
return;
if (!self.isEdit)
return;
[self selectIcon];
@ -178,13 +214,14 @@ @@ -178,13 +214,14 @@
else if (i == 1 || i == titleArr.count-1)
{
/// 姓名和电话号码
UITextField *textfield = [UICommon ui_textField:CGRectZero textColor:KKTextBlackColor backColor:KKClearColor font:FontADA_(13) maxTextNum:i == titleArr.count-1 ? 11 : 20 placeholderColor:KKGrey143 placeholder:i == 1 ? GJText(@"请输入姓名") : GJText(@"请输入设备电话号码") toMaxNum:^(UITextField *textField) {
UITextField *textfield = [UICommon ui_textField:CGRectZero textColor:KKGrey121 backColor:KKClearColor font:FontADA_(13) maxTextNum:i == titleArr.count-1 ? 11 : 20 placeholderColor:KKGrey143 placeholder:i == 1 ? GJText(@"请输入姓名") : GJText(@"请输入设备电话号码") toMaxNum:^(UITextField *textField) {
} change:^(UITextField *textField) {
}];
textfield.textAlignment = NSTextAlignmentRight;
if (self.devModel.identity != 2)
textfield.enabled = NO;
if (i == 1)
{
textfield.text = self.devModel.name;
@ -209,14 +246,17 @@ @@ -209,14 +246,17 @@
NSArray *sexArr = @[GJText(@"男"),
GJText(@"女"),
GJText(@"保密")];
NSInteger sex = self.devModel.sex-1 < 0 ? 2 : self.devModel.sex-1;
UIButton *sexBtn = [UICommon ui_buttonSimple:CGRectZero font:FontADA_(13) normalColor:KKTextBlackColor normalText:sexArr[sex] click:^(UIButton *btn) {
NSInteger sexs = self.devModel.sex-1 < 0 ? 2 : self.devModel.sex-1;
self.Sex = self.devModel.sex;
UIButton *sexBtn = [UICommon ui_buttonSimple:CGRectZero font:FontADA_(13) normalColor:KKGrey121 normalText:sexArr[sexs] click:^(UIButton *btn) {
[UICommon resignKeyboard];
if (self.devModel.identity != 2)
return;
if (!self.isEdit)
return;
[BRStringPickerView showPickerWithTitle:GJText(@"请选择性别") dataSourceArr:sexArr selectIndex:self.devModel.sex-1 resultBlock:^(BRResultModel * _Nullable resultModel) {
[btn setTitle:resultModel.value forState:0];
self.devModel.sex = resultModel.index+1;
self.Sex = resultModel.index+1;
}];
}];
sexBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
@ -330,7 +370,7 @@ @@ -330,7 +370,7 @@
{
[BRStringPickerView showPickerWithTitle:GJText(@"请选择身高") dataSourceArr:hArr selectIndex:idx resultBlock:^(BRResultModel * _Nullable resultModel) {
[weakself.heightBtn setTitle:resultModel.value forState:0];
weakself.devModel.height = resultModel.value;
weakself.Height = resultModel.value;
}];
}
}];
@ -342,7 +382,7 @@ @@ -342,7 +382,7 @@
{
[BRStringPickerView showPickerWithTitle:GJText(@"请选择体重") dataSourceArr:wArr selectIndex:idx resultBlock:^(BRResultModel * _Nullable resultModel) {
[weakself.weightBtn setTitle:resultModel.value forState:0];
weakself.devModel.weight = resultModel.value;
weakself.Weight = resultModel.value;
}];
}
}];
@ -352,17 +392,21 @@ @@ -352,17 +392,21 @@
commBtn.tag = i;
if (i == 1)
{
[commBtn setTitleColor:KKGrey121 forState:0];
[commBtn setTitle:self.devModel.birthday forState:0];
commBtn.enabled = NO;
self.birthdayBtn = commBtn;
}
else if (i == 2)
{
[commBtn setTitle:self.devModel.height forState:0];
self.Height = self.devModel.height;
self.heightBtn = commBtn;
}
else if (i == 3)
{
[commBtn setTitle:self.devModel.weight forState:0];
self.Weight = self.devModel.weight;
self.weightBtn = commBtn;
}
commBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
@ -433,20 +477,24 @@ @@ -433,20 +477,24 @@
{
UIImage *curImg = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
[picker dismissViewControllerAnimated:YES completion:nil];
[self.iconBtn setImage:curImg forState:0];
[self.iconBtn setImage:[UICommon reduceImage:curImg percent:0.5] forState:0];
self.isSelectIcon = YES;
}
- (void)setIsEditMsg
{
self.nameField.enabled = self.isEdit;
self.phoneField.enabled = self.isEdit;
self.nameField.textColor = self.isEdit ? KKTextBlackColor : KKGrey121;
self.phoneField.textColor = self.isEdit ? KKTextBlackColor : KKGrey121;
if (self.devModel.identity == 2)
{
self.nameField.enabled = self.isEdit;
self.phoneField.enabled = self.isEdit;
self.nameField.textColor = self.isEdit ? KKTextBlackColor : KKGrey121;
self.phoneField.textColor = self.isEdit ? KKTextBlackColor : KKGrey121;
[self.sexBtn setTitleColor:self.isEdit ? KKTextBlackColor : KKGrey121 forState:0];
}
[self.sexBtn setTitleColor:self.isEdit ? KKTextBlackColor : KKGrey121 forState:0];
[self.birthdayBtn setTitleColor:self.isEdit ? KKTextBlackColor : KKGrey121 forState:0];
//[self.birthdayBtn setTitleColor:self.isEdit ? KKTextBlackColor : KKGrey121 forState:0];
[self.heightBtn setTitleColor:self.isEdit ? KKTextBlackColor : KKGrey121 forState:0];
[self.weightBtn setTitleColor:self.isEdit ? KKTextBlackColor : KKGrey121 forState:0];
self.relationLabel.textColor = self.isEdit ? KKTextBlackColor : KKGrey121 ;
@ -460,13 +508,13 @@ @@ -460,13 +508,13 @@
{
if (self.phoneField.text.length <= 0)
{
[UICommon MessageErrorText:NSLocalizedString(@"请输入号码", nil)];
[UICommon MessageErrorText:@"请输入号码"];
return;
}
if (self.nameField.text.length <= 0)
{
[UICommon MessageErrorText:NSLocalizedString(@"请输入姓名", nil)];
[UICommon MessageErrorText:@"请输入姓名"];
return;
}
[UICommon MessageUpload:@"加载中"];
@ -474,13 +522,13 @@ @@ -474,13 +522,13 @@
self.iconFile = UIImageJPEGRepresentation(self.iconBtn.currentImage, 1.0f);
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
[parameters setValue:APIManager.sharedManager.deviceModel.imei forKey:@"imei"];
[parameters setValue:self.devModel.height forKey:@"height"];
[parameters setValue:self.Height forKey:@"height"];
[parameters setValue:self.nameField.text forKey:@"name"];
[parameters setValue:self.phoneField.text forKey:@"phone"];
[parameters setValue:self.relationLabel.text forKey:@"relation"];
[parameters setValue:@(self.devModel.relationImageId) forKey:@"relationImageId"];
[parameters setValue:@(self.devModel.sex) forKey:@"sex"];
[parameters setValue:self.devModel.weight forKey:@"weight"];
[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) {
[super updataNotificat];
[UICommon HidenLoading];

92
LekangGuard/Home/MoreService (更多功能)/LocationModeViewController.m

@ -11,6 +11,8 @@ @@ -11,6 +11,8 @@
@property (nonatomic ,strong) NSMutableArray *imgArr;
@property (nonatomic ,assign) NSInteger time;
@end
@implementation LocationModeViewController
@ -24,28 +26,50 @@ @@ -24,28 +26,50 @@
[self zx_setRightBtnWithText:GJText(@"保存") clickedBlock:^(ZXNavItemBtn * _Nonnull btn) {
[self SetLocationModel];
}];
NSArray *arr = @[GJText(@"正常模式"),GJText(@"省电模式"),GJText(@"高频模式")];
NSArray *arr = @[GJText(@"高频模式"),GJText(@"正常模式"),GJText(@"省电模式")];
UIView *bgView = [UICommon ui_view:CGRectMake(0, iPhoneX_NavHeight, SCREEN_WIDTH, Adapted(55)*arr.count) backgroundColor:KKWhiteColorColor cornerRadius:0 borderWidth:0 borderColor:KKWhiteColorColor];
[self.view addSubview:bgView];
NSArray *timeArr = @[F(GJText(@":%ld分钟/次"), self.model.positioningThreeInterva),
F(GJText(@":%ld分钟/次"), self.model.positioningOneInterva),
F(GJText(@":%ld分钟/次"), self.model.positioningTwoInterva)];
UIView *bgView1 = [UICommon ui_view:CGRectMake(15, iPhoneX_NavHeight+15, SCREEN_WIDTH-30, Adapted(55)*arr.count) backgroundColor:KKWhiteColorColor cornerRadius:5 borderWidth:0 borderColor:KKWhiteColorColor];
[self.view addSubview:bgView1];
UILabel *headerTitle = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentLeft font:FontADA_(12) textColor:KKGrey121 text:@"" Radius:0];
headerTitle.text = GJText(@"温馨提示:建议选择省电模式!\n高频模式:定位频率较高\n正常模式:定位频率适中\n省电模式:定位频率较低");
[self.view addSubview:headerTitle];
[headerTitle mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self.view).inset(15);
make.top.equalTo(bgView.mas_bottom).offset(Adapted(20));
UIImageView *iconImg = [UICommon ui_imageView:CGRectZero fileName:@"LocationMode_icon"];
[bgView1 addSubview: iconImg];
[iconImg mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(bgView1);
make.top.equalTo(bgView1).offset(10);
make.size.mas_equalTo(iconImg.image.size);
}];
UILabel *headerTitle = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentLeft font:FontADA_(15) textColor:KKTextBlackColor text:@"" Radius:0];
headerTitle.text = GJText(@"设置设备的定位模式:频次间隔越久,设备续航时间越长。");
[bgView1 addSubview:headerTitle];
[headerTitle mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(bgView1).inset(15);
make.bottom.equalTo(bgView1.mas_bottom).inset(Adapted(10));
}];
UIView *bgView = [UICommon ui_view:CGRectMake(15, bgView1.bottom+15, SCREEN_WIDTH-30, Adapted(55)*arr.count) backgroundColor:KKWhiteColorColor cornerRadius:5 borderWidth:0 borderColor:KKWhiteColorColor];
[self.view addSubview:bgView];
for (int i = 0; i < arr.count; i++)
{
UIButton *titleBtn = [UICommon ui_buttonSimple:CGRectZero font:FontADA_(13) normalColor:KKTextBlackColor normalText:arr[i] click:^(UIButton *btn) {
UIButton *titleBtn = [UICommon ui_buttonSimple:CGRectZero font:FontADA_(13) normalColor:KKTextBlackColor normalText:F(@"%@%@", arr[i],timeArr[i]) click:^(UIButton *btn) {
for (UIImageView *image in self.imgArr)
{
image.image = image.tag == btn.tag ? ImageName_(@"icon_selectImg_Yes") : ImageName_(@"");
}
self.model.positioningModeId = btn.tag+1;
if (btn.tag == 0)
self.time = self.model.positioningThreeInterva;
else if (btn.tag == 1)
self.time = self.model.positioningOneInterva;
else if (btn.tag == 2)
self.time = self.model.positioningTwoInterva;
}];
titleBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
@ -84,13 +108,27 @@ @@ -84,13 +108,27 @@
}];
}
}
NSInteger tags = 0;
if (self.model.positioningOneInterva == APIManager.sharedManager.deviceModel.positioningInterval)
NSInteger tags = 1;
if (self.model.positioningThreeInterva == APIManager.sharedManager.deviceModel.positioningInterval)
{
/// 高频
self.time = self.model.positioningThreeInterva;
tags = 0;
else if (self.model.positioningTwoInterva == APIManager.sharedManager.deviceModel.positioningInterval)
}
else if (self.model.positioningOneInterva == APIManager.sharedManager.deviceModel.positioningInterval)
{
/// 正常
self.time = self.model.positioningOneInterva;
tags = 1;
else if (self.model.positioningThreeInterva == APIManager.sharedManager.deviceModel.positioningInterval)
}
else if (self.model.positioningTwoInterva == APIManager.sharedManager.deviceModel.positioningInterval)
{
/// 省电
self.time = self.model.positioningTwoInterva;
tags = 2;
}
for (UIImageView *image in self.imgArr)
{
@ -105,25 +143,29 @@ @@ -105,25 +143,29 @@
{
[UICommon MessageUpload:@"加载中"];
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
NSInteger time = 0;
if (self.model.positioningModeId == 1)
time = self.model.positioningOneInterva;
else if (self.model.positioningModeId == 2)
time = self.model.positioningTwoInterva;
else if (self.model.positioningModeId == 3)
time = self.model.positioningThreeInterva;
[super updataNotificat];
[[[APIManager sharedManager] APGET:F(@"%@/%ld/%@", LocationModel_URL,time,APIManager.sharedManager.deviceModel.imei) parameters:parameters resultClass:nil] subscribeNext:^(id _Nullable x) {
[[[APIManager sharedManager] APGET:F(@"%@/%ld/%@", LocationModel_URL,self.time,APIManager.sharedManager.deviceModel.imei) parameters:parameters resultClass:nil] subscribeNext:^(id _Nullable x) {
[UICommon HidenLoading];
[UICommon MessageSuccessText:@"保存成功"];
self.isLoSuccess();
[self UpdataDeviceMsg];
[super updataNotificat];
AfterDispatch(0.5, ^{
self.isLoSuccess();
});
} error:^(NSError * _Nullable error) {
NSDictionary *dic = error.userInfo;
[UICommon MessageErrorText:dic[NSLocalizedDescriptionKey]];
}];
}
- (void)UpdataDeviceMsg
{
DeviceModel *model = APIManager.sharedManager.deviceModel;
model.positioningInterval = self.time;
[APIManager.sharedManager.cache setObject:model forKey:sDeviceKey];
}
/*
#pragma mark - Navigation

36
LekangGuard/Home/MoreService (更多功能)/MoreServiceViewController.m

@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
[super viewDidLoad];
// Do any additional setup after loading the view.
self.view.backgroundColor = KKBackgroundGrey;
self.zx_navTitle = NSLocalizedString(@"更多服务", nil);
self.zx_navTitle = GJText(@"更多服务");
[self setMenu];
[self.view addSubview:self.menuScroll];
[self.menuScroll mas_makeConstraints:^(MASConstraintMaker *make) {
@ -45,7 +45,7 @@ @@ -45,7 +45,7 @@
- (void)SubOneView
{
MoreMenuTitleView *titleView = [[MoreMenuTitleView alloc] initWithFrame:CGRectMake(0, 10, SCREEN_WIDTH, 30)];
titleView.titleStr = NSLocalizedString(@"常用功能", nil);
titleView.titleStr = GJText(@"常用功能");
[self.menuScroll addSubview:titleView];
CGFloat sizes = (SCREEN_WIDTH-65)/4;
@ -68,7 +68,7 @@ @@ -68,7 +68,7 @@
- (void)subTwoView:(UIView *)views
{
MoreMenuTitleView *titleView = [[MoreMenuTitleView alloc] initWithFrame:CGRectMake(0, views.bottom+10, SCREEN_WIDTH, 30)];
titleView.titleStr = NSLocalizedString(@"设备设置", nil);
titleView.titleStr = GJText(@"设备设置");
[self.menuScroll addSubview:titleView];
@ -81,7 +81,7 @@ @@ -81,7 +81,7 @@
[setView DevicePosition];
/// 远程关机
UIButton *shutdownBtn = [UICommon ui_buttonSimple:CGRectMake(10, setView.bottom+Adapted(60), SCREEN_WIDTH-20, Adapted(44)) font:FontADA_(15) normalColor:KKWhiteColorColor normalText:NSLocalizedString(@"远程关机", nil) click:^(id x) {
UIButton *shutdownBtn = [UICommon ui_buttonSimple:CGRectMake(10, setView.bottom+Adapted(60), SCREEN_WIDTH-20, Adapted(44)) font:FontADA_(15) normalColor:KKWhiteColorColor normalText:GJText(@"远程关机") click:^(id x) {
EasyAlertView *alertV = [EasyAlertView alertViewWithTitle:GJText(@"远程关机") subtitle:GJText(@"\n设备将会远程关机,”是否“确认") AlertViewType:AlertViewTypeSystemAlert config:nil];
[alertV addAlertItem:^EasyAlertItem *{
@ -105,7 +105,7 @@ @@ -105,7 +105,7 @@
msg = GJText(@"\n您是设备的管理员,如果您进行解绑,其他绑定该设备的用户,将自动解绑,确认解除绑定吗?");
/// 解除与设备的绑定
UIButton *unbundleBtn = [UICommon ui_buttonSimple:CGRectMake(10, shutdownBtn.bottom+Adapted(15), SCREEN_WIDTH-20, Adapted(44)) font:FontADA_(15) normalColor:KKMainColor normalText:NSLocalizedString(@"解除与设备的绑定", nil) click:^(id x) {
UIButton *unbundleBtn = [UICommon ui_buttonSimple:CGRectMake(10, shutdownBtn.bottom+Adapted(15), SCREEN_WIDTH-20, Adapted(44)) font:FontADA_(15) normalColor:KKMainColor normalText:GJText(@"解除与设备的绑定") click:^(id x) {
EasyAlertView *alertV = [EasyAlertView alertViewWithTitle:GJText(@"设备解绑") subtitle:GJText(msg) AlertViewType:AlertViewTypeSystemAlert config:nil];
[alertV addAlertItem:^EasyAlertItem *{
@ -145,71 +145,71 @@ @@ -145,71 +145,71 @@
// if ([APIManager sharedManager].deviceModel.identity == 2)
// [self.menuArr addObject:NSLocalizedString(@"管理员", nil)];
// [self.menuArr addObject:GJText(@"管理员")];
// else
[self.menuArr addObject:NSLocalizedString(@"电话本", nil)];
[self.menuArr addObject:GJText(@"电话本")];
[self.menuImgArr addObject:@"icon_home_phone_book"];
if([APIManager sharedManager].deviceModel.videoModelName != 0)
{
[self.menuArr addObject:NSLocalizedString(@"视频通话", nil)];
[self.menuArr addObject:GJText(@"视频通话")];
[self.menuImgArr addObject:@"icon_more_video_call"];
}
if ([APIManager sharedManager].deviceModel.watchAlarmClock )
{
[self.menuArr addObject:NSLocalizedString(@"设备闹钟", nil)];
[self.menuArr addObject:GJText(@"设备闹钟")];
[self.menuImgArr addObject:@"icon_more_watch_the_clock"];
}
if ([APIManager sharedManager].deviceModel.classDisable )
{
[self.menuArr addObject:NSLocalizedString(@"上课禁用", nil)];
[self.menuArr addObject:GJText(@"上课禁用")];
[self.menuImgArr addObject:@"icon_more_class_disable"];
}
if ([APIManager sharedManager].deviceModel.sosPhone)
{
[self.menuArr addObject:NSLocalizedString(@"SOS号码", nil)];
[self.menuArr addObject:GJText(@"SOS号码")];
[self.menuImgArr addObject:@"icon_more_sos"];
}
// if([APIManager sharedManager].deviceModel.watchWiff)
// {
// [self.menuArr addObject:NSLocalizedString(@"设备WIFI", nil)];
// [self.menuArr addObject:GJText(@"设备WIFI")];
// [self.menuImgArr addObject:@"icon_more_watch_wifi"];
// }
if([APIManager sharedManager].deviceModel.timingSwitch)
{
[self.menuArr addObject:NSLocalizedString(@"定时开关机", nil)];
[self.menuArr addObject:GJText(@"定时开关机")];
[self.menuImgArr addObject:@"icon_more_timing_switch"];
}
if([APIManager sharedManager].deviceModel.lookupFun)
{
[self.menuArr addObject:NSLocalizedString(@"查找设备", nil)];
[self.menuArr addObject:GJText(@"查找设备")];
[self.menuImgArr addObject:@"icon_more_looking_watch"];
}
if([APIManager sharedManager].deviceModel.stepRecorder)
{
[self.menuArr addObject:NSLocalizedString(@"计步", nil)];
[self.menuArr addObject:GJText(@"计步")];
[self.menuImgArr addObject:@"icon_more_step_gauge"];
}
// // 学生卡
// if([APIManager sharedManager].deviceModel.deviceType == 2)
// {
// [self.menuArr addObject:NSLocalizedString(@"亲情号", nil)];
// [self.menuArr addObject:GJText(@"亲情号")];
// [self.menuImgArr addObject:@"icon_home_phone_book"];
// }
// // 学生资料
// if([APIManager sharedManager].deviceModel.deviceType == 2)
// {
// [self.menuArr addObject:NSLocalizedString(@"学生资料", nil)];
// [self.menuArr addObject:GJText(@"学生资料")];
// [self.menuImgArr addObject:@"icon_more_watch_data"];
// }
// if ([APIManager sharedManager].deviceModel.whiteList)
// {
// [self.menuArr addObject:NSLocalizedString(@"通讯录", nil)];
// [self.menuArr addObject:GJText(@"通讯录")];
// [self.menuImgArr addObject:@"icon_home_phone_book"];
// }

14
LekangGuard/Home/MoreService (更多功能)/View/DeviceSetView.m

@ -176,19 +176,19 @@ @@ -176,19 +176,19 @@
- (void)DevicePosition
{
kWeakSelf(self)
[UICommon MessageUpload:@"加载中"];
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
[[[APIManager sharedManager] APGET:F(@"%@/%@", DevicePosition_URL,APIManager.sharedManager.deviceModel.imei) parameters:parameters resultClass:PositionModel.class] subscribeNext:^(PositionModel *model) {
[UICommon HidenLoading];
if (model != nil)
{
NSLog(@"--->%@",APIManager.sharedManager.deviceModel);
if (model.positioningOneInterva == APIManager.sharedManager.deviceModel.positioningInterval)
self.textLabel.text = model.modelOneName;
else if (model.positioningTwoInterva == APIManager.sharedManager.deviceModel.positioningInterval)
self.textLabel.text = model.modelTwoName;
else if (model.positioningThreeInterva == APIManager.sharedManager.deviceModel.positioningInterval)
self.textLabel.text = model.modelThreeName;
if (APIManager.sharedManager.deviceModel.positioningInterval == model.positioningOneInterva)//10
self.textLabel.text = GJText(@"正常模式");
else if (APIManager.sharedManager.deviceModel.positioningInterval == model.positioningTwoInterva)//60
self.textLabel.text = GJText(@"省电模式");
else if (APIManager.sharedManager.deviceModel.positioningInterval == model.positioningThreeInterva)//5
self.textLabel.text = GJText(@"高频模式");
weakself.pmodel = model;
}

1
LekangGuard/Home/VideoChat(视频聊天)/Agora/CallViewController.m

@ -149,7 +149,6 @@ @@ -149,7 +149,6 @@
//[callObserver setDelegate:self queue:dispatch_get_main_queue()];
}
self.statusLabel.text = GJText(@"正在发起通话请求...");
self.jietingLabel.text = GJText(@"接听");
self.guanduanLabel.text = GJText(@"挂断");
self.guanduanLabel1.text = GJText(@"挂断");

2
LekangGuard/LekangGuard.pch

@ -178,6 +178,8 @@ @@ -178,6 +178,8 @@
// 通话时间 和 视频ID 的记录 Key
#define VideoTimeAndIDAndWHRecordKey @"VideoTimeAndIDAndWHRecordKey"
/// 点击未读消息后更新未读消息数量
#define KK_UPDATE_ALL_NEWS_MESSAGE @"UPDATE_ALL_NEWS_MESSAGE"
#endif

18
LekangGuard/Login/EmailLoginViewController.m

@ -37,7 +37,7 @@ @@ -37,7 +37,7 @@
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.zx_navTitle = NSLocalizedString(@"邮箱登录", nil);
self.zx_navTitle = GJText(@"邮箱登录");
self.zx_navBarBackgroundColor = KKClearColor;
self.zx_navTintColor = KKTextBlackColor;
self.backImgName = @"asd";
@ -83,7 +83,7 @@ @@ -83,7 +83,7 @@
}
UITextField *textfield = [UICommon ui_textField:CGRectZero textColor:KKTextBlackColor backColor:KKClearColor font:FontADA_(14) maxTextNum:30 placeholderColor:KKGrey143 placeholder:i == 0 ? NSLocalizedString(@"请输入邮箱", nil) : NSLocalizedString(@"请输入密码", nil) toMaxNum:^(UITextField *textField) {
UITextField *textfield = [UICommon ui_textField:CGRectZero textColor:KKTextBlackColor backColor:KKClearColor font:FontADA_(14) maxTextNum:30 placeholderColor:KKGrey143 placeholder:i == 0 ? GJText(@"请输入邮箱") : GJText(@"请输入密码") toMaxNum:^(UITextField *textField) {
} change:^(UITextField *textField) {
@ -111,7 +111,7 @@ @@ -111,7 +111,7 @@
}
/// 记住密码按钮
UIButton *rememberPassBtn = [UICommon ui_buttonSimple:CGRectZero font:FontADA_(12) normalColor:KKMainColor normalText:NSLocalizedString(@"记住密码", ni) click:^(UIButton *sender) {
UIButton *rememberPassBtn = [UICommon ui_buttonSimple:CGRectZero font:FontADA_(12) normalColor:KKMainColor normalText:GJText(@"记住密码") click:^(UIButton *sender) {
[sender setSelected:!sender.isSelected];
self.isRememberPWD = sender.isSelected;
}];
@ -132,7 +132,7 @@ @@ -132,7 +132,7 @@
[self aucnTexg];
/// 登录
UIButton *loginBtn = [UICommon ui_buttonSimple:CGRectZero font:FontADA_(15) normalColor:KKWhiteColorColor normalText:NSLocalizedString(@"登录",nil) click:^(id x) {
UIButton *loginBtn = [UICommon ui_buttonSimple:CGRectZero font:FontADA_(15) normalColor:KKWhiteColorColor normalText:GJText(@"登录") click:^(id x) {
[self UserLogin];
}];
loginBtn.backgroundColor = RGB(255, 173, 1);
@ -149,7 +149,7 @@ @@ -149,7 +149,7 @@
/// 立即注册
UIButton *registerBtn = [UICommon ui_buttonSimple:CGRectZero font:FontADA_(12) normalColor:KKGrey102 normalText:NSLocalizedString(@"立即注册", ni) click:^(UIButton *sender) {
UIButton *registerBtn = [UICommon ui_buttonSimple:CGRectZero font:FontADA_(12) normalColor:KKGrey102 normalText:GJText(@"立即注册") click:^(UIButton *sender) {
RegisterViewController *vc = [RegisterViewController new];
vc.isViewType = 0;
@ -205,16 +205,16 @@ @@ -205,16 +205,16 @@
{
if (![self.emailField.text validateEmail])
{
[UICommon MessageErrorText:NSLocalizedString(@"请输入正确的邮箱", nil)];
[UICommon MessageErrorText:GJText(@"请输入正确的邮箱")];
return;
}
else if (self.passField.text.length <= 0)
else if (self.passField.text.length < 6)
{
[UICommon MessageErrorText:NSLocalizedString(@"密码为6~16位字符内", nil)];
[UICommon MessageErrorText:GJText(@"密码为6~16位字符内")];
return;
}
self.loginBtn.enabled = NO;
[UICommon MessageUpload:NSLocalizedString(@"登录中", nil)];
[UICommon MessageUpload:@"登录中"];
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
[parameters setValue:self.emailField.text forKey:@"email"];
[parameters setValue:self.passField.text forKey:@"password"];

14
LekangGuard/Login/LoginViewController.m

@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
make.height.width.mas_equalTo(Adapted(90));
}];
UILabel *logoName = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentCenter font:FontADA_(17) textColor:KKTextBlackColor text:NSLocalizedString(@"乐康守护", nil) Radius:0];
UILabel *logoName = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentCenter font:FontADA_(17) textColor:KKTextBlackColor text:GJText(@"乐康守护") Radius:0];
[self.view addSubview:logoName];
[logoName mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(logoImg.mas_bottom).offset(Adapted(15));
@ -46,9 +46,9 @@ @@ -46,9 +46,9 @@
//去除配置 可自定义链接样式
agreementView.linkTextAttributes = @{};
// lable.text = @"点击“注册”即表示你同意《用户服务协议》";
NSString * userAgreement = NSLocalizedString(@"用户服务协议", nil);
NSString * privacyPolicy = NSLocalizedString(@"隐私政策", nil);
NSString * allStr = [NSString stringWithFormat:NSLocalizedString(@"点击登录即表示您同意%@和%@", nil),userAgreement,privacyPolicy];
NSString * userAgreement = GJText(@"用户服务协议");
NSString * privacyPolicy = GJText(@"隐私政策");
NSString * allStr = [NSString stringWithFormat:GJText(@"点击登录即表示您同意%@和%@"),userAgreement,privacyPolicy];
NSMutableAttributedString * attributedStr = [[NSMutableAttributedString alloc] initWithString:allStr];
[attributedStr addAttribute:NSForegroundColorAttributeName value:KKMainColor range:[allStr rangeOfString:userAgreement]];
@ -57,8 +57,8 @@ @@ -57,8 +57,8 @@
[attributedStr addAttribute:NSForegroundColorAttributeName value:KKMainColor range:[allStr rangeOfString:privacyPolicy]];
[attributedStr addAttribute:NSLinkAttributeName value:PrivacyPolicyURLStr range:[allStr rangeOfString:privacyPolicy]];
[attributedStr addAttribute:NSForegroundColorAttributeName value:KKGrey121 range:[allStr rangeOfString:NSLocalizedString(@"点击登录即表示您同意", nil)]];
[attributedStr addAttribute:NSForegroundColorAttributeName value:KKGrey121 range:[allStr rangeOfString:NSLocalizedString(@"和", nil)]];
[attributedStr addAttribute:NSForegroundColorAttributeName value:KKGrey121 range:[allStr rangeOfString:GJText(@"点击登录即表示您同意")]];
[attributedStr addAttribute:NSForegroundColorAttributeName value:KKGrey121 range:[allStr rangeOfString:GJText(@"和")]];
agreementView.attributedText = attributedStr;
agreementView.textAlignment = NSTextAlignmentCenter;
@ -73,7 +73,7 @@ @@ -73,7 +73,7 @@
/// 邮箱登录
UIButton *weChatBtn = [UICommon ui_buttonSimple:CGRectZero font:FontADA_(15) normalColor:KKWhiteColorColor normalText:NSLocalizedString(@" 邮箱登录",nil) click:^(id x) {
UIButton *weChatBtn = [UICommon ui_buttonSimple:CGRectZero font:FontADA_(15) normalColor:KKWhiteColorColor normalText:GJText(@" 邮箱登录") click:^(id x) {
EmailLoginViewController *vc = [EmailLoginViewController new];
[[UICommon currentVC].navigationController pushViewController:vc animated:YES];

46
LekangGuard/Login/RegisterViewController.m

@ -41,16 +41,16 @@ @@ -41,16 +41,16 @@
self.zx_navTintColor = KKTextBlackColor;
self.backImgName = @"asd";
// Do any additional setup after loading the view.
self.zx_navTitle = NSLocalizedString(self.isViewType == 0 ? GJText(@"注册") : GJText(@"忘记密码"), nil);
self.zx_navTitle = self.isViewType == 0 ? GJText(@"注册") : GJText(@"忘记密码");
NSArray *titleArr = @[NSLocalizedString(@"邮箱", nil),
NSLocalizedString(@"验证码", nil),
NSLocalizedString(@"密码", nil),
NSLocalizedString(@"确认密码", nil)];
NSArray *placeholderArr = @[NSLocalizedString(@"请输入邮箱", nil),
NSLocalizedString(@"请输入验证码", nil),
NSLocalizedString(@"请输入密码", nil),
NSLocalizedString(@"请输入确认密码", nil)];
NSArray *titleArr = @[GJText(@"邮箱"),
GJText(@"验证码"),
GJText(@"密码"),
GJText(@"确认密码")];
NSArray *placeholderArr = @[GJText(@"请输入邮箱"),
GJText(@"请输入验证码"),
GJText(@"请输入6~16个字符"),
GJText(@"请输入6~16个字符")];
for (int i = 0; i < titleArr.count; i++)
{
@ -76,7 +76,7 @@ @@ -76,7 +76,7 @@
UIButton *rightBtn;
if (i == 1)
{
rightBtn = [UICommon ui_buttonSimple:CGRectZero font:FontADA_(12) normalColor:KKMainColor normalText:NSLocalizedString(@"获取验证码", nil) click:^(UIButton *sender) {
rightBtn = [UICommon ui_buttonSimple:CGRectZero font:FontADA_(12) normalColor:KKMainColor normalText:GJText(@"获取验证码") click:^(UIButton *sender) {
[self GetEmailCode];
}];
CGRect rect = [UICommon GetTextWidth:rightBtn.currentTitle ViewHeight:Adapted(30) fontSize:FontADA_(12) type:@"w"];
@ -155,9 +155,9 @@ @@ -155,9 +155,9 @@
//去除配置 可自定义链接样式
agreementView.linkTextAttributes = @{};
// lable.text = @"点击“注册”即表示你同意《用户服务协议》";
NSString * userAgreement = NSLocalizedString(@"用户服务协议", nil);
NSString * privacyPolicy = NSLocalizedString(@"隐私政策", nil);
NSString * allStr = [NSString stringWithFormat:NSLocalizedString(@"点击注册即表示您同意%@和%@", nil),userAgreement,privacyPolicy];
NSString * userAgreement = GJText(@"用户服务协议");
NSString * privacyPolicy = GJText(@"隐私政策");
NSString * allStr = [NSString stringWithFormat:GJText(@"点击注册即表示您同意%@和%@"),userAgreement,privacyPolicy];
NSMutableAttributedString * attributedStr = [[NSMutableAttributedString alloc] initWithString:allStr];
[attributedStr addAttribute:NSForegroundColorAttributeName value:KKMainColor range:[allStr rangeOfString:userAgreement]];
@ -166,8 +166,8 @@ @@ -166,8 +166,8 @@
[attributedStr addAttribute:NSForegroundColorAttributeName value:KKMainColor range:[allStr rangeOfString:privacyPolicy]];
[attributedStr addAttribute:NSLinkAttributeName value:PrivacyPolicyURLStr range:[allStr rangeOfString:privacyPolicy]];
[attributedStr addAttribute:NSForegroundColorAttributeName value:KKGrey121 range:[allStr rangeOfString:NSLocalizedString(@"点击注册即表示您同意", nil)]];
[attributedStr addAttribute:NSForegroundColorAttributeName value:KKGrey121 range:[allStr rangeOfString:NSLocalizedString(@"和", nil)]];
[attributedStr addAttribute:NSForegroundColorAttributeName value:KKGrey121 range:[allStr rangeOfString:GJText(@"点击注册即表示您同意")]];
[attributedStr addAttribute:NSForegroundColorAttributeName value:KKGrey121 range:[allStr rangeOfString:GJText(@"和")]];
agreementView.attributedText = attributedStr;
agreementView.textAlignment = NSTextAlignmentCenter;
@ -190,7 +190,7 @@ @@ -190,7 +190,7 @@
[UICommon resignKeyboard];
if (![self.emailField.text validateEmail])
{
[UICommon MessageErrorText:@"请输入正确的邮箱"];
[UICommon MessageErrorText:@"请输入邮箱"];
return;
}
else if (self.codeField.text.length <= 1)
@ -200,12 +200,12 @@ @@ -200,12 +200,12 @@
}
else if (self.passField.text.length < 6 || self.passField.text.length > 16)
{
[UICommon MessageErrorText:@"密码6~16位字符内"];
[UICommon MessageErrorText:@"请输入密码"];
return;
}
else if (self.passIField.text.length < 6 || self.passIField.text.length > 16)
{
[UICommon MessageErrorText:@"密码6~16位字符内"];
[UICommon MessageErrorText:@"请输入密码"];
return;
}
else if (![self.passField.text isEqualToString:self.passIField.text])
@ -228,7 +228,7 @@ @@ -228,7 +228,7 @@
[userCache setObject:userDic forKey:UserCacheKey];
self.isRegisterSuccess();
[UICommon MessageSuccessText:NSLocalizedString(self.isViewType == 0 ? @"注册成功,请登录账号" : @"密码重置成功,请登录账号", nil)];
[UICommon MessageSuccessText:self.isViewType == 0 ? GJText(@"注册成功,请登录账号") : GJText(@"密码重置成功,请登录账号")];
AfterDispatch(1, ^{
[[UICommon currentVC].navigationController popViewControllerAnimated:YES];
self.registerBtn.enabled = YES;
@ -247,19 +247,18 @@ @@ -247,19 +247,18 @@
{
if (![self.emailField.text validateEmail])
{
[UICommon MessageErrorText:NSLocalizedString(@"请输入正确的邮箱", nil)];
[UICommon MessageErrorText:@"请输入正确的邮箱"];
return;
}
self.codeBtn.enabled = NO;
[UICommon MessageUpload:NSLocalizedString(@"加载中", nil)];
[UICommon MessageUpload:@"加载中"];
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
[parameters setValue:self.emailField.text forKey:@"email"];
[parameters setValue:self.isViewType == 0 ? @(1) : @(2) forKey:@"type"];
[[[APIManager sharedManager] APGET:EmailCode_URL parameters:parameters resultClass:nil] subscribeNext:^(id _Nullable x) {
[UICommon MessageSuccessText:@"获取验证码成功"];
[self timeOutCount];
} error:^(NSError * _Nullable error) {
self.codeBtn.enabled = YES;
NSDictionary *dic = error.userInfo;
[UICommon MessageErrorText:dic[NSLocalizedDescriptionKey]];
}];
@ -281,7 +280,6 @@ @@ -281,7 +280,6 @@
dispatch_async(dispatch_get_main_queue(), ^{
//设置界面的按钮显示 根据自己需求设置
weakself.codeBtn.selected = NO;
weakself.codeBtn.enabled = YES;
weakself.codeBtn.userInteractionEnabled = YES;
});

3
LekangGuard/Managers/UIURL.h

@ -276,4 +276,7 @@ @@ -276,4 +276,7 @@
/// APP挂断后上传视频通话记录
#define VideoRecord_URL @"/device_video_record_app/record/videoRecord"
/// 查询未读消息数GET
#define UnReadTotal_URL @"/reminder_message_app/query/unReadTotal"
#endif /* UIURL_h */

14
LekangGuard/Map/VC/MapViewController.m

@ -52,17 +52,12 @@ @@ -52,17 +52,12 @@
[self rightBtns];
[[NSNotificationCenter defaultCenter] addObserverForName:@"deviceNowLocation"
object:nil
queue:[NSOperationQueue mainQueue]
usingBlock:^(NSNotification * _Nonnull note)
{
[[[NSNotificationCenter defaultCenter] rac_addObserverForName:@"updateBatteryAndLocation" object:nil] subscribeNext:^(NSNotification *x){
[self UpdataLatestlocation:APIManager.sharedManager.deviceModel.imei];
}];
}
- (void)rightBtns
{
NSMutableArray *btnsTitleArr = [NSMutableArray new];
@ -194,11 +189,6 @@ @@ -194,11 +189,6 @@
return _topView;
}
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
@ -212,7 +202,7 @@ @@ -212,7 +202,7 @@
- (void)GetLatest
{
NSString *imei = APIManager.sharedManager.deviceModel.imei;
[UICommon MessageUpload:NSLocalizedString(@"定位中", nil)];
[UICommon MessageUpload:@"定位中"];
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
[[[APIManager sharedManager] APGET:F(@"%@/%@", Latest_location_app_instructions_URL,imei) parameters:parameters resultClass:nil] subscribeNext:^(id _Nullable x) {

2
LekangGuard/Map/VC/View/MapMessageView.m

@ -51,7 +51,7 @@ @@ -51,7 +51,7 @@
}];
/// 位置
UILabel *addLabel = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentLeft font:FontADA_(12) textColor:KKTextBlackColor text:NSLocalizedString(@"当前位置未知,点击进行定位", nil) Radius:0];
UILabel *addLabel = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentLeft font:FontADA_(12) textColor:KKTextBlackColor text:GJText(@"当前位置未知,点击进行定位") Radius:0];
self.addLabel = addLabel;
[self addSubview:addLabel];
[addLabel mas_makeConstraints:^(MASConstraintMaker *make) {

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

@ -254,7 +254,7 @@ @@ -254,7 +254,7 @@
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
[[[APIManager sharedManager] APGET:F(@"%@%@/1", UpdateInfoStatus_URL,dMessage.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) {
NSDictionary *dic = error.userInfo;
[UICommon MessageErrorText:dic[NSLocalizedDescriptionKey]];
@ -281,6 +281,8 @@ @@ -281,6 +281,8 @@
[[[APIManager sharedManager] APPOST:ApprovalFollow_URL parameters:parameters isJson:YES resultClass:nil] subscribeNext:^(id _Nullable x) {
[UICommon HidenLoading];
[[NSNotificationCenter defaultCenter] postNotificationName:KK_UPDATE_ALL_NEWS_MESSAGE object:nil];
[UICommon MessageSuccessText:@"操作成功"];
[self GetQueryFollowInfo:TableisReload_h];
} error:^(NSError * _Nullable error) {
NSDictionary *dic = error.userInfo;

35
LekangGuard/My/VC/Message(消息)/MessageViewController.m

@ -61,6 +61,10 @@ @@ -61,6 +61,10 @@
[self zx_setPopGestureCompatibleScrollViews:@[self.PageView.titleScroll,self.PageView.contentCollection]];
[self.PageView selectIndex:self.selectedIndex];
[[[NSNotificationCenter defaultCenter] rac_addObserverForName:KK_UPDATE_ALL_NEWS_MESSAGE object:nil] subscribeNext:^(NSNotification *x) {
[self GetUnReadTotal];
}];
}
@ -127,6 +131,37 @@ @@ -127,6 +131,37 @@
// Dispose of any resources that can be recreated.
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[self GetUnReadTotal];
}
#pragma mark 查询未读消息数
/// 查询未读消息数
- (void)GetUnReadTotal
{
kWeakSelf(self)
[UICommon MessageUpload:@"加载中"];
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) {
NSInteger total = [obj[@"total"] integerValue];
NSInteger type = [obj[@"type"] integerValue];
[weakself.PageView setBadgeWithIndex:type-1 badge:total];
}];
}
} error:^(NSError * _Nullable error) {
NSDictionary *dic = error.userInfo;
[UICommon MessageErrorText:dic[NSLocalizedDescriptionKey]];
}];
}
/*
#pragma mark - Navigation

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

@ -270,6 +270,7 @@ @@ -270,6 +270,7 @@
[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]];

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

@ -269,6 +269,7 @@ @@ -269,6 +269,7 @@
[[[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;

3
LekangGuard/My/VC/Message(消息)/View/MessageTableViewCell.m

@ -20,6 +20,9 @@ @@ -20,6 +20,9 @@
}
- (void)awakeFromNib {
[super awakeFromNib];
[self.agreeBtn setTitle:GJText(@"同意") forState:0];
[self.reFusalBtn setTitle:GJText(@"拒绝") forState:0];
self.aTitleLabel.textColor = KKMainColor;
self.selectionStyle = 0;
self.agreeBtn.layer.cornerRadius = 3;

8
LekangGuard/My/VC/Message(消息)/View/MessageTableViewCell.xib

@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
@ -56,7 +56,7 @@ @@ -56,7 +56,7 @@
<constraint firstAttribute="height" constant="25" id="Fld-TV-B9p"/>
<constraint firstAttribute="width" constant="55" id="hBT-ej-V99"/>
</constraints>
<state key="normal" title="拒绝">
<state key="normal">
<color key="titleColor" red="0.96078431369999995" green="0.96078431369999995" blue="0.96078431369999995" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
</state>
<connections>
@ -70,7 +70,7 @@ @@ -70,7 +70,7 @@
<constraint firstAttribute="height" constant="25" id="lIP-ip-Xhg"/>
<constraint firstAttribute="width" constant="55" id="qzp-cN-NGg"/>
</constraints>
<state key="normal" title="同意">
<state key="normal">
<color key="titleColor" red="0.96078431369999995" green="0.96078431369999995" blue="0.96078431369999995" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
</state>
<connections>

33
LekangGuard/My/VC/ModifyDataViewController.m

@ -16,6 +16,11 @@ @@ -16,6 +16,11 @@
@property (nonatomic ,weak) UIImageView *iconImg;
@property (nonatomic ,strong) NSString *nameStr;
@property (nonatomic ,strong) NSString *phoneStr;
@property (nonatomic ,assign) BOOL isSelectIcon;
@end
@implementation ModifyDataViewController
@ -24,9 +29,12 @@ @@ -24,9 +29,12 @@
[super viewDidLoad];
// Do any additional setup after loading the view.
self.zx_navTitle = GJText(@"我的资料");
self.isSelectIcon = NO;
[self zx_setRightBtnWithText:GJText(@"保存") clickedBlock:^(ZXNavItemBtn * _Nonnull btn) {
[self UpdateInfo];
}];
self.nameStr = self.model.name;
self.phoneStr = self.model.phone;
self.titleArr = @[GJText(@"头像"),
GJText(@"昵称"),
GJText(@"手机号")];
@ -100,10 +108,10 @@ @@ -100,10 +108,10 @@
{
if (textField.tag == 1)
{
self.model.name = textField.text;
self.nameStr = textField.text;
}
else
self.model.phone = textField.text;
self.phoneStr = textField.text;
}
@ -111,22 +119,30 @@ @@ -111,22 +119,30 @@
/// 修改账号信息
- (void)UpdateInfo
{
if (self.model.name.length <= 0)
if (self.model.phone.length <= 0)
{
[UICommon MessageErrorText:@"请先绑定设备"];
return;
}
if (self.nameStr.length <= 0)
{
[UICommon MessageErrorText:@"昵称不能为空"];
return;
}
if (self.model.phone.length <= 0)
if (self.phoneStr.length <= 0)
{
[UICommon MessageErrorText:@"手机号不能为空"];
return;
}
[UICommon MessageUpload:@"加载中"];
self.iconFile = UIImageJPEGRepresentation(self.iconImg.image, 1.0f);
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.model.name forKey:@"name"];
[parameters setValue:self.model.phone forKey:@"phone"];
[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) {
NSLog(@"%@",x);
[UICommon HidenLoading];
@ -190,7 +206,8 @@ @@ -190,7 +206,8 @@
{
UIImage *curImg = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
[picker dismissViewControllerAnimated:YES completion:nil];
self.iconImg.image = curImg;
self.iconImg.image = [UICommon reduceImage:curImg percent:0.5];
self.isSelectIcon = YES;
}

55
LekangGuard/My/VC/MyViewController.m

@ -21,7 +21,9 @@ @@ -21,7 +21,9 @@
@property (nonatomic ,assign) UILabel *nameLabel;
@property (nonatomic ,assign) UILabel *phoneLabel;
@property (nonatomic ,assign) UIImageView *iconImg;
@property (nonatomic ,assign) UIButton *iconImg;
@property (nonatomic ,weak) UILabel *newsMeg;
@property (nonatomic ,strong) MyUserMsgModel *userModel;
@ -33,7 +35,7 @@ @@ -33,7 +35,7 @@
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.zx_navTitle = NSLocalizedString(@"我的", nil);
self.zx_navTitle = GJText(@"我的");
self.view.backgroundColor = KKBackgroundGrey;
[self.view addSubview:self.myScroll];
[self.myScroll mas_makeConstraints:^(MASConstraintMaker *make) {
@ -130,9 +132,24 @@ @@ -130,9 +132,24 @@
make.centerY.equalTo(btn);
make.size.mas_equalTo(rightImg.image.size);
}];
if (i == 1 && j == 0)
{
/// 未读消息展示红点
UILabel *newsMeg = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentCenter font:FontADA_(12) textColor:KKGrey121 text:@"" Radius:5];
newsMeg.backgroundColor = UIColor.redColor;
newsMeg.hidden = YES;
self.newsMeg = newsMeg;
[bgView addSubview:newsMeg];
[newsMeg mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(rightImg.mas_left).inset(15);
make.centerY.equalTo(btn);
make.width.height.mas_equalTo(10);
}];
}
if (i == 1 && j == 1)
{
///缓存显示
UILabel *cacheLabel = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentCenter font:FontADA_(12) textColor:KKGrey121 text:[DPClearCacheTool getCacheSize] Radius:0];
self.cacheLabel = cacheLabel;
[bgView addSubview:cacheLabel];
@ -220,7 +237,11 @@ @@ -220,7 +237,11 @@
}];
/// 头像
UIImageView *iconImg = [UIImageView new];
UIButton *iconImg = [UICommon ui_buttonSimple:CGRectZero font:0 normalColor:KKWhiteColorColor normalText:@"" click:^(id x) {
ModifyDataViewController *vc = [ModifyDataViewController new];
vc.model = self.userModel;
[self.navigationController pushViewController:vc animated:YES];
}];
iconImg.layer.cornerRadius = Adapted(33);
iconImg.layer.masksToBounds = YES;
iconImg.backgroundColor = KKWhiteColorColor;
@ -254,6 +275,7 @@ @@ -254,6 +275,7 @@
{
[super viewWillAppear:animated];
[self QueryMsg];
[self GetUnReadTotal];
}
#pragma mark 查看个人资料
@ -268,7 +290,7 @@ @@ -268,7 +290,7 @@
if (model != nil)
{
self.userModel = model;
[self.iconImg sd_setImageWithURL:[NSURL URLWithString:model.image] placeholderImage:ImageName_(@"icon_adults_occupies_the_head")];
[self.iconImg sd_setImageWithURL:[NSURL URLWithString:model.image] forState:0 placeholderImage:ImageName_(@"icon_adults_occupies_the_head")];
self.nameLabel.text = model.name;
self.phoneLabel.text = F(@"%@:%@",GJText(@"号码"), model.phone.length > 0 ? model.phone : @"--");
}
@ -314,6 +336,31 @@ @@ -314,6 +336,31 @@
}
#pragma mark 查询未读消息数
/// 查询未读消息数
- (void)GetUnReadTotal
{
kWeakSelf(self)
[UICommon MessageUpload:@"加载中"];
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) {
NSInteger total = [obj[@"total"] integerValue];
weakself.newsMeg.hidden = total > 0 ? NO : YES;
}];
}
} error:^(NSError * _Nullable error) {
NSDictionary *dic = error.userInfo;
[UICommon MessageErrorText:dic[NSLocalizedDescriptionKey]];
}];
}
- (UIScrollView *)myScroll
{
if (!_myScroll)

31
LekangGuard/en.lproj/Localizable.strings

@ -87,6 +87,8 @@ @@ -87,6 +87,8 @@
"请输入密码" = "Please enter PassWord";
"请输入6~16个字符" = "The value contains 6 to 16 characters";
"输入密码不一致" = "Enter PassWord Not the same";
"密码重置成功,请登录账号" = "The password is reset successfully, Please log in to the account";
@ -99,7 +101,7 @@ @@ -99,7 +101,7 @@
"记住密码" = "Remember the password";
"获取验证码" = "AcquireCode";
"获取验证码" = "GetCode";
"登录中" = "In the login";
@ -547,7 +549,8 @@ @@ -547,7 +549,8 @@
"从相册选择" = "Select from album";
" 邮箱登录" = "Email Login";
" 邮箱登录" = " Email Login";
"邮箱登录" = "Email Login";
"重置密码" = "Reset Password";
@ -782,3 +785,27 @@ @@ -782,3 +785,27 @@
"扫一扫二维码,关注我" = "Scan the QR code and follow me";
"二维码" = "QR code";
"请选择体重" = "Please select your weight";
"请选择身高" = "Please select the height";
"提交" = "submit";
"热门问题" = "Hot issue";
"语音最长15秒" = "The longest voice is 15 seconds";
"录音时间太短" = "The recording time is too short";
"请先绑定设备" = "Bind the device first";
"确认要删除%ld个联系人?" = "Are you sure you want to delete %ld contacts?";
"用户(%@)" = "user(%@)";
"操作成功" = "Successful operation";
"设置设备的定位模式:频次间隔越久,设备续航时间越长。" = "Set the positioning mode of the device: The longer the frequency interval, the longer the battery life of the device.";
":%ld分钟/次" = ": %ld minute/once";

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

@ -85,6 +85,8 @@ @@ -85,6 +85,8 @@
"请输入密码" = "请输入密码";
"请输入6~16个字符" = "请输入6~16个字符";
"输入密码不一致" = "输入密码不一致";
"密码重置成功,请登录账号" = "密码重置成功,请登录账号";
@ -546,6 +548,8 @@ @@ -546,6 +548,8 @@
" 邮箱登录" = " 邮箱登录";
"邮箱登录" = "邮箱登录";
"重置密码" = "重置密码";
"您还未绑定设备,请先绑定设备!" = "您还未绑定设备,请先绑定设备!";
@ -778,6 +782,32 @@ @@ -778,6 +782,32 @@
"二维码" = "二维码";
"请选择体重" = "请选择体重";
"请选择身高" = "请选择身高";
"提交" = "提交";
"热门问题" = "热门问题";
"语音最长15秒" = "语音最长15秒";
"录音时间太短" = "录音时间太短";
"请先绑定设备" = "请先绑定设备";
"确认要删除%ld个联系人?" = "确认要删除%ld个联系人?";
"用户(%@)" = "用户(%@)";
"操作成功" = "操作成功";
"设置设备的定位模式:频次间隔越久,设备续航时间越长。" = "设置设备的定位模式:频次间隔越久,设备续航时间越长。";
":%ld分钟/次" = ":%ld分钟/次";
"" = "";
"" = "";
"" = "";

Loading…
Cancel
Save