删除文件

This commit is contained in:
History
2025-07-02 18:36:30 +08:00
parent cc4663206b
commit 4eec6512e7
90 changed files with 605 additions and 11774 deletions
@@ -1,16 +0,0 @@
//
// HQLoginViewController.h
// healthQuestion
//
// Created by xulei on 2022/8/16.
//
#import "HQBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface HQLoginViewController : HQBaseViewController
@end
NS_ASSUME_NONNULL_END
@@ -1,576 +0,0 @@
//
// HQLoginViewController.m
// healthQuestion
//
// Created by xulei on 2022/8/16.
//
#import "HQLoginViewController.h"
#import "TUIC2CChatViewController.h"
#import "LoginFoundPasswordViewController.h"
#import "IMUserInfoModel.h"
#import "RSAObjC.h"
#import "MineCenterUserModel.h"
#import "ADJumpViewController.h"
#import "HQRegisterViewController.h"
#import "LVKeyboard.h"
#import "MQTextField.h"
@interface HQLoginViewController ()<V2TIMSDKListener,V2TIMSDKListener,LVKeyboardDelegate,UITextFieldDelegate>
@property (nonatomic, strong) UITextField * userNameField;
@property (nonatomic, strong) MQTextField * passwordField;
@property (nonatomic, strong) UIButton * logoBtn;
@property (nonatomic, strong) UIView * loginView;
@property (nonatomic, strong) UIButton * privacyPolicyBtn;
@property (nonatomic, strong) UIButton * agreenBtn;
@property (nonatomic, strong) IMUserInfoModel * model ;
@property (nonatomic, strong) NSMutableArray * dataArray;
@property (nonatomic, strong) UIButton * regisBtn;
@property (nonatomic, strong) LVKeyboard *keyboard;
@property (nonatomic, strong) UIButton *toggleButton;
@end
@implementation HQLoginViewController
- (NSMutableArray *)dataArray {
if (!_dataArray) {
_dataArray = [[NSMutableArray alloc] init];
}
return _dataArray;
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.isHidenNaviBar = YES;
self.view.backgroundColor = KWhiteColor;
[self createUI];
[self createData];
// [self ishiderRegisData];
//初始化键盘
LVKeyboard *keyboard = [[LVKeyboard alloc] init];
keyboard.delegate = self;
self.keyboard = keyboard;
}
- (void)createUI {
UIImageView * topBackImg = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kRealValue(243))];
topBackImg.image = IMAGE_NAMED(@"loginTopBimg");
topBackImg.userInteractionEnabled = true;
[self.view addSubview:topBackImg];
UIImageView * cenetrImg = [[UIImageView alloc] initWithFrame:CGRectMake(0, kRealValue(70), kRealValue(68), kRealValue(68))];
cenetrImg.centerX = self.view.centerX;
cenetrImg.image = IMAGE_NAMED(@"login_icon");
cenetrImg.userInteractionEnabled = true;
[self.view addSubview:cenetrImg];
UIButton * homeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
homeBtn.frame = CGRectMake(kRealValue(15), kRealValue(40),kRealValue(100), 41);
[homeBtn setTitle:@"< 去首页" forState:UIControlStateNormal];
[homeBtn.titleLabel setFont:BOLDSYSTEMFONT(14)];
[homeBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[homeBtn addTarget:self action:@selector(backHomeAction) forControlEvents:UIControlEventTouchUpInside];
[topBackImg addSubview:homeBtn];
UIImageView *titleImg = [[UIImageView alloc] initWithFrame:CGRectMake(0, cenetrImg.bottom + kRealValue(20), kRealValue(109), kRealValue(24))];
titleImg.centerX = self.view.centerX;
titleImg.image = IMAGE_NAMED(@"loginTitle_Img");
[self.view addSubview:titleImg];
//
UIView *loginView = [[UIView alloc]init];
loginView.frame = CGRectMake(0, titleImg.bottom + kRealValue(41), kScreenWidth, kScreenHeight - titleImg.bottom - kRealValue(41));
[self.view addSubview:loginView];
loginView.backgroundColor = KWhiteColor;
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:loginView.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(20, 20)];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.path = maskPath.CGPath;
loginView.layer.mask = maskLayer;
self.loginView = loginView;
//
UITextField *accountField = [[UITextField alloc]init];
accountField.frame = CGRectMake(kRealValue(35), kRealValue(36), loginView.width - kRealValue(70), 40);
accountField.placeholder = @"请输入用户名";
accountField.font = BOLDSYSTEMFONT(14);
accountField.textColor = CFontColor1;
self.userNameField = accountField;
self.userNameField.backgroundColor = UIColorHex(#EEEEEE);
self.userNameField.layer.cornerRadius = 20;
self.userNameField.layer.masksToBounds = true;
UIView * leftview = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 20, 40)];
self.userNameField.leftView = leftview;
self.userNameField.leftViewMode = UITextFieldViewModeAlways;
[loginView addSubview:accountField ];
//
//
MQTextField * passwordField = [[MQTextField alloc]init];
passwordField.frame = CGRectMake(kRealValue(35), accountField.bottom + kRealValue(19), accountField.width, accountField.height);
passwordField.placeholder = @"请输入密码";
passwordField.font = BOLDSYSTEMFONT(14);
passwordField.textColor = CFontColor1;
passwordField.backgroundColor = UIColorHex(#EEEEEE);
passwordField.secureTextEntry = YES;
self.passwordField = passwordField;
self.passwordField.leftView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 20, 40)];
self.passwordField.leftViewMode = UITextFieldViewModeAlways;
self.passwordField.layer.cornerRadius = 20;
self.passwordField.layer.masksToBounds = true;
self.passwordField.delegate = self;
self.passwordField.inputView = self.keyboard;
self.toggleButton = [UIButton buttonWithType:UIButtonTypeCustom];
[self.toggleButton setImage:[UIImage imageNamed:@"eye"] forState:UIControlStateNormal];
[self.toggleButton setImage:[UIImage imageNamed:@"eye.slash"] forState:UIControlStateSelected];
self.toggleButton.frame = CGRectMake(0, 5, 30,30);
[self.toggleButton addTarget:self action:@selector(togglePasswordVisibility) forControlEvents:UIControlEventTouchUpInside];
// 创建一个容器视图来包含按钮,并增加边距
UIView *rightView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
[rightView addSubview:self.toggleButton];
// 调整按钮在容器视图中的位置,增加边距
self.toggleButton.center = CGPointMake(rightView.frame.size.width - self.toggleButton.frame.size.width / 2, rightView.frame.size.height / 2);
self.passwordField.rightView = rightView;
self.passwordField.rightViewMode = UITextFieldViewModeAlways;
[loginView addSubview:passwordField];
UIButton *loginBtn = [UIButton buttonWithType:UIButtonTypeCustom];
loginBtn.frame = CGRectMake(kRealValue(35), self.passwordField.bottom + kRealValue(19), WIDTH - kRealValue(70), 41);
[loginBtn setTitle:@"登录" forState:UIControlStateNormal];
[loginBtn.titleLabel setFont:BOLDSYSTEMFONT(14)];
[loginBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[loginBtn setBackgroundImage:[UIImage imageNamed:@"loginBtn_img"] forState:UIControlStateNormal];
[loginBtn addTarget:self action:@selector(toClickFootBtn:) forControlEvents:UIControlEventTouchUpInside];
[loginView addSubview:loginBtn];
UIButton * foundPasswordBtn = [UIButton buttonWithType:UIButtonTypeCustom];
foundPasswordBtn.frame = CGRectMake(kRealValue(35), loginBtn.bottom + kRealValue(10), WIDTH - kRealValue(70), 20);
[foundPasswordBtn setTitle:@"找回密码" forState:UIControlStateNormal];
foundPasswordBtn.titleLabel.font = MEDIUMFONT(14);
[foundPasswordBtn setTitleColor:UIColorHex(#999999) forState:UIControlStateNormal];
[foundPasswordBtn addTarget:self action:@selector(foundUserPasswordAction) forControlEvents:UIControlEventTouchUpInside];
[loginView addSubview:foundPasswordBtn];
UIButton * regisBtn = [UIButton buttonWithType:UIButtonTypeCustom];
regisBtn.frame = CGRectMake(kRealValue(35), foundPasswordBtn.bottom + kRealValue(20), kScreenWidth - kRealValue(70), 20);
[regisBtn setTitle:@"注册" forState:UIControlStateNormal];
self.regisBtn = regisBtn;
regisBtn.titleLabel.font = MEDIUMFONT(14);
self.regisBtn.hidden = true;
[regisBtn setTitleColor:UIColorHex(#999999) forState:UIControlStateNormal];
[regisBtn addTarget:self action:@selector(regisAction) forControlEvents:UIControlEventTouchUpInside];
[loginView addSubview:regisBtn];
[[NSUserDefaults standardUserDefaults] setObject:@"1" forKey:@"LOGINAgree"];
[[NSUserDefaults standardUserDefaults] synchronize];
NSUserDefaults * agreeDefaul = [NSUserDefaults standardUserDefaults];
NSString * agree = [agreeDefaul objectForKey:@"LOGINAgree"];
self.agreenBtn = [UIButton buttonWithType:UIButtonTypeCustom];
self.agreenBtn.frame = CGRectMake(kRealValue(28), self.view.bottom - kRealValue(45) - SafetyAreaHeight, kRealValue(20), kRealValue(20));
[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];
//隐私
YYLabel * yslabel = [[YYLabel alloc] initWithFrame:CGRectMake(self.agreenBtn.right + kRealValue(5) ,self.agreenBtn.top , kScreenWidth - self.agreenBtn.right - kRealValue(47), 20)];
[self.view addSubview:yslabel];
yslabel.numberOfLines = 0;
NSString *string = @"已阅读并同意《用户协议》、《隐私政策》";
NSMutableAttributedString *attributed = [[NSMutableAttributedString alloc] initWithString:string];
[attributed setAttribute:NSForegroundColorAttributeName value:UIColorHex(#3390FF) range:[string rangeOfString:@"《用户协议》"]];
[attributed setAttribute:NSForegroundColorAttributeName value:UIColorHex(#3390FF) range:[string rangeOfString:@"《隐私政策》"]];
// [attributed setAttribute:NSForegroundColorAttributeName value:UIColorHex(#3390FF) range:[string rangeOfString:@"《相关法律说明》"]];
YYTextHighlight * protocolHightlight = [[YYTextHighlight alloc] init];
protocolHightlight.userInfo = @{@"协议":@"《用户协议》"};
[protocolHightlight setColor:UIColorHex(#3390FF)];
[attributed setTextHighlight:protocolHightlight range:[string rangeOfString:@"《用户协议》"]];
YYTextHighlight * layHightlight = [[YYTextHighlight alloc] init];
layHightlight.userInfo = @{@"隐私":@"《隐私政策》"};
[layHightlight setColor:UIColorHex(#3390FF)];
[attributed setTextHighlight:layHightlight range:[string rangeOfString:@"《隐私政策》"]];
//
// YYTextHighlight * shuoHightlight = [[YYTextHighlight alloc] init];
// shuoHightlight.userInfo = @{@"说明":@"《相关法律说明》"};
// [shuoHightlight setColor:UIColorHex(#3390FF)];
// [attributed setTextHighlight:shuoHightlight range:[string rangeOfString:@"《相关法律说明》"]];
attributed.lineSpacing = 3;
attributed.paragraphSpacing = 5;
yslabel.attributedText = attributed;
yslabel.highlightTapAction = ^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
NSString *string = [text.string substringWithRange:range];
if ([string containsString:@"用户协议"]){
if (self.dataArray.count <= 0) {
[EasyTextView showErrorText:@"暂无用户协议"];
return;
}
for (MineCenterUserModel * model in self.dataArray) {
if ([model.value integerValue] == 1) {
ADJumpViewController * webVC= [[ADJumpViewController alloc] init];
webVC.webTitle = @"用户协议";
webVC.webUrl = [NSString stringWithFormat:@"%@%@",IntervenH5,model.text];
[self.navigationController pushViewController:webVC animated:YES];
}
}
}
if ([string containsString:@"隐私政策"]){
if (self.dataArray.count <= 0) {
[EasyTextView showErrorText:@"暂无隐私政策"];
return;
}
for (MineCenterUserModel * model in self.dataArray) {
if ([model.value integerValue] == 2) {
ADJumpViewController * webVC= [[ADJumpViewController alloc] init];
webVC.webTitle = @"隐私政策";
webVC.webUrl = [NSString stringWithFormat:@"%@%@",IntervenH5,model.text];
[self.navigationController pushViewController:webVC animated:YES];
}
}
}
if ([string containsString:@"相关法律说明"]){
for (MineCenterUserModel * model in self.dataArray) {
if ([model.value integerValue] == 3) {
ADJumpViewController * webVC= [[ADJumpViewController alloc] init];
webVC.webTitle = @"相关法律说明";
webVC.webUrl = [NSString stringWithFormat:@"%@%@",IntervenH5,model.text];
[self.navigationController pushViewController:webVC animated:YES];
}
}
}
};
}
- (void)createData {
JKCQAPI * agreeAPI = [[JKCQAPI alloc] init:self tag:@"AGREEAPI" NeedToken:@""];
[agreeAPI getUserAgreementPrivacy:nil];
}
#pragma mark - ACTION
- (void)toClickFootBtn:(UIButton *)button{
if (self.agreenBtn.selected == false) {
[EasyTextView showErrorText:@"请选阅读并同意用户服务协议与隐私"];
return;;
}
if (self.userNameField.text.length < 1) {
[EasyTextView showErrorText:@"请输入用户名"];
return;;
}
if (self.passwordField.text.length < 12 || self.passwordField.text.length > 32) {
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) {
LoginFoundPasswordViewController * modifVC = [[LoginFoundPasswordViewController alloc] init];
[self.navigationController pushViewController:modifVC animated:YES];
}];
[alertController addAction:cancelAction];
[alertController addAction:sureAction];
[self presentViewController:alertController animated:YES completion:nil];
return;;
}
if (self.passwordField.text.length < 1) {
[EasyTextView showErrorText:@"请输入密码"];
return;;
}
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"];
JKCQAPI * proctocolApi = [[JKCQAPI alloc] init:self tag:@"LOGINGAPI" NeedToken:nil];
[proctocolApi PostLogin:parmDic];
//
// NSString * userSig = @"";
// if ([self.userNameField.text isEqual:@"111"]) {
//
// userSig = @"eAEtzMsKgkAUBuB3OdtCzow2N3CTiZs01F4gcmpOkYgjUUTvnjhtv--ygeO*jXx3Pw0DdWBYgig1l1ytl2Sih51VSLHhUqgkqKcrGGhjXZZFvap2mTvnLneHbXOrG1k5XcT4Vk1Bo2Uq471PIQzta5gNjMBEIQZ72nE*4xH*O9TZfqILLcwYg*8PBAYuZw__";
// }else {
// userSig = @"eAEtzLsOgjAUBuB36arB9gR6gMSBQV0g0UBwcTFpK0esaQARY3x3iXX9-subVXkZ9Ko9O0eKpSLkHBNAiJe-ZCCrZ5UoI0CUodeeLixl1xticRRCtmbf2M0z2dVVsS2jCbKHMK-Tyo1NVotykdvDmvmlnhx186PkYcy5t1F38xsE-N8hpe8DGfIMwD5fblkvWg__";
// }
//
// [ESCTUIManager loginInitTUISDKUserID:self.userNameField.text userSig:userSig];
//
//
}
#pragma mark -网络请求处理
- (void)Failed:(NSString*)message tag:(NSString*)tag
{
[self hiddenAllMBProgressHUD];
[self showMBProgressHUDOnlyWithString:message];
}
- (void)Sucess:(id)response tag:(NSString*)tag
{
if ([tag isEqualToString:@"LOGINGAPI"]) {
[self hiddenAllMBProgressHUD];
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"AVATAR"];
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"placeholdImg"];
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];
NSString * avatar = @"";
NSString * placeholdImg ;
if (!ValidStr(user.avatar)) {
avatar = user.avatar;
}else
{
if ([user.sex_dictText isEqualToString:@""]) {
placeholdImg = @"heard_man";
}else
{
placeholdImg = @"heard_woman";
}
}
if (ValidStr(user.personType) || [user.personType intValue] != 1 ) {
[self showMBProgressHUDOnlyWithString:@"账号或登录密码错误,请重试"];
return;
}
[[NSUserDefaults standardUserDefaults] setObject:avatar forKey:@"AVATAR"];
[[NSUserDefaults standardUserDefaults] setObject:placeholdImg forKey:@"placeholdImg"];
[[NSUserDefaults standardUserDefaults] synchronize];
KPostNotification(KNotificationLoginStateChange, @YES);
//登录im
[self loginImAccount];
}
if ([tag isEqualToString:@"IMAPI"]) {
NSDictionary * pamrDic = response;
IMUserInfoModel * model = [IMUserInfoModel modelWithDictionary:pamrDic];
IMUserInfoModel * iminfoModel = [[IMUserInfoModel alloc] init];
iminfoModel.IMInfo = pamrDic;
[HQCommonUtils keyedArchiverWithData:iminfoModel key:IMLoginUserInfo];
// 1. 从即时通信 IM 控制台获取应用 SDKAppID。
// 2. 初始化 config 对象
V2TIMSDKConfig *config = [[V2TIMSDKConfig alloc] init];
// 3. 指定 log 输出级别。
config.logLevel = V2TIM_LOG_INFO;
// 4. 添加 V2TIMSDKListener 的事件监听器,self 是 id<V2TIMSDKListener> 的实现类,如果您不需要监听 IM SDK 的事件,这个步骤可以忽略。
[[V2TIMManager sharedInstance] addIMSDKListener:self];
// 5. 初始化 IM SDK,调用这个接口后,可以立即调用登录接口。
[[V2TIMManager sharedInstance] initSDK:[model.sdkAppId intValue] config:config];
[ESCTUIManager loginInitTUISDKAppidWith:[model.sdkAppId intValue] UserID:model.userId userSig:model.userSig];
}
if ([tag isEqualToString:@"AGREEAPI"]) {
NSArray * array = response;
for (NSDictionary * parmDic in array) {
MineCenterUserModel * model = [MineCenterUserModel modelWithDictionary:parmDic];
https://api.cqygjk.com/health-consultation/api/consult/conDoctor/selectDictList?dictKey=qh_jump_url
[self.dataArray addObject:model];
}
}
if ([tag isEqualToString:@"VERSIONAPI"]) {
NSString * version = response;
NSBundle *mainBundle = [NSBundle mainBundle];
if (mainBundle) {
NSString *version = [mainBundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
// NSString *build = [mainBundle objectForInfoDictionaryKey:@"CFBundleVersion"];
// NSString *displayName = [mainBundle objectForInfoDictionaryKey:@"CFBundleDisplayName"];
// NSString *fullVersion = [NSString stringWithFormat:@"%@ %@ (Build %@)", displayName, version, build];
if([version floatValue] < [version floatValue]) {
self.regisBtn.hidden = true;
}else
{
self.regisBtn.hidden = false;
}
}
}
}
- (void)backHomeAction {
KPostNotification(KNotificationLoginStateChange, @YES);
}
- (void)loginImAccount {
JKCQAPI * proctocolApi = [[JKCQAPI alloc] init:self tag:@"IMAPI" NeedToken:nil];
[proctocolApi GetIMLoginAccount:nil];
}
//建议整体禁用(复制、粘贴、全选等都被禁用了)
-(BOOL)canPerformAction:(SEL)action withSender:(id)sender{
UIMenuController *menuController = [UIMenuController sharedMenuController];
if (menuController) {
[UIMenuController sharedMenuController].menuVisible = NO;
}
return NO;
}
- (void)agreeProtocolAction:(UIButton *)agreeBtn {
agreeBtn.selected = !agreeBtn.selected;
}
#pragma mark:找回密码
- (void)foundUserPasswordAction {
// GastoremteroscopeViewController * resultAppointVC = [[GastoremteroscopeViewController alloc] init];
// [self.navigationController pushViewController:resultAppointVC animated:YES];
LoginFoundPasswordViewController * foundVC = [[LoginFoundPasswordViewController alloc] init];
[self.navigationController pushViewController:foundVC animated:YES];
}
- (void)ishiderRegisData {
JKCQAPI * versionAPI = [[JKCQAPI alloc] init:self tag:@"VERSIONAPI" NeedToken:@""];
[versionAPI getVesionHideRegis:@{@"type":@"app_update_user_ios"}.mutableCopy];
}
#pragma mark:注册
- (void)regisAction {
HQRegisterViewController * forgetVc = [[HQRegisterViewController alloc] init];
[self presentViewController:forgetVc animated:YES completion:nil];
}
-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField {
if(textField == self.passwordField) {
self.passwordField.inputView = self.keyboard;
}
return YES;
}
- (void)keyboard:(LVKeyboard *)keyboard didClickDeleteButton:(UIButton *)deleteBtn string:(NSMutableString *)string {
self.passwordField.text = string;
}
- (void)keyboard:(LVKeyboard *)keyboard didClickTextButton:(UIButton *)textBtn string:(NSMutableString *)string {
self.passwordField.text = string;
}
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
[self.passwordField resignFirstResponder];
}
- (void)togglePasswordVisibility {
self.passwordField.secureTextEntry = !self.passwordField.secureTextEntry;
self.toggleButton.selected = !self.toggleButton.selected;
}
@end
@@ -1,16 +0,0 @@
//
// LoginFoundPasswordViewController.h
// EscortProject
//
// Created by 仁康信息 on 2023/5/22.
//
#import "HQBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface LoginFoundPasswordViewController : HQBaseViewController
@end
NS_ASSUME_NONNULL_END
@@ -1,211 +0,0 @@
//
// LoginFoundPasswordViewController.m
// EscortProject
//
// Created by 仁康信息 on 2023/5/22.
//
#import "LoginFoundPasswordViewController.h"
#import "LoginSetPasswordViewController.h"
#import "LVKeyboard.h"
#import "MQTextField.h"
@interface LoginFoundPasswordViewController ()<LVKeyboardDelegate,UITextFieldDelegate>
@property (nonatomic, strong)UITextField * nameTextFild;
@property (nonatomic, strong)UITextField * phoneTextFild;
@property (nonatomic, strong)MQTextField * codeTextFild;
@property (nonatomic, strong)UIButton * codeButton;
@property (nonatomic, strong) LVKeyboard *keyboard;
@end
@implementation LoginFoundPasswordViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.isHidenNaviBar = false;
self.navigationItem.title = @"修改密码";
// Do any additional setup after loading the view.
self.view.backgroundColor = UIColorHex(#E0E0E0);
[self createUI];
}
- (void)createUI {
//初始化键盘
LVKeyboard *keyboard = [[LVKeyboard alloc] init];
keyboard.delegate = self;
self.keyboard = keyboard;
UIView * topView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kRealValue(151))];
topView.backgroundColor = KWhiteColor;
[self.view addSubview:topView];
UIView * nameLeft = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 112, kRealValue(50))];
UILabel * nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, 0, 80, kRealValue(50))];
nameLabel.text = @"用户姓名";
nameLabel.textAlignment = NSTextAlignmentLeft;
nameLabel.font = SYSTEMFONT(13);
nameLabel.textColor = UIColorHex(#666666);
[nameLeft addSubview:nameLabel];
self.nameTextFild = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kRealValue(50))];
self.nameTextFild.placeholder = @"请输入用户姓名";
self.nameTextFild.returnKeyType = UIReturnKeyDone;
self.nameTextFild.font = [UIFont systemFontOfSize:14];
self.nameTextFild.backgroundColor = KWhiteColor;
self.nameTextFild.leftView = nameLeft;
self.nameTextFild.leftViewMode = UITextFieldViewModeAlways;
self.nameTextFild.font = SYSTEMFONT(14);
[topView addSubview:self.nameTextFild];
UIView * linv = [[UIView alloc] initWithFrame:CGRectMake(16, self.nameTextFild.bottom, kScreenWidth - 32, 1)];
linv.backgroundColor = UIColorHex(#E0E0E0);
[topView addSubview:linv];
UIView * codeLeft = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 112, kRealValue(50))];
UILabel * codeLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, 0, 90, kRealValue(50))];
codeLabel.text = @"身份证号";
codeLabel.textAlignment = NSTextAlignmentLeft;
codeLabel.font = SYSTEMFONT(13);
codeLabel.textColor = UIColorHex(#666666);
[codeLeft addSubview:codeLabel];
self.codeTextFild = [[MQTextField alloc] initWithFrame:CGRectMake(0, self.nameTextFild.bottom+1, kScreenWidth, kRealValue(50))];
self.codeTextFild.placeholder = @"请输入用户身份证号";
self.codeTextFild.font = [UIFont systemFontOfSize:14];
self.codeTextFild.backgroundColor = KWhiteColor;
self.codeTextFild.inputView = self.keyboard;
self.codeTextFild.delegate = self;
self.codeTextFild.leftView = codeLeft;
self.codeTextFild.leftViewMode = UITextFieldViewModeAlways;
[topView addSubview:self.codeTextFild];
UIView * linvCard = [[UIView alloc] initWithFrame:CGRectMake(16, self.codeTextFild.bottom, kScreenWidth - 32, 1)];
linvCard.backgroundColor = UIColorHex(#E0E0E0);
[topView addSubview:linvCard];
UIView * phoneLeft = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 112, kRealValue(50))];
UILabel * phoneLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, 0, 90, kRealValue(50))];
phoneLabel.text = @"手机号";
phoneLabel.textAlignment = NSTextAlignmentLeft;
phoneLabel.font = SYSTEMFONT(13);
phoneLabel.textColor = UIColorHex(#666666);
[phoneLeft addSubview:phoneLabel];
self.phoneTextFild = [[UITextField alloc] initWithFrame:CGRectMake(0, self.codeTextFild.bottom+1, kScreenWidth, kRealValue(50))];
self.phoneTextFild.placeholder = @"请输入用户手机号";
self.phoneTextFild.font = [UIFont systemFontOfSize:14];
self.phoneTextFild.backgroundColor = KWhiteColor;
self.phoneTextFild.leftView = phoneLeft;
self.phoneTextFild.keyboardType = UIKeyboardTypeNumberPad;
self.phoneTextFild.leftViewMode = UITextFieldViewModeAlways;
[topView addSubview:self.phoneTextFild];
UIView * phoneLinv = [[UIView alloc] initWithFrame:CGRectMake(16, self.phoneTextFild.bottom, kScreenWidth - 32, 1)];
phoneLinv.backgroundColor = UIColorHex(#E0E0E0);
[topView addSubview:phoneLinv];
UIButton * loginBtn = [[UIButton alloc] initWithFrame:CGRectMake(48,self.phoneTextFild.bottom+58, kScreenWidth-96, 48)];
[loginBtn setTitle:@"确定" forState:UIControlStateNormal ];
loginBtn.titleLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:14];
[loginBtn setBackgroundColor:UIColorHex(#21BEBD)];
loginBtn.layer.cornerRadius = 20;
loginBtn.layer.masksToBounds = true;
[loginBtn setTitleColor:KWhiteColor forState:UIControlStateNormal];
[loginBtn addTarget:self action:@selector(sureFoundAction) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:loginBtn];
}
#pragma mark - 确定点击
- (void)sureFoundAction {
if (ValidStr(self.nameTextFild.text)) {
[EasyTextView showErrorText:@"请输入用户姓名"];
return;
}
if (ValidStr(self.codeTextFild.text)) {
[EasyTextView showErrorText:@"请输入用户身份证号"];
return;
}
if (ValidStr(self.phoneTextFild.text)) {
[EasyTextView showErrorText:@"请输入用户手机号"];
return;
}
[self showMBProgressHUDWithString:@"信息验证中,请稍候..." autoHidden:false];
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:self.nameTextFild.text forKey:@"realname"];
[parmDic setObject:self.codeTextFild.text forKey:@"idCard"];
[parmDic setObject:self.phoneTextFild.text forKey:@"phone"];
JKCQAPI * chageApi = [[JKCQAPI alloc] init:self tag:@"CHANGEAPI" NeedToken:@""];
[chageApi postSetUserPassword:parmDic];
}
#pragma mark -网络请求处理
- (void)Failed:(NSString*)message tag:(NSString*)tag
{
[self showMBProgressHUDOnlyWithString:message];
[self hiddenAllMBProgressHUD];
}
- (void)Sucess:(id)response tag:(NSString*)tag
{
if ([tag isEqualToString:@"CHANGEAPI"]) {
[self hiddenAllMBProgressHUD];
NSString * result = response;
LoginSetPasswordViewController * password = [[LoginSetPasswordViewController alloc] init];
password.result = result;
[self.navigationController pushViewController:password animated:YES];
}
}
-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField {
if(textField == self.codeTextFild) {
self.codeTextFild.inputView = self.keyboard;
}
return YES;
}
- (void)keyboard:(LVKeyboard *)keyboard didClickDeleteButton:(UIButton *)deleteBtn string:(NSMutableString *)string {
self.codeTextFild.text = string;
}
- (void)keyboard:(LVKeyboard *)keyboard didClickTextButton:(UIButton *)textBtn string:(NSMutableString *)string {
self.codeTextFild.text = string;
}
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
[self.codeTextFild resignFirstResponder];
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
@@ -1,18 +0,0 @@
//
// LoginSetPasswordViewController.h
// EscortProject
//
// Created by 仁康信息 on 2023/5/22.
//
#import "HQBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface LoginSetPasswordViewController : HQBaseViewController
@property (nonatomic, copy) NSString * result;
@end
NS_ASSUME_NONNULL_END
@@ -1,229 +0,0 @@
//
// LoginSetPasswordViewController.m
// EscortProject
//
// Created by 仁康信息 on 2023/5/22.
//
#import "LoginSetPasswordViewController.h"
#import "RSAObjC.h"
#import "HQLoginViewController.h"
@interface LoginSetPasswordViewController ()
@property (nonatomic, strong) UITextField * phoneTextFild;
@property (nonatomic, strong) UITextField * codeTextFild;
@property (nonatomic, strong) UIButton * toggleButton;
@property (nonatomic, strong) UIButton * suretoggleButton;
@end
@implementation LoginSetPasswordViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.isHidenNaviBar = false;
self.navigationItem.title = @"设置密码";
self.view.backgroundColor = UIColorHex(#EFEFEF);
[self createUI];
}
- (void)createUI {
UIView * topView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kRealValue(100))];
topView.backgroundColor = KWhiteColor;
[self.view addSubview:topView];
UIView * phoneLeft = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 112, kRealValue(50))];
UILabel * phoneLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, 0, 80, kRealValue(50))];
phoneLabel.text = @"新密码";
phoneLabel.textAlignment = NSTextAlignmentLeft;
phoneLabel.font = SYSTEMFONT(13);
phoneLabel.textColor = UIColorHex(#666666);
[phoneLeft addSubview:phoneLabel];
self.phoneTextFild = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kRealValue(50))];
self.phoneTextFild.placeholder = @"请输入新密码";
self.phoneTextFild.returnKeyType = UIReturnKeyDone;
self.phoneTextFild.font = [UIFont systemFontOfSize:14];
self.phoneTextFild.backgroundColor = KWhiteColor;
self.phoneTextFild.leftView = phoneLeft;
self.phoneTextFild.secureTextEntry = YES;
self.phoneTextFild.leftViewMode = UITextFieldViewModeAlways;
self.phoneTextFild.font = SYSTEMFONT(14);
[self.view addSubview:self.phoneTextFild];
self.toggleButton = [UIButton buttonWithType:UIButtonTypeCustom];
[self.toggleButton setImage:[UIImage imageNamed:@"eye"] forState:UIControlStateNormal];
[self.toggleButton setImage:[UIImage imageNamed:@"eye.slash"] forState:UIControlStateSelected];
self.toggleButton.frame = CGRectMake(0, 5, 30,30);
[self.toggleButton addTarget:self action:@selector(togglePasswordVisibility) forControlEvents:UIControlEventTouchUpInside];
// 创建一个容器视图来包含按钮,并增加边距
UIView *rightView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
[rightView addSubview:self.toggleButton];
// 调整按钮在容器视图中的位置,增加边距
self.toggleButton.centerX = rightView.centerX;
self.toggleButton.center = CGPointMake(rightView.frame.size.width - self.toggleButton.frame.size.width / 2, rightView.frame.size.height / 2);
self.phoneTextFild.rightView = rightView;
self.phoneTextFild.rightViewMode = UITextFieldViewModeAlways;
UIView * linv = [[UIView alloc] initWithFrame:CGRectMake(16, self.phoneTextFild.bottom, kScreenWidth - 32, 1)];
linv.backgroundColor = UIColorHex(#E0E0E0);
[self.view addSubview:linv];
UIView * codeLeft = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 112, kRealValue(50))];
UILabel * codeLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, 0, 90, kRealValue(50))];
codeLabel.text = @"确认密码";
codeLabel.textAlignment = NSTextAlignmentLeft;
codeLabel.font = SYSTEMFONT(13);
codeLabel.textColor = UIColorHex(#666666);
[codeLeft addSubview:codeLabel];
self.codeTextFild = [[UITextField alloc] initWithFrame:CGRectMake(0, self.phoneTextFild.bottom+1, kScreenWidth, kRealValue(50))];
self.codeTextFild.placeholder = @"请输入新密码";
self.codeTextFild.font = [UIFont systemFontOfSize:14];
self.codeTextFild.backgroundColor = KWhiteColor;
self.codeTextFild.leftView = codeLeft;
self.codeTextFild.secureTextEntry = YES;
self.codeTextFild.leftViewMode = UITextFieldViewModeAlways;
[self.view addSubview:self.codeTextFild];
self.suretoggleButton = [UIButton buttonWithType:UIButtonTypeCustom];
[self.suretoggleButton setImage:[UIImage imageNamed:@"eye"] forState:UIControlStateNormal];
[self.suretoggleButton setImage:[UIImage imageNamed:@"eye.slash"] forState:UIControlStateSelected];
self.suretoggleButton.frame = CGRectMake(0, 5, 30,30);
[self.suretoggleButton addTarget:self action:@selector(sureTogglePasswordVisibility) forControlEvents:UIControlEventTouchUpInside];
// 创建一个容器视图来包含按钮,并增加边距
UIView *coderightView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
[coderightView addSubview:self.suretoggleButton];
// 调整按钮在容器视图中的位置,增加边距
self.suretoggleButton.centerX = coderightView.centerX;
self.codeTextFild.rightView = coderightView;
self.codeTextFild.rightViewMode = UITextFieldViewModeAlways;
UILabel * passwordLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(15), topView.bottom + kRealValue(8) , kScreenWidth - kRealValue(30), 42)];
passwordLabel.textColor = UIColorHex(#666666);
passwordLabel.text = @"温馨提示:密码需要为12-32位(包含数字、大写、小写字母、特殊字符)";
passwordLabel.numberOfLines = 2;
passwordLabel.font =MEDIUMFONT(14);
[passwordLabel sizeToFit];
// NSMutableAttributedString * attString = [HQCommonUtils firstString:@"请为您的账号" firstColor:UIColorHex(#666666) firstSize:14 secondString:@"zhangsan" secondColor:UIColorHex(#333333) secondSize:14 thirdString:@"设置一个新密码" thirdColor:UIColorHex(#666666) thirdSize:14];
// passwordLabel.attributedText = attString ;
// passwordLabel.textAlignment = NSTextAlignmentCenter;
// [topView addSubview:passwordLabel];
[self.view addSubview:passwordLabel];
UIButton * loginBtn = [[UIButton alloc] initWithFrame:CGRectMake(48,passwordLabel.bottom+58, kScreenWidth-96, 48)];
[loginBtn setTitle:@"确定" forState:UIControlStateNormal ];
loginBtn.titleLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:14];
[loginBtn setBackgroundColor:UIColorHex(#21BEBD)];
loginBtn.layer.cornerRadius = 20;
loginBtn.layer.masksToBounds = true;
[loginBtn setTitleColor:KWhiteColor forState:UIControlStateNormal];
[loginBtn addTarget:self action:@selector(sureFoundAction) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:loginBtn];
}
#pragma mark:重新设置密码
- (void)sureFoundAction {
[self.phoneTextFild resignFirstResponder];
[self.codeTextFild resignFirstResponder];
if (ValidStr(self.phoneTextFild.text) || ValidStr(self.codeTextFild.text)) {
[EasyTextView showErrorText:@"请输入新密码"];
return;
}
if (isValidPassword(self.phoneTextFild.text)) {
} else {
[EasyTextView showErrorText:@"请按照密码规则,请重新输入"];
return;
}
if ( ![self.phoneTextFild.text isEqualToString:self.codeTextFild.text]) {
[EasyTextView showErrorText:@"两次输入密码不一致,请重新输入"];
return;
}
NSString * publish_key = @" MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCmZfR/bA9X3vp86y1aEpvwzXJYKRRF1fLau2+05/ZtaITLpV8bhkmSf3neSy/Q9gAdvG75Fr73E+GWE+K5b0BpvIS1jDGo319+PpZR39SaZTKZ27XFXrosmJTZutN79t819HS1VseleunHAFgMVufE9U5jP6LGzl/wbkSy01GhzwIDAQAB";
// 原始数据,要加密的字符串
NSString *originalString = self.phoneTextFild.text;
// RSA 加密,使用字符串格式的公钥私钥加密解密, RSAPublickKey 为公钥字符串(NSString 格式)
NSString *encryptStr = [RSAObjC encrypt:originalString PublicKey:publish_key];
[self showMBProgressHUDWithString:@"密码重置中,请稍候..." autoHidden:false];
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:encryptStr forKey:@"newPassword"];
[parmDic setObject:encryptStr forKey:@"newPasswordConfirm"];
[parmDic setObject:self.result forKey:@"resetCode"];
JKCQAPI * chageApi = [[JKCQAPI alloc] init:self tag:@"CHANGEAPI" NeedToken:@""];
[chageApi postResetUserNewPassword:parmDic];
}
BOOL isValidPassword(NSString *password) {
// 定义正则表达式
NSString *pattern = @"^(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*(),.?\":{}|<>]).{12,32}$";
// 创建NSPredicate对象
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", pattern];
// 使用NSPredicate对象进行判断
return [predicate evaluateWithObject:password];
}
#pragma mark -网络请求处理
- (void)Failed:(NSString*)message tag:(NSString*)tag
{
[self showMBProgressHUDOnlyWithString:message];
[self hiddenAllMBProgressHUD];
}
- (void)Sucess:(id)response tag:(NSString*)tag
{
if ([tag isEqualToString:@"CHANGEAPI"]) {
[self hiddenAllMBProgressHUD];
[self.navigationController popToRootViewControllerAnimated:YES];
[self showMBProgressHUDOnlyWithString:response];
}
}
- (void)togglePasswordVisibility {
self.phoneTextFild.secureTextEntry = !self.phoneTextFild.secureTextEntry;
self.toggleButton.selected = !self.toggleButton.selected;
}
- (void)sureTogglePasswordVisibility {
self.codeTextFild.secureTextEntry = !self.codeTextFild.secureTextEntry;
self.suretoggleButton.selected = !self.suretoggleButton.selected;
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
@@ -1,16 +0,0 @@
//
// HQRegisterViewController.h
// healthQuestion
//
// Created by xulei on 2022/8/17.
//
#import "HQBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface HQRegisterViewController : HQBaseViewController
@end
NS_ASSUME_NONNULL_END
@@ -1,264 +0,0 @@
//
// HQRegisterViewController.m
// healthQuestion
//
// Created by xulei on 2022/8/17.
//
#import "HQRegisterViewController.h"
#import "ADJumpViewController.h"
#import "MineCenterUserModel.h"
@interface HQRegisterViewController ()<UITextFieldDelegate>
@property (nonatomic, strong)UITextField * phoneTextField;
@property (nonatomic, strong)UITextField * codeTextField;
@property (nonatomic, strong)UITextField * passwordTextField;
@property (nonatomic, strong)UITextField * surePasswordTextField;
@property (nonatomic, strong)UITextField * inviteCodeTextField;
@property (nonatomic, strong)UIButton * protocolBtn;
@property (nonatomic, strong)UIButton * codeButton;
@property (nonatomic, copy)NSString * protocolString;
@end
@implementation HQRegisterViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.isHidenNaviBar = YES;
self.StatusBarStyle = UIStatusBarStyleDefault;
self.view.backgroundColor = CViewBgColor;
[self createUI];
[self getUserProtocol];
}
- (void)createUI
{
UIImageView * topBackImg = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kRealValue(243))];
topBackImg.image = IMAGE_NAMED(@"loginTopBimg");
[self.view addSubview:topBackImg];
UIImageView * cenetrImg = [[UIImageView alloc] initWithFrame:CGRectMake(0, kRealValue(70), kRealValue(68), kRealValue(68))];
cenetrImg.centerX = self.view.centerX;
cenetrImg.image = IMAGE_NAMED(@"login_icon");
[self.view addSubview:cenetrImg];
UIImageView *titleImg = [[UIImageView alloc] initWithFrame:CGRectMake(0, cenetrImg.bottom + kRealValue(20), kRealValue(109), kRealValue(24))];
titleImg.centerX = self.view.centerX;
titleImg.image = IMAGE_NAMED(@"loginTitle_Img");
[self.view addSubview:titleImg];
UIButton * leftButton = [[UIButton alloc] initWithFrame:CGRectMake(11, 40, 20, 20)];
[leftButton setImage:[UIImage imageNamed:@"close_Icon"] forState:UIWindowLevelNormal];
[leftButton addTarget:self action:@selector(leftBtnClick) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:leftButton];
UIView * connetView = [[UIView alloc] init];
connetView.frame = CGRectMake(0, topBackImg.bottom+1, kScreenWidth, 200);
connetView.backgroundColor = [UIColor whiteColor];
[self.view addSubview:connetView];
self.phoneTextField = [self createTextFieldWithFrame:CGRectMake(10, 0, kScreenWidth-20, 50) placeholder:@"请输入账户名" passWord:NO leftImageView:nil rightImageView:nil Font:14];
self.phoneTextField.delegate =self;
self.phoneTextField.keyboardType = UIKeyboardTypeNumberPad;
[connetView addSubview:self.phoneTextField];
self.passwordTextField = [self createTextFieldWithFrame:CGRectMake(10, self.phoneTextField.bottom+1, kScreenWidth-20, 50) placeholder:@"请输入密码(6-20位)" passWord:NO leftImageView:nil rightImageView:nil Font:14];
self.passwordTextField.secureTextEntry = YES;
self.passwordTextField.delegate =self;
[connetView addSubview:self.passwordTextField];
//平台协议
UIButton * protocolBtn = [[UIButton alloc] initWithFrame:CGRectMake(10, connetView.bottom+9, 20, 20)];
[protocolBtn setImage:IMAGE_NAMED(@"login_nomalProtocol") forState:UIControlStateNormal];
[protocolBtn setImage:IMAGE_NAMED(@"login_selectProtocol") forState:UIControlStateSelected];
protocolBtn.selected = NO;
[protocolBtn addTarget:self action:@selector(agreeProtocol:) forControlEvents:UIControlEventTouchUpInside];
self.protocolBtn = protocolBtn;
[self.view addSubview:protocolBtn];
UILabel * contentTitle = [[UILabel alloc] initWithFrame:CGRectMake(protocolBtn.right+5,connetView.bottom+9, 300, 20)];
NSString *text = @"我已阅读并同意《健康咨询员工端使用协议》";
NSMutableAttributedString *attributeStr = [[NSMutableAttributedString alloc]initWithString:text];
[attributeStr addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:50/255.0 green:170/255.0 blue:223/255.0 alpha:1] range:NSMakeRange(7, text.length - 7)];
contentTitle.attributedText = attributeStr;
contentTitle.textAlignment = NSTextAlignmentLeft;
contentTitle.font = [UIFont systemFontOfSize:12];
contentTitle.userInteractionEnabled = YES;
UITapGestureRecognizer * tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tap)];
[contentTitle addGestureRecognizer:tapRecognizer];
[self.view addSubview:contentTitle];
UIButton * loginBtn = [[UIButton alloc] initWithFrame:CGRectMake(10, self.surePasswordTextField.bottom+140, kScreenWidth-20, 44)];
loginBtn.mj_y = self.protocolBtn.bottom+25;
[loginBtn setTitle:@"注册" forState:UIControlStateNormal ];
loginBtn.tag = 100;
loginBtn.titleLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:16];
[loginBtn setBackgroundImage:[UIImage imageNamed:@"loginBtn_img"] forState:UIControlStateNormal];
[loginBtn setTitleColor:UIColorTitle1 forState:UIControlStateNormal];
[loginBtn addTarget:self action:@selector(regisOnClick) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:loginBtn];
}
- (void)agreeProtocol:(UIButton *)agreeBtn
{
agreeBtn.selected = !agreeBtn.selected;
}
#pragma mark - 获取协议
- (void)getUserProtocol {
JKCQAPI * agreeAPI = [[JKCQAPI alloc] init:self tag:@"AGREEAPI" NeedToken:@""];
[agreeAPI getUserAgreementPrivacy:nil];
}
// 跳转用户协议
- (void)tap
{
ADJumpViewController * webVC= [[ADJumpViewController alloc] init];
webVC.webTitle = @"用户注册协议";
webVC.webUrl = [NSString stringWithFormat:@"%@%@",IntervenH5,self.protocolString];
[self.navigationController pushViewController:webVC animated:YES];
}
- (void)xmProtocol
{
self.protocolBtn.selected = YES;
}
#pragma mark - 注册
- (void)regisOnClick
{
if ([NSString stringWithFormat:@"%@",self.passwordTextField.text].length<6||[NSString stringWithFormat:@"%@",self.passwordTextField.text].length>20)
{
[EasyTextView showErrorText:@"密码的长度是6-20位"];
return;
}
if (!self.protocolBtn.selected )
{
[EasyTextView showErrorText:@"请先阅读并同意协议"];
return;
}
[self showMBProgressHUDOnlyWithString:@"注册已提交,请等待审核通过后方可登录"];
}
- (void)Sucess:(id)response tag:(NSString*)tag
{
if ([tag isEqualToString:@"GetUserRegister"])
{
[self showMBProgressHUDOnlyWithString:@"注册成功"];
[self dismissViewControllerAnimated:YES completion:nil];
}
if ([tag isEqualToString:@"AGREEAPI"]) {
NSArray * array = response;
NSMutableArray * dataArray = [[NSMutableArray alloc] init];
for (NSDictionary * parmDic in array) {
MineCenterUserModel * model = [MineCenterUserModel modelWithDictionary:parmDic];
if ([model.value integerValue] == 1) {
self.protocolString = model.text;
}
[dataArray addObject:model];
}
}
}
- (void)Failed:(NSString*)message tag:(NSString*)tag
{
[EasyTextView showErrorText:message];
NSLog(@"apiError=%@",message);
// [self showMessage:message];
}
- (void)leftBtnClick
{
[self dismissViewControllerAnimated:YES completion:nil];
}
//实现UITextField代理方法
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
[textField resignFirstResponder];//取消第一响应者
return YES;
}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
[self.view endEditing:YES];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(UITextField*)createTextFieldWithFrame:(CGRect)frame placeholder:(NSString*)placeholder passWord:(BOOL)YESorNO leftImageView:(UIView*)leftView rightImageView:(UIView*)rightView Font:(float)font
{
UITextField*textField=[[UITextField alloc]initWithFrame:frame];
//灰色提示框
textField.placeholder=placeholder;
//文字对齐方式
textField.textAlignment=NSTextAlignmentLeft;
textField.secureTextEntry=YESorNO;
//边框
//textField.borderStyle=UITextBorderStyleLine;
//键盘类型
textField.returnKeyType=UIReturnKeyDone;
//关闭首字母大写
textField.autocapitalizationType=NO;
//清除按钮
textField.clearButtonMode=NO;
//左图片
textField.leftView=leftView;
textField.leftViewMode=UITextFieldViewModeAlways;
//右图片
textField.rightView=rightView;
//编辑状态下一直存在
textField.rightViewMode=UITextFieldViewModeAlways;
//自定义键盘
//textField.inputView
//字体
textField.font=[UIFont systemFontOfSize:font];
//字体颜色
UIView * line2 = [[UIView alloc] initWithFrame:CGRectMake(0, frame.size.height-1, kScreenWidth, 1)];
line2.backgroundColor = UIColorLine;
[textField addSubview:line2];
return textField;
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
@@ -1,21 +0,0 @@
//
// AddContactViewController.h
// EscortProject
//
// Created by 仁康信息 on 2023/7/27.
//
#import "HQBaseViewController.h"
#import "EmergencyContactModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface AddContactViewController : HQBaseViewController
@property (nonatomic, copy) NSString * contact_id;
@property (nonatomic, strong) EmergencyContactModel * model;
@end
NS_ASSUME_NONNULL_END
@@ -1,356 +0,0 @@
//
// AddContactViewController.m
// EscortProject
//
// Created by 仁康信息 on 2023/7/27.
//
#import "AddContactViewController.h"
#import "LineTextField.h"
#import "FamilyMemberRelationModel.h"
#import "BRStringPickerView.h"
#import "AddContactViewController.h"
@interface AddContactViewController ()
@property (nonatomic, strong) LineTextField * nameField;
@property (nonatomic, strong) LineTextField * phoneField;
@property (nonatomic, strong) LineTextField * cardNumberField;
@property (nonatomic, strong) LineTextField * relationshipTextField;
@property (nonatomic, strong) NSMutableArray * memberArray;
@property (nonatomic, copy) NSString * familyInt;
@end
@implementation AddContactViewController
- (NSMutableArray *)memberArray {
if (!_memberArray) {
_memberArray = [[NSMutableArray alloc] init];
}
return _memberArray;
}
- (void)viewDidLoad {
[super viewDidLoad];
self.isHidenNaviBar = false;
self.navigationItem.title = @"紧急联系人";
self.view.backgroundColor = KWhiteColor;
[self createUI];
[self getFamilyMembers];
// Do any additional setup after loading the view.
}
- (void)createUI {
//咨询人姓名
self.nameField = [self createFieldWithLeftTitle:@"姓名" withRightString:@"" placeholderStr:@"请填写紧急联系人姓名" isShowRight:true];
self.nameField.frame = CGRectMake(0, 1, kScreenWidth, 51);
[self.view addSubview:self.nameField];
//手机号
self.phoneField = [self createFieldWithLeftTitle:@"手机号" withRightString:@" " placeholderStr:@"请填写手机号" isShowRight:true];
self.phoneField.frame = CGRectMake(0, self.nameField.bottom, kScreenWidth, 51);
[self.view addSubview:self.phoneField];
//身份证号码,
self.cardNumberField = [self createFieldWithLeftTitle:@"身份证号" withRightString:@"" placeholderStr:@"请填写身份证号" isShowRight:true];
self.cardNumberField.frame = CGRectMake(0, self.phoneField.bottom, kScreenWidth, 51);
[self.view addSubview:self.cardNumberField];
//与本人关系
self.relationshipTextField = [self createFieldWithLeftTitle:@"与咨询人关系" withRightString:@">" placeholderStr:@"请点击选择" isShowRight:true];
self.relationshipTextField.frame = CGRectMake(0, self.cardNumberField.bottom, kScreenWidth, 51);
self.relationshipTextField.userInteractionEnabled = true;
[self.view addSubview:self.relationshipTextField];
UIButton * shipBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 51)];
[shipBtn addTarget:self action:@selector(relastionShipOnclick) forControlEvents:UIControlEventTouchUpInside];
[self.relationshipTextField addSubview:shipBtn];
//保存按钮
if (self.model) {
self.nameField.text = self.model.name;
self.phoneField.text = self.model.phone;
self.cardNumberField.text = self.model.idCard;
self.relationshipTextField.text = self.model.familyRelation_dictText;
UIButton * delectBtn = [[UIButton alloc] initWithFrame:CGRectMake(kScreenWidth/2 - kRealValue(120) , kScreenHeight - kTopHeight - kTabBarHeight - 30 - 40, kRealValue(110), 33)];
[delectBtn setTitle:@"删除" forState:UIControlStateNormal];
delectBtn.titleLabel.font = SYSTEMFONT(14);
delectBtn.layer.cornerRadius = 17.0f;
delectBtn.layer.masksToBounds = true;
delectBtn.layer.borderColor = UIColorHex(#21BEBD).CGColor;
delectBtn.layer.borderWidth = 1.0f;
delectBtn.backgroundColor = KWhiteColor;
[delectBtn addTarget:self action:@selector(delectedInfoAction) forControlEvents:UIControlEventTouchUpInside];
[delectBtn setTitleColor:UIColorHex(#21BEBD) forState:UIControlStateNormal];
[self.view addSubview:delectBtn];
UIButton * saveBtn = [[UIButton alloc] initWithFrame:CGRectMake(kScreenWidth/2 + kRealValue(10), kScreenHeight - kTopHeight - kTabBarHeight - 30 - 40, kRealValue(110), 33)];
[saveBtn setTitle:@"保存" forState:UIControlStateNormal];
saveBtn.titleLabel.font = SYSTEMFONT(14);
saveBtn.layer.cornerRadius = 17;
saveBtn.layer.masksToBounds = true;
saveBtn.backgroundColor = UIColorHex(#21BEBD);
[saveBtn addTarget:self action:@selector(saveInfo) forControlEvents:UIControlEventTouchUpInside];
[saveBtn setTitleColor:KWhiteColor forState:UIControlStateNormal];
[self.view addSubview:saveBtn];
}else
{
UIButton * saveBtn = [[UIButton alloc] initWithFrame:CGRectMake(kRealValue(48), kScreenHeight - kTopHeight - kTabBarHeight - 30 - 40, kScreenWidth - kRealValue(96), 40)];
[saveBtn setTitle:@"保存" forState:UIControlStateNormal];
saveBtn.titleLabel.font = SYSTEMFONT(14);
saveBtn.layer.cornerRadius = 20.0f;
saveBtn.layer.masksToBounds = true;
saveBtn.layer.borderColor = UIColorHex(#21BEBD).CGColor;
saveBtn.layer.borderWidth = 1.0f;
saveBtn.backgroundColor = KWhiteColor;
[saveBtn addTarget:self action:@selector(saveInfo) forControlEvents:UIControlEventTouchUpInside];
[saveBtn setTitleColor:UIColorHex(#21BEBD) forState:UIControlStateNormal];
[self.view addSubview:saveBtn];
}
}
- (LineTextField *)createFieldWithLeftTitle:(NSString *)leftStr
withRightString:(NSString *)rightStr
placeholderStr:(NSString *)placeStr
isShowRight:(BOOL)isShowRight {
LineTextField * field = [[LineTextField alloc] init];
field.font = SYSTEMFONT(13);
field.placeholder = placeStr;
field.textAlignment = NSTextAlignmentRight;
field.backgroundColor = KWhiteColor;
UIView * leftView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 51)];
UILabel * leftlabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(16), 0, 100, 51)];
leftlabel.text = leftStr;
leftlabel.font = SYSTEMFONT(13);
leftlabel.textAlignment = NSTextAlignmentLeft;
leftlabel.textColor = UIColorHex(#666666);
[leftView addSubview:leftlabel];
field.leftView = leftView;
field.leftViewMode = UITextFieldViewModeAlways;
if (isShowRight) {
UIView * rightView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 30, 51)];
UILabel * rightlabel = [[UILabel alloc] initWithFrame:CGRectMake(5, 0, 30, 51)];
rightlabel.text = rightStr;
rightlabel.font = SYSTEMFONT(13);
rightlabel.textColor = UIColorHex(#666666);
field.rightView = rightView;
rightlabel.textAlignment = NSTextAlignmentLeft;
field.rightViewMode = UITextFieldViewModeAlways;
[rightView addSubview:rightlabel];
}
return field;
}
- (void)delectedInfoAction {
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:self.model.contact_ID forKey:@"id"];
JKCQAPI * memberApi = [[JKCQAPI alloc] init:self tag:@"DelectedAPI" NeedToken:@""];
[memberApi getDelectedEmergencyContact:parmDic];
}
- (void)getFamilyMembers {
JKCQAPI * memberApi = [[JKCQAPI alloc] init:self tag:@"Family" NeedToken:@""];
[memberApi getCheckKeyResult:@{@"dictKey":@"family_member_relation"}];
}
- (void)Failed:(NSString*)message tag:(NSString*)tag
{
[self hiddenAllMBProgressHUD];
}
- (void)Sucess:(id)response tag:(NSString*)tag
{
if ([tag isEqualToString:@"Family"]) {
NSArray * array = response;
for (NSDictionary * dic in array) {
FamilyMemberRelationModel * model = [FamilyMemberRelationModel modelWithDictionary:dic] ;
[self.memberArray addObject:model];
}
}
if ([tag isEqualToString:@"ADDAPI"]) {
[EasyTextView showSuccessText:@"操作成功"];
[self.navigationController popViewControllerAnimated:YES];
}
if ([tag isEqualToString:@"DelectedAPI"]) {
[EasyTextView showSuccessText:@"操作成功"];
[self.navigationController popViewControllerAnimated:YES];
}
}
- (void)relastionShipOnclick {
/// 1.单列字符串选择器(传字符串数组)
BRStringPickerView *stringPickerView = [[BRStringPickerView alloc]init];
stringPickerView.pickerMode = BRStringPickerComponentSingle;
stringPickerView.title = @"关系";
NSMutableArray * array = [[NSMutableArray alloc] init];
for (FamilyMemberRelationModel * model in self.memberArray) {
[array addObject:model.text];
}
stringPickerView.dataSourceArr = array;
stringPickerView.selectIndex = 2;
stringPickerView.resultModelBlock = ^(BRResultModel *resultModel) {
NSLog(@"选择的值:%@", resultModel.value);
for (FamilyMemberRelationModel * model in self.memberArray) {
if ([model.text isEqualToString:resultModel.value]) {
self.familyInt = model.value;
}
}
self.relationshipTextField.text = resultModel.value;
};
[stringPickerView show];
}
- (void)saveInfo {
[self.view endEditing:TRUE];
if (ValidStr(self.nameField.text)) {
[EasyTextView showErrorText:@"请输入紧急联系人姓名"];
return;
}
if (ValidStr(self.phoneField.text)) {
[EasyTextView showErrorText:@"请输入手机号"];
return;
}
if (ValidStr(self.cardNumberField.text)) {
[EasyTextView showErrorText:@"请输入身份证号"];
return;
}
if (ValidStr(self.relationshipTextField.text)) {
[EasyTextView showErrorText:@"请选择与咨询人关系"];
return;
}
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
if (self.model) {
[parmDic setObject:self.model.contact_ID forKey:@"id"];
}else
{
[parmDic setObject:@"" forKey:@"id"];
}
[parmDic setObject:self.nameField.text forKey:@"name"];
[parmDic setObject:self.phoneField.text forKey:@"phone"];
[parmDic setObject:self.cardNumberField.text forKey:@"idCard"];
[parmDic setObject:self.familyInt forKey:@"familyRelation"];
JKCQAPI * api = [[JKCQAPI alloc] init:self tag:@"ADDAPI" NeedToken:@""];
[api postAddEmergencyContact:parmDic];
}
- (NSString *)getTimestampFromTime:(NSString *)CurrentTime{
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateStyle:NSDateFormatterMediumStyle];
[formatter setTimeStyle:NSDateFormatterShortStyle];
[formatter setDateFormat:@"yyyy-MM-dd"]; //(@"YYYY-MM-dd hh:mm:ss") ----------设置你想要的格式,hh与HH的区别:分别表示12小时制,24小时制
//设置时区选择北京时间
NSTimeZone* timeZone = [NSTimeZone timeZoneWithName:@"Asia/Beijing"];
[formatter setTimeZone:timeZone];
NSDate* date = [formatter dateFromString:CurrentTime]; //------------将字符串按formatter转成nsdate
//时间转时间戳的方法:
NSInteger timeSp = [[NSNumber numberWithDouble:[date timeIntervalSince1970]] integerValue] * 1000;
return [NSString stringWithFormat:@"%ld",(long)timeSp];
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
@@ -1,16 +0,0 @@
//
// EditSystemViewController.h
// EscortProject
//
// Created by 仁康信息 on 2024/1/10.
//
#import "HQBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface EditSystemViewController : HQBaseViewController
@end
NS_ASSUME_NONNULL_END
@@ -1,239 +0,0 @@
//
// EditSystemViewController.m
// EscortProject
//
// Created by 仁康信息 on 2024/1/10.
//
#import "EditSystemViewController.h"
#import "LoginFoundPasswordViewController.h"
#import "MineCenterUserModel.h"
#import "ADJumpViewController.h"
@interface EditSystemViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (nonatomic, strong) UITableView * homeTableView;
@property (nonatomic, strong) NSMutableArray * dataArray;
@end
@implementation EditSystemViewController
- (NSMutableArray *)dataArray {
if (!_dataArray) {
_dataArray = [[NSMutableArray alloc] init];
}
return _dataArray;
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.view.backgroundColor = CViewBgColor;
self.navigationItem.title = @"设置";
[self createUI];
[self createData];
}
- (void)createUI
{
self.homeTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight - kTopHeight) style:UITableViewStyleGrouped];
if (@available(iOS 11.0, *)) {
self.homeTableView.estimatedRowHeight = 0;
self.homeTableView.estimatedSectionFooterHeight = 0;
self.homeTableView.estimatedSectionHeaderHeight = 0;
self.homeTableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}
self.homeTableView.delegate = self;
self.homeTableView.backgroundColor = CViewBgColor;
self.homeTableView.dataSource = self;
self.homeTableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
self.homeTableView.showsVerticalScrollIndicator = NO;
[self.view addSubview:self.homeTableView];
}
- (void)createData {
JKCQAPI * agreeAPI = [[JKCQAPI alloc] init:self tag:@"AGREEAPI" NeedToken:@""];
[agreeAPI getUserAgreementPrivacy:nil];
}
- (void)Failed:(NSString*)message tag:(NSString*)tag
{
[self showMBProgressHUDOnlyWithString:message];
[self hiddenAllMBProgressHUD];
}
- (void)Sucess:(id)response tag:(NSString*)tag
{
if ([tag isEqualToString:@"AGREEAPI"]) {
NSArray * array = response;
for (NSDictionary * parmDic in array) {
MineCenterUserModel * model = [MineCenterUserModel modelWithDictionary:parmDic];
[self.dataArray addObject:model];
}
}
}
#pragma mark - DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
if (section == 0) {
return 3;
}
return 1;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 2;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0) {
NSArray * sectionOne = @[@"账号与安全(修改密码)",@"用户协议",@"隐私政策"];
static NSString * cellID = @"cellID";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.textLabel.font = SYSTEMFONT(14);
cell.textLabel.text = sectionOne[indexPath.row];
cell.textLabel.textColor = UIColorHex(#666666);
cell.textLabel.font = SYSTEMFONT(14);
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.backgroundColor = KWhiteColor;
return cell;
}
if (indexPath.section == 1) {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"CONNETCELL"];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"CONNETCELL"];
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.textLabel.font = SYSTEMFONT(14);
cell.textLabel.text = @"版本号";
cell.detailTextLabel.text = [[[NSBundle mainBundle]infoDictionary] objectForKey:@"CFBundleShortVersionString"];
return cell;
}
return UITableViewCell.new;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 44;
}
- (CGFloat )tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return CGFLOAT_MIN;
}
- (CGFloat )tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return kRealValue(5);
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
return UIView.new;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0) {
if (indexPath.row == 0) {
LoginFoundPasswordViewController * loginVC = [[LoginFoundPasswordViewController alloc] init];
[self.navigationController pushViewController:loginVC animated:YES];
}
if (indexPath.row == 1) {
for (MineCenterUserModel * model in self.dataArray) {
if ([model.value integerValue] == 1) {
ADJumpViewController * webVC= [[ADJumpViewController alloc] init];
webVC.webTitle = @"用户协议";
webVC.webUrl = [NSString stringWithFormat:@"%@%@",IntervenH5,model.text];
[self.navigationController pushViewController:webVC animated:YES];
}
}
}
if (indexPath.row == 2) {
for (MineCenterUserModel * model in self.dataArray) {
if ([model.value integerValue] == 2) {
ADJumpViewController * webVC= [[ADJumpViewController alloc] init];
webVC.webTitle = @"隐私政策";
webVC.webUrl = [NSString stringWithFormat:@"%@%@",IntervenH5,model.text];
[self.navigationController pushViewController:webVC animated:YES];
}
}
}
}
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
@@ -1,18 +0,0 @@
//
// MinePictureRecordViewController.h
// EscortProject
//
// Created by 仁康信息 on 2023/7/25.
//
#import "HQBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface MinePictureRecordViewController : HQBaseViewController
@property (nonatomic, assign) NSInteger selectOnes;
@end
NS_ASSUME_NONNULL_END
@@ -1,561 +0,0 @@
//
// MinePictureRecordViewController.m
// EscortProject
//
// Created by 仁康信息 on 2023/7/25.
//
#import "MinePictureRecordViewController.h"
#import "QuestionRecoredTable.h"
#import "QuestionRecordModel.h"
#import "RecordIMListDateModel.h"
#import "DoctorMainViewController.h"
@interface MinePictureRecordViewController ()
@property (nonatomic, strong) QuestionRecoredTable * homeTable;
@property (nonatomic, strong) NSMutableArray * buttonArray;
@property (nonatomic, strong) NSMutableArray * redCountArray;
@property (nonatomic, assign) NSInteger pageNo;
@property (nonatomic, copy) NSString * type;
@property (nonatomic, strong) NSMutableArray * dataArray;
@property (nonatomic, strong) NSMutableArray * groupIDArray;
@property (nonatomic, strong) NSMutableArray * jingxingArray;
@property (nonatomic, assign) NSInteger totalCount;
@end
@implementation MinePictureRecordViewController
- (NSMutableArray *)groupIDArray {
if (!_groupIDArray) {
_groupIDArray = [[NSMutableArray alloc] init];
}
return _groupIDArray;
}
- (NSMutableArray *)redCountArray {
if (!_redCountArray) {
_redCountArray = [[NSMutableArray alloc] init];
}
return _redCountArray;
}
- (NSMutableArray *)jingxingArray {
if (!_jingxingArray) {
_jingxingArray = [[NSMutableArray alloc] init];
}
return _jingxingArray;
}
- (NSMutableArray *)dataArray {
if (!_dataArray) {
_dataArray = [[NSMutableArray alloc] init];
}
return _dataArray;
}
- (NSMutableArray *)buttonArray {
if (!_buttonArray) {
_buttonArray = [[NSMutableArray alloc] init];
}
return _buttonArray;
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.isHidenNaviBar = false;
self.pageNo = 0;
[self createUI];
if ([ESCTUIManager TUIUserStatus] == false) {
[self loginImAccount];
}
if ([self.type integerValue] == 3)
{
[self getChatList];
}
else
{
[self createData];
}
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.homeTable.mj_header beginRefreshing];
}
- (void)createUI {
NSArray * array = @[@"进行中",@"已评价",@"历史"];
[self.buttonArray removeAllObjects];
CGFloat w = kRealValue(80);
for (int index = 0; index < array.count; index ++) {
UIButton * listBtn = [[UIButton alloc] init];
listBtn.frame = CGRectMake(kRealValue(15) + (w + kRealValue(13)) * index , kRealValue(15), w, 27);
[listBtn setTitle:array[index] forState:UIControlStateNormal];
[listBtn setTitleColor:KWhiteColor forState:UIControlStateSelected];
[listBtn setTitleColor:CFontColor1 forState:UIControlStateNormal];
[listBtn addTarget:self action:@selector(statusChange:) forControlEvents:UIControlEventTouchUpInside];
listBtn.titleLabel.font = SYSTEMFONT(13);
listBtn.layer.cornerRadius = 14.0;
listBtn.layer.masksToBounds = true;
listBtn.tag = 1000 + index;
[self.view addSubview:listBtn];
if (self.selectOnes == 3) {
if (index == 0 ) {
listBtn.selected = YES;
listBtn.backgroundColor = UIColorHex(#21BEBD);
}else{
listBtn.backgroundColor = UIColorHex(#DDDDDD);
}
}
if (self.selectOnes == 4) {
if (index == 1 ) {
listBtn.selected = YES;
listBtn.backgroundColor = UIColorHex(#21BEBD);
}else{
listBtn.backgroundColor = UIColorHex(#DDDDDD);
}
}
if (self.selectOnes == 5) {
if (index == 2 ) {
listBtn.selected = YES;
listBtn.backgroundColor = UIColorHex(#21BEBD);
}else{
listBtn.backgroundColor = UIColorHex(#DDDDDD);
}
}
if (self.selectOnes == 6) {
if (index == 2 ) {
listBtn.selected = YES;
listBtn.backgroundColor = UIColorHex(#21BEBD);
}else{
listBtn.backgroundColor = UIColorHex(#DDDDDD);
}
}
[self.buttonArray addObject:listBtn];
}
self.homeTable = [[QuestionRecoredTable alloc] initWithFrame:CGRectMake(0, 50, kScreenWidth, kScreenHeight - kTopHeight - 50 - SafetyAreaHeight) style:UITableViewStyleGrouped];
self.homeTable.detailBlock = ^(NSString * _Nonnull recordID, NSString * _Nonnull imID, NSString * _Nonnull memberId, RecordIMListDateModel * _Nonnull model) {
// DoctorMainViewController * doctorVC = [[DoctorMainViewController alloc] init];
// doctorVC.yuyue_id = recordID;
// [self.navigationController pushViewController:doctorVC animated:YES];
if ([TUILogin isUserLogined]) {
ChatViewController * chatVC = [[ChatViewController alloc] init];
chatVC.isGroupID = YES;
chatVC.chatID = imID ;
chatVC.pictureEnd_id = recordID ;
chatVC.eableSendReport = true;
chatVC.eablehaveHelathData = false;
chatVC.navTitle = @"图文咨询";
chatVC.isVideo = NO;
chatVC.questionType = 2;
chatVC.medicalRecordsId = memberId;
//是否评价
if ([model.contentStatus integerValue] == 5 ) {
chatVC.isEveal = true;
}else
{
chatVC.isEveal = false;
}
if ([model.contentStatus intValue] >= 4)
{
chatVC.endRecordType = 100;
}
[self.navigationController pushViewController:chatVC animated:YES];
}else
{
[self loginImAccount];
}
};
[self.view addSubview:self.homeTable];
// [self.homeTable mas_makeConstraints:^(MASConstraintMaker *make) {
// make.top.mas_equalTo(@50);
// make.bottom.left.right.mas_offset(0);
// }];
__weak __typeof(self) weakSelf = self;
self.homeTable.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
weakSelf.pageNo = 0;
if ([ESCTUIManager TUIUserStatus] == false) {
[self loginImAccount];
}
if ([self.type integerValue] == 3)
{
[self getChatList];
}
else
{
[weakSelf createData];
}
}];
self.homeTable.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
weakSelf.pageNo ++;
if ([ESCTUIManager TUIUserStatus] == false) {
[self loginImAccount];
}
if ([self.type integerValue] == 3)
{
[self getChatList];
}
else
{
[weakSelf createData];
}
}];
LYEmptyView *emptyView = [LYEmptyView emptyViewWithImageStr:@"noData" titleStr:@"暂无数据" detailStr:@""];
//元素竖直方向的间距
emptyView.subViewMargin = 20.f;
//标题颜色
emptyView.titleLabTextColor = [UIColor blackColor];
//描述字体
emptyView.detailLabFont = [UIFont systemFontOfSize:17];
//按钮背景色
emptyView.actionBtnBackGroundColor = KWhiteColor;
emptyView.actionBtnWidth = CGFLOAT_MIN;
emptyView.actionBtnHeight = CGFLOAT_MIN;
//设置空内容占位图
self.homeTable.ly_emptyView = emptyView;
}
//获取腾讯im会话列表
- (void)getChatList {
V2TIMConversationListFilter *filter = [[V2TIMConversationListFilter alloc] init];
// filter.type = V2TIM_C2C; //拉取单聊会话
filter.type = V2TIM_GROUP; //拉取群聊会话
[[V2TIMManager sharedInstance] getConversationListByFilter:filter nextSeq:self.pageNo count:50 succ:^(NSArray<V2TIMConversation *> *list, uint64_t nextSeq, BOOL isFinished) {
// 获取会话列表成功,list 为会话列表
if (self.pageNo == 0) {
[self.groupIDArray removeAllObjects];
}
DLog(@"%@",list);
[self.redCountArray addObjectsFromArray:list];
for (V2TIMConversation * v2Model in list) {
[self.groupIDArray addObject: v2Model.groupID];
}
[self postGroupArray:self.groupIDArray];
} fail:^(int code, NSString *desc) {
// 获取会话列表失败
}];
// //获取所以会话的未读总数
// // filter.type = V2TIM_GROUP; //拉取群聊会话
//
// [[V2TIMManager sharedInstance] getUnreadMessageCountByFilter:filter succ:^(UInt64 totalUnreadCount) {
// self.totalCount = totalUnreadCount;
// } fail:^(int code, NSString *desc) {
//
// }];
}
#pragma mark:上传id数组
- (void)postGroupArray:(NSArray *)array {
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:array forKey:@"imIds"];
[self showMBProgressHUDWithString:@"数据加载中,请稍候..." autoHidden:NO];
JKCQAPI * recordApi = [[JKCQAPI alloc] init:self tag:@"GROUPID" NeedToken:@""];
[recordApi PostGroupIDArray:parmDic];
}
- (void)createData {
// type : 1 图文 2 音视频
[self showMBProgressHUDWithString:@"数据加载中,请稍候..." autoHidden:NO];
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:@(self.pageNo) forKey:@"pageNo"];
[parmDic setObject:@(10) forKey:@"pageSize"];
[parmDic setObject:self.type forKey:@"status"];
[parmDic setObject:@"1" forKey:@"type"];
//status 1 3 4 5 //4 代评价
JKCQAPI * recordApi = [[JKCQAPI alloc] init:self tag:@"RECORD" NeedToken:@""];
[recordApi getMineQuestionRecord:parmDic];
}
- (void)loginImAccount {
JKCQAPI * proctocolApi = [[JKCQAPI alloc] init:self tag:@"IMAPI" NeedToken:nil];
[proctocolApi GetIMLoginAccount:nil];
}
- (void)Failed:(NSString*)message tag:(NSString*)tag
{
[self.homeTable.mj_footer endRefreshing];
[self.homeTable.mj_header endRefreshing];
[self showMBProgressHUDOnlyWithString:message];
[self hiddenAllMBProgressHUD];
}
- (void)Sucess:(id)response tag:(NSString*)tag
{
[self.homeTable.mj_footer endRefreshing];
[self.homeTable.mj_header endRefreshing];
if ([tag isEqualToString:@"RECORD"]) {
[self hiddenAllMBProgressHUD];
if (self.pageNo == 0) {
[self.dataArray removeAllObjects];
}
NSArray * array = response ;
for (NSDictionary * dic in array) {
RecordIMListDateModel * model = [ RecordIMListDateModel modelWithDictionary:dic];
[self.dataArray addObject:model];
}
self.homeTable.dataArray = self.dataArray;
}
if ([tag isEqualToString:@"IMAPI"]) {
NSDictionary * pamrDic = response;
IMUserInfoModel * model = [IMUserInfoModel modelWithDictionary:pamrDic];
IMUserInfoModel * iminfoModel = [[IMUserInfoModel alloc] init];
iminfoModel.IMInfo = pamrDic;
[HQCommonUtils keyedArchiverWithData:iminfoModel key:IMLoginUserInfo];
// 1. 从即时通信 IM 控制台获取应用 SDKAppID。
// 2. 初始化 config 对象
V2TIMSDKConfig *config = [[V2TIMSDKConfig alloc] init];
// 3. 指定 log 输出级别。
config.logLevel = V2TIM_LOG_INFO;
// 4. 添加 V2TIMSDKListener 的事件监听器,self 是 id<V2TIMSDKListener> 的实现类,如果您不需要监听 IM SDK 的事件,这个步骤可以忽略。
[[V2TIMManager sharedInstance] addIMSDKListener:self];
// 5. 初始化 IM SDK,调用这个接口后,可以立即调用登录接口。
[[V2TIMManager sharedInstance] initSDK:[model.sdkAppId intValue] config:config];
// 1. 从即时通信 IM 控制台获取应用 SDKAppID。
// 2. 初始化 config 对象
// 3. 指定 log 输出级别。
config.logLevel = V2TIM_LOG_INFO;
// 4. 添加 V2TIMSDKListener 的事件监听器,self 是 id<V2TIMSDKListener> 的实现类,如果您不需要监听 IM SDK 的事件,这个步骤可以忽略。
// 5. 初始化 IM SDK,调用这个接口后,可以立即调用登录接口。
[TUILogin login:[model.sdkAppId intValue] userID:model.userId userSig:model.userSig succ:^{
[self getChatList];
} fail:^(int code, NSString *msg) {
[EasyTextView showErrorText:msg];
}];
}
if ([tag isEqualToString:@"GROUPID"]) {
NSArray * array = response;
[self.jingxingArray removeAllObjects];
[self hiddenAllMBProgressHUD];
for (NSDictionary * parmDic in array) {
RecordIMListDateModel * model = [ RecordIMListDateModel modelWithDictionary:parmDic];
for (V2TIMConversation * v2Model in self.redCountArray) {
if ([v2Model.groupID isEqualToString:model.imId])
{
model.unredCount = v2Model.unreadCount;
}
}
[self.jingxingArray addObject:model];
}
self.homeTable.dataArray = self.jingxingArray;
// self.homeTable.totalCount
}
}
- (void)statusChange:(UIButton *)statusBtn {
[self.dataArray removeAllObjects];
if (statusBtn.tag == 1000) {
self.type = @"3"; //进行中
[self getChatList];
}
if (statusBtn.tag == 1001) {
self.type = @"5"; //已评价
[self createData];
}
if (statusBtn.tag == 1002) {
self.type = @""; //全部 历史
[self createData];
}
for (UIButton * titBtn in self.buttonArray) {
if (titBtn == statusBtn) {
titBtn.selected = YES;
titBtn.backgroundColor = UIColorHex(#21BEBD);
}else
{
titBtn.selected = NO;
titBtn.backgroundColor = UIColorHex(#DDDDDD);
}
}
}
- (void)setSelectOnes:(NSInteger)selectOnes {
_selectOnes = selectOnes;
self.type = [NSString stringWithFormat:@"%ld",_selectOnes];
switch (_selectOnes) {
case 3://进行中
{
for (UIButton * seleBtn in self.buttonArray) {
if (seleBtn.tag == 1000) {
seleBtn.selected = YES;
seleBtn.backgroundColor = UIColorHex(#21BEBD);
}else
{
seleBtn.selected = NO;
seleBtn.backgroundColor = UIColorHex(#DDDDDD);
}
}
}
break;
case 5://已评价
{
for (UIButton * seleBtn in self.buttonArray) {
if (seleBtn.tag == 1001) {
seleBtn.selected = YES;
seleBtn.backgroundColor = UIColorHex(#21BEBD);
}else
{
seleBtn.selected = NO;
seleBtn.backgroundColor = UIColorHex(#DDDDDD);
}
}
}
break;
case 6:
{
for (UIButton * seleBtn in self.buttonArray) {
if (seleBtn.tag == 1002) {
seleBtn.selected = YES;
seleBtn.backgroundColor = UIColorHex(#21BEBD);
}else
{
seleBtn.selected = NO;
seleBtn.backgroundColor = UIColorHex(#DDDDDD);
}
}
}
break;
default:
break;
}
}
//在线时票据过期:此时您需要生成新的 userSig,并再次重新调用初始化。
- (void)onKickedOffline {
[HQCommonUtils keyedArchiverWithData:nil key:LoginUserInfo];
[ESCTUIManager outLoginTUISDK];
KPostNotification(KNotificationLoginStateChange, @NO);
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
@@ -1,18 +0,0 @@
//
// MineQuestionRecordViewController.h
// EscortProject
//
// Created by 仁康信息 on 2023/7/25.
//
#import "HQBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface MineQuestionRecordViewController : HQBaseViewController
@property (nonatomic, assign) NSInteger type; // 1 进行中 2 待评价 3 已评价 4 历史
@property (nonatomic, assign) NSInteger titleSelected; // 10 图文 11 音视频
@end
NS_ASSUME_NONNULL_END
@@ -1,16 +0,0 @@
//
// MineUserInfoViewController.h
// EscortProject
//
// Created by 仁康信息 on 2023/7/26.
//
#import "HQBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface MineUserInfoViewController : HQBaseViewController
@end
NS_ASSUME_NONNULL_END
@@ -1,141 +0,0 @@
//
// MineUserInfoViewController.m
// EscortProject
//
// Created by 仁康信息 on 2023/7/26.
//
#import "MineUserInfoViewController.h"
#import "MineUserInfoTable.h"
#import "EmergencyContactModel.h"
#import "AddContactViewController.h"
@interface MineUserInfoViewController ()
@property (nonatomic, strong) MineUserInfoTable * homeTable;
@property (nonatomic, strong) NSMutableArray * dataArray;
@end
@implementation MineUserInfoViewController
- (NSMutableArray *)dataArray {
if (!_dataArray) {
_dataArray = [[NSMutableArray alloc] init];
}
return _dataArray;
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.navigationItem.title = @"个人信息";
self.isHidenNaviBar = false;
self.view.backgroundColor = KWhiteColor;
[self createUI];
[self createData];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated] ;
[self.dataArray removeAllObjects];
[self getEmergencyContact];
}
- (void)createUI {
MJWeakSelf
self.homeTable = [[MineUserInfoTable alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight - kTopHeight) style:UITableViewStyleGrouped];
self.homeTable.addBlcok = ^{
//新增紧急联系人
[weakSelf addEmergencyContact];
};
self.homeTable.editBlcok = ^(EmergencyContactModel * _Nonnull model) {
AddContactViewController * addVC = [[AddContactViewController alloc] init];
addVC.model = model;
[weakSelf.navigationController pushViewController:addVC animated:YES];
};
[self.view addSubview:self.homeTable];
}
- (void)createData {
JKCQAPI * infoApi = [[JKCQAPI alloc] init:self tag:@"USERINFO" NeedToken:@""];
[infoApi getMineCenterUserInfo:nil];
}
- (void)getEmergencyContact {
NSMutableDictionary * dic = [[NSMutableDictionary alloc] init];
JKCQAPI * numbeApi = [[JKCQAPI alloc] init:self tag:@"ContactAPI" NeedToken:@""];
[numbeApi getEmergencyContact:dic];
}
#pragma mark -网络请求处理
- (void)Failed:(NSString*)message tag:(NSString*)tag
{
[self showMBProgressHUDOnlyWithString:message];
[self hiddenAllMBProgressHUD];
}
- (void)Sucess:(id)response tag:(NSString*)tag
{
[self hiddenAllMBProgressHUD];
if ([tag isEqualToString:@"USERINFO"]) {
NSDictionary * dic = response;
MineCenterUserModel * userModel = [MineCenterUserModel modelWithDictionary:dic];
self.homeTable.model = userModel;
}
if ([tag isEqualToString:@"ContactAPI"]) {
NSArray * array = response;
for (NSDictionary * parmDic in array) {
EmergencyContactModel * model = [EmergencyContactModel modelWithDictionary:parmDic];
[self.dataArray addObject:model];
}
self.homeTable.dataArray = self.dataArray;
}
}
#pragma mark:新增联系人
- (void)addEmergencyContact {
AddContactViewController * addVC = [[AddContactViewController alloc] init];
[self.navigationController pushViewController:addVC animated:YES];
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
@@ -1,19 +0,0 @@
//
// MineVideoRecordViewController.h
// EscortProject
//
// Created by 仁康信息 on 2023/7/25.
//
#import "HQBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface MineVideoRecordViewController : HQBaseViewController
@property (nonatomic, assign) NSInteger selectOnes;
@end
NS_ASSUME_NONNULL_END
@@ -1,374 +0,0 @@
//
// MineVideoRecordViewController.m
// EscortProject
//
// Created by 仁康信息 on 2023/7/25.
//
#import "MineVideoRecordViewController.h"
#import "QuestionRecoredTable.h"
#import "QuestionRecordModel.h"
#import "RecordIMListDateModel.h"
#import "DoctorMainViewController.h"
@interface MineVideoRecordViewController ()<V2TIMSDKListener>
@property (nonatomic, strong) QuestionRecoredTable * homeTable;
@property (nonatomic, strong) NSMutableArray * buttonArray;
@property (nonatomic, assign) NSInteger pageNo;
@property (nonatomic, copy) NSString * type;
@property (nonatomic, strong) NSMutableArray * dataArray;
@property (nonatomic, strong) NSMutableArray * groupIDArray;
@property (nonatomic, strong) NSMutableArray * jingxingArray;
@end
@implementation MineVideoRecordViewController
- (NSMutableArray *)groupIDArray {
if (!_groupIDArray) {
_groupIDArray = [[NSMutableArray alloc] init];
}
return _groupIDArray;
}
- (NSMutableArray *)jingxingArray {
if (!_jingxingArray) {
_jingxingArray = [[NSMutableArray alloc] init];
}
return _jingxingArray;
}
- (NSMutableArray *)dataArray {
if (!_dataArray) {
_dataArray = [[NSMutableArray alloc] init];
}
return _dataArray;
}
- (NSMutableArray *)buttonArray {
if (!_buttonArray) {
_buttonArray = [[NSMutableArray alloc] init];
}
return _buttonArray;
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.isHidenNaviBar = false;
self.pageNo = 0;
self.type = [NSString stringWithFormat:@"%ld",_selectOnes];
[self createUI];
[self createData];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.homeTable.mj_header beginRefreshing];
}
- (void)createUI {
NSArray * array = @[@"进行中",@"待评价",@"已评价",@"历史"];
[self.buttonArray removeAllObjects];
CGFloat w = kRealValue(70);
for (int index = 0; index < array.count; index ++) {
UIButton * listBtn = [[UIButton alloc] init];
listBtn.frame = CGRectMake(kRealValue(17) + (w + kRealValue(13)) * index , kRealValue(15), w, 27);
[listBtn setTitle:array[index] forState:UIControlStateNormal];
[listBtn setTitleColor:KWhiteColor forState:UIControlStateSelected];
[listBtn setTitleColor:CFontColor1 forState:UIControlStateNormal];
[listBtn addTarget:self action:@selector(statusChange:) forControlEvents:UIControlEventTouchUpInside];
listBtn.titleLabel.font = SYSTEMFONT(13);
listBtn.layer.cornerRadius = 14.0;
listBtn.layer.masksToBounds = true;
listBtn.tag = 1000 + index;
[self.view addSubview:listBtn];
// if (index == 0 ) {
// listBtn.selected = YES;
// listBtn.backgroundColor = UIColorHex(#21BEBD);
// }else{
// listBtn.backgroundColor = UIColorHex(#DDDDDD);
// }
if (self.selectOnes == 3) {
if (index == 0 ) {
listBtn.selected = YES;
listBtn.backgroundColor = UIColorHex(#21BEBD);
}else{
listBtn.backgroundColor = UIColorHex(#DDDDDD);
}
}
if (self.selectOnes == 4) {
if (index == 1 ) {
listBtn.selected = YES;
listBtn.backgroundColor = UIColorHex(#21BEBD);
}else{
listBtn.backgroundColor = UIColorHex(#DDDDDD);
}
}
if (self.selectOnes == 5) {
if (index == 2 ) {
listBtn.selected = YES;
listBtn.backgroundColor = UIColorHex(#21BEBD);
}else{
listBtn.backgroundColor = UIColorHex(#DDDDDD);
}
}
if (self.selectOnes == 6) {
if (index == 3 ) {
listBtn.selected = YES;
listBtn.backgroundColor = UIColorHex(#21BEBD);
}else{
listBtn.backgroundColor = UIColorHex(#DDDDDD);
}
}
[self.buttonArray addObject:listBtn];
}
self.homeTable = [[QuestionRecoredTable alloc] initWithFrame:CGRectMake(0, 50, kScreenWidth, kScreenHeight - kTopHeight - 45 - 60) style:UITableViewStyleGrouped];
MJWeakSelf;
self.homeTable.detailBlock = ^(NSString * _Nonnull recordID, NSString * _Nonnull imID, NSString * _Nonnull memberId, RecordIMListDateModel * _Nonnull model) {
DoctorMainViewController * doctorVC = [[DoctorMainViewController alloc] init];
doctorVC.yuyue_id = recordID;
doctorVC.popType = 1;
[weakSelf.navigationController pushViewController:doctorVC animated:YES];
};
[self.view addSubview:self.homeTable];
self.homeTable.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
weakSelf.pageNo = 0;
[weakSelf createData];
}];
self.homeTable.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
weakSelf.pageNo ++;
[weakSelf createData];
}];
LYEmptyView *emptyView = [LYEmptyView emptyViewWithImageStr:@"noData" titleStr:@"暂无数据" detailStr:@""];
//元素竖直方向的间距
emptyView.subViewMargin = 20.f;
//标题颜色
emptyView.titleLabTextColor = [UIColor blackColor];
//描述字体
emptyView.detailLabFont = [UIFont systemFontOfSize:17];
//按钮背景色
emptyView.actionBtnBackGroundColor = KWhiteColor;
emptyView.actionBtnWidth = CGFLOAT_MIN;
emptyView.actionBtnHeight = CGFLOAT_MIN;
//设置空内容占位图
self.homeTable.ly_emptyView = emptyView;
}
- (void)createData {
// type : 1 图文 2 音视频
[self showMBProgressHUDWithString:@"数据加载中,请稍候..." autoHidden:NO];
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:@(self.pageNo) forKey:@"pageNo"];
[parmDic setObject:@(10) forKey:@"pageSize"];
[parmDic setObject:self.type forKey:@"status"];
[parmDic setObject:@"2" forKey:@"type"];
//status 1 3 4 5 //4 代评价
JKCQAPI * recordApi = [[JKCQAPI alloc] init:self tag:@"RECORD" NeedToken:@""];
[recordApi getMineQuestionRecord:parmDic];
}
- (void)Failed:(NSString*)message tag:(NSString*)tag
{
[self.homeTable.mj_footer endRefreshing];
[self.homeTable.mj_header endRefreshing];
[self hiddenAllMBProgressHUD];
}
- (void)Sucess:(id)response tag:(NSString*)tag
{
[self.homeTable.mj_footer endRefreshing];
[self.homeTable.mj_header endRefreshing];
if ([tag isEqualToString:@"RECORD"]) {
[self hiddenAllMBProgressHUD];
if (self.pageNo == 1) {
[self.dataArray removeAllObjects];
}
NSArray * array = response ;
if (self.pageNo == 0) {
[self.dataArray removeAllObjects];
}
for (NSDictionary * dic in array) {
RecordIMListDateModel * model = [ RecordIMListDateModel modelWithDictionary:dic];
[self.dataArray addObject:model];
}
self.homeTable.dataArray = self.dataArray;
}
}
- (void)statusChange:(UIButton *)statusBtn {
if (statusBtn.tag == 1000) { //进行中
self.type = @"3";
}
if (statusBtn.tag == 1001) { //待评价
self.type = @"4";
}
if (statusBtn.tag == 1002) { //已评价
self.type = @"5";
}
if (statusBtn.tag == 1003) { //全部
self.type = @"6";
}
for (UIButton * titBtn in self.buttonArray) {
if (titBtn == statusBtn) {
titBtn.selected = YES;
titBtn.backgroundColor = UIColorHex(#21BEBD);
}else
{
titBtn.selected = NO;
titBtn.backgroundColor = UIColorHex(#DDDDDD);
}
}
[self.homeTable.mj_header beginRefreshing];
}
- (void)setSelectOnes:(NSInteger)selectOnes {
_selectOnes = selectOnes;
switch (_selectOnes) {
case 3: //进行中
{
for (UIButton * seleBtn in self.buttonArray) {
if (seleBtn.tag == 1000) {
seleBtn.selected = YES;
seleBtn.backgroundColor = UIColorHex(#21BEBD);
}else
{
seleBtn.selected = NO;
seleBtn.backgroundColor = UIColorHex(#DDDDDD);
}
}
}
break;
case 4: //待评价
{
for (UIButton * seleBtn in self.buttonArray) {
if (seleBtn.tag == 1001) {
seleBtn.selected = YES;
seleBtn.backgroundColor = UIColorHex(#21BEBD);
}else
{
seleBtn.selected = NO;
seleBtn.backgroundColor = UIColorHex(#DDDDDD);
}
}
}
break;
case 5://已经评价
{
for (UIButton * seleBtn in self.buttonArray) {
if (seleBtn.tag == 1002) {
seleBtn.selected = YES;
seleBtn.backgroundColor = UIColorHex(#21BEBD);
}else
{
seleBtn.selected = NO;
seleBtn.backgroundColor = UIColorHex(#DDDDDD);
}
}
}
break;
case 6:// 全部历史
{
for (UIButton * seleBtn in self.buttonArray) {
if (seleBtn.tag == 1002) {
seleBtn.selected = YES;
seleBtn.backgroundColor = UIColorHex(#21BEBD);
}else
{
seleBtn.selected = NO;
seleBtn.backgroundColor = UIColorHex(#DDDDDD);
}
}
}
break;
default:
break;
}
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
@@ -1,16 +0,0 @@
//
// MyCenterViewController.h
// EscortProject
//
// Created by 仁康信息 on 2023/2/13.
//
#import "HQBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface MyCenterViewController : HQBaseViewController
@end
NS_ASSUME_NONNULL_END
@@ -1,345 +0,0 @@
//
// MyCenterViewController.m
// EscortProject
//
// Created by 仁康信息 on 2023/2/13.
//
#import "MyCenterViewController.h"
#import "SliderView.h"
#import "UILabel+Extension.h"
#import "SliderView.h"
#import "MyCenterTableView.h"
#import "QuestionPeopleMangerVC.h"
#import "MineQuestionRecordViewController.h"
#import "MineUserInfoViewController.h"
#import "MineCenterUserModel.h"
#import "EditSystemViewController.h"
#import "LoginFoundPasswordViewController.h"
#import "ADJumpViewController.h"
#import "LoginSetPasswordViewController.h"
#import "LoginFoundPasswordViewController.h"
@interface MyCenterViewController ()<myCenterHeardToolsDelegate,cenerCellListDelegate>
@property (nonatomic, strong) MyCenterTableView * homeTable;
@property (nonatomic, strong) NSMutableArray * dataArray;
@end
@implementation MyCenterViewController
- (NSMutableArray *)dataArray {
if (!_dataArray) {
_dataArray = [[NSMutableArray alloc] init];
}
return _dataArray;
}
- (void)viewDidLoad {
[super viewDidLoad];
self.isHidenNaviBar = false;
self.navigationItem.title = @"个人中心";
self.view.backgroundColor = UIColorHex(#EEEEEE);
// [self createTopAndNav];
[self addNavigationItemWithImageNames:@[@"setting_icon"] isLeft:false target:self action:@selector(settingAction) tags:@[ @"100"]];
[self createUI];
[self createData];
}
-(void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
if ([HQCommonUtils isLogin]) {
[self createUserInfo];
[self questionNumber];
}
}
- (void)settingAction {
EditSystemViewController * infoVC = [[EditSystemViewController alloc] init];
[self.navigationController pushViewController:infoVC animated:YES];
}
#pragma mark - numberFormat
- (NSString *)numberFormat:(float)num {
NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
[formatter setPositiveFormat:@"0"];
return [formatter stringFromNumber:[NSNumber numberWithFloat:num]];
}
- (void)createUI {
UIView * topView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kRealValue(120))];
topView.backgroundColor = UIColorHex(#21BEBD);
[self.view addSubview:topView];
self.homeTable = [[MyCenterTableView alloc] initWithFrame:CGRectMake(kRealValue(15), kRealValue(25), kScreenWidth - kRealValue(30), kScreenHeight - kRealValue(25) - kTopHeight - kTabBarHeight) style:UITableViewStyleGrouped];
self.homeTable.heardDelegate =self;
self.homeTable.cellDelegate = self;
self.homeTable.contentInset = UIEdgeInsetsMake(20, 0, 0, 0);
[self.homeTable scrollRectToVisible:CGRectMake(0, 29,1, 1) animated:YES];
[self.view addSubview:self.homeTable];
UIButton * outLoginBtn = [[UIButton alloc] initWithFrame:CGRectMake(kRealValue(48), kScreenHeight - kTabBarHeight - kTopHeight -kRealValue(100) , kScreenWidth - kRealValue(96), kRealValue(40))];
outLoginBtn.backgroundColor = KWhiteColor;
if ([HQCommonUtils isLogin]) {
[outLoginBtn setTitle:@"退出登录" forState:UIControlStateNormal];
[outLoginBtn addTarget:self action:@selector(outLoginUserinfo) forControlEvents:UIControlEventTouchUpInside];
}else
{
[outLoginBtn setTitle:@"去登录" forState:UIControlStateNormal];
[outLoginBtn addTarget:self action:@selector(gotoLoginUserinfo) forControlEvents:UIControlEventTouchUpInside];
}
[outLoginBtn setTitleColor:UIColorHex(#21BEBD) forState:UIControlStateNormal];
outLoginBtn.layer.cornerRadius = 20;
outLoginBtn.layer.masksToBounds = YES;
outLoginBtn.layer.borderColor = UIColorHex(#21BEBD).CGColor;
outLoginBtn.titleLabel.font = SYSTEMFONT(14);
outLoginBtn.layer.borderWidth = 1.0f;
[self.view addSubview:outLoginBtn];
}
- (void)createUserInfo {
JKCQAPI * infoApi = [[JKCQAPI alloc] init:self tag:@"USERINFO" NeedToken:@""];
[infoApi getMineCenterUserInfo:nil];
}
- (void)createData {
JKCQAPI * agreeAPI = [[JKCQAPI alloc] init:self tag:@"AGREEAPI" NeedToken:@""];
[agreeAPI getUserAgreementPrivacy:nil];
}
- (void)outLoginUserinfo {
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) {
[HQCommonUtils keyedArchiverWithData:nil key:LoginUserInfo];
[ESCTUIManager outLoginTUISDK];
KPostNotification(KNotificationLoginStateChange, @NO);
}];
[alertController addAction:cancelAction];
[alertController addAction:sureAction];
[[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:alertController animated:YES completion:nil];
}
#pragma mark:进行中
- (void)myCenterInProgress {
if (![HQCommonUtils isLogin]) {
[EasyTextView showErrorText:@"请登录"];
return;
}
MineQuestionRecordViewController * recordVC = [[MineQuestionRecordViewController alloc] init];
recordVC.titleSelected = 10;//图文视频
recordVC.type = 3;
[self.navigationController pushViewController:recordVC animated:YES];
}
#pragma mark:待评价
- (void)waitEvaluation {
if (![HQCommonUtils isLogin]) {
[EasyTextView showErrorText:@"请登录"];
return;
}
MineQuestionRecordViewController * recordVC = [[MineQuestionRecordViewController alloc] init];
recordVC.titleSelected = 11;//音视频
recordVC.type = 4;
[self.navigationController pushViewController:recordVC animated:YES];
}
#pragma mark:已评价
- (void)completeEvaluation {
if (![HQCommonUtils isLogin]) {
[EasyTextView showErrorText:@"请登录"];
return;
}
MineQuestionRecordViewController * recordVC = [[MineQuestionRecordViewController alloc] init];
recordVC.titleSelected = 10;//图文视频
recordVC.type = 4;
[self.navigationController pushViewController:recordVC animated:YES];
}
#pragma mark:历史
- (void)myHistoryAction {
if (![HQCommonUtils isLogin]) {
[EasyTextView showErrorText:@"请登录"];
return;
}
MineQuestionRecordViewController * recordVC = [[MineQuestionRecordViewController alloc] init];
recordVC.titleSelected = 10;//图文视频
recordVC.type = 6;
[self.navigationController pushViewController:recordVC animated:YES];
}
#pragma mark:查看全部
- (void)lookAllQuestion {
if (![HQCommonUtils isLogin]) {
[EasyTextView showErrorText:@"请登录"];
return;
}
MineQuestionRecordViewController * recordVC = [[MineQuestionRecordViewController alloc] init];
recordVC.titleSelected = 10;//图文视频
recordVC.type = 6;
[self.navigationController pushViewController:recordVC animated:YES];
}
- (void)cellListClick:(NSInteger)cellIndex {
if (![HQCommonUtils isLogin]) {
[EasyTextView showErrorText:@"请登录"];
return;
}
if (cellIndex == 0) {
LoginFoundPasswordViewController * loginVC = [[LoginFoundPasswordViewController alloc] init];
[self.navigationController pushViewController:loginVC animated:YES];
}
if (cellIndex == 1) {
if (self.dataArray.count <= 0) {
[EasyTextView showErrorText:@"暂无用户协议"];
return;
}
for (MineCenterUserModel * model in self.dataArray) {
if ([model.value integerValue] == 1) {
ADJumpViewController * webVC= [[ADJumpViewController alloc] init];
webVC.webTitle = @"用户协议";
webVC.webUrl = [NSString stringWithFormat:@"%@%@",IntervenH5,model.text];
[self.navigationController pushViewController:webVC animated:YES];
}
}
}
if (cellIndex == 2) {
if (self.dataArray.count <= 0) {
[EasyTextView showErrorText:@"暂无隐私政策"];
return;
}
for (MineCenterUserModel * model in self.dataArray) {
if ([model.value integerValue] == 2) {
ADJumpViewController * webVC= [[ADJumpViewController alloc] init];
webVC.webTitle = @"隐私政策";
webVC.webUrl = [NSString stringWithFormat:@"%@%@",IntervenH5,model.text];
[self.navigationController pushViewController:webVC animated:YES];
}
}
}
}
- (void)questionNumber {
NSMutableDictionary * dic = [[NSMutableDictionary alloc] init];
JKCQAPI * numbeApi = [[JKCQAPI alloc] init:self tag:@"NUMBERAPI" NeedToken:@""];
[numbeApi getMineCenterNumber:dic];
}
- (void)heardImageOnClick {
MineUserInfoViewController * infoVC = [[MineUserInfoViewController alloc] init];
[self.navigationController pushViewController:infoVC animated:YES];
}
- (void)Failed:(NSString*)message tag:(NSString*)tag
{
[self hiddenAllMBProgressHUD];
}
- (void)Sucess:(id)response tag:(NSString*)tag
{
if ([tag isEqualToString:@"NUMBERAPI"]) {
NSString * number = response;
self.homeTable.number = [number integerValue];
}
if ([tag isEqualToString:@"USERINFO"]) {
NSDictionary * dic = response;
MineCenterUserModel * userModel = [MineCenterUserModel modelWithDictionary:dic];
self.homeTable.userModel = userModel;
}
if ([tag isEqualToString:@"AGREEAPI"]) {
NSArray * array = response;
[self.dataArray removeAllObjects];
for (NSDictionary * parmDic in array) {
MineCenterUserModel * model = [MineCenterUserModel modelWithDictionary:parmDic];
[self.dataArray addObject:model];
}
}
}
- (void)gotoLoginUserinfo {
KPostNotification(KNotificationLoginStateChange, @NO);
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
@@ -0,0 +1,169 @@
//
// XJSOSDetailSmallSumViewController.m
// EscortProject
//
// Created by 仁康信息 on 2023/8/22.
//
#import "XJSOSDetailSmallSumViewController.h"
@interface XJSOSDetailSmallSumViewController ()
@property (nonatomic, strong) UIScrollView * mainScrollview;
@property (nonatomic, strong) YYLabel * jingguoLabel;
@property (nonatomic, strong) YYLabel * xiaojieLabel;
@end
@implementation XJSOSDetailSmallSumViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.view.backgroundColor = CViewBgColor;
[self createUI];
[self createData];
}
- (void)createUI {
self.mainScrollview = [[UIScrollView alloc] initWithFrame:CGRectMake(kRealValue(10), kRealValue(58), kScreenWidth - kRealValue(20), kScreenHeight - kTopHeight - kRealValue(58))];
self.mainScrollview.layer.cornerRadius = 10.0;
self.mainScrollview.layer.masksToBounds = YES;
[self.view addSubview:self.mainScrollview];
UILabel * jingguoTitle = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(14), kRealValue(24), 100, 15)];
jingguoTitle.text = @"事件经过";
jingguoTitle.textColor = CFontColor1;
jingguoTitle.font = BOLDSYSTEMFONT(14);
[self.mainScrollview addSubview:jingguoTitle];
self.jingguoLabel = [[YYLabel alloc] initWithFrame:CGRectMake(kRealValue(13),kRealValue(55), self.mainScrollview.width, 13)];
self.jingguoLabel.textAlignment = NSTextAlignmentLeft;
self.jingguoLabel.font = MEDIUMFONT(13);
self.jingguoLabel.textColor = UIColorHex(#333333);
self.jingguoLabel.numberOfLines = 0;
// 查询文本排版结果
// 计算文本尺寸YYTextLayout
CGSize maxSize = CGSizeMake(self.mainScrollview.width, MAXFLOAT);
YYTextLayout * layout = [YYTextLayout layoutWithContainerSize:maxSize text:self.jingguoLabel.attributedText];
self.jingguoLabel.textLayout = layout;
CGFloat introHeight = layout.textBoundingSize.height;
self.jingguoLabel.width = maxSize.width;
// 记录真正的正确高度
self.jingguoLabel.height = introHeight;
// 显示文本排版结果
[self.mainScrollview addSubview:self.jingguoLabel];
UILabel * xiaojieTitle = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(14), self.jingguoLabel.bottom + kRealValue(24), 100, 15)];
xiaojieTitle.text = @"事件小结";
xiaojieTitle.textColor = CFontColor1;
xiaojieTitle.font = BOLDSYSTEMFONT(14);
[self.mainScrollview addSubview:xiaojieTitle];
//小结
self.xiaojieLabel = [[YYLabel alloc] initWithFrame:CGRectMake(kRealValue(13),kRealValue(55), self.mainScrollview.width, 13)];
self.xiaojieLabel.textAlignment = NSTextAlignmentLeft;
self.xiaojieLabel.font = MEDIUMFONT(13);
self.xiaojieLabel.textColor = UIColorHex(#333333);
self.xiaojieLabel.numberOfLines = 0;
// 查询文本排版结果
// 计算文本尺寸YYTextLayout
YYTextLayout * sumlayout = [YYTextLayout layoutWithContainerSize:maxSize text:self.xiaojieLabel.attributedText];
self.xiaojieLabel.textLayout = layout;
CGFloat sumIntroHeight = sumlayout.textBoundingSize.height;
// 记录真正的正确高度
self.xiaojieLabel.height = sumIntroHeight;
// 显示文本排版结果
[self.mainScrollview addSubview:self.xiaojieLabel];
self.mainScrollview.contentSize = CGSizeMake(self.mainScrollview.width, self.xiaojieLabel.bottom + kRealValue(20));
}
- (void)createData {
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:self.hospital_id forKey:@"id"];
JKCQAPI * smallApi = [[JKCQAPI alloc] init:self tag:@"SMALLAPI" NeedToken:@""];
[smallApi getSOSSmallSumData:parmDic];
}
- (void)Failed:(NSString*)message tag:(NSString*)tag
{
[self showMBProgressHUDOnlyWithString:message];
[self hiddenAllMBProgressHUD];
}
- (void)Sucess:(id)response tag:(NSString*)tag
{
if ([tag isEqualToString:@"DETAILAPI"]) {
NSDictionary * dic = response;
if (ValidDict(dic)) {
NSString * jingguoString = [dic objectForKey:@"orderThrough"];
NSString * xiaojieString = [dic objectForKey:@"orderResult"];
if (!ValidStr(jingguoString)) {
NSAttributedString *attrStr = [[NSAttributedString alloc] initWithData:[jingguoString dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType } documentAttributes:nil error:nil];
self.jingguoLabel.frame = CGRectMake(kRealValue(13),kRealValue(55), self.mainScrollview.width, 13);
// 查询文本排版结果
// 计算文本尺寸YYTextLayout
CGSize maxSize = CGSizeMake(self.mainScrollview.width, MAXFLOAT);
YYTextLayout * layout = [YYTextLayout layoutWithContainerSize:maxSize text:self.jingguoLabel.attributedText];
self.jingguoLabel.textLayout = layout;
CGFloat introHeight = layout.textBoundingSize.height;
// 记录真正的正确高度
self.jingguoLabel.height = introHeight;
}
if (!ValidStr(xiaojieString)) {
//小结
NSAttributedString * sumAttrStr = [[NSAttributedString alloc] initWithData:[xiaojieString dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType } documentAttributes:nil error:nil];
self.xiaojieLabel.frame = CGRectMake(kRealValue(13),kRealValue(55), self.mainScrollview.width, 13);
self.xiaojieLabel.attributedText = sumAttrStr;
// 查询文本排版结果
// 计算文本尺寸YYTextLayout
CGSize maxSize = CGSizeMake(self.mainScrollview.width, MAXFLOAT);
YYTextLayout * sumlayout = [YYTextLayout layoutWithContainerSize:maxSize text:self.xiaojieLabel.attributedText];
self.xiaojieLabel.textLayout = sumlayout;
CGFloat sumIntroHeight = sumlayout.textBoundingSize.height;
// 记录真正的正确高度
self.xiaojieLabel.height = sumIntroHeight;
// 显示文本排版结果
}
self.mainScrollview.contentSize = CGSizeMake(self.mainScrollview.width, self.xiaojieLabel.bottom + kRealValue(20));
}
}
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
@@ -1,15 +1,16 @@
//
// MineQuestionRecordViewController.m
// XJSOSLookDoctorDetailViewController.m
// EscortProject
//
// Created by on 2023/7/25.
// Created by on 2023/8/22.
//
#import "MineQuestionRecordViewController.h"
#import "MineVideoRecordViewController.h"
#import "MinePictureRecordViewController.h"
#import "XJSOSLookDoctorDetailViewController.h"
#import "XJSOSDetailInfoViewController.h"
#import "XJSOSDetailSmallSumViewController.h"
@interface MineQuestionRecordViewController ()<UICollectionViewDataSource,UICollectionViewDelegate>
@interface XJSOSLookDoctorDetailViewController ()<UICollectionViewDataSource,UICollectionViewDelegate>
/** 顶部控件*/
@property (nonatomic, weak) UIScrollView *topView;
@@ -24,7 +25,7 @@
@end
@implementation MineQuestionRecordViewController
@implementation XJSOSLookDoctorDetailViewController
#pragma mark - 懒加载
- (NSMutableArray *)titleButtons {
@@ -37,10 +38,9 @@
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.isHidenNaviBar = NO;
self.title = @"我的咨询";
self.view.backgroundColor = UIColorBackground;
// [self addNavigationItemWithImageNames:@[@"backIcon@2x"] isLeft:YES target:self action:@selector(popVc) tags:@[@"100"]];
self.isHidenNaviBar = false;
self.navigationItem.title = @"应急就医";
self.view.backgroundColor = CViewBgColor;
[self createUI];
}
@@ -61,7 +61,7 @@
//
[self setupAllChildViewController];
[self setupAllTitle:self.titleSelected];
[self setupAllTitle];
//
self.automaticallyAdjustsScrollViewInsets = NO;
@@ -70,18 +70,18 @@
#pragma mark - 添加所有的子控制器
- (void)setupAllChildViewController {
MinePictureRecordViewController * pictureVc = [[MinePictureRecordViewController alloc] init];
pictureVc.navigationItem.title = @"图文咨询";
pictureVc.selectOnes = self.type;
pictureVc.view.backgroundColor = CViewBgColor;
[self addChildViewController:pictureVc];
XJSOSDetailInfoViewController * infoVC = [[XJSOSDetailInfoViewController alloc] init];
infoVC.sessionId = self.sessionId;
infoVC.view.backgroundColor = UIColorBackground;
infoVC.navigationItem.title = @"工单信息";
[self addChildViewController:infoVC];
//
MineVideoRecordViewController * videoVc = [[MineVideoRecordViewController alloc] init];
videoVc.navigationItem.title = @"视频咨询";
videoVc.selectOnes = self.type;
videoVc.view.backgroundColor = CViewBgColor;
[self addChildViewController:videoVc];
XJSOSDetailSmallSumViewController * sumVc = [[XJSOSDetailSmallSumViewController alloc] init];
sumVc.hospital_id = self.hospital_id;
sumVc.view.backgroundColor = UIColorBackground;
sumVc.navigationItem.title = @"应急小结";
[self addChildViewController:sumVc];
}
@@ -122,7 +122,7 @@
}
#pragma mark - 添加标题
- (void)setupAllTitle:(NSInteger)titleSelected{
- (void)setupAllTitle{
NSUInteger count = self.childViewControllers.count;
CGFloat btnX = 0;
@@ -150,7 +150,7 @@
[_topView addSubview:titleButton];
if (i == titleSelected - 10) {
if (i == 0) {
// 线
// 线 =
// 线x = x
@@ -187,7 +187,7 @@
layout.minimumLineSpacing = 0;
// UICollectionView
UICollectionView *collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0,kRealValue(48), kScreenWidth, kScreenHeight - kRealValue(48) ) collectionViewLayout:layout];
UICollectionView *collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0,kRealValue(48), kScreenWidth, kScreenHeight - kRealValue(48) - kTopHeight) collectionViewLayout:layout];
collectionView.backgroundColor = [UIColor whiteColor];
[self.view addSubview:collectionView];
_collectionView = collectionView;
@@ -1,38 +0,0 @@
//
// BigillessDetailModel.h
// EscortProject
//
// Created by 仁康信息 on 2023/8/21.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface BigillessDetailModel : NSObject
@property (nonatomic, copy) NSString * detail_id;
@property (nonatomic, copy) NSString * hospitalId;
@property (nonatomic, copy) NSString * hospitalName;
@property (nonatomic, copy) NSString * medicalCardNo;
@property (nonatomic, copy) NSString * registerCategory;
@property (nonatomic, copy) NSString * registerCategory_dictText;
@property (nonatomic, copy) NSString * yiyuan_id;
@property (nonatomic, copy) NSString * state;
@property (nonatomic, copy) NSString * desireTime;
@property (nonatomic, copy) NSString * reservationOffice;
@property (nonatomic, copy) NSString * createTime;
@property (nonatomic, copy) NSString * reservationDoctor;
@property (nonatomic, copy) NSString * diseaseDescribe;
@property (nonatomic, copy) NSString * rejectionReason;
@property (nonatomic, copy) NSString * realname;
@property (nonatomic, copy) NSString * idNo;
@property (nonatomic, copy) NSString * telPhone;
@property (nonatomic, copy) NSString * reservationNo;
@property (nonatomic, copy) NSString * topState;
@property (nonatomic, copy) NSString * rejectionTime;
@end
NS_ASSUME_NONNULL_END
@@ -1,17 +0,0 @@
//
// BigillessDetailModel.m
// EscortProject
//
// Created by 仁康信息 on 2023/8/21.
//
#import "BigillessDetailModel.h"
@implementation BigillessDetailModel
+ (NSDictionary *)modelCustomPropertyMapper
{
NSDictionary * dic =@{@"topState" :@"newState"};
return dic;
}
@end
@@ -1,19 +0,0 @@
//
// BigillessHospitalModel.h
// EscortProject
//
// Created by 仁康信息 on 2023/8/21.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface BigillessHospitalModel : NSObject
@property (nonatomic, copy) NSString * yiyuan_id;
@property (nonatomic, copy) NSString * name;
@end
NS_ASSUME_NONNULL_END
@@ -1,18 +0,0 @@
//
// BigillessHospitalModel.m
// EscortProject
//
// Created by 仁康信息 on 2023/8/21.
//
#import "BigillessHospitalModel.h"
@implementation BigillessHospitalModel
+ (NSDictionary *)modelCustomPropertyMapper
{
NSDictionary * dic =@{@"yiyuan_id" :@"id"};
return dic;
}
@end
@@ -1,24 +0,0 @@
//
// BigillnessModel.h
// EscortProject
//
// Created by 仁康信息 on 2023/8/21.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface BigillnessModel : NSObject
@property (nonatomic, copy) NSString * zixun_id;
@property (nonatomic, copy) NSString * hospitalName;
@property (nonatomic, copy) NSString * reservationOffice;
@property (nonatomic, copy) NSString * reservationDoctor;
@property (nonatomic, copy) NSString * realname;
@property (nonatomic, copy) NSString * state ;// 状态 1未派单 2已派单 3已接单 4已预约 5已完成 6操作人员驳回 7驻场人员驳回 8 超时未接单 6,7,8红色 其余都是绿色
@property (nonatomic, copy) NSString * createTime;
@property (nonatomic, copy) NSString * desireTime;
@end
NS_ASSUME_NONNULL_END
@@ -1,19 +0,0 @@
//
// BigillnessModel.m
// EscortProject
//
// Created by 仁康信息 on 2023/8/21.
//
#import "BigillnessModel.h"
@implementation BigillnessModel
+ (NSDictionary *)modelCustomPropertyMapper
{
NSDictionary * dic =@{@"zixun_id" :@"id"};
return dic;
}
@end
@@ -1,23 +0,0 @@
//
// EmergencyContactModel.h
// EscortProject
//
// Created by 仁康信息 on 2023/7/27.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface EmergencyContactModel : NSObject
@property (nonatomic, copy) NSString * contact_ID;
@property (nonatomic, copy) NSString * phone;
@property (nonatomic, copy) NSString * familyRelation_dictText;
@property (nonatomic, copy) NSString * name;
@property (nonatomic, copy) NSString * idCard;
@property (nonatomic, copy) NSString * familyRelation;
@end
NS_ASSUME_NONNULL_END
@@ -1,19 +0,0 @@
//
// EmergencyContactModel.m
// EscortProject
//
// Created by 仁康信息 on 2023/7/27.
//
#import "EmergencyContactModel.h"
@implementation EmergencyContactModel
+ (NSDictionary *)modelCustomPropertyMapper
{
NSDictionary * dic =@{@"contact_ID" :@"id"};
return dic;
}
@end
@@ -1,30 +0,0 @@
//
// MineCenterUserModel.h
// EscortProject
//
// Created by 仁康信息 on 2023/7/26.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface MineCenterUserModel : NSObject
@property (nonatomic, copy) NSString * realname;
@property (nonatomic, copy) NSString * workNo;
@property (nonatomic, copy) NSString * phone;
@property (nonatomic, copy) NSString * idCard;
@property (nonatomic, copy) NSString * sex;
@property (nonatomic, copy) NSString * sex_dictText;
@property (nonatomic, copy) NSString * personType;
@property (nonatomic, copy) NSString * personType_dictText;
@property (nonatomic, copy) NSString * orgCode;
@property (nonatomic, copy) NSString * avatar;
@property (nonatomic, copy) NSString * value;
@property (nonatomic, copy) NSString * text;
@property (nonatomic, copy) NSString * title;
@end
NS_ASSUME_NONNULL_END
@@ -1,107 +0,0 @@
//
// SOSDoctorDetailInfoModel.h
// EscortProject
//
// Created by 仁康信息 on 2023/8/23.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface SOSDoctorDetailHistory : NSObject
@property (nonatomic, copy) NSString * status;
@property (nonatomic, copy) NSString * stationUserId;
@property (nonatomic, copy) NSString * stationUserName;
@property (nonatomic, copy) NSString * stationUserSex;
@property (nonatomic, copy) NSString * accept_dictText;
@property (nonatomic, copy) NSString * updateTime;
@property (nonatomic, copy) NSString * stationBusiness_dictText;
@property (nonatomic, copy) NSString * sendOrderHospital;
@property (nonatomic, copy) NSString * orderId;
@property (nonatomic, copy) NSString * stationBusiness;
@property (nonatomic, copy) NSString * createTime;
@property (nonatomic, copy) NSString * createBy;
@property (nonatomic, copy) NSString * history_id;
@property (nonatomic, copy) NSString * transferOrderTime;
@end
@interface SOSDoctorDetailInfoModel : NSObject
@property (nonatomic, copy) NSString * createTimeEnd;
@property (nonatomic, copy) NSString * majorSalvageOpinion;
@property (nonatomic, copy) NSString * infoDesc;
@property (nonatomic, copy) NSString * delFlag;
@property (nonatomic, copy) NSString * detail_id;
@property (nonatomic, copy) NSString * initiatorUserDepart;
@property (nonatomic, copy) NSString * stationUserMobile;
@property (nonatomic, copy) NSString * memo;
@property (nonatomic, copy) NSString * orderDetail;
@property (nonatomic, copy) NSString * stationUserAvatar;
@property (nonatomic, copy) NSString * updateBy;
@property (nonatomic, copy) NSString * sessionNow;
@property (nonatomic, copy) NSString * stationUserSex;
@property (nonatomic, copy) NSString * stationUserId;
@property (nonatomic, copy) NSString * isDispatch_dictText;
@property (nonatomic, copy) NSString * createBy;
@property (nonatomic, copy) NSString * stationRejectionTime;
@property (nonatomic, copy) NSString * initiatorUserName;
@property (nonatomic, copy) NSString * salvageUserAge;
@property (nonatomic, copy) NSString * createTime;
@property (nonatomic, copy) NSString * resourceId;
@property (nonatomic, copy) NSString * operationUserSex;
@property (nonatomic, copy) NSString * stationBusiness;
@property (nonatomic, copy) NSString * majorUserSex;
@property (nonatomic, copy) NSString * status;
@property (nonatomic, copy) NSString * operationUserName;
@property (nonatomic, copy) NSString * stationUserDepart;
@property (nonatomic, copy) NSString * salvageUserSecondDepart;
@property (nonatomic, copy) NSString * majorUserId;
@property (nonatomic, copy) NSString * initiatorUserSex;
@property (nonatomic, strong) NSArray<SOSDoctorDetailHistory *> * orderSendRecordList;
@property (nonatomic, copy) NSString * stationBusiness_dictText;
@property (nonatomic, copy) NSString * majorResponseTime;
@property (nonatomic, copy) NSString * salvageUserMobile;
@property (nonatomic, copy) NSString * initiatorUserId;
@property (nonatomic, copy) NSString * orderStatus;
@property (nonatomic, copy) NSString * salvageUserAvatar;
@property (nonatomic, copy) NSString * initiatorType;
@property (nonatomic, copy) NSString * initiatorUserAge;
@property (nonatomic, copy) NSString * sessionId;
@property (nonatomic, copy) NSString * salvageUserName;
@property (nonatomic, copy) NSString * initiatorUserMobile;
@property (nonatomic, copy) NSString * stationUserName;
@property (nonatomic, copy) NSString * updateTime;
@property (nonatomic, copy) NSString * operationUserMobile;
@property (nonatomic, copy) NSString * majorUserName;
@property (nonatomic, copy) NSString * isDispatch;
@property (nonatomic, copy) NSString * orderStatus_dictText;
@property (nonatomic, copy) NSString * resourceName;
@property (nonatomic, copy) NSString * initiatorUserSecondDepart;
@property (nonatomic, copy) NSString * salvageUserDepart;
@property (nonatomic, copy) NSString * orderOverTime;
@property (nonatomic, copy) NSString * initiatorUserIdCard;
@property (nonatomic, copy) NSString * initiatorUserAvatar;
@property (nonatomic, copy) NSString * salvageUserId;
@property (nonatomic, copy) NSString * operationUserId;
@property (nonatomic, copy) NSString * operationResponseTime;
@property (nonatomic, copy) NSString * stationResponseTime;
@property (nonatomic, copy) NSString * operationSendOrderTime;
@property (nonatomic, assign) BOOL isFill;
@property (nonatomic, copy) NSString * sendOrderHospital;
@property (nonatomic, copy) NSString * salvageUserIdCard;
@end
NS_ASSUME_NONNULL_END
@@ -1,40 +0,0 @@
//
// SOSDoctorDetailInfoModel.m
// EscortProject
//
// Created by 仁康信息 on 2023/8/23.
//
#import "SOSDoctorDetailInfoModel.h"
@implementation SOSDoctorDetailHistory
+ (NSDictionary *)modelCustomPropertyMapper
{
NSDictionary * dic =@{@"history_id" :@"id"};
return dic;
}
@end
@implementation SOSDoctorDetailInfoModel
+ (NSDictionary *)modelContainerPropertyGenericClass
{
return @{
@"orderSendRecordList":[SOSDoctorDetailHistory class]
};
}
+ (NSDictionary *)modelCustomPropertyMapper
{
NSDictionary * dic =@{@"detail_id" :@"id"};
return dic;
}
@end
@@ -1,38 +0,0 @@
//
// SOSDoctorModel.h
// EscortProject
//
// Created by 仁康信息 on 2023/8/22.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface SOSDoctorRecordListModel : NSObject
@property (nonatomic, copy) NSString * sos_id;
@property (nonatomic, copy) NSString * sessionId;
@property (nonatomic, copy) NSString * initiatorUserId;
@property (nonatomic, copy) NSString * initiatorUserName;
@property (nonatomic, copy) NSString * createTime;
@property (nonatomic, copy) NSString * initiatorUserSex;
@property (nonatomic, copy) NSString * orderStatus_dictText;
@property (nonatomic, copy) NSString * sendOrderHospital;
@property (nonatomic, copy) NSString * stationBusiness;
@property (nonatomic, copy) NSString * orderStatus;
@property (nonatomic, copy) NSString * stationBusiness_dictText;
@end
@interface SOSDoctorModel : NSObject
@property (nonatomic, strong) NSArray <SOSDoctorRecordListModel *>* records;
@end
NS_ASSUME_NONNULL_END
@@ -1,37 +0,0 @@
//
// SOSDoctorModel.m
// EscortProject
//
// Created by 仁康信息 on 2023/8/22.
//
#import "SOSDoctorModel.h"
@implementation SOSDoctorRecordListModel
+ (NSDictionary *)modelCustomPropertyMapper
{
NSDictionary * dic =@{@"sos_id" :@"id"};
return dic;
}
@end
@implementation SOSDoctorModel
+ (NSDictionary *)modelContainerPropertyGenericClass
{
return @{
@"records":[SOSDoctorRecordListModel class]
};
}
@end
@@ -1,25 +0,0 @@
//
// BigilessTopStatusView.h
// EscortProject
//
// Created by 仁康信息 on 2023/8/21.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface BigilessTopStatusView : UIView
@property (nonatomic, assign) BOOL isSelected;
@property (nonatomic, assign) BOOL isLast;
@property (nonatomic, assign) NSInteger lastType;
@property (nonatomic, copy) NSString * statusString;
@end
NS_ASSUME_NONNULL_END
@@ -1,120 +0,0 @@
//
// BigilessTopStatusView.m
// EscortProject
//
// Created by 仁康信息 on 2023/8/21.
//
#import "BigilessTopStatusView.h"
@interface BigilessTopStatusView ()
@property (nonatomic, strong) UIButton * statusBtn;
@property (nonatomic, strong) UILabel * statusLabel;
@property (nonatomic, strong) UILabel * numberLabel;
@property (nonatomic, strong) UIImageView * statusView;
@property (nonatomic, strong) UIView * lineView;
@end
@implementation BigilessTopStatusView
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self createUI];
}
return self;
}
- (void)createUI {
self.statusBtn = [[UIButton alloc] initWithFrame:CGRectMake(kRealValue(5), 0, kRealValue(38), kRealValue(38))];
[self.statusBtn setImage:[UIImage imageNamed:@"statusTop_nomal"] forState:UIControlStateNormal];
[self.statusBtn setImage:[UIImage imageNamed:@"statusTop_selected"] forState:UIControlStateSelected];
[self addSubview:self.statusBtn];
self.numberLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(5), 0, kRealValue(38), kRealValue(38))];
self.numberLabel.textAlignment = NSTextAlignmentCenter;
self.numberLabel.font = SYSTEMFONT(13);
self.numberLabel.text = @"1";
self.numberLabel.textColor = UIColorHex(#21BEBD);
[self addSubview:self.numberLabel];
self.statusLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, self.statusBtn.bottom + 8, 60, 13)];
self.statusLabel.textAlignment = NSTextAlignmentLeft;
self.statusLabel.font = SYSTEMFONT(13);
self.statusLabel.text = @"在线咨询";
self.statusLabel.textColor = KWhiteColor;
[self addSubview:self.statusLabel];
self.statusView = [[UIImageView alloc] initWithFrame:CGRectMake(self.statusBtn.right + kRealValue(13) , kRealValue(13), 20, 7)];
self.statusView.image = [UIImage imageNamed:@"line_selected"];
self.statusView.hidden = true;
[self addSubview:self.statusView];
self.lineView = [[UIImageView alloc] initWithFrame:CGRectMake(self.statusBtn.right , kRealValue(19), kRealValue(24), 2)];
self.lineView.backgroundColor = KWhiteColor;
self.lineView.hidden = true;
[self addSubview:self.lineView];
}
- (void)setIsSelected:(BOOL)isSelected {
_isSelected = isSelected;
if (_isSelected) {
self.statusBtn.selected = true;
self.statusView.hidden = false;
self.lineView.hidden = true;
self.statusLabel.textColor = KWhiteColor;
}
else {
self.statusBtn.selected = false;
self.statusView.hidden = true;
self.lineView.hidden = false;
self.statusLabel.textColor = UIColorHex(#FBFBFB);
}
}
- (void)setLastType:(NSInteger)lastType {
_lastType = lastType;
if (_lastType == 3) {
self.lineView.hidden = YES;
self.statusView.hidden = YES;
}
self.numberLabel.text = [NSString stringWithFormat:@"%ld",_lastType + 1];
}
- (void)setStatusString:(NSString *)statusString {
_statusString = statusString;
self.statusLabel.text = _statusString;
}
@end
@@ -1,22 +0,0 @@
//
// BigillessListTable.h
// EscortProject
//
// Created by 仁康信息 on 2023/8/19.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
typedef void(^lookDetailBlock)(NSString * card_id);
@interface BigillessListTable : UITableView
@property (nonatomic, strong) NSArray * dataArray;
@property (nonatomic, copy) lookDetailBlock detailBlock;
@end
NS_ASSUME_NONNULL_END
@@ -1,137 +0,0 @@
//
// BigillessListTable.m
// EscortProject
//
// Created by 仁康信息 on 2023/8/19.
//
#import "BigillessListTable.h"
#import "BigillessTableViewCell.h"
@interface BigillessListTable ()<UITableViewDelegate,UITableViewDataSource>
@end
@implementation BigillessListTable
- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style {
if (self = [super initWithFrame:frame style:style]) {
[self createUI];
}
return self;
}
- (void)createUI {
if (@available(iOS 11.0, *)) {
self.estimatedRowHeight = 0;
self.estimatedSectionFooterHeight = 0;
self.estimatedSectionHeaderHeight = 0;
self.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}
self.delegate = self;
self.dataSource = self;
self.backgroundColor = UIColor.clearColor;
self.showsVerticalScrollIndicator = false;
self.showsHorizontalScrollIndicator = false;
self.separatorStyle = UITableViewCellSeparatorStyleNone;
self.estimatedRowHeight = 60;
self.rowHeight = UITableViewAutomaticDimension;
}
- (void)setDataArray:(NSArray *)dataArray {
_dataArray = dataArray;
[self reloadData];
}
#pragma mark - tableview的代理方法
//组数
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return self.dataArray.count;
}
//每组多少行
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 1;
}
//注册cell
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
BigillessTableViewCell * cell = [self dequeueReusableCellWithIdentifier:@"STATUSCELL"];
if (!cell) {
cell = [[BigillessTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"STATUSCELL"];
}
cell.model= self.dataArray[indexPath.section];
cell.backgroundColor = KWhiteColor;
cell.layer.cornerRadius = 10;
cell.layer.masksToBounds = YES;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
//每行高度
//- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
//{
// return kRealValue(77);
//}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
return kRealValue(10);
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
return CGFLOAT_MIN;
}
//组头 --- 组尾
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
return [UIView new];
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
UIView * footerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kRealValue(10))];
return footerView;
}
////cell点击事件
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
BigillnessModel * model= self.dataArray[indexPath.section];
if (self.detailBlock) {
self.detailBlock(model.zixun_id);
}
}
@end
@@ -1,193 +0,0 @@
//
// BigillessTableViewCell.m
// EscortProject
//
// Created by 仁康信息 on 2023/8/19.
//
#import "BigillessTableViewCell.h"
@interface BigillessTableViewCell()
@property (nonatomic, strong) UILabel * hospitalLabel;
@property (nonatomic, strong) UILabel * roomLabel;
@property (nonatomic, strong) UILabel * doctorLabel;
@property (nonatomic, strong) UILabel * peopleLabel;
@property (nonatomic, strong) UILabel * timeLabel;
@property (nonatomic, strong) UILabel * statusLabel;
@end
@implementation BigillessTableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
[self createUI];
}
return self;
}
- (void)createUI {
self.hospitalLabel = [[UILabel alloc] init];
self.hospitalLabel.textColor = UIColorHex(#333333);
self.hospitalLabel.font = BOLDSYSTEMFONT(14);
self.hospitalLabel.textAlignment = NSTextAlignmentLeft;
self.hospitalLabel.text = @"预约医院:";
[self.contentView addSubview:self.hospitalLabel];
[self.hospitalLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_offset(14);
make.top.mas_offset(16);
make.height.mas_offset(14);
}];
[self.hospitalLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
self.roomLabel = [[UILabel alloc] init];
self.roomLabel.textColor = UIColorHex(#333333);
self.roomLabel.font = SYSTEMFONT(13);
self.roomLabel.textAlignment = NSTextAlignmentLeft;
self.roomLabel.text = @"预约科室:";
[self.contentView addSubview:self.roomLabel];
[self.roomLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_offset(14);
make.top.mas_equalTo(self.hospitalLabel.mas_bottom).offset(14);
make.height.mas_offset(14);
make.right.mas_offset (0);
}];
self.doctorLabel = [[UILabel alloc] init];
self.doctorLabel.textColor = UIColorHex(#333333);
self.doctorLabel.font = SYSTEMFONT(14);
self.doctorLabel.textAlignment = NSTextAlignmentLeft;
self.doctorLabel.text = @"预约医生:";
[self.contentView addSubview:self.doctorLabel];
[self.doctorLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_offset(14);
make.top.mas_equalTo(self.roomLabel.mas_bottom).offset(14);
make.height.mas_offset(14);
make.right.mas_offset (0);
}];
self.peopleLabel = [[UILabel alloc] init];
self.peopleLabel.textColor = UIColorHex(#333333);
self.peopleLabel.font = SYSTEMFONT(14);
self.peopleLabel.text = @"预约人:";
self.peopleLabel.textAlignment = NSTextAlignmentLeft;
[self.contentView addSubview:self.peopleLabel];
[self.peopleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_offset(14);
make.top.mas_equalTo(self.doctorLabel.mas_bottom).offset(14);
make.height.mas_offset(14);
make.right.mas_offset (0);
make.bottom.mas_offset(-15);
}];
self.timeLabel = [[UILabel alloc] init];
self.timeLabel.textColor = UIColorHex(#999999);
self.timeLabel.font = SYSTEMFONT(13);
self.timeLabel.textAlignment = NSTextAlignmentRight;
[self.contentView addSubview:self.timeLabel];
[self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(@17);
make.height.mas_offset(12);
make.right.mas_offset (-17);
}];
self.statusLabel = [[UILabel alloc] init];
self.statusLabel.textColor = UIColorHex(#16C716);
self.statusLabel.font = SYSTEMFONT(14);
self.statusLabel.textAlignment = NSTextAlignmentRight;
self.statusLabel.text = @"待派单";
[self.contentView addSubview:self.statusLabel];
[self.statusLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(self.timeLabel.mas_right);
make.top.mas_equalTo(self.timeLabel.mas_bottom).offset(28);
make.height.mas_offset(12);
make.right.mas_offset (-17);
}];
}
- (void)setModel:(BigillnessModel *)model {
_model = model;
self.hospitalLabel.text = [NSString stringWithFormat:@"预约医院:%@",model.hospitalName] ;
self.roomLabel.text = [NSString stringWithFormat:@"预约科室:%@",model.reservationOffice];
self.doctorLabel.text = [NSString stringWithFormat:@"预约医生:%@",model.reservationDoctor];
self.peopleLabel.text = [NSString stringWithFormat:@"预约人:%@",model.realname];
self.timeLabel.text = model.createTime;
//状态 1未派单 2已派单 3已接单 4已预约 5已完成 6操作人员驳回 7驻场人员驳回 8 超时未接单 6,7,8红色 其余都是绿色
if ([_model.state integerValue] == 1 ) {
self.statusLabel.text =@"待派单";
self.statusLabel.textColor = UIColorHex(#16C716);
}
if ([_model.state integerValue] == 2 ) {
self.statusLabel.text =@"已派单";
self.statusLabel.textColor = UIColorHex(#16C716);
}
if ([_model.state integerValue] == 3 ) {
self.statusLabel.text =@"已接单";
self.statusLabel.textColor = UIColorHex(#16C716);
}
if ([_model.state integerValue] == 4 ) {
self.statusLabel.text =@"已预约";
self.statusLabel.textColor = UIColorHex(#16C716);
}
if ([_model.state integerValue] == 5 ) {
self.statusLabel.text =@"已完成";
self.statusLabel.textColor = UIColorHex(#16C716);
}
if ([_model.state integerValue] == 6 ) {
self.statusLabel.text =@"被驳回";
self.statusLabel.textColor = KRedColor;
}
if ([_model.state integerValue] == 7 ) {
self.statusLabel.text =@"被驳回";
self.statusLabel.textColor = KRedColor;
}
if ([_model.state integerValue] == 8 ) {
self.statusLabel.text =@"未响应";
self.statusLabel.textColor = KRedColor;
}
}
@end
@@ -1,101 +0,0 @@
//
// HistoryOrderTableViewCell.m
// EscortProject
//
// Created by 仁康信息 on 2023/8/23.
//
#import "HistoryOrderTableViewCell.h"
@implementation HistoryOrderTableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
[self createUI];
}
return self;
}
- (void)createUI {
NSArray * leftInfoArray = @[@"派单时间",@"当前状态",@"派单业务",@"派单医院",@"驻场人员",@"转单时间"];
UIView * linTwoView;
for (int j = 0; j < leftInfoArray.count; j ++) {
UIView * orderView = [self orderInfoLabelViewWithFrame:CGRectMake(0, kRealValue(5) + kRealValue(25) * j, kScreenWidth - kRealValue(22), kRealValue(25)) withLeftText:leftInfoArray[j] withRightLabTag:300 + j];
[self addSubview:orderView];
if (j == leftInfoArray.count - 1) {
linTwoView = [[UIView alloc] initWithFrame:CGRectMake(0, orderView.bottom + kRealValue(8), kScreenWidth - kRealValue(22), 1)];
linTwoView.backgroundColor = UIColorHex(#E0E0E0);
}
[self addSubview:linTwoView];
}
}
- (UIView *)orderInfoLabelViewWithFrame:(CGRect)frame
withLeftText:(NSString *)leftText
withRightLabTag:(NSInteger)rightTag {
UIView * labeView = [[UIView alloc] initWithFrame:frame];
UILabel * leftLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(14), 0, 80, kRealValue(25))];
leftLabel.textColor = UIColorHex(#666666);
leftLabel.font = SYSTEMFONT(13);
leftLabel.textAlignment = NSTextAlignmentLeft;
leftLabel.text = leftText;
[labeView addSubview:leftLabel];
UILabel * rightLabel = [[UILabel alloc] initWithFrame:CGRectMake(kScreenWidth - kRealValue(22) - 200 - kRealValue(14), 0, 200, kRealValue(25))];
rightLabel.textColor = UIColorHex(#333333);
rightLabel.font = SYSTEMFONT(13);
rightLabel.textAlignment = NSTextAlignmentRight;
rightLabel.text = leftText;
rightLabel.tag = rightTag;
[labeView addSubview:rightLabel];
return labeView;
}
- (void)setHistoryModel:(SOSDoctorDetailHistory *)historyModel {
_historyModel = historyModel;
UILabel * timeLabel = [self viewWithTag:300];
timeLabel.text = _historyModel.createTime;
UILabel * currentStatusLabel = [self viewWithTag:301];
currentStatusLabel.text = _historyModel.accept_dictText;
UILabel * yewuLabel = [self viewWithTag:302];
yewuLabel.text = _historyModel.stationBusiness_dictText;
UILabel * hospitalLabel = [self viewWithTag:303];
hospitalLabel.text = _historyModel.sendOrderHospital;
UILabel * zhuchangLabel = [self viewWithTag:304];
zhuchangLabel.text = _historyModel.stationUserName;
UILabel * zhuangTimeLabel = [self viewWithTag:305];
zhuangTimeLabel.text = _historyModel.transferOrderTime;
}
@end
@@ -1,77 +0,0 @@
//
// MineHeardTableViewCell.m
// EscortProject
//
// Created by 仁康信息 on 2023/7/26.
//
#import "MineHeardTableViewCell.h"
@interface MineHeardTableViewCell ()
@property (nonatomic, strong) UILabel * headLabel;
@property (nonatomic, strong) UIImageView * heardImage ;
@end
@implementation MineHeardTableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
[self createUI];
}
return self;
}
- (void)createUI {
self.headLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, 24, 100, 14)];
self.headLabel.textColor = UIColorHex(#666666);
self.headLabel.text = @"头像";
self.headLabel.font = MEDIUMFONT(14);
self.headLabel.textAlignment = NSTextAlignmentLeft;
[self.contentView addSubview:self.headLabel];
self.heardImage = [[UIImageView alloc] initWithFrame:CGRectMake(kScreenWidth - 33 - 45, 8, 45, 45)];
self.heardImage.layer.cornerRadius = 22.0;
self.heardImage.layer.masksToBounds = YES;
[self.contentView addSubview:self.heardImage];
}
- (void)setHeardModel:(MineCenterUserModel *)heardModel {
_heardModel = heardModel;
NSString * photo = [NSString stringWithFormat:@"%@%@",ResourceAddress,_heardModel.avatar];
NSString * str1 = @"\\";
photo = [ photo stringByReplacingOccurrencesOfString:str1 withString:@"/"];
NSString *encodedString3 = CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef) photo, (CFStringRef)@"!$&'()*+,-./:;=?@_~%#[]", NULL, kCFStringEncodingUTF8));
if ([_heardModel.sex integerValue] == 1) { //女[]
[self.heardImage sd_setImageWithURL:[NSURL URLWithString:encodedString3] placeholderImage:[UIImage imageNamed:@"heard_woman"]];
}else
{
[self.heardImage sd_setImageWithURL:[NSURL URLWithString:encodedString3] placeholderImage:[UIImage imageNamed:@"heard_man"]];
}
}
@end
@@ -1,29 +0,0 @@
//
// MineUserInfoTable.h
// EscortProject
//
// Created by 仁康信息 on 2023/7/26.
//
#import <UIKit/UIKit.h>
#import "MineCenterUserModel.h"
#import "EmergencyContactModel.h"
NS_ASSUME_NONNULL_BEGIN
typedef void(^addContactBlock)();
typedef void(^editContactMode)(EmergencyContactModel * model);
@interface MineUserInfoTable : UITableView
@property (nonatomic, strong) MineCenterUserModel * model;
@property (nonatomic, copy) addContactBlock addBlcok;
@property (nonatomic, copy) editContactMode editBlcok;
@property (nonatomic, strong) NSArray * dataArray;
@end
NS_ASSUME_NONNULL_END
@@ -1,265 +0,0 @@
//
// MineUserInfoTable.m
// EscortProject
//
// Created by 仁康信息 on 2023/7/26.
//
#import "MineUserInfoTable.h"
#import "MineHeardTableViewCell.h"
#import "EmergencyContactModel.h"
@interface MineUserInfoTable ()<UITableViewDelegate,UITableViewDataSource>
@end
@implementation MineUserInfoTable
- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style
{
if (self = [super initWithFrame:frame style:style])
{
[self createUI];
}
return self;
}
- (void)createUI
{
if ([[UIDevice currentDevice].systemVersion floatValue] >= 11) {
self.estimatedRowHeight = 0;
self.estimatedSectionFooterHeight = 0;
self.estimatedSectionHeaderHeight = 0;
self.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}
self.delegate = self;
self.backgroundColor = CViewBgColor;
self.dataSource = self;
self.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
self.showsVerticalScrollIndicator = NO;
}
- (void)setModel:(MineCenterUserModel *)model {
_model = model;
[self reloadData];
}
- (void)setDataArray:(NSArray *)dataArray {
_dataArray = dataArray;
[self reloadData];
}
#pragma mark - DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
if (section == 0) {
return 8;
}
return self.dataArray.count;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 2;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0) {
//头像
if (indexPath.row == 0) {
MineHeardTableViewCell * heardCell = [tableView dequeueReusableCellWithIdentifier:@"HEARDCELL"];
if (!heardCell) {
heardCell = [[MineHeardTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"HEARDCELL"];
}
heardCell.backgroundColor = KWhiteColor;
heardCell.heardModel = self.model;
heardCell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return heardCell;
}else
{
NSArray * sectionOne = @[@"姓名",@"性别",@"工号",@"手机号",@"身份证号",@"人员类型",@"所属部门"];
NSArray * sectionTwo ;
NSString * workNo = @"--";
NSString * sex_dictText = @"--";
NSString * realname = @"--";
NSString * phone = @"--";
NSString * idCard = @"--";
NSString * personType_dictText = @"--";
NSString * orgCode = @"--";
if (!ValidStr(self.model.workNo)) {
workNo = [NSString stringWithFormat:@"%@",self.model.workNo];
}
if (!ValidStr(self.model.realname)) {
realname = [NSString stringWithFormat:@"%@",self.model.realname];
}
if (!ValidStr(self.model.sex_dictText)) {
sex_dictText = [NSString stringWithFormat:@"%@",self.model.sex_dictText];
}
if (!ValidStr(self.model.phone)) {
phone = [NSString stringWithFormat:@"%@",self.model.phone];
}
if (!ValidStr(self.model.idCard)) {
idCard = [NSString stringWithFormat:@"%@",self.model.idCard];
}
if (!ValidStr(self.model.personType_dictText)) {
personType_dictText = [NSString stringWithFormat:@"%@",self.model.personType_dictText];
}
if (!ValidStr(self.model.orgCode)) {
orgCode = [NSString stringWithFormat:@"%@",self.model.orgCode];
}
sectionTwo = @[realname,sex_dictText,workNo,phone,idCard,personType_dictText,orgCode];
static NSString * cellID = @"cellID";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellID];
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.textLabel.font = SYSTEMFONT(14);
if (self.model) {
cell.detailTextLabel.text = sectionTwo[indexPath.row - 1];
}
cell.textLabel.text = sectionOne[indexPath.row - 1];
cell.textLabel.textColor = UIColorHex(#666666);
cell.textLabel.font = SYSTEMFONT(14);
cell.detailTextLabel.font = SYSTEMFONT(14);
cell.detailTextLabel.textColor = UIColorHex(#333333);
cell.backgroundColor = KWhiteColor;
return cell;
}
}
if (indexPath.section == 1) {
EmergencyContactModel * model = self.dataArray[indexPath.row];
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"CONNETCELL"];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"CONNETCELL"];
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.textLabel.font = SYSTEMFONT(14);
cell.textLabel.text = [NSString stringWithFormat:@"%@-%@",model.name,model.phone];
return cell;
}
return UITableViewCell.new;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0) {
if (indexPath.row == 0) {
return 62;
}else
{
return 45;
}
}
return 46;
}
- (CGFloat )tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
if (section == 1) {
return 50;
}
return CGFLOAT_MIN;
}
- (CGFloat )tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return CGFLOAT_MIN;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
if (section == 1) {
UIView * sectionHeardView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 50)];
sectionHeardView.backgroundColor = CViewBgColor;
UIView * labView = [[UIView alloc] initWithFrame:CGRectMake(0, 10, kScreenWidth, 40)];
labView.backgroundColor = KWhiteColor;
[sectionHeardView addSubview:labView];
UILabel * heardLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, 0, 200, 40)];
heardLabel.text = @"紧急联系人";
heardLabel.textColor = UIColorHex(#666666);
heardLabel.font = SYSTEMFONT(14);
heardLabel.textAlignment = NSTextAlignmentLeft;
[labView addSubview:heardLabel];
UIButton * addBtn = [[UIButton alloc] initWithFrame:CGRectMake(kScreenWidth - 18 - 40, 12, 40, 13)];
[addBtn setTitle:@"新增" forState:UIControlStateNormal];
addBtn.titleLabel.textAlignment = NSTextAlignmentRight;
[addBtn setTitleColor:UIColorHex(#3390FF) forState:UIControlStateNormal];
addBtn.titleLabel.font = SYSTEMFONT(13);
[addBtn addTarget:self action:@selector(addEmergencyContact) forControlEvents:UIControlEventTouchUpInside];
[labView addSubview:addBtn];
return sectionHeardView;
}
return UIView.new;
}
- (void)addEmergencyContact {
if (self.addBlcok) {
self.addBlcok();
}
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 1) {
EmergencyContactModel * model = self.dataArray[indexPath.row];
self.editBlcok(model);
}
}
@end
@@ -1,50 +0,0 @@
//
// MyCenterHeardView.h
// EscortProject
//
// Created by 仁康信息 on 2023/4/23.
//
#import <UIKit/UIKit.h>
#import "MineCenterUserModel.h"
NS_ASSUME_NONNULL_BEGIN
@protocol myCenterHeardToolsDelegate <NSObject>
/*
进行中
*/
- (void)myCenterInProgress;
/*
待评价
*/
- (void)waitEvaluation;
/*
已评价
*/
- (void)completeEvaluation;
/*
历史
*/
- (void)myHistoryAction;
//查看全部
- (void)lookAllQuestion;
- (void)heardImageOnClick;
@end
@interface MyCenterHeardView : UIView
@property (nonatomic, weak)id<myCenterHeardToolsDelegate> heardDelegate;
@property (nonatomic, assign) NSInteger number;
@property (nonatomic, strong) MineCenterUserModel * heardModel;
@end
NS_ASSUME_NONNULL_END
@@ -1,203 +0,0 @@
//
// MyCenterHeardView.m
// EscortProject
//
// Created by 仁康信息 on 2023/4/23.
//
#import "MyCenterHeardView.h"
@interface MyCenterHeardView ()
@property (nonatomic, strong) UIImageView * heardImage;
@property (nonatomic, strong) UILabel * nameLabel;
@property (nonatomic, strong) UILabel * numberLabel;
@property (nonatomic, strong) YYLabel * lookMoreLabel;
@end
@implementation MyCenterHeardView
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self createUI];
}
return self;
}
- (void)createUI {
UIImageView * heardImg = [[UIImageView alloc] initWithFrame:CGRectMake(kRealValue(26), - kRealValue(16) , 52, 52)];
self.heardImage = heardImg;
heardImg.layer.cornerRadius = 26;
heardImg.layer.masksToBounds = true;
heardImg.userInteractionEnabled = true;
heardImg.image = [UIImage imageNamed:@"heard_woman"] ;
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(heardImageAction)];
[heardImg addGestureRecognizer:tap];
[self addSubview:heardImg];
self.nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.heardImage.right + kRealValue(8), kRealValue(10), self.width - self.heardImage.right - kRealValue(10), 15)];
self.nameLabel.textColor = CFontColor1;
self.nameLabel.font = SYSTEMFONT(15);
self.nameLabel.textAlignment = NSTextAlignmentLeft;
self.nameLabel.text = @"未登录";
[self addSubview:self.nameLabel];
self.lookMoreLabel = [[YYLabel alloc] initWithFrame:CGRectMake(kScreenWidth - kRealValue(100), kRealValue(10), kRealValue(60), 15)];
self.lookMoreLabel.textColor = CFontColor1;
self.lookMoreLabel.font = SYSTEMFONT(13);
self.lookMoreLabel.textAlignment = NSTextAlignmentRight;
self.lookMoreLabel.text = @"查看更多>";
MJWeakSelf
[self.lookMoreLabel setTextTapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
if ([weakSelf.heardDelegate respondsToSelector:@selector(lookAllQuestion)]) {
[weakSelf.heardDelegate lookAllQuestion];
}
}];
[self addSubview:self.lookMoreLabel];
NSArray * array = @[@[@"进行中",@"HeardProgress_icon"],@[@"待评价",@"waitEveal_icon"],@[@"已评价",@"alreadyEveal"],@[@"历史",@"HeardHistory_icon"]];
CGFloat w = 58 ;
for (int i = 0 ; i < 4; i++) {
UIView * heardView = [[UIView alloc] initWithFrame:CGRectMake(i * (kScreenWidth - kRealValue(30))/4, self.heardImage.bottom + kRealValue(18),(kScreenWidth - kRealValue(30))/4, self.height - self.heardImage.bottom - kRealValue(18))];
[self addSubview:heardView];
UIImageView * toolsImg = [[UIImageView alloc] initWithFrame:CGRectMake((heardView.width / 2 - 29 ) , kRealValue(18), w, w)];
toolsImg.image = [UIImage imageNamed:array[i][1]];
toolsImg.userInteractionEnabled = true;
if (i == 0)
{
UILabel * numLabel = [[UILabel alloc] initWithFrame:CGRectMake(toolsImg.width - 16, -2, 18, 18)];
numLabel.text = @"1";
numLabel.textColor = KWhiteColor;
numLabel.font = SYSTEMFONT(13);
numLabel.textAlignment = NSTextAlignmentCenter;
numLabel.backgroundColor = KRedColor;
numLabel.layer.borderColor = UIColor.whiteColor.CGColor;
numLabel.layer.borderWidth = 1.0f;
numLabel.layer.cornerRadius = 9.0;
numLabel.layer.masksToBounds = YES;
self.numberLabel = numLabel;
numLabel.hidden = YES;
[toolsImg addSubview:numLabel];
}
[heardView addSubview:toolsImg];
UILabel * toolsLabel = [[UILabel alloc] initWithFrame:CGRectMake(0 ,toolsImg.bottom + kRealValue(5), heardView.width, 15)];
toolsLabel.textColor = CFontColor1;
toolsLabel.font = SYSTEMFONT(13);
toolsLabel.text = array[i][0];
toolsLabel.textAlignment = NSTextAlignmentCenter;
[heardView addSubview:toolsLabel];
UIButton * heardBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, heardView.width, 80)];
[heardBtn addTarget:self action:@selector(heardToolsAction:) forControlEvents:UIControlEventTouchUpInside];
heardBtn.tag = 100 + i;
[heardView addSubview:heardBtn];
}
}
- (void)heardToolsAction:(UIButton *)toolsBtn {
if (toolsBtn.tag == 100) {
if ([self.heardDelegate respondsToSelector:@selector(myCenterInProgress)]) {
[self.heardDelegate myCenterInProgress];
}
}
if (toolsBtn.tag == 101) {
if ([self.heardDelegate respondsToSelector:@selector(waitEvaluation)]) {
[self.heardDelegate waitEvaluation];
}
}
if (toolsBtn.tag == 102) {
if ([self.heardDelegate respondsToSelector:@selector(completeEvaluation)]) {
[self.heardDelegate completeEvaluation];
}
}
if (toolsBtn.tag == 103) {
if ([self.heardDelegate respondsToSelector:@selector(myHistoryAction)]) {
[self.heardDelegate myHistoryAction];
}
}
}
- (void)setNumber:(NSInteger )number {
_number = number;
if (number == 0) {
self.numberLabel.hidden = YES;
}else
{
self.numberLabel.hidden = false;
self.numberLabel.text = [NSString stringWithFormat:@"%ld",number];
}
}
- (void)setHeardModel:(MineCenterUserModel *)heardModel {
_heardModel = heardModel;
NSString * photo = [NSString stringWithFormat:@"%@%@",ResourceAddress,_heardModel.avatar];
NSString * str1 = @"\\";
photo = [ photo stringByReplacingOccurrencesOfString:str1 withString:@"/"];
NSString *encodedString3 = CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef) photo, (CFStringRef)@"!$&'()*+,-./:;=?@_~%#[]", NULL, kCFStringEncodingUTF8));
self.nameLabel.text = _heardModel.realname;
if ([_heardModel.sex integerValue] == 1) { //女[]
[self.heardImage sd_setImageWithURL:[NSURL URLWithString:encodedString3] placeholderImage:[UIImage imageNamed:@"heard_woman"]];
}else
{
[self.heardImage sd_setImageWithURL:[NSURL URLWithString:encodedString3] placeholderImage:[UIImage imageNamed:@"heard_man"]];
}
}
- (void)heardImageAction {
if ([self.heardDelegate respondsToSelector:@selector(heardImageOnClick)]) {
[self.heardDelegate heardImageOnClick];
}
}
@end
@@ -1,33 +0,0 @@
//
// MyCenterTableView.h
// EscortProject
//
// Created by 仁康信息 on 2023/4/23.
//
#import <UIKit/UIKit.h>
#import "MyCenterHeardView.h"
#import "MineCenterUserModel.h"
NS_ASSUME_NONNULL_BEGIN
@protocol cenerCellListDelegate <NSObject>
- (void)cellListClick:(NSInteger)cellIndex;
@end
@interface MyCenterTableView : UITableView
@property (nonatomic, strong) NSArray * dataArray;
@property (nonatomic, weak)id<myCenterHeardToolsDelegate> heardDelegate;
@property (nonatomic, weak)id<cenerCellListDelegate> cellDelegate;
@property (nonatomic, assign) NSInteger number;
@property (nonatomic, strong) MineCenterUserModel * userModel;
@end
NS_ASSUME_NONNULL_END
@@ -1,253 +0,0 @@
//
// MyCenterTableView.m
// EscortProject
//
// Created by 仁康信息 on 2023/4/23.
//
#import "MyCenterTableView.h"
#import "MyCenterHeardView.h"
@interface MyCenterTableView ()<UITableViewDelegate,UITableViewDataSource>
@property (nonatomic, strong) MyCenterHeardView * heardV;
@end
@implementation MyCenterTableView
- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style
{
if (self = [super initWithFrame:frame style:style])
{
[self createUI];
}
return self;
}
- (void)createUI
{
if (@available(iOS 11.0, *)) {
self.estimatedRowHeight = 0;
self.estimatedSectionFooterHeight = 0;
self.estimatedSectionHeaderHeight = 0;
self.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}
self.delegate = self;
self.backgroundColor = KClearColor;
self.dataSource = self;
self.tableHeaderView = [self createHeardView];
self.separatorStyle = UITableViewCellSeparatorStyleNone;
self.showsVerticalScrollIndicator = NO;
}
- (void)setDataArray:(NSArray *)dataArray
{
_dataArray = dataArray;
[self reloadData];
}
- (void)setHeardDelegate:(id<myCenterHeardToolsDelegate>)heardDelegate {
_heardDelegate = heardDelegate;
self.heardV.heardDelegate = _heardDelegate;
}
- (void)setUserModel:(MineCenterUserModel *)userModel {
_userModel = userModel;
self.heardV.heardModel = _userModel;
}
- (void)setNumber:(NSInteger)number {
_number = number;
self.heardV.number = _number;
}
- (UIView *)createHeardView
{
MyCenterHeardView * heardV = [[MyCenterHeardView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kRealValue(150))];
heardV.layer.cornerRadius = 10;
heardV.backgroundColor = KWhiteColor;
heardV.heardDelegate = self.heardDelegate;
[HQCommonUtils addShadowToView:heardV];
self.heardV = heardV;
return heardV;
}
#pragma mark - DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
if (section == 0) {
return 3;
}
return 3;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
//,@[@"我的关注",@"myLove_icon"]
NSArray * sectionOne = @[@[@"账户与安全(修改密码)",@"relati"],@[@"用户协议",@"myRen"],@[@"隐私政策",@"medi"]];
static NSString * cellID = @"cellID";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.textLabel.font = SYSTEMFONT(14);
cell.textLabel.text = sectionOne[indexPath.row][0];
// cell.imageView.image = [UIImage imageNamed: sectionOne[indexPath.row][1]];
return cell;
}
- (CGFloat )tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return kRealValue(10);
}
- (CGFloat )tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return CGFLOAT_MIN;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return kRealValue(52);
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
UIView * sectionHeardView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kRealValue(10))];
sectionHeardView.backgroundColor = KClearColor;
return sectionHeardView;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if ([self.cellDelegate respondsToSelector:@selector(cellListClick:)] ) {
[self.cellDelegate cellListClick:indexPath.row];
}
}
- (void)tableView:(UITableView*)tableView willDisplayCell:(UITableViewCell*)cell forRowAtIndexPath:(NSIndexPath*)indexPath
{
if([cell respondsToSelector:@selector(tintColor)]) {
if(tableView ==self) {
CGFloat cornerRadius =5.f;
cell.backgroundColor=UIColor.clearColor;
CAShapeLayer * layer = [[CAShapeLayer alloc]init];
CGMutablePathRef pathRef = CGPathCreateMutable();
CGRect bounds = CGRectInset(cell.bounds,0,0);
BOOL addLine =NO;
if(indexPath.row==0&& indexPath.row== [tableView numberOfRowsInSection:indexPath.section]-1) {
CGPathAddRoundedRect(pathRef,nil, bounds, cornerRadius, cornerRadius);
}else if(indexPath.row==0) {
CGPathMoveToPoint(pathRef,nil,CGRectGetMinX(bounds),CGRectGetMaxY(bounds));
CGPathAddArcToPoint(pathRef,nil,CGRectGetMinX(bounds),CGRectGetMinY(bounds),CGRectGetMidX(bounds),CGRectGetMinY(bounds), cornerRadius);
CGPathAddArcToPoint(pathRef,nil,CGRectGetMaxX(bounds),CGRectGetMinY(bounds),CGRectGetMaxX(bounds),CGRectGetMidY(bounds), cornerRadius);
CGPathAddLineToPoint(pathRef,nil,CGRectGetMaxX(bounds),CGRectGetMaxY(bounds));
addLine =YES;
}else if(indexPath.row== [tableView numberOfRowsInSection:indexPath.section]-1) {
CGPathMoveToPoint(pathRef,nil,CGRectGetMinX(bounds),CGRectGetMinY(bounds));
CGPathAddArcToPoint(pathRef,nil,CGRectGetMinX(bounds),CGRectGetMaxY(bounds),CGRectGetMidX(bounds),CGRectGetMaxY(bounds), cornerRadius);
CGPathAddArcToPoint(pathRef,nil,CGRectGetMaxX(bounds),CGRectGetMaxY(bounds),CGRectGetMaxX(bounds),CGRectGetMidY(bounds), cornerRadius);
CGPathAddLineToPoint(pathRef,nil,CGRectGetMaxX(bounds),CGRectGetMinY(bounds));
}else{
CGPathAddRect(pathRef,nil, bounds);
addLine =YES;
}
layer.path= pathRef;
CFRelease(pathRef);
layer.fillColor= [UIColor colorWithWhite:1.f alpha:0.8f].CGColor;
if(addLine ==YES) {
CALayer* lineLayer = [[CALayer alloc]init];
CGFloat lineHeight = (1.f/ [UIScreen mainScreen].scale);
lineLayer.frame=CGRectMake(CGRectGetMinX(bounds)+10, bounds.size.height-lineHeight, bounds.size.width-10, lineHeight);
lineLayer.backgroundColor= tableView.separatorColor.CGColor;
[layer addSublayer:lineLayer];
}
UIView*testView = [[UIView alloc]initWithFrame:bounds];
[testView.layer insertSublayer:layer atIndex:0];
testView.backgroundColor=UIColor.clearColor;
cell.backgroundView= testView;
}
}
}
@end
@@ -1,207 +0,0 @@
//
// SOSDetailTableHeardView.m
// EscortProject
//
// Created by 仁康信息 on 2023/8/22.
//
#import "SOSDetailTableHeardView.h"
@interface SOSDetailTableHeardView ()
@property (nonatomic, strong) UILabel * orderStatusLabel;
@property (nonatomic, strong) UILabel * sendLabel;
@property (nonatomic, strong) UILabel * helpLabel;
@property (nonatomic, strong) UILabel * orderNumberLabel;
@property (nonatomic, strong) UILabel * helpTimeLabel;
@property (nonatomic, strong) UILabel * sosTimeLabel;
@property (nonatomic, strong) UILabel * peopleLabel;
@property (nonatomic, strong) UILabel * orderTimeLabel;
@property (nonatomic, strong) UILabel * statusLabel;
@property (nonatomic, strong) UILabel * yewuLabel;
@property (nonatomic, strong) UILabel * hospitalLabel;
@property (nonatomic, strong) UILabel * zhuchangLabel;
@property (nonatomic, strong) UILabel * jiedanLabel;
@property (nonatomic, strong) UILabel * infoLabel;
@property (nonatomic, strong) UIView * lineView;
@property (nonatomic, strong) UIView * lineTwoView;
@end
@implementation SOSDetailTableHeardView
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
self.backgroundColor = KWhiteColor;
[self createUI];
}
return self;
}
- (void)createUI {
UILabel * titLabel= [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(14), kRealValue(24), 100, 14)];
titLabel.text = @"工单信息";
titLabel.textAlignment = NSTextAlignmentLeft;
titLabel.font =BOLDSYSTEMFONT(14);
titLabel.textColor = UIColorHex(#333333);
[self addSubview:titLabel];
NSArray * leftArray = @[@"工单状态",@"发起人",@"求助人",@"工单号",@"求助时间",@"就助时间"];
UIView * linView;
for (int i = 0; i < leftArray.count; i ++) {
UIView * infoView = [self orderInfoLabelViewWithFrame:CGRectMake(0, titLabel.bottom + kRealValue(10)+ kRealValue(27) * i, self.width, kRealValue(27)) withLeftText:leftArray[i] withRightLabTag:100 + i];
[self addSubview:infoView];
if (i == leftArray.count - 1) {
linView = [[UIView alloc] initWithFrame:CGRectMake(0, infoView.bottom + kRealValue(8), self.width, 1)];
linView.backgroundColor = UIColorHex(#E0E0E0);
self.lineView = linView;
}
[self addSubview:linView];
}
UILabel * infoLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(14), linView.bottom + kRealValue(21), 100, 14)];
infoLabel.text = @"派单信息";
infoLabel.textAlignment = NSTextAlignmentLeft;
infoLabel.font =BOLDSYSTEMFONT(14);
infoLabel.textColor = UIColorHex(#333333);
self.infoLabel = infoLabel;
[self addSubview:infoLabel];
NSArray * leftInfoArray = @[@"操作人员",@"派单时间",@"当前状态",@"派单业务",@"派单医院",@"驻场人员",@"接单时间"];
UIView * linTwoView;
for (int j = 0; j < leftInfoArray.count; j ++) {
UIView * orderView = [self orderInfoLabelViewWithFrame:CGRectMake(0, infoLabel.bottom + kRealValue(10) + kRealValue(25) * j, self.width, kRealValue(25)) withLeftText:leftInfoArray[j] withRightLabTag:200 + j];
orderView.tag = 500 + j;
[self addSubview:orderView];
if (j == leftInfoArray.count - 1) {
linTwoView = [[UIView alloc] initWithFrame:CGRectMake(0, orderView.bottom + kRealValue(8), self.width, 1)];
linTwoView.backgroundColor = UIColorHex(#E0E0E0);
self.lineTwoView = linTwoView;
}
[self addSubview:linTwoView];
}
}
- (UIView *)orderInfoLabelViewWithFrame:(CGRect)frame
withLeftText:(NSString *)leftText
withRightLabTag:(NSInteger)rightTag {
UIView * labeView = [[UIView alloc] initWithFrame:frame];
UILabel * leftLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(14), 0, 80, kRealValue(25))];
leftLabel.textColor = UIColorHex(#666666);
leftLabel.font = SYSTEMFONT(13);
leftLabel.textAlignment = NSTextAlignmentLeft;
leftLabel.text = leftText;
[labeView addSubview:leftLabel];
UILabel * rightLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.width - 200 - kRealValue(14), 0, 200, kRealValue(25))];
rightLabel.textColor = UIColorHex(#333333);
rightLabel.font = SYSTEMFONT(13);
rightLabel.textAlignment = NSTextAlignmentRight;
rightLabel.text = leftText;
rightLabel.tag = rightTag;
[labeView addSubview:rightLabel];
return labeView;
}
- (void)setHeardModel:(SOSDoctorDetailInfoModel *)heardModel {
_heardModel = heardModel;
self.statusLabel = [self viewWithTag:100];
self.statusLabel.text = _heardModel.orderStatus_dictText;
self.sendLabel = [self viewWithTag:101];
self.sendLabel.text = _heardModel.initiatorUserName;
self.helpLabel = [self viewWithTag:102];
self.helpLabel.text = _heardModel.salvageUserName;
self.orderNumberLabel = [self viewWithTag:103];
self.orderNumberLabel.text = _heardModel.detail_id;
self.helpTimeLabel = [self viewWithTag:104];
self.helpTimeLabel.text = _heardModel.createTime;
self.sosTimeLabel = [self viewWithTag:105];
self.sosTimeLabel.text = _heardModel.majorResponseTime;
//
self.peopleLabel = [self viewWithTag:200];
self.peopleLabel.text = _heardModel.operationUserName;
}
- (void)setHistoryModel:(SOSDoctorDetailHistory *)historyModel {
_historyModel = historyModel;
UIView * oneView = [self viewWithTag:500];
UIView * twoView = [self viewWithTag:501];
UIView * threeView = [self viewWithTag:502];
UIView * fourView = [self viewWithTag:503];
UIView * fiveView = [self viewWithTag:504];
UIView * sixView = [self viewWithTag:505];
UIView * sevView = [self viewWithTag:506];
self.orderTimeLabel = [self viewWithTag:201];
self.statusLabel = [self viewWithTag:202];
self.yewuLabel = [self viewWithTag:203];
self.hospitalLabel = [self viewWithTag:204];
self.zhuchangLabel = [self viewWithTag:205];
self.jiedanLabel = [self viewWithTag:206];
if (_historyModel) {
self.orderTimeLabel.text = _historyModel.createTime;
self.statusLabel.text = _historyModel.accept_dictText;
self.yewuLabel.text = _historyModel.stationBusiness_dictText;
self.hospitalLabel.text = _historyModel.sendOrderHospital;
self.zhuchangLabel.text = _historyModel.stationUserName;
self.jiedanLabel.text = _historyModel.transferOrderTime;
self.lineTwoView.hidden = false;
self.heradHeight = sevView.bottom;
}else
{
[oneView removeFromSuperview];
[twoView removeFromSuperview];
[threeView removeFromSuperview];
[fourView removeFromSuperview];
[fiveView removeFromSuperview];
[sixView removeFromSuperview];
[sevView removeFromSuperview];
self.infoLabel.hidden = true;
self.orderTimeLabel.hidden = true;
self.statusLabel.hidden = true;
self.yewuLabel.hidden = true;
self.hospitalLabel.hidden = true;
self.zhuchangLabel.hidden = true;
self.lineTwoView.hidden = true;
self.heradHeight = self.lineView.bottom;
}
}
@end
@@ -1,182 +0,0 @@
//
// SOSDoctorDetailTable.m
// EscortProject
//
// Created by 仁康信息 on 2023/8/23.
//
#import "SOSDoctorDetailTable.h"
#import "SOSDetailTableHeardView.h"
#import "SOSDoctorTableViewCell.h"
#import "HistoryOrderTableViewCell.h"
@interface SOSDoctorDetailTable ()<UITableViewDelegate,UITableViewDataSource>
@property (nonatomic, strong) SOSDetailTableHeardView * heardView;
@end
@implementation SOSDoctorDetailTable
- (SOSDetailTableHeardView *)heardView {
if (!_heardView) {
_heardView = [[SOSDetailTableHeardView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth - kRealValue(22), 190)];
_heardView.backgroundColor = KClearColor;
}
return _heardView;
}
- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style {
if (self = [super initWithFrame:frame style:style]) {
[self createUI];
}
return self;
}
- (void)createUI {
if (@available(iOS 11.0, *)) {
self.estimatedRowHeight = 0;
self.estimatedSectionFooterHeight = 0;
self.estimatedSectionHeaderHeight = 0;
self.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}
self.delegate = self;
self.dataSource = self;
self.backgroundColor = UIColor.clearColor;
self.showsVerticalScrollIndicator = false;
self.showsHorizontalScrollIndicator = false;
self.separatorStyle = UITableViewCellSeparatorStyleNone;
self.estimatedRowHeight = 60;
self.rowHeight = UITableViewAutomaticDimension;
self.tableHeaderView = self.heardView;
self.tableHeaderView.height = self.heardView.heradHeight;
}
- (void)setModel:(SOSDoctorDetailInfoModel *)model {
_model = model;
if (_model.orderSendRecordList.count >= 1) {
self.heardView.historyModel = self.model.orderSendRecordList[0];
}else
{
self.heardView.historyModel = nil;
}
self.heardView.heardModel = self.model;
self.heardView.height = self.heardView.heradHeight;
[self reloadData];
}
#pragma mark - tableview的代理方法
//组数
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
if (_model.orderSendRecordList.count >= 1) {
return 1;
}else
{
return 0;
}
}
//每组多少行
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
if (_model.orderSendRecordList.count >= 1) {
return self.model.orderSendRecordList.count - 1;
}else
{
return 0;
}
}
//注册cell
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSMutableArray * dataArray = [[NSMutableArray alloc] initWithArray:self.model.orderSendRecordList];
[dataArray removeFirstObject];
SOSDoctorDetailHistory * hisModel = dataArray[indexPath.row];
HistoryOrderTableViewCell * cell = [self dequeueReusableCellWithIdentifier:@"STATUSCELL"];
if (!cell) {
cell = [[HistoryOrderTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"STATUSCELL"];
}
cell.historyModel= hisModel;
cell.backgroundColor = KWhiteColor;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
//每行高度
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return kRealValue(180);
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
return kRealValue(46);
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
return CGFLOAT_MIN;
}
//组头 --- 组尾
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
return [UIView new];
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
if (_model.orderSendRecordList.count >= 2) {
UIView * heardView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kRealValue(46))];
heardView.backgroundColor = KWhiteColor;
UILabel * historyLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(14), kRealValue(23), 100, 14)];
historyLabel.text = @"历史派单";
historyLabel.textAlignment = NSTextAlignmentLeft;
historyLabel.font =BOLDSYSTEMFONT(14);
historyLabel.textColor = UIColorHex(#333333);
[heardView addSubview:historyLabel];
return heardView;
}
return UIView.new;
}
////cell点击事件
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
}
@end
@@ -1,21 +0,0 @@
//
// SOSDoctorTableView.h
// EscortProject
//
// Created by 仁康信息 on 2023/8/22.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
typedef void(^sosDoctorListActionBlock)(NSString * sessionId , NSString * hospitalId);
@interface SOSDoctorTableView : UITableView
@property (nonatomic, strong) NSArray * dataArray;
@property (nonatomic, copy) sosDoctorListActionBlock recordBlock;
@end
NS_ASSUME_NONNULL_END
@@ -1,137 +0,0 @@
//
// SOSDoctorTableView.m
// EscortProject
//
// Created by 仁康信息 on 2023/8/22.
//
#import "SOSDoctorTableView.h"
#import "SOSDoctorTableViewCell.h"
@interface SOSDoctorTableView ()<UITableViewDelegate,UITableViewDataSource>
@end
@implementation SOSDoctorTableView
- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style {
if (self = [super initWithFrame:frame style:style]) {
[self createUI];
}
return self;
}
- (void)createUI {
if (@available(iOS 11.0, *)) {
self.estimatedRowHeight = 0;
self.estimatedSectionFooterHeight = 0;
self.estimatedSectionHeaderHeight = 0;
self.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}
self.delegate = self;
self.dataSource = self;
self.backgroundColor = UIColor.clearColor;
self.showsVerticalScrollIndicator = false;
self.showsHorizontalScrollIndicator = false;
self.separatorStyle = UITableViewCellSeparatorStyleNone;
self.estimatedRowHeight = 60;
self.rowHeight = UITableViewAutomaticDimension;
}
- (void)setDataArray:(NSArray *)dataArray {
_dataArray = dataArray;
[self reloadData];
}
#pragma mark - tableview的代理方法
//组数
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return self.dataArray.count;
}
//每组多少行
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 1;
}
//注册cell
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
SOSDoctorTableViewCell * cell = [self dequeueReusableCellWithIdentifier:@"STATUSCELL"];
if (!cell) {
cell = [[SOSDoctorTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"STATUSCELL"];
}
cell.model= self.dataArray[indexPath.section];
cell.backgroundColor = KWhiteColor;
cell.layer.cornerRadius = 10;
cell.layer.masksToBounds = YES;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
//每行高度
//- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
//{
// return kRealValue(77);
//}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
return kRealValue(10);
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
return CGFLOAT_MIN;
}
//组头 --- 组尾
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
return [UIView new];
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
UIView * footerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kRealValue(10))];
return footerView;
}
////cell点击事件
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
SOSDoctorRecordListModel * model= self.dataArray[indexPath.section];
if (self.recordBlock) {
self.recordBlock(model.sos_id,model.sos_id);
}
}
@end
@@ -1,18 +0,0 @@
//
// SOSDoctorTableViewCell.h
// EscortProject
//
// Created by 仁康信息 on 2023/8/22.
//
#import <UIKit/UIKit.h>
#import "SOSDoctorModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface SOSDoctorTableViewCell : UITableViewCell
@property (nonatomic, strong) SOSDoctorRecordListModel * model;
@end
NS_ASSUME_NONNULL_END
@@ -1,149 +0,0 @@
//
// SOSDoctorTableViewCell.m
// EscortProject
//
// Created by 仁康信息 on 2023/8/22.
//
#import "SOSDoctorTableViewCell.h"
@interface SOSDoctorTableViewCell ()
@property (nonatomic, strong) UILabel * nameLabel;
@property (nonatomic, strong) UILabel * timeLabel;
@property (nonatomic, strong) YYLabel * lookDetail;
@property (nonatomic, strong) UILabel * statusLabel;
@property (nonatomic, strong) UILabel * hospitalLabel;
@end
@implementation SOSDoctorTableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
[self createUI];
}
return self;
}
- (void)createUI {
self.nameLabel = [[UILabel alloc] init];
self.nameLabel.textColor = CFontColor1;
self.nameLabel.font = BOLDSYSTEMFONT(14);
self.nameLabel.textAlignment = NSTextAlignmentLeft;
self.nameLabel.text = @"求助人:张三";
[self.contentView addSubview:self.nameLabel];
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_offset(15);
make.top.mas_offset(16);
make.height.mas_offset(14);
}];
[self.nameLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
self.timeLabel = [[UILabel alloc] init];
self.timeLabel.textColor = UIColorHex(#333333);
self.timeLabel.font = MEDIUMFONT(14);
self.timeLabel.text = @"求救时间:202-01-01 13:12";
self.timeLabel.textAlignment = NSTextAlignmentLeft;
[self.contentView addSubview:self.timeLabel];
[self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_offset(15);
make.top.mas_equalTo(self.nameLabel.mas_bottom).offset(14);
make.height.mas_offset(14);
}];
[self.timeLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
self.hospitalLabel = [[UILabel alloc] init];
self.hospitalLabel.textColor = UIColorHex(#333333);
self.hospitalLabel.font = MEDIUMFONT(14);
self.hospitalLabel.textAlignment = NSTextAlignmentLeft;
self.hospitalLabel.text = @"应急医院:西京医院-协助检查";
[self.contentView addSubview:self.hospitalLabel];
[self.hospitalLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_offset(15);
make.top.mas_equalTo(self.timeLabel.mas_bottom).offset(14);
make.height.mas_offset(13);
make.bottom.mas_offset(-18);
}];
[self.hospitalLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
UIImageView * accowImg = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"garyRight"]];
[self.contentView addSubview:accowImg];
[accowImg mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_offset(-15);
make.top.mas_offset(16);
make.height.mas_offset(14);
make.width.mas_offset(8);
}];
self.lookDetail = [[YYLabel alloc] init];
self.lookDetail.textColor = UIColorHex(#999999);
self.lookDetail.font = MEDIUMFONT(13);
self.lookDetail.text = @"查看详情";
self.lookDetail.textAlignment = NSTextAlignmentRight;
[self.contentView addSubview:self.lookDetail];
[self.lookDetail mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(accowImg.mas_left).offset(-6);
make.top.mas_offset(16);
make.height.mas_offset(14);
make.width.mas_offset(100);
}];
self.statusLabel = [[UILabel alloc] init];
self.statusLabel.textColor = UIColorHex(#16C716);
self.statusLabel.font = MEDIUMFONT(14);
self.statusLabel.text = @"已完成";
self.statusLabel.textAlignment = NSTextAlignmentRight;
[self.contentView addSubview:self.statusLabel];
[self.statusLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_offset(-15);
make.top.mas_equalTo(self.lookDetail.mas_bottom).offset(26);
make.height.mas_offset(13);
}];
}
- (void)setModel:(SOSDoctorRecordListModel *)model {
_model = model;
self.nameLabel.text = [NSString stringWithFormat:@"求助人:%@",_model.initiatorUserName];
self.timeLabel.text = [NSString stringWithFormat:@"求救时间:%@",_model.createTime];
if ( ValidStr(_model.sendOrderHospital) ) {
self.hospitalLabel.text = @"应急医院:";
}else
{
self.hospitalLabel.text =[NSString stringWithFormat:@"应急医院:%@-%@",_model.sendOrderHospital,_model.stationBusiness_dictText];
}
self.statusLabel.text = model.orderStatus_dictText;
}
@end
@@ -1,21 +0,0 @@
//
// SliderView.h
// WDYAdjustFontSize
//
// Created by wdyzmx on 2022/1/19.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
typedef void (^SliderValueCallBack)(UISlider *);
@interface SliderView : UIView
/// 初始化方法
/// @param frame frame
/// @param callBack 回调block
- (instancetype)initWithFrame:(CGRect)frame callBack:(SliderValueCallBack)callBack;
@end
NS_ASSUME_NONNULL_END
@@ -1,157 +0,0 @@
//
// SliderView.m
// WDYAdjustFontSize
//
// Created by wdyzmx on 2022/1/19.
//
#import "SliderView.h"
#define kScreenWidth UIScreen.mainScreen.bounds.size.width
#define kScreenHeight UIScreen.mainScreen.bounds.size.height
#define SliderRate 1.0
#define DefaultFontSize 16
#define SliderHeight 10
#define SliderBGWidth 300
#define SliderWidth 330
@interface SliderView ()
/// slider
@property (nonatomic, strong) UISlider *slider;
/// tap手势
@property (nonatomic, strong) UITapGestureRecognizer *tapGesture;
/// slider控件value回调
@property (nonatomic, copy) SliderValueCallBack callBack;
/// @{@"字体size": @"slider value"} 字体size对应slider value
@property (nonatomic, strong) NSDictionary *unitDict;
@property (nonatomic, strong) NSArray *unitArr;
@end
@implementation SliderView
#pragma mark - initWithFrame
- (instancetype)initWithFrame:(CGRect)frame callBack:(SliderValueCallBack)callBack {
self = [super initWithFrame:frame];
if (self) {
self.callBack = callBack;
UIImageView *sliderBgImgView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"icon_detail_sliderBgImg"]];
[self addSubview:sliderBgImgView];
sliderBgImgView.frame = CGRectMake(frame.size.width / 2 - SliderBGWidth / 2, 5, SliderBGWidth, SliderHeight);
self.slider = [[UISlider alloc] init];
self.slider.minimumValue = 1;
self.slider.maximumValue = 4;
self.slider.minimumTrackTintColor = [UIColor clearColor];
self.slider.maximumTrackTintColor = [UIColor clearColor];
self.slider.multipleTouchEnabled = NO;
[self.slider setThumbImage:[UIImage imageNamed:@"icon_detail_slider_thum"] forState:UIControlStateNormal];
[self addSubview:self.slider];
self.slider.frame = CGRectMake(0, 0, SliderWidth, SliderHeight);
self.slider.center = sliderBgImgView.center;
[self.slider addTarget:self
action:@selector(valueChanged:)
forControlEvents:UIControlEventValueChanged];
[self.slider addTarget:self
action:@selector(sliderTouchDown:)
forControlEvents:UIControlEventTouchDown];
[self.slider addTarget:self
action:@selector(sliderTouchUp:)
forControlEvents:UIControlEventTouchUpInside];
// 字体size值为该字典key slider value值为该字典value
self.unitDict = @{
@"16": @"1",
@"18": @"2",
@"20": @"3",
@"22": @"4"
};
self.unitArr = @[
@"16",
@"18",
@"20",
@"22"
];
[self.slider setValue:[self sliderInitialValue]];
for (int i = 0; i < self.unitArr.count; i++) {
CGFloat ptx = (kScreenWidth - SliderBGWidth) / 2 + (SliderBGWidth / 3) * i;
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 50, 20)];
label.center = CGPointMake(ptx, self.slider.center.y + 25);
label.font = [UIFont systemFontOfSize:14];
label.textAlignment = NSTextAlignmentCenter;
label.text = self.unitArr[i];
// label.backgroundColor = UIColor.redColor;
[self addSubview:label];
}
// self.backgroundColor = UIColor.orangeColor;
self.tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)];
[self addGestureRecognizer:self.tapGesture];
}
return self;
}
- (CGFloat)sliderInitialValue {
NSMutableDictionary *mdict = [NSMutableDictionary dictionaryWithDictionary:[[NSUserDefaults standardUserDefaults] objectForKey:@"fontSizeDict"]];
__block NSString *value = nil;
if (mdict) {
[mdict enumerateKeysAndObjectsUsingBlock:^(NSString * _Nonnull key, NSString * _Nonnull obj, BOOL * _Nonnull stop) {
if ([obj isEqualToString:@"1"]) {
value = self.unitDict[key];
}
}];
}
return value ? value.floatValue : 1;
}
#pragma mark - 滑动slider修改
- (void)valueChanged:(UISlider *)sender {
// 只取整数值,固定间距
NSString *tempStr = [self numberFormat:sender.value];
if (tempStr.floatValue == sender.value) {
return;
}
[sender setValue:tempStr.integerValue];
// 调用block
self.callBack(self.slider);
}
#pragma mark - Slider Action
- (void)sliderTouchDown:(UISlider *)sender {
self.tapGesture.enabled = NO;
}
- (void)sliderTouchUp:(UISlider *)sender {
self.tapGesture.enabled = YES;
}
#pragma mark - 手势点击事件
- (void)tapAction:(UITapGestureRecognizer *)tap {
CGPoint point = [tap locationInView:self];
CGFloat margin = kScreenWidth / 2 - SliderBGWidth / 2;
CGFloat unitWidth = SliderWidth / 3;
CGFloat res = (point.x - margin) / unitWidth;
[self.slider setValue:[self numberFormat:res].floatValue + 1];
// 调用block
self.callBack(self.slider);
// CGFloat rate = res - [self numberFormat:res].floatValue;
}
#pragma mark - numberFormat
- (NSString *)numberFormat:(float)num {
NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
[formatter setPositiveFormat:@"0"];
return [formatter stringFromNumber:[NSNumber numberWithFloat:num]];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end
@@ -0,0 +1,411 @@
//
// MonitoringWarchViewController.m
// XinjiangProject
//
// Created by 仁康信息 on 2023/12/14.
//
#import "MonitoringWarchViewController.h"
#import "MonitoringWatchTableView.h"
#import "ADJumpViewController.h"
#import "SDGETHealthTokenManager.h"
#import "SDHttpRequest.h"
#import "MonitoringDataModel.h"
#import "BRStringPickerView.h"
#import "MonitoringDetailViewController.h"
#import "MonitoringHistoryController.h"
@interface MonitoringWarchViewController ()
//@property (nonatomic, strong) UIScrollView * mainScrollView;
@property (nonatomic, strong) MonitoringWatchTableView * homeTable;
//@property (nonatomic, strong) UIView * warnView;
//
//@property (nonatomic, strong) UIImageView * noQustionImg;
@property (nonatomic, strong) MonitoringDataModel * model;
@end
@implementation MonitoringWarchViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.view.backgroundColor = CViewBgColor;
[self createUI];
[self createDetail];
//请求问券
// [self createData];
// [self showNowImage:YES];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
// [self createData];
[self createDetail];
[self hiddenAllMBProgressHUD];
}
- (void)createUI {
// self.mainScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight - kTopHeight -kTabBarHeight)];
// self.mainScrollView.backgroundColor = CViewBgColor;
// [self.view addSubview:self.mainScrollView];
self.homeTable = [[MonitoringWatchTableView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight - kTopHeight - kTabBarHeight) style:UITableViewStyleGrouped];
[self.view addSubview:self.homeTable];
MJWeakSelf
self.homeTable.popBlock = ^(NSString *type) {
if ([type isEqualToString:@"heart_rate"]) {
[weakSelf showPickStringView:BRStringPickerComponentMulti
withTitle: @"心率阈值"
withDataArray:@[@[@"40次/分钟", @"45次/分钟", @"50次/分钟"], @[@"100次/分钟",@"110次/分钟",@"120次/分钟",@"130次/分钟",@"140次/分钟",@"150次/分钟"]] withType:type];
}
if ([type isEqualToString:@"spo2"]) {
[weakSelf showPickStringView:BRStringPickerComponentSingle
withTitle: @"血氧阈值"
withDataArray:@[@"75%", @"80%", @"85%",@"90%"] withType:type];
}
if ([type isEqualToString:@"stress"]) {
[weakSelf showPickStringView:BRStringPickerComponentSingle
withTitle: @"压力阈值"
withDataArray:@[@"80", @"81", @"82",@"83",@"84",@"85",@"86",@"87",@"88",@"89",@"90",@"91",@"92",@"93",@"94",@"95",@"96",@"97",@"98",@"99"] withType:type];
}
if ([type isEqualToString:@"temperature"]) {
[weakSelf showPickStringView:BRStringPickerComponentMulti
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℃"],
@[@"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];
}
};
self.homeTable.detailBlock = ^(NSString * _Nonnull type, NSString * _Nonnull time) {
[weakSelf lookDetailType:type withTime:time];
};
self.homeTable.heardBlock = ^(NSString * _Nonnull type, NSString * _Nonnull time) {
[weakSelf lookDetailType:type withTime:time];
};
self.homeTable.historyBlock = ^(NSString *type) {
MonitoringHistoryController * historyVC = [[MonitoringHistoryController alloc] init];
historyVC.eventType = type;
[self.navigationController pushViewController:historyVC animated:YES];
};
// UIView * warnView = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(15), self.homeTable.bottom + kRealValue(15), kScreenWidth - kRealValue(30), kRealValue(325))];
// warnView.layer.cornerRadius = 10;
// warnView.backgroundColor = KWhiteColor;
// warnView.layer.masksToBounds = true;
// self.warnView = warnView;
// [self.mainScrollView addSubview:warnView];
//
// UILabel * warnTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(17), kRealValue(24), warnView.width, 16)];
// warnTitleLabel.font = BOLDSYSTEMFONT(16);
// warnTitleLabel.numberOfLines = 0;
// warnTitleLabel.textColor = UIColorHex(#252535);
// warnTitleLabel.textAlignment = NSTextAlignmentLeft;
// warnTitleLabel.text = @"疾病预警";
// [warnView addSubview:warnTitleLabel];
//
// self.noQustionImg = [[UIImageView alloc] initWithFrame:CGRectMake(kRealValue(11), kRealValue(34), warnView.width - kRealValue(22), 176)];
// self.noQustionImg.image = [UIImage imageNamed:@"noQuestionImg"];
// [warnView addSubview:self.noQustionImg];
//
// UILabel * infoLabel = [[UILabel alloc] initWithFrame:CGRectMake(0,self.noQustionImg.bottom + 5, warnView.width, 16)];
// infoLabel.font = MEDIUMFONT(14);
// infoLabel.textColor = UIColorHex(#77849E);
// infoLabel.textAlignment = NSTextAlignmentCenter;
// infoLabel.text = @"请先完成基本信息问卷";
// [warnView addSubview:infoLabel];
//
// UIButton * inputBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.warnView.width/2 - kRealValue(60),infoLabel.bottom + kRealValue(21), kRealValue(120), kRealValue(36))];
// [inputBtn setTitle:@"填写" forState:UIControlStateNormal];
// [inputBtn setTitleColor:KWhiteColor forState:UIControlStateNormal];
// inputBtn.titleLabel.font = MEDIUMFONT(14);
// inputBtn.layer.cornerRadius = 17;
// inputBtn.layer.masksToBounds = true;
// [inputBtn addTarget:self action:@selector(inputQuestionClick) forControlEvents:UIControlEventTouchUpInside];
// inputBtn.backgroundColor = UIColorHex(#21BEBD);
// [warnView addSubview:inputBtn];
//
//
// self.mainScrollView.contentSize = CGSizeMake(kScreenWidth, warnView.bottom + kRealValue(64));
//
//
// UIView * bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, kScreenHeight - kTopHeight - kRealValue(56) - kTabBarHeight, kScreenWidth, kRealValue(56))];
// bottomView.backgroundColor = KWhiteColor;
// [self.view addSubview:bottomView];
//
// UIButton * helpBtn = [[UIButton alloc] initWithFrame:CGRectMake(kRealValue(45), kRealValue(6), kScreenWidth - kRealValue(90), kRealValue(44))];
// [helpBtn setTitle:@"一键帮助" forState:UIControlStateNormal];
// [helpBtn setTitleColor:KWhiteColor forState:UIControlStateNormal];
// helpBtn.titleLabel.font = BOLDSYSTEMFONT(18);
// helpBtn.layer.cornerRadius = 22.0;
// helpBtn.layer.masksToBounds = true;
// helpBtn.backgroundColor = UIColorHex(#F24439);
// [bottomView addSubview:helpBtn];
//
// //初始化一个emptyView
// LYEmptyView *emptyView = [LYEmptyView emptyViewWithImageStr:@"boxNoData" titleStr:@"正在开发中..." detailStr:@""];
//
// //元素竖直方向的间距
// emptyView.subViewMargin = 20.f;
// //标题颜色
// emptyView.titleLabTextColor = [UIColor blackColor];
// //描述字体
// emptyView.detailLabFont = [UIFont systemFontOfSize:17];
// //按钮背景色
// //设置空内容占位图
// self.homeTable.ly_emptyView = emptyView;
//
}
- (void)createData {
// type 1 防心梗。 2脑卒
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:@"2" forKey:@"type"];
JKCQAPI * sosApi = [[JKCQAPI alloc] init:self tag:@"QUSTIONAPI" NeedToken:@""];
[sosApi getMinitringFillQusetion:parmDic];
}
- (void)createDetail {
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:User_ID forKey:@"userId"];
JKCQAPI * sosApi = [[JKCQAPI alloc] init:self tag:@"DETAILAPI" NeedToken:@""];
[sosApi getMinitringWatchData:parmDic];
}
#pragma mark:网络请求
- (void)Failed:(NSString*)message tag:(NSString*)tag
{
[EasyTextView showErrorText:message];
[self hiddenAllMBProgressHUD];
}
- (void)Sucess:(id)response tag:(NSString*)tag
{
if ([tag isEqualToString:@"QUSTIONAPI"])
{
BOOL isQuestion = [response boolValue];
//没有问卷
if (isQuestion == false) {
}
}
if ([tag isEqualToString:@"DETAILAPI"])
{
NSDictionary * dic = response;
MonitoringDataModel * model = [MonitoringDataModel modelWithDictionary:dic];
self.model = model;
self.homeTable.model = model;
}
if ([tag isEqualToString:@"MAXAPI"])
{
[self hiddenAllMBProgressHUD];
[EasyTextView showSuccessText:@"保存成功"];
}
}
- (void)showPickStringView:(BRStringPickerMode)stringModel
withTitle:(NSString *)title
withDataArray:(NSArray *)array
withType:(NSString *)type{
/// 多列文本选择器
BRStringPickerView *textPickerView = [[BRStringPickerView alloc]initWithPickerMode:stringModel];
textPickerView.title = title;
textPickerView.pickerStyle.doneBtnTitle = @"保存并同步";
textPickerView.pickerStyle.doneTextFont = SYSTEMFONT(13);
textPickerView.pickerStyle.doneTextColor = UIColorHex(#21BEBD);
// 设置数据源
textPickerView.dataSourceArr = array;
if (stringModel == 0) {
textPickerView.selectIndex =1;
textPickerView.resultModelBlock = ^(BRResultModel *resultModel) {
if ([type isEqualToString:@"spo2"]) {
[self settingWithType:type MaxAndMin:@"0" minValue:resultModel.value];
}
if ([type isEqualToString:@"stress"]) {
[self settingWithType:type MaxAndMin:resultModel.value minValue:@"0"];
}
};
}else {
textPickerView.selectIndexs = @[@1,@1];
textPickerView.resultModelArrayBlock = ^(NSArray<BRResultModel *> * _Nullable resultModelArr) {
BRResultModel * resultModel1 = resultModelArr[0];
BRResultModel * resultModel2 = resultModelArr[1];
[self settingWithType:type MaxAndMin:resultModel1.value minValue:resultModel2.value];
};
}
[textPickerView show];
}
#pragma mark:设置最大最小值
- (void)settingWithType:(NSString *)type
MaxAndMin:(NSString *)max
minValue:(NSString *)min{
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:User_ID forKey:@"userId"];
[parmDic setObject:max forKey:@"warnMax"];
[parmDic setObject:min forKey:@"warnMin"];
[self showMBProgressHUDWithString:@"请稍候..." autoHidden:false];
JKCQAPI * sosApi = [[JKCQAPI alloc] init:self tag:@"MAXAPI" NeedToken:@""];
[sosApi getInterMonitoringMaxMinData:parmDic];
}
- (void)lookDetailType:(NSString *)type withTime:(NSString *)time{
MonitoringDetailViewController *detailVC = [[MonitoringDetailViewController alloc] init];
if ([type isEqualToString:@"heart_rate"]) {
detailVC.webUrl = [NSString stringWithFormat:@"%@/static/monitor/index.html?p=%@&r=%@&t=%@&id=%@&d=%@&h=%@#/%@",
IntervenH5, @"heartRate", H5DevHost, User_Token, User_ID, time, SCHEME, @"heartRate"];
}
if ([type isEqualToString:@"spo2"]) {
detailVC.webUrl = [NSString stringWithFormat:@"%@/static/monitor/index.html?p=%@&r=%@&t=%@&id=%@&d=%@&h=%@#/%@",
IntervenH5, @"oxygenSaturation", H5DevHost, User_Token, User_ID, time, SCHEME, @"oxygenSaturation"];
}
if ([type isEqualToString:@"stress"]) {
detailVC.webUrl = [NSString stringWithFormat:@"%@/static/monitor/index.html?p=%@&r=%@&t=%@&id=%@&d=%@&h=%@#/%@",
IntervenH5, @"pressure", H5DevHost, User_Token, User_ID, time, SCHEME, @"pressure"];
}
if ([type isEqualToString:@"temperature"]) {
detailVC.webUrl = [NSString stringWithFormat:@"%@/static/monitor/index.html?p=%@&r=%@&t=%@&id=%@&d=%@&h=%@#/%@",
IntervenH5, @"temperature", H5DevHost, User_Token, User_ID, time, SCHEME, @"temperature"];
}
if ([type isEqualToString:@"steps"]) {
detailVC.webUrl = [NSString stringWithFormat:@"%@/static/monitor/index.html?p=%@&r=%@&t=%@&id=%@&d=%@&h=%@#/%@",
IntervenH5, @"stepNumber", H5DevHost, User_Token, User_ID, time, SCHEME, @"stepNumber"];
}
if ([type isEqualToString:@"sleep"]) {
detailVC.webUrl = [NSString stringWithFormat:@"%@/static/monitor/index.html?p=%@&r=%@&t=%@&id=%@&d=%@&h=%@#/%@",
IntervenH5, @"sleep", H5DevHost, User_Token, User_ID, time, SCHEME, @"sleep"];
}
[self.navigationController pushViewController:detailVC animated:YES];
}
- (void)inputQuestionClick {
HQUserInfo * user = [HQCommonUtils keyedUnarchiverWithKey:LoginUserInfo];
ADJumpViewController * webVC = [[ADJumpViewController alloc] init];
webVC.webUrl = [NSString stringWithFormat:@"%@/static/mobile/heart-attack?scheme=%@&host=%@&tokenF=%@&heartType=2",IntervenH5,SCHEME,H5DevHost,user.token];
[self.navigationController pushViewController:webVC animated:YES];
}
//- (void)showNowImage:(BOOL)isShow {
// // LYEmptyView *emptyView = [LYEmptyView emptyViewWithImageStr:@"boxNoData" titleStr:@"暂无数据" detailStr:@""];
//
// UIImageView * noImageView = [[UIImageView alloc] initWithFrame: CGRectMake(0, self.view.centerY - kRealValue(150), kRealValue(200), kRealValue(200))];
// noImageView.image = IMAGE_NAMED(@"boxNoData");
// noImageView.hidden = !isShow;
// noImageView.centerX = self.view.centerX;
// [self.view addSubview:noImageView];
//
// UILabel * resultLabe = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(15),noImageView.bottom + kRealValue(10), kScreenWidth, 20)];
// resultLabe.font = MEDIUMFONT(15);
// resultLabe.textColor = UIColorHex(#333333);
// resultLabe.textAlignment = NSTextAlignmentCenter;
// resultLabe.text = @"功能待开发";
// resultLabe.hidden = !isShow;
// [self.view addSubview:resultLabe];
//}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
@@ -1,16 +0,0 @@
//
// HeartBadViewController.h
// EscortProject
//
// Created by 仁康信息 on 2023/12/14.
//
#import "HQBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface HeartBadViewController : HQBaseViewController
@end
NS_ASSUME_NONNULL_END
@@ -1,223 +0,0 @@
//
// HeartBadViewController.m
// EscortProject
//
// Created by 仁康信息 on 2023/12/14.
//
#import "HeartBadViewController.h"
#import "HeardBadTableView.h"
#import "ADJumpViewController.h"
#import "SDGETHealthTokenManager.h"
#import "SDHttpRequest.h"
#import "MonitoringDataModel.h"
@interface HeartBadViewController ()
@property (nonatomic, strong) UIScrollView * mainScrollView;
@property (nonatomic, strong) HeardBadTableView * homeTable;
@property (nonatomic, strong) UIView * warnView;
@property (nonatomic, strong) UIImageView * noQustionImg;
@end
@implementation HeartBadViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.view.backgroundColor = CViewBgColor;
[self createUI];
[self createDetail];
//请求问券
[self createData];
// [self showNowImage:YES];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self createData];
[self createDetail];
[self hiddenAllMBProgressHUD];
}
- (void)createUI {
self.mainScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight - kTopHeight -kTabBarHeight)];
self.mainScrollView.backgroundColor = CViewBgColor;
[self.view addSubview:self.mainScrollView];
self.homeTable = [[HeardBadTableView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kRealValue(135) * 5 + kRealValue(195) + kRealValue(165)) style:UITableViewStyleGrouped];
[self.mainScrollView addSubview:self.homeTable];
UIView * warnView = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(15), self.homeTable.bottom + kRealValue(15), kScreenWidth - kRealValue(30), kRealValue(325))];
warnView.layer.cornerRadius = 10;
warnView.backgroundColor = KWhiteColor;
warnView.layer.masksToBounds = true;
self.warnView = warnView;
[self.mainScrollView addSubview:warnView];
UILabel * warnTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(17), kRealValue(24), warnView.width, 16)];
warnTitleLabel.font = BOLDSYSTEMFONT(16);
warnTitleLabel.numberOfLines = 0;
warnTitleLabel.textColor = UIColorHex(#252535);
warnTitleLabel.textAlignment = NSTextAlignmentLeft;
warnTitleLabel.text = @"疾病预警";
[warnView addSubview:warnTitleLabel];
self.noQustionImg = [[UIImageView alloc] initWithFrame:CGRectMake(kRealValue(11), kRealValue(34), warnView.width - kRealValue(22), 176)];
self.noQustionImg.image = [UIImage imageNamed:@"noQuestionImg"];
[warnView addSubview:self.noQustionImg];
UILabel * infoLabel = [[UILabel alloc] initWithFrame:CGRectMake(0,self.noQustionImg.bottom + 5, warnView.width, 16)];
infoLabel.font = MEDIUMFONT(14);
infoLabel.textColor = UIColorHex(#77849E);
infoLabel.textAlignment = NSTextAlignmentCenter;
infoLabel.text = @"请先完成基本信息问卷";
[warnView addSubview:infoLabel];
UIButton * inputBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.warnView.width/2 - kRealValue(60),infoLabel.bottom + kRealValue(21), kRealValue(120), kRealValue(36))];
[inputBtn setTitle:@"填写" forState:UIControlStateNormal];
[inputBtn setTitleColor:KWhiteColor forState:UIControlStateNormal];
inputBtn.titleLabel.font = MEDIUMFONT(14);
inputBtn.layer.cornerRadius = 17;
inputBtn.layer.masksToBounds = true;
[inputBtn addTarget:self action:@selector(inputQuestionClick) forControlEvents:UIControlEventTouchUpInside];
inputBtn.backgroundColor = UIColorHex(#21BEBD);
[warnView addSubview:inputBtn];
self.mainScrollView.contentSize = CGSizeMake(kScreenWidth, warnView.bottom + kRealValue(64));
UIView * bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, kScreenHeight - kTopHeight - kRealValue(56) - kTabBarHeight, kScreenWidth, kRealValue(56))];
bottomView.backgroundColor = KWhiteColor;
[self.view addSubview:bottomView];
UIButton * helpBtn = [[UIButton alloc] initWithFrame:CGRectMake(kRealValue(45), kRealValue(6), kScreenWidth - kRealValue(90), kRealValue(44))];
[helpBtn setTitle:@"一键帮助" forState:UIControlStateNormal];
[helpBtn setTitleColor:KWhiteColor forState:UIControlStateNormal];
helpBtn.titleLabel.font = BOLDSYSTEMFONT(18);
helpBtn.layer.cornerRadius = 22.0;
helpBtn.layer.masksToBounds = true;
helpBtn.backgroundColor = UIColorHex(#F24439);
[bottomView addSubview:helpBtn];
//初始化一个emptyView
LYEmptyView *emptyView = [LYEmptyView emptyViewWithImageStr:@"boxNoData" titleStr:@"正在开发中..." detailStr:@""];
//元素竖直方向的间距
emptyView.subViewMargin = 20.f;
//标题颜色
emptyView.titleLabTextColor = [UIColor blackColor];
//描述字体
emptyView.detailLabFont = [UIFont systemFontOfSize:17];
//按钮背景色
//设置空内容占位图
self.homeTable.ly_emptyView = emptyView;
//
}
- (void)createData {
// type 1 防心梗。 2脑卒
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:@"2" forKey:@"type"];
JKCQAPI * sosApi = [[JKCQAPI alloc] init:self tag:@"QUSTIONAPI" NeedToken:@""];
[sosApi getMinitringFillQusetion:parmDic];
}
- (void)createDetail {
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:User_ID forKey:@"userId"];
JKCQAPI * sosApi = [[JKCQAPI alloc] init:self tag:@"DETAILAPI" NeedToken:@""];
[sosApi getMinitringWatchData:parmDic];
}
#pragma mark:网络请求
- (void)Failed:(NSString*)message tag:(NSString*)tag
{
[EasyTextView showErrorText:message];
[self hiddenAllMBProgressHUD];
}
- (void)Sucess:(id)response tag:(NSString*)tag
{
if ([tag isEqualToString:@"QUSTIONAPI"])
{
BOOL isQuestion = [response boolValue];
//没有问卷
if (isQuestion == false) {
}
}
if ([tag isEqualToString:@"DETAILAPI"])
{
}
}
- (void)inputQuestionClick {
HQUserInfo * user = [HQCommonUtils keyedUnarchiverWithKey:LoginUserInfo];
ADJumpViewController * webVC = [[ADJumpViewController alloc] init];
webVC.webUrl = [NSString stringWithFormat:@"%@/static/mobile/heart-attack?scheme=%@&host=%@&tokenF=%@&heartType=2",IntervenH5,SCHEME,H5DevHost,user.token];
[self.navigationController pushViewController:webVC animated:YES];
}
//- (void)showNowImage:(BOOL)isShow {
// // LYEmptyView *emptyView = [LYEmptyView emptyViewWithImageStr:@"boxNoData" titleStr:@"暂无数据" detailStr:@""];
//
// UIImageView * noImageView = [[UIImageView alloc] initWithFrame: CGRectMake(0, self.view.centerY - kRealValue(150), kRealValue(200), kRealValue(200))];
// noImageView.image = IMAGE_NAMED(@"boxNoData");
// noImageView.hidden = !isShow;
// noImageView.centerX = self.view.centerX;
// [self.view addSubview:noImageView];
//
// UILabel * resultLabe = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(15),noImageView.bottom + kRealValue(10), kScreenWidth, 20)];
// resultLabe.font = MEDIUMFONT(15);
// resultLabe.textColor = UIColorHex(#333333);
// resultLabe.textAlignment = NSTextAlignmentCenter;
// resultLabe.text = @"功能待开发";
// resultLabe.hidden = !isShow;
// [self.view addSubview:resultLabe];
//}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
@@ -1,214 +0,0 @@
//
// HeardBadHeardView.m
// EscortProject
//
// Created by 仁康信息 on 2023/12/14.
//
#import "HeardBadHeardView.h"
@interface HeardBadHeardView ()
@property (nonatomic, strong) UILabel * stepLabel;
@property (nonatomic, strong) UILabel * timeLabel;
@property (nonatomic, strong) UILabel * numberLabel;
@property (nonatomic, strong) UILabel * allNumberLabel;
@property (nonatomic, strong) UILabel * sleepTimeLabel;
@property (nonatomic, strong) UILabel * subTimeLabel;
@property (nonatomic, strong) UILabel * avgTimeLabel;
@end
@implementation HeardBadHeardView
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
self.backgroundColor = CViewBgColor;
[self createUI];
}
return self;
}
- (void)createUI {
UIImageView * StepView = [[UIImageView alloc] initWithFrame:CGRectMake(kRealValue(15), kRealValue(15), ( kScreenWidth - kRealValue(45))/2, kRealValue(165))];
StepView.layer.cornerRadius = 15.0;
StepView.layer.masksToBounds = YES;
StepView.image = [UIImage imageNamed:@"stepNumerIcon"];
StepView.userInteractionEnabled = true;
StepView.backgroundColor = KWhiteColor;
[self addSubview:StepView];
UIImageView * stepImg = [[UIImageView alloc] initWithFrame:CGRectMake(kRealValue(12), kRealValue(16), kRealValue(32), kRealValue(32))];
stepImg.image = [UIImage imageNamed:@"stepNumberIcon"];
[StepView addSubview:stepImg];
self.stepLabel = [[UILabel alloc] initWithFrame:CGRectMake(stepImg.right + kRealValue(12), kRealValue(14), StepView.width - kRealValue(46), 16)];
self.stepLabel.text = @"步数";
self.stepLabel.textColor = CFontColor1;
self.stepLabel.font = BOLDSYSTEMFONT(16);
self.stepLabel.textAlignment = NSTextAlignmentLeft;
[StepView addSubview:self.stepLabel];
self.timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(stepImg.right + kRealValue(12),self.stepLabel.bottom + kRealValue(9), StepView.width - kRealValue(46), 16)];
self.timeLabel.text = @"--/--/--";
self.timeLabel.textColor = UIColorHex(#77849E);
self.timeLabel.font = SYSTEMFONT(13);
self.timeLabel.textAlignment = NSTextAlignmentLeft;
[StepView addSubview:self.timeLabel];
UIButton * stepIconBtn = [[UIButton alloc] initWithFrame:CGRectMake(StepView.width - kRealValue(9) - 20, kRealValue(16), 20, 20)];
[stepIconBtn setImage:[UIImage imageNamed:@"garyRight"] forState:UIControlStateNormal];
[StepView addSubview:stepIconBtn];
UIImageView * stepBackImg =[[UIImageView alloc] initWithFrame:CGRectMake(0, stepImg.bottom + kRealValue(4), StepView.width, kRealValue(114))];
stepBackImg.image = [UIImage imageNamed:@"steoBackImage"];
[StepView addSubview:stepBackImg];
self.allNumberLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(15), StepView.height - 12 - kRealValue(8), StepView.width - kRealValue(30), 12)];
self.allNumberLabel.text = @"累计约步行--公里";
self.allNumberLabel.textColor = UIColorHex(#77849E);
self.allNumberLabel.font = MEDIUMFONT(12);
self.allNumberLabel.textAlignment = NSTextAlignmentLeft;
[StepView addSubview:self.allNumberLabel];
self.numberLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(15), self.allNumberLabel.top - 28 - kRealValue(12), StepView.width - kRealValue(30), 28)];
self.numberLabel.text = @"--步";
self.numberLabel.textColor = UIColorHex(#77849E);
self.numberLabel.font = BOLDSYSTEMFONT(28);
self.numberLabel.textAlignment = NSTextAlignmentLeft;
[StepView addSubview:self.numberLabel];
//睡眠
UIView * sleepView = [[UIView alloc] initWithFrame:CGRectMake(StepView.right + kRealValue(15), kRealValue(15), ( kScreenWidth - kRealValue(45))/2, kRealValue(165))];
sleepView.layer.cornerRadius = 15.0;
sleepView.layer.masksToBounds = YES;
sleepView.backgroundColor = KWhiteColor;
[self addSubview:sleepView];
UIImageView * sleepImg = [[UIImageView alloc] initWithFrame:CGRectMake(kRealValue(12), kRealValue(16), kRealValue(32), kRealValue(32))];
sleepImg.image = [UIImage imageNamed:@"sleepIcon"];
[sleepView addSubview:sleepImg];
UILabel * sleepLab = [[UILabel alloc] initWithFrame:CGRectMake(sleepImg.right + kRealValue(12), kRealValue(14), StepView.width - kRealValue(46), 16)];
sleepLab.text = @"睡眠";
sleepLab.textColor = CFontColor1;
sleepLab.font = BOLDSYSTEMFONT(16);
sleepLab.textAlignment = NSTextAlignmentLeft;
[sleepView addSubview:sleepLab];
self.sleepTimeLabel = [[UILabel alloc] initWithFrame:CGRectMake(sleepImg.right + kRealValue(12),sleepLab.bottom + kRealValue(9), sleepView.width - kRealValue(46), 16)];
self.sleepTimeLabel.text = @"--/--/--";
self.sleepTimeLabel.textColor = UIColorHex(#77849E);
self.sleepTimeLabel.font = SYSTEMFONT(13);
self.sleepTimeLabel.textAlignment = NSTextAlignmentLeft;
[sleepView addSubview:self.sleepTimeLabel];
UIButton * sleepIconBtn = [[UIButton alloc] initWithFrame:CGRectMake(sleepView.width - kRealValue(9) - 20, kRealValue(16), 20, 20)];
[sleepIconBtn setImage:[UIImage imageNamed:@"garyRight"] forState:UIControlStateNormal];
[sleepView addSubview:sleepIconBtn];
UIView * blueView = [[UIView alloc] initWithFrame:CGRectMake(sleepView.width - kRealValue(29) , self.sleepTimeLabel.bottom + kRealValue(11), kRealValue(17), kRealValue(34))];
CAGradientLayer *gradientLayer = [CAGradientLayer layer];
gradientLayer.frame = blueView.bounds;
gradientLayer.colors = @[(__bridge id)RGBA(1, 142, 253, 0.5).CGColor, (__bridge id)UIColorHex(#FFFFFF).CGColor];
gradientLayer.startPoint = CGPointMake(0, 0);
gradientLayer.endPoint = CGPointMake(0, 1);
gradientLayer.transform = CATransform3DMakeRotation(0, 0, 0, 1);
[blueView.layer addSublayer:gradientLayer];
[sleepView addSubview:blueView];
UIView * blueLine = [[UIView alloc] initWithFrame:CGRectMake(0, 0, blueView.width, 2)];
blueLine.backgroundColor = UIColorHex(#018EFD);
[blueView addSubview:blueLine];
UIView * orangeView = [[UIView alloc] initWithFrame:CGRectMake(blueView.left - kRealValue(5) , self.sleepTimeLabel.bottom + kRealValue(11), kRealValue(4), kRealValue(34))];
CAGradientLayer * orangegradientLayer = [CAGradientLayer layer];
orangegradientLayer.frame = orangeView.bounds;
orangegradientLayer.colors = @[(__bridge id)RGBA(253, 193, 32, 0.5).CGColor, (__bridge id)UIColorHex(#FFFFFF).CGColor];
orangegradientLayer.startPoint = CGPointMake(0, 0);
orangegradientLayer.endPoint = CGPointMake(0, 1);
orangegradientLayer.transform = CATransform3DMakeRotation(0, 0, 0, 1);
[orangeView.layer addSublayer:orangegradientLayer];
[sleepView addSubview:orangeView];
UIView * orangeLine = [[UIView alloc] initWithFrame:CGRectMake(0, 0, orangeView.width, 2)];
orangeLine.backgroundColor = RGBA(253, 193, 32, 1);
[orangeView addSubview:orangeLine];
UIView * pickView = [[UIView alloc] initWithFrame:CGRectMake(orangeView.left - kRealValue(35) , self.sleepTimeLabel.bottom + kRealValue(11), kRealValue(34), kRealValue(34))];
CAGradientLayer * pickViewgradientLayer = [CAGradientLayer layer];
pickViewgradientLayer.frame = pickView.bounds;
pickViewgradientLayer.colors = @[(__bridge id)RGBA(252, 120, 117, 0.5).CGColor, (__bridge id)UIColorHex(#FFFFFF).CGColor];
pickViewgradientLayer.startPoint = CGPointMake(0, 0);
pickViewgradientLayer.endPoint = CGPointMake(0, 1);
pickViewgradientLayer.transform = CATransform3DMakeRotation(0, 0, 0, 1);
[pickView.layer addSublayer:pickViewgradientLayer];
[sleepView addSubview:pickView];
UIView * pickLine = [[UIView alloc] initWithFrame:CGRectMake(0, 0, pickView.width, 2)];
pickLine.backgroundColor = RGBA(252, 120, 117, 1);
[pickView addSubview:pickLine];
UIView * purpleView = [[UIView alloc] initWithFrame:CGRectMake(pickView.left - kRealValue(45) , self.sleepTimeLabel.bottom + kRealValue(11), kRealValue(44), kRealValue(34))];
CAGradientLayer * pupleViewgradientLayer = [CAGradientLayer layer];
pupleViewgradientLayer.frame = purpleView.bounds;
pupleViewgradientLayer.colors = @[(__bridge id)RGBA(203, 45, 218, 0.5).CGColor, (__bridge id)UIColorHex(#FFFFFF).CGColor];
pupleViewgradientLayer.startPoint = CGPointMake(0, 0);
pupleViewgradientLayer.endPoint = CGPointMake(0, 1);
pupleViewgradientLayer.transform = CATransform3DMakeRotation(0, 0, 0, 1);
[purpleView.layer addSublayer:pupleViewgradientLayer];
[sleepView addSubview:purpleView];
UIView * purpleLine = [[UIView alloc] initWithFrame:CGRectMake(0, 0, purpleView.width, 2)];
purpleLine.backgroundColor = RGBA(203, 45, 218, 1);
[purpleView addSubview:purpleLine];
UIView * blackPurple = [[UIView alloc] initWithFrame:CGRectMake(purpleView.left - kRealValue(39) , self.sleepTimeLabel.bottom + kRealValue(11), kRealValue(38), kRealValue(34))];
CAGradientLayer * blackPurplegradientLayer = [CAGradientLayer layer];
blackPurplegradientLayer.frame = blackPurple.bounds;
blackPurplegradientLayer.colors = @[(__bridge id)RGBA(155, 70, 225, 0.5).CGColor, (__bridge id)UIColorHex(#FFFFFF).CGColor];
blackPurplegradientLayer.startPoint = CGPointMake(0, 0);
blackPurplegradientLayer.endPoint = CGPointMake(0, 1);
blackPurplegradientLayer.transform = CATransform3DMakeRotation(0, 0, 0, 1);
[blackPurple.layer addSublayer:blackPurplegradientLayer];
[sleepView addSubview:blackPurple];
UIView * blackPurpleLine = [[UIView alloc] initWithFrame:CGRectMake(0, 0, blackPurple.width, 2)];
blackPurpleLine.backgroundColor = RGBA(155, 70, 225, 1);
[blackPurple addSubview:blackPurpleLine];
self.avgTimeLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(15), sleepView.height - 12 - kRealValue(8), StepView.width - kRealValue(30), 12)];
self.avgTimeLabel.text = @"平均睡眠--小时";
self.avgTimeLabel.textColor = UIColorHex(#77849E);
self.avgTimeLabel.font = MEDIUMFONT(12);
self.avgTimeLabel.textAlignment = NSTextAlignmentLeft;
[sleepView addSubview:self.avgTimeLabel];
self.subTimeLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(15),self.avgTimeLabel.top - 28 - kRealValue(12), StepView.width - kRealValue(30), 28)];
self.subTimeLabel.text = @"--小时--分";
self.subTimeLabel.textColor = UIColorHex(#77849E);
self.subTimeLabel.font = BOLDSYSTEMFONT(28);
self.subTimeLabel.textAlignment = NSTextAlignmentLeft;
[sleepView addSubview:self.subTimeLabel];
}
@end
@@ -1,88 +0,0 @@
//
// HeardBadTabFooterView.m
// EscortProject
//
// Created by 仁康信息 on 2023/12/14.
//
#import "HeardBadTabFooterView.h"
@interface HeardBadTabFooterView ()
@property (nonatomic, strong) UIView * warnView ;
@end
@implementation HeardBadTabFooterView
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self createUI];
}
return self;
}
- (void)createUI {
UIView * watchView = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(15), kRealValue(16), kScreenWidth - kRealValue(30), kRealValue(143))];
watchView.layer.cornerRadius = 15;
watchView.backgroundColor = KWhiteColor;
watchView.layer.masksToBounds = true;
[self addSubview:watchView];
CGFloat footWidth = (watchView.width - kRealValue(60))/3;
for (int i = 0; i < 3; i ++) {
UIView * footView = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(15) + (footWidth + kRealValue(15) )* i, kRealValue(11), footWidth, kRealValue(123))];
footView.layer.cornerRadius = 15;
footView.backgroundColor = KWhiteColor;
footView.layer.masksToBounds = true;
UILabel * titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, kRealValue(19), footWidth, 16)];
titleLabel.font = BOLDSYSTEMFONT(16);
titleLabel.textAlignment = NSTextAlignmentCenter;
UILabel * contLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, titleLabel.bottom + kRealValue(12), footWidth, footView.height - kRealValue(56))];
contLabel.font = MEDIUMFONT(12);
contLabel.numberOfLines = 0;
contLabel.textColor = UIColorHex(#77849E);
contLabel.textAlignment = NSTextAlignmentCenter;
if (i == 0) {
footView.backgroundColor = UIColorHex(#E3F2F9);
titleLabel.text = @"穿戴设备";
titleLabel.textColor = UIColorHex(#0789C0);
contLabel.text = @"佩戴90天23小时\n充电284次";
}
if (i == 1) {
footView.backgroundColor = UIColorHex(#FFF3EB);
titleLabel.text = @"预警研究";
titleLabel.textColor = UIColorHex(#E7AE84);
contLabel.text = @"心率失常权重 \n 心率失常权重 \n 心率失常权重";
}
if (i == 2) {
footView.backgroundColor = UIColorHex(#FFEFF2);
titleLabel.text = @"心脏体检";
titleLabel.textColor = UIColorHex(#D16685);
contLabel.text = @"心电图正常 \n 心脏CTA正常 \n 检验指标正常";
}
[watchView addSubview:footView];
[footView addSubview:titleLabel];
[footView addSubview:contLabel];
}
}
@end
@@ -1,19 +0,0 @@
//
// AddQuestionViewController.h
// EscortProject
//
// Created by 仁康信息 on 2023/4/18.
//
#import "HQBaseViewController.h"
#import "QuestionPeopleModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface AddQuestionViewController : HQBaseViewController
@property (nonatomic, strong) QuestionPeopleModel * questionModel;
@end
NS_ASSUME_NONNULL_END
@@ -1,598 +0,0 @@
//
// AddQuestionViewController.m
// EscortProject
//
// Created by 仁康信息 on 2023/4/18.
//
#import "AddQuestionViewController.h"
#import "LineTextField.h"
#import "BRPickerView.h"
#import "FamilyMemberRelationModel.h"
#import "UserInfoHealthPopView.h"
#import "BasicHealthInfoViewController.h"
#import "BasicHealthInfoViewController.h"
@interface AddQuestionViewController () <userInfoPopDelegate>
@property (nonatomic, strong) LineTextField * questionNameField;
@property (nonatomic, strong) UIButton * sexBtn;
@property (nonatomic, strong) UILabel * birthdayLabel;
@property (nonatomic, strong) LineTextField * birthdayTextField;
@property (nonatomic, strong) UIButton * womanBtn ;
@property (nonatomic, strong) UIButton * manBtn ;
@property (nonatomic, strong) NSMutableArray * memberArray;
@property (nonatomic, strong) LineTextField * heiTextField;
@property (nonatomic, strong) LineTextField * weightTextField;
@property (nonatomic, strong) LineTextField * relationshipTextField;
@property (nonatomic, copy) NSString * familyInt;
@property (nonatomic, strong) UserInfoHealthPopView * popView;
@property (nonatomic, strong) LineTextField * baseHelathInfoField;
@property (nonatomic, copy) NSString * memberId;
@property (nonatomic, assign) bool isJump;
@end
@implementation AddQuestionViewController
- (NSMutableArray *)memberArray {
if (!_memberArray) {
_memberArray = [[NSMutableArray alloc] init];
}
return _memberArray;
}
- (UserInfoHealthPopView *)popView {
if (!_popView) {
_popView = [[UserInfoHealthPopView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)];
_popView.popDelegate = self;
}
return _popView;
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.isHidenNaviBar = false;
self.view.backgroundColor = UIColorHex(#EFEFEF);
self.navigationItem.title = @"添加咨询人信息";
[self createUI];
[self getFamilyMembers];
}
- (void)createUI {
//咨询人姓名
self.questionNameField = [self createFieldWithLeftTitle:@"咨询人姓名" withRightString:@"" placeholderStr:@"请填写咨询人姓名" isShowRight:true];
self.questionNameField.frame = CGRectMake(0, 1, kScreenWidth, 51);
[self.view addSubview:self.questionNameField];
//性别选择
UIView * sexView = [[UIView alloc] initWithFrame:CGRectMake(0, self.questionNameField.bottom, kScreenWidth, 51)];
sexView.backgroundColor = KWhiteColor;
[self.view addSubview:sexView];
UILabel * sexlabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(16), 0, 100, 51)];
sexlabel.text = @"性别";
sexlabel.font = SYSTEMFONT(13);
sexlabel.textAlignment = NSTextAlignmentLeft;
sexlabel.textColor = UIColorHex(#666666);
[sexView addSubview:sexlabel];
UIButton * womanBtn = [[UIButton alloc] initWithFrame:CGRectMake(kScreenWidth - kRealValue(16) - 60, 0, 50, 51)];
[womanBtn setImage:[UIImage imageNamed:@"choose_nomal"] forState:UIControlStateNormal];
[womanBtn setImage:[UIImage imageNamed:@"choose_Selected"] forState:UIControlStateSelected];
[womanBtn addTarget:self action:@selector(womanAction) forControlEvents:UIControlEventTouchUpInside];
[womanBtn setTitle:@"" forState:UIControlStateNormal];
womanBtn.titleLabel.font = SYSTEMFONT(13);
self.womanBtn = womanBtn;
[womanBtn setTitleColor:CFontColor1 forState:UIControlStateNormal];
[sexView addSubview:womanBtn];
UIButton * manBtn = [[UIButton alloc] initWithFrame:CGRectMake(womanBtn.left - 60, 0, 50, 51)];
[manBtn setImage:[UIImage imageNamed:@"choose_nomal"] forState:UIControlStateNormal];
[manBtn setImage:[UIImage imageNamed:@"choose_Selected"] forState:UIControlStateSelected];
[manBtn setTitle:@"" forState:UIControlStateNormal];
[manBtn addTarget:self action:@selector(manAction) forControlEvents:UIControlEventTouchUpInside];
manBtn.titleLabel.font = SYSTEMFONT(13);
[manBtn setTitleColor:CFontColor1 forState:UIControlStateNormal];
self.manBtn = manBtn;
[sexView addSubview:manBtn];
UIView * sexLineView = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(14), sexView.bottom, kScreenWidth - kRealValue(28), 0.5)];
sexLineView.backgroundColor = UIColorHex(#E0E0E0);
[self.view addSubview:sexLineView];
//出生日期
self.birthdayTextField = [self createFieldWithLeftTitle:@"出生日期" withRightString:@">" placeholderStr:@"请选择出生日期" isShowRight:true];
self.birthdayTextField.frame = CGRectMake(0, sexLineView.bottom, kScreenWidth, 51);
self.birthdayTextField.userInteractionEnabled = true;
[self.view addSubview:self.birthdayTextField];
UIButton * birBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 51)];
[birBtn addTarget:self action:@selector(selectBirthdayOnclick) forControlEvents:UIControlEventTouchUpInside];
[self.birthdayTextField addSubview:birBtn];
self.heiTextField = [self createFieldWithLeftTitle:@"身高" withRightString:@"cm" placeholderStr:@"请填写咨询人身高" isShowRight:true];
self.heiTextField.keyboardType = UIKeyboardTypeNumberPad;
self.heiTextField.frame = CGRectMake(0, self.birthdayTextField.bottom, kScreenWidth, 51);
[self.view addSubview:self.heiTextField];
self.weightTextField = [self createFieldWithLeftTitle:@"体重" withRightString:@"kg" placeholderStr:@"请填写咨询人体重" isShowRight:true];
self.weightTextField.keyboardType = UIKeyboardTypeDecimalPad;
self.weightTextField.frame = CGRectMake(0, self.heiTextField.bottom, kScreenWidth, 51);
[self.view addSubview:self.weightTextField];
//与本人关系
self.relationshipTextField = [self createFieldWithLeftTitle:@"与咨询人关系" withRightString:@">" placeholderStr:@"请点击选择" isShowRight:true];
self.relationshipTextField.frame = CGRectMake(0, self.weightTextField.bottom, kScreenWidth, 51);
self.relationshipTextField.userInteractionEnabled = true;
[self.view addSubview:self.relationshipTextField];
UIButton * shipBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 51)];
[shipBtn addTarget:self action:@selector(relastionShipOnclick) forControlEvents:UIControlEventTouchUpInside];
[self.relationshipTextField addSubview:shipBtn];
self.baseHelathInfoField = [self createFieldWithLeftTitle:@"基本健康信息" withRightString:@">" placeholderStr:@"" isShowRight:true];
self.baseHelathInfoField.frame = CGRectMake(0, self.relationshipTextField.bottom + 5, kScreenWidth, 51);
self.baseHelathInfoField.userInteractionEnabled = true;
UIButton * baseBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 51)];
[baseBtn addTarget:self action:@selector(healthInfoAction) forControlEvents:UIControlEventTouchUpInside];
[self.baseHelathInfoField addSubview:baseBtn];
[self.view addSubview:self.baseHelathInfoField];
UILabel * tishiLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(15), self.relationshipTextField.bottom + kRealValue(10) , kScreenWidth - kRealValue(30), 30)];
tishiLabel.text = @"温馨提示:咨询人姓名、证件信息用于平台审核,不会外传。请输入正确的咨询人姓名和证件号码。";
tishiLabel.numberOfLines = 0;
tishiLabel.font = SYSTEMFONT(12);
tishiLabel.textColor = UIColorHex(#999999);
CGFloat h = [HQCommonUtils getSpaceLabelHeight:tishiLabel withStr:tishiLabel.text withFont: SYSTEMFONT(12) withWidth:kScreenWidth withLineSpacing:2];
tishiLabel.height = h ;
[self.view addSubview:tishiLabel];
//保存按钮
UIButton * saveBtn = [[UIButton alloc] initWithFrame:CGRectMake(kRealValue(48), kScreenHeight - kTopHeight - kTabBarHeight - 30 - 40, kScreenWidth - kRealValue(96), 40)];
[saveBtn setTitle:@"保存" forState:UIControlStateNormal];
saveBtn.titleLabel.font = SYSTEMFONT(14);
saveBtn.layer.cornerRadius = 20.0f;
saveBtn.layer.masksToBounds = true;
saveBtn.layer.borderColor = UIColorHex(#21BEBD).CGColor;
saveBtn.layer.borderWidth = 1.0f;
saveBtn.backgroundColor = KWhiteColor;
[saveBtn addTarget:self action:@selector(saveInfo) forControlEvents:UIControlEventTouchUpInside];
[saveBtn setTitleColor:UIColorHex(#21BEBD) forState:UIControlStateNormal];
[self.view addSubview:saveBtn];
if (self.questionModel) {
self.baseHelathInfoField.hidden = false;
baseBtn.hidden = false;
tishiLabel.top = self.baseHelathInfoField.bottom + kRealValue(10);
self.questionNameField.text = self.questionModel.name;
self.relationshipTextField.text = self.questionModel.familyRelation;
self.weightTextField.text = [NSString stringWithFormat:@"%@",self.questionModel.weight];
self.heiTextField.text = [NSString stringWithFormat:@"%@",self.questionModel.height];
if ( [self.questionModel.gender integerValue] == 1 ) {
self.womanBtn.selected = true;
self.manBtn.selected = false;
}else
{
self.womanBtn.selected = false;
self.manBtn.selected = true;
}
self.birthdayTextField.text = [NSString stringWithFormat:@"%@",self.questionModel.birthday];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
//需要设置为和字符串相同的格式
[dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
NSDate *localDate = [dateFormatter dateFromString:self.questionModel.birthday];
NSString * str = [NSDate br_stringFromDate:localDate dateFormat:@"yyyy-MM-dd"];
self.birthdayTextField.text = str;
}else {
self.baseHelathInfoField.hidden = true;
baseBtn.hidden = true;
tishiLabel.top = self.relationshipTextField.bottom + kRealValue(10);
}
// [kAppWindow addSubview:self.popView];
}
- (LineTextField *)createFieldWithLeftTitle:(NSString *)leftStr
withRightString:(NSString *)rightStr
placeholderStr:(NSString *)placeStr
isShowRight:(BOOL)isShowRight {
LineTextField * field = [[LineTextField alloc] init];
field.font = SYSTEMFONT(13);
field.placeholder = placeStr;
field.textAlignment = NSTextAlignmentRight;
field.backgroundColor = KWhiteColor;
UIView * leftView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 51)];
UILabel * leftlabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(16), 0, 100, 51)];
leftlabel.text = leftStr;
leftlabel.font = SYSTEMFONT(13);
leftlabel.textAlignment = NSTextAlignmentLeft;
leftlabel.textColor = UIColorHex(#666666);
[leftView addSubview:leftlabel];
field.leftView = leftView;
field.leftViewMode = UITextFieldViewModeAlways;
if (isShowRight) {
UIView * rightView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 30, 51)];
UILabel * rightlabel = [[UILabel alloc] initWithFrame:CGRectMake(5, 0, 30, 51)];
rightlabel.text = rightStr;
rightlabel.font = SYSTEMFONT(13);
rightlabel.textColor = UIColorHex(#666666);
field.rightView = rightView;
rightlabel.textAlignment = NSTextAlignmentLeft;
field.rightViewMode = UITextFieldViewModeAlways;
[rightView addSubview:rightlabel];
}
return field;
}
- (void)getFamilyMembers {
JKCQAPI * memberApi = [[JKCQAPI alloc] init:self tag:@"Family" NeedToken:@""];
[memberApi getCheckKeyResult:@{@"dictKey":@"family_member_relation"}];
}
- (void)Failed:(NSString*)message tag:(NSString*)tag
{
[EasyTextView showErrorText:message];
[self hiddenAllMBProgressHUD];
}
- (void)Sucess:(id)response tag:(NSString*)tag
{
if ([tag isEqualToString:@"Family"]) {
NSArray * array = response;
for (NSDictionary * dic in array) {
FamilyMemberRelationModel * model = [FamilyMemberRelationModel modelWithDictionary:dic] ;
[self.memberArray addObject:model];
}
}
if ([tag isEqualToString:@"ADDAPI"]) {
self.memberId = response;
[self hiddenAllMBProgressHUD];
if (self.isJump == true) {
[self.navigationController popViewControllerAnimated:YES];
}
if (self.isJump == false) {
BasicHealthInfoViewController * basicVC = [[BasicHealthInfoViewController alloc] init];
basicVC.memberId = self.memberId;
if (self.questionModel) {
basicVC.isAddQuetsion = false;
}else
{
basicVC.isAddQuetsion = true;
}
[self.navigationController pushViewController:basicVC animated:YES];
}
}
if ([tag isEqualToString:@"updataAPI"]) {
[self hiddenAllMBProgressHUD];
[EasyTextView showSuccessText:@"保存成功"];
[self.navigationController popViewControllerAnimated:YES];
}
}
- (void)selectBirthdayOnclick {
[self.view endEditing:TRUE];
// 1.创建日期选择器
BRDatePickerView *datePickerView = [[BRDatePickerView alloc]init];
// 2.设置属性
datePickerView.pickerMode = BRDatePickerModeYMD;
datePickerView.title = @"选择出生日期";
// datePickerView.selectValue = @"2019-10-30";
datePickerView.minDate = [NSDate br_setYear:1949 month:3 day:12];
datePickerView.maxDate = [NSDate date];
datePickerView.isAutoSelect = YES;
datePickerView.showUnitType = BRShowUnitTypeOnlyCenter;
datePickerView.resultBlock = ^(NSDate *selectDate, NSString *selectValue) {
NSLog(@"选择的值:%@", selectValue);
self.birthdayTextField.text = selectValue;
};
datePickerView.pickerStyle = [BRPickerStyle pickerStyleWithThemeColor:UIColorHex(#21BEBD)];
// 3.显示
[datePickerView show];
}
- (void)relastionShipOnclick {
/// 1.单列字符串选择器(传字符串数组)
BRStringPickerView *stringPickerView = [[BRStringPickerView alloc]init];
stringPickerView.pickerMode = BRStringPickerComponentSingle;
stringPickerView.title = @"关系";
NSMutableArray * array = [[NSMutableArray alloc] init];
for (FamilyMemberRelationModel * model in self.memberArray) {
[array addObject:model.text];
}
stringPickerView.dataSourceArr = array;
stringPickerView.selectIndex = 2;
stringPickerView.resultModelBlock = ^(BRResultModel *resultModel) {
NSLog(@"选择的值:%@", resultModel.value);
for (FamilyMemberRelationModel * model in self.memberArray) {
if ([model.text isEqualToString:resultModel.value]) {
self.familyInt = model.value;
}
}
self.relationshipTextField.text = resultModel.value;
};
[stringPickerView show];
}
- (void)womanAction {
[self.view endEditing:TRUE];
self.womanBtn.selected = true;
self.manBtn.selected = false;
}
- (void)manAction {
[self.view endEditing:TRUE];
self.womanBtn.selected = false;
self.manBtn.selected = true;
}
- (void)saveInfo {
[self.view endEditing:TRUE];
NSInteger sexInter;
sexInter = self.womanBtn.selected == true ?1:2;
if (ValidStr(self.questionNameField.text)) {
[EasyTextView showErrorText:@"请输入咨询人姓名"];
return;
}
if (self.womanBtn.selected == false && self.manBtn.selected == false ) {
[EasyTextView showErrorText:@"请选择咨询人性别"];
return;
}
if (ValidStr(self.birthdayTextField.text)) {
[EasyTextView showErrorText:@"请选择咨询人出生日期"];
return;
}
if (ValidStr(self.heiTextField.text)) {
[EasyTextView showErrorText:@"请输入咨询人身高"];
return;
}
if (ValidStr(self.weightTextField.text)) {
[EasyTextView showErrorText:@"请输入咨询人体重"];
return;
}
if (ValidStr(self.relationshipTextField.text)) {
[EasyTextView showErrorText:@"请选择与咨询人关系"];
return;
}
if (self.questionModel) {
[self updateQuestionInfo];
}else
{
[kAppWindow addSubview:self.popView];
}
}
- (NSString *)getTimestampFromTime:(NSString *)CurrentTime{
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateStyle:NSDateFormatterMediumStyle];
[formatter setTimeStyle:NSDateFormatterShortStyle];
[formatter setDateFormat:@"yyyy-MM-dd"]; //(@"YYYY-MM-dd hh:mm:ss") ----------设置你想要的格式,hh与HH的区别:分别表示12小时制,24小时制
//设置时区选择北京时间
NSTimeZone* timeZone = [NSTimeZone timeZoneWithName:@"Asia/Beijing"];
[formatter setTimeZone:timeZone];
NSDate* date = [formatter dateFromString:CurrentTime]; //------------将字符串按formatter转成nsdate
//时间转时间戳的方法:
NSInteger timeSp = [[NSNumber numberWithDouble:[date timeIntervalSince1970]] integerValue] * 1000;
return [NSString stringWithFormat:@"%ld",(long)timeSp];
}
- (void)jumpOnclick {
self.isJump = true;
[self.popView removeFromSuperview];
[self addQuestionInfo];
}
- (void)updateQuestionInfo {
NSInteger sexInter;
sexInter = self.womanBtn.selected == true ?1:2;
[self showMBProgressHUDWithString:@"更新中,请稍候..." autoHidden:false];
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
NSString * time = [self getTimestampFromTime:self.birthdayTextField.text];
[parmDic setObject:self.questionNameField.text forKey:@"name"];
[parmDic setObject:@(sexInter) forKey:@"gender"];
[parmDic setObject:time forKey:@"birthdayLong"];
[parmDic setObject:self.heiTextField.text forKey:@"height"];
[parmDic setObject:self.weightTextField.text forKey:@"weight"];
if (ValidStr(self.familyInt)) {
self.familyInt = self.questionModel.familyRelation;
}
[parmDic setObject:self.familyInt forKey:@"familyRelation"];
[parmDic setObject:self.questionModel.people_id forKey:@"id"];
JKCQAPI * api = [[JKCQAPI alloc] init:self tag:@"updataAPI" NeedToken:@""];
[api postUpdateQuestionFailyMembers:parmDic];
}
- (void)wanshanOnclick {
self.isJump = false;
[self.popView removeFromSuperview];
[self addQuestionInfo];
}
- (void)addQuestionInfo {
[self.view endEditing:TRUE];
NSInteger sexInter;
sexInter = self.womanBtn.selected == true ?1:2;
if (ValidStr(self.questionNameField.text)) {
[EasyTextView showErrorText:@"请输入咨询人姓名"];
return;
}
if (self.womanBtn.selected == false && self.manBtn.selected == false ) {
[EasyTextView showErrorText:@"请选择咨询人性别"];
return;
}
if (ValidStr(self.birthdayTextField.text)) {
[EasyTextView showErrorText:@"请选择咨询人出生日期"];
return;
}
if (ValidStr(self.heiTextField.text)) {
[EasyTextView showErrorText:@"请输入咨询人身高"];
return;
}
if (ValidStr(self.weightTextField.text)) {
[EasyTextView showErrorText:@"请输入咨询人体重"];
return;
}
if (ValidStr(self.relationshipTextField.text)) {
[EasyTextView showErrorText:@"请选择与咨询人关系"];
return;
}
[self showMBProgressHUDWithString:@"加载中,请稍候..." autoHidden:false];
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
NSString * time = [self getTimestampFromTime:self.birthdayTextField.text];
[parmDic setObject:self.questionNameField.text forKey:@"name"];
[parmDic setObject:@(sexInter) forKey:@"gender"];
[parmDic setObject:time forKey:@"birthdayLong"];
[parmDic setObject:self.heiTextField.text forKey:@"height"];
[parmDic setObject:self.weightTextField.text forKey:@"weight"];
[parmDic setObject:self.familyInt forKey:@"familyRelation"];
JKCQAPI * api = [[JKCQAPI alloc] init:self tag:@"ADDAPI" NeedToken:@""];
[api getAddQuestionFailyMembers:parmDic];
}
- (void)healthInfoAction {
BasicHealthInfoViewController * basicVC = [[BasicHealthInfoViewController alloc] init];
basicVC.memberId = self.questionModel.people_id;
[self.navigationController pushViewController:basicVC animated:YES];
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
@@ -1,19 +0,0 @@
//
// BasicHealthInfoViewController.h
// EscortProject
//
// Created by 仁康信息 on 2023/6/21.
//
#import "HQBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface BasicHealthInfoViewController : HQBaseViewController
@property (nonatomic, strong) NSString * memberId;
@property (nonatomic, assign) bool isAddQuetsion;
@end
NS_ASSUME_NONNULL_END
@@ -1,290 +0,0 @@
//
// BasicHealthInfoViewController.m
// EscortProject
//
// Created by 仁康信息 on 2023/6/21.
//
#import "BasicHealthInfoViewController.h"
#import "BasicHealthTable.h"
#import "QuestionOptionModel.h"
#import "QuestionPeopleMangerVC.h"
@interface BasicHealthInfoViewController ()
@property (nonatomic, strong) BasicHealthTable * homeTable;
@property (nonatomic, strong) NSMutableArray * dataArray;
@end
@implementation BasicHealthInfoViewController
- (NSMutableArray *)dataArray {
if (!_dataArray) {
_dataArray = [[NSMutableArray alloc] init];
}
return _dataArray;
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.isHidenNaviBar = false;
self.navigationItem.title = @"基本健康信息";
[self createUI];
[self createData];
[self addNavigationItemWithImageNames:@[@"whiteBack_icon"] isLeft:YES target:self action:@selector(backQuestionVC) tags:@[@"1"]];
}
- (void)backQuestionVC {
if (self.isAddQuetsion == true) {
for (UIViewController *controller in self.navigationController.viewControllers)
{
if ([controller isKindOfClass:[QuestionPeopleMangerVC class]]) {
QuestionPeopleMangerVC * phyVC =(QuestionPeopleMangerVC *)controller;
[self.navigationController popToViewController:phyVC animated:false];
}
}
}else
{
[self.navigationController popViewControllerAnimated:YES];
}
}
- (void)createUI {
self.homeTable = [[BasicHealthTable alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight - kTopHeight) style:UITableViewStyleGrouped];
self.homeTable.saveBlock = ^(NSArray * _Nonnull array) {
DLog(@"%@",array);
NSString * baseHealthId;
NSString * itemType;
NSString * itemOptions = @"";
NSMutableArray * customArray = [[NSMutableArray alloc] init];
for (QuestionOptionModel * model in array) {
for (QuestionOptionChildListModel * listModel in model.childList) {
baseHealthId = listModel.option_id;
itemType = listModel.itemType;
NSMutableDictionary * pamrDic = [[NSMutableDictionary alloc] init];
for (QuestionOptionCustomModel * customModel in listModel.answerList) {
[pamrDic setObject:customModel.value forKey:customModel.radioText];
// itemOptions = [NSString stringWithFormat:@"%@,%@",currentString,itemOptions];
itemOptions = [self convertToJSONData:pamrDic];
}
listModel.itemOptions = itemOptions;
itemOptions = @"";
}
[customArray addObject:model];
}
DLog(@"%@",customArray);
[self saveBaseHealthInfo:customArray];
};
[self.view addSubview:self.homeTable];
}
- (void)createData {
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:self.memberId forKey:@"memberId"];
JKCQAPI * detailApi = [[JKCQAPI alloc] init:self tag:@"MEMBERAPI" NeedToken:@""];
[detailApi getQustionOptionsMembers :parmDic];
}
- (void)Failed:(NSString*)message tag:(NSString*)tag
{
[self hiddenAllMBProgressHUD];
[EasyTextView showSuccessText:message];
}
- (void)Sucess:(id)response tag:(NSString*)tag
{
[self hiddenAllMBProgressHUD];
if ([tag isEqualToString:@"MEMBERAPI"]) {
NSArray * array = response;
for (NSDictionary * dic in array) {
QuestionOptionModel * model = [QuestionOptionModel modelWithDictionary:dic];
NSMutableArray * customAnswerArray = [[NSMutableArray alloc] init];
for (QuestionOptionChildListModel * optionModel in model.childList) {
NSData *jsonData = [optionModel.itemOptions dataUsingEncoding:NSUTF8StringEncoding];
NSDictionary * dictionary = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableContainers error:nil];
NSMutableArray * dicArray = [[NSMutableArray alloc] init];
[dictionary enumerateKeysAndObjectsUsingBlock:^(id  _Nonnull key, id  _Nonnull obj, BOOL * _Nonnull stop) {
NSDictionary * dic = @{@"radioText":key,@"itemType":optionModel.itemType,@"checked":@(false),@"value":[NSString stringWithFormat:@"%@",obj]};
NSString *mainString = optionModel.itemOptions;
NSString *subString = key;
NSRange range = [mainString rangeOfString:subString];
if (range.location != NSNotFound) {
NSLog(@"Substring '%@' found at location %lu, length %lu", subString, (unsigned long)range.location, (unsigned long)range.length);
} else {
NSLog(@"Substring '%@' not found", subString);
}
QuestionOptionCustomModel * model = [[QuestionOptionCustomModel alloc] init];
model.radioText = key;
model.itemType = optionModel.itemType;
model.checked = false;
model.loctaionThin = range.location;
if ([optionModel.itemType intValue] == 4) { //带输入框
}else
{
if ([obj boolValue] == true) {
optionModel.answerContent = key;
}
}
model.value =[NSString stringWithFormat:@"%@",obj] ;
[dicArray addObject:model];
optionModel.answerList = dicArray;
}];
}
[self.dataArray addObject:model];
}
self.homeTable.dataArray = self.dataArray;
}
if ([tag isEqualToString:@"UPHEALTH"]) {
[EasyTextView showSuccessText:response];
[self backQuestionVC];
}
}
- (void)saveBaseHealthInfo:(NSArray *)array {
NSMutableArray * jsonArray = [[NSMutableArray alloc] init];
NSString * baseHealthId;
NSString * itemType;
NSString * itemOptions = @"";
NSMutableArray * customArray = [[NSMutableArray alloc] init];
for (QuestionOptionModel * model in array) {
for (QuestionOptionChildListModel * listModel in model.childList) {
baseHealthId = listModel.option_id;
itemType = listModel.itemType;
NSMutableDictionary * dic = [[NSMutableDictionary alloc] init];
[dic setObject:baseHealthId forKey:@"id"];
[dic setObject:listModel.itemOptions forKey:@"itemOptions"];
[dic setObject:listModel.itemType forKey:@"itemType"];
[dic setObject:self.memberId forKey:@"memberId"];
if (![listModel.itemOptions containsString:@"1"]) {
[EasyTextView showErrorText:[NSString stringWithFormat:@"请选择%@",listModel.itemProblem]];
return;
}
if ([listModel.itemType intValue] == 4) {
NSString *itemOptionsJSONString = listModel.itemOptions;
NSData *jsonData = [itemOptionsJSONString dataUsingEncoding:NSUTF8StringEncoding];
NSDictionary *itemOptions = [NSJSONSerialization JSONObjectWithData:jsonData options:0 error:nil];
if ([itemOptions[@""] isEqualToString:@"1"]) {
listModel.answerContent = @"";
}
}
[dic setObject:listModel.answerContent forKey:@"answerContent"];
[jsonArray addObject:dic];
}
[customArray addObject:model];
}
[self showMBProgressHUDWithString:@"正在保存" autoHidden:NO];
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:jsonArray forKey:@"list"];
JKCQAPI * detailApi = [[JKCQAPI alloc] init:self tag:@"UPHEALTH" NeedToken:@""];
[detailApi postBaseHealthInfoAPI :parmDic];
}
- (NSString*)convertToJSONData:(id)infoDict
{
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:infoDict
options:NSJSONWritingPrettyPrinted // Pass 0 if you don't care about the readability of the generated string
error:&error];
NSString *jsonString = @"";
if (! jsonData)
{
}else
{
jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
}
jsonString = [jsonString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; //去除掉首尾的空白字符和换行字符
[jsonString stringByReplacingOccurrencesOfString:@"\n" withString:@""];
return jsonString;
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
@@ -1,21 +0,0 @@
//
// DoctorMainViewController.h
// EscortProject
//
// Created by 仁康信息 on 2023/4/20.
//
#import "HQBaseViewController.h"
#import "QuestionDiseaseInfoModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface DoctorMainViewController : HQBaseViewController
@property (nonatomic, strong) QuestionDiseaseInfoModel * disModel;
@property (nonatomic, strong) NSString * yuyue_id;
@property (nonatomic, assign) NSInteger popType; // 1返回上一页 其他跳转向相应
@end
NS_ASSUME_NONNULL_END
@@ -1,733 +0,0 @@
//
// DoctorMainViewController.m
// EscortProject
//
// Created by 仁康信息 on 2023/4/20.
//
#import "DoctorMainViewController.h"
#import "DoctorStatusView.h"
#import "DoctorInfoTopView.h"
#import "AppointmentInfoView.h"
#import "evaluationPopView.h"
#import "SelectedDoctorTimeVC.h"
#import "DoctorReportModel.h"
#import "LookModficalFileViewController.h"
#import "QuesstionDetailLookFileViewController.h"
#import "QuestionBodyReportModel.h"
#import "ExpertMainViewController.h"
#import "evaluationPopView.h"
#import "FSXBStarRateView.h"
#import "SelectedQuestionViewController.h"
@interface DoctorMainViewController ()<UIGestureRecognizerDelegate>
@property (nonatomic, strong) DoctorReportDoctorInfoModel * doctorModel;
@property (nonatomic, strong) DoctorReportConSessionModel * sessionModel;
@property (nonatomic, strong) DoctorReportRecordsModel * danganModel;
@property (nonatomic, strong) DoctorInfoTopView * doctorInfoView;
@property (nonatomic, strong) AppointmentInfoView * AppointView;
@property (nonatomic, strong) UIScrollView * mainScrollview;
@property (nonatomic, copy) NSString * yueyue_id;
@property (nonatomic, strong) UIButton * bottomBtn;
@property (nonatomic, strong) UIButton * pingjiaBtn;
@property (nonatomic, strong) UIView * evaluateView;
@property (nonatomic, strong) NSMutableArray * topViewArray;
@property (nonatomic, strong) UILabel * evaluateLabel;
@property (nonatomic, strong) UILabel * evaluateNameLabel;
@property (nonatomic, strong) FSXBStarRateView * starRateView;
@property (nonatomic, strong) evaluationPopView * popView;
@end
@implementation DoctorMainViewController
- (NSMutableArray *)topViewArray {
if (!_topViewArray) {
_topViewArray = [[NSMutableArray alloc] init];
}
return _topViewArray;
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.view.backgroundColor = UIColorHex(#EFEFEF);
// 注册键盘通知
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillShow:)
name:UIKeyboardWillShowNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillHide:)
name:UIKeyboardWillHideNotification
object:nil];
// 启用侧滑返回手势
self.navigationController.interactivePopGestureRecognizer.delegate = self;
self.navigationController.interactivePopGestureRecognizer.enabled = YES;
// 创建自定义手势识别器
UIScreenEdgePanGestureRecognizer *panGesture = [[UIScreenEdgePanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePanGesture:)];
panGesture.edges = UIRectEdgeLeft;
[self.view addGestureRecognizer:panGesture];
self.isHidenNaviBar = YES;
[self createTopAndNav];
[self createStatusView];
[self createData];
}
- (void)createTopAndNav {
UIView * navView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kRealValue(222))];
navView.backgroundColor = UIColorHex(#21BEBD);
[self.view addSubview:navView];
UIButton * backBtn = [[UIButton alloc] initWithFrame:CGRectMake(kRealValue(15), kStatusBarHeight + kRealValue(15), 30, 30)];
[backBtn setImage:[UIImage imageNamed:@"whiteBack_icon"] forState:UIControlStateNormal];
[backBtn addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
[navView addSubview:backBtn];
}
- (void)backAction {
// if (self.popType == 1) {
// [self.navigationController popViewControllerAnimated:YES];
// }else
// {
//// int i = 0;
//// int allCount = self.navigationController.viewControllers.count;
//// for (UIViewController *controller in self.navigationController.viewControllers)
//// {
//// if ([controller isKindOfClass:[ExpertMainViewController class]]) {
//// ExpertMainViewController * expervc =(ExpertMainViewController *)controller;
//// [self.navigationController popToViewController:expervc animated:YES];
//// }
//// if ([controller isKindOfClass:[OneKeyQuestionDetailVC class]]) {
//// OneKeyQuestionDetailVC * phyVC =(OneKeyQuestionDetailVC *)controller;
//// [self.navigationController popToViewController:phyVC animated:false];
//// }
//// i++;
//// if (i == allCount && ![controller isKindOfClass:[ExpertMainViewController class]] && ![controller isKindOfClass:[OneKeyQuestionDetailVC class]] ) {
//// [self.navigationController popViewControllerAnimated:YES];
//// }
////
//// }
// // 获取导航堆栈视图控制器数组
// NSArray *viewControllers = self.navigationController.viewControllers;
//
// // 确保堆栈中有足够的视图控制器
// if (viewControllers.count >= 3) {
// // 返回到上上级视图控制器
// UIViewController *targetViewController = viewControllers[viewControllers.count - 3];
// [self.navigationController popToViewController:targetViewController animated:YES];
// } else {
// // 处理视图控制器不足的情况,比如弹出提示或者直接 popToRootViewController
// [self.navigationController popViewControllerAnimated:YES];
// }
// }
// 获取当前导航控制器的视图控制器堆栈
NSArray *viewControllers = self.navigationController.viewControllers;
// 查找导航堆栈中的目标视图控制器
UIViewController *targetViewController = nil;
for (UIViewController *vc in viewControllers) {
if ([vc isKindOfClass:[SelectedQuestionViewController class]]) {
targetViewController = vc;
break;
}
}
if (targetViewController) {
// 如果找到目标视图控制器,则弹出到该视图控制器
[self.navigationController popToViewController:targetViewController animated:YES];
} else {
// 如果没有找到目标视图控制器,则返回到上一页
[self.navigationController popViewControllerAnimated:YES];
}
}
- (void)createStatusView {
NSArray * array = @[@" 待确认 ",@" 待开始 ",@"在线咨询",@" 待评价 ",@" 完成 "];
CGFloat statusW = (kScreenWidth - kRealValue(68))/5;
for (int i = 0; i < 5 ; i ++) {
DoctorStatusView * statusView = [[DoctorStatusView alloc] initWithFrame:CGRectMake(kRealValue(34) + (statusW + 5) * i , kTopHeight + kRealValue(5), statusW, kRealValue(50))];
if (i == 0) {
statusView.isSelected = true;
}else
{
statusView.isSelected = false;
}
statusView.lastType = 4;
statusView.statusString = array[i];
[self.topViewArray addObject:statusView];
[self.view addSubview:statusView];
}
UILabel * titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(33), kTopHeight + kRealValue(11) + kRealValue(70) , kScreenWidth - kRealValue(66), 13)];
titleLabel.text = @"预约成功后,请就诊当日打开APP等待医生呼叫";
titleLabel.textColor = KWhiteColor;
titleLabel.font = MEDIUMFONT(12);
titleLabel.textAlignment = NSTextAlignmentLeft;
[self.view addSubview:titleLabel];
UIButton * bottomBtn = [[UIButton alloc] initWithFrame:CGRectMake(kRealValue(31.5), kScreenHeight - 50 , self.view.width - kRealValue(66), 40)];
[bottomBtn setTitle:@"取消预约" forState:UIControlStateNormal];
[bottomBtn setTitleColor:UIColorHex(#21BEBD) forState:UIControlStateNormal];
bottomBtn.titleLabel.font = SYSTEMFONT(14);
bottomBtn.layer.cornerRadius = 20;
bottomBtn.layer.masksToBounds = true;
bottomBtn.layer.borderColor = UIColorHex(#21BEBD).CGColor;
[bottomBtn addTarget:self action:@selector(cancelAppointClick) forControlEvents:UIControlEventTouchUpInside];
bottomBtn.layer.borderWidth = 1.0f;
self.bottomBtn = bottomBtn;
[self.view addSubview:bottomBtn];
self.pingjiaBtn = [[UIButton alloc] initWithFrame:CGRectMake(kRealValue(31.5), kScreenHeight - 50 , self.view.width - kRealValue(66), 40)];
[self.pingjiaBtn setTitle:@"去评价" forState:UIControlStateNormal];
[self.pingjiaBtn setTitleColor:KWhiteColor forState:UIControlStateNormal];
self.pingjiaBtn.titleLabel.font = SYSTEMFONT(14);
self.pingjiaBtn.layer.cornerRadius = 20;
self.pingjiaBtn.layer.masksToBounds = true;
[self.pingjiaBtn addTarget:self action:@selector(qupingjiaAction) forControlEvents:UIControlEventTouchUpInside];
self.pingjiaBtn.hidden = true;
self.pingjiaBtn.backgroundColor = UIColorHex(#21BEBD);
[self.view addSubview:self.pingjiaBtn];
MJWeakSelf
UIScrollView * mainScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(kRealValue(15), titleLabel.bottom + kRealValue(27), kScreenWidth - kRealValue(30),kScreenHeight - titleLabel.bottom - 50 - 40)];
mainScrollView.showsVerticalScrollIndicator = false;
mainScrollView.showsHorizontalScrollIndicator = false;
mainScrollView.backgroundColor = KClearColor;
self.mainScrollview = mainScrollView;
[self.view addSubview:mainScrollView];
DoctorInfoTopView * infoView = [[DoctorInfoTopView alloc] initWithFrame:CGRectMake(0, 0, mainScrollView.width, 210)];
infoView.backgroundColor = KWhiteColor;
self.doctorInfoView = infoView;
infoView.height = infoView.doctorinfoHeight;
infoView.layer.cornerRadius = 5.0;
infoView.layer.masksToBounds = true;
infoView.collectBlock = ^(DoctorReportDoctorInfoModel * _Nonnull doctorModel) {
[weakSelf collectDoctor:doctorModel];
};
[mainScrollView addSubview:infoView];
AppointmentInfoView * AppointView = [[AppointmentInfoView alloc] initWithFrame:CGRectMake(0, infoView.bottom + kRealValue(10), mainScrollView.width, 400)];
AppointView.backgroundColor = KWhiteColor;
self.AppointView = AppointView;
AppointView.lookBlock = ^{
[weakSelf lookFileDeatil];
};
[HQCommonUtils addShadowToView:AppointView];
AppointView.height = AppointView.infoH;
[mainScrollView addSubview:AppointView];
self.evaluateView = [[UIView alloc] initWithFrame:CGRectMake(0, AppointView.bottom + kRealValue(10), mainScrollView.width, 50)];
self.evaluateView.backgroundColor = KWhiteColor;
self.evaluateView.layer.cornerRadius = 10;
self.evaluateView.layer.masksToBounds = true;
self.evaluateView.hidden = true;
[mainScrollView addSubview:self.evaluateView];
self.evaluateNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(15), kRealValue(15), 100, 15)];
self.evaluateNameLabel.textColor = CFontColor1;
self.evaluateNameLabel.textAlignment = NSTextAlignmentLeft;
self.evaluateNameLabel.font = BOLDSYSTEMFONT(14);
self.evaluateNameLabel.text = @"--";
[self.evaluateView addSubview:self.evaluateNameLabel];
self.starRateView = [[FSXBStarRateView alloc] initWithFrame:CGRectMake(self.evaluateNameLabel.right, kRealValue(13), 100, 15) numberOfStars:5 rateStyle:HalfStar isAnination:YES finish:^(CGFloat currentScore) {
}];
self.starRateView.enable = false;
self.starRateView.currentScore = 3;
[self.evaluateView addSubview:self.starRateView];
self.evaluateLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(15),self.evaluateNameLabel.bottom + kRealValue(15), self.evaluateView.width - kRealValue(30), 15)];
self.evaluateLabel.textColor = CFontColor2;
self.evaluateLabel.textAlignment = NSTextAlignmentLeft;
self.evaluateLabel.font = SYSTEMFONT(12);
self.evaluateLabel.text = @"--";
[self.evaluateView addSubview:self.evaluateLabel];
mainScrollView.contentSize = CGSizeMake(kScreenWidth - kRealValue(30), kScreenHeight - titleLabel.bottom - 50 - 40);
}
- (void)createData {
[self showMBProgressHUDWithString:@"数据加载中,请稍候..." autoHidden:NO];
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:self.yuyue_id forKey:@"id"];
JKCQAPI * detailApi = [[JKCQAPI alloc] init:self tag:@"ReportApi" NeedToken:@""];
[detailApi getAppointmentReportDetailAPI:parmDic];
}
- (void)Failed:(NSString*)message tag:(NSString*)tag
{
[self showMBProgressHUDOnlyWithString:message];
[self hiddenAllMBProgressHUD];
}
- (void)Sucess:(id)response tag:(NSString*)tag
{
if ([tag isEqualToString:@"ReportApi"]) {
[self hiddenAllMBProgressHUD];
NSDictionary * resDic = response;
DoctorReportModel * model = [DoctorReportModel modelWithDictionary:resDic];
self.sessionModel = [DoctorReportConSessionModel modelWithDictionary:model.conSession] ;
self.doctorModel = [DoctorReportDoctorInfoModel modelWithDictionary:model.conDoctorDO] ;
self.danganModel = [DoctorReportRecordsModel modelWithDictionary:model.conMedicalRecordsListDO];
// 预约状态 1待确认 2待开始 3已开始 4待评价 5已完成 6 拒绝 7取消 8 超时
[self topStatus:[self.sessionModel.contentStatus intValue]];
self.doctorInfoView.model = model;
// self.AppointView.recordModel = [DoctorReportRecordsModel modelWithDictionary:model.conMedicalRecordsListDO] ;
// self.AppointView.familyModel = [DoctorReportFamilyInfoModel modelWithDictionary:model.conFamilyMembersDO];
// self.AppointView.answerModel = model;
self.AppointView.model = model;
if ([self.sessionModel.contentStatus intValue] == 7) {
self.AppointView.isQuxiao = true;
self.bottomBtn.hidden = true;
}
if ([self.sessionModel.contentStatus intValue] == 6) {
self.AppointView.isQuxiao = false;
self.bottomBtn.hidden = true;
}
if ([self.sessionModel.contentStatus intValue] == 4) {
self.pingjiaBtn.hidden = false;
}
if ([self.sessionModel.contentStatus intValue] == 5) {
self.pingjiaBtn.hidden = true;
self.bottomBtn.hidden = true;
self.evaluateView.hidden = false;
DoctorConEvaluateDOModel * evModel = [DoctorConEvaluateDOModel modelWithDictionary:model.conEvaluateDO] ;
self.evaluateLabel.text = evModel.context;
self.evaluateNameLabel.text = evModel.userName;
self.starRateView.currentScore = [evModel.score floatValue];
self.evaluateNameLabel.width = [HQCommonUtils getLengthFromText:self.evaluateNameLabel.text andFontSize:16];
self.starRateView.left = self.evaluateNameLabel.right + kRealValue(10);
self.evaluateLabel.height = [HQCommonUtils getSpaceLabelHeight:self.evaluateLabel withStr:self.evaluateLabel.text withFont:[UIFont systemFontOfSize:12 weight:UIFontWeightMedium] withWidth:self.evaluateLabel.width withLineSpacing:5];
self.evaluateView.height = self.evaluateLabel.bottom + kRealValue(10);
}
if ([self.sessionModel.contentStatus intValue] == 1 || [self.sessionModel.contentStatus intValue] == 2 || [self.sessionModel.contentStatus intValue] == 3)
{
self.AppointView.isQuxiao = false;
}
//布局
self.doctorInfoView.height = self.doctorInfoView.doctorinfoHeight;
self.AppointView.top = self.doctorInfoView.bottom + 10;
self.AppointView.height = self.AppointView.infoH;
self.evaluateView.top = self.AppointView.bottom + 10;
self.AppointView.height = self.AppointView.infoH;
self.evaluateView.top = self.AppointView.bottom + 10;
self.mainScrollview.contentSize = CGSizeMake(kScreenWidth - kRealValue(30), self.evaluateView.bottom);
// //是否体检报告
// if ([self.danganModel.tfPermission integerValue] == 1) { //有体检报告
//
// [self getBodyInfoReport:model.idNo];
//
// }else
// {
//
// }
}
if ([tag isEqualToString:@"CARDSEARCH"]) {
[self hiddenAllMBProgressHUD];
// NSDictionary * dic = response;
//
// if ([dic.allKeys containsObject:@"records"]) {
// int i = 0;
// NSArray * array = [dic objectForKey:@"records"];
// for (NSDictionary * parm in array) {
//
// PhyscialReportListModel * model = [PhyscialReportListModel modelWithDictionary:parm];
//
// if (i == 0) {
// self.AppointView.bodyModel =model;
// }
// i++;
// }
// if (array.count <= 0) {
// self.AppointView.bodyModel = nil;
// }
// self.AppointView.height = self.AppointView.infoH;
// self.evaluateView.top = self.AppointView.bottom + 10;
// self.mainScrollview.contentSize = CGSizeMake(kScreenWidth - kRealValue(30), self.evaluateView.bottom);
//
// }
//
}
if ([tag isEqualToString:@"CANCELQUESTION"]) {
[self hiddenAllMBProgressHUD];
[self createData];
}
if ([tag isEqualToString:@"CollAPI"]) {
[self hiddenAllMBProgressHUD];
[EasyTextView showSuccessText:response];
[self createData];
}
if ([tag isEqualToString:@"cancelAPI"]) {
[self hiddenAllMBProgressHUD];
[EasyTextView showSuccessText:response];
[self createData];
}
if ([tag isEqualToString:@"DoctorSource"]) {
[self hiddenAllMBProgressHUD];
[self.popView removeFromSuperview];
[self createData];
}
}
- (void)collectDoctor:(DoctorReportDoctorInfoModel *)doctorModel {
if([doctorModel.tfFollow integerValue] == 1) { //已经关注 点击取消
[self showMBProgressHUDWithString:@"正在取消关注" autoHidden:false];
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:doctorModel.doctor_id forKey:@"doctorId"];
JKCQAPI * detailApi = [[JKCQAPI alloc] init:self tag:@"cancelAPI" NeedToken:@""];
[detailApi getCancelCollectDoctorExpertData:parmDic];
}
else
{
[self showMBProgressHUDWithString:@"正在关注" autoHidden:false];
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:doctorModel.doctor_id forKey:@"doctorId"];
JKCQAPI * detailApi = [[JKCQAPI alloc] init:self tag:@"CollAPI" NeedToken:@""];
[detailApi getCollectDoctorExpertData:parmDic];
}
}
//请求体检信息
- (void)getBodyInfoReport:(NSString *)byID {
// NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
//
// [parmDic setObject:User_ID forKey:@"userId"];
//
// JKCQAPI * api = [[JKCQAPI alloc] init:self tag:@"CARDSEARCH" NeedToken:nil];
//
// [api GetPhyscialIDCardSearch:parmDic];
}
- (void)topStatus:(int)status {
//预约状态 1待确认 2待开始 3已开始 4待评价 5已完成
// 6 拒绝 7取消 8 超时
if(status == 1 || status == 6 ) {
int i = 0;
for (DoctorStatusView * topView in self.topViewArray) {
if ( i == 0) {
topView.isSelected = true;
}else
{
topView.isSelected = false;
}
topView.lastType = i ;
i ++;
}
}
if(status == 2) {
int i = 0;
for (DoctorStatusView * topView in self.topViewArray) {
if ( i == 1) {
topView.isSelected = true;
}else
{
topView.isSelected = false;
}
topView.lastType = i ;
i ++;
}
}
if(status == 3) {
int i = 0;
for (DoctorStatusView * topView in self.topViewArray) {
if ( i == 2) {
topView.isSelected = true;
}else
{
topView.isSelected = false;
}
i ++;
}
}
if(status == 4) {
int i = 0;
for (DoctorStatusView * topView in self.topViewArray) {
if ( i == 3) {
topView.isSelected = true;
}else
{
topView.isSelected = false;
}
topView.lastType = i ;
i ++;
}
}
if(status == 5) {
int i = 0;
for (DoctorStatusView * topView in self.topViewArray) {
if ( i == 4) {
topView.isSelected = true;
}else
{
topView.isSelected = false;
}
topView.lastType = i ;
i ++;
}
}
// 6 拒绝 7取消 8 超时
if(status == 7)
{
int i = 0;
for (DoctorStatusView * topView in self.topViewArray) {
if ( i == 1) {
topView.statusString = @"取消预约";
topView.isSelected = true;
}else
{
topView.isSelected = false;
}
topView.lastType = i ;
i ++;
}
}
if(status == 8 )
{
DoctorStatusView * topView = self.topViewArray.lastObject;
topView.isSelected = true;
}
DoctorStatusView * lastView = self.topViewArray.lastObject;
lastView.lastType = 4;
}
#pragma mark:查看档案详情
- (void)lookFileDeatil {
#pragma mark - 网络请求
// NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
//
// [parmDic setObject:self.danganModel.dangan_id forKey:@"id"];
//
// JKCQAPI * upApi = [[JKCQAPI alloc] init:self tag:@"FILEDATA" NeedToken:@""];
//
// [upApi GetLookModficalMemberShipFileData:parmDic];
//
QuesstionDetailLookFileViewController * detailvc = [[QuesstionDetailLookFileViewController alloc] init];
detailvc.danganID = self.danganModel.dangan_id;
[self.navigationController pushViewController:detailvc animated:YES];
}
#pragma mark:查看体检报告
- (void)lookReportDeatil {
// PhysicalReportViewController * phyVC = [[PhysicalReportViewController alloc] init];
// [self.navigationController pushViewController:phyVC animated:YES];
// PhyReportDetailViewController * yearVC = [[PhyReportDetailViewController alloc] init];
// yearVC.navTitle = model.medicalYear;
// yearVC.yearString = model.report_id;
// [self.navigationController pushViewController:yearVC animated:YES];
}
#pragma mark:取消预约
- (void)cancelAppointClick {
// GET http://cqyt.dev.yg.dt.io/health-consultation/api/consult/conSession/cancelSession?id=1716737797670907906 HTTP/1.1
// evaluationPopView * popView = [[evaluationPopView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)];
// popView.popBlock = ^(CGFloat starNumber, BOOL isSecrect, NSString * _Nonnull evaluationString) {
// [EasyTextView showInfoText:@"点击了提交"];
// };
// [[UIApplication sharedApplication].keyWindow addSubview:popView];
// GET http://cqyt.dev.yg.dt.io/health-consultation/api/consult/conDoctorSchedulingDate/selectSchedulingDateListByDoctorId?doctorId=1539253293e421ab0115425351860001 HTTP/1.1
// QuesstionDetailLookFileViewController * lookVC = [[QuesstionDetailLookFileViewController alloc] init];
//
// lookVC.danganID = self.danganModel.dangan_id;
//
// [self.navigationController pushViewController:lookVC animated:YES];
[self showMBProgressHUDWithString:@"正在取消..." autoHidden:false];
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:self.sessionModel.yuyue_id forKey:@"id"];
JKCQAPI * api = [[JKCQAPI alloc] init:self tag:@"CANCELQUESTION" NeedToken:nil];
[api getCancelQuestion:parmDic];
}
- (void)qupingjiaAction {
evaluationPopView * popView = [[evaluationPopView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)];
self.popView = popView;
popView.popBlock = ^(CGFloat starNumber, BOOL isSecrect, NSString * _Nonnull evaluationString) {
NSString * niming = isSecrect == YES? @"1":@"0";
[self doctorSourceWithStarNumaber:starNumber withContext:evaluationString isKnow:niming];
};
[[UIApplication sharedApplication].keyWindow addSubview:popView];
}
- (void)doctorSourceWithStarNumaber:(CGFloat)starNumer withContext:(NSString *)connet isKnow:(NSString *)isNiming{
[self showMBProgressHUDWithString:@"评价中,请稍候..." autoHidden:false];
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:@(starNumer) forKey:@"score"];
[parmDic setObject:connet forKey:@"context"];
[parmDic setObject:self.sessionModel.yuyue_id forKey:@"sessionId"];
[parmDic setObject:isNiming forKey:@"tfUnknow"];
JKCQAPI * endApi = [[JKCQAPI alloc] init:self tag:@"DoctorSource" NeedToken:@""];
[endApi PostQustionDoctorScore:parmDic];
}
- (void)keyboardWillShow:(NSNotification *)notification {
// 获取键盘的大小和动画持续时间
NSDictionary *userInfo = [notification userInfo];
CGRect keyboardFrame = [[userInfo objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];
double duration = [[userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue];
// 根据键盘的大小调整视图的位置
[UIView animateWithDuration:duration animations:^{
// 您可以在这里调整视图的位置,例如:
self.popView.frame = CGRectMake(0, self.view.bounds.size.height - keyboardFrame.size.height - self.popView.bounds.size.height, self.popView.bounds.size.width, self.popView.bounds.size.height);
}];
}
- (void)keyboardWillHide:(NSNotification *)notification {
// 获取动画持续时间
NSDictionary *userInfo = [notification userInfo];
double duration = [[userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue];
// 恢复视图的位置
[UIView animateWithDuration:duration animations:^{
// 恢复视图到原来的位置,例如:
self.popView.frame = CGRectMake(0, 0, kScreenWidth, kScreenHeight); // originalFrame 是视图原来的位置
}];
}
- (void)dealloc {
// 移除通知
[[NSNotificationCenter defaultCenter] removeObserver:self
name:UIKeyboardWillShowNotification
object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:UIKeyboardWillHideNotification
object:nil];
}
// 手势处理方法
- (void)handlePanGesture:(UIScreenEdgePanGestureRecognizer *)gesture {
if (gesture.state == UIGestureRecognizerStateEnded) {
NSArray *viewControllers = self.navigationController.viewControllers;
UIViewController *targetViewController = nil;
// 查找导航堆栈中的目标视图控制器
for (UIViewController *vc in viewControllers) {
if ([vc isKindOfClass:[SelectedQuestionViewController class]]) {
targetViewController = vc;
break;
}
}
if (targetViewController) {
// 如果找到目标视图控制器,则弹出到该视图控制器
[self.navigationController popToViewController:targetViewController animated:YES];
} else {
// 如果没有找到目标视图控制器,则返回到上一页
[self.navigationController popViewControllerAnimated:YES];
}
}
}
// UIGestureRecognizerDelegate 方法
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {
// 确保只有在不是根视图控制器时才启用手势
return self.navigationController.viewControllers.count > 1;
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
@@ -1,16 +0,0 @@
//
// AudioVideoRecordViewController.h
// EscortProject
//
// Created by 仁康信息 on 2023/6/28.
//
#import "HQBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface AudioVideoRecordViewController : HQBaseViewController
@end
NS_ASSUME_NONNULL_END
@@ -1,229 +0,0 @@
//
// AudioVideoRecordViewController.m
// EscortProject
//
// Created by 仁康信息 on 2023/6/28.
//
#import "AudioVideoRecordViewController.h"
#import "QuestionRecoredTable.h"
#import "QuestionRecordModel.h"
#import "RecordIMListDateModel.h"
#import "DoctorMainViewController.h"
@interface AudioVideoRecordViewController ()
@property (nonatomic, strong) QuestionRecoredTable * homeTable;
@property (nonatomic, strong) NSMutableArray * buttonArray;
@property (nonatomic, strong) NSMutableArray * dataArray;
@property (nonatomic, assign) NSInteger pageNo;
@property (nonatomic, copy) NSString * type;
@end
@implementation AudioVideoRecordViewController
- (NSMutableArray *)dataArray {
if (!_dataArray) {
_dataArray = [[NSMutableArray alloc] init];
}
return _dataArray;
}
- (NSMutableArray *)buttonArray {
if (!_buttonArray) {
_buttonArray = [[NSMutableArray alloc] init];
}
return _buttonArray;
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.isHidenNaviBar = false;
self.pageNo = 1;
self.type = @"3";
[self createUI];
[self createData];
}
- (void)createUI {
// 3 1 5
NSArray * array = @[@"进行中",@"待确认",@"已完成"];
[self.buttonArray removeAllObjects];
CGFloat w = kRealValue(80);
for (int index = 0; index < array.count; index ++) {
UIButton * listBtn = [[UIButton alloc] init];
listBtn.frame = CGRectMake(kRealValue(15) + (w + kRealValue(13)) * index , kRealValue(15), w, 27);
[listBtn setTitle:array[index] forState:UIControlStateNormal];
[listBtn setTitleColor:KWhiteColor forState:UIControlStateSelected];
[listBtn setTitleColor:CFontColor1 forState:UIControlStateNormal];
[listBtn addTarget:self action:@selector(statusChange:) forControlEvents:UIControlEventTouchUpInside];
listBtn.titleLabel.font = SYSTEMFONT(13);
listBtn.layer.cornerRadius = 14.0;
listBtn.layer.masksToBounds = true;
listBtn.tag = 1000 + index;
[self.view addSubview:listBtn];
if (index == 0 ) {
listBtn.selected = YES;
listBtn.backgroundColor = UIColorHex(#21BEBD);
}else{
listBtn.backgroundColor = UIColorHex(#DDDDDD);
}
[self.buttonArray addObject:listBtn];
}
self.homeTable = [[QuestionRecoredTable alloc] initWithFrame:CGRectMake(0, 50, kScreenWidth, kScreenHeight - kTopHeight - kRealValue(110)) style:UITableViewStyleGrouped];
self.homeTable.detailBlock = ^(NSString * _Nonnull recordID, NSString * _Nonnull imID, NSString * _Nonnull memberId, RecordIMListDateModel * _Nonnull model) {
DoctorMainViewController * doctorVC = [[DoctorMainViewController alloc] init];
doctorVC.yuyue_id = recordID;
doctorVC.popType = 1;
[self.navigationController pushViewController:doctorVC animated:YES];
};
[self.view addSubview:self.homeTable];
[self.view addSubview:self.homeTable];
__weak __typeof(self) weakSelf = self;
self.homeTable.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
weakSelf.pageNo = 1;
[weakSelf createData];
}];
self.homeTable.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
weakSelf.pageNo ++;
[weakSelf createData];
}];
LYEmptyView *emptyView = [LYEmptyView emptyViewWithImageStr:@"noData" titleStr:@"暂无数据" detailStr:@""];
//元素竖直方向的间距
emptyView.subViewMargin = 20.f;
//标题颜色
emptyView.titleLabTextColor = [UIColor blackColor];
//描述字体
emptyView.detailLabFont = [UIFont systemFontOfSize:17];
//按钮背景色
emptyView.actionBtnBackGroundColor = KWhiteColor;
emptyView.actionBtnWidth = CGFLOAT_MIN;
emptyView.actionBtnHeight = CGFLOAT_MIN;
//设置空内容占位图
self.homeTable.ly_emptyView = emptyView;
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.homeTable.mj_header beginRefreshing];
}
- (void)createData {
// type : 1 图文 2 音视频
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:@(self.pageNo) forKey:@"pageNo"];
[parmDic setObject:@(10) forKey:@"pageSize"];
[parmDic setObject: self.type forKey:@"status"];
[parmDic setObject:@"2" forKey:@"type"];
JKCQAPI * recordApi = [[JKCQAPI alloc] init:self tag:@"RECORD" NeedToken:@""];
[recordApi GetQuestionRecordList:parmDic];
}
- (void)Failed:(NSString*)message tag:(NSString*)tag
{
[self.homeTable.mj_footer endRefreshing];
[self.homeTable.mj_header endRefreshing];
[self hiddenAllMBProgressHUD];
}
- (void)Sucess:(id)response tag:(NSString*)tag
{
[self.homeTable.mj_footer endRefreshing];
[self.homeTable.mj_header endRefreshing];
if ([tag isEqualToString:@"RECORD"]) {
if (self.pageNo == 1) {
[self.dataArray removeAllObjects];
}
NSArray * array = response ;
for (NSDictionary * dic in array) {
RecordIMListDateModel * model = [ RecordIMListDateModel modelWithDictionary:dic];
[self.dataArray addObject:model];
}
self.homeTable.dataArray = self.dataArray;
}
}
- (void)statusChange:(UIButton *)statusBtn {
if (statusBtn.tag == 1000) {
self.type = @"3";
}
if (statusBtn.tag == 1001) {
self.type = @"1";
}
if (statusBtn.tag == 1002) {
self.type = @"5";
}
for (UIButton * titBtn in self.buttonArray) {
if (titBtn == statusBtn) {
titBtn.selected = YES;
titBtn.backgroundColor = UIColorHex(#21BEBD);
}else
{
titBtn.selected = NO;
titBtn.backgroundColor = UIColorHex(#DDDDDD);
}
}
[self.homeTable.mj_header beginRefreshing];
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
@@ -1,16 +0,0 @@
//
// PictureRecordViewController.h
// EscortProject
//
// Created by 仁康信息 on 2023/6/28.
//
#import "HQBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface PictureRecordViewController : HQBaseViewController
@end
NS_ASSUME_NONNULL_END
@@ -1,477 +0,0 @@
//
// PictureRecordViewController.m
// EscortProject
//
// Created by 仁康信息 on 2023/6/28.
//
#import "PictureRecordViewController.h"
#import "QuestionRecoredTable.h"
#import "QuestionRecordModel.h"
#import "RecordIMListDateModel.h"
#import "DoctorMainViewController.h"
@interface PictureRecordViewController ()
@property (nonatomic, strong) QuestionRecoredTable * homeTable;
@property (nonatomic, strong) NSMutableArray * buttonArray;
@property (nonatomic, strong) NSMutableArray * redCountArray;
@property (nonatomic, assign) NSInteger pageNo;
@property (nonatomic, copy) NSString * type;
@property (nonatomic, strong) NSMutableArray * dataArray;
@property (nonatomic, strong) NSMutableArray * groupIDArray;
@property (nonatomic, strong) NSMutableArray * jingxingArray;
@property (nonatomic, assign) NSInteger totalCount;
@end
@implementation PictureRecordViewController
- (NSMutableArray *)groupIDArray {
if (!_groupIDArray) {
_groupIDArray = [[NSMutableArray alloc] init];
}
return _groupIDArray;
}
- (NSMutableArray *)redCountArray {
if (!_redCountArray) {
_redCountArray = [[NSMutableArray alloc] init];
}
return _redCountArray;
}
- (NSMutableArray *)jingxingArray {
if (!_jingxingArray) {
_jingxingArray = [[NSMutableArray alloc] init];
}
return _jingxingArray;
}
- (NSMutableArray *)dataArray {
if (!_dataArray) {
_dataArray = [[NSMutableArray alloc] init];
}
return _dataArray;
}
- (NSMutableArray *)buttonArray {
if (!_buttonArray) {
_buttonArray = [[NSMutableArray alloc] init];
}
return _buttonArray;
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.isHidenNaviBar = false;
self.pageNo = 0;
self.type = @"3";
[self createUI];
if ([ESCTUIManager TUIUserStatus] == false) {
[self loginImAccount];
}
if ([self.type integerValue] == 3)
{
[self getChatList];
}
else
{
[self createData];
}
}
- (void)createUI {
NSArray * array = @[@"进行中",@"已完成"];
[self.buttonArray removeAllObjects];
CGFloat w = kRealValue(80);
for (int index = 0; index < array.count; index ++) {
UIButton * listBtn = [[UIButton alloc] init];
listBtn.frame = CGRectMake(kRealValue(15) + (w + kRealValue(13)) * index , kRealValue(15), w, 27);
[listBtn setTitle:array[index] forState:UIControlStateNormal];
[listBtn setTitleColor:KWhiteColor forState:UIControlStateSelected];
[listBtn setTitleColor:CFontColor1 forState:UIControlStateNormal];
[listBtn addTarget:self action:@selector(statusChange:) forControlEvents:UIControlEventTouchUpInside];
listBtn.titleLabel.font = SYSTEMFONT(13);
listBtn.layer.cornerRadius = 14.0;
listBtn.layer.masksToBounds = true;
listBtn.tag = 1000 + index;
[self.view addSubview:listBtn];
if (index == 0 ) {
listBtn.selected = YES;
listBtn.backgroundColor = UIColorHex(#21BEBD);
}else{
listBtn.width = kRealValue(90);
listBtn.backgroundColor = UIColorHex(#DDDDDD);
}
[self.buttonArray addObject:listBtn];
}
self.homeTable = [[QuestionRecoredTable alloc] initWithFrame:CGRectMake(0, 50, kScreenWidth, kScreenHeight - kTopHeight - kRealValue(110) ) style:UITableViewStyleGrouped];
self.homeTable.detailBlock = ^(NSString * _Nonnull recordID, NSString * _Nonnull imID, NSString * _Nonnull memberId, RecordIMListDateModel * _Nonnull model) {
DoctorMainViewController * doctorVC = [[DoctorMainViewController alloc] init];
doctorVC.yuyue_id = imID;
doctorVC.popType = 1;
[self.navigationController pushViewController:doctorVC animated:YES];
};
[self.view addSubview:self.homeTable];
__weak __typeof(self) weakSelf = self;
self.homeTable.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
weakSelf.pageNo = 1;
[weakSelf createData];
}];
self.homeTable.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
weakSelf.pageNo ++;
[weakSelf createData];
}];
self.homeTable = [[QuestionRecoredTable alloc] initWithFrame:CGRectMake(0, 50, kScreenWidth, kScreenHeight - kTopHeight - kRealValue(110)) style:UITableViewStyleGrouped];
self.homeTable.detailBlock = ^(NSString * _Nonnull recordID, NSString * _Nonnull imID, NSString * _Nonnull memberId, RecordIMListDateModel * _Nonnull model) {
// DoctorMainViewController * doctorVC = [[DoctorMainViewController alloc] init];
// doctorVC.yuyue_id = recordID;
// [self.navigationController pushViewController:doctorVC animated:YES];
if ([TUILogin isUserLogined]) {
ChatViewController * chatVC = [[ChatViewController alloc] init];
chatVC.isGroupID = YES;
chatVC.chatID = imID ;
chatVC.eableSendReport = true;
chatVC.eablehaveHelathData = false;
chatVC.navTitle = @"图文咨询";
chatVC.isVideo = NO;
chatVC.pictureEnd_id = model.Record_id;
chatVC.questionType = 2;
chatVC.medicalRecordsId = memberId;
if ([model.contentStatus intValue] == 5) {
chatVC.isEveal = true;
}else
{
chatVC.isEveal = false;
}
if ([model.contentStatus intValue] >=4 ) {
chatVC.endRecordType = 100;
}
[self.navigationController pushViewController:chatVC animated:YES];
}else
{
[self loginImAccount];
}
};
[self.view addSubview:self.homeTable];
self.homeTable.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
weakSelf.pageNo = 0;
if ([ESCTUIManager TUIUserStatus] == false) {
[self loginImAccount];
}
if ([self.type integerValue] == 3)
{
[self getChatList];
}
else
{
[weakSelf createData];
}
}];
self.homeTable.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
weakSelf.pageNo ++;
if ([ESCTUIManager TUIUserStatus] == false) {
[self loginImAccount];
}
if ([self.type integerValue] == 3)
{
[self getChatList];
}
else
{
[weakSelf createData];
}
}];
}
//获取腾讯im会话列表
- (void)getChatList {
V2TIMConversationListFilter *filter = [[V2TIMConversationListFilter alloc] init];
// filter.type = V2TIM_C2C; //拉取单聊会话
filter.type = V2TIM_GROUP; //拉取群聊会话
[[V2TIMManager sharedInstance] getConversationListByFilter:filter nextSeq:self.pageNo count:50 succ:^(NSArray<V2TIMConversation *> *list, uint64_t nextSeq, BOOL isFinished) {
// 获取会话列表成功,list 为会话列表
if (self.pageNo == 0) {
[self.groupIDArray removeAllObjects];
}
DLog(@"%@",list);
[self.redCountArray addObjectsFromArray:list];
for (V2TIMConversation * v2Model in list) {
[self.groupIDArray addObject: v2Model.groupID];
}
[self postGroupArray:self.groupIDArray];
} fail:^(int code, NSString *desc) {
// 获取会话列表失败
}];
// //获取所以会话的未读总数
// // filter.type = V2TIM_GROUP; //拉取群聊会话
//
// [[V2TIMManager sharedInstance] getUnreadMessageCountByFilter:filter succ:^(UInt64 totalUnreadCount) {
// self.totalCount = totalUnreadCount;
// } fail:^(int code, NSString *desc) {
//
// }];
}
#pragma mark:上传id数组
- (void)postGroupArray:(NSArray *)array {
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:array forKey:@"imIds"];
[self showMBProgressHUDWithString:@"加载中,请稍候..." autoHidden:false];
JKCQAPI * recordApi = [[JKCQAPI alloc] init:self tag:@"GROUPID" NeedToken:@""];
[recordApi PostGroupIDArray:parmDic];
}
- (void)createData {
// type : 1 图文 2 音视频
[self showMBProgressHUDWithString:@"加载中,请稍候..." autoHidden:false];
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:@(self.pageNo) forKey:@"pageNo"];
[parmDic setObject:@(10) forKey:@"pageSize"];
[parmDic setObject:self.type forKey:@"status"];
[parmDic setObject:@"1" forKey:@"type"];
//status 1 3 4 5 //4 代评价
JKCQAPI * recordApi = [[JKCQAPI alloc] init:self tag:@"RECORD" NeedToken:@""];
[recordApi GetQuestionRecordList:parmDic];
//getMineQuestionRecord
}
- (void)loginImAccount {
JKCQAPI * proctocolApi = [[JKCQAPI alloc] init:self tag:@"IMAPI" NeedToken:nil];
[proctocolApi GetIMLoginAccount:nil];
}
- (void)Failed:(NSString*)message tag:(NSString*)tag
{
[self.homeTable.mj_footer endRefreshing];
[self.homeTable.mj_header endRefreshing];
[self hiddenAllMBProgressHUD];
}
- (void)Sucess:(id)response tag:(NSString*)tag
{
[self.homeTable.mj_footer endRefreshing];
[self.homeTable.mj_header endRefreshing];
[self hiddenAllMBProgressHUD];
if ([tag isEqualToString:@"RECORD"]) {
if (self.pageNo == 0) {
[self.dataArray removeAllObjects];
}
NSArray * array = response ;
for (NSDictionary * dic in array) {
RecordIMListDateModel * model = [ RecordIMListDateModel modelWithDictionary:dic];
[self.dataArray addObject:model];
}
self.homeTable.dataArray = self.dataArray;
}
if ([tag isEqualToString:@"IMAPI"]) {
[self hiddenAllMBProgressHUD];
NSDictionary * pamrDic = response;
IMUserInfoModel * model = [IMUserInfoModel modelWithDictionary:pamrDic];
IMUserInfoModel * iminfoModel = [[IMUserInfoModel alloc] init];
iminfoModel.IMInfo = pamrDic;
[HQCommonUtils keyedArchiverWithData:iminfoModel key:IMLoginUserInfo];
// 1. 从即时通信 IM 控制台获取应用 SDKAppID。
// 2. 初始化 config 对象
V2TIMSDKConfig *config = [[V2TIMSDKConfig alloc] init];
// 3. 指定 log 输出级别。
config.logLevel = V2TIM_LOG_INFO;
// 4. 添加 V2TIMSDKListener 的事件监听器,self 是 id<V2TIMSDKListener> 的实现类,如果您不需要监听 IM SDK 的事件,这个步骤可以忽略。
[[V2TIMManager sharedInstance] addIMSDKListener:self];
// 5. 初始化 IM SDK,调用这个接口后,可以立即调用登录接口。
[[V2TIMManager sharedInstance] initSDK:[model.sdkAppId intValue] config:config];
// 1. 从即时通信 IM 控制台获取应用 SDKAppID。
// 2. 初始化 config 对象
// 3. 指定 log 输出级别。
config.logLevel = V2TIM_LOG_INFO;
// 4. 添加 V2TIMSDKListener 的事件监听器,self 是 id<V2TIMSDKListener> 的实现类,如果您不需要监听 IM SDK 的事件,这个步骤可以忽略。
// 5. 初始化 IM SDK,调用这个接口后,可以立即调用登录接口。
[TUILogin login:[model.sdkAppId intValue] userID:model.userId userSig:model.userSig succ:^{
[self getChatList];
} fail:^(int code, NSString *msg) {
[EasyTextView showErrorText:msg];
}];
}
if ([tag isEqualToString:@"GROUPID"]) {
[self hiddenAllMBProgressHUD];
NSArray * array = response;
[self.jingxingArray removeAllObjects];
for (NSDictionary * parmDic in array) {
RecordIMListDateModel * model = [ RecordIMListDateModel modelWithDictionary:parmDic];
for (V2TIMConversation * v2Model in self.redCountArray) {
if ([v2Model.groupID isEqualToString:model.imId])
{
model.unredCount = v2Model.unreadCount;
}
}
[self.jingxingArray addObject:model];
}
self.homeTable.dataArray = self.jingxingArray;
// self.homeTable.totalCount
}
}
- (void)statusChange:(UIButton *)statusBtn {
[self.dataArray removeAllObjects];
if (statusBtn.tag == 1000) {
self.type = @"3"; //进行中
[self getChatList];
}
if (statusBtn.tag == 1001) {
self.type = @"5"; //已评价
[self createData];
}
if (statusBtn.tag == 1002) {
self.type = @""; //全部 历史
[self createData];
}
for (UIButton * titBtn in self.buttonArray) {
if (titBtn == statusBtn) {
titBtn.selected = YES;
titBtn.backgroundColor = UIColorHex(#21BEBD);
}else
{
titBtn.selected = NO;
titBtn.backgroundColor = UIColorHex(#DDDDDD);
}
}
}
//在线时票据过期:此时您需要生成新的 userSig,并再次重新调用初始化。
- (void)onKickedOffline {
[HQCommonUtils keyedArchiverWithData:nil key:LoginUserInfo];
[ESCTUIManager outLoginTUISDK];
KPostNotification(KNotificationLoginStateChange, @NO);
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
@@ -1,16 +0,0 @@
//
// QuestionCompleteViewController.h
// EscortProject
//
// Created by 仁康信息 on 2023/6/28.
//
#import "HQBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface QuestionCompleteViewController : HQBaseViewController
@end
NS_ASSUME_NONNULL_END
@@ -1,196 +0,0 @@
//
// QuestionCompleteViewController.m
// EscortProject
//
// Created by 仁康信息 on 2023/6/28.
//
#import "QuestionCompleteViewController.h"
#import "QuestionRecoredTable.h"
#import "QuestionRecordModel.h"
@interface QuestionCompleteViewController ()
@property (nonatomic, strong) QuestionRecoredTable * homeTable;
@property (nonatomic, strong) NSMutableArray * buttonArray;
@property (nonatomic, strong) NSMutableArray * dataArray;
@property (nonatomic, assign) NSInteger pageNo;
@property (nonatomic, copy) NSString * type;
@end
@implementation QuestionCompleteViewController
- (NSMutableArray *)dataArray {
if (!_dataArray) {
_dataArray = [[NSMutableArray alloc] init];
}
return _dataArray;
}
- (NSMutableArray *)buttonArray {
if (!_buttonArray) {
_buttonArray = [[NSMutableArray alloc] init];
}
return _buttonArray;
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.isHidenNaviBar = false;
self.pageNo = 1;
self.type = @"1";
[self createUI];
[self createData];
}
- (void)createUI {
NSArray * array = @[@"图文咨询",@"视频咨询"];
[self.buttonArray removeAllObjects];
CGFloat w = kRealValue(80);
for (int index = 0; index < array.count; index ++) {
UIButton * listBtn = [[UIButton alloc] init];
listBtn.frame = CGRectMake(kRealValue(15) + (w + kRealValue(13)) * index , kRealValue(15), w, 27);
[listBtn setTitle:array[index] forState:UIControlStateNormal];
[listBtn setTitleColor:KWhiteColor forState:UIControlStateSelected];
[listBtn setTitleColor:CFontColor1 forState:UIControlStateNormal];
[listBtn addTarget:self action:@selector(statusChange:) forControlEvents:UIControlEventTouchUpInside];
listBtn.titleLabel.font = SYSTEMFONT(13);
listBtn.layer.cornerRadius = 14.0;
listBtn.layer.masksToBounds = true;
listBtn.tag = 1000 + index;
[self.view addSubview:listBtn];
if (index == 0 ) {
listBtn.selected = YES;
listBtn.backgroundColor = UIColorHex(#21BEBD);
}else{
listBtn.width = kRealValue(90);
listBtn.backgroundColor = UIColorHex(#DDDDDD);
}
[self.buttonArray addObject:listBtn];
}
self.homeTable = [[QuestionRecoredTable alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
[self.view addSubview:self.homeTable];
[self.homeTable mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(@50);
make.bottom.left.right.mas_offset(0);
}];
__weak __typeof(self) weakSelf = self;
self.homeTable.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
weakSelf.pageNo = 1;
[weakSelf createData];
}];
self.homeTable.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
weakSelf.pageNo ++;
[weakSelf createData];
}];
}
- (void)createData {
// type : 1 图文 2 音视频
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:@(self.pageNo) forKey:@"pageNo"];
[parmDic setObject:@(10) forKey:@"pageSize"];
[parmDic setObject:@"5" forKey:@"status"];
[parmDic setObject:self.type forKey:@"type"];
JKCQAPI * recordApi = [[JKCQAPI alloc] init:self tag:@"RECORD" NeedToken:@""];
[recordApi GetQuestionRecordList:parmDic];
}
- (void)Failed:(NSString*)message tag:(NSString*)tag
{
[self.homeTable.mj_footer endRefreshing];
[self.homeTable.mj_header endRefreshing];
[self hiddenAllMBProgressHUD];
}
- (void)Sucess:(id)response tag:(NSString*)tag
{
[self.homeTable.mj_footer endRefreshing];
[self.homeTable.mj_header endRefreshing];
if ([tag isEqualToString:@"RECORD"]) {
if (self.pageNo == 1) {
[self.dataArray removeAllObjects];
}
NSArray * array = response ;
for (NSDictionary * dic in array) {
QuestionRecordModel * model = [QuestionRecordModel modelWithDictionary:dic];
[self.dataArray addObject:model];
}
self.homeTable.dataArray = self.dataArray;
}
}
- (void)statusChange:(UIButton *)statusBtn {
if (statusBtn.tag == 1000) {
self.type = @"1";
}
if (statusBtn.tag == 1001) {
self.type = @"2";
}
for (UIButton * titBtn in self.buttonArray) {
if (titBtn == statusBtn) {
titBtn.selected = YES;
titBtn.backgroundColor = UIColorHex(#21BEBD);
}else
{
titBtn.selected = NO;
titBtn.backgroundColor = UIColorHex(#DDDDDD);
}
}
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
@@ -1,16 +0,0 @@
//
// QuestionJingxingViewController.h
// EscortProject
//
// Created by 仁康信息 on 2023/6/28.
//
#import "HQBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface QuestionJingxingViewController : HQBaseViewController
@end
NS_ASSUME_NONNULL_END
@@ -1,196 +0,0 @@
//
// QuestionJingxingViewController.m
// EscortProject
//
// Created by 仁康信息 on 2023/6/28.
//
#import "QuestionJingxingViewController.h"
#import "QuestionRecoredTable.h"
#import "QuestionRecordModel.h"
@interface QuestionJingxingViewController ()
@property (nonatomic, strong) QuestionRecoredTable * homeTable;
@property (nonatomic, strong) NSMutableArray * buttonArray;
@property (nonatomic, strong) NSMutableArray * dataArray;
@property (nonatomic, assign) NSInteger pageNo;
@property (nonatomic, copy) NSString * type;
@end
@implementation QuestionJingxingViewController
- (NSMutableArray *)dataArray {
if (!_dataArray) {
_dataArray = [[NSMutableArray alloc] init];
}
return _dataArray;
}
- (NSMutableArray *)buttonArray {
if (!_buttonArray) {
_buttonArray = [[NSMutableArray alloc] init];
}
return _buttonArray;
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.isHidenNaviBar = false;
self.pageNo = 1;
self.type = @"1";
[self createUI];
[self createData];
}
- (void)createUI {
NSArray * array = @[@"图文咨询",@"视频咨询"];
[self.buttonArray removeAllObjects];
CGFloat w = kRealValue(80);
for (int index = 0; index < array.count; index ++) {
UIButton * listBtn = [[UIButton alloc] init];
listBtn.frame = CGRectMake(kRealValue(15) + (w + kRealValue(13)) * index , kRealValue(15), w, 27);
[listBtn setTitle:array[index] forState:UIControlStateNormal];
[listBtn setTitleColor:KWhiteColor forState:UIControlStateSelected];
[listBtn setTitleColor:CFontColor1 forState:UIControlStateNormal];
[listBtn addTarget:self action:@selector(statusChange:) forControlEvents:UIControlEventTouchUpInside];
listBtn.titleLabel.font = SYSTEMFONT(13);
listBtn.layer.cornerRadius = 14.0;
listBtn.layer.masksToBounds = true;
listBtn.tag = 1000 + index;
[self.view addSubview:listBtn];
if (index == 0 ) {
listBtn.selected = YES;
listBtn.backgroundColor = UIColorHex(#21BEBD);
}else{
listBtn.width = kRealValue(90);
listBtn.backgroundColor = UIColorHex(#DDDDDD);
}
[self.buttonArray addObject:listBtn];
}
self.homeTable = [[QuestionRecoredTable alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
[self.view addSubview:self.homeTable];
[self.homeTable mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(@50);
make.bottom.left.right.mas_offset(0);
}];
__weak __typeof(self) weakSelf = self;
self.homeTable.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
weakSelf.pageNo = 1;
[weakSelf createData];
}];
self.homeTable.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
weakSelf.pageNo ++;
[weakSelf createData];
}];
}
- (void)createData {
// type : 1 图文 2 音视频
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:@(self.pageNo) forKey:@"pageNo"];
[parmDic setObject:@(10) forKey:@"pageSize"];
[parmDic setObject:@"3" forKey:@"status"];
[parmDic setObject:self.type forKey:@"type"];
JKCQAPI * recordApi = [[JKCQAPI alloc] init:self tag:@"RECORD" NeedToken:@""];
[recordApi GetQuestionRecordList:parmDic];
}
- (void)Failed:(NSString*)message tag:(NSString*)tag
{
[self.homeTable.mj_footer endRefreshing];
[self.homeTable.mj_header endRefreshing];
[self hiddenAllMBProgressHUD];
}
- (void)Sucess:(id)response tag:(NSString*)tag
{
[self.homeTable.mj_footer endRefreshing];
[self.homeTable.mj_header endRefreshing];
if ([tag isEqualToString:@"RECORD"]) {
if (self.pageNo == 1) {
[self.dataArray removeAllObjects];
}
NSArray * array = response ;
for (NSDictionary * dic in array) {
QuestionRecordModel * model = [QuestionRecordModel modelWithDictionary:dic];
[self.dataArray addObject:model];
}
self.homeTable.dataArray = self.dataArray;
}
}
- (void)statusChange:(UIButton *)statusBtn {
if (statusBtn.tag == 1000) {
self.type = @"1";
}
if (statusBtn.tag == 1001) {
self.type = @"2";
}
for (UIButton * titBtn in self.buttonArray) {
if (titBtn == statusBtn) {
titBtn.selected = YES;
titBtn.backgroundColor = UIColorHex(#21BEBD);
}else
{
titBtn.selected = NO;
titBtn.backgroundColor = UIColorHex(#DDDDDD);
}
}
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
@@ -1,272 +0,0 @@
//
// QustionRecordViewController.m
// EscortProject
//
// Created by 仁康信息 on 2023/6/28.
//
#import "QustionRecordViewController.h"
#import "AudioVideoRecordViewController.h"
#import "PictureRecordViewController.h"
#import "QuestionCompleteViewController.h"
#import "QustionWaitEvlaViewController.h"
#import "QuestionJingxingViewController.h"
#import "QustionWaitEvlaViewController.h"
@interface QustionRecordViewController ()<UICollectionViewDataSource,UICollectionViewDelegate>
/** 顶部控件*/
@property (nonatomic, weak) UIScrollView *topView;
/** 下划线 */
@property (nonatomic, weak) UIView *lineView;
/** 滚动视图 */
@property (nonatomic, weak) UICollectionView *collectionView;
/** 当前选中的按钮 */
@property (nonatomic, weak) UIButton *selectButton;
/** 按钮数组 */
@property (nonatomic, strong) NSMutableArray *titleButtons;
@end
@implementation QustionRecordViewController
#pragma mark - 懒加载
- (NSMutableArray *)titleButtons {
if (_titleButtons==nil) {
_titleButtons = [NSMutableArray array];
}
return _titleButtons;
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.isHidenNaviBar = NO;
self.navigationItem.title = @"我的咨询";
self.view.backgroundColor = UIColorBackground;
// [self addNavigationItemWithImageNames:@[@"backIcon@2x"] isLeft:YES target:self action:@selector(popVc) tags:@[@"100"]];
[self createUI];
}
#pragma mark:返回
- (void)popVc
{
[self.navigationController popViewControllerAnimated:YES];
}
- (void)createUI
{
[self setupNavgationBar];
// 添加底部内容view
[self setupBottomContentView];
// 添加所有子控制器
[self setupAllChildViewController];
[self setupAllTitle];
// 不添加额外滚动区域
self.automaticallyAdjustsScrollViewInsets = NO;
}
#pragma mark - 添加所有的子控制器
- (void)setupAllChildViewController {
PictureRecordViewController * pictureVc = [[PictureRecordViewController alloc] init];
pictureVc.view.backgroundColor = UIColorBackground;
pictureVc.navigationItem.title = @"图文咨询";
[self addChildViewController:pictureVc];
//
AudioVideoRecordViewController * videoVc = [[AudioVideoRecordViewController alloc] init];
videoVc.view.backgroundColor = UIColorBackground;
videoVc.navigationItem.title = @"视频咨询";
[self addChildViewController:videoVc];
//
// QuestionJingxingViewController * jingxingVc = [[QuestionJingxingViewController alloc] init];
// jingxingVc.view.backgroundColor = UIColorBackground;
// jingxingVc.navigationItem.title = @"进行中";
// [self addChildViewController:jingxingVc];
// //
// QustionWaitEvlaViewController * evlVc = [[QustionWaitEvlaViewController alloc] init];
// evlVc.view.backgroundColor = UIColorBackground;
// evlVc.navigationItem.title = @"待评价";
// [self addChildViewController:evlVc];
// //
// QuestionCompleteViewController * completeVc = [[QuestionCompleteViewController alloc] init];
// completeVc.view.backgroundColor = UIColorBackground;
// completeVc.navigationItem.title = @"已完成";
// [self addChildViewController:completeVc];
}
#pragma mark - 设置导航条内容
- (void)setupNavgationBar {
UIScrollView *topView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 1, kScreenWidth, kRealValue(48))];
topView.backgroundColor = [UIColor whiteColor];
_topView = topView;
[self.view addSubview:topView];
}
#pragma mark - 按钮被点击
- (void)titleClick:(UIButton *)titleButton{
NSInteger i = titleButton.tag;
// 重复点击标题按钮的时候,刷新当前界面
if (titleButton == _selectButton) {
}
[self selButton:titleButton];
//滚动collectionView 修改偏移量
CGFloat offsetX = i * kScreenWidth;
_collectionView.contentOffset = CGPointMake(offsetX, 0);
}
#pragma mark - 选中标题按钮
- (void)selButton:(UIButton *)titleButton{
_selectButton.selected = NO;
titleButton.selected = YES;
_selectButton = titleButton;
// 移动下划线的位置
[UIView animateWithDuration:0.25 animations:^{
_lineView.centerX = titleButton.centerX;
}];
}
#pragma mark - 添加标题
- (void)setupAllTitle{
NSUInteger count = self.childViewControllers.count;
CGFloat btnX = 0;
CGFloat btnW = kScreenWidth/count;
CGFloat btnH = _topView.height;
for (int i = 0; i < count; i++) {
UIButton *titleButton = [UIButton buttonWithType:UIButtonTypeCustom];
titleButton.tag = i;
UIViewController *vc = self.childViewControllers[i];
[titleButton setTitle:vc.navigationItem.title forState:UIControlStateNormal];
// 设置标题颜色
[titleButton setTitleColor:RGBA(34, 34, 34, 1) forState:UIControlStateSelected];
[titleButton setTitleColor:RGBA(102, 102, 102, 1) forState:UIControlStateNormal];
// 设置标题字体
titleButton.titleLabel.font = MEDIUMFONT(14);
btnX = i * btnW;
titleButton.frame = CGRectMake(btnX, 0, btnW, btnH);
// 监听按钮点击
[titleButton addTarget:self action:@selector(titleClick:) forControlEvents:UIControlEventTouchUpInside];
[_topView addSubview:titleButton];
if (i == 0) {
// 添加下划线
// 下划线宽度 = 按钮文字宽度
// 下划线中心点x = 按钮中心点x
CGFloat h = 5;
CGFloat y = kRealValue(45) ;
UIView *lineView =[[UIView alloc] init];
// 位置和尺寸
lineView.height = h;
// 先计算文字尺寸,在给label去赋值
[titleButton.titleLabel sizeToFit];
lineView.width = kRealValue(28);
lineView.centerX = titleButton.centerX;
lineView.mj_y = y;
lineView.backgroundColor = UIColorHex(#21BEBD);
_lineView = lineView;
[_topView addSubview:lineView];
[self titleClick:titleButton];
}
[self.titleButtons addObject:titleButton];
}
}
#pragma mark - 添加底部内容view
- (void)setupBottomContentView
{
// 创建一个流水布局
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.itemSize = CGSizeMake(kScreenWidth, kScreenHeight-44);
// 设置水平滚动方向
layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
layout.minimumInteritemSpacing = 0;
layout.minimumLineSpacing = 0;
// 创建UICollectionView
UICollectionView *collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0,kRealValue(48), kScreenWidth, kScreenHeight - kRealValue(48) ) collectionViewLayout:layout];
collectionView.backgroundColor = [UIColor whiteColor];
[self.view addSubview:collectionView];
_collectionView = collectionView;
collectionView.scrollsToTop = NO;
collectionView.scrollEnabled = YES;
// 开启分页
collectionView.pagingEnabled = YES;
collectionView.showsHorizontalScrollIndicator = NO;
collectionView.bounces = YES;
// 展示cell
collectionView.dataSource = self;
collectionView.delegate = self;
// 注册cell
[collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"COUPCELLID"];
}
#pragma mark - UICollectionViewDelegate
// 滚动完成的时候就会调用
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView{
// 获取角标
NSInteger i = scrollView.contentOffset.x / kScreenWidth;
// 获取选中标题
UIButton *selButton = self.titleButtons[i];
// 选中标题
[self selButton:selButton];
}
#pragma mark - UICollectionViewDataSource
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
return self.childViewControllers.count;
}
// 只要有新的cell出现的时候才会调用
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"COUPCELLID" forIndexPath:indexPath];
// 移除之前子控制器view
[cell.contentView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
// 取出对应的子控制器添加到对应cell上
UIViewController *vc = self.childViewControllers[indexPath.row];
[cell.contentView addSubview:vc.view];
return cell;
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
@@ -1,196 +0,0 @@
//
// QustionWaitEvlaViewController.m
// EscortProject
//
// Created by 仁康信息 on 2023/6/28.
//
#import "QustionWaitEvlaViewController.h"
#import "QuestionRecoredTable.h"
#import "QuestionRecordModel.h"
@interface QustionWaitEvlaViewController ()
@property (nonatomic, strong) QuestionRecoredTable * homeTable;
@property (nonatomic, strong) NSMutableArray * buttonArray;
@property (nonatomic, strong) NSMutableArray * dataArray;
@property (nonatomic, assign) NSInteger pageNo;
@property (nonatomic, copy) NSString * type;
@end
@implementation QustionWaitEvlaViewController
- (NSMutableArray *)dataArray {
if (!_dataArray) {
_dataArray = [[NSMutableArray alloc] init];
}
return _dataArray;
}
- (NSMutableArray *)buttonArray {
if (!_buttonArray) {
_buttonArray = [[NSMutableArray alloc] init];
}
return _buttonArray;
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.isHidenNaviBar = false;
self.pageNo = 1;
self.type = @"1";
[self createUI];
[self createData];
}
- (void)createUI {
NSArray * array = @[@"图文咨询",@"视频咨询"];
[self.buttonArray removeAllObjects];
CGFloat w = kRealValue(80);
for (int index = 0; index < array.count; index ++) {
UIButton * listBtn = [[UIButton alloc] init];
listBtn.frame = CGRectMake(kRealValue(15) + (w + kRealValue(13)) * index , kRealValue(15), w, 27);
[listBtn setTitle:array[index] forState:UIControlStateNormal];
[listBtn setTitleColor:KWhiteColor forState:UIControlStateSelected];
[listBtn setTitleColor:CFontColor1 forState:UIControlStateNormal];
[listBtn addTarget:self action:@selector(statusChange:) forControlEvents:UIControlEventTouchUpInside];
listBtn.titleLabel.font = SYSTEMFONT(13);
listBtn.layer.cornerRadius = 14.0;
listBtn.layer.masksToBounds = true;
listBtn.tag = 1000 + index;
[self.view addSubview:listBtn];
if (index == 0 ) {
listBtn.selected = YES;
listBtn.backgroundColor = UIColorHex(#21BEBD);
}else{
listBtn.width = kRealValue(90);
listBtn.backgroundColor = UIColorHex(#DDDDDD);
}
[self.buttonArray addObject:listBtn];
}
self.homeTable = [[QuestionRecoredTable alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
[self.view addSubview:self.homeTable];
[self.homeTable mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(@50);
make.bottom.left.right.mas_offset(0);
}];
__weak __typeof(self) weakSelf = self;
self.homeTable.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
weakSelf.pageNo = 1;
[weakSelf createData];
}];
self.homeTable.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
weakSelf.pageNo ++;
[weakSelf createData];
}];
}
- (void)createData {
// type : 1 图文 2 音视频
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:@(self.pageNo) forKey:@"pageNo"];
[parmDic setObject:@(10) forKey:@"pageSize"];
[parmDic setObject:@"4" forKey:@"status"];
[parmDic setObject:self.type forKey:@"type"];
JKCQAPI * recordApi = [[JKCQAPI alloc] init:self tag:@"RECORD" NeedToken:@""];
[recordApi GetQuestionRecordList:parmDic];
}
- (void)Failed:(NSString*)message tag:(NSString*)tag
{
[self.homeTable.mj_footer endRefreshing];
[self.homeTable.mj_header endRefreshing];
[self hiddenAllMBProgressHUD];
}
- (void)Sucess:(id)response tag:(NSString*)tag
{
[self.homeTable.mj_footer endRefreshing];
[self.homeTable.mj_header endRefreshing];
if ([tag isEqualToString:@"RECORD"]) {
if (self.pageNo == 1) {
[self.dataArray removeAllObjects];
}
NSArray * array = response ;
for (NSDictionary * dic in array) {
QuestionRecordModel * model = [QuestionRecordModel modelWithDictionary:dic];
[self.dataArray addObject:model];
}
self.homeTable.dataArray = self.dataArray;
}
}
- (void)statusChange:(UIButton *)statusBtn {
if (statusBtn.tag == 1000) {
self.type = @"1";
}
if (statusBtn.tag == 1001) {
self.type = @"2";
}
for (UIButton * titBtn in self.buttonArray) {
if (titBtn == statusBtn) {
titBtn.selected = YES;
titBtn.backgroundColor = UIColorHex(#21BEBD);
}else
{
titBtn.selected = NO;
titBtn.backgroundColor = UIColorHex(#DDDDDD);
}
}
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
@@ -1,16 +0,0 @@
//
// SosCenterViewController.h
// EscortProject
//
// Created by 仁康信息 on 2023/4/13.
//
#import "HQBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface SosCenterViewController : HQBaseViewController
@end
NS_ASSUME_NONNULL_END
@@ -1,996 +0,0 @@
//
// SosCenterViewController.m
// EscortProject
//
// Created by 仁康信息 on 2023/4/13.
//
#import "SosCenterViewController.h"
#import "POIAnnotation.h"
#import "CustomAnnotationView.h"
#import "XMButton.h"
#import <WebKit/WebKit.h>
#import "LXSegmentTitleView.h"
#import "SOSCenterModel.h"
#import <AMapFoundationKit/AMapFoundationKit.h>
#import <AMapSearchKit/AMapSearchKit.h>
#import <AMapLocationKit/AMapLocationKit.h>
#import "SOSAddressView.h"
#import "SOSGroupIMModel.h"
#import "TYMapNavSheet.h"
#import "HealthInterveneHomeModel.h"
#import "AEDNetWrokModel.h"
@interface SosCenterViewController ()<MAMapViewDelegate, LXSegmentTitleViewDelegate, LXSegmentTitleViewDataSource,AMapLocationManagerDelegate,SoSBottomProtocol,UIActionSheetDelegate>
{
TYMapNavSheet * TYNavSheet;
}
@property (nonatomic, strong) MAMapView * mapView ;
@property (nonatomic, strong) UIView * grapView ;
@property (nonatomic, strong) AMapSearchAPI *search;
@property (nonatomic, strong) AMapLocationManager *locationManager;
@property (nonatomic, copy) AMapLocatingCompletionBlock completionBlock;
@property (nonatomic, strong) LXSegmentTitleView *titleView;
@property(strong, nonatomic) NSArray *titles;
@property(strong, nonatomic) NSMutableArray * titlesArray;
@property(strong, nonatomic) NSMutableArray * ponisArray;
@property (strong, nonatomic) SOSCenterModel * model;
//经纬度
@property (assign, nonatomic) CGFloat Longitude;
@property (assign, nonatomic) CGFloat latitude;
@property (copy, nonatomic) NSString * type;
//
@property (nonatomic, strong) SOSAddressView * addressView;
@property (nonatomic, strong) SOSResourcesModel * resourceModel;
@property (assign, nonatomic) NSInteger selecetIndex;
@property (strong, nonatomic) NSMutableArray * hospitalArray;
@property (strong, nonatomic) NSMutableArray * AedArray;
@property (strong, nonatomic) NSMutableArray * carArray;
@end
@implementation SosCenterViewController
- (NSMutableArray *)carArray {
if (!_carArray) {
_carArray = [[NSMutableArray alloc] init];
}
return _carArray;
}
- (NSMutableArray *)hospitalArray {
if (!_hospitalArray) {
_hospitalArray = [[NSMutableArray alloc] init];
}
return _hospitalArray;
}
- (NSMutableArray *)AedArray {
if (!_AedArray) {
_AedArray = [[NSMutableArray alloc] init];
}
return _AedArray;
}
- (NSMutableArray *)titlesArray {
if (!_titlesArray) {
_titlesArray = [[NSMutableArray alloc] init];
}
return _titlesArray;
}
- (NSMutableArray *)ponisArray {
if (!_ponisArray) {
_ponisArray = [[NSMutableArray alloc] init];
}
return _ponisArray;
}
- (SOSAddressView *)addressView {
if (!_addressView) {
_addressView = [[SOSAddressView alloc] initWithFrame:CGRectMake(kRealValue(15), kScreenHeight - kTopHeight - kRealValue(130), kScreenWidth - kRealValue(30), kRealValue(110))];
_addressView.addressDelegate = self;
_addressView.backgroundColor = KWhiteColor;
}
return _addressView;
}
- (void)showBottomBtn {
self.grapView.hidden = false;
}
- (void)configLocationManager
{
self.locationManager = [[AMapLocationManager alloc] init];
[self.locationManager setDelegate:self];
//设置期望定位精度
[self.locationManager setDesiredAccuracy:kCLLocationAccuracyNearestTenMeters];
//设置不允许系统暂停定位
[self.locationManager setPausesLocationUpdatesAutomatically:NO];
//设置允许在后台定位
[self.locationManager setAllowsBackgroundLocationUpdates:NO];
//设置定位超时时间
[self.locationManager setLocationTimeout:10];
//设置逆地理超时时间
[self.locationManager setReGeocodeTimeout:3];
//设置开启虚拟定位风险监测,可以根据需要开启
[self.locationManager setDetectRiskOfFakeLocation:NO];
}
- (void)cleanUpAction
{
//停止定位
[self.locationManager stopUpdatingLocation];
[self.locationManager setDelegate:nil];
}
- (void)reGeocodeAction
{
[self.mapView removeAnnotations:self.mapView.annotations];
//进行单次带逆地理定位请求
[self.locationManager requestLocationWithReGeocode:YES completionBlock:self.completionBlock];
}
- (void)initCompleteBlock
{
__weak SosCenterViewController *weakSelf = self;
self.completionBlock = ^(CLLocation *location, AMapLocationReGeocode *regeocode, NSError *error)
{
if (error != nil && error.code == AMapLocationErrorLocateFailed)
{
//定位错误:此时location和regeocode没有返回值,不进行annotation的添加
return;
}
else if (error != nil
&& (error.code == AMapLocationErrorReGeocodeFailed
|| error.code == AMapLocationErrorTimeOut
|| error.code == AMapLocationErrorCannotFindHost
|| error.code == AMapLocationErrorBadURL
|| error.code == AMapLocationErrorNotConnectedToInternet
|| error.code == AMapLocationErrorCannotConnectToHost))
{
//逆地理错误:在带逆地理的单次定位中,逆地理过程可能发生错误,此时location有返回值,regeocode无返回值,进行annotation的添加
}
else if (error != nil && error.code == AMapLocationErrorRiskOfFakeLocation)
{
//存在虚拟定位的风险:此时location和regeocode没有返回值,不进行annotation的添加
//存在虚拟定位的风险的定位结果
__unused CLLocation *riskyLocateResult = [error.userInfo objectForKey:@"AMapLocationRiskyLocateResult"];
//存在外接的辅助定位设备
__unused NSDictionary *externalAccressory = [error.userInfo objectForKey:@"AMapLocationAccessoryInfo"];
return;
}
else
{
//没有错误:location有返回值,regeocode是否有返回值取决于是否进行逆地理操作,进行annotation的添加
}
//根据定位信息,添加annotation
MAPointAnnotation *annotation = [[MAPointAnnotation alloc] init];
[annotation setCoordinate:location.coordinate];
//有无逆地理信息,annotationView的标题显示的字段不一样
if (regeocode)
{
[annotation setTitle:[NSString stringWithFormat:@"%@", regeocode.formattedAddress]];
[annotation setSubtitle:[NSString stringWithFormat:@"%@-%@-%.2fm", regeocode.citycode, regeocode.adcode, location.horizontalAccuracy]];
}
else
{
[annotation setTitle:[NSString stringWithFormat:@"lat:%f;lon:%f;", location.coordinate.latitude, location.coordinate.longitude]];
[annotation setSubtitle:[NSString stringWithFormat:@"accuracy:%.2fm", location.horizontalAccuracy]];
}
self.Longitude = location.coordinate.longitude;
self.latitude = location.coordinate.latitude;
[self getResourceDataWithType:@"1" Longitude:self.Longitude withLatitude:self.latitude];
SosCenterViewController *strongSelf = weakSelf;
[strongSelf addAnnotationToMapView:annotation];
};
}
- (void)addAnnotationToMapView:(id<MAAnnotation>)annotation
{
[self.mapView addAnnotation:annotation];
[self.mapView showAnnotations:self.mapView.annotations edgePadding:UIEdgeInsetsMake(100, 100, 100, 100) animated:YES];
[self.mapView setCenterCoordinate:annotation.coordinate animated:YES];
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.isHidenNaviBar = false;
self.type = @"0";
self.selecetIndex = 0;
self.navigationItem.title = @"应急就医";
self.view.backgroundColor = KWhiteColor;
TYNavSheet = [[TYMapNavSheet alloc]init];
[self initMapView];
// [self initCompleteBlock];
// [self configLocationManager];
// [self reGeocodeAction];
self.titleView = [[LXSegmentTitleView alloc] initWithFrame:CGRectMake(0 , 0 , kScreenWidth , kRealValue(35))];
self.titleView.itemMinMargin = 15.f;
self.titleView.delegate = self;
self.titleView.titleNormalColor = CFontColor1;
self.titleView.titleSelectedColor = KWhiteColor;
self.titleView.btnNormalColor = KClearColor;
self.titleView.btnSelectedColor = UIColorHex(#21BEBD);
self.titleView.backgroundColor = KWhiteColor;
self.titleView.indicatorColor = KWhiteColor;
[self.view addSubview:self.titleView];
UIView * grapView = [[UIView alloc] initWithFrame:CGRectMake(0, kScreenHeight - kTopHeight - kRealValue(170), kScreenWidth,kRealValue(170))];
grapView.backgroundColor = RGBA(0, 0, 0, 0.1);
self.grapView = grapView;
self.grapView.hidden = false;
[self.view addSubview:grapView];
XMButton * callBtn = [[XMButton alloc] initWithFrame:CGRectMake(kScreenWidth/2 - 70 - kRealValue(33), grapView.height - StatusBar_Height - kRealValue(80) , kRealValue(70), kRealValue(70))];
callBtn.style = SDButtonStyleTop;
callBtn.backgroundColor = KWhiteColor;
callBtn.layer.cornerRadius = 35.0f;
callBtn.layer.masksToBounds = true;
[callBtn setTitle:@"120" forState:UIControlStateNormal];
callBtn.titleLabel.font = SYSTEMFONT(12);
[callBtn setTitleColor:UIColorHex(#FF422F) forState:UIControlStateNormal];
[callBtn setImage:[UIImage imageNamed:@"callHospation"] forState:UIControlStateNormal];
[callBtn addTarget:self action:@selector(callHospationAction) forControlEvents:UIControlEventTouchUpInside];
callBtn.imageW = 22;
callBtn.imageH = 20;
callBtn.imageY = 19;
callBtn.imageX = 24;
callBtn.interval = 5;
[grapView addSubview:callBtn];
XMButton * sosBtn = [[XMButton alloc] initWithFrame:CGRectMake(kScreenWidth/2 + kRealValue(33), callBtn.top , kRealValue(70), kRealValue(70))];
sosBtn.style = SDButtonStyleTop;
sosBtn.backgroundColor = KWhiteColor;
sosBtn.layer.cornerRadius = 35.0f;
sosBtn.layer.masksToBounds = true;
[sosBtn setTitle:@"应急就医" forState:UIControlStateNormal];
sosBtn.titleLabel.font = SYSTEMFONT(11);
[sosBtn setTitleColor:UIColorHex(#FF422F) forState:UIControlStateNormal];
[sosBtn setImage:[UIImage imageNamed:@"callSoSIcon"] forState:UIControlStateNormal];
[sosBtn addTarget:self action:@selector(callSoSAction) forControlEvents:UIControlEventTouchUpInside];
sosBtn.imageW = 22;
sosBtn.imageH = 21;
sosBtn.imageY = 19;
sosBtn.imageX = 24;
sosBtn.interval = 5;
[grapView addSubview:sosBtn];
self.titles = @[@"油田医院",@"合作医院",@"医疗点",@"AED",@"救护车"];
self.titleView.segmentTitles = self.titles;
[self.titleView reloadData];
}
- (void)initMapView {
if (self.mapView == nil) {
[AMapServices sharedServices].enableHTTPS = YES;
// ///初始化地图
self.mapView = [[MAMapView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)];
self.mapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
self.mapView.showsCompass = YES; //设置成NO表示关闭指南针;YES表示显示指南针
self.mapView.compassOrigin = CGPointMake(self.mapView.compassOrigin.x, 222);
self.mapView.showsScale = YES; //设置成NO表示不显示比例尺;YES表示显示比例尺
self.mapView.delegate = self;
///如果您需要进入地图就显示定位小蓝点,则需要下面两行代码
_mapView.scaleOrigin= CGPointMake(_mapView.scaleOrigin.x, kRealValue(45)); //设置比例尺位置
[self.view addSubview:self.mapView];
self.mapView.showsUserLocation = YES;
self.mapView.userTrackingMode = MAUserTrackingModeFollow;
//1.2、新增点A
// //将目标经纬度设置为地图中心店
MAUserLocationRepresentation *r = [[MAUserLocationRepresentation alloc] init];
r.showsAccuracyRing = YES;///精度圈是否显示,默认YES
r.showsHeadingIndicator = YES;///是否显示方向指示(MAUserTrackingModeFollowWithHeading模式开启)。默认为YES
r.enablePulseAnnimation = YES;///内部蓝色圆点是否使用律动效果, 默认YES
r.image = [UIImage imageNamed:@"myLocationIcon"]; ///定位图标, 与蓝色原点互斥
[self.mapView updateUserLocationRepresentation:r];
}
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
NSUserDefaults * user = [NSUserDefaults standardUserDefaults];
CGFloat longitude = [[user objectForKey:USERDEFAULLONG] floatValue];
CGFloat latitude = [[user objectForKey:USERDEFAULLATITUDE] floatValue];
[self getResourceDataWithType:@"1" Longitude:longitude withLatitude:latitude];
}
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
// 开启定位
self.mapView.showsUserLocation = YES;
self.mapView.userTrackingMode = MAUserTrackingModeFollow;
}
- (void)viewDidDisappear:(BOOL)animated
{
[super viewDidDisappear:animated];
}
#pragma mark: 拨打120
- (void)callHospationAction {
NSUserDefaults * user = [NSUserDefaults standardUserDefaults];
CGFloat longitude = [[user objectForKey:USERDEFAULLONG] floatValue];
CGFloat latitude = [[user objectForKey:USERDEFAULLATITUDE] floatValue];
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:@(longitude) forKey:@"longitude"];
[parmDic setObject:@(latitude) forKey:@"latitude"];
[parmDic setObject:@"0" forKey:@"callType"];
[parmDic setObject:self.type forKey:@"resourceId"];
JKCQAPI * sosApi = [[JKCQAPI alloc] init:self tag:@"CALLAPI" NeedToken:@""];
[sosApi PostSoSPhoneEmergency:parmDic];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://120"] options:nil completionHandler:^(BOOL success) {
}];
}
#pragma mark:应急点击
- (void)callSoSAction {
[self showMBProgressHUDWithString:@"应急发起中,请稍候..." autoHidden:false];
NSUserDefaults * user = [NSUserDefaults standardUserDefaults];
CGFloat longitude = [[user objectForKey:USERDEFAULLONG] floatValue];
CGFloat latitude = [[user objectForKey:USERDEFAULLATITUDE] floatValue];
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:@(longitude) forKey:@"longitude"];
[parmDic setObject:@(latitude) forKey:@"latitude"];
[parmDic setObject:@"0" forKey:@"name"];
JKCQAPI * sosApi = [[JKCQAPI alloc] init:self tag:@"GroupAPI" NeedToken:@""];
[sosApi getSoSCreateGroupChat:parmDic];
}
#pragma mark - AMapLocationManager Delegate
- (void)amapLocationManager:(AMapLocationManager *)manager doRequireLocationAuth:(CLLocationManager *)locationManager
{
[locationManager requestAlwaysAuthorization];
}
#pragma mark - MAMapViewDelegate
- (void)mapViewRequireLocationAuth:(CLLocationManager *)locationManager
{
[locationManager requestAlwaysAuthorization];
}
- (void)mapView:(MAMapView *)mapView didChangeUserTrackingMode:(MAUserTrackingMode)mode animated:(BOOL)animated
{
}
#pragma mark:定位失败
- (void)mapView:(MAMapView *)mapView didFailToLocateUserWithError:(NSError *)error {
}
#pragma mark:更新位置
- (void)mapView:(MAMapView *)mapView didUpdateUserLocation:(MAUserLocation *)userLocation updatingLocation:(BOOL)updatingLocation
{
if (updatingLocation)
{
DLog(@"userlocation :%f", userLocation.location.coordinate.latitude);
self.Longitude = userLocation.location.coordinate.longitude;
self.latitude = userLocation.location.coordinate.latitude;
NSUserDefaults * user = [NSUserDefaults standardUserDefaults];
// [self.mapView setCenterCoordinate: userLocation.location.coordinate animated:YES];
[user setObject:@(userLocation.location.coordinate.longitude) forKey:USERDEFAULLONG];
[user setObject:@(userLocation.location.coordinate.latitude) forKey:USERDEFAULLATITUDE];
[user synchronize];
// [self getResourceDataWithType:@"0" Longitude:self.Longitude withLatitude:self.latitude];
// [self getResourceDataWithType:self.type Longitude:self.Longitude withLatitude:self.latitude];
}
}
#pragma mark - LXSegmentTitleViewDataSource
- (NSArray *)segmentTitlesOfSegmentTitleView:(LXSegmentTitleView *)segmentView {
return self.titles;
}
- (void)segmentTitleView:(LXSegmentTitleView *)segmentView selectedIndex:(NSInteger)selectedIndex lastSelectedIndex:(NSInteger)lastSelectedIndex {
self.mapView.showsUserLocation = YES;
self.mapView.userTrackingMode = MAUserTrackingModeFollow;
self.selecetIndex = selectedIndex + 1;
if (self.selecetIndex == 1 || self.selecetIndex == 2)
{
[self getResourceDataWithType:[NSString stringWithFormat:@"%ld",self.selecetIndex] Longitude:self.Longitude withLatitude:self.latitude];
[self.addressView removeFromSuperview];
}
if (self.selecetIndex ==3) {
[self.hospitalArray removeAllObjects];
[self NearbyHospitalData];
[self.addressView removeFromSuperview];
}
if (self.selecetIndex ==4) {
[self.AedArray removeAllObjects];
[self NearbyAEDEquipmentData];
[self.addressView removeFromSuperview];
}
if (self.selecetIndex ==5) {
[self.AedArray removeAllObjects];
[self NearbySoSCarInf0Data];
[self.addressView removeFromSuperview];
}
}
#pragma mark:请求医疗点数据
- (void)NearbyHospitalData {
NSUserDefaults * user = [NSUserDefaults standardUserDefaults];
CGFloat longitude = [[user objectForKey:USERDEFAULLONG] floatValue];
CGFloat latitude = [[user objectForKey:USERDEFAULLATITUDE] floatValue];
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:[NSString stringWithFormat:@"%f",longitude] forKey:@"longitude"];
[parmDic setObject:[NSString stringWithFormat:@"%f",latitude] forKey:@"latitude"];
[parmDic setObject:[NSString stringWithFormat:@"%d",100000] forKey:@"radiusRange"];
[parmDic setObject:@"" forKey:@"name"];
[parmDic setObject:@(5) forKey:@"resourceNum"];
JKCQAPI * sosApi = [[JKCQAPI alloc] init:self tag:@"HOSPITALAPI" NeedToken:@""];
[sosApi getNearbyHomePageHospitalPoint:parmDic];
}
#pragma mark:请求医疗点数据
- (void)NearbyAEDEquipmentData {
NSUserDefaults * user = [NSUserDefaults standardUserDefaults];
CGFloat longitude = [[user objectForKey:USERDEFAULLONG] floatValue];
CGFloat latitude = [[user objectForKey:USERDEFAULLATITUDE] floatValue];
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:[NSString stringWithFormat:@"%f",longitude] forKey:@"longitude"];
[parmDic setObject:[NSString stringWithFormat:@"%f",latitude] forKey:@"latitude"];
[parmDic setObject:[NSString stringWithFormat:@"%d",100000] forKey:@"radiusRange"];
[parmDic setObject:@"" forKey:@"aedNum"];
JKCQAPI * sosApi = [[JKCQAPI alloc] init:self tag:@"AEDEQAPI" NeedToken:@""];
[sosApi getNearbyAEDEquipmentqNumber:parmDic];
}
#pragma mark:请求救护车数据
- (void)NearbySoSCarInf0Data {
NSUserDefaults * user = [NSUserDefaults standardUserDefaults];
CGFloat longitude = [[user objectForKey:USERDEFAULLONG] floatValue];
CGFloat latitude = [[user objectForKey:USERDEFAULLATITUDE] floatValue];
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:[NSString stringWithFormat:@"%f",longitude] forKey:@"longitude"];
[parmDic setObject:[NSString stringWithFormat:@"%f",latitude] forKey:@"latitude"];
[parmDic setObject:[NSString stringWithFormat:@"%d",100000] forKey:@"radiusRange"];
JKCQAPI * sosApi = [[JKCQAPI alloc] init:self tag:@"SOSCARAPI" NeedToken:@""];
[sosApi getSoSCarInfoLocationHome:parmDic];
}
- (void)getResourceDataWithType:(NSString *)type
Longitude:(CGFloat)longitude
withLatitude:(CGFloat)latitude{
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:type forKey:@"type"];
[parmDic setObject:@(longitude) forKey:@"longitude"];
[parmDic setObject:@(latitude) forKey:@"latitude"];
JKCQAPI * api = [[JKCQAPI alloc] init:self tag:@"RESOURCES" NeedToken:@""];
[api GetSoSHomePageResources:parmDic];
}
#pragma mark:网络请求
- (void)Failed:(NSString*)message tag:(NSString*)tag
{
[EasyTextView showErrorText:message];
[self hiddenAllMBProgressHUD];
}
- (void)Sucess:(id)response tag:(NSString*)tag
{
if ([tag isEqualToString:@"RESOURCES"])
{
NSDictionary * parmDic = response;
SOSCenterModel * model = [SOSCenterModel modelWithDictionary:parmDic];
self.model = model;
NSMutableArray * poiAnnotations = [[NSMutableArray alloc] init];
[self.mapView removeAnnotations:self.mapView.annotations];
[self.ponisArray removeAllObjects];
// 获取用户位置
MAUserLocation *userLocation = self.mapView.userLocation;
if (userLocation) {
[self.ponisArray addObject:userLocation];
}
for (SOSResourcesModel * resourceModel in model.resources) {
MAPointAnnotation *pointAnnotation = [[MAPointAnnotation alloc] init];
pointAnnotation.coordinate = CLLocationCoordinate2DMake(resourceModel.latitude, resourceModel.longitude);
pointAnnotation.title = resourceModel.name;
pointAnnotation.subtitle = resourceModel.address;
[poiAnnotations addObject:pointAnnotation];
[self addAnnotationToMapView:pointAnnotation];
[self.ponisArray addObject:pointAnnotation];
}
}
if ([tag isEqualToString:@"CALLAPI"]) {
NSDictionary * dic = response;
}
if ([tag isEqualToString:@"GroupAPI"]) {
NSDictionary * dic = response;
if ([ESCTUIManager TUIUserStatus] == false) {
[self loginImAccount];
return;
}
SOSGroupIMModel * model = [SOSGroupIMModel modelWithDictionary:dic];
ChatViewController * chatVC = [[ChatViewController alloc] init];
chatVC.isGroupID = YES;
chatVC.isVideo = YES;
chatVC.eableSendReport = true;
chatVC.eablehaveHelathData = true ;
chatVC.chatID = model.groupId;
chatVC.tfNew = model.tfNew;
chatVC.member = model.member;
chatVC.sosEnd_id = model.sosEnd_id;
chatVC.navTitle = @"应急中心";
chatVC.questionType = 1;
[self.navigationController pushViewController:chatVC animated:YES];
[self hiddenAllMBProgressHUD];
}
if ([tag isEqualToString:@"loginIMAPI"]) {
NSDictionary * pamrDic = response;
IMUserInfoModel * model = [IMUserInfoModel modelWithDictionary:pamrDic];
IMUserInfoModel * iminfoModel = [[IMUserInfoModel alloc] init];
iminfoModel.IMInfo = pamrDic;
[HQCommonUtils keyedArchiverWithData:iminfoModel key:IMLoginUserInfo];
[ESCTUIManager loginInitTUISDKAppidWith:[model.sdkAppId intValue] UserID:model.userId userSig:model.userSig];
[self callSoSAction];
}
if([tag isEqualToString:@"HOSPITALAPI"]) {
NSArray * responseArray = response;
NSMutableArray * poiAnnotations = [[NSMutableArray alloc] init];
[self.mapView removeAnnotations:self.mapView.annotations];
[self.ponisArray removeAllObjects];
// 获取用户位置
MAUserLocation *userLocation = self.mapView.userLocation;
if (userLocation) {
[self.ponisArray addObject:userLocation];
}
for (NSDictionary * dic in responseArray) {
HealthInterveneHomeModel * hospitalModel = [HealthInterveneHomeModel modelWithDictionary:dic];
[self.hospitalArray addObject:hospitalModel];
MAPointAnnotation *pointAnnotation = [[MAPointAnnotation alloc] init];
pointAnnotation.coordinate = CLLocationCoordinate2DMake(hospitalModel.latitude, hospitalModel.longitude);
pointAnnotation.title = hospitalModel.name;
pointAnnotation.subtitle = hospitalModel.address;
[poiAnnotations addObject:pointAnnotation];
[self addAnnotationToMapView:pointAnnotation];
[self.ponisArray addObject:pointAnnotation];
}
}
if ([tag isEqualToString:@"AEDEQAPI"]) {
NSArray * responseArray = response;
NSMutableArray * poiAnnotations = [[NSMutableArray alloc] init];
[self.mapView removeAnnotations:self.mapView.annotations];
[self.ponisArray removeAllObjects];
// 获取用户位置
MAUserLocation *userLocation = self.mapView.userLocation;
if (userLocation) {
[self.ponisArray addObject:userLocation];
}
for (NSDictionary * dic in responseArray) {
AEDNetWrokModel * aedModel = [AEDNetWrokModel modelWithDictionary:dic];
[self.AedArray addObject:aedModel];
MAPointAnnotation *pointAnnotation = [[MAPointAnnotation alloc] init];
pointAnnotation.coordinate = CLLocationCoordinate2DMake(aedModel.latitude, aedModel.longitude);
pointAnnotation.title = aedModel.name;
pointAnnotation.subtitle = aedModel.installAddress;
[poiAnnotations addObject:pointAnnotation];
[self addAnnotationToMapView:pointAnnotation];
[self.ponisArray addObject:pointAnnotation];
}
}
if ([tag isEqualToString:@"SOSCARAPI"]) {
NSArray * responseArray = response;
NSMutableArray * poiAnnotations = [[NSMutableArray alloc] init];
[self.mapView removeAnnotations:self.mapView.annotations];
[self.ponisArray removeAllObjects];
// 获取用户位置
MAUserLocation *userLocation = self.mapView.userLocation;
if (userLocation) {
[self.ponisArray addObject:userLocation];
}
for (NSDictionary * dic in responseArray) {
SOSResourcesModel * aedModel = [SOSResourcesModel modelWithDictionary:dic];
[self.carArray addObject:aedModel];
MAPointAnnotation *pointAnnotation = [[MAPointAnnotation alloc] init];
pointAnnotation.coordinate = CLLocationCoordinate2DMake(aedModel.latitude, aedModel.longitude);
pointAnnotation.title = aedModel.departCode;
pointAnnotation.subtitle = aedModel.licensePlateNumber;
[poiAnnotations addObject:pointAnnotation];
[self addAnnotationToMapView:pointAnnotation];
[self.ponisArray addObject:pointAnnotation];
}
}
}
- (void)loginImAccount {
JKCQAPI * proctocolApi = [[JKCQAPI alloc] init:self tag:@"loginIMAPI" NeedToken:nil];
[proctocolApi GetIMLoginAccount:nil];
}
- (MAAnnotationView *)mapView:(MAMapView *)mapView viewForAnnotation:(id<MAAnnotation>)annotation
{
[self.mapView showAnnotations:self.ponisArray edgePadding:UIEdgeInsetsMake(100, 100, 100, 100) animated:YES];
//用户当前位置大头针
if ([annotation isKindOfClass:[MAUserLocation class]])
{
static NSString *userLocationStyleReuseIndetifier = @"userLocationStyleReuseIndetifier";
MAAnnotationView *annotationView = [mapView dequeueReusableAnnotationViewWithIdentifier:userLocationStyleReuseIndetifier];
if (annotationView == nil)
{
annotationView = [[MAAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:userLocationStyleReuseIndetifier];
}
annotationView.canShowCallout = true;
annotationView.image = [UIImage imageNamed:@"myLocationIcon"];
annotationView.frame = CGRectMake(0, 0, 50, 50);
return annotationView;
}
if ([annotation isKindOfClass:[MAPointAnnotation class]])
{
static NSString *reuseIndetifier = @"annotationReuseIndetifier";
MAAnnotationView *annotationView = (MAAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:reuseIndetifier];
if (annotationView == nil)
{
annotationView = [[MAAnnotationView alloc] initWithAnnotation:annotation
reuseIdentifier:reuseIndetifier];
}
if (self.selecetIndex == 3) {
for (HealthInterveneHomeModel * hospitalModel in self.hospitalArray) {
if (annotation.coordinate.longitude == hospitalModel.longitude && annotation.coordinate.latitude == hospitalModel.latitude) {
annotationView.image = [UIImage imageNamed:@"medicalAnnitation"];
}
}
// 使用动画效果将点显示在屏幕内
[annotationView setSelected:false animated:YES];
//设置中心点偏移,使得标注底部中间点成为经纬度对应点
annotationView.centerOffset = CGPointMake(0, -18);
return annotationView;
}
if (self.selecetIndex == 4) {
for (AEDNetWrokModel * aedModel in self.AedArray) {
if (annotation.coordinate.longitude == aedModel.longitude && annotation.coordinate.latitude == aedModel.latitude) {
annotationView.image = [UIImage imageNamed:@"AEDIcon"];
}
}
// 使用动画效果将点显示在屏幕内
[annotationView setSelected:false animated:YES];
//设置中心点偏移,使得标注底部中间点成为经纬度对应点
annotationView.centerOffset = CGPointMake(0, -18);
return annotationView;
}
//救护车
if (self.selecetIndex == 5) {
for (SOSResourcesModel * aedModel in self.carArray) {
if (annotation.coordinate.longitude == aedModel.longitude && annotation.coordinate.latitude == aedModel.latitude) {
annotationView.image = [UIImage imageNamed:@"sosCard"];
}
}
// 使用动画效果将点显示在屏幕内
[annotationView setSelected:false animated:YES];
//设置中心点偏移,使得标注底部中间点成为经纬度对应点
annotationView.centerOffset = CGPointMake(0, -18);
return annotationView;
}
else
{
for (SOSResourcesModel * resourceModel in self.model.resources) {
if (annotation.coordinate.longitude == resourceModel.longitude && annotation.coordinate.latitude == resourceModel.latitude) {
if ([resourceModel.type integerValue]== 1) {
annotationView.image = [UIImage imageNamed:@"youtianHosoital"];
}
if ([resourceModel.type integerValue]== 2) {
annotationView.image = [UIImage imageNamed:@"hezuoHospital"];
}
if ([resourceModel.type integerValue]== 3) {
annotationView.image = [UIImage imageNamed:@"medicalAnnitation"];
}
if ([resourceModel.type integerValue]== 4) {
annotationView.image = [UIImage imageNamed:@"AEDIcon"];
}
if ([resourceModel.type integerValue]== 5) {
annotationView.image = [UIImage imageNamed:@"sosCard"];
}
if ([resourceModel.type integerValue]== 6) {
annotationView.image = [UIImage imageNamed:@"sosPeople"];
}
}
}
// 使用动画效果将点显示在屏幕内
[annotationView setSelected:false animated:YES];
//设置中心点偏移,使得标注底部中间点成为经纬度对应点
annotationView.centerOffset = CGPointMake(0, -18);
return annotationView;
}
}
return nil;
}
- (void)mapView:(MAMapView *)mapView didSelectAnnotationView:(MAAnnotationView *)view
{
self.grapView.hidden = true;
if (self.selecetIndex == 3) { //医疗点
for (HealthInterveneHomeModel * hospitalModel in self.hospitalArray) {
if (view.annotation.coordinate.longitude == hospitalModel.longitude && view.annotation.coordinate.latitude == hospitalModel.latitude) {
SOSResourcesModel * resourceModel = [[SOSResourcesModel alloc] init];
resourceModel.address = hospitalModel.address;
resourceModel.name = hospitalModel.name;
resourceModel.mobile = hospitalModel.mobile;
resourceModel.latitude = hospitalModel.latitude;
resourceModel.longitude = hospitalModel.longitude;
self.addressView.resourceModel = resourceModel;
self.resourceModel = resourceModel;
[self.mapView addSubview:self.addressView];
}
}
return;
}
if (self.selecetIndex == 4) { //aed
for (AEDNetWrokModel * aedModel in self.AedArray) {
if (view.annotation.coordinate.longitude == aedModel.longitude && view.annotation.coordinate.latitude == aedModel.latitude) {
HealthInterveneAEDModel * subAedModel = [[HealthInterveneAEDModel alloc] init];
subAedModel.resourceAddress = aedModel.installAddress;
subAedModel.resourceName = aedModel.name;
subAedModel.principalPhone = aedModel.chargeFirstMobile;
self.addressView.aedModel = subAedModel;
SOSResourcesModel * resourceModel = [[SOSResourcesModel alloc] init];
resourceModel.address = aedModel.installAddress;
resourceModel.name = aedModel.name;
resourceModel.mobile = aedModel.chargeFirstMobile;
resourceModel.latitude = aedModel.latitude;
resourceModel.longitude = aedModel.longitude;
self.resourceModel = resourceModel;
[self.mapView addSubview:self.addressView];
}
}
return;
}
if (self.selecetIndex == 5) {
for (SOSResourcesModel * aedModel in self.carArray) {
if (view.annotation.coordinate.longitude == aedModel.longitude && view.annotation.coordinate.latitude == aedModel.latitude) {
SOSResourcesModel * resourceModel = [[SOSResourcesModel alloc] init];
resourceModel.address = aedModel.licensePlateNumber;
resourceModel.name = aedModel.departCode;
resourceModel.latitude = aedModel.latitude;
resourceModel.longitude = aedModel.longitude;
self.resourceModel = resourceModel;
self.addressView.resourceModel = resourceModel;
[self.mapView addSubview:self.addressView];
}
}
return;
}
for (SOSResourcesModel * resourceModel in self.model.resources) {
if (view.annotation.coordinate.longitude == resourceModel.longitude && view.annotation.coordinate.latitude == resourceModel.latitude) {
self.addressView.resourceModel = resourceModel;
self.resourceModel = resourceModel;
[self.mapView addSubview:self.addressView];
}
}
// }
}
- (void)addressNavLocataion {
NSUserDefaults * user = [NSUserDefaults standardUserDefaults];
CGFloat longitude = [[user objectForKey:USERDEFAULLONG] floatValue];
CGFloat latitude = [[user objectForKey:USERDEFAULLATITUDE] floatValue];
NSMutableDictionary * Dic = [[NSMutableDictionary alloc] initWithObjectsAndKeys:@"我的位置",@"startName",self.resourceModel.address,@"endName", nil];
[TYNavSheet ShowMapNavSheetSuperView:self withLocationDic:Dic withstartCoor:CLLocationCoordinate2DMake(latitude, longitude) withendCoor:CLLocationCoordinate2DMake(self.resourceModel.latitude, self.resourceModel.longitude)];
}
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
[TYNavSheet actionSheetBtnClick:buttonIndex];
}
- (void)resourcePhoneOnclick:(NSString *)phoneNumber {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: [NSString stringWithFormat:@"tel://%@",phoneNumber]] options:nil completionHandler:^(BOOL success) {
}];
}
//在线时票据过期:此时您需要生成新的 userSig,并再次重新调用初始化。
- (void)onKickedOffline {
[HQCommonUtils keyedArchiverWithData:nil key:LoginUserInfo];
[ESCTUIManager outLoginTUISDK];
KPostNotification(KNotificationLoginStateChange, @NO);
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
@@ -1,75 +0,0 @@
//
// AEDNetWrokModel.h
// EscortProject
//
// Created by 仁康信息 on 2023/12/19.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface AEDNetWrokModel : NSObject
@property (nonatomic, copy) NSString * aed_id;
@property (nonatomic, copy) NSString * routerStatus_dictText;
@property (nonatomic, copy) NSString * installAddressImg;
@property (nonatomic, copy) NSString * manageDepartName;
@property (nonatomic, copy) NSString * installAddress;
@property (nonatomic, copy) NSString * batteryStatus;
@property (nonatomic, copy) NSString * handleExplain;
@property (nonatomic, copy) NSString * videoHandle;
@property (nonatomic, copy) NSString * aedAnnexStatus;
@property (nonatomic, copy) NSString * chargeFirstMobile;
@property (nonatomic, copy) NSString * manageUserName;
@property (nonatomic, copy) NSString * routerSerialNum;
@property (nonatomic, copy) NSString * manageUserId;
@property (nonatomic, copy) NSString * secondDepartName;
@property (nonatomic, copy) NSString * hostModel;
@property (nonatomic, copy) NSString * hostSerialNum;
@property (nonatomic, copy) NSString * delFlag;
@property (nonatomic, copy) NSString * annex;
@property (nonatomic, copy) NSString * batteryModel;
@property (nonatomic, copy) NSString * updateBy;
@property (nonatomic, copy) NSString * checkStatus_dictText;
@property (nonatomic, copy) NSString * routerModel;
@property (nonatomic, copy) NSString * name;
@property (nonatomic, copy) NSString * updateTime;
@property (nonatomic, copy) NSString * electrodeSheetValidTime;
@property (nonatomic, copy) NSString * createBy;
@property (nonatomic, copy) NSString * departName;
@property (nonatomic, copy) NSString * manageDepartCode;
@property (nonatomic, assign) long distance;
@property (nonatomic, copy) NSString * aedImg;
@property (nonatomic, assign) double longitude;
@property (nonatomic, copy) NSString * manageUserMobile;
@property (nonatomic, assign) double latitude;
@property (nonatomic, copy) NSString * departCode;
@property (nonatomic, copy) NSString * electrodeSheetStatus;
@property (nonatomic, copy) NSString * batteryStatus_dictText;
@property (nonatomic, assign) NSInteger coverUserNum;
@property (nonatomic, copy) NSString * chargeSecond;
@property (nonatomic, copy) NSString * chargeSecondMobile;
@property (nonatomic, copy) NSString * checkStatus;
@property (nonatomic, copy) NSString * createTime;
@property (nonatomic, copy) NSString * mfrsName;
@property (nonatomic, copy) NSString * warrantyEndDate;
@property (nonatomic, copy) NSString * warrantyStartDate;
@property (nonatomic, copy) NSString * chargeFirst;
@property (nonatomic, copy) NSString * routerStatus;
@property (nonatomic, copy) NSString * electrodeSheetStatus_dictText;
@property (nonatomic, copy) NSString * mfrsMobile;
@property (nonatomic, copy) NSString * memo;
@property (nonatomic, assign) NSInteger batteryVoltage;
@end
NS_ASSUME_NONNULL_END
@@ -1,19 +0,0 @@
//
// AEDNetWrokModel.m
// EscortProject
//
// Created by 仁康信息 on 2023/12/19.
//
#import "AEDNetWrokModel.h"
@implementation AEDNetWrokModel
+ (NSDictionary *)modelCustomPropertyMapper
{
NSDictionary * dic =@{@"aed_id" :@"id"};
return dic;
}
@end
@@ -1,36 +0,0 @@
//
// HealthInterveneAEDModel.h
// EscortProject
//
// Created by 仁康信息 on 2023/12/19.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface HealthInterveneAEDModel : NSObject
@property (nonatomic, copy) NSString * aed_id;
@property (nonatomic, copy) NSString * resourceAddress;
@property (nonatomic, copy) NSString * principalName;
@property (nonatomic, copy) NSString * principalPhone;
@property (nonatomic, copy) NSString * updateBy;
@property (nonatomic, copy) NSString * resourceDesc;
@property (nonatomic, copy) NSString * resourceType;
@property (nonatomic, assign) double longitude;
@property (nonatomic, copy) NSString * delFlag;
@property (nonatomic, assign) double latitude;
@property (nonatomic, copy) NSString * resourceName;
@property (nonatomic, copy) NSString * resourceImg;
@property (nonatomic, copy) NSString * resourceNo;
@property (nonatomic, assign) long distance;
@property (nonatomic, strong) NSArray * assoSymtomIds;
@property (nonatomic, copy) NSString * status;
@property (nonatomic, copy) NSString * createBy;
@end
NS_ASSUME_NONNULL_END
@@ -1,19 +0,0 @@
//
// HealthInterveneAEDModel.m
// EscortProject
//
// Created by 仁康信息 on 2023/12/19.
//
#import "HealthInterveneAEDModel.h"
@implementation HealthInterveneAEDModel
+ (NSDictionary *)modelCustomPropertyMapper
{
NSDictionary * dic =@{@"aed_id" :@"id"};
return dic;
}
@end
@@ -1,56 +0,0 @@
//
// HealthInterveneHomeModel.h
// EscortProject
//
// Created by 仁康信息 on 2023/9/12.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface HealthInterveneHomeModel : NSObject
@property (nonatomic, copy) NSString * tit;
@property (nonatomic, copy) NSString * healthImg;
@property (nonatomic, copy) NSString * des;
@property (nonatomic, copy) NSString * currentData;
@property (nonatomic, copy) NSString * backImg;
@property (nonatomic, copy) NSString * type;
//医院
@property (nonatomic, copy) NSString * status;
@property (nonatomic, copy) NSString * status_dictText;
@property (nonatomic, copy) NSString * delFlag;
@property (nonatomic, copy) NSString * createBy;
@property (nonatomic, copy) NSString * createTime;
@property (nonatomic, copy) NSString * updateBy;
@property (nonatomic, copy) NSString * updateTime;
@property (nonatomic, copy) NSString * memo;
@property (nonatomic, copy) NSString * detail_id;
@property (nonatomic, copy) NSString * name;
@property (nonatomic, copy) NSString * address;
@property (nonatomic, copy) NSString * mobile;
@property (nonatomic, assign) double longitude;
@property (nonatomic, assign) double latitude;
@property (nonatomic, copy) NSString * aidrange;
@property (nonatomic, copy) NSString * gdId;
@property (nonatomic, copy) NSString * url;
@property (nonatomic, copy) NSString * level;
@property (nonatomic, copy) NSString * img;
@property (nonatomic, copy) NSString * hospitalId;
@property (nonatomic, copy) NSString * hospitalName;
@property (nonatomic, copy) NSString * departCode;
@property (nonatomic, copy) NSString * departName;
@property (nonatomic, copy) NSString * adminUser;
@property (nonatomic, copy) NSString * setUpTime;
@property (nonatomic, copy) NSString * medicalStaffNum;
@property (nonatomic, copy) NSString * radiationNum;
@property (nonatomic, copy) NSString * ambulanceNum;
@property (nonatomic, copy) NSString * radiationDepart;
@property (nonatomic, strong) NSArray * radiationDepartList;
@property (nonatomic, copy) NSString * distance;
@end
NS_ASSUME_NONNULL_END
@@ -1,18 +0,0 @@
//
// HealthInterveneHomeModel.m
// EscortProject
//
// Created by 仁康信息 on 2023/9/12.
//
#import "HealthInterveneHomeModel.h"
@implementation HealthInterveneHomeModel
+ (NSDictionary *)modelCustomPropertyMapper
{
NSDictionary * dic =@{@"detail_id" :@"id"};
return dic;
}
@end
@@ -1,54 +0,0 @@
//
// SOSCenterModel.h
// EscortProject
//
// Created by 仁康信息 on 2023/5/13.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface SOSTitleModel : NSObject
@property (nonatomic, copy) NSString * title;
@property (nonatomic, copy) NSString * value;
@end
@interface SOSResourcesModel : NSObject
@property (nonatomic, copy) NSString * province;
@property (nonatomic, copy) NSString * gdId;
@property (nonatomic, assign) double latitude;
@property (nonatomic, copy) NSString * city;
@property (nonatomic, copy) NSString * name;
@property (nonatomic, copy) NSString * type;
@property (nonatomic, copy) NSString * level;
@property (nonatomic, assign) double longitude;
@property (nonatomic, copy) NSString * distance;
@property (nonatomic, copy) NSString * reaourceID;
@property (nonatomic, copy) NSString * address;
@property (nonatomic, copy) NSString * img;
@property (nonatomic, copy) NSString * mobile;
@property (nonatomic, copy) NSString * licensePlateNumber;
@property (nonatomic, copy) NSString * departCode;
@property (nonatomic, copy) NSString * driverName;
@end
@interface SOSCenterModel : NSObject
@property (nonatomic, strong) NSArray<SOSResourcesModel *> * resources;
@property (nonatomic, strong) NSArray<SOSTitleModel *> * dicts;
@end
NS_ASSUME_NONNULL_END
@@ -1,36 +0,0 @@
//
// SOSCenterModel.m
// EscortProject
//
// Created by 仁康信息 on 2023/5/13.
//
#import "SOSCenterModel.h"
@implementation SOSTitleModel
@end
@implementation SOSResourcesModel
+ (NSDictionary *)modelCustomPropertyMapper
{
NSDictionary * dic =@{@"reaourceID" :@"id"};
return dic;
}
@end
@implementation SOSCenterModel
+ (NSDictionary *)modelContainerPropertyGenericClass
{
return @{@"resources":[SOSResourcesModel class],
@"dicts":[SOSTitleModel class]
};
}
@end
@@ -1,34 +0,0 @@
//
// SOSAddressView.h
// EscortProject
//
// Created by 仁康信息 on 2023/6/2.
//
#import <UIKit/UIKit.h>
#import "SOSCenterModel.h"
#import "HealthInterveneAEDModel.h"
NS_ASSUME_NONNULL_BEGIN
@protocol SoSBottomProtocol <NSObject>
- (void)addressNavLocataion;
- (void)resourcePhoneOnclick:(NSString *)phoneNumber;
- (void)showBottomBtn;
@end
@interface SOSAddressView : UIView
@property (nonatomic, strong) SOSResourcesModel * resourceModel;
@property (nonatomic, strong) HealthInterveneAEDModel * aedModel;
@property (nonatomic, weak)id<SoSBottomProtocol> addressDelegate;
@end
NS_ASSUME_NONNULL_END
@@ -1,224 +0,0 @@
//
// SOSAddressView.m
// EscortProject
//
// Created by 仁康信息 on 2023/6/2.
//
#import "SOSAddressView.h"
@interface SOSAddressView ()
@property (nonatomic, strong) UILabel * lvLabel;
@property (nonatomic, strong) UILabel * hospitalName;
@property (nonatomic, strong) UILabel * phoneLabel;
@property (nonatomic, strong) UILabel * addressLabel;
@end
@implementation SOSAddressView
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self createUI];
}
return self;
}
- (void)createUI {
self.layer.cornerRadius = 10;
self.layer.masksToBounds = true;
self.lvLabel = [[UILabel alloc] init];
self.lvLabel.layer.cornerRadius = 3.0f;
self.lvLabel.layer.masksToBounds = true;
self.lvLabel.text = @"--";
self.lvLabel.textColor = KWhiteColor;
self.lvLabel.backgroundColor = UIColorHex(#21BEBD);
self.lvLabel.textAlignment = NSTextAlignmentCenter;
self.lvLabel.font = MEDIUMFONT(9);
self.lvLabel.hidden = true;
[self addSubview:self.lvLabel];
[self.lvLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(kRealValue(18));
make.width.mas_offset(60);
make.top.mas_offset(20);
make.height.mas_offset(16);
}];
self.hospitalName = [[UILabel alloc] init];
self.hospitalName.text = @"--";
self.hospitalName.font = BOLDSYSTEMFONT(14);
self.hospitalName.textColor = UIColorHex(#333333);
self.hospitalName.textAlignment = NSTextAlignmentLeft;
[self addSubview:self.hospitalName];
[self.hospitalName mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.lvLabel.mas_right).offset(10);
make.right.mas_offset(-30);
make.top.mas_offset(20);
make.height.mas_offset(15);
}];
self.phoneLabel = [[UILabel alloc] init];
self.phoneLabel.text = @"--";
self.phoneLabel.font = MEDIUMFONT(13);
self.phoneLabel.textColor = UIColorHex(#999999);
self.phoneLabel.textAlignment = NSTextAlignmentLeft;
[self addSubview:self.phoneLabel];
[self.phoneLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(kRealValue(15));
make.right.mas_offset(-30);
make.top.mas_equalTo(self.lvLabel.mas_bottom).offset(12);
make.height.mas_offset(15);
}];
self.addressLabel = [[UILabel alloc] init];
self.addressLabel.text = @"--km | ---";
self.addressLabel.font = MEDIUMFONT(13);
self.addressLabel.textColor = UIColorHex(#999999);
[self addSubview:self.addressLabel];
[self.addressLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(kRealValue(18));
make.right.mas_offset(kRealValue(-15));
make.top.mas_equalTo(self.phoneLabel.mas_bottom).offset(10);
make.bottom.mas_offset(-10);
}];
[self.addressLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
UIButton * closeBtn = [[UIButton alloc] init];
[closeBtn setImage:IMAGE_NAMED(@"close_icon") forState:UIControlStateNormal];
[closeBtn addTarget:self action:@selector(closePopView) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:closeBtn];
[closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_offset(kRealValue(-15));
make.top.mas_equalTo(@10);
make.width.height.mas_offset(20);
}];
UIButton * navBtn = [[UIButton alloc] init];
[navBtn setImage:IMAGE_NAMED(@"address_NavLoctaion") forState:UIControlStateNormal];
[navBtn addTarget:self action:@selector(navLocationView) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:navBtn];
[navBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_offset(kRealValue(-21));
make.top.mas_equalTo(self.hospitalName.mas_bottom).offset(4);
make.width.height.mas_offset(26);
}];
UIButton * samllPhoneBtn = [[UIButton alloc] init];
[samllPhoneBtn setImage:IMAGE_NAMED(@"address_phone") forState:UIControlStateNormal];
[samllPhoneBtn addTarget:self action:@selector(LocationPhoneView) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:samllPhoneBtn];
[samllPhoneBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(navBtn.mas_left).offset(-14);
make.top.mas_equalTo(self.hospitalName.mas_bottom).offset(4);
make.width.height.mas_offset(26);
}];
}
- (void)setResourceModel:(SOSResourcesModel *)resourceModel {
_resourceModel = resourceModel;
if ( !ValidStr(_resourceModel.level) ) {
self.lvLabel.hidden = false;
self.lvLabel.text = _resourceModel.level;
[self.hospitalName mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.lvLabel.mas_right).offset(10);
make.right.mas_offset(-30);
make.top.mas_offset(20);
make.height.mas_offset(15);
}];
}else
{
[self.hospitalName mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(kRealValue(18));
make.right.mas_offset(-30);
make.top.mas_offset(20);
make.height.mas_offset(15);
}];
}
self.addressLabel.text = _resourceModel.address;
self.hospitalName.text = _resourceModel.name;
self.phoneLabel.text = _resourceModel.mobile;
}
- (void)setAedModel:(HealthInterveneAEDModel *)aedModel {
_aedModel = aedModel;
[self.hospitalName mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(kRealValue(18));
make.right.mas_offset(-30);
make.top.mas_offset(20);
make.height.mas_offset(15);
}];
self.addressLabel.text = [NSString stringWithFormat:@"%.2f | %@",_aedModel.distance / 1000.0, _aedModel.resourceAddress] ;
self.hospitalName.text = _aedModel.resourceName;
self.phoneLabel.text = _aedModel.principalPhone;
}
- (void)navLocationView {
if ([self.addressDelegate respondsToSelector:@selector(addressNavLocataion)]) {
[self.addressDelegate addressNavLocataion];
}
}
- (void)LocationPhoneView {
if ([self.addressDelegate respondsToSelector:@selector(resourcePhoneOnclick:)]) {
if (self.resourceModel) {
[self.addressDelegate resourcePhoneOnclick:self.resourceModel.mobile];
}
if (self.aedModel ) {
[self.addressDelegate resourcePhoneOnclick:self.aedModel.principalPhone];
}
}
}
- (void)closePopView {
if ([self.addressDelegate respondsToSelector:@selector(showBottomBtn)]) {
[self.addressDelegate showBottomBtn];
}
[self removeFromSuperview];
}
@end