新疆修改

This commit is contained in:
History
2026-01-22 09:35:14 +08:00
parent 4aba54ce74
commit 57643da94d
26 changed files with 1057 additions and 383 deletions
@@ -375,7 +375,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2; CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = A7CC5LW224; DEVELOPMENT_TEAM = A7CC5LW224;
ENABLE_USER_SCRIPT_SANDBOXING = NO; ENABLE_USER_SCRIPT_SANDBOXING = NO;
GCC_PREFIX_HEADER = "$(SRCROOT)/XinjiangProject/Supporting Files/PrefixHeader.pch"; GCC_PREFIX_HEADER = "$(SRCROOT)/XinjiangProject/Supporting Files/PrefixHeader.pch";
@@ -395,12 +395,12 @@
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
INFOPLIST_KEY_UIUserInterfaceStyle = Light; INFOPLIST_KEY_UIUserInterfaceStyle = Light;
IPHONEOS_DEPLOYMENT_TARGET = 15.0; IPHONEOS_DEPLOYMENT_TARGET = 15;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.0.6; MARKETING_VERSION = 1.0.8;
PRODUCT_BUNDLE_IDENTIFIER = com.questionTools.XinjiangProject; PRODUCT_BUNDLE_IDENTIFIER = com.questionTools.XinjiangProject;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
@@ -419,7 +419,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2; CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = A7CC5LW224; DEVELOPMENT_TEAM = A7CC5LW224;
ENABLE_USER_SCRIPT_SANDBOXING = NO; ENABLE_USER_SCRIPT_SANDBOXING = NO;
GCC_PREFIX_HEADER = "$(SRCROOT)/XinjiangProject/Supporting Files/PrefixHeader.pch"; GCC_PREFIX_HEADER = "$(SRCROOT)/XinjiangProject/Supporting Files/PrefixHeader.pch";
@@ -439,12 +439,12 @@
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
INFOPLIST_KEY_UIUserInterfaceStyle = Light; INFOPLIST_KEY_UIUserInterfaceStyle = Light;
IPHONEOS_DEPLOYMENT_TARGET = 15.0; IPHONEOS_DEPLOYMENT_TARGET = 15;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.0.6; MARKETING_VERSION = 1.0.8;
PRODUCT_BUNDLE_IDENTIFIER = com.questionTools.XinjiangProject; PRODUCT_BUNDLE_IDENTIFIER = com.questionTools.XinjiangProject;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
@@ -509,7 +509,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 18.4; IPHONEOS_DEPLOYMENT_TARGET = 15.6;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES; LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES; MTL_FAST_MATH = YES;
@@ -565,7 +565,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 18.4; IPHONEOS_DEPLOYMENT_TARGET = 15.6;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES; LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES; MTL_FAST_MATH = YES;
@@ -78,20 +78,38 @@
//#define IntervenH5 @"https://starry.out.icdat.cn" //#define IntervenH5 @"https://starry.out.icdat.cn"
//开发环境地址 彭杰 http://192.168.1.37 //开发环境地址 彭杰 http://192.168.1.37
//#define Http @"http://192.168.1.37"// //#define Http @"http://192.168.1.37"//
//#define H5DevHost @"xjgateway.mcrm.vip:8888"// //#define H5DevHost @"xjgateway.mcrm.vip:8888"//
//#define IntervenH5 @"https://xjconsole.mcrm.vip:8888" //#define IntervenH5 @"https://xjconsole.mcrm.vip:8888"
//#define BASEURL @"https://yyjk.cqygjk.com" //北边接口前缀 //#define BASEURL @"https://yyjk.cqygjk.com" //北边接口前缀
//#define SCHEME @"https" // //#define SCHEME @"https" //
//#define Http @"http://192.168.1.23"//昊 //#define Http @"http://192.168.1.23"//昊
//正式地址 //正式地址
#define Http @"https://api-jkglpt.iosp.ydpt.tech"// //#define Http @"https://api-jkglpt.iosp.ydpt.tech"//
#define H5DevHost @"api-jkglpt.iosp.ydpt.tech"// //#define H5DevHost @"api-jkglpt.iosp.ydpt.tech"//
#define IntervenH5 @"https://console-jkglpt.iosp.ydpt.tech" //#define IntervenH5 @"https://console-jkglpt.iosp.ydpt.tech"
//#define SCHEME @"https" //
//卫鑫本地
//#define Http @"https://api-jkglpt.iosp.ydpt.tech"//
//#define H5DevHost @"api-jkglpt.iosp.ydpt.tech"//
//#define IntervenH5 @"http://192.168.1.26:9876"
//#define SCHEME @"https" //
//测试
#define Http @"https://api-xj.tri.icdat.cn"//
#define H5DevHost @"api-xj.tri.icdat.cn"//
#define IntervenH5 @"https://console-xj.tri.icdat.cn"
#define SCHEME @"https" // #define SCHEME @"https" //
//新疆项目后期的调试环境由阿里云迁移至公司内部主机服务器,功能联调和测试可用以下的环境地址
//https://api-xj.tri.icdat.cn
//https://console-xj.tri.icdat.cn/
//接口: http://api-xj.tri.dt.io/
//后台: http://console-xj.tri.dt.io/
//大屏: http://screen-xj.tri.dt.io/home
#endif /* StatusMacros_h */ #endif /* StatusMacros_h */
@@ -53,4 +53,6 @@ typedef void (^FileDownloadFail)(int code, NSString * desc);
#pragma mark - 下载文件方法 #pragma mark - 下载文件方法
- (void)downLoadFileWithUrl:(NSString *)urlStr Path:(NSString*)path downloadProgress:(void (^)(NSProgress *downloadProgress))progress SuccessBlock:(FileDownloadSucc)success FileDownloadFail:(FileDownloadFail)failure; - (void)downLoadFileWithUrl:(NSString *)urlStr Path:(NSString*)path downloadProgress:(void (^)(NSProgress *downloadProgress))progress SuccessBlock:(FileDownloadSucc)success FileDownloadFail:(FileDownloadFail)failure;
#pragma mark - 表单带参数
- (void)httpPostFormDataRequest:(NSString *)api params:(NSMutableDictionary *)params;
@end @end
@@ -20,6 +20,8 @@ typedef NS_ENUM(NSInteger, RequestType) {
RequestTypeMultiUpload,//多个上传 RequestTypeMultiUpload,//多个上传
RequestTypeDownload, RequestTypeDownload,
RequestTypeUpLoadVideo,//上传视频 RequestTypeUpLoadVideo,//上传视频
RequestTypeParmFormData//参数表单
}; };
@implementation JKCQNetworkingWithCache @implementation JKCQNetworkingWithCache
@@ -115,6 +117,13 @@ typedef NS_ENUM(NSInteger, RequestType) {
//5.开始启动下载任务 //5.开始启动下载任务
[task resume]; [task resume];
} }
#pragma mark:表单上传参数
- (void)httpPostFormDataRequest:(NSString *)api params:(NSMutableDictionary *)params {
[self httpRequestWithUrlStr:api params:params requestType:RequestTypeParmFormData isCache:YES cacheKey:api imageKey:nil withData:nil withDataArray:nil];
}
#pragma mark - 网络请求统一处理 #pragma mark - 网络请求统一处理
/** /**
@@ -326,6 +335,35 @@ typedef NS_ENUM(NSInteger, RequestType) {
}]; }];
}else if(requestType == RequestTypeParmFormData) {//参数表单上传
[session.requestSerializer setValue:@"application/x-www-form-urlencoded;charset=utf-8" forHTTPHeaderField:@"Content-Type"];
[session POST:url parameters:nil headers:@{@"X-Access-Token":self.needToken} constructingBodyWithBlock:^(id<AFMultipartFormData> _Nonnull formData) {
// 这里我们通过将每一个键值对转换成 multipart 数据块来实现
[formData appendPartWithFormData:[params[@"userId"] dataUsingEncoding:NSUTF8StringEncoding] name:@"userId"];
} progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
// 请求成功处理
[weakSelf dealWithResponseObject:responseObject cacheUrl:url];
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
// 请求失败处理
NSString * statusCode = [error.userInfo objectForKey:@"NSLocalizedDescription"];
if ([statusCode containsString:@"(401)"]) {
DLog(@"%@",error.userInfo);
[EasyTextView showErrorText:@"身份验证过期"];
[HQCommonUtils keyedArchiverWithData:nil key:LoginUserInfo];
KPostNotification(KNotificationLoginStateChange, @NO);
}
else {
[MBProgressHUD hideHUDForView:[HQCommonUtils getCurrentVC].view animated:YES];
[EasyTextView showErrorText:@"请求超时"];
}
}];
} }
} }
@@ -375,7 +413,7 @@ typedef NS_ENUM(NSInteger, RequestType) {
} }
if ([response.allKeys containsObject:@"code"]) { if ([response.allKeys containsObject:@"code"]) {
if ([[response objectForKey:@"code"] integerValue] == 200) if ([[response objectForKey:@"code"] integerValue] == 200 ||( [[response objectForKey:@"code"] integerValue] == 0 && [url containsString:@"listAll"]))
{ {
flag = true; flag = true;
}else }else
@@ -73,6 +73,7 @@
- (void)getOneKeyQuestionByID:(NSMutableDictionary *)parmDic; - (void)getOneKeyQuestionByID:(NSMutableDictionary *)parmDic;
- (void)postSearchOneKeyQuestionData:(NSMutableDictionary *)parmDic; - (void)postSearchOneKeyQuestionData:(NSMutableDictionary *)parmDic;
- (void)getHistoryReportById:(NSMutableDictionary *)parmDic; - (void)getHistoryReportById:(NSMutableDictionary *)parmDic;
- (void)recordDoctorCardInfoClick:(NSMutableDictionary *)parmDic;
#pragma mark:咨询人管理 #pragma mark:咨询人管理
@@ -125,6 +126,8 @@
- (void)getInterMonitoringMaxMinData:(NSMutableDictionary *)parmDic; - (void)getInterMonitoringMaxMinData:(NSMutableDictionary *)parmDic;
- (void)getWarningWatchListV2Data:(NSMutableDictionary *)parmDic;
- (void)getWranHistoryList:(NSMutableDictionary *)parmDic; - (void)getWranHistoryList:(NSMutableDictionary *)parmDic;
- (void)getSOSDoctorRecordList:(NSMutableDictionary *)parmDic; - (void)getSOSDoctorRecordList:(NSMutableDictionary *)parmDic;
@@ -134,4 +137,18 @@
- (void)getSOSSmallSumData:(NSMutableDictionary *)parmDic; - (void)getSOSSmallSumData:(NSMutableDictionary *)parmDic;
- (void)healthAccountLogin:(NSMutableDictionary *)parmDic; - (void)healthAccountLogin:(NSMutableDictionary *)parmDic;
//版本更新
- (void)GetAppVesionUpdata:(NSMutableDictionary *)parmDic;
#pragma mark:模拟数据
//获取模拟用户信息(判断是否为模拟)
- (void)postSimulationUser:(NSMutableDictionary *)parmDic;
//获取系统用户数据(查询全部用户,不做租户隔离)
- (void)getSimulationUserList:(NSMutableDictionary *)parmDic;
//开启模拟
- (void)postStartedSimulationUser:(NSMutableDictionary *)parmDic;
//恢复用户状态
- (void)postRecoverySimulationUser:(NSMutableDictionary *)parmDic;
@end @end
@@ -100,6 +100,13 @@
} }
//记录医生信息
- (void)recordDoctorCardInfoClick:(NSMutableDictionary *)parmDic {
[httpRequest httpPostRequest:[NSString stringWithFormat:@"%@/health-consultation/con-message/saveReadLog",Http] params:parmDic];
}
- (void)GetAllHistoryChatRecord:(NSMutableDictionary *)parmDic { - (void)GetAllHistoryChatRecord:(NSMutableDictionary *)parmDic {
//http://192.168.1.28/health-consultation/?groupId=1801087415104962560&pageNo=1&pageSize=10 //http://192.168.1.28/health-consultation/?groupId=1801087415104962560&pageNo=1&pageSize=10
[httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-consultation/api/consult/conSession/selectImMessagePageListSession",Http] params:parmDic]; [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-consultation/api/consult/conSession/selectImMessagePageListSession",Http] params:parmDic];
@@ -741,6 +748,13 @@
[httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-watch/watchH5Api/indexDataNew",Http] params:parmDic]; [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-watch/watchH5Api/indexDataNew",Http] params:parmDic];
} }
//更新接口
- (void)getWarningWatchListV2Data:(NSMutableDictionary *)parmDic {
[httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-watch/watchH5Api/indexDataNew/v2",Http] params:parmDic];
}
- (void)getInterMonitoringMaxMinData:(NSMutableDictionary *)parmDic { - (void)getInterMonitoringMaxMinData:(NSMutableDictionary *)parmDic {
@@ -778,5 +792,40 @@
[httpRequest httpPostRequest:[NSString stringWithFormat:@"%@/sys/mLoginAnYan",Http] params:parmDic]; [httpRequest httpPostRequest:[NSString stringWithFormat:@"%@/sys/mLoginAnYan",Http] params:parmDic];
}
//版本更新
- (void)GetAppVesionUpdata:(NSMutableDictionary *)parmDic {
[httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-system/version/getSysVersionDetailByPackageName",Http] params:parmDic];
}
#pragma mark:模拟用户
- (void)postSimulationUser:(NSMutableDictionary *)parmDic {
[httpRequest httpPostRequest:[NSString stringWithFormat:@"%@/health-system/test/fakeUser",Http] params:parmDic];
}
//获取系统用户数据(查询全部用户,不做租户隔离)
- (void)getSimulationUserList:(NSMutableDictionary *)parmDic {
[httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-system/sys/user/listAll",Http] params:parmDic];
}
//开启模拟
- (void)postStartedSimulationUser:(NSMutableDictionary *)parmDic{
[httpRequest httpPostFormDataRequest:[NSString stringWithFormat:@"%@/health-system/test/fake",Http] params:parmDic];
}
//恢复用户状态
- (void)postRecoverySimulationUser:(NSMutableDictionary *)parmDic{
[httpRequest httpPostRequest:[NSString stringWithFormat:@"%@/health-system/test/restore",Http] params:parmDic];
} }
@end @end
@@ -65,7 +65,7 @@
- (void)addSubviews{ - (void)addSubviews{
WKWebViewConfiguration *configuration = [[WKWebViewConfiguration alloc] init]; WKWebViewConfiguration *configuration = [[WKWebViewConfiguration alloc] init];
WKPreferences *preferences = [[WKPreferences alloc]init]; WKPreferences *preferences = [[WKPreferences alloc]init];
preferences.javaScriptEnabled = YES; // preferences.javaScriptEnabled = YES;
preferences.javaScriptCanOpenWindowsAutomatically = YES; preferences.javaScriptCanOpenWindowsAutomatically = YES;
preferences.minimumFontSize = 10; preferences.minimumFontSize = 10;
configuration.preferences = preferences; configuration.preferences = preferences;
@@ -17,6 +17,9 @@
#import "MQTextField.h" #import "MQTextField.h"
#import "XJTYFoundPassWordViewController.h" #import "XJTYFoundPassWordViewController.h"
#import "SimulationViewController.h"
@interface XJLoginTopChangeViewController ()<V2TIMSDKListener,V2TIMSDKListener,LVKeyboardDelegate,UITextFieldDelegate> @interface XJLoginTopChangeViewController ()<V2TIMSDKListener,V2TIMSDKListener,LVKeyboardDelegate,UITextFieldDelegate>
@property (nonatomic, strong) UITextField * userNameField; @property (nonatomic, strong) UITextField * userNameField;
@@ -49,6 +52,16 @@
@property (nonatomic, strong) UIButton * foundPasswordBtn; @property (nonatomic, strong) UIButton * foundPasswordBtn;
@property (nonatomic, assign) NSInteger tapCount;
@property (nonatomic, strong) NSDate *firstTapDate;
@property (nonatomic, strong) UILabel * topLoginTitleLab;
@property (nonatomic, strong) UIButton * bottomChangeBtn;
@property (nonatomic, assign) NSTimeInterval lastClickTime;
@end @end
@implementation XJLoginTopChangeViewController @implementation XJLoginTopChangeViewController
@@ -95,6 +108,7 @@
UILabel *headLab = [[UILabel alloc] initWithFrame:CGRectMake(24, topBackImg.bottom - kRealValue(46) - 58, 300, 58)]; UILabel *headLab = [[UILabel alloc] initWithFrame:CGRectMake(24, topBackImg.bottom - kRealValue(46) - 58, 300, 58)];
headLab.numberOfLines = 0; headLab.numberOfLines = 0;
headLab.textColor = KWhiteColor; headLab.textColor = KWhiteColor;
headLab.userInteractionEnabled = true;
headLab.textAlignment = NSTextAlignmentLeft; headLab.textAlignment = NSTextAlignmentLeft;
NSString *text = @"你好呀,\n欢迎使用 健康油我"; NSString *text = @"你好呀,\n欢迎使用 健康油我";
@@ -118,7 +132,11 @@
[homeBtn addTarget:self action:@selector(backHomeAction) forControlEvents:UIControlEventTouchUpInside]; [homeBtn addTarget:self action:@selector(backHomeAction) forControlEvents:UIControlEventTouchUpInside];
[topBackImg addSubview:homeBtn]; [topBackImg addSubview:homeBtn];
// 添加点击手势识别器
UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleImageTap:)];
[headLab addGestureRecognizer:tapGestureRecognizer];
// 初始化计数器
// //
UIView *loginView = [[UIView alloc]init]; UIView *loginView = [[UIView alloc]init];
loginView.frame = CGRectMake(0, topBackImg.bottom - kRealValue(20), kScreenWidth, kScreenHeight - topBackImg.bottom - kRealValue(20)); loginView.frame = CGRectMake(0, topBackImg.bottom - kRealValue(20), kScreenWidth, kScreenHeight - topBackImg.bottom - kRealValue(20));
@@ -130,40 +148,51 @@
loginView.layer.mask = maskLayer; loginView.layer.mask = maskLayer;
self.loginView = loginView; self.loginView = loginView;
// 新增切换逻辑 // 新增切换逻辑
CGFloat btnWidth = (kScreenWidth - kRealValue(37) * 2) / 2 ; // CGFloat btnWidth = (kScreenWidth - kRealValue(37) * 2) / 2 ;
//
// self.leftLoginBtn = [[UIButton alloc] initWithFrame:CGRectMake(kRealValue(37), kRealValue(40), btnWidth, 48)];
// [self.leftLoginBtn setTitle:@"平台统一认证" forState:UIControlStateNormal];
// [self.leftLoginBtn setTitleColor:KWhiteColor forState:UIControlStateSelected];
// [self.leftLoginBtn setTitleColor:UIColorHex(#2EB8B2) forState:UIControlStateNormal];
// self.leftLoginBtn.selected = true;
// self.leftLoginBtn.titleLabel.font = MEDIUMFONT(16);
// [self.leftLoginBtn setBackgroundImage:[UIImage imageNamed:@"leftLoginNomal"] forState:UIControlStateNormal];
// [self.leftLoginBtn setBackgroundImage:[UIImage imageNamed:@"loginSelectedImg"] forState:UIControlStateSelected];
// [self.leftLoginBtn addTarget:self action:@selector(accountLoginTypeClick) forControlEvents:UIControlEventTouchUpInside];
//
// [self.loginView addSubview:self.leftLoginBtn];
//
// self.rightLoginBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.leftLoginBtn.right, kRealValue(40), btnWidth, 48)];
// [self.rightLoginBtn setTitle:@"健康系统认证" forState:UIControlStateNormal];
// [self.rightLoginBtn setTitleColor:KWhiteColor forState:UIControlStateSelected];
// [self.rightLoginBtn setTitleColor:UIColorHex(#2EB8B2) forState:UIControlStateNormal];
// self.rightLoginBtn.selected = false;
// self.rightLoginBtn.titleLabel.font = MEDIUMFONT(16);
// [self.rightLoginBtn setBackgroundImage:[UIImage imageNamed:@"loginNomalImg"] forState:UIControlStateNormal];
// [self.rightLoginBtn setBackgroundImage:[UIImage imageNamed:@"rightLoginSelected"] forState:UIControlStateSelected];
// [self.rightLoginBtn addTarget:self action:@selector(healthLoginTypeClick) forControlEvents:UIControlEventTouchUpInside];
// [self.loginView addSubview:self.rightLoginBtn];
//
self.leftLoginBtn = [[UIButton alloc] initWithFrame:CGRectMake(kRealValue(37), kRealValue(40), btnWidth, 48)]; //1月21日新需求
[self.leftLoginBtn setTitle:@"平台统一认证" forState:UIControlStateNormal];
[self.leftLoginBtn setTitleColor:KWhiteColor forState:UIControlStateSelected]; self.topLoginTitleLab = [[UILabel alloc] initWithFrame:CGRectMake(0, kRealValue(40), kScreenWidth, 20)];;
[self.leftLoginBtn setTitleColor:UIColorHex(#2EB8B2) forState:UIControlStateNormal]; self.topLoginTitleLab.text = @"平台统一认证";
self.leftLoginBtn.selected = true; self.topLoginTitleLab.font = [UIFont systemFontOfSize:20 weight:UIFontWeightBold];
self.leftLoginBtn.titleLabel.font = MEDIUMFONT(16); self.topLoginTitleLab.textColor = UIColorHex(#2EB8B2);
[self.leftLoginBtn setBackgroundImage:[UIImage imageNamed:@"leftLoginNomal"] forState:UIControlStateNormal]; self.topLoginTitleLab.textAlignment = NSTextAlignmentCenter;
[self.leftLoginBtn setBackgroundImage:[UIImage imageNamed:@"loginSelectedImg"] forState:UIControlStateSelected]; [self.loginView addSubview:self.topLoginTitleLab];
[self.leftLoginBtn addTarget:self action:@selector(accountLoginTypeClick) forControlEvents:UIControlEventTouchUpInside];
[self.loginView addSubview:self.leftLoginBtn];
self.rightLoginBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.leftLoginBtn.right, kRealValue(40), btnWidth, 48)];
[self.rightLoginBtn setTitle:@"健康系统认证" forState:UIControlStateNormal];
[self.rightLoginBtn setTitleColor:KWhiteColor forState:UIControlStateSelected];
[self.rightLoginBtn setTitleColor:UIColorHex(#2EB8B2) forState:UIControlStateNormal];
self.rightLoginBtn.selected = false;
self.rightLoginBtn.titleLabel.font = MEDIUMFONT(16);
[self.rightLoginBtn setBackgroundImage:[UIImage imageNamed:@"loginNomalImg"] forState:UIControlStateNormal];
[self.rightLoginBtn setBackgroundImage:[UIImage imageNamed:@"rightLoginSelected"] forState:UIControlStateSelected];
[self.rightLoginBtn addTarget:self action:@selector(healthLoginTypeClick) forControlEvents:UIControlEventTouchUpInside];
[self.loginView addSubview:self.rightLoginBtn];
UITextField *accountField = [[UITextField alloc]init]; UITextField *accountField = [[UITextField alloc]init];
accountField.frame = CGRectMake(kRealValue(37),self.leftLoginBtn.bottom + kRealValue(24), loginView.width - kRealValue(74), 48); accountField.frame = CGRectMake(kRealValue(25),self.topLoginTitleLab.bottom + kRealValue(24), loginView.width - kRealValue(50), 48);
accountField.placeholder = @"请输入员工编号或用户名"; accountField.placeholder = @"请输入员工编号或用户名";
accountField.font = BOLDSYSTEMFONT(14); accountField.font = BOLDSYSTEMFONT(14);
accountField.textColor = CFontColor1; accountField.textColor = CFontColor1;
self.userNameField = accountField; self.userNameField = accountField;
self.userNameField.backgroundColor = UIColorHex(#EEEEEE); self.userNameField.backgroundColor = UIColorHex(#EEEEEE);
self.userNameField.layer.cornerRadius = 24; self.userNameField.layer.cornerRadius = 8;
self.userNameField.layer.masksToBounds = true; self.userNameField.layer.masksToBounds = true;
UIView * leftview = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 44, 48)]; UIView * leftview = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 44, 48)];
UIImageView * userLeftImg = [[UIImageView alloc] initWithFrame:CGRectMake(16, 14, 20, 20)]; UIImageView * userLeftImg = [[UIImageView alloc] initWithFrame:CGRectMake(16, 14, 20, 20)];
@@ -176,7 +205,7 @@
// //
// //
MQTextField * passwordField = [[MQTextField alloc]init]; MQTextField * passwordField = [[MQTextField alloc]init];
passwordField.frame = CGRectMake(kRealValue(35), accountField.bottom + kRealValue(19), accountField.width, accountField.height); passwordField.frame = CGRectMake(kRealValue(25), accountField.bottom + kRealValue(19), accountField.width, accountField.height);
passwordField.placeholder = @"请输入密码"; passwordField.placeholder = @"请输入密码";
passwordField.font = BOLDSYSTEMFONT(14); passwordField.font = BOLDSYSTEMFONT(14);
passwordField.textColor = CFontColor1; passwordField.textColor = CFontColor1;
@@ -190,7 +219,7 @@
[passLeftview addSubview:passLeftImg]; [passLeftview addSubview:passLeftImg];
self.passwordField.leftView = passLeftview; self.passwordField.leftView = passLeftview;
self.passwordField.leftViewMode = UITextFieldViewModeAlways; self.passwordField.leftViewMode = UITextFieldViewModeAlways;
self.passwordField.layer.cornerRadius = 24; self.passwordField.layer.cornerRadius = 8;
self.passwordField.layer.masksToBounds = true; self.passwordField.layer.masksToBounds = true;
self.passwordField.delegate = self; self.passwordField.delegate = self;
self.passwordField.inputView = self.keyboard; self.passwordField.inputView = self.keyboard;
@@ -213,27 +242,25 @@
UIButton *loginBtn = [UIButton buttonWithType:UIButtonTypeCustom]; UIButton *loginBtn = [UIButton buttonWithType:UIButtonTypeCustom];
loginBtn.frame = CGRectMake(kRealValue(37), self.passwordField.bottom + kRealValue(20), WIDTH - kRealValue(74), 48); loginBtn.frame = CGRectMake(kRealValue(25), self.passwordField.bottom + kRealValue(20), WIDTH - kRealValue(50), 48);
[loginBtn setTitle:@"登录" forState:UIControlStateNormal]; [loginBtn setTitle:@"登录" forState:UIControlStateNormal];
[loginBtn.titleLabel setFont:BOLDSYSTEMFONT(16)]; [loginBtn.titleLabel setFont:BOLDSYSTEMFONT(16)];
loginBtn.backgroundColor = UIColorHex(#2EB8B2); loginBtn.backgroundColor = UIColorHex(#2EB8B2);
loginBtn.layer.cornerRadius = 24; loginBtn.layer.cornerRadius = 8;
loginBtn.layer.masksToBounds = true; loginBtn.layer.masksToBounds = true;
[loginBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [loginBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[loginBtn addTarget:self action:@selector(toClickFootBtn:) forControlEvents:UIControlEventTouchUpInside]; [loginBtn addTarget:self action:@selector(toClickFootBtn:) forControlEvents:UIControlEventTouchUpInside];
[loginView addSubview:loginBtn]; [loginView addSubview:loginBtn];
UIButton * foundPasswordBtn = [UIButton buttonWithType:UIButtonTypeCustom]; UIButton * foundPasswordBtn = [UIButton buttonWithType:UIButtonTypeCustom];
foundPasswordBtn.frame = CGRectMake(kRealValue(35), loginBtn.bottom + kRealValue(23), WIDTH - kRealValue(70), 20); foundPasswordBtn.frame = CGRectMake(loginBtn.right - 52, loginBtn.bottom + kRealValue(22), 52, 12);
[foundPasswordBtn setTitle:@"统一认证找回密码" forState:UIControlStateNormal]; [foundPasswordBtn setTitle:@"找回密码" forState:UIControlStateNormal];
foundPasswordBtn.titleLabel.font = MEDIUMFONT(14); foundPasswordBtn.titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightRegular];
[foundPasswordBtn setTitleColor:UIColorHex(#B6B6B6) forState:UIControlStateNormal]; [foundPasswordBtn setTitleColor:UIColorHex(#B6B6B6) forState:UIControlStateNormal];
[foundPasswordBtn addTarget:self action:@selector(foundUserPasswordAction) forControlEvents:UIControlEventTouchUpInside]; [foundPasswordBtn addTarget:self action:@selector(foundUserPasswordAction) forControlEvents:UIControlEventTouchUpInside];
self.foundPasswordBtn = foundPasswordBtn; self.foundPasswordBtn = foundPasswordBtn;
[loginView addSubview:foundPasswordBtn]; [loginView addSubview:foundPasswordBtn];
[[NSUserDefaults standardUserDefaults] setObject:@"1" forKey:@"LOGINAgree"]; [[NSUserDefaults standardUserDefaults] setObject:@"1" forKey:@"LOGINAgree"];
[[NSUserDefaults standardUserDefaults] synchronize]; [[NSUserDefaults standardUserDefaults] synchronize];
@@ -245,6 +272,25 @@
//隐私 //隐私
self.agreenBtn = [[UIButton alloc] init];
[self.agreenBtn addTarget:self action:@selector(agreeProtocolAction:) forControlEvents:UIControlEventTouchUpInside];
[self.agreenBtn setImage:IMAGE_NAMED(@"login_nomalProtocol") forState:UIControlStateNormal];
[self.agreenBtn setImage:IMAGE_NAMED(@"login_selectProtocol") forState:UIControlStateSelected];
if ([agree intValue] == 1) {
self.agreenBtn.selected = true;
}else
{
self.agreenBtn.selected = false;
}
[self.view addSubview:self.agreenBtn];
[self.agreenBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_offset(25);
make.top.mas_equalTo(loginBtn.mas_bottom).offset(18);
make.width.height.mas_offset(kRealValue(20));
}];
NSString *string = @"我已阅读并同意用户协议和隐私政策"; NSString *string = @"我已阅读并同意用户协议和隐私政策";
YYLabel * yslabel = [[YYLabel alloc] init]; YYLabel * yslabel = [[YYLabel alloc] init];
yslabel.textColor = UIColorHex(#B6B6B6); yslabel.textColor = UIColorHex(#B6B6B6);
@@ -252,9 +298,10 @@
[self.view addSubview:yslabel]; [self.view addSubview:yslabel];
[yslabel mas_makeConstraints:^(MASConstraintMaker *make) { [yslabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_offset(-29 - SafetyAreaHeight); make.left.mas_equalTo(self.agreenBtn.mas_right).offset(5);
make.centerX.mas_equalTo(self.view); make.top.mas_equalTo(loginBtn.mas_bottom).offset(22);
}]; }];
yslabel.numberOfLines = 0; yslabel.numberOfLines = 0;
NSMutableAttributedString *attributed = [[NSMutableAttributedString alloc] initWithString:string]; NSMutableAttributedString *attributed = [[NSMutableAttributedString alloc] initWithString:string];
// 1️⃣ 给整段文字设置默认样式(灰色) // 1️⃣ 给整段文字设置默认样式(灰色)
@@ -324,23 +371,28 @@
} }
}; };
self.agreenBtn = [[UIButton alloc] init]; //底部切换
[self.agreenBtn addTarget:self action:@selector(agreeProtocolAction:) forControlEvents:UIControlEventTouchUpInside]; self.bottomChangeBtn = [[UIButton alloc] init];
[self.agreenBtn setImage:IMAGE_NAMED(@"login_nomalProtocol") forState:UIControlStateNormal]; [self.bottomChangeBtn setTitle:@"非掌油用户登录入口" forState:UIControlStateNormal];
[self.agreenBtn setImage:IMAGE_NAMED(@"login_selectProtocol") forState:UIControlStateSelected];
if ([agree intValue] == 1) {
self.agreenBtn.selected = true;
}else
{
self.agreenBtn.selected = false;
}
[self.view addSubview:self.agreenBtn];
[self.agreenBtn mas_makeConstraints:^(MASConstraintMaker *make) { [self.bottomChangeBtn setTitle:@"掌油用户登录入口" forState:UIControlStateSelected];
make.right.mas_equalTo(yslabel.mas_left).offset(-5);
make.width.height.mas_offset(kRealValue(20)); [self.bottomChangeBtn setTitleColor:UIColorHex(#2EB8B2) forState:UIControlStateNormal];
make.centerY.mas_equalTo(yslabel); self.bottomChangeBtn.titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightRegular];
self.bottomChangeBtn.selected = false;
[self.bottomChangeBtn addTarget:self action:@selector(healthLoginTypeClick:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:self.bottomChangeBtn];
[self.bottomChangeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_offset(-40);
make.centerX.mas_equalTo(self.view);
make.width.mas_offset(130);
}]; }];
// 昨天改的今天不要了 那就隐藏吧
self.bottomChangeBtn.hidden = true;
} }
@@ -371,6 +423,15 @@
return;; return;;
} }
NSTimeInterval now = [[NSDate date] timeIntervalSince1970];
if (self.lastClickTime > 0 && now - self.lastClickTime < 5) {
[EasyTextView showErrorText:@"操作过于频繁,请稍候再试!"];
return; // 👈 只提示,不再继续
}
self.lastClickTime = now;
NSString * publish_key = @" MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCmZfR/bA9X3vp86y1aEpvwzXJYKRRF1fLau2+05/ZtaITLpV8bhkmSf3neSy/Q9gAdvG75Fr73E+GWE+K5b0BpvIS1jDGo319+PpZR39SaZTKZ27XFXrosmJTZutN79t819HS1VseleunHAFgMVufE9U5jP6LGzl/wbkSy01GhzwIDAQAB"; NSString * publish_key = @" MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCmZfR/bA9X3vp86y1aEpvwzXJYKRRF1fLau2+05/ZtaITLpV8bhkmSf3neSy/Q9gAdvG75Fr73E+GWE+K5b0BpvIS1jDGo319+PpZR39SaZTKZ27XFXrosmJTZutN79t819HS1VseleunHAFgMVufE9U5jP6LGzl/wbkSy01GhzwIDAQAB";
// 原始数据,要加密的字符串 // 原始数据,要加密的字符串
@@ -404,29 +465,29 @@
} }
else //健康系统登录 else //健康系统登录
{ {
if (self.passwordField.text.length < 12 || self.passwordField.text.length > 32) { // if (self.passwordField.text.length < 12 || self.passwordField.text.length > 32) {
//
//
//
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"温馨提示" message:@"密码不安全,请先修改密码" preferredStyle:UIAlertControllerStyleAlert]; // UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"温馨提示" message:@"密码不安全,请先修改密码" preferredStyle:UIAlertControllerStyleAlert];
//
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) { // UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
//
}]; // }];
UIAlertAction *sureAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { // UIAlertAction *sureAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
//
XJLoginFoundPasswordViewController * modifVC = [[XJLoginFoundPasswordViewController alloc] init]; // XJLoginFoundPasswordViewController * modifVC = [[XJLoginFoundPasswordViewController alloc] init];
[self.navigationController pushViewController:modifVC animated:YES]; // [self.navigationController pushViewController:modifVC animated:YES];
//
}]; // }];
[alertController addAction:cancelAction]; // [alertController addAction:cancelAction];
[alertController addAction:sureAction]; // [alertController addAction:sureAction];
//
[self presentViewController:alertController animated:YES completion:nil]; // [self presentViewController:alertController animated:YES completion:nil];
//
//
return; // return;
} // }
XJPNetAPI * proctocolApi = [[XJPNetAPI alloc] init:self tag:@"LOGINGAPI" NeedToken:nil]; XJPNetAPI * proctocolApi = [[XJPNetAPI alloc] init:self tag:@"LOGINGAPI" NeedToken:nil];
[proctocolApi PostLogin:parmDic]; [proctocolApi PostLogin:parmDic];
@@ -557,6 +618,45 @@
} }
} }
} }
if([tag isEqualToString:@"SIMLOGINGAPI"]) {
//'人员类型(1:员工 2: 小助手 3: 专家 4: 医疗点 5: 操作人员 6: 专业人员 7:驻场人员 8:其他 9:医院管理员 10: 医院体检医生 11:医院前台 12: 健康室管理员 13: 健康打卡管理员 15:医疗点医护人员)'
[self hiddenAllMBProgressHUD];
NSDictionary * dic = response;
HQUserInfo * user = [[HQUserInfo alloc] init];
user.userInfo = [dic objectForKey:@"userInfo"];
user.token = [dic objectForKey:@"token"];
[HQCommonUtils keyedArchiverWithData:user key:LoginUserInfo];
[[NSUserDefaults standardUserDefaults] setObject:@"1" forKey:@"LOGINAgree"];
[[NSUserDefaults standardUserDefaults] synchronize];
[[NSUserDefaults standardUserDefaults] setObject:user.token forKey:@"SIMTOKEN"];
[[NSUserDefaults standardUserDefaults] synchronize];
NSString * avatar = @"";
NSString * placeholdImg ;
if (!ValidStr(user.avatar)) {
avatar = user.avatar;
}else
{
if ([user.sex_dictText isEqualToString:@""]) {
placeholdImg = @"heard_man";
}else
{
placeholdImg = @"heard_woman";
}
}
[[NSUserDefaults standardUserDefaults] setObject:avatar forKey:@"AVATAR"];
[[NSUserDefaults standardUserDefaults] setObject:placeholdImg forKey:@"placeholdImg"];
[[NSUserDefaults standardUserDefaults] synchronize];
KPostNotification(KNotificationLoginStateChange, @YES);
}
} }
@@ -668,15 +768,122 @@
} }
//健康系统登录方法 //健康系统登录方法
- (void)healthLoginTypeClick { - (void)healthLoginTypeClick:(UIButton *)changeBtn {
self.loginType = 2;
self.leftLoginBtn.selected = false; changeBtn.selected = !changeBtn.selected;
self.rightLoginBtn.selected = true;
[self.foundPasswordBtn setTitle:@"健康系统找回密码" forState:UIControlStateNormal]; if (changeBtn.selected == true) {
self.loginType = 2;
self.topLoginTitleLab.text = @"健康系统认证";
}else
{
self.loginType = 1;
self.topLoginTitleLab.text = @"平台统一认证";
}
} }
//模拟功能
- (void)handleImageTap:(UITapGestureRecognizer *)sender {
// 获取当前点击时间
NSDate *currentTapDate = [NSDate date];
// 如果是第一次点击,记录时间
if (self.tapCount == 0) {
self.firstTapDate = currentTapDate;
}
// 计算点击间隔时间
NSTimeInterval timeInterval = [currentTapDate timeIntervalSinceDate:self.firstTapDate];
// 如果间隔时间超过2秒,重置计数器
if (timeInterval > 2.0) {
self.tapCount = 0;
self.firstTapDate = currentTapDate;
}
// 增加点击计数
self.tapCount += 1;
// 如果点击次数达到5次,触发事件
if (self.tapCount == 5) {
[self handleFiveContinuousTaps];
// 重置计数器
self.tapCount = 0;
}
}
- (void)handleFiveContinuousTaps {
// 在这里实现击5次触发事件的逻辑
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"温馨提示" message:@"你已经触发模拟用户功能!" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
}];
UIAlertAction *sureAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
self.userNameField.text = @"admin";
self.passwordField.text = @"#fCjW%x2dv@a";
//模拟用户system登录
[self loginModelUser];
}];
[alertController addAction:cancelAction];
[alertController addAction:sureAction];
[[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:alertController animated:YES completion:nil];
}
- (void)loginModelUser {
//测试
//#if DEBUG
// self.passwordField.text = @"#fCjW%x2dv@a";
//#else
// self.passwordField.text = @"&ZzW$3**@VLA";
//#endif
NSString * publish_key = @" MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCmZfR/bA9X3vp86y1aEpvwzXJYKRRF1fLau2+05/ZtaITLpV8bhkmSf3neSy/Q9gAdvG75Fr73E+GWE+K5b0BpvIS1jDGo319+PpZR39SaZTKZ27XFXrosmJTZutN79t819HS1VseleunHAFgMVufE9U5jP6LGzl/wbkSy01GhzwIDAQAB";
// 原始数据,要加密的字符串
NSString *originalString = self.passwordField.text;
// RSA 加密,使用字符串格式的公钥私钥加密解密, RSAPublickKey 为公钥字符串(NSString 格式)
NSString *encryptStr = [RSAObjC encrypt:originalString PublicKey:publish_key];
[self showMBProgressHUDWithString:@"登录中" autoHidden:false];
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:self.userNameField.text forKey:@"username"];
//新增
UIDevice *currentDevice = [UIDevice currentDevice];
NSString * phone = [currentDevice getCurrentDeviceModel];
// NSString * system = [NSString stringWithFormat:@"%.1f",CurrentSystemVersion] ;
if (!ValidStr(phone)) {
[parmDic setObject:phone forKey:@"deviceType"];
}
[parmDic setObject:@(CurrentSystemVersion) forKey:@"deviceSystem"];
[parmDic setObject:encryptStr forKey:@"password"];
XJPNetAPI * proctocolApi = [[XJPNetAPI alloc] init:self tag:@"SIMLOGINGAPI" NeedToken:nil];
[proctocolApi PostLogin:parmDic];
}
@end @end
@@ -9,6 +9,7 @@
#import "XJLoginFoundPasswordViewController.h" #import "XJLoginFoundPasswordViewController.h"
#import "XJMineCenterUserModel.h" #import "XJMineCenterUserModel.h"
#import "ADJumpViewController.h" #import "ADJumpViewController.h"
#import "XJTYFoundPassWordViewController.h"
@interface XJEditSystemViewController ()<UITableViewDelegate,UITableViewDataSource> @interface XJEditSystemViewController ()<UITableViewDelegate,UITableViewDataSource>
@@ -188,8 +189,9 @@
if (indexPath.row == 0) { if (indexPath.row == 0) {
XJLoginFoundPasswordViewController * loginVC = [[XJLoginFoundPasswordViewController alloc] init]; XJTYFoundPassWordViewController * xjVC = [[XJTYFoundPassWordViewController alloc] init];
[self.navigationController pushViewController:loginVC animated:YES]; xjVC.webUrl = @"https://sso.iosp.ydpt.tech/SSOManageClient/userController/changePassword";
[self.navigationController pushViewController:xjVC animated:YES];
} }
if (indexPath.row == 1) { if (indexPath.row == 1) {
@@ -17,12 +17,14 @@
#import "XJEditSystemViewController.h" #import "XJEditSystemViewController.h"
#import "XJSOSLookDoctoreViewController.h" #import "XJSOSLookDoctoreViewController.h"
#import "XJEmergencyListViewController.h" #import "XJEmergencyListViewController.h"
#import "SimulationViewController.h"
@interface XJMyCenterViewController ()<myCenterHeardToolsDelegate,cenerCellListDelegate> @interface XJMyCenterViewController ()<myCenterHeardToolsDelegate,cenerCellListDelegate>
@property (nonatomic, strong) XJMyCenterTableView * homeTable; @property (nonatomic, strong) XJMyCenterTableView * homeTable;
@property (nonatomic, assign) NSInteger tapCount;
@property (nonatomic, strong) NSDate *firstTapDate;
@end @end
@implementation XJMyCenterViewController @implementation XJMyCenterViewController
@@ -93,7 +95,11 @@
topView.backgroundColor = UIColorHex(#21BEBD); topView.backgroundColor = UIColorHex(#21BEBD);
[self.view addSubview:topView]; [self.view addSubview:topView];
// 添加点击手势识别器
UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleImageTap:)];
[topView addGestureRecognizer:tapGestureRecognizer];
// 初始化计数器
self.tapCount = 0;
self.homeTable = [[XJMyCenterTableView alloc] initWithFrame:CGRectMake(kRealValue(15), kRealValue(25), kScreenWidth - kRealValue(30), kScreenHeight - kRealValue(25) - kTopHeight - kTabBarHeight) style:UITableViewStyleGrouped]; self.homeTable = [[XJMyCenterTableView alloc] initWithFrame:CGRectMake(kRealValue(15), kRealValue(25), kScreenWidth - kRealValue(30), kScreenHeight - kRealValue(25) - kTopHeight - kTabBarHeight) style:UITableViewStyleGrouped];
self.homeTable.heardDelegate =self; self.homeTable.heardDelegate =self;
@@ -283,6 +289,44 @@
} }
- (void)handleImageTap:(UITapGestureRecognizer *)sender {
// 获取当前点击时间
NSDate *currentTapDate = [NSDate date];
// 如果是第一次点击,记录时间
if (self.tapCount == 0) {
self.firstTapDate = currentTapDate;
}
// 计算点击间隔时间
NSTimeInterval timeInterval = [currentTapDate timeIntervalSinceDate:self.firstTapDate];
// 如果间隔时间超过2秒,重置计数器
if (timeInterval > 2.0) {
self.tapCount = 0;
self.firstTapDate = currentTapDate;
}
// 增加点击计数
self.tapCount += 1;
// 如果点击次数达到5次,触发事件
if (self.tapCount == 5) {
[self handleFiveContinuousTaps];
// 重置计数器
self.tapCount = 0;
}
}
- (void)handleFiveContinuousTaps {
//模拟
SimulationViewController * simVC = [[SimulationViewController alloc] init];
[self.navigationController pushViewController:simVC animated:YES];
}
@@ -25,6 +25,9 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, copy) NSString * text; @property (nonatomic, copy) NSString * text;
@property (nonatomic, copy) NSString * title; @property (nonatomic, copy) NSString * title;
@property (nonatomic, copy) NSString * username;
@property (nonatomic, copy) NSString * userId_id;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
@@ -9,4 +9,11 @@
@implementation XJMineCenterUserModel @implementation XJMineCenterUserModel
+ (NSDictionary *)modelCustomPropertyMapper
{
NSDictionary * dic =@{@"userId_id" :@"id"};
return dic;
}
@end @end
@@ -62,38 +62,38 @@
MJWeakSelf MJWeakSelf
self.homeTable.popBlock = ^(MonitoringListDataModel *model) { self.homeTable.popBlock = ^(NSString *type) {
if ([model.wdType isEqualToString:@"heart_rate"]) { if ([type isEqualToString:@"heart_rate"]) {
[weakSelf showPickStringView:BRStringPickerComponentMulti [weakSelf showPickStringView:BRStringPickerComponentMulti
withTitle: @"心率阈值" withTitle: @"心率阈值"
withDataArray:@[@[@"40次/分钟", @"45次/分钟", @"50次/分钟"], @[@"100次/分钟",@"110次/分钟",@"120次/分钟",@"130次/分钟",@"140次/分钟",@"150次/分钟"]] withType:model.wdType withLeft:model.warnMin withRight:model.warnMax]; withDataArray:@[@[@"40次/分钟", @"45次/分钟", @"50次/分钟"], @[@"100次/分钟",@"110次/分钟",@"120次/分钟",@"130次/分钟",@"140次/分钟",@"150次/分钟"]] withType:type];
} }
if ([model.wdType isEqualToString:@"spo2"]) { if ([type isEqualToString:@"spo2"]) {
[weakSelf showPickStringView:BRStringPickerComponentSingle [weakSelf showPickStringView:BRStringPickerComponentSingle
withTitle: @"血氧阈值(下限)" withTitle: @"血氧阈值(下限)"
withDataArray:@[@"75%", @"80%", @"85%",@"90%"] withType:model.wdType withLeft:model.warnMin withRight:model.warnMax]; withDataArray:@[@"75%", @"80%", @"85%",@"90%"] withType:type];
} }
if ([model.wdType isEqualToString:@"stress"]) { if ([type isEqualToString:@"stress"]) {
[weakSelf showPickStringView:BRStringPickerComponentSingle [weakSelf showPickStringView:BRStringPickerComponentSingle
withTitle: @"压力阈值(上限)" withTitle: @"压力阈值(上限)"
withDataArray:@[@"80", @"81", @"82",@"83",@"84",@"85",@"86",@"87",@"88",@"89",@"90",@"91",@"92",@"93",@"94",@"95",@"96",@"97",@"98",@"99"] withType:model.wdType withLeft:model.warnMin withRight:model.warnMin]; withDataArray:@[@"80", @"81", @"82",@"83",@"84",@"85",@"86",@"87",@"88",@"89",@"90",@"91",@"92",@"93",@"94",@"95",@"96",@"97",@"98",@"99"] withType:type];
} }
if ([model.wdType isEqualToString:@"temperature"]) { if ([type isEqualToString:@"temperature"]) {
[weakSelf showPickStringView:BRStringPickerComponentMulti [weakSelf showPickStringView:BRStringPickerComponentMulti
withTitle: @"体温阈值" withTitle: @"体温阈值"
withDataArray:@[@[@"34.0℃", @"34.1℃", @"34.2℃",@"34.3℃",@"34.4℃",@"34.5℃",@"34.6℃",@"34.7℃",@"34.8℃",@"34.9℃",@"35.0℃",@"35.1℃",@"35.2℃",@"35.3℃",@"35.4℃",@"35.5℃",@"35.6℃",@"35.7℃",@"35.8℃",@"35.9℃"], withDataArray:@[@[@"34.0℃", @"34.1℃", @"34.2℃",@"34.3℃",@"34.4℃",@"34.5℃",@"34.6℃",@"34.7℃",@"34.8℃",@"34.9℃",@"35.0℃",@"35.1℃",@"35.2℃",@"35.3℃",@"35.4℃",@"35.5℃",@"35.6℃",@"35.7℃",@"35.8℃",@"35.9℃"],
@[@"37.2℃", @"37.3℃", @"37.4℃",@"37.5℃",@"37.6℃",@"37.7℃",@"37.8℃",@"37.9℃",@"38.0℃",@"38.1℃",@"38.2℃",@"38.3℃",@"38.4℃"]] withType:model.wdType withLeft:model.warnMin withRight:model.warnMax]; @[@"37.2℃", @"37.3℃", @"37.4℃",@"37.5℃",@"37.6℃",@"37.7℃",@"37.8℃",@"37.9℃",@"38.0℃",@"38.1℃",@"38.2℃",@"38.3℃",@"38.4℃"]] withType:type];
} }
@@ -208,7 +208,9 @@
[parmDic setObject:User_ID forKey:@"userId"]; [parmDic setObject:User_ID forKey:@"userId"];
XJPNetAPI * sosApi = [[XJPNetAPI alloc] init:self tag:@"DETAILAPI" NeedToken:@""]; XJPNetAPI * sosApi = [[XJPNetAPI alloc] init:self tag:@"DETAILAPI" NeedToken:@""];
[sosApi getMinitringWatchData:parmDic]; // [sosApi getMinitringWatchData:parmDic];
[sosApi getWarningWatchListV2Data:parmDic];
} }
@@ -257,16 +259,18 @@
[self hiddenAllMBProgressHUD]; [self hiddenAllMBProgressHUD];
[EasyTextView showSuccessText:@"保存成功"]; [EasyTextView showSuccessText:@"保存成功"];
[self createDetail];
} }
} }
- (void)showPickStringView:(BRStringPickerMode)stringModel - (void)showPickStringView:(BRStringPickerMode)stringModel
withTitle:(NSString *)title withTitle:(NSString *)title
withDataArray:(NSArray *)array withDataArray:(NSArray *)array
withType:(NSString *)type withType:(NSString *)type {
withLeft:(NSString *)leftString
withRight:(NSString *)rightString{ BRStringPickerView *textPickerView =
[[BRStringPickerView alloc] initWithPickerMode:stringModel];
UIView * customView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 30)]; UIView * customView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 30)];
UILabel * leftLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, kScreenWidth/2, 20)]; UILabel * leftLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, kScreenWidth/2, 20)];
@@ -283,95 +287,217 @@
rightLabel.textColor = CFontColor2; rightLabel.textColor = CFontColor2;
[customView addSubview:rightLabel]; [customView addSubview:rightLabel];
/// 多列文本选择器
BRStringPickerView *textPickerView = [[BRStringPickerView alloc]initWithPickerMode:stringModel];
textPickerView.title = title; textPickerView.title = title;
textPickerView.pickerStyle.doneBtnFrame = CGRectMake(self.view.width - 120, 0, 120, 45);
textPickerView.pickerStyle.doneBtnTitle = @"保存并同步"; textPickerView.pickerStyle.doneBtnTitle = @"保存并同步";
textPickerView.pickerStyle.doneTextFont = SYSTEMFONT(13); textPickerView.pickerStyle.doneTextFont = SYSTEMFONT(13);
textPickerView.pickerStyle.doneTextColor = UIColorHex(#21BEBD); textPickerView.pickerStyle.doneTextColor = UIColorHex(#21BEBD);
// 设置数据源
textPickerView.dataSourceArr = array; textPickerView.dataSourceArr = array;
if (stringModel == 0) { //单列
NSInteger selectedOnes = 0; // ✅ 拿到当前指标 model
MonitoringListDataModel * vo = [self modelForType:type];
// ===============================
// 单列 Pickerspo2 / stress
// ===============================
if (stringModel == BRStringPickerComponentSingle) {
NSString *defaultValue = @"";
if ([type isEqualToString:@"spo2"]) { if ([type isEqualToString:@"spo2"]) {
defaultValue = [NSString stringWithFormat:@"%.0f", [vo.warnMin floatValue]];
for (NSString * dataString in array) {
if ( [dataString intValue] == [leftString intValue]) {
textPickerView.selectIndex = selectedOnes;
}
selectedOnes ++;
}
} }
else if ([type isEqualToString:@"stress"]) {
if ([type isEqualToString:@"stress"]) { defaultValue = [NSString stringWithFormat:@"%.0f", [vo.warnMax floatValue]];
for (NSString * dataString in array) {
if ( [dataString intValue] == [rightString intValue]) {
textPickerView.selectIndex = selectedOnes;
}
selectedOnes ++;
}
} }
textPickerView.resultModelBlock = ^(BRResultModel *resultModel) { NSInteger index =
NSString *valueStr = [self extractNumberFromString:resultModel.value]; [self indexOfValue:defaultValue inArray:array];
textPickerView.selectIndex = index;
textPickerView.resultModelBlock =
^(BRResultModel *resultModel) {
NSString *minValue =
[self pureNumberStringFrom:resultModel.value];
if ([type isEqualToString:@"spo2"]) { if ([type isEqualToString:@"spo2"]) {
[self settingWithType:type MaxAndMin:@"0" minValue:valueStr]; [self settingWithType:type
MaxAndMin:@"0"
minValue:minValue];
} }
if ([type isEqualToString:@"stress"]) { if ([type isEqualToString:@"stress"]) {
[self settingWithType:type MaxAndMin:valueStr minValue:@"0"]; [self settingWithType:type
MaxAndMin:minValue
minValue:@"0"];
} }
}; };
} else { }
[textPickerView addSubViewToPicker:customView];
NSInteger selectedLeft = 0; // ===============================
// 双列 Pickerheart_rate / temperature
// ===============================
else {
textPickerView.pickerHeaderView = customView;
for (NSString * dataString in array[0]) { NSArray *minArray = array[0];
NSArray *maxArray = array[1];
if ( [dataString intValue] == [leftString intValue]) {
break; NSString *minStr = @"";
} NSString *maxStr = @"";
selectedLeft ++;
if ([type isEqualToString:@"heart_rate"]) {
minStr = [NSString stringWithFormat:@"%.0f", [vo.warnMin floatValue]];
maxStr = [NSString stringWithFormat:@"%.0f", [vo.warnMax floatValue]];
} }
else if ([type isEqualToString:@"temperature"]) {
NSInteger selectedRight = 0; minStr = [NSString stringWithFormat:@"%.1f", [vo.warnMin floatValue]];
maxStr = [NSString stringWithFormat:@"%.1f", [vo.warnMax floatValue]];
for (NSString * dataString in array[1]) {
if ( [dataString intValue] == [rightString intValue]) {
break;
}
selectedRight ++;
} }
textPickerView.selectIndexs = @[@(selectedLeft),@(selectedRight)];
NSInteger minIndex =
[self indexOfValue:minStr inArray:minArray];
NSInteger maxIndex =
[self indexOfValue:maxStr inArray:maxArray];
textPickerView.resultModelArrayBlock = ^(NSArray<BRResultModel *> * _Nullable resultModelArr) { textPickerView.selectIndexs = @[@(minIndex), @(maxIndex)];
textPickerView.resultModelArrayBlock =
^(NSArray<BRResultModel *> * _Nullable resultModelArr) {
BRResultModel *minModel = resultModelArr[0];
BRResultModel *maxModel = resultModelArr[1];
NSString * minValue =
[self pureNumberStringFrom:minModel.value];
NSString * maxValue =
[self pureNumberStringFrom:maxModel.value];
[self settingWithType:type
BRResultModel *resultModel1 = resultModelArr[1]; MaxAndMin:maxValue
BRResultModel *resultModel2 = resultModelArr[0]; minValue:minValue];
NSString *maxValue = [self extractNumberFromString:resultModel1.value];
NSString *minValue = [self extractNumberFromString:resultModel2.value];
[self settingWithType:type MaxAndMin:maxValue minValue:minValue];
}; };
} }
[textPickerView show]; [textPickerView show];
} }
//
//- (void)showPickStringView:(BRStringPickerMode)stringModel
// withTitle:(NSString *)title
// withDataArray:(NSArray *)array
// withType:(NSString *)type
// withLeft:(NSString *)leftString
// withRight:(NSString *)rightString{
//
//
// /// 多列文本选择器
// BRStringPickerView *textPickerView = [[BRStringPickerView alloc]initWithPickerMode:stringModel];
// textPickerView.title = title;
// textPickerView.pickerStyle.doneBtnFrame = CGRectMake(self.view.width - 120, 0, 120, 45);
// textPickerView.pickerStyle.doneBtnTitle = @"保存并同步";
// textPickerView.pickerStyle.doneTextFont = SYSTEMFONT(13);
// textPickerView.pickerStyle.doneTextColor = UIColorHex(#21BEBD);
// // 设置数据源
// textPickerView.dataSourceArr = array;
//
// // ✅ 拿到当前指标 model
// MonitoringListDataModel * vo = [self modelForType:type];
//
// if (stringModel == BRStringPickerComponentSingle) {
//
// NSString *defaultValue = @"";
//
// if ([type isEqualToString:@"spo2"]) {
// defaultValue = [NSString stringWithFormat:@"%.0f", [vo.warnMin floatValue]];
// }
// else if ([type isEqualToString:@"stress"]) {
// defaultValue = [NSString stringWithFormat:@"%.0f", [vo.warnMax floatValue]];
// }
//
// NSInteger index =
// [self indexOfValue:defaultValue inArray:array];
//
// textPickerView.selectIndex = index;
//
// textPickerView.resultModelBlock =
// ^(BRResultModel *resultModel) {
//
// NSString *minValue =
// [self pureNumberStringFrom:resultModel.value];
//
// if ([type isEqualToString:@"spo2"]) {
// [self settingWithType:type
// MaxAndMin:@"0"
// minValue:minValue];
// }
// if ([type isEqualToString:@"stress"]) {
// [self settingWithType:type
// MaxAndMin:minValue
// minValue:@"0"];
// }
// };
// }
//
// // ===============================
// // 双列 Pickerheart_rate / temperature
// // ===============================
// else {
//
// NSArray *minArray = array[0];
// NSArray *maxArray = array[1];
//
// NSString *minStr = @"";
// NSString *maxStr = @"";
//
// if ([type isEqualToString:@"heart_rate"]) {
// minStr = [NSString stringWithFormat:@"%.0f", [vo.warnMin floatValue]];
// maxStr = [NSString stringWithFormat:@"%.0f", [vo.warnMax floatValue]];
// }
// else if ([type isEqualToString:@"temperature"]) {
// minStr = [NSString stringWithFormat:@"%.1f", [vo.warnMin floatValue]];
// maxStr = [NSString stringWithFormat:@"%.1f", [vo.warnMax floatValue]];
// }
//
// NSInteger minIndex =
// [self indexOfValue:minStr inArray:minArray];
// NSInteger maxIndex =
// [self indexOfValue:maxStr inArray:maxArray];
//
// textPickerView.selectIndexs = @[@(minIndex), @(maxIndex)];
//
// textPickerView.resultModelArrayBlock =
// ^(NSArray<BRResultModel *> * _Nullable resultModelArr) {
//
// BRResultModel *minModel = resultModelArr[0];
// BRResultModel *maxModel = resultModelArr[1];
//
// NSString * minValue =
// [self pureNumberStringFrom:minModel.value];
//
// NSString * maxValue =
// [self pureNumberStringFrom:maxModel.value];
//
// [self settingWithType:type
// MaxAndMin:maxValue
// minValue:minValue];
// };
// }
//
// [textPickerView show];
//
//}
- (NSString *)pureNumberStringFrom:(NSString *)string {
NSCharacterSet *set =
[[NSCharacterSet characterSetWithCharactersInString:@"0123456789."] invertedSet];
NSString *result =
[[string componentsSeparatedByCharactersInSet:set] componentsJoinedByString:@""];
return result;
}
// 提取字符串中的第一个数字(包括小数),例如从 @"34.1m" 提取 @"34.1" // 提取字符串中的第一个数字(包括小数),例如从 @"34.1m" 提取 @"34.1"
- (NSString *)extractNumberFromString:(NSString *)input { - (NSString *)extractNumberFromString:(NSString *)input {
@@ -481,6 +607,28 @@
} }
- (MonitoringListDataModel *)modelForType:(NSString *)type {
for (MonitoringListDataModel * vo in self.model.indexItemVos) {
if ([vo.wdType isEqualToString:type]) {
return vo;
}
}
return nil;
}
- (NSInteger)indexOfValue:(NSString *)value
inArray:(NSArray<NSString *> *)array {
for (NSInteger i = 0; i < array.count; i++) {
NSString *item = array[i];
if ([item containsString:value]) {
return i;
}
}
return 0; // 找不到默认选第一个
}
//- (void)showNowImage:(BOOL)isShow { //- (void)showNowImage:(BOOL)isShow {
// // LYEmptyView *emptyView = [LYEmptyView emptyViewWithImageStr:@"boxNoData" titleStr:@"暂无数据" detailStr:@""]; // // LYEmptyView *emptyView = [LYEmptyView emptyViewWithImageStr:@"boxNoData" titleStr:@"暂无数据" detailStr:@""];
// //
@@ -80,6 +80,7 @@
UIButton * stepIconBtn = [[UIButton alloc] initWithFrame:CGRectMake(StepView.width - kRealValue(9) - 20, kRealValue(16), 20, 20)]; UIButton * stepIconBtn = [[UIButton alloc] initWithFrame:CGRectMake(StepView.width - kRealValue(9) - 20, kRealValue(16), 20, 20)];
[stepIconBtn setImage:[UIImage imageNamed:@"garyRight"] forState:UIControlStateNormal]; [stepIconBtn setImage:[UIImage imageNamed:@"garyRight"] forState:UIControlStateNormal];
stepIconBtn.userInteractionEnabled = false;
[StepView addSubview:stepIconBtn]; [StepView addSubview:stepIconBtn];
UIImageView * stepBackImg =[[UIImageView alloc] initWithFrame:CGRectMake(0, stepImg.bottom + kRealValue(4), StepView.width, kRealValue(114))]; UIImageView * stepBackImg =[[UIImageView alloc] initWithFrame:CGRectMake(0, stepImg.bottom + kRealValue(4), StepView.width, kRealValue(114))];
@@ -134,6 +135,7 @@
UIButton * sleepIconBtn = [[UIButton alloc] initWithFrame:CGRectMake(sleepView.width - kRealValue(9) - 20, kRealValue(16), 20, 20)]; UIButton * sleepIconBtn = [[UIButton alloc] initWithFrame:CGRectMake(sleepView.width - kRealValue(9) - 20, kRealValue(16), 20, 20)];
[sleepIconBtn setImage:[UIImage imageNamed:@"garyRight"] forState:UIControlStateNormal]; [sleepIconBtn setImage:[UIImage imageNamed:@"garyRight"] forState:UIControlStateNormal];
sleepIconBtn.userInteractionEnabled = false;
[sleepView addSubview:sleepIconBtn]; [sleepView addSubview:sleepIconBtn];
UIView * blueView = [[UIView alloc] initWithFrame:CGRectMake(sleepView.width - kRealValue(29) , self.sleepTimeLabel.bottom + kRealValue(11), kRealValue(17), kRealValue(34))]; UIView * blueView = [[UIView alloc] initWithFrame:CGRectMake(sleepView.width - kRealValue(29) , self.sleepTimeLabel.bottom + kRealValue(11), kRealValue(17), kRealValue(34))];
@@ -221,7 +223,10 @@
_heardModel = heardModel; _heardModel = heardModel;
self.allNumberLabel.text = [NSString stringWithFormat:@"累计约步行%.0f公里",_heardModel.distance]; self.allNumberLabel.text =
[NSString stringWithFormat:@"累计约步行%.0f公里",
_heardModel.distance / 1000.0];
CGFloat minutes = _heardModel.aveSleep; CGFloat minutes = _heardModel.aveSleep;
NSString *timeString; NSString *timeString;
@@ -14,7 +14,8 @@
@property (nonatomic, strong) MonitoringWarchTableHeardView * badHeardView; @property (nonatomic, strong) MonitoringWarchTableHeardView * badHeardView;
@property (nonatomic, strong) MonitoringWatchTableFooterView * badfooterView; //@property (nonatomic, strong) MonitoringWatchTableFooterView * badfooterView;
@property (nonatomic, strong) NSMutableArray * customArray;
@end @end
@@ -22,6 +23,14 @@
@implementation MonitoringWatchTableView @implementation MonitoringWatchTableView
- (NSMutableArray *)customArray {
if (!_customArray) {
_customArray = [[NSMutableArray alloc] init];
}
return _customArray;
}
- (MonitoringWarchTableHeardView *)badHeardView { - (MonitoringWarchTableHeardView *)badHeardView {
if (!_badHeardView) { if (!_badHeardView) {
@@ -35,20 +44,22 @@
return _badHeardView; return _badHeardView;
} }
- (MonitoringWatchTableFooterView *)badfooterView { //- (MonitoringWatchTableFooterView *)badfooterView {
//
if (!_badfooterView) { // if (!_badfooterView) {
//
_badfooterView = [[MonitoringWatchTableFooterView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kRealValue(165))]; // _badfooterView = [[MonitoringWatchTableFooterView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kRealValue(165))];
} // }
return _badfooterView; // return _badfooterView;
//
} //}
- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style - (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style
{ {
if (self = [super initWithFrame:frame style:style]) if (self = [super initWithFrame:frame style:style])
{ {
[self createUI]; [self createUI];
} }
return self; return self;
@@ -74,10 +85,13 @@
- (void)setModel:(MonitoringDataModel *)model { - (void)setModel:(MonitoringDataModel *)model {
[self.customArray removeAllObjects];
_model = model; _model = model;
[self buildCustomArray];
self.badHeardView.heardModel = _model; self.badHeardView.heardModel = _model;
self.badfooterView.footModel = _model; // self.badfooterView.footModel = _model;
[self reloadData]; [self reloadData];
} }
@@ -91,12 +105,38 @@
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{ {
return 4;
return self.customArray.count;
} }
- (void)buildCustomArray {
[self.customArray removeAllObjects];
NSArray *orderArray = @[@"心率", @"血氧饱和度", @"压力", @"体温"];
for (NSString *typeName in orderArray) {
for (MonitoringListDataModel *listModel in self.model.indexItemVos) {
// 排除 睡眠 / 步数(如果接口里可能混着)
if ([listModel.wdTypeName isEqualToString:@"睡眠"] ||
[listModel.wdTypeName isEqualToString:@"步数"]) {
continue;
}
if ([listModel.wdTypeName isEqualToString:typeName]) {
[self.customArray addObject:listModel];
break; // 找到就跳出,防止重复
}
}
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
MonitoringListDataModel * listModel = self.customArray[indexPath.section];
MonitoringWatchTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"CELLID"]; MonitoringWatchTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"CELLID"];
if (!cell) { if (!cell) {
@@ -104,51 +144,52 @@
cell = [[MonitoringWatchTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"CELLID"]; cell = [[MonitoringWatchTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"CELLID"];
} }
cell.backgroundColor = CViewBgColor; cell.backgroundColor = CViewBgColor;
if (indexPath.section == 0) { // if (indexPath.section == 0) {
//
for (MonitoringListDataModel * listModel in self.model.indexItemVos) { // for (MonitoringListDataModel * listModel in self.model.indexItemVos) {
//
if ([listModel.wdTypeName isEqualToString:@"心率"]) { // if ([listModel.wdTypeName isEqualToString:@"心率"]) {
cell.listModel = listModel; // cell.listModel = listModel;
} // }
//
} // }
//
//
} // }
if (indexPath.section == 1) { // if (indexPath.section == 1) {
//
for (MonitoringListDataModel * listModel in self.model.indexItemVos) { // for (MonitoringListDataModel * listModel in self.model.indexItemVos) {
//
if ([listModel.wdTypeName isEqualToString:@"血氧饱和度"]) { // if ([listModel.wdTypeName isEqualToString:@"血氧饱和度"]) {
cell.listModel = listModel; // cell.listModel = listModel;
} // }
//
} // }
//
} // }
if (indexPath.section == 2) { // if (indexPath.section == 2) {
//
for (MonitoringListDataModel * listModel in self.model.indexItemVos) { // for (MonitoringListDataModel * listModel in self.model.indexItemVos) {
//
if ([listModel.wdTypeName isEqualToString:@"压力"]) { // if ([listModel.wdTypeName isEqualToString:@"压力"]) {
cell.listModel = listModel; // cell.listModel = listModel;
} // }
//
} // }
//
} // }
if (indexPath.section == 3) { // if (indexPath.section == 3) {
//
for (MonitoringListDataModel * listModel in self.model.indexItemVos) { // for (MonitoringListDataModel * listModel in self.model.indexItemVos) {
//
if ([listModel.wdTypeName isEqualToString:@"体温"]) { // if ([listModel.wdTypeName isEqualToString:@"体温"]) {
cell.listModel = listModel; // cell.listModel = listModel;
} // }
//
} // }
//
} // }
cell.listModel = listModel;
cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.popBlock = self.popBlock; cell.popBlock = self.popBlock;
cell.historyBlock = self.historyBlock; cell.historyBlock = self.historyBlock;
@@ -160,61 +201,66 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{ {
NSString * lookType; NSString * lookType;
if (indexPath.section == 0) { MonitoringListDataModel * listModel = self.customArray[indexPath.section];
for (MonitoringListDataModel * listModel in self.model.indexItemVos) { if (self.detailBlock) {
self.detailBlock(listModel.wdType, listModel.dataDate);
if ([listModel.wdTypeName isEqualToString:@"心率"]) {
if (self.detailBlock) {
self.detailBlock(listModel.wdType, listModel.dataDate);
}
}
}
}
if (indexPath.section == 1) {
for (MonitoringListDataModel * listModel in self.model.indexItemVos) {
if ([listModel.wdTypeName isEqualToString:@"血氧饱和度"]) {
if (self.detailBlock) {
self.detailBlock(listModel.wdType, listModel.dataDate);
}
}
}
}
if (indexPath.section == 2) {
for (MonitoringListDataModel * listModel in self.model.indexItemVos) {
if ([listModel.wdTypeName isEqualToString:@"压力"]) {
if (self.detailBlock) {
self.detailBlock(listModel.wdType, listModel.dataDate);
}
}
}
}
if (indexPath.section == 3) {
for (MonitoringListDataModel * listModel in self.model.indexItemVos) {
if ([listModel.wdTypeName isEqualToString:@"体温"]) {
if (self.detailBlock) {
self.detailBlock(listModel.wdType, listModel.dataDate);
}
}
}
} }
// if (indexPath.section == 0) {
//
// for (MonitoringListDataModel * listModel in self.model.indexItemVos) {
//
// if ([listModel.wdTypeName isEqualToString:@"心率"]) {
//
// if (self.detailBlock) {
// self.detailBlock(listModel.wdType, listModel.dataDate);
// }
// }
//
// }
//
//
// }
// if (indexPath.section == 1) {
//
// for (MonitoringListDataModel * listModel in self.model.indexItemVos) {
//
// if ([listModel.wdTypeName isEqualToString:@"血氧饱和度"]) {
//
// if (self.detailBlock) {
// self.detailBlock(listModel.wdType, listModel.dataDate);
// }
// }
//
// }
//
// }
// if (indexPath.section == 2) {
//
// for (MonitoringListDataModel * listModel in self.model.indexItemVos) {
//
// if ([listModel.wdTypeName isEqualToString:@"压力"]) {
// if (self.detailBlock) {
// self.detailBlock(listModel.wdType, listModel.dataDate);
// }
// }
//
// }
//
// }
// if (indexPath.section == 3) {
//
// for (MonitoringListDataModel * listModel in self.model.indexItemVos) {
//
// if ([listModel.wdTypeName isEqualToString:@"体温"]) {
// if (self.detailBlock) {
// self.detailBlock(listModel.wdType, listModel.dataDate);
// }
// }
//
// }
//
// }
} }
@@ -8,7 +8,7 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "MonitoringDataModel.h" #import "MonitoringDataModel.h"
typedef void(^showPickStringBlock)(MonitoringListDataModel * model); typedef void(^showPickStringBlock)(NSString * type);
typedef void(^showHistoryListBlock)(NSString * type); typedef void(^showHistoryListBlock)(NSString * type);
@@ -25,6 +25,8 @@
#import "RoomDoctorRecordsVC.h" #import "RoomDoctorRecordsVC.h"
#import "HomeQusetionRecordsModel.h" #import "HomeQusetionRecordsModel.h"
#import "XJDoctorMainViewController.h" #import "XJDoctorMainViewController.h"
#import "UPAppVesionModel.h"
@interface QuestionViewController ()<questionToolsProtocl,V2TIMSDKListener,V2TIMConversationListener, TUILoginListener,V2TIMAPNSListener, TUICallObserver,V2TIMSimpleMsgListener,AMapLocationManagerDelegate> @interface QuestionViewController ()<questionToolsProtocl,V2TIMSDKListener,V2TIMConversationListener, TUILoginListener,V2TIMAPNSListener, TUICallObserver,V2TIMSimpleMsgListener,AMapLocationManagerDelegate>
@@ -32,7 +34,8 @@
@property (nonatomic, assign) NSInteger page; @property (nonatomic, assign) NSInteger page;
//@property (nonatomic, strong) PSCheckVersionView * checkVersionView; @property (nonatomic, strong) PSCheckVersionView * checkVersionView;
@property (nonatomic, strong) UIView * coverView; @property (nonatomic, strong) UIView * coverView;
//定位相关 //定位相关
@property (nonatomic, strong) AMapSearchAPI *search; @property (nonatomic, strong) AMapSearchAPI *search;
@@ -83,11 +86,13 @@
name:KNotificAgreeProtoocl name:KNotificAgreeProtoocl
object:nil]; object:nil];
[self createUI]; [self createUI];
[self getUpDateinfo];
self.page = 1; self.page = 1;
[self verifyTokenData]; [self verifyTokenData];
[self initCompleteBlock]; [self initCompleteBlock];
[self configLocationManager]; [self configLocationManager];
[self reGeocodeAction]; [self reGeocodeAction];
// 4. 添加 V2TIMSDKListener 的事件监听器,self 是 id<V2TIMSDKListener> 的实现类,如果您不需要监听 IM SDK 的事件,这个步骤可以忽略。 // 4. 添加 V2TIMSDKListener 的事件监听器,self 是 id<V2TIMSDKListener> 的实现类,如果您不需要监听 IM SDK 的事件,这个步骤可以忽略。
[[V2TIMManager sharedInstance] addIMSDKListener:self]; [[V2TIMManager sharedInstance] addIMSDKListener:self];
// 5. 初始化 IM SDK,调用这个接口后,可以立即调用登录接口。 // 5. 初始化 IM SDK,调用这个接口后,可以立即调用登录接口。
@@ -128,7 +133,10 @@
if (!ValidStr(UserDefaultObjectForKey(@"HTTPS"))) { if (!ValidStr(UserDefaultObjectForKey(@"HTTPS"))) {
[self verifyTokenData]; [self verifyTokenData];
} } }
}
- (void)reGeocodeAction - (void)reGeocodeAction
@@ -175,14 +183,15 @@
#pragma mark:更新 #pragma mark:更新
- (void)getUpDateinfo { - (void)getUpDateinfo {
// NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
// // 获取应用的版本号
// [parmDic setObject:@"com.question.QinghaiProvince" forKey:@"pkg"];
//
// JKCQAPI * homeRemakerApi = [[JKCQAPI alloc] init:self tag:@"UPVERSION" NeedToken:@""];
// [homeRemakerApi getABMUpdate:parmDic];
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
// 获取应用的版本号
[parmDic setObject:@"com.questionTools.XinjiangProject" forKey:@"packageName"];
[parmDic setObject:@"2" forKey:@"androidOrIos"];
XJPNetAPI * homeRemakerApi = [[XJPNetAPI alloc] init:self tag:@"UPVERSION" NeedToken:@""];
[homeRemakerApi GetAppVesionUpdata:parmDic];
} }
- (void)initCompleteBlock - (void)initCompleteBlock
@@ -510,48 +519,31 @@
if ([tag isEqualToString:@"UPVERSION"]) { if ([tag isEqualToString:@"UPVERSION"]) {
NSString * upVersion = [NSString stringWithFormat:@"%@",response] ; NSDictionary * dic = response;
NSString * version = [NSString stringWithFormat:@"%@",[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]] ; UPAppVesionModel * model = [UPAppVesionModel modelWithDictionary:dic];
NSString *lastChar; // 避免1.0.10 跟 1.0.1 出错
if (!ValidStr(version)) {
NSArray * array = [version componentsSeparatedByString:@"."];
if (array.count >0) {
lastChar = [NSString stringWithFormat:@"%@", [array lastObject]];
}
NSLog(@"Last character: %@", lastChar);
}
/** NSString *version =
// * 当前版本号 [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
// */
// @property (nonatomic, copy) NSString *currentVersion; NSString *versionCode =
// [version stringByReplacingOccurrencesOfString:@"." withString:@""];
// /**
// * 更新版本号 NSInteger loctaionVesion = [versionCode integerValue];
// */
// @property (nonatomic, copy) NSString *releaseVersion; NSDictionary * infoDic = @{
// @"version":[NSString stringWithFormat:@"%@",model.versionName] ,
// /** @"releaseNotes":model.updateContent,
// * 更新日志 @"currentVersionReleaseDate":model.updateTime};
// */
// @property (nonatomic, copy) NSString *releaseLog;
//
// /**
// * 更新时间(yyyy-MM-dd HH:mm)
// */
// @property (nonatomic, copy) NSString *releaseDate;
NSDictionary * dic = @{ PSAppInfo * info = [[PSAppInfo alloc] initWithDict:infoDic];
@"version":[NSString stringWithFormat:@"1.0.%@",upVersion] , //是否需要强制更新
@"releaseNotes":@"修复已知问题,提升用户体验感!"};
PSAppInfo * info = [[PSAppInfo alloc] initWithDict:dic]; BOOL isNeed = [model.forced integerValue] == 1 ? YES : NO;
if ([upVersion intValue] > [lastChar intValue]) { if ( model.versionNo > loctaionVesion) {
[self show:info]; [self show:info isNeedUpdate:isNeed];
}else }else
{ {
DLog(@"不需要更新"); DLog(@"不需要更新");
@@ -559,33 +551,43 @@
} }
} }
//是否需要更新
- (void)show:(PSAppInfo *)info { - (void)show:(PSAppInfo *)info isNeedUpdate:(BOOL)isNeed {
// if (_coverView) { return; }
// __weak typeof(self)weakSelf = self;
// __weak typeof(self)weakSelf = self;
// if(isNeed == true) { //强制更新
// self.checkVersionView = [[PSCheckVersionView alloc] self.checkVersionView = [[PSCheckVersionView alloc]
// initWithAppInfo:info initWithAppInfo:info
// confirm:^{ confirm:^{
// [self jumpAppStoreUpdate]; [weakSelf jumpAppStoreUpdate];
// }]; }];
//
// [self.coverView addSubview:self.checkVersionView]; }else {
// [self.checkVersionView mas_makeConstraints:^(MASConstraintMaker *make) { self.checkVersionView = [[PSCheckVersionView alloc] initWithAppInfo:info confirm:^{
// make.width.equalTo(self.coverView).multipliedBy(0.69);
// make.height.equalTo(self.coverView).multipliedBy(0.57); [weakSelf jumpAppStoreUpdate];
// make.center.equalTo(self.coverView);
// }]; } cancel:^{
// [[UIApplication sharedApplication].keyWindow.rootViewController.view addSubview:self.coverView];
[self.coverView removeFromSuperview];
}];
}
[self.coverView addSubview:self.checkVersionView];
[self.checkVersionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.equalTo(self.coverView).multipliedBy(0.75);
make.height.equalTo(self.coverView).multipliedBy(0.33);
make.center.equalTo(self.coverView);
}];
[[UIApplication sharedApplication].keyWindow.rootViewController.view addSubview:self.coverView];
} }
- (void)jumpAppStoreUpdate { - (void)jumpAppStoreUpdate {
UIApplication *application = [UIApplication sharedApplication];// 打电话 //强制退出
exit(0);
[application openURL:[NSURL URLWithString:@"https://api.cqygjk.com/health-system/api/anon/sys/toAppDown?pkg=com.question.QinghaiProvince&type=2"] options:@{} completionHandler:nil];//
} }
@@ -0,0 +1,26 @@
//
// UPAppVesionModel.h
// XinjiangProject
//
// Created by Apple on 2025/12/25.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface UPAppVesionModel : NSObject
@property (nonatomic, copy) NSString * deviceType;
@property (nonatomic, strong) NSArray * ignoreFlag;
@property (nonatomic, copy) NSString * appUrl;
@property (nonatomic, copy) NSString * appStatus;
@property (nonatomic, copy) NSString * forced;
@property (nonatomic, assign) NSInteger versionNo;
@property (nonatomic, copy) NSString * updateContent;
@property (nonatomic, copy) NSString * versionName;
@property (nonatomic, copy) NSString * updateTime;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,12 @@
//
// UPAppVesionModel.m
// XinjiangProject
//
// Created by Apple on 2025/12/25.
//
#import "UPAppVesionModel.h"
@implementation UPAppVesionModel
@end
@@ -105,7 +105,7 @@
[self.addressLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.addressLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(kRealValue(18)); make.left.mas_equalTo(kRealValue(18));
make.right.mas_offset(kRealValue(-15)); make.right.mas_offset(kRealValue(-50));
make.top.mas_equalTo(self.phoneLabel.mas_bottom).offset(11); make.top.mas_equalTo(self.phoneLabel.mas_bottom).offset(11);
make.bottom.mas_offset(-26); make.bottom.mas_offset(-26);
}]; }];
@@ -179,7 +179,7 @@
self.samllPhoneBtn.hidden = false; self.samllPhoneBtn.hidden = false;
[self.addressLabel mas_remakeConstraints:^(MASConstraintMaker *make) { [self.addressLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(kRealValue(18)); make.left.mas_equalTo(kRealValue(18));
make.right.mas_offset(kRealValue(-15)); make.right.mas_offset(kRealValue(-50));
make.top.mas_equalTo(self.phoneLabel.mas_bottom).offset(11); make.top.mas_equalTo(self.phoneLabel.mas_bottom).offset(11);
make.bottom.mas_offset(-25); make.bottom.mas_offset(-25);
}]; }];
@@ -190,7 +190,7 @@
[self.addressLabel mas_remakeConstraints:^(MASConstraintMaker *make) { [self.addressLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(kRealValue(18)); make.left.mas_equalTo(kRealValue(18));
make.right.mas_offset(kRealValue(-15)); make.right.mas_offset(kRealValue(-50));
make.top.mas_equalTo(self.hospitalName.mas_bottom).offset(11); make.top.mas_equalTo(self.hospitalName.mas_bottom).offset(11);
make.bottom.mas_offset(-25); make.bottom.mas_offset(-25);
}]; }];
@@ -449,9 +449,36 @@
if ([cell isKindOfClass:DoctorIDCardMessageCell.class]) { if ([cell isKindOfClass:DoctorIDCardMessageCell.class]) {
DoctorIDCardMessageCell * endCell = cell; DoctorIDCardMessageCell * endCell = cell;
//7月6日新增 点击判断
NSLog(@"--%@",endCell.messageData.innerMessage.msgID);
//7月6日新增 点击判断
// 获取当前日期和时间 // 获取当前日期和时间
//@property(nonatomic, strong) NSString *groupId;
// @property(nonatomic, strong) NSString *fromUser;
//
// @property(nonatomic, strong) NSString *toUser;
// endCell.messageData.innerMessage.groupID;
// endCell.messageData.innerMessage.userID;
NSLog(@"--%@",endCell.messageData.innerMessage.groupID);
NSLog(@"--%@",endCell.messageData.innerMessage.userID);
NSString * groupId = endCell.messageData.innerMessage.groupID;
NSString * msgId = endCell.messageData.innerMessage.msgID;
NSString * fromAccount = endCell.messageData.identifier;
// !2025年12月10号 新疆卡片不让点击需求-- 李龙
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:groupId forKey:@"groupId"];
[parmDic setObject:fromAccount forKey:@"fromAccount"];
[parmDic setObject:User_ID forKey:@"toAccount"];
[parmDic setObject:msgId forKey:@"msgId"];
[self RecordCardInfo:parmDic];
//小助手id
endCell.messageData.identifier;
NSDate *currentDate = endCell.messageData.innerMessage.timestamp; NSDate *currentDate = endCell.messageData.innerMessage.timestamp;
// 获取自1970年1月1日以来的时间间隔(以秒为单位) // 获取自1970年1月1日以来的时间间隔(以秒为单位)
@@ -488,6 +515,13 @@
} }
- (void)RecordCardInfo:(NSDictionary *)parmDic {
[self showMBProgressHUDOnlyWithString:@"加载中,请稍候..."];
XJPNetAPI * endApi = [[XJPNetAPI alloc] init:self tag:@"ClickInfo" NeedToken:@""];
[endApi recordDoctorCardInfoClick:parmDic];
}
#pragma mark:网络请求 #pragma mark:网络请求
- (void)Failed:(NSString*)message tag:(NSString*)tag - (void)Failed:(NSString*)message tag:(NSString*)tag
{ {
@@ -512,19 +546,27 @@
} }
if ([tag isEqualToString:@"TIME"]) if ([tag isEqualToString:@"TIME"])
{ {
NSString * isExpired =[NSString stringWithFormat:@"%@",response] ; // NSString * isExpired =[NSString stringWithFormat:@"%@",response] ;
//
if ([isExpired integerValue]== 0) { // if ([isExpired integerValue]== 0) {
XJExpertMainViewController * experVC= [[XJExpertMainViewController alloc] init]; // XJExpertMainViewController * experVC= [[XJExpertMainViewController alloc] init];
experVC.doctorId = self.doctorCardID; // experVC.doctorId = self.doctorCardID;
[self.navigationController pushViewController:experVC animated:YES]; // [self.navigationController pushViewController:experVC animated:YES];
}else // }else
{ // {
[EasyTextView showErrorText:@"医生信息已过期"]; // [EasyTextView showErrorText:@"医生信息已过期"];
} // }
} }
if ([tag isEqualToString:@"ClickInfo"]) {
XJExpertMainViewController * experVC= [[XJExpertMainViewController alloc] init];
experVC.doctorId = self.doctorCardID;
[self.navigationController pushViewController:experVC animated:YES];
}
if ([tag isEqualToString:@"ENDPICTUREAPI"]) { if ([tag isEqualToString:@"ENDPICTUREAPI"]) {
[self hiddenAllMBProgressHUD]; [self hiddenAllMBProgressHUD];
if( self.isGroupID == false) { if( self.isGroupID == false) {
@@ -21,7 +21,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, strong) NSDate * msgTime; @property (nonatomic, strong) NSDate * msgTime;
- (void)fillWithData:(DoctiorIDCardCellData *)data; // 绘制 UI - (void)fillWithData:(DoctiorIDCardCellData *)data; // 绘制 UI
//是否可以点击
//@property (nonatomic, assign) bool isClick;
@end @end
@@ -23,7 +23,7 @@
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
// self.isClick = true;
[self createUI]; [self createUI];
} }
@@ -34,18 +34,20 @@
} }
- (NSString *)formatReleaseDate { - (NSString *)formatReleaseDate {
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
dateFormatter.dateFormat = @"yyyy-MM-dd'T'HH:mm:ssZ"; dateFormatter.dateFormat = @"yyyy-MM-dd HH:mm:ss";
NSDate *date = [dateFormatter dateFromString:self.releaseDate];
NSTimeZone* timeZone = [NSTimeZone timeZoneWithName:@"Asia/Shanghai"];
[dateFormatter setTimeZone:timeZone];
dateFormatter.dateFormat = @"yyyy-MM-dd HH:mm";
NSString *releaseDate= [dateFormatter stringFromDate:date];
return releaseDate; NSDate *date = [dateFormatter dateFromString:self.releaseDate];
if (!date) return @"";
dateFormatter.timeZone = [NSTimeZone timeZoneWithName:@"Asia/Shanghai"];
dateFormatter.dateFormat = @"yyyy-MM-dd HH:mm";
return [dateFormatter stringFromDate:date];
} }
- (NSString *)formatFileSizeByMB { - (NSString *)formatFileSizeByMB {
CGFloat fileSizeByMB = ([self.fileSize integerValue] /(1000 *1000)); CGFloat fileSizeByMB = ([self.fileSize integerValue] /(1000 *1000));
@@ -84,7 +84,7 @@
self.titleLabel.textColor = kRGBColor(23, 24, 28); self.titleLabel.textColor = kRGBColor(23, 24, 28);
self.titleLabel.font = [UIFont systemFontOfSize:16.0f];; self.titleLabel.font = [UIFont systemFontOfSize:16.0f];;
self.titleLabel.textAlignment = NSTextAlignmentLeft; self.titleLabel.textAlignment = NSTextAlignmentLeft;
self.titleLabel.text = @"新版本"; self.titleLabel.text = @"发现新版本";
[self.contentView addSubview:self.titleLabel]; [self.contentView addSubview:self.titleLabel];
self.latestVersionLabel = [[UILabel alloc] init]; self.latestVersionLabel = [[UILabel alloc] init];
@@ -111,11 +111,11 @@
[self.contentView addSubview:self.currentVersionLabel]; [self.contentView addSubview:self.currentVersionLabel];
self.updateTimeLabel = [[UILabel alloc] init]; self.updateTimeLabel = [[UILabel alloc] init];
self.updateTimeLabel.textColor = KClearColor; self.updateTimeLabel.textColor = kRGBColor(119, 119, 119);
self.updateTimeLabel.font = [UIFont systemFontOfSize:12.0f]; self.updateTimeLabel.font = [UIFont systemFontOfSize:12.0f];
self.updateTimeLabel.textAlignment = NSTextAlignmentLeft; self.updateTimeLabel.textAlignment = NSTextAlignmentLeft;
// self.updateTimeLabel.text = [NSString stringWithFormat: self.updateTimeLabel.text = [NSString stringWithFormat:
// @"更新时间: %@",self.appInfo.releaseDate]; @"更新时间: %@",self.appInfo.releaseDate];
[self.contentView addSubview:self.updateTimeLabel]; [self.contentView addSubview:self.updateTimeLabel];
self.updateExplainLabel = [[UILabel alloc] init]; self.updateExplainLabel = [[UILabel alloc] init];
@@ -142,11 +142,14 @@
self.confirmButton.titleLabel.font = [UIFont systemFontOfSize:16.0f]; self.confirmButton.titleLabel.font = [UIFont systemFontOfSize:16.0f];
[self.confirmButton setTitleColor:kRGBColor(69, 149, 236) [self.confirmButton setTitleColor:kRGBColor(69, 149, 236)
forState:UIControlStateNormal]; forState:UIControlStateNormal];
[self.confirmButton setTitle:@"立即更新" forState:UIControlStateNormal]; [self.confirmButton setTitle:@"请前往移动平台更新" forState:UIControlStateNormal];
[self addSubview:self.confirmButton]; [self addSubview:self.confirmButton];
[self.confirmButton addTarget:self action:@selector(confirmButtonDidClicked) forControlEvents:UIControlEventTouchUpInside]; [self.confirmButton addTarget:self action:@selector(confirmButtonDidClicked) forControlEvents:UIControlEventTouchUpInside];
if (!self.isCompulsoryUpdate) { if (!self.isCompulsoryUpdate) {
[self.confirmButton setTitle:@"我知道了" forState:UIControlStateNormal];
self.centerLineView = [[UIView alloc] init]; self.centerLineView = [[UIView alloc] init];
self.centerLineView.backgroundColor = kRGBColor(223, 223, 223); self.centerLineView.backgroundColor = kRGBColor(223, 223, 223);
[self addSubview:self.centerLineView]; [self addSubview:self.centerLineView];
@@ -54,7 +54,7 @@
} }
if ([[UIApplication sharedApplication]canOpenURL:[NSURL URLWithString:@"iosamap://"]]){ if ([[UIApplication sharedApplication]canOpenURL:[NSURL URLWithString:@"iosamap://"]]){
NSString *TYurlString = [NSString stringWithFormat:@"iosamap://navi?sourceApplication=%@&backScheme=applicationScheme&poiname=fangheng&poiid=BGVIS&lat=%f&lon=%f&dev=0&style=3", NSString *TYurlString = [NSString stringWithFormat:@"iosamap://navi?sourceApplication=%@&backScheme=applicationScheme&poiname=&poiid=BGVIS&lat=%f&lon=%f&dev=0&style=3",
[LocationDataDic objectForKey:@"toName"], _endCoor.latitude, _endCoor.longitude]; [LocationDataDic objectForKey:@"toName"], _endCoor.latitude, _endCoor.longitude];
NSDictionary *dic = @{@"name": @"高德地图", NSDictionary *dic = @{@"name": @"高德地图",