diff --git a/DoctorXinjiang/DoctorXinjiang.xcodeproj/project.pbxproj b/DoctorXinjiang/DoctorXinjiang.xcodeproj/project.pbxproj index bed6de1..1f7170e 100644 --- a/DoctorXinjiang/DoctorXinjiang.xcodeproj/project.pbxproj +++ b/DoctorXinjiang/DoctorXinjiang.xcodeproj/project.pbxproj @@ -407,18 +407,20 @@ GCC_PREFIX_HEADER = "$(SRCROOT)/DoctorXinjiang/Supporting Files/PrefixHeader.pch"; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "$(SRCROOT)/DoctorXinjiang/Supporting Files/Info.plist"; + INFOPLIST_KEY_CFBundleDisplayName = "健康油我专家端"; INFOPLIST_KEY_ITSAppUsesNonExemptEncryption = NO; - INFOPLIST_KEY_NSCameraUsageDescription = "专家端需要访问您的相机用来您的头像上传是否同意?"; + INFOPLIST_KEY_NSCameraUsageDescription = "健康油我专家端需要访问您的相机用来您的头像上传是否同意?"; INFOPLIST_KEY_NSLocationAlwaysUsageDescription = "始终允许访问位置信息"; INFOPLIST_KEY_NSLocationUsageDescription = "永不允许访问位置信息"; INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "专家端使用期间允许访问位置信息"; - INFOPLIST_KEY_NSMicrophoneUsageDescription = "专家端需要访问您的麦克风用来视频录制,是否同意?"; - INFOPLIST_KEY_NSPhotoLibraryAddUsageDescription = "专家端需要访问你的相册,方便您保存图片,是否同意?"; + INFOPLIST_KEY_NSMicrophoneUsageDescription = "健康油我专家端需要访问您的麦克风用来视频录制,是否同意?"; + INFOPLIST_KEY_NSPhotoLibraryAddUsageDescription = "健康油我专家端需要访问你的相册,方便您保存图片,是否同意?"; INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "专家端需要访问您的相册上传图片,方便您的使用,是否同意?"; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UIUserInterfaceStyle = Light; IPHONEOS_DEPLOYMENT_TARGET = 15.6; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -454,18 +456,20 @@ GCC_PREFIX_HEADER = "$(SRCROOT)/DoctorXinjiang/Supporting Files/PrefixHeader.pch"; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "$(SRCROOT)/DoctorXinjiang/Supporting Files/Info.plist"; + INFOPLIST_KEY_CFBundleDisplayName = "健康油我专家端"; INFOPLIST_KEY_ITSAppUsesNonExemptEncryption = NO; - INFOPLIST_KEY_NSCameraUsageDescription = "专家端需要访问您的相机用来您的头像上传是否同意?"; + INFOPLIST_KEY_NSCameraUsageDescription = "健康油我专家端需要访问您的相机用来您的头像上传是否同意?"; INFOPLIST_KEY_NSLocationAlwaysUsageDescription = "始终允许访问位置信息"; INFOPLIST_KEY_NSLocationUsageDescription = "永不允许访问位置信息"; INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "专家端使用期间允许访问位置信息"; - INFOPLIST_KEY_NSMicrophoneUsageDescription = "专家端需要访问您的麦克风用来视频录制,是否同意?"; - INFOPLIST_KEY_NSPhotoLibraryAddUsageDescription = "专家端需要访问你的相册,方便您保存图片,是否同意?"; + INFOPLIST_KEY_NSMicrophoneUsageDescription = "健康油我专家端需要访问您的麦克风用来视频录制,是否同意?"; + INFOPLIST_KEY_NSPhotoLibraryAddUsageDescription = "健康油我专家端需要访问你的相册,方便您保存图片,是否同意?"; INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "专家端需要访问您的相册上传图片,方便您的使用,是否同意?"; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UIUserInterfaceStyle = Light; IPHONEOS_DEPLOYMENT_TARGET = 15.6; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", diff --git a/DoctorXinjiang/DoctorXinjiang/Define/ThirdMacros.h b/DoctorXinjiang/DoctorXinjiang/Define/ThirdMacros.h index fe5ce2b..d1df152 100755 --- a/DoctorXinjiang/DoctorXinjiang/Define/ThirdMacros.h +++ b/DoctorXinjiang/DoctorXinjiang/Define/ThirdMacros.h @@ -28,7 +28,7 @@ //高德key -#define AMAPSDKKEY @"6f5c1979535a0bea4965d033306c61a7" +#define AMAPSDKKEY @"0017de4b0745e1e1be58e9fa89b66f56" //友盟appster diff --git a/DoctorXinjiang/DoctorXinjiang/Manager/NetworkingManager/XJDNetAPI.h b/DoctorXinjiang/DoctorXinjiang/Manager/NetworkingManager/XJDNetAPI.h new file mode 100755 index 0000000..1e83ff1 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Manager/NetworkingManager/XJDNetAPI.h @@ -0,0 +1,104 @@ +// +// API.h +// XZYNetworking +// +// Created by 仁康信息 on 2022/9/9. +// Copyright © 2022年 仁康信息. All rights reserved. +// + +#import +#import "YXNetworkingWithCache.h" + +@interface XJDNetAPI : NSObject + +@property (nonatomic,strong) YXNetworkingWithCache * httpRequest; + +#pragma mark - init方法 +//无需token +- (instancetype)init:(id)delegate tag:(NSString *)tag; +//携带token +- (instancetype)init:(id)delegate tag:(NSString *)tag NeedToken:(NSString *)NeedToken; + +#pragma mark - 首页模块 + +- (void)getHomeData:(NSMutableDictionary *)parmaDic; +- (void)getHomeSmallData:(NSMutableDictionary *)parmaDic; +- (void)getHomeFoundSmallHelpData:(NSMutableDictionary *)parmaDic; + +//接受咨询 +- (void)getAcceptQuestion:(NSMutableDictionary *)parmaDic; + +#pragma mark: -医生排班 + +- (void)PostDoctorWorkTime:(NSMutableDictionary *)parmDic; +- (void)GetDoctorWorkSetting:(NSMutableDictionary *)pamraDic; + +#pragma mark:咨询统计 + +- (void)GetQuestionStatistics:(NSMutableDictionary *)pamraDic; +- (void)GetStatisticsEarnings:(NSMutableDictionary *)pamraDic; +- (void)GetQuestionRecoredList:(NSMutableDictionary *)parmDic; +- (void)GetRecoredQuestionDetail:(NSMutableDictionary *)pamraDic; +- (void)getBodyReportDeatil:(NSMutableDictionary *)parmDic; +- (void)GetCancelReasourData:(NSMutableDictionary *)pamraDic; +- (void)submitCancelreasourData:(NSMutableDictionary *)pamraDic; +- (void)fileDetatilData:(NSMutableDictionary *)pamraDic; +#pragma mark:暂停公告 + +- (void)GetPublishServerMessage:(NSMutableDictionary *)pamraDic; +- (void)GetSPublishServerRecored:(NSMutableDictionary *)pamraDic; +- (void)GetChangePublishServer:(NSMutableDictionary *)pamraDic; +- (void)GetPhyscialSearchAnomalyData:(NSMutableDictionary *)parmDic; + +#pragma mark:发布公告 + +- (void)PostStopPublishServer:(NSMutableDictionary *)pamraDic; + +//查询停诊原因 +- (void)GetPublishServerReason:(NSMutableDictionary *)pamraDic; +//查询当前咨询数量 +- (void)GetCurrentServerNumber:(NSMutableDictionary *)pamraDic; +#pragma mark: im + +- (void)PostEndSoSIMQuestion:(NSMutableDictionary *)pamraDic; +- (void)GetEndPictureEndIMQuestion:(NSMutableDictionary *)pamraDic; +- (void)PostGroupIDArray:(NSMutableDictionary *)parmDic; + +#pragma mark - 我的模块 + +- (void)GetInquireDoctorInfo:(NSMutableDictionary *)pamraDic; + +//查询科室 +- (void)GetInquireDoctorRoomInfo:(NSMutableDictionary *)pamraDic; +//个人简介 +- (void)postUpdateDoctorInfo:(NSMutableDictionary *)pamraDic; +//收益明细 +- (void)GetBillListData:(NSMutableDictionary *)pamraDic; +//提现详情 +- (void)withDrawDetailsData:(NSMutableDictionary *)pamraDic; + +#pragma mark - 登录注册 + +- (void)PostLogin:(NSMutableDictionary *)parmDic; +- (void)GetIMLoginAccount:(NSMutableDictionary *)pamraDic; +- (void)postSetUserPassword:(NSMutableDictionary *)parmDic; +- (void)postImageArrayUpload:(NSArray *)imageArray; +- (void)postResetUserNewPassword:(NSMutableDictionary *)parmDic; +//更新头像 +- (void)updateUserAvatar:(NSMutableDictionary *)parmDic; +//更新密码 +- (void)updateDoctorLoginPassword:(NSMutableDictionary *)pamraDic; +- (void)getUserAgreementPrivacy:(NSMutableDictionary *)parmDic; +- (void)getVesionHideRegis:(NSMutableDictionary *)parmDic; +#pragma mark - IM模块 + +- (void)getAgainSessionReservationDate:(NSMutableDictionary *)parmDic; +- (void)getendVideoReportById:(NSMutableDictionary *)parmDic; +//获取体检语音 +- (void)docotorReportListAudioResource:(NSMutableDictionary *)parmDic; +- (void)docotorReportListHistoryDoctorAudioResource:(NSMutableDictionary *)parmDic; +- (void)GetDoctorPhyscialIDCardSearch:(NSMutableDictionary *)parmDic; +- (void)getHistoryReportById:(NSMutableDictionary *)parmDic; +- (void)getSendVideoStart:(NSMutableDictionary *)pamraDic; + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Manager/NetworkingManager/XJDNetAPI.m b/DoctorXinjiang/DoctorXinjiang/Manager/NetworkingManager/XJDNetAPI.m new file mode 100755 index 0000000..2f3f329 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Manager/NetworkingManager/XJDNetAPI.m @@ -0,0 +1,333 @@ +// +// API.m +// XZYNetworking +// +// Created by 仁康信息 on 2022/9/9. +// Copyright © 2022年 仁康信息. All rights reserved. +// + +#import "XJDNetAPI.h" +#define needToken httpRequest.needToken +#define isLoginFlag httpRequest.isLoginFlag + +@implementation XJDNetAPI + +#pragma mark - init方法 +@synthesize httpRequest; + +//无需token +- (instancetype)init:(id)delegate tag:(NSString *)tag +{ + XJDUserInfo * user = [XJDCommonUtils keyedUnarchiverWithKey:LoginUserInfo]; + return [self init:delegate tag:tag NeedToken:user.token]; +} + +//携带token +- (instancetype)init:(id)delegate tag:(NSString *)tag NeedToken:(NSString *)NeedToken +{ + if (self=[super init]) { + if (![tag isEqualToString:@"LOGINGAPI"] || ![tag isEqualToString:@"CHANGEAPI"] ) { + + XJDUserInfo * user = [XJDCommonUtils keyedUnarchiverWithKey:LoginUserInfo]; + + httpRequest = [[YXNetworkingWithCache alloc] initWithDelegate:delegate bindTag:tag NeedToken:user.token]; + }else{ + httpRequest = [[YXNetworkingWithCache alloc] initWithDelegate:delegate bindTag:tag NeedToken:@""]; + + } + } + return self; +} +#pragma mark - 首页模块 +- (void)getHomeData:(NSMutableDictionary *)parmaDic { + + //GET https://starry.test.icdat.cn/health-consultation/api/consult/conSession/selectSessionProfessorIng HTTP/1.1 + + [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-consultation/api/consult/conSession/selectSessionProfessorIngNew",Http] params:parmaDic]; + + +} + +- (void)getHomeSmallData:(NSMutableDictionary *)parmaDic { + + [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-consultation/api/consult/conSession/insertProfessorAndHelperSessionShow",Http] params:parmaDic]; + +} + +- (void)getHomeFoundSmallHelpData:(NSMutableDictionary *)parmaDic { + + [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-consultation/api/consult/conSession/insertProfessorAndHelperSession",Http] params:parmaDic]; + +} +- (void)getAcceptQuestion:(NSMutableDictionary *)parmaDic { + +// GET https://cqyt.test.yg.icdat.cn/health-consultation/api/consult/conSession/sessionConfirm?id=1744619023486275586&startTime=1705287600000&endTime=1705294800000 HTTP/1.1 + [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-consultation/api/consult/conSession/sessionConfirm",Http] params:parmaDic]; +} +//结束图文咨询 +- (void)GetEndPictureEndIMQuestion:(NSMutableDictionary *)pamraDic { + + [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-consultation/api/consult/conSession/finishSession",Http] params:pamraDic]; +// /health-consultation/api/consult/conSession/finishSession +} + +- (void)PostEndSoSIMQuestion:(NSMutableDictionary *)pamraDic { + + [httpRequest httpPostRequest:[NSString stringWithFormat:@"%@/health-emergency/api/emergency/order/orderOver",Http] params:pamraDic]; + +} + +- (void)GetInquireDoctorInfo:(NSMutableDictionary *)pamraDic { + + [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-consultation/api/consult/conDoctor/queryDoctor",Http] params:pamraDic]; + +} + +#pragma mark: -医生排班 + +- (void)PostDoctorWorkTime:(NSMutableDictionary *)parmDic { + + [httpRequest httpPostRequest:[NSString stringWithFormat:@"%@/health-consultation/api/consult/conDoctorScheduling/insertDoctorScheduling",Http] params:parmDic]; + +} + +#pragma mark: -查询医生排班 +- (void)GetDoctorWorkSetting:(NSMutableDictionary *)pamraDic { + + [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-consultation/api/consult/conDoctorScheduling/selectDoctorScheduling",Http] params:pamraDic]; + +} + +- (void)postUpdateDoctorInfo:(NSMutableDictionary *)pamraDic { + +// POST https://cqyt.test.yg.icdat.cn/health-consultation/api/consult/conDoctor/update HTTP/1.1 + [httpRequest httpPostRequest:[NSString stringWithFormat:@"%@/health-consultation/api/consult/conDoctor/update",Http] params:pamraDic]; + + +} +#pragma mark:咨询统计 + +- (void)GetQuestionStatistics:(NSMutableDictionary *)pamraDic { + + [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-consultation/api/consult/conCostStatistics/groupByTypehList",Http] params:pamraDic]; + +} + +- (void)GetStatisticsEarnings:(NSMutableDictionary *)pamraDic { + + [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-consultation/api/consult/conCostStatistics/getStatistics",Http] params:pamraDic]; + +} + +- (void)GetQuestionRecoredList:(NSMutableDictionary *)parmDic { + + //selectSessionListByDoctorId + [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-consultation/api/consult/conSession/selectSessionListByDoctorIdNew",Http] params:parmDic]; +} + +#pragma mark:咨询详情 +- (void)GetRecoredQuestionDetail:(NSMutableDictionary *)pamraDic { + + [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-consultation/api/consult/conSession/sessionDetailDoctorAll",Http] params:pamraDic]; + +} +- (void)getBodyReportDeatil:(NSMutableDictionary *)parmDic { + +// [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@cqyt/middleController/getCheckItemBySfzhNewNew",Http] params:parmDic]; + [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-archives/historyReport/selectNewHealthReport",Http] params:parmDic]; + +} +//拒绝理由 +- (void)GetCancelReasourData:(NSMutableDictionary *)pamraDic { + + [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-consultation/api/consult/conSession/selectRejectReason",Http] params:pamraDic]; + +} +//开始视频 + +- (void)getSendVideoStart:(NSMutableDictionary *)pamraDic { + +// GET https://cqyt.test.yg.icdat.cn/health-consultation/api/consult/conSessionVideoInfo/startVideoSession?sessionId=1778696654498156546 HTTP/1.1 + [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-consultation/api/consult/conSessionVideoInfo/startVideoSession",Http] params:pamraDic]; + +} +//确认拒绝 +- (void)submitCancelreasourData:(NSMutableDictionary *)pamraDic { + + [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-consultation/api/consult/conSession/sessionReject",Http] params:pamraDic]; + +} +- (void)fileDetatilData:(NSMutableDictionary *)pamraDic { + + [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-consultation/api/consult/medicalRecords/selectConMedicalRecordsByIdDoctor",Http] params:pamraDic]; +} + +//提现详情 +- (void)withDrawDetailsData:(NSMutableDictionary *)pamraDic { + + [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-consultation/api/consult/conCostStatistics/queryById",Http] params:pamraDic]; +} + +- (void)getAgainSessionReservationDate:(NSMutableDictionary *)parmDic { + + [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-consultation/api/consult/sessionReservationDate/sessionReservationDate",Http] params:parmDic]; + +} + + +//查询体检信息(整合,带正常异常数量) + +- (void)GetPhyscialSearchAnomalyData:(NSMutableDictionary *)parmDic { + + [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/cqyt/middleController/getCheckItemBySfzhTotal/",Http] params:parmDic]; + +} + +#pragma mark:暂停公告 + +//暂停公告发布 +- (void)GetPublishServerMessage:(NSMutableDictionary *)pamraDic { + + [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-consultation/conDoctor/getServiceByDoctorId",Http] params:pamraDic]; + +} +//暂停公告列表 +- (void)GetSPublishServerRecored:(NSMutableDictionary *)pamraDic { + + [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-consultation/api/consult/conService/list",Http] params:pamraDic]; + +} +//编辑公告状态 +- (void)GetChangePublishServer:(NSMutableDictionary *)pamraDic { + + [httpRequest httpPostRequest:[NSString stringWithFormat:@"%@/health-consultation/api/consult/conService/edit",Http] params:pamraDic]; + +} + +//发布公告状态 +- (void)PostStopPublishServer:(NSMutableDictionary *)pamraDic { + + [httpRequest httpPostRequest:[NSString stringWithFormat:@"%@/health-consultation/api/consult/conService/add",Http] params:pamraDic]; + +} +//查询停诊原因 +- (void)GetPublishServerReason:(NSMutableDictionary *)pamraDic { + + [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-consultation/api/consult/conDoctor/selectDictList",Http] params:pamraDic]; + +} +//查询当前咨询数量 +- (void)GetCurrentServerNumber:(NSMutableDictionary *)pamraDic { + + [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-consultation/api/consult/conSession/selectSessionVideoExistDoctor",Http] params:pamraDic]; + +} + +//上传图片 +- (void)postImageArrayUpload:(NSArray *)imageArray { + + [httpRequest upLoadDataWithUrlStr:[NSString stringWithFormat:@"%@/sys/upload/uploadFileMany",Http] params:nil withDataArray:imageArray]; +} +//更新头像 +- (void)updateUserAvatar:(NSMutableDictionary *)parmDic { + + [httpRequest httpPostRequest:[NSString stringWithFormat:@"%@/sys/user/updateUserAvatar",Http] params:parmDic]; +} +#pragma mark - 登录注册 +- (void)PostLogin:(NSMutableDictionary *)parmDic { + + [httpRequest httpPostRequest:[NSString stringWithFormat:@"%@/health-consultation/conDoctor/loginDoctor",Http] params:parmDic]; + +} +- (void)getUserAgreementPrivacy:(NSMutableDictionary *)parmDic { + + //GET https://cqyt.test.yg.icdat.cn/health-consultation/api/consult/conDoctor/selectDictList?dictKey=jump_url HTTP/1.1 + [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-consultation/api/consult/conDoctor/selectDictList?dictKey=jump_url",Http] params:parmDic]; + + +} +/* + IM登录 + */ +- (void)GetIMLoginAccount:(NSMutableDictionary *)pamraDic { + + [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-im/wnapp/userSigAndroid",Http] params:pamraDic]; +} + +- (void)PostGroupIDArray:(NSMutableDictionary *)parmDic { + +// POST https://starry.test.icdat.cn/health-consultation/api/consult/conSession/selectSessionByImIdNew HTTP/1.1 + [httpRequest httpPostRequest:[NSString stringWithFormat:@"%@/health-consultation/api/consult/conSession/selectSessionByImIdNewNew",Http] params:parmDic]; +} + +#pragma mark:我的 +- (void)GetInquireDoctorRoomInfo:(NSMutableDictionary *)pamraDic { + +// GET https://cqyt.test.yg.icdat.cn/health-consultation/api/consult/conSicks/selectSickListByDepartmentIdDoctorSearch?departmentId=1677938163633926145 HTTP/1.1 + [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-consultation/api/consult/conSicks/selectSickListByDepartmentIdDoctorSearch",Http] params:pamraDic]; + +} + +- (void)GetBillListData:(NSMutableDictionary *)pamraDic { + // + [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-consultation/api/consult/conCostStatistics/findlistpage",Http] params:pamraDic]; +} + +//修改密码 +- (void)updateDoctorLoginPassword:(NSMutableDictionary *)pamraDic { + //T https://cqyt.test.yg.icdat.cn/health-consultation/api/consult/conDoctor/updatePassword + [httpRequest httpPUTCacheRequest:[NSString stringWithFormat:@"%@/health-consultation/api/consult/conDoctor/updatePassword",Http] params:pamraDic]; +} + +- (void)postResetUserNewPassword:(NSMutableDictionary *)parmDic { + + [httpRequest httpPostRequest:[NSString stringWithFormat:@"%@/health-system/api/anon/sys/resetUserPwd",Http] params:parmDic]; + +} + +- (void)postSetUserPassword:(NSMutableDictionary *)parmDic { + + [httpRequest httpPostRequest:[NSString stringWithFormat:@"%@/health-system/api/anon/sys/checkUser",Http] params:parmDic]; + +} +- (void)getVesionHideRegis:(NSMutableDictionary *)parmDic { + + [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-system/sys/api/notice/selectIosUpdate",Http] params:parmDic]; +} + +//获取体检语音 +- (void)docotorReportListAudioResource:(NSMutableDictionary *)parmDic{ + [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-archives/historyReport/getVoiceUrl",Http] params:parmDic]; + +} +- (void)docotorReportListHistoryDoctorAudioResource:(NSMutableDictionary *)parmDic{ + [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-archives/historyReport/convertVoice2",Http] params:parmDic]; + +} +- (void)GetDoctorPhyscialIDCardSearch:(NSMutableDictionary *)parmDic { + + [httpRequest httpPostRequest:[NSString stringWithFormat:@"%@/health-archives/historyReport/getHistoryReportByPage",Http] params:parmDic]; + +} +- (void)getHistoryReportById:(NSMutableDictionary *)parmDic { + + [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-archives/historyReport/getHistoryReportById",Http] params:parmDic]; + +} + +- (void)getendVideoReportById:(NSMutableDictionary *)parmDic { + +// GET https://cqyt.test.yg.icdat.cn/health-consultation/api/consult/sessionReservationDate/endPhone?id=1780071436959469569 HTTP/1.1 + + [httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-consultation/api/consult/sessionReservationDate/endPhone",Http] params:parmDic]; + +} + +//结束咨询 +- (void)getABMUpdate:(NSMutableDictionary *)parmDic { + + [httpRequest httpGetRequest:@"https://base.icdat.cn/latest" params:parmDic]; + +} + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Manager/NetworkingManager/YXNetworkingWithCache.m b/DoctorXinjiang/DoctorXinjiang/Manager/NetworkingManager/YXNetworkingWithCache.m index 4e581f7..fa965d3 100755 --- a/DoctorXinjiang/DoctorXinjiang/Manager/NetworkingManager/YXNetworkingWithCache.m +++ b/DoctorXinjiang/DoctorXinjiang/Manager/NetworkingManager/YXNetworkingWithCache.m @@ -146,7 +146,7 @@ typedef NS_ENUM(NSInteger, RequestType) { if ([statusCode containsString:@"(401)"]) { DLog(@"%@",error.userInfo); [MBProgressHUD showErrorMessage:@"身份验证过期"]; - [HQCommonUtils keyedArchiverWithData:nil key:LoginUserInfo]; + [XJDCommonUtils keyedArchiverWithData:nil key:LoginUserInfo]; KPostNotification(KNotificationLoginStateChange, @NO); }else{ [MBProgressHUD showErrorMessage:@"网络服务错误"]; @@ -165,7 +165,7 @@ typedef NS_ENUM(NSInteger, RequestType) { if ([statusCode containsString:@"(401)"]) { DLog(@"%@",error.userInfo); [EasyTextView showErrorText:@"身份验证过期"]; - [HQCommonUtils keyedArchiverWithData:nil key:LoginUserInfo]; + [XJDCommonUtils keyedArchiverWithData:nil key:LoginUserInfo]; KPostNotification(KNotificationLoginStateChange, @NO); }else { @@ -186,7 +186,7 @@ typedef NS_ENUM(NSInteger, RequestType) { if ([statusCode containsString:@"(401)"]) { DLog(@"%@",error.userInfo); [EasyTextView showErrorText:@"身份验证过期"]; - [HQCommonUtils keyedArchiverWithData:nil key:LoginUserInfo]; + [XJDCommonUtils keyedArchiverWithData:nil key:LoginUserInfo]; KPostNotification(KNotificationLoginStateChange, @NO); } else @@ -311,7 +311,7 @@ typedef NS_ENUM(NSInteger, RequestType) { } if (flag == true) { - DLog(@" 返回Json\n%@\n %@", [HQCommonUtils DataTOjsonString:response],url); + DLog(@" 返回Json\n%@\n %@", [XJDCommonUtils DataTOjsonString:response],url); if ([response.allKeys containsObject:@"result"]) { [self showSuccess:[response objectForKey:@"result"]]; } diff --git a/DoctorXinjiang/DoctorXinjiang/Manager/UserManager/XJDKeychainTool.h b/DoctorXinjiang/DoctorXinjiang/Manager/UserManager/XJDKeychainTool.h new file mode 100755 index 0000000..ca48ea9 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Manager/UserManager/XJDKeychainTool.h @@ -0,0 +1,36 @@ + +// XJDKeychainTool.h +// idleBuy +// +// Created by ios on 2018/5/28. +// Copyright © 2018年 ios. All rights reserved. +#import +#import + +@interface XJDKeychainTool : NSObject +/** + * 储存字符串到🔑钥匙串 + * + * @param sValue 对应的Value + * @param sKey 对应的Key + */ ++ (void)saveKeychainValue:(NSString *)sValue key:(NSString *)sKey; + + +/** + * 从🔑钥匙串获取字符串 + * + * @param sKey 对应的Key + * + * @return 返回储存的Value + */ ++ (NSString *)readKeychainValue:(NSString *)sKey; + + +/** + * 从🔑钥匙串删除字符串 + * + * @param sKey 对应的Key + */ ++ (void)deleteKeychainValue:(NSString *)sKey; +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Manager/UserManager/XJDKeychainTool.m b/DoctorXinjiang/DoctorXinjiang/Manager/UserManager/XJDKeychainTool.m new file mode 100755 index 0000000..2afa822 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Manager/UserManager/XJDKeychainTool.m @@ -0,0 +1,56 @@ + +// NewLottery +// +// Created by 孙号斌 on 2017/2/14. +// Copyright © 2017年 孙号斌. All rights reserved. +// + +#import "XJDKeychainTool.h" + +@implementation XJDKeychainTool ++ (NSMutableDictionary *)getKeychainQuery:(NSString *)service{ + return [NSMutableDictionary dictionaryWithObjectsAndKeys: + (__bridge_transfer id)kSecClassGenericPassword, + (__bridge_transfer id)kSecClass,service, + (__bridge_transfer id)kSecAttrService,service, + (__bridge_transfer id)kSecAttrAccount, + (__bridge_transfer id)kSecAttrAccessibleAfterFirstUnlock, + (__bridge_transfer id)kSecAttrAccessible, + nil]; +} + ++ (void)saveKeychainValue:(NSString *)sValue key:(NSString *)sKey{ + NSMutableDictionary * keychainQuery = [self getKeychainQuery:sKey]; + SecItemDelete((__bridge_retained CFDictionaryRef)keychainQuery); + + [keychainQuery setObject:[NSKeyedArchiver archivedDataWithRootObject:sValue] forKey:(__bridge_transfer id)kSecValueData]; + + SecItemAdd((__bridge_retained CFDictionaryRef)keychainQuery, NULL); + +} + ++ (NSString *)readKeychainValue:(NSString *)sKey +{ + NSString *ret = nil; + NSMutableDictionary *keychainQuery = [self getKeychainQuery:sKey]; + [keychainQuery setObject:(id)kCFBooleanTrue forKey:(__bridge_transfer id)kSecReturnData]; + [keychainQuery setObject:(__bridge_transfer id)kSecMatchLimitOne forKey:(__bridge_transfer id)kSecMatchLimit]; + CFDataRef keyData = NULL; + if (SecItemCopyMatching((__bridge CFDictionaryRef)keychainQuery, (CFTypeRef *)&keyData) == noErr) { + @try { + ret = (NSString *)[NSKeyedUnarchiver unarchiveObjectWithData:(__bridge NSData *)keyData]; + } @catch (NSException *e) { + NSLog(@"Unarchive of %@ failed: %@", sKey, e); + } @finally { + } + } + if (keyData) + CFRelease(keyData); + return ret; +} ++ (void)deleteKeychainValue:(NSString *)sKey { + NSMutableDictionary *keychainQuery = [self getKeychainQuery:sKey]; + SecItemDelete((__bridge CFDictionaryRef)keychainQuery); +} + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Manager/UserManager/XJDUserInfo.h b/DoctorXinjiang/DoctorXinjiang/Manager/UserManager/XJDUserInfo.h new file mode 100755 index 0000000..c056ba6 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Manager/UserManager/XJDUserInfo.h @@ -0,0 +1,38 @@ +// +// XJDUserInfo.h +// idleBuy +// +// Created by ios on 2018/5/30. +// Copyright © 2018年 ios. All rights reserved. +// + +#import + +@interface XJDUserInfo : NSObject + +@property (nonatomic, strong) NSDictionary *userInfo; + +@property (nonatomic, copy) NSString * user_id; +@property (nonatomic, copy) NSString * username; +@property (nonatomic, copy) NSString * realname; +@property (nonatomic, copy) NSString * avatar; +@property (nonatomic, copy) NSString * phone; +@property (nonatomic, copy) NSString * orgCode; +@property (nonatomic, copy) NSString * sex; +@property (nonatomic, copy) NSString * loginTenantId; +@property (nonatomic, copy) NSString * status_dictText; +@property (nonatomic, copy) NSString * delFlag; +@property (nonatomic, copy) NSString * workNo; +@property (nonatomic, copy) NSString * idCard; +@property (nonatomic, copy) NSString * sex_dictText; +@property (nonatomic, copy) NSString * email; + +@property (nonatomic, copy) NSString * status; +@property (nonatomic, copy) NSString * depart; +@property (nonatomic, copy) NSString * personType_dictText; +@property (nonatomic, copy) NSString * createTime; + +@property (nonatomic, copy) NSString * token; + + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Manager/UserManager/XJDUserInfo.m b/DoctorXinjiang/DoctorXinjiang/Manager/UserManager/XJDUserInfo.m new file mode 100755 index 0000000..25b62ea --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Manager/UserManager/XJDUserInfo.m @@ -0,0 +1,73 @@ +// +// YXUserInfo.m +// idleBuy +// +// Created by ios on 2018/5/30. +// Copyright © 2018年 ios. All rights reserved. +// + +#import "XJDUserInfo.h" + +@implementation XJDUserInfo +- (void)encodeWithCoder:(NSCoder *)aCoder +{ + [aCoder encodeObject:self.userInfo forKey:@"userInfo"]; + [aCoder encodeObject:self.user_id forKey:@"user_id"]; + [aCoder encodeObject:self.avatar forKey:@"avatar"]; + [aCoder encodeObject:self.username forKey:@"username"]; + [aCoder encodeObject:self.realname forKey:@"realname"]; + [aCoder encodeObject:self.phone forKey:@"phone"]; + [aCoder encodeObject:self.idCard forKey:@"idCard"]; + [aCoder encodeObject:self.status forKey:@"status"]; + [aCoder encodeObject:self.workNo forKey:@"workNo"]; + [aCoder encodeObject:self.token forKey:@"token"]; + [aCoder encodeObject:self.sex_dictText forKey:@"sex_dictText"]; + + + +} +- (id)initWithCoder:(NSCoder *)aDecoder +{ + self = [super init]; + if (self) + { + self.userInfo = [aDecoder decodeObjectForKey:@"userInfo"]; + self.user_id = [aDecoder decodeObjectForKey:@"user_id"]; + self.avatar = [aDecoder decodeObjectForKey:@"avatar"]; + self.username = [aDecoder decodeObjectForKey:@"username"]; + self.realname = [aDecoder decodeObjectForKey:@"realname"]; + self.phone = [aDecoder decodeObjectForKey:@"phone"]; + self.idCard = [aDecoder decodeObjectForKey:@"idCard"]; + self.token = [aDecoder decodeObjectForKey:@"token"]; + self.status = [aDecoder decodeObjectForKey:@"status"]; + self.workNo = [aDecoder decodeObjectForKey:@"workNo"]; + self.sex_dictText = [aDecoder decodeObjectForKey:@"sex_dictText"]; + + } + return self; +} + + +- (void)setUserInfo:(NSDictionary *)userInfo { + + _userInfo = userInfo; + self.user_id = [_userInfo objectForKey:@"id"]; + self.avatar = [NSString stringWithFormat:@"%@%@",ResourceAddress,[_userInfo objectForKey:@"avatar"]]; + self.phone = [_userInfo objectForKey:@"phone"]; + self.realname = [_userInfo objectForKey:@"realname"]; + self.username = [_userInfo objectForKey:@"username"]; + self.sex = [_userInfo objectForKey:@"sex"]; + self.status = [_userInfo objectForKey:@"status"]; + self.email = [_userInfo objectForKey:@"email"]; + self.idCard = [_userInfo objectForKey:@"idCard"]; + self.workNo = [_userInfo objectForKey:@"workNo"]; + self.sex_dictText = [_userInfo objectForKey:@"sex_dictText"]; +} + + +-(void)setToken:(NSString *)token { + _token = token; + +} + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/AppDelegate/AppDelegate+AppService.m b/DoctorXinjiang/DoctorXinjiang/Project/AppDelegate/AppDelegate+AppService.m index 373a5eb..5e47220 100644 --- a/DoctorXinjiang/DoctorXinjiang/Project/AppDelegate/AppDelegate+AppService.m +++ b/DoctorXinjiang/DoctorXinjiang/Project/AppDelegate/AppDelegate+AppService.m @@ -7,7 +7,7 @@ #import "AppDelegate+AppService.h" #import "YXBaseTabBarController.h" -#import "YXLoginViewController.h" +#import "XJDLoginViewController.h" #import #import #import @@ -30,7 +30,7 @@ selector:@selector(loginStateChange:) name:KNotificationLoginStateChange object:nil]; - if ([HQCommonUtils isLogin]) { + if ([XJDCommonUtils isLogin]) { //腾讯im V2TIMSDKConfig *config = [[V2TIMSDKConfig alloc] init]; @@ -46,13 +46,13 @@ self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; self.window.backgroundColor = KWhiteColor; //直接进入显示登录页面 - if ([HQCommonUtils isLogin]) { + if ([XJDCommonUtils isLogin]) { self.mainTabBar = [YXBaseTabBarController new]; self.mainTabBar.delegate =self; self.window.rootViewController = self.mainTabBar; [self.window makeKeyAndVisible]; }else { - YXLoginViewController * loginvc = [[YXLoginViewController alloc] init]; + XJDLoginViewController * loginvc = [[XJDLoginViewController alloc] init]; YXBaseNavigationController * nav = [[YXBaseNavigationController alloc] initWithRootViewController:loginvc]; self.window.rootViewController = nav; } @@ -110,7 +110,7 @@ paragraphStyle.alignment = NSTextAlignmentLeft; - NSMutableAttributedString *message = [[NSMutableAttributedString alloc] initWithString:@"\n亲,感谢您对健康咨询专家端一直以来的信任!我们依据最新的监管要求更新了健康咨询专家端《隐私权政策》,特向您说明如下\n1.为向您提供交易相关基本功能,我们会收集、使用必要的信息;\n2.基于您的明示授权,我们可能会获取您的位置(为您提供服务)等信息,您有权拒绝或取消授权;\n3.我们会采取业界先进的安全措施保护您的信息安全;\n4.未经您同意,我们不会从第三方处获取、共享或向提供您的信息;" attributes:@{ + NSMutableAttributedString *message = [[NSMutableAttributedString alloc] initWithString:@"\n亲,感谢您对健康油我专家端一直以来的信任!我们依据最新的监管要求更新了健康油我专家端《隐私权政策》,特向您说明如下\n1.为向您提供交易相关基本功能,我们会收集、使用必要的信息;\n2.基于您的明示授权,我们可能会获取您的位置(为您提供服务)等信息,您有权拒绝或取消授权;\n3.我们会采取业界先进的安全措施保护您的信息安全;\n4.未经您同意,我们不会从第三方处获取、共享或向提供您的信息;" attributes:@{ NSParagraphStyleAttributeName:paragraphStyle, }]; @@ -184,19 +184,11 @@ } - -- (void)loginImAccount { - - YXNetAPI * proctocolApi = [[YXNetAPI alloc] init:self tag:@"loginIMAPI" NeedToken:nil]; - [proctocolApi GetIMLoginAccount:nil]; - -} - //在线时票据过期:此时您需要生成新的 userSig,并再次重新调用初始化。 - (void)onKickedOffline { - [HQCommonUtils keyedArchiverWithData:nil key:LoginUserInfo]; + [XJDCommonUtils keyedArchiverWithData:nil key:LoginUserInfo]; [ESCTUIManager outLoginTUISDK]; KPostNotification(KNotificationLoginStateChange, @NO); diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Base/HQBaseTabBarController.h b/DoctorXinjiang/DoctorXinjiang/Project/Base/HQBaseTabBarController.h deleted file mode 100644 index 3d9869c..0000000 --- a/DoctorXinjiang/DoctorXinjiang/Project/Base/HQBaseTabBarController.h +++ /dev/null @@ -1,25 +0,0 @@ -// -// YXBaseTabBarController.h -// healthQuestion -// -// Created by xulei on 2022/8/12. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface YXBaseTabBarController : UITabBarController - -/** - 设置小红点 - - @param index tabbar下标 - @param isShow 是显示还是隐藏 - */ --(void)setRedDotWithIndex:(NSInteger)index isShow:(BOOL)isShow isNumber:(NSInteger)number; - -@property (nonatomic, assign)NSInteger lastSelectIndex; -@end - -NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Base/HQBaseWebViewController.h b/DoctorXinjiang/DoctorXinjiang/Project/Base/HQBaseWebViewController.h deleted file mode 100644 index 689fa98..0000000 --- a/DoctorXinjiang/DoctorXinjiang/Project/Base/HQBaseWebViewController.h +++ /dev/null @@ -1,42 +0,0 @@ -// -// YXBaseWebViewController.h -// healthQuestion -// -// Created by 仁康信息 on 2024/1/12. -// - -#import "YXBaseViewController.h" - -#import -#import - - -NS_ASSUME_NONNULL_BEGIN - -typedef enum { - WkJSMessageTypeDefault = 0, - WkJSMessageTypeBack = 1, -}WkJSMessageType; -typedef enum { - RightDefaultType = 0, - RightCompleteType = 1, -}RightNavType; - -@protocol WebJSExport - -- (void)startFunction; -@end - -@interface YXBaseWebViewController : YXBaseViewController - -@property (nonatomic, strong) NSString *webUrl; -@property (nonatomic, strong) NSString *webTitle; -@property (nonatomic, strong) JSContext *context; -@property (nonatomic, strong) WKWebView *wkWebView; -@property (nonatomic, assign) RightNavType rightType; - -- (void)webViewRequest; - -@end - -NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Base/YXBaseTabBarController.m b/DoctorXinjiang/DoctorXinjiang/Project/Base/YXBaseTabBarController.m index 1d7d316..065e21b 100644 --- a/DoctorXinjiang/DoctorXinjiang/Project/Base/YXBaseTabBarController.m +++ b/DoctorXinjiang/DoctorXinjiang/Project/Base/YXBaseTabBarController.m @@ -7,8 +7,8 @@ #import "YXBaseTabBarController.h" #import "HQTabBar.h" -#import "YXHomePageViewController.h" -#import "YXMineViewController.h" +#import "XJDHomePageViewController.h" +#import "XJDMineViewController.h" @interface YXBaseTabBarController () @@ -86,13 +86,13 @@ -(void)setUpAllChildViewController{ _VCS = @[].mutableCopy; - YXHomePageViewController *homeVC = [[YXHomePageViewController alloc]init]; + XJDHomePageViewController *homeVC = [[XJDHomePageViewController alloc]init]; [self setupChildViewController:homeVC title:@"工作台" imageName:@"homeTabar_nomarl" seleceImageName:@"homeTabar_selected"]; - YXMineViewController *mineVC = [[YXMineViewController alloc]init]; + XJDMineViewController *mineVC = [[XJDMineViewController alloc]init]; [self setupChildViewController:mineVC title:@"我的" imageName:@"mianTabar_nomarl" seleceImageName:@"mianTabar_selected"]; self.viewControllers = _VCS; diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Base/YXBaseViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/Base/YXBaseViewController.m index 354eb30..d0a0e8a 100644 --- a/DoctorXinjiang/DoctorXinjiang/Project/Base/YXBaseViewController.m +++ b/DoctorXinjiang/DoctorXinjiang/Project/Base/YXBaseViewController.m @@ -6,7 +6,7 @@ // #import "YXBaseViewController.h" -#import "YXLoginViewController.h" +#import "XJDLoginViewController.h" @interface YXBaseViewController () @@ -85,7 +85,7 @@ }else { - YXLoginViewController *loginVC = [[YXLoginViewController alloc]init]; + XJDLoginViewController *loginVC = [[XJDLoginViewController alloc]init]; UINavigationController * nav = [[UINavigationController alloc] initWithRootViewController:loginVC]; [[kAppDelegate getCurrentVC] presentViewController:nav animated:YES completion:nil]; } diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HQPopView/XJDShowPromptPopView.h b/DoctorXinjiang/DoctorXinjiang/Project/HQPopView/XJDShowPromptPopView.h new file mode 100644 index 0000000..b3dc7b1 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HQPopView/XJDShowPromptPopView.h @@ -0,0 +1,16 @@ +// +// XJDShowPromptPopView.h +// healthQuestion +// +// Created by 仁康信息 on 2022/9/28. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDShowPromptPopView : UIView + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HQPopView/XJDShowPromptPopView.m b/DoctorXinjiang/DoctorXinjiang/Project/HQPopView/XJDShowPromptPopView.m new file mode 100644 index 0000000..bcdcf55 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HQPopView/XJDShowPromptPopView.m @@ -0,0 +1,134 @@ +// +// XJDShowPromptPopView.m +// healthQuestion +// +// Created by 仁康信息 on 2022/9/28. +// + +#import "XJDShowPromptPopView.h" + +@implementation XJDShowPromptPopView + +- (instancetype)initWithFrame:(CGRect)frame { + + if (self = [super initWithFrame:frame]) { + + [self createUI]; + } + + return self; + +} + +- (void)createUI { + + UIView * backView = [[UIView alloc] initWithFrame:self.frame]; + backView.backgroundColor = UIColorBackground; + [self addSubview:backView]; + + UIImageView * popImageView = [[UIImageView alloc] initWithImage:IMAGE_NAMED(@"popCenterImg")]; + popImageView.userInteractionEnabled = true; + [backView addSubview:popImageView]; + + [popImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(kRealValue(260)); + make.width.mas_equalTo(kScreenWidth - 47); + make.centerX.mas_equalTo(self); + }]; + + UILabel * titLabel = [[UILabel alloc] init]; + titLabel.text = @"提示"; + titLabel.textColor = CFontColor1; + titLabel.font = BOLDSYSTEMFONT(16); + titLabel.textAlignment = NSTextAlignmentCenter; + [popImageView addSubview:titLabel]; + + [titLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(kRealValue(107)); + make.width.mas_equalTo(popImageView); + make.centerX.mas_equalTo(self); + }]; + + UILabel * detailLabel = [[UILabel alloc] init]; + detailLabel.text = @"本人郑重承诺,认真履行自主防疫责任,填报相关内容全部属实"; + detailLabel.textColor = CFontColor1; + detailLabel.font = BOLDSYSTEMFONT(16); + detailLabel.numberOfLines = 2; + detailLabel.textAlignment = NSTextAlignmentCenter; + [popImageView addSubview:detailLabel]; + + [detailLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(titLabel.mas_bottom).offset(20); + make.height.mas_equalTo(40); + make.left.mas_equalTo(popImageView.mas_left).offset(50.5); + make.right.mas_equalTo(popImageView.mas_right).offset(-40.5); + }]; + + UIButton * cancalBtn = [[UIButton alloc] init]; + [cancalBtn setTitle:@"取消" forState:UIControlStateNormal]; + [cancalBtn setTitleColor:UIColorHex(#394356) forState:UIControlStateNormal]; + [cancalBtn addTarget:self action:@selector(cancelClick) forControlEvents: UIControlEventTouchUpInside]; + [popImageView addSubview:cancalBtn]; + + [cancalBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.mas_equalTo(@0); + make.left.mas_equalTo(popImageView.mas_left).offset(35); + make.height.mas_equalTo(50); + make.width.mas_equalTo((popImageView.width-20)/2); + }]; + + + UIButton * sureBtn = [[UIButton alloc] init]; + [sureBtn setTitleColor:UIColorHex(#77849E) forState:UIControlStateNormal]; + sureBtn.titleLabel.font = SYSTEMFONT(17); + [popImageView addSubview:sureBtn]; + + [sureBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.mas_equalTo(@0); + make.left.mas_equalTo(cancalBtn.mas_right); + make.height.mas_equalTo(50); + make.width.mas_equalTo(cancalBtn); + }]; + + + + + __block int timeout=3; //倒计时时间 + dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); + dispatch_source_t _timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0,queue); + dispatch_source_set_timer(_timer,dispatch_walltime(NULL, 0),1.0*NSEC_PER_SEC, 0); //每秒执行 + dispatch_source_set_event_handler(_timer, ^{ + if(timeout<=0){ //倒计时结束,关闭 + dispatch_source_cancel(_timer); + dispatch_async(dispatch_get_main_queue(), ^{ + //设置界面的按钮显示 根据自己需求设置 + [sureBtn setTitleColor:UIColorMain forState:UIControlStateNormal]; + [sureBtn setTitle:@"确定" forState:UIControlStateNormal]; + [sureBtn addTarget:self action:@selector(cancelClick) forControlEvents:UIControlEventTouchUpInside]; + sureBtn.userInteractionEnabled = YES; + }); + }else{ + int seconds = timeout; + NSString *strTime = [NSString stringWithFormat:@"%.2d", seconds]; + dispatch_async(dispatch_get_main_queue(), ^{ + //让按钮变为不可点击的灰色 + sureBtn.userInteractionEnabled = NO; + //设置界面的按钮显示 根据自己需求设置 + [UIView beginAnimations:nil context:nil]; + [UIView setAnimationDuration:1]; + [sureBtn setTitle:[NSString stringWithFormat:@"%@秒后点击确认",strTime] forState:UIControlStateNormal]; + [UIView commitAnimations]; + }); + timeout--; + } + }); + dispatch_resume(_timer); +} + +- (void)cancelClick { + + [self removeFromSuperview]; +} + + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/FileDataDetail(档案详情)/XJDFileDataDetailViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/FileDataDetail(档案详情)/XJDFileDataDetailViewController.m index b3ae43e..27ba6a4 100644 --- a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/FileDataDetail(档案详情)/XJDFileDataDetailViewController.m +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/FileDataDetail(档案详情)/XJDFileDataDetailViewController.m @@ -6,22 +6,22 @@ // #import "XJDFileDataDetailViewController.h" -#import "DetailTitleView.h" -#import "DetailUserInfoView.h" -#import "FileDataDeatilCenterView.h" -#import "BasicHealthInfoView.h" -#import "YXRecoredListDetailModel.h" +#import "XJDDetailTitleView.h" +#import "XJDDetailUserInfoView.h" +#import "XJDFileDataDeatilCenterView.h" +#import "XJDBasicHealthInfoView.h" +#import "XJDRecoredListDetailModel.h" @interface XJDFileDataDetailViewController () -@property (nonatomic, strong) DetailUserInfoView * infoView ; +@property (nonatomic, strong) XJDDetailUserInfoView * infoView ; -@property (nonatomic, strong) FileDataDeatilCenterView * detailView ; +@property (nonatomic, strong) XJDFileDataDeatilCenterView * detailView ; -@property (nonatomic, strong) BasicHealthInfoView * healthView; +@property (nonatomic, strong) XJDBasicHealthInfoView * healthView; -@property (nonatomic, strong) DetailTitleView * titleview; +@property (nonatomic, strong) XJDDetailTitleView * titleview; @end @@ -54,27 +54,27 @@ mainScrollView.backgroundColor = KClearColor; [self.view addSubview:mainScrollView]; - DetailTitleView * titleview = [[DetailTitleView alloc] initWithFrame:CGRectMake(0, 0, mainScrollView.width, 33)]; + XJDDetailTitleView * titleview = [[XJDDetailTitleView alloc] initWithFrame:CGRectMake(0, 0, mainScrollView.width, 33)]; self.titleview = titleview; [mainScrollView addSubview:titleview]; //个人信息 - DetailUserInfoView * infoView = [[DetailUserInfoView alloc] initWithFrame:CGRectMake(0, titleview.bottom, kScreenWidth - kRealValue(30), kRealValue(103))]; + XJDDetailUserInfoView * infoView = [[XJDDetailUserInfoView alloc] initWithFrame:CGRectMake(0, titleview.bottom, kScreenWidth - kRealValue(30), kRealValue(103))]; self.infoView = infoView; infoView.backgroundColor = KWhiteColor; [mainScrollView addSubview:infoView]; //问题 - FileDataDeatilCenterView * detailView = [[FileDataDeatilCenterView alloc] initWithFrame:CGRectMake(0, infoView.bottom + kRealValue(10), mainScrollView.width, 500)]; + XJDFileDataDeatilCenterView * detailView = [[XJDFileDataDeatilCenterView alloc] initWithFrame:CGRectMake(0, infoView.bottom + kRealValue(10), mainScrollView.width, 500)]; [mainScrollView addSubview:detailView]; detailView.height = detailView.questionH; detailView.layer.cornerRadius = 10; self.detailView = detailView; - [HQCommonUtils addShadowToView:detailView]; + [XJDCommonUtils addShadowToView:detailView]; - BasicHealthInfoView * healthView = [[BasicHealthInfoView alloc] initWithFrame:CGRectMake(0,detailView.bottom + kRealValue(15), kScreenWidth - kRealValue(30), kRealValue(280))]; + XJDBasicHealthInfoView * healthView = [[XJDBasicHealthInfoView alloc] initWithFrame:CGRectMake(0,detailView.bottom + kRealValue(15), kScreenWidth - kRealValue(30), kRealValue(280))]; healthView.backgroundColor = [UIColor whiteColor]; healthView.layer.cornerRadius = 10.0; - [HQCommonUtils addShadowToView:healthView]; + [XJDCommonUtils addShadowToView:healthView]; self.healthView = healthView; [mainScrollView addSubview:healthView]; @@ -88,7 +88,7 @@ [parmDic setObject:self.record_id forKey:@"id"]; - YXNetAPI * recordApi = [[YXNetAPI alloc] init:self tag:@"RECORD" NeedToken:@""]; + XJDNetAPI * recordApi = [[XJDNetAPI alloc] init:self tag:@"RECORD" NeedToken:@""]; [recordApi fileDetatilData:parmDic]; } @@ -108,13 +108,13 @@ NSDictionary * dic = response; - YXRecoredListDetailModel * model = [YXRecoredListDetailModel modelWithDictionary:dic]; + XJDRecoredListDetailModel * model = [XJDRecoredListDetailModel modelWithDictionary:dic]; //用户信息 - YXReocrdconFamilyMembersDO * infoModel = [YXReocrdconFamilyMembersDO modelWithDictionary:model.conFamilyMembersDO]; + XJDReocrdconFamilyMembersDO * infoModel = [XJDReocrdconFamilyMembersDO modelWithDictionary:model.conFamilyMembersDO]; self.infoView.userInfo = infoModel; //档案详情 - YXRecoredconMedicalRecordsListDO * medicalModel = [YXRecoredconMedicalRecordsListDO modelWithDictionary:model.conMedicalRecordsDO]; + XJDRecoredconMedicalRecordsListDO * medicalModel = [XJDRecoredconMedicalRecordsListDO modelWithDictionary:model.conMedicalRecordsDO]; self.detailView.medicalModel = medicalModel; self.titleview.createTime = medicalModel.createTime; @@ -143,15 +143,15 @@ // //#import "XJDFileDataDetailViewController.h" -//#import "DetailTitleView.h" +//#import "XJDDetailTitleView.h" //#import "DetailUserInfoView.h" -//#import "FileDataDeatilCenterView.h" -//#import "BasicHealthInfoView.h" +//#import "XJDFileDataDeatilCenterView.h" +//#import "XJDBasicHealthInfoView.h" //#import "XLPhotoBrowser.h" //#import "DoctorReportModel.h" //@interface XJDFileDataDetailViewController () // -//@property (nonatomic, strong) DetailTitleView * titleview; +//@property (nonatomic, strong) XJDDetailTitleView * titleview; // // //@property (nonatomic, strong) UIScrollView * mainScrollView; @@ -240,11 +240,11 @@ // mainScrollView.backgroundColor = KClearColor; // [self.view addSubview:mainScrollView]; // -// DetailTitleView * titleview = [[DetailTitleView alloc] initWithFrame:CGRectMake(0, 0, mainScrollView.width, 33)]; +// XJDDetailTitleView * titleview = [[XJDDetailTitleView alloc] initWithFrame:CGRectMake(0, 0, mainScrollView.width, 33)]; // self.titleview = titleview; // [mainScrollView addSubview:titleview]; // -// DetailUserInfoView * infoView = [[DetailUserInfoView alloc] initWithFrame:CGRectMake(0, titleview.bottom, kScreenWidth - kRealValue(30), kRealValue(103))]; +// XJDDetailUserInfoView * infoView = [[XJDDetailUserInfoView alloc] initWithFrame:CGRectMake(0, titleview.bottom, kScreenWidth - kRealValue(30), kRealValue(103))]; // infoView.backgroundColor = KWhiteColor; // self.userView = infoView; // [mainScrollView addSubview:infoView]; @@ -392,7 +392,7 @@ // hosLeftLabel.textColor = UIColorHex(#666666); // hosLeftLabel.font = SYSTEMFONT(13); // hosLeftLabel.textAlignment = NSTextAlignmentLeft; -// CGFloat hosW = [HQCommonUtils getLengthFromText: @"就诊医院及科室:" andFontSize:13]; +// CGFloat hosW = [XJDCommonUtils getLengthFromText: @"就诊医院及科室:" andFontSize:13]; // hosLeftLabel.width = hosW; // [self.hospationView addSubview:hosLeftLabel]; // @@ -412,7 +412,7 @@ // sickLeftLabel.font = SYSTEMFONT(13); // sickLeftLabel.textAlignment = NSTextAlignmentLeft; // self.sickLeftLabel = sickLeftLabel; -// CGFloat sickW = [HQCommonUtils getLengthFromText: @"诊断的疾病名:" andFontSize:13]; +// CGFloat sickW = [XJDCommonUtils getLengthFromText: @"诊断的疾病名:" andFontSize:13]; // sickLeftLabel.width = hosW; // [self.hospationView addSubview:sickLeftLabel]; // @@ -468,7 +468,7 @@ // // leftLabel.text = leftText; // -// CGFloat w = [HQCommonUtils getLengthFromText:leftText andFontSize:13]; +// CGFloat w = [XJDCommonUtils getLengthFromText:leftText andFontSize:13]; // // leftLabel.font = SYSTEMFONT(13); // @@ -509,7 +509,7 @@ // [parmDic setObject:self.record_id forKey:@"id"]; // } // -// YXNetAPI * recordApi = [[YXNetAPI alloc] init:self tag:@"RECORD" NeedToken:@""]; +// XJDNetAPI * recordApi = [[XJDNetAPI alloc] init:self tag:@"RECORD" NeedToken:@""]; // // [recordApi fileDetatilData:parmDic]; // @@ -619,11 +619,11 @@ // self.hospationView.hidden = false; // // self.sicksLabel.text = [NSString stringWithFormat:@"%@",recordModel.lookOffice]; -// self.sicksLabel.height = [HQCommonUtils getSpaceLabelHeight:self.sicksLabel withStr:self.sicksLabel.text withFont:[UIFont systemFontOfSize:14] withWidth:self.sicksLabel.width withLineSpacing:5]; +// self.sicksLabel.height = [XJDCommonUtils getSpaceLabelHeight:self.sicksLabel withStr:self.sicksLabel.text withFont:[UIFont systemFontOfSize:14] withWidth:self.sicksLabel.width withLineSpacing:5]; // // self.hospationNameLabel.text = [NSString stringWithFormat:@"%@",recordModel.lookMedicalName]; // -// self.hospationNameLabel.height = [HQCommonUtils getSpaceLabelHeight:self.sicksLabel withStr:self.sicksLabel.text withFont:[UIFont systemFontOfSize:14] withWidth:self.sicksLabel.width withLineSpacing:5]; +// self.hospationNameLabel.height = [XJDCommonUtils getSpaceLabelHeight:self.sicksLabel withStr:self.sicksLabel.text withFont:[UIFont systemFontOfSize:14] withWidth:self.sicksLabel.width withLineSpacing:5]; // // self.sickLeftLabel.top = self.hospationNameLabel.bottom + kRealValue(17); // diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/HistoryRecord(历史记录)/XJDHistoricalRecordViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/HistoryRecord(历史记录)/XJDHistoricalRecordViewController.m index 8f812af..d52957d 100644 --- a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/HistoryRecord(历史记录)/XJDHistoricalRecordViewController.m +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/HistoryRecord(历史记录)/XJDHistoricalRecordViewController.m @@ -6,12 +6,12 @@ // #import "XJDHistoricalRecordViewController.h" -#import "HQSearchView.h" -#import "HistoryRecordTable.h" +#import "XJDSearchView.h" +#import "XJDHistoryRecordTable.h" @interface XJDHistoricalRecordViewController () -@property (nonatomic, strong) HistoryRecordTable * homeTable; +@property (nonatomic, strong) XJDHistoryRecordTable * homeTable; @end @@ -33,7 +33,7 @@ topView.backgroundColor = KWhiteColor; [self.view addSubview:topView]; - HQSearchView * seacrhView = [[HQSearchView alloc] initWithFrame:CGRectMake(0, 8, kScreenWidth, 35)]; + XJDSearchView * seacrhView = [[XJDSearchView alloc] initWithFrame:CGRectMake(0, 8, kScreenWidth, 35)]; seacrhView.backgroundColor = KWhiteColor; seacrhView.searchPlacehold = @"输入关键字搜索"; seacrhView.searchBlock = ^(NSString * _Nonnull fieldtext) { @@ -41,7 +41,7 @@ }; [topView addSubview:seacrhView]; - self.homeTable = [[HistoryRecordTable alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped]; + self.homeTable = [[XJDHistoryRecordTable alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped]; [self.view addSubview:self.homeTable]; diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDDownToolsManager.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDDownToolsManager.h new file mode 100644 index 0000000..40f1e59 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDDownToolsManager.h @@ -0,0 +1,20 @@ +// +// XJDDownToolsManager.h +// DoctorXinjiang +// +// Created by 仁康信息 on 2023/12/1. +// + +#import +#import "ReaderViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDDownToolsManager : NSObject + ++ (void)downLoadReportWithURL:(NSString *)PDFURL withFileName:(NSString *)fileName; + + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDDownToolsManager.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDDownToolsManager.m new file mode 100644 index 0000000..d8a671a --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDDownToolsManager.m @@ -0,0 +1,103 @@ +// +// XJDDownToolsManager.m +// DoctorXinjiang +// +// Created by 仁康信息 on 2023/12/1. +// + +#import "XJDDownToolsManager.h" +@implementation XJDDownToolsManager + ++ (void)downLoadReportWithURL:(NSString *)PDFURL withFileName:(NSString *)fileName +{ + + [self downLoadPdfFileByUrl:PDFURL fileName:[NSString stringWithFormat:@"%@.pdf",fileName]]; + +} + ++(__kindof NSURLSessionTask *)downloadWithURL:(NSString *)URL + fileDir:(NSString *)fileDir + progress:(void(^)(NSProgress *progress))progress + success:(void(^)(NSString *filePath))success + failure:(void(^)(NSError *error))failure{ + + AFHTTPSessionManager *manager = [AFHTTPSessionManager manager]; + NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:URL]]; + NSURLSessionDownloadTask *downloadTask = [manager downloadTaskWithRequest:request progress:^(NSProgress * _Nonnull downloadProgress) { + //下载进度 + progress ? progress(downloadProgress) : nil; + NSLog(@"下载进度:%.2f%%",100.0*downloadProgress.completedUnitCount/downloadProgress.totalUnitCount); + } destination:^NSURL * _Nonnull(NSURL * _Nonnull targetPath, NSURLResponse * _Nonnull response) { + + //拼接缓存目录 + NSString *downloadStr = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject] ; + + //拼接文件路径 + NSString *filePath = [downloadStr stringByAppendingPathComponent:fileDir]; + + NSLog(@"downloadStr = %@",downloadStr); + return [NSURL fileURLWithPath:filePath]; + + } completionHandler:^(NSURLResponse * _Nonnull response, NSURL * _Nullable filePath, NSError * _Nullable error) { + NSLog(@"%@---%@", filePath, filePath.absoluteString); + success ? success(filePath.absoluteString /** NSURL->NSString*/) : nil; + failure && error ? failure(error) : nil; + }]; + //开始下载 + [downloadTask resume]; + return downloadTask; + +} + +//下载pdf文件 ++(void)downLoadPdfFileByUrl:(NSString *)url fileName:(NSString *)fileName +{ + //如果存在直接打开 + if ([self isFileExist:fileName]) { + //获取路径 + NSString *documentsPath = [ReaderDocument documentsPath]; + //可根据路径command + shift + G查看该路径下的所有的pdf文件 + NSLog(@"%@", documentsPath); + NSString *filePath = [documentsPath stringByAppendingPathComponent:fileName]; + ReaderDocument *document = [ReaderDocument withDocumentFilePath:filePath password:nil]; + if (document != nil) + { + ReaderViewController *readerViewController = [[ReaderViewController alloc] initWithReaderDocument:document]; + + readerViewController.delegate = self; + [[XJDCommonUtils getCurrentVC] presentViewController:readerViewController animated:YES completion:nil]; + } + }else{ + + [self downloadWithURL:url fileDir:fileName progress:^(NSProgress *progress) { + + } success:^(NSString *filePath) { + NSLog(@"%@", filePath); + //下载完成直接打开 + [self downLoadPdfFileByUrl:url fileName:fileName]; + } failure:^(NSError *error) { + }]; + } + +} +#pragma mark ReaderViewControllerDelegate因为PDF阅读器可能是push出来的,也可能是present出来的,为了更好的效果,这个代理方法可以实现很好的退出 ++ (void)dismissReaderViewController:(ReaderViewController *)viewController{ + [[XJDCommonUtils getCurrentVC] dismissViewControllerAnimated:YES completion:nil]; +} + +#pragma 判断文件是否存在 ++(BOOL)isFileExist:(NSString *)fileName +{ + NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); + NSString *path = [paths objectAtIndex:0]; + NSString *filePath = [path stringByAppendingPathComponent:fileName]; + NSFileManager *fileManager = [NSFileManager defaultManager]; + BOOL result = [fileManager fileExistsAtPath:filePath]; + NSLog(@"这个文件已经存在:%@",result?@"是的":@"不存在"); + return result; + +} + + +@end + diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDHealthPhyReportModel.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDHealthPhyReportModel.h new file mode 100644 index 0000000..6ecd241 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDHealthPhyReportModel.h @@ -0,0 +1,99 @@ +// +// XJDHealthPhyReportModel.h +// DoctorXinjiang +// +// Created by 仁康信息 on 2023/8/28. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +//新增影像报告 + + +@interface XJDThirdResultResModel : NSObject + +@property (nonatomic, copy) NSString * third_tId; +@property (nonatomic, copy) NSString * type; + +@property (nonatomic, copy) NSString * userResultId; +@property (nonatomic, copy) NSString * peItemName; +@property (nonatomic, copy) NSString * uniItemId; +@property (nonatomic, copy) NSString * printContext; +@property (nonatomic, copy) NSString * peResult; +@property (nonatomic, copy) NSString * unit; +@property (nonatomic, copy) NSString * colour; +@property (nonatomic, copy) NSString * textFlag; + +@end + + +@interface XJDImageItemListModel : NSObject + +@property (nonatomic, copy) NSString * imageCheckName; +@property (nonatomic, copy) NSString * imageShowUrl; +@property (nonatomic, copy) NSString * imageClass; +@property (nonatomic, copy) NSString * studyInsId; +@property (nonatomic, copy) NSString * reportContent; +@property (nonatomic, copy) NSString * reportUrl; +@property (nonatomic, copy) NSString * reportDate; +@property (nonatomic, copy) NSString * imageClassName; +@property (nonatomic, assign) CGFloat textHeight; +@property (nonatomic, assign) CGFloat cellHeight; + +@end + +@interface XJDSenResultResModel : NSObject +@property (nonatomic, copy) NSString * uniItemClassId; +@property (nonatomic, copy) NSString * uniItemClassName; +@property (nonatomic, strong) NSArray * thirdResultRes; + +@end + +@interface XJDResultItemResListModel : NSObject + +@property (nonatomic, copy) NSString * analysisId; +@property (nonatomic, copy) NSString * analysisName; +@property (nonatomic, copy) NSString * empBirthday; +@property (nonatomic, copy) NSString * medicalYear; +@property (nonatomic, assign) NSInteger rowNumber; +@property (nonatomic, strong) NSArray * senResultRes; +@property (nonatomic, strong) NSArray * allResultArray; + + +@end + +@interface XJDHealthPhyReportModel : NSObject + +@property (nonatomic, copy) NSString * report_id; +@property (nonatomic, copy) NSString * userId; +@property (nonatomic, copy) NSString * userName; +@property (nonatomic, copy) NSString * sex; +@property (nonatomic, copy) NSString * sex_dictText; +@property (nonatomic, copy) NSString * age; +@property (nonatomic, copy) NSString * card; +@property (nonatomic, copy) NSString * mobilePhone; +@property (nonatomic, copy) NSString * peQueueDate; +@property (nonatomic, copy) NSString * empBirthday; +@property (nonatomic, copy) NSString * medicalYear; +@property (nonatomic, copy) NSString * suggest; +@property (nonatomic, copy) NSString * conclusion; +@property (nonatomic, copy) NSString * email; +@property (nonatomic, copy) NSString * empNativeplace; +@property (nonatomic, copy) NSString * hospitalName; + + +@property (nonatomic, assign) BOOL zhangkaiSug; +@property (nonatomic, assign) BOOL zhangkaiCon; + + + +@property (nonatomic, strong) NSArray * resultItemResList; + +@property (nonatomic, strong) NSArray * imageItemList; + + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDHealthPhyReportModel.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDHealthPhyReportModel.m new file mode 100644 index 0000000..6529547 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDHealthPhyReportModel.m @@ -0,0 +1,80 @@ +// +// XJDHealthPhyReportModel.m +// DoctorXinjiang +// +// Created by 仁康信息 on 2023/8/28. +// + +#import "XJDHealthPhyReportModel.h" + +@implementation XJDThirdResultResModel + ++ (NSDictionary *)modelCustomPropertyMapper +{ + NSDictionary * dic =@{@"third_tId" :@"id"}; + return dic; +} + + +@end + +@implementation XJDImageItemListModel + + + +@end + +@implementation XJDSenResultResModel + ++ (NSDictionary *)modelContainerPropertyGenericClass +{ + + return @{ + + @"thirdResultRes":[XJDThirdResultResModel class] + }; +} + + + +@end + + +@implementation XJDResultItemResListModel + ++ (NSDictionary *)modelContainerPropertyGenericClass +{ + + return @{ + @"senResultRes":[XJDSenResultResModel class], + @"allResultArray":[XJDThirdResultResModel class] + }; + +} + + + +@end + +@implementation XJDHealthPhyReportModel + ++ (NSDictionary *)modelCustomPropertyMapper +{ + NSDictionary * dic =@{@"report_id" :@"id"}; + return dic; +} + + ++ (NSDictionary *)modelContainerPropertyGenericClass +{ + + return @{ + @"resultItemResList":[XJDResultItemResListModel class], + @"imageItemList":[XJDImageItemListModel class] + }; +} + + + + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDLookReportImageViewController.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDLookReportImageViewController.h new file mode 100644 index 0000000..98f3bb2 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDLookReportImageViewController.h @@ -0,0 +1,22 @@ +// +// XJDLookReportImageViewController.h +// DoctorXinjiang +// +// Created by Apple on 2024/2/26. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDLookReportImageViewController : YXBaseViewController + +@property (nonatomic, strong) NSString * webTitle; + +@property (nonatomic, strong) NSString * webUrl; + + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDLookReportImageViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDLookReportImageViewController.m new file mode 100644 index 0000000..d324524 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDLookReportImageViewController.m @@ -0,0 +1,173 @@ +// +// XJDLookReportImageViewController.m +// DoctorXinjiang +// +// Created by Apple on 2024/2/26. +// + +#import "XJDLookReportImageViewController.h" + +@interface XJDLookReportImageViewController () + +@property (nonatomic, strong)NSURL *originalUrl; +@property (nonatomic, copy)NSString *videoUrl; +@property (nonatomic, copy)NSString *messageType; +@property (nonatomic, strong) WKWebView * wkWebView; + +@end + +@implementation XJDLookReportImageViewController + + +#pragma mark - LifeCycle +- (void)viewDidLoad { + [super viewDidLoad]; + self.view.backgroundColor = [UIColor whiteColor]; + self.isHidenNaviBar = false; + [self addNavigationItemWithImageNames:@[@"whiteBack_icon"] isLeft:YES target:self action:@selector(backVC) tags:@[@""]]; + + if (self.webTitle) { + self.navigationItem.title = self.webTitle; + } + [self.view addSubview:self.wkWebView]; + [self webViewRequest]; +} + +- (void)backVC { + + [self.navigationController popViewControllerAnimated:YES]; +} + + + +- (void)viewWillDisappear:(BOOL)animated{ + [super viewWillDisappear:animated]; + _wkWebView.navigationDelegate = nil; + _wkWebView.UIDelegate = nil; + //清除cookies + NSHTTPCookie *cookie; + NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage]; + for (cookie in [storage cookies]) { + [storage deleteCookie:cookie]; + } + [[NSURLCache sharedURLCache] removeAllCachedResponses]; + [self clearWebViewCache]; +} + + +#pragma mark 懒加载 +-(WKWebView *)wkWebView{ + if (!_wkWebView) { + + NSString *jScript = @"var meta = document.createElement('meta'); meta.setAttribute('name', 'viewport'); meta.setAttribute('content', 'width=device-width,initial-scale=1,minimum-scale=0.25,maximum-scale=2,user-scalable=yes'); document.getElementsByTagName('head')[0].appendChild(meta); var imgs = document.getElementsByTagName('img');for (var i in imgs){imgs[i].style.maxWidth='100%';imgs[i].style.height='auto';}"; + + + WKUserScript *wkUScript = [[WKUserScript alloc] initWithSource:jScript injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:YES]; + WKUserContentController *wkUController = [[WKUserContentController alloc] init]; + [wkUController addUserScript:wkUScript]; + WKWebViewConfiguration *wkWebConfig = [[WKWebViewConfiguration alloc] init]; + wkWebConfig.userContentController = wkUController; + + _wkWebView = [[WKWebView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) configuration:wkWebConfig]; + _wkWebView.allowsBackForwardNavigationGestures = true; + } + return _wkWebView; +} + + +- (void)webViewRequest{ + NSString *urlString = self.webUrl; + [self hiddenAllMBProgressHUD]; + if (urlString.length > 0) { + [self showMBProgressHUDOnlyWithString:@"加载中"]; + NSURL *url = [NSURL URLWithString:urlString]; + NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url]; + if (self.wkWebView) { + [self.wkWebView loadRequest:urlRequest]; + } + } +} + + + + +#pragma mark - WKNavigationDelegate +- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message{ + +} + +#pragma mark - WKScriptMessageHandler +- (WKWebView *)webView:(WKWebView *)webView createWebViewWithConfiguration:(WKWebViewConfiguration *)configuration forNavigationAction:(WKNavigationAction *)navigationAction windowFeatures:(WKWindowFeatures *)windowFeatures { + [self hiddenAllMBProgressHUD]; + if (!navigationAction.targetFrame.isMainFrame) { + [webView loadRequest:navigationAction.request]; + } + return nil; +} + +- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation{ + if (!self.webTitle) { + self.title = @"加载中..."; + } + +} + +- (void)webView:(WKWebView *)webView didFinishNavigation:(null_unspecified WKNavigation *)navigation{ + [self hiddenAllMBProgressHUD]; + + if (!self.webTitle) { + self.title = webView.title; + } + +} + +- (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation withError:(nonnull NSError *)error{ + [self hiddenAllMBProgressHUD]; +} + + +#pragma mark - 自定义 +- (void)onBackClicked{ + if ( self.wkWebView.canGoBack){ + [self.wkWebView goBack]; + } else { + [self clearWebViewCache]; + } +} + +- (void)clearWebViewCache{ + if (iOS9Later) { + NSSet *websiteDataTypes = [WKWebsiteDataStore allWebsiteDataTypes]; + NSDate *dateFrom = [NSDate dateWithTimeIntervalSince1970:0]; + [[WKWebsiteDataStore defaultDataStore] removeDataOfTypes:websiteDataTypes modifiedSince:dateFrom completionHandler:^{ + NSLog(@"-----clear webView cache success------"); + }]; + } else { + NSString *libraryPath = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) objectAtIndex:0]; + NSString *cookiesFolderPath = [libraryPath stringByAppendingString:@"/Cookies"]; + NSError *errors; + [[NSFileManager defaultManager] removeItemAtPath:cookiesFolderPath error:&errors]; + if (!errors) { + NSLog(@"-----clear wkWebView cache success------"); + } + } +} +- (NSString *)URLEncodedString:(NSString *)urlString{ + NSString *encodePath ; + if (!IOS7) { + encodePath = [urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; + }else{ + encodePath = [urlString stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]; + }return encodePath; +} + + +#pragma mark - SETTER + +- (void)setWebUrl:(NSString *)webUrl{ + _webUrl = webUrl; + [self webViewRequest]; +} + + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDQuestionDetailViewController.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDQuestionDetailViewController.h new file mode 100644 index 0000000..275e033 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDQuestionDetailViewController.h @@ -0,0 +1,18 @@ +// +// XJDQuestionDetailViewController.h +// healthQuestion +// +// Created by 仁康信息 on 2023/4/27. +// + +#import "YXBaseViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDQuestionDetailViewController : YXBaseViewController + +@property (nonatomic, copy) NSString * question_id; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDQuestionDetailViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDQuestionDetailViewController.m new file mode 100644 index 0000000..ab96fee --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDQuestionDetailViewController.m @@ -0,0 +1,744 @@ +// +// XJDQuestionDetailViewController.m +// healthQuestion +// +// Created by 仁康信息 on 2023/4/27. +// + +#import "XJDQuestionDetailViewController.h" +#import "XJDDetailUserInfoView.h" +#import "XJDDetailTitleView.h" +#import "XJDQuestionAppointmentTimeView.h" +#import "XJDQuestionFileDataView.h" +#import "XJDQuestionHealthInfoView.h" +#import "XJDQuestionReportView.h" +#import "XJDRecoredListDetailModel.h" +#import "XJDQuestionBodyReportModel.h" +#import "XJDRefuseQuestionPopView.h" +#import "XJDCancelReasonModel.h" +#import "XJDFileDataDetailViewController.h" +#import "XJDTTestView.h" +#import "TUIConversationListBaseDataProvider.h" + +#import +#import +#import +#import +#import "TUIConversationCellData.h" +@interface XJDQuestionDetailViewController () + +@property (nonatomic, strong) UIScrollView * mainScrollView; + +@property (nonatomic, strong) XJDDetailTitleView * titleview; + +@property (nonatomic, strong) XJDDetailUserInfoView * infoView; + +@property (nonatomic, strong) XJDQuestionAppointmentTimeView * timeView; + +@property (nonatomic, strong) XJDQuestionFileDataView * fileView; + +@property (nonatomic, strong) XJDQuestionReportView * reportView; + +@property (nonatomic, strong) XJDQuestionHealthInfoView * healthView; + +@property (nonatomic, strong) UIView * questionStartView; + +@property (nonatomic, strong) UIButton * cancelBtn; + +@property (nonatomic, strong) UIButton * acceptBtn; + +@property (nonatomic, strong) UIButton * sendVideBtn; + +@property (nonatomic, strong) XJDRefuseQuestionPopView * popView; + +@property (nonatomic, copy) NSString * conSession_id; + +@property (nonatomic, copy) NSString * record_id; + +@property (nonatomic, copy) NSString * idNo; + +@property (nonatomic, copy) NSString * starTimeString; + +@property (nonatomic, copy) NSString * endTimeString; + +@property (nonatomic, strong) UILabel * questionStartLabel; + +@property (nonatomic, copy) NSString * imId; + + +@property (nonatomic, copy) NSString * endPhoneID; + +@property (nonatomic, strong) XJDRecoredDetailConsessionModel * timeModel; + +@end + +@implementation XJDQuestionDetailViewController + +- (XJDRefuseQuestionPopView *)popView { + + if (!_popView) { + MJWeakSelf + _popView = [[XJDRefuseQuestionPopView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)]; + _popView.upBlock = ^{ + + }; + + _popView.popBlock = ^(NSString * _Nonnull beizhuString, NSString * _Nonnull reasourString) { + //拒绝提交 + [weakSelf cancelReasourSubmit:beizhuString withReasonType:reasourString]; + + }; + _popView.alpha = 0; + + } + return _popView; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + self.isHidenNaviBar = false; + self.navigationItem.title = @"视频咨询"; + self.view.backgroundColor = UIColorHex(#E0E0E0); + // Do any additional setup after loading the view. + [self createUI]; + [self createData]; + [self getCancelReasourData]; +} + +- (void)createUI { + + UIImageView * topImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 200)]; + topImage.image = [UIImage imageNamed:@"questionDetailBack"]; + [self.view addSubview:topImage]; + + + + self.mainScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(kRealValue(15), 0, kScreenWidth - kRealValue(30), kScreenHeight - kTopHeight - SafetyAreaHeight)]; + self.mainScrollView.showsVerticalScrollIndicator = false; + self.mainScrollView.showsHorizontalScrollIndicator = false; + self.mainScrollView.layer.cornerRadius = 8.0; + self.mainScrollView.layer.masksToBounds = true; + self.mainScrollView.backgroundColor = KClearColor; + [self.view addSubview:self.mainScrollView]; + + XJDDetailTitleView * titleview = [[XJDDetailTitleView alloc] initWithFrame:CGRectMake(0, 0, self.mainScrollView.width, 33)]; + self.titleview = titleview; + [self.mainScrollView addSubview:titleview]; + + //个人信息 + XJDDetailUserInfoView * infoView = [[XJDDetailUserInfoView alloc] initWithFrame:CGRectMake(0, titleview.bottom, kScreenWidth - kRealValue(30), kRealValue(103))]; + infoView.backgroundColor = KWhiteColor; + self.infoView = infoView; + [self.mainScrollView addSubview:infoView]; + + //预约时间 + XJDQuestionAppointmentTimeView * timeView = [[XJDQuestionAppointmentTimeView alloc] initWithFrame:CGRectMake(0, infoView.bottom + 1, kScreenWidth - kRealValue(30), kRealValue(64))]; + timeView.backgroundColor = KWhiteColor; + self.timeView = timeView; + [self.mainScrollView addSubview:timeView]; + //档案 + XJDQuestionFileDataView * fileView = [[XJDQuestionFileDataView alloc] initWithFrame:CGRectMake(0, timeView.bottom, kScreenWidth - kRealValue(30), kRealValue(64))]; + fileView.backgroundColor = KWhiteColor; + fileView.height = fileView.fileHeight; + self.fileView = fileView; + fileView.fileBlock = ^{ + [self lookFileDetail]; + }; + [self.mainScrollView addSubview:fileView]; + //基本健康信息 + XJDQuestionHealthInfoView * healthView = [[XJDQuestionHealthInfoView alloc] initWithFrame:CGRectMake(0, fileView.bottom +1, kScreenWidth - kRealValue(30), kRealValue(1))]; + healthView.backgroundColor = KWhiteColor; + self.healthView = healthView; + self.questionStartView.layer.cornerRadius = 10.0; + [self.mainScrollView addSubview:healthView]; + //体检报告 + XJDQuestionReportView * reportView = [[XJDQuestionReportView alloc] initWithFrame:CGRectMake(0, healthView.bottom +1, kScreenWidth - kRealValue(30), kRealValue(100))]; + reportView.backgroundColor = KWhiteColor; + self.reportView = reportView; + self.reportView.layer.cornerRadius = 10.0; + self.reportView.layer.masksToBounds = true; +// reportView.baogaoBlock = ^(YXPhyscialReportListModel * _Nonnull reportModel) { +// +// YXPhyReportDetailViewController * yearVC = [[YXPhyReportDetailViewController alloc] init]; +// yearVC.navTitle = reportModel.medicalYear; +// yearVC.yearString = reportModel.report_id; +// [self.navigationController pushViewController:yearVC animated:YES]; +// +// }; + [self.mainScrollView addSubview:reportView]; + + //咨询开始时间 + self.questionStartView = [[UIView alloc] initWithFrame:CGRectMake(0, reportView.bottom, kScreenWidth - kRealValue(30), 1)]; + self.questionStartView.backgroundColor = KWhiteColor; + self.questionStartView.layer.cornerRadius = 10.0; + self.questionStartView.layer.masksToBounds = true; + self.questionStartView.hidden = true; + [self.mainScrollView addSubview:self.questionStartView]; +// + UILabel * startLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(18), kRealValue(22), 100, 14)]; + startLabel.text = @"咨询开始时间"; + startLabel.font = BOLDSYSTEMFONT(13); + startLabel.textAlignment = NSTextAlignmentLeft; + [self.questionStartView addSubview:startLabel]; + + self.questionStartLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(18), startLabel.bottom + kRealValue(17), self.questionStartView.width - kRealValue(36), 13)]; + self.questionStartLabel.text = @""; + self.questionStartLabel.font = BOLDSYSTEMFONT(13); + self.questionStartLabel.textAlignment = NSTextAlignmentLeft; + [self.questionStartView addSubview:self.questionStartLabel]; + + self.mainScrollView.contentSize = CGSizeMake(kScreenWidth - kRealValue(30), reportView.bottom + kTopHeight); + + UIButton * cancelBtn = [[UIButton alloc] initWithFrame:CGRectMake( self.mainScrollView.width/2 - kRealValue(155) , kScreenHeight - kTopHeight - 60 - SafetyAreaHeight , kRealValue(150), 40)]; + [cancelBtn setTitle:@"拒绝" forState:UIControlStateNormal]; + [cancelBtn setTitleColor:UIColorHex(#21BEBD) forState:UIControlStateNormal]; + cancelBtn.titleLabel.font = SYSTEMFONT(18); + cancelBtn.backgroundColor = KWhiteColor; + cancelBtn.layer.cornerRadius = 18; + cancelBtn.layer.borderColor = UIColorHex(#21BEBD).CGColor; + [cancelBtn addTarget:self action:@selector(cancelQuestionAction) forControlEvents:UIControlEventTouchUpInside]; + cancelBtn.layer.masksToBounds = true; + self.cancelBtn = cancelBtn; + self.cancelBtn.hidden = YES; + [self.mainScrollView addSubview:cancelBtn]; + + UIButton * acceptBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.mainScrollView.width/2 + kRealValue(5), cancelBtn.top , kRealValue(150), 40)]; + [acceptBtn setTitle:@"接受" forState:UIControlStateNormal]; + [acceptBtn setTitleColor:KWhiteColor forState:UIControlStateNormal]; + [acceptBtn addTarget:self action:@selector(waitAcceptAction) forControlEvents:UIControlEventTouchUpInside]; + acceptBtn.titleLabel.font = SYSTEMFONT(18); + acceptBtn.backgroundColor = UIColorHex(#21BEBD); + acceptBtn.layer.cornerRadius = 18; + acceptBtn.layer.masksToBounds = true; + self.acceptBtn = acceptBtn; + self.acceptBtn.hidden = YES; + [self.mainScrollView addSubview:acceptBtn]; + + // + UIButton * videoBtn = [[UIButton alloc] initWithFrame:CGRectMake(kScreenWidth/2 + kRealValue(5), kScreenHeight - kTopHeight - 40 - SafetyAreaHeight , kRealValue(150), 40)]; + [videoBtn setTitle:@"视频通话" forState:UIControlStateNormal]; + [videoBtn setImage:[UIImage imageNamed:@"sendVideo_icon"] forState:UIControlStateNormal]; + [videoBtn setTitleColor:UIColorHex(#21BEBD) forState:UIControlStateNormal]; + videoBtn.titleLabel.font = SYSTEMFONT(18); + videoBtn.backgroundColor = KWhiteColor; + videoBtn.layer.cornerRadius = 18; + videoBtn.layer.masksToBounds = true; + videoBtn.centerX = self.mainScrollView.centerX; + self.sendVideBtn = videoBtn; + [self.sendVideBtn addTarget:self action:@selector(sendVideoAction) forControlEvents:UIControlEventTouchUpInside]; + self.sendVideBtn.hidden = YES; + [self.mainScrollView addSubview:videoBtn]; + + self.mainScrollView.contentSize = CGSizeMake(kScreenWidth - kRealValue(30), reportView.bottom + 35); +} + +- (void) createData { + + [self showMBProgressHUDWithString:@"数据加载中,请稍候..." autoHidden:NO]; + NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; + [parmDic setObject:self.question_id forKey:@"id"]; + + XJDNetAPI * detailApi = [[XJDNetAPI alloc] init:self tag:@"DeatilAPI" NeedToken:@""]; + + [detailApi GetRecoredQuestionDetail:parmDic]; +} + +- (void)getCancelReasourData { + + NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; + + XJDNetAPI * detailApi = [[XJDNetAPI alloc] init:self tag:@"REASOURAPI" NeedToken:@""]; + + [detailApi GetCancelReasourData:parmDic]; + + +} + +- (void)Failed:(NSString*)message tag:(NSString*)tag +{ + [self hiddenAllMBProgressHUD]; + +} + + +- (void)Sucess:(id)response tag:(NSString*)tag +{ + + if ([tag isEqualToString:@"DeatilAPI"]) { + + [self hiddenAllMBProgressHUD]; + NSDictionary * dic = response; + + XJDRecoredListDetailModel * model = [XJDRecoredListDetailModel modelWithDictionary:dic]; + + XJDReocrdconFamilyMembersDO * infoModel = [XJDReocrdconFamilyMembersDO modelWithDictionary:model.conFamilyMembersDO]; + + XJDRecoredDetailConsessionModel * timeModel = [XJDRecoredDetailConsessionModel modelWithDictionary:model.conSession]; + self.timeModel = timeModel; + XJDRecoredconMedicalRecordsListDO * medicalModel = [XJDRecoredconMedicalRecordsListDO modelWithDictionary:model.conMedicalRecordsListDO]; + //总的ID + self.conSession_id = timeModel.consession_id; + self.record_id = medicalModel.dangan_id; + self.imId = infoModel.groupId; + //个人信息 + self.infoView.userInfo = infoModel; + //顶部时间 + self.titleview.createTime = timeModel.createTime; + //预约时间 + self.timeView.model = model; + //顶部时间高度 + self.timeView.height = self.timeView.doctorinfoHeight; + //档案 + self.fileView.model = medicalModel; + self.fileView.top = self.timeView.bottom; + + //健康信息 + if (model.answer.count <= 0) { + + self.healthView.hidden = YES; + self.healthView.height = 1; + + UIBezierPath * maskPath = [UIBezierPath bezierPathWithRoundedRect:self.fileView.bounds byRoundingCorners:UIRectCornerBottomLeft|UIRectCornerBottomRight cornerRadii:CGSizeMake(10, 10)]; + + CAShapeLayer * maskLayer = [[CAShapeLayer alloc]init]; + + maskLayer.frame = self.fileView.bounds; + + maskLayer.path = maskPath.CGPath; + + self.fileView.layer.mask = maskLayer; + + + }else + { + self.healthView.hidden = false; + self.healthView.questionArray = model.answer; + self.healthView.height = self.healthView.healthHeight; + + UIBezierPath * maskPath = [UIBezierPath bezierPathWithRoundedRect:self.healthView.bounds byRoundingCorners:UIRectCornerBottomLeft|UIRectCornerBottomRight cornerRadii:CGSizeMake(10, 10)]; + + CAShapeLayer * maskLayer = [[CAShapeLayer alloc]init]; + + maskLayer.frame = self.healthView.bounds; + + maskLayer.path = maskPath.CGPath; + + self.healthView.layer.mask = maskLayer; + + } + + // self.endTimeString = info + self.idNo = model.idNo; + + //是否体检报告 + if ([medicalModel.tfPermission integerValue] == 1) { //有体检报告 +// self.reportView.hidden = false; + [self getBodyInfoReport:timeModel.fromAccount]; +// self.reportView.height = self.reportView.reportHeight; +// self.reportView.top = self.healthView.bottom - 10; + + }else + { + self.reportView.hidden = YES; + self.reportView.height = 1; + [self updateUI]; + + } +// [self updateUI]; + + + } + if ([tag isEqualToString:@"BodyApi"]) { + + // NSArray * dataArray = response; + // + // self.reportView.dataArray = dataArray; + // self.reportView.top= self.healthView.bottom; + // self.reportView.height = self.reportView.reportHeight; + // self.mainScrollView.height = self.reportView.bottom + 35; + // self.mainScrollView.contentSize = CGSizeMake(kScreenWidth - kRealValue(30), self.reportView.bottom + 35); + [self hiddenAllMBProgressHUD]; + NSDictionary * dic = response; + + if (ValidDict(dic)) { + +// YXPhyscialReportListModel * model = [YXPhyscialReportListModel modelWithDictionary:dic]; +// self.reportView.bodyModel =model; + self.reportView.height = self.reportView.reportHeight; + self.questionStartView.top = self.reportView.bottom + kRealValue(15); +// [self updateFocusIfNeeded]; +// if (self.cancelBtn.hidden == false) { +// self.mainScrollView.contentSize = CGSizeMake(kScreenWidth - kRealValue(30), self.cancelBtn.bottom + 35); +// } +// if (self.sendVideBtn.hidden == false) { +// self.mainScrollView.contentSize = CGSizeMake(kScreenWidth - kRealValue(30), self.sendVideBtn.bottom + 35); +// } +// if (self.questionStartView.hidden == false) { +// self.mainScrollView.contentSize = CGSizeMake(kScreenWidth - kRealValue(30), self.questionStartView.bottom + 35); +// } + [self updateUI]; + }else + { + self.reportView.height = 1; + self.reportView.hidden = true; + [self updateUI]; + } + + + } + if ([tag isEqualToString:@"REASOURAPI"]) { + [self hiddenAllMBProgressHUD]; + NSArray * array = response; + + NSMutableArray * dataArray = [[NSMutableArray alloc] init]; + + for (NSDictionary * reasourDic in array) { + + XJDCancelReasonModel * model = [XJDCancelReasonModel modelWithDictionary:reasourDic]; + + [dataArray addObject:model]; + + } + self.popView.dataArray = dataArray; + + } + if ([tag isEqualToString:@"SUBMITREASOUR"]) { + + [self.popView removeFromSuperview]; + [self hiddenAllMBProgressHUD]; + [self createData]; + } + if([tag isEqualToString:@"ACCEPTQUESTION"]) { + [self hiddenAllMBProgressHUD]; + [self createData]; + + } + if ([tag isEqualToString:@"ENDPICTUREAPI"]) { + + [self createData]; + } + if ([tag isEqualToString:@"AgainQuestion"]) { + + [self createData]; + [self hiddenAllMBProgressHUD]; + } + if ([tag isEqualToString:@"IMAPI"]) { + + NSDictionary * pamrDic = response; + + XJDIMUserInfoModel * model = [XJDIMUserInfoModel modelWithDictionary:pamrDic]; + + XJDIMUserInfoModel * iminfoModel = [[XJDIMUserInfoModel alloc] init]; + iminfoModel.IMInfo = pamrDic; + [XJDCommonUtils 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 的实现类,如果您不需要监听 IM SDK 的事件,这个步骤可以忽略。 + // 5. 初始化 IM SDK,调用这个接口后,可以立即调用登录接口。 + [[V2TIMManager sharedInstance] initSDK:[model.sdkAppId intValue] config:config]; + [ESCTUIManager loginInitTUISDKAppidWith:[model.sdkAppId intValue] UserID:model.userId userSig:model.userSig]; + [[TUICallEngine createInstance] init:[model.sdkAppId intValue] userId:model.userId userSig:model.userSig succ:^{ + + } fail:^(int code, NSString * _Nullable errMsg) { + + }]; + + } + if ([tag isEqualToString:@"STARSENDVIDE"]) { + + [self hiddenAllMBProgressHUD]; + NSDictionary * dic = response; + + NSString * groupId ; + + if ([dic.allKeys containsObject:@"groupId"]) { + + NSArray * memberArray = [dic objectForKey:@"member"]; + + [[TUICallEngine createInstance] addObserver:self]; + + [[TUICallKit createInstance] groupCall:[dic objectForKey:@"groupId"] userIdList:memberArray callMediaType:TUICallMediaTypeVideo]; + + [self hiddenAllMBProgressHUD]; + } + + if ([ESCTUIManager TUIUserStatus] == false) { + + + [self loginImAccount]; + return; + }else + { + + } + } + + if ([tag isEqualToString:@"ENDVideo"]) { + [self createData]; + + } + + if ([tag isEqualToString:@"beginVideo"]) { + + self.endPhoneID = [NSString stringWithFormat:@"%@",response]; + [self createData]; + } +} + +- (void)updateUI { + + //健康信息布局 + self.healthView.top = self.fileView.bottom; + // 体检信息布局 + self.reportView.top = self.healthView.bottom - 10; + //开始视图布局 + self.questionStartView.top = self.healthView.bottom + kRealValue(15); + //底部按钮布局 + self.cancelBtn.top = self.reportView.bottom + kRealValue(30); + self.acceptBtn.top = self.reportView.bottom + kRealValue(30); + self.sendVideBtn.top = self.reportView.bottom + kRealValue(30); + + // 预约状态 1待确认 2待开始 3已开始 4待评价 5已完成 + // 6 拒绝 7取消 8 超时 + + + if ([self.timeModel.contentStatus intValue] == 1) { + self.acceptBtn.hidden = false; + self.cancelBtn.hidden = false; + self.sendVideBtn.hidden = YES; + self.questionStartView.hidden = true; //视图开始时间隐藏 + self.mainScrollView.contentSize = CGSizeMake(kScreenWidth - kRealValue(30), self.cancelBtn.bottom + 60); + + } + if ([self.timeModel.contentStatus intValue] == 2 || [self.timeModel.contentStatus intValue] == 3) { + self.acceptBtn.hidden = YES; + self.cancelBtn.hidden = YES; + self.sendVideBtn.hidden = false; + self.questionStartView.hidden = false; + NSTimeInterval starTimeInterval = [self.timeModel.doctorStartTimeLong longLongValue]; + NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; + [formatter setDateFormat:@"yyyy年MM月dd HH:mm"]; + NSDate *date = [NSDate dateWithTimeIntervalSince1970:starTimeInterval/1000]; + NSString *timeString = [formatter stringFromDate:date]; + + NSTimeInterval endTimeInterval = [self.timeModel.doctorEndTimeLong longLongValue]; + NSDateFormatter * endformatter = [[NSDateFormatter alloc] init]; + [endformatter setDateFormat:@"HH:mm"]; + NSDate * enddate = [NSDate dateWithTimeIntervalSince1970:endTimeInterval/1000]; + NSString * endTimeString = [endformatter stringFromDate:enddate]; + self.questionStartView.height = kRealValue(100); + self.questionStartLabel.text = [NSString stringWithFormat:@"%@~%@",timeString,endTimeString]; + self.questionStartView.top = self.reportView.bottom + kRealValue(15); + self.sendVideBtn.top = self.questionStartView.bottom + kRealValue(30); + self.mainScrollView.contentSize = CGSizeMake(kScreenWidth - kRealValue(30), self.sendVideBtn.bottom + 35); + + + } + if ([self.timeModel.contentStatus intValue] >= 4 ) { //待评价 已完成 + self.acceptBtn.hidden = true; + self.cancelBtn.hidden = true; + self.sendVideBtn.hidden = true; + NSTimeInterval starTimeInterval = [self.timeModel.doctorStartTimeLong longLongValue]; + NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; + [formatter setDateFormat:@"yyyy年MM月dd HH:mm"]; + NSDate *date = [NSDate dateWithTimeIntervalSince1970:starTimeInterval/1000]; + NSString *timeString = [formatter stringFromDate:date]; + + NSTimeInterval endTimeInterval = [self.timeModel.doctorEndTimeLong longLongValue]; + NSDateFormatter * endformatter = [[NSDateFormatter alloc] init]; + [endformatter setDateFormat:@"HH:mm"]; + NSDate * enddate = [NSDate dateWithTimeIntervalSince1970:endTimeInterval/1000]; + NSString * endTimeString = [endformatter stringFromDate:enddate]; + + self.questionStartLabel.text = [NSString stringWithFormat:@"%@~%@",timeString,endTimeString]; + self.questionStartView.top = self.reportView.bottom + kRealValue(15); + self.questionStartView.height = CGFLOAT_MIN; + self.mainScrollView.contentSize = CGSizeMake(kScreenWidth - kRealValue(30), self.questionStartView.bottom + 60); + + } + +} +- (void)loginImAccount { + + + XJDNetAPI * proctocolApi = [[XJDNetAPI alloc] init:self tag:@"IMAPI" NeedToken:nil]; + [proctocolApi GetIMLoginAccount:nil]; + + + +} + +//请求体检信息 +- (void)getBodyInfoReport:(NSString *)byID { + + +// NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; +// +// [parmDic setObject:byID forKey:@"sfzh"]; +// + + NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; + + [parmDic setObject:byID forKey:@"userId"]; + + XJDNetAPI * detailApi = [[XJDNetAPI alloc] init:self tag:@"BodyApi" NeedToken:@""]; + + [detailApi getBodyReportDeatil:parmDic]; + + +} + +//拒绝 +- (void)cancelQuestionAction { + + + [kApplication.keyWindow addSubview:self.popView]; + + [UIView animateWithDuration:0.5 + animations:^{ + self.popView.alpha = 1; + }]; +} +//发起视频通话 +- (void)sendVideoAction { + + [self showMBProgressHUDWithString:@"视频通话请求中..." autoHidden:NO]; + NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; + [parmDic setObject:self.question_id forKey:@"sessionId"]; + XJDNetAPI * detailApi = [[XJDNetAPI alloc] init:self tag:@"STARSENDVIDE" NeedToken:@""]; + [detailApi getSendVideoStart:parmDic]; +} + + +//提交拒绝原因 +- (void)cancelReasourSubmit:(NSString *)rejectReason withReasonType:(NSString *)reasonType { + + NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; + [parmDic setObject: self.conSession_id forKey:@"id"]; + [parmDic setObject:rejectReason forKey:@"rejectReason"]; + [parmDic setObject:reasonType forKey:@"reasonType"]; + + XJDNetAPI * detailApi = [[XJDNetAPI alloc] init:self tag:@"SUBMITREASOUR" NeedToken:@""]; + + [detailApi submitCancelreasourData:parmDic]; + +} + +//接受请求 +- (void)waitAcceptAction { + XJDTTestView *vi = [[XJDTTestView alloc]initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)]; + [kAppWindow addSubview:vi]; + vi.returnBlock = ^(NSString *startTime, NSString *endTime) { + NSLog(@"开始时间 = %@", startTime); + NSLog(@"结束时间 = %@", endTime); + NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; + [parmDic setObject: self.conSession_id forKey:@"id"]; + [parmDic setObject:startTime forKey:@"startTime"]; + [parmDic setObject:endTime forKey:@"endTime"]; + + XJDNetAPI * detailApi = [[XJDNetAPI alloc] init:self tag:@"ACCEPTQUESTION" NeedToken:@""]; + + [detailApi getAcceptQuestion:parmDic]; + + }; +} + +//点否 下次预约 +-(void)againSendVideoTime { + + XJDTTestView *vi = [[XJDTTestView alloc]initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)]; + [kAppWindow addSubview:vi]; + vi.returnBlock = ^(NSString *startTime, NSString *endTime) { + NSLog(@"开始时间 = %@", startTime); + NSLog(@"结束时间 = %@", endTime); + NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; + [parmDic setObject: self.conSession_id forKey:@"id"]; + [parmDic setObject:startTime forKey:@"startTime"]; + [parmDic setObject:endTime forKey:@"endTime"]; + [parmDic setObject:@(1) forKey:@"type"]; + [self showMBProgressHUDWithString:@"重新预约中" autoHidden:false]; + XJDNetAPI * detailApi = [[XJDNetAPI alloc] init:self tag:@"AgainQuestion" NeedToken:@""]; + [detailApi getAgainSessionReservationDate:parmDic]; + + }; + +} + +//查看详情 +- (void)lookFileDetail { + + XJDFileDataDetailViewController * detalVC = [[XJDFileDataDetailViewController alloc] init]; + detalVC.record_id = self.record_id; + [self.navigationController pushViewController:detalVC animated:YES]; + +} + +//开始通话 +- (void)onCallBegin:(TUIRoomId *)roomId callMediaType:(TUICallMediaType)callMediaType callRole:(TUICallRole)callRole { + + NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; + [parmDic setObject: self.conSession_id forKey:@"id"]; + [parmDic setObject:@"" forKey:@"startTime"]; + [parmDic setObject:@"" forKey:@"endTime"]; + [parmDic setObject:@(2) forKey:@"type"]; + XJDNetAPI * detailApi = [[XJDNetAPI alloc] init:self tag:@"beginVideo" NeedToken:@""]; + [detailApi getAgainSessionReservationDate:parmDic]; + +} + +//结束通话 +- (void)onCallEnd:(TUIRoomId *)roomId callMediaType:(TUICallMediaType)callMediaType callRole:(TUICallRole)callRole totalTime:(float)totalTime { + + NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; + [parmDic setObject:self.endPhoneID forKey:@"id"]; + XJDNetAPI * endApi = [[XJDNetAPI alloc] init:self tag:@"ENDVideo" NeedToken:@""]; + [endApi getendVideoReportById:parmDic]; + + + + UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"温馨提示" message:@"本次咨询是否已完成?" preferredStyle:UIAlertControllerStyleAlert]; + + UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"否" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) { + [self againSendVideoTime]; + + }]; + UIAlertAction *sureAction = [UIAlertAction actionWithTitle:@"完成" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + + [self endQuestionSelected]; + + }]; + [alertController addAction:cancelAction]; + [alertController addAction:sureAction]; + // 确保在主线程上显示 UIAlertController + dispatch_async(dispatch_get_main_queue(), ^{ + [self presentViewController:alertController animated:YES completion:nil]; + }); + +} + +//结束本次咨询 +- (void)endQuestionSelected { + + NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; + [parmDic setObject:self.question_id forKey:@"id"]; + XJDNetAPI * endApi = [[XJDNetAPI alloc] init:self tag:@"ENDPICTUREAPI" NeedToken:@""]; + [endApi GetEndPictureEndIMQuestion:parmDic]; + +} + + +/* +#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 diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDSickNameSubTableViewCell.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDSickNameSubTableViewCell.h new file mode 100644 index 0000000..d2c6f74 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDSickNameSubTableViewCell.h @@ -0,0 +1,19 @@ +// +// XJDSickNameSubTableViewCell.h +// DoctorXinjiang +// +// Created by 仁康信息 on 2023/8/29. +// + +#import +#import "XJDHealthPhyReportModel.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDSickNameSubTableViewCell : UITableViewCell + +@property (nonatomic, strong) XJDThirdResultResModel * model; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDSickNameSubTableViewCell.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDSickNameSubTableViewCell.m new file mode 100644 index 0000000..358da7d --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDSickNameSubTableViewCell.m @@ -0,0 +1,221 @@ +// +// XJDSickNameSubTableViewCell.m +// DoctorXinjiang +// +// Created by 仁康信息 on 2023/8/29. +// + +#import "XJDSickNameSubTableViewCell.h" + + +@interface XJDSickNameSubTableViewCell () + +@property (nonatomic, strong) UILabel * nameLabel; +@property (nonatomic, strong) UILabel * resultLabel; +@property (nonatomic, strong) UILabel * danweiLabel; +@property (nonatomic, strong) UILabel * caokaoLabel; +@property (nonatomic, strong) UIButton * detailBtn; +@property (nonatomic, strong) UIView * popbackView; +@end + +@implementation XJDSickNameSubTableViewCell + +- (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 { + + + + UIView * headView = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(15), 0, kScreenWidth - kRealValue(30), kRealValue(40))]; + headView.backgroundColor =KWhiteColor; + [self.contentView addSubview:headView]; + + + + UILabel * nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, kRealValue(127), kRealValue(40))]; + nameLabel.text = @""; + nameLabel.textAlignment = NSTextAlignmentCenter; + nameLabel.font = SYSTEMFONT(13); + nameLabel.numberOfLines = 2; + self.nameLabel = nameLabel; + [headView addSubview:nameLabel]; + + CGFloat tabWidth = (kScreenWidth - kRealValue(30) - kRealValue(127) - 4)/3; + + UIView * lin_left = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 1, nameLabel.height)]; + lin_left.backgroundColor = CLineColor; + [headView addSubview:lin_left]; + + UIView * linName = [[UIView alloc] initWithFrame:CGRectMake(nameLabel.right, 0, 1, nameLabel.height)]; + linName.backgroundColor = CLineColor; + [headView addSubview:linName]; + + UILabel * reslutLabel = [[UILabel alloc] initWithFrame:CGRectMake(linName.right , 0, tabWidth, kRealValue(40))]; + reslutLabel.text = @""; + reslutLabel.textAlignment = NSTextAlignmentCenter; + reslutLabel.font = SYSTEMFONT(13); + reslutLabel.textColor = UIColorHex(#333333); + self.resultLabel = reslutLabel; + reslutLabel.userInteractionEnabled = true; + [headView addSubview:reslutLabel]; + + self.detailBtn = [[UIButton alloc] initWithFrame:CGRectMake(10, 10, tabWidth - 20, 20)]; + [self.detailBtn setTitle:@"详情" forState:UIControlStateNormal]; + [self.detailBtn setTitleColor:KWhiteColor forState:UIControlStateNormal]; + self.detailBtn.titleLabel.font = MEDIUMFONT(13); + self.detailBtn.layer.cornerRadius = 5; + self.detailBtn.backgroundColor = RGBA(33, 190, 189, 0.5); + [self.detailBtn addTarget:self action:@selector(showResultDetail) forControlEvents:UIControlEventTouchUpInside]; + [reslutLabel addSubview:self.detailBtn]; + + UIView * resName = [[UIView alloc] initWithFrame:CGRectMake(reslutLabel.right, 0, 1, nameLabel.height)]; + resName.backgroundColor = CLineColor; + [headView addSubview:resName]; + + UILabel * danweiLabel = [[UILabel alloc] initWithFrame:CGRectMake(resName.right, 0, tabWidth, kRealValue(40))]; + danweiLabel.text = @""; + danweiLabel.textAlignment = NSTextAlignmentCenter; + danweiLabel.font = SYSTEMFONT(13); + danweiLabel.textColor = UIColorHex(#333333); + self.danweiLabel = danweiLabel; + [headView addSubview:danweiLabel]; + + UIView * danweiLine = [[UIView alloc] initWithFrame:CGRectMake(danweiLabel.right, 0, 1, nameLabel.height)]; + danweiLine.backgroundColor = CLineColor; + [headView addSubview:danweiLine]; + + UILabel * zhiLabel = [[UILabel alloc] initWithFrame:CGRectMake(danweiLine.right, 0, tabWidth, kRealValue(40))]; + zhiLabel.text = @""; + zhiLabel.textAlignment = NSTextAlignmentCenter; + zhiLabel.textColor = UIColorHex(#333333); + zhiLabel.font = SYSTEMFONT(13); + self.caokaoLabel = zhiLabel; + [headView addSubview:zhiLabel]; + + UIView * lin_right = [[UIView alloc] initWithFrame:CGRectMake(zhiLabel.right, 0, 1, nameLabel.height)]; + lin_right.backgroundColor = CLineColor; + [headView addSubview:lin_right]; + + UIView * lin_bottom = [[UIView alloc] initWithFrame:CGRectMake(0, zhiLabel.bottom - 1, kScreenWidth - kRealValue(30), 1)]; + lin_bottom.backgroundColor = CLineColor; + [headView addSubview:lin_bottom]; +} + +- (void)setModel:(XJDThirdResultResModel *)model { + + _model = model; + + if (ValidStr(_model.peResult)) { + _model.peResult = @"/"; + } + if (ValidStr(_model.unit)) { + _model.unit = @"/"; + } + if (ValidStr(_model.printContext)) { + _model.printContext = @"/"; + } + if (ValidStr(_model.peItemName)) { + _model.peItemName = @"/"; + } + self.nameLabel.text = _model.peItemName; + + + if (_model.peResult.length >= 5) { + + self.resultLabel.text =@""; + self.detailBtn.hidden = false; + }else + { + self.resultLabel.text = _model.peResult; + self.detailBtn.hidden = true; + } + self.danweiLabel.text = _model.unit; + self.caokaoLabel.text = _model.printContext; + + + if ([_model.colour integerValue] == 1) { + + self.nameLabel.textColor = UIColorHex(#DA180F); + self.resultLabel.textColor = UIColorHex(#DA180F); + self.danweiLabel.textColor = UIColorHex(#DA180F); + self.caokaoLabel.textColor = UIColorHex(#DA180F); + }else + { + self.nameLabel.textColor = UIColorHex(#333333); + self.resultLabel.textColor = UIColorHex(#333333); + self.danweiLabel.textColor = UIColorHex(#333333); + self.caokaoLabel.textColor = UIColorHex(#333333); + } + +} + +- (void)showResultDetail { + + + UIView * popbackView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)]; + self.popbackView = popbackView; + popbackView.backgroundColor = RGBA(0, 0, 0, 0.5); + + + + UIScrollView * centerView = [[UIScrollView alloc] initWithFrame:CGRectMake(kRealValue(15), kRealValue(154), kScreenWidth - kRealValue(30), 200)]; + centerView.backgroundColor = KWhiteColor; + centerView.layer.cornerRadius = 10.0; + [popbackView addSubview:centerView]; + + UILabel * connteLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 20, centerView.width - 20, 50)]; + connteLabel.text = [NSString stringWithFormat:@"%@",self.model.peResult] ; + connteLabel.numberOfLines = 0; + connteLabel.font = SYSTEMFONT(14); + connteLabel.textAlignment = NSTextAlignmentLeft; + connteLabel.textColor = CFontColor1; + [centerView addSubview:connteLabel]; + + CGFloat h = [XJDCommonUtils getSpaceLabelHeight:connteLabel AndLeftisTrue:true withStr:connteLabel.text withFont:[UIFont systemFontOfSize:14] withWidth:connteLabel.width withLineSpacing:5]; + + connteLabel.height = h; + + centerView.height = h + 69; + + if (h > kScreenHeight - kRealValue(180)) { + + centerView.height = kRealValue(450); + centerView.contentSize = CGSizeMake(centerView.width, h); + } + + UIButton * sureBtn = [[UIButton alloc] initWithFrame:CGRectMake(kRealValue(15), centerView.bottom- 15, kScreenWidth - kRealValue(30), 49)]; + [sureBtn setTitle:@"确定" forState:UIControlStateNormal]; + sureBtn.titleLabel.font = SYSTEMFONT(13); + sureBtn.backgroundColor = KWhiteColor; + sureBtn.layer.cornerRadius = 10; + [sureBtn setTitleColor:UIColorHex(#21BEBD) forState:UIControlStateNormal]; + [sureBtn addTarget:self action:@selector(sureAction) forControlEvents:UIControlEventTouchUpInside]; + [popbackView addSubview:sureBtn]; + + + [kAppWindow addSubview:popbackView]; +} + +- (void)sureAction { + + [self.popbackView removeFromSuperview]; +} +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDSickNameTopTableViewCell.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDSickNameTopTableViewCell.h new file mode 100644 index 0000000..040a850 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDSickNameTopTableViewCell.h @@ -0,0 +1,23 @@ +// +// XJDSickNameTopTableViewCell.h +// DoctorXinjiang +// +// Created by 仁康信息 on 2023/8/29. +// + +#import +#import "XJDHealthPhyReportModel.h" +NS_ASSUME_NONNULL_BEGIN + +typedef void(^onekeyQuestionBlock)(NSString * itemID); + +@interface XJDSickNameTopTableViewCell : UITableViewCell + +@property (nonatomic, strong) XJDThirdResultResModel * model; +@property (nonatomic, copy) onekeyQuestionBlock itemBlock; +@property (nonatomic, copy) NSString * uniItemClassId; +@property (nonatomic, assign) NSInteger questionType; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDSickNameTopTableViewCell.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDSickNameTopTableViewCell.m new file mode 100644 index 0000000..cdfe52d --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDSickNameTopTableViewCell.m @@ -0,0 +1,134 @@ +// +// SickNameTopTableViewCell.m +// DoctorXinjiang +// +// Created by 仁康信息 on 2023/8/29. +// + +#import "XJDSickNameTopTableViewCell.h" + +@interface XJDSickNameTopTableViewCell () + +@property (nonatomic, strong ) UILabel * sickNameLabel; +@property (nonatomic, strong ) YYLabel * oneKeyLabel; + +@end + +@implementation XJDSickNameTopTableViewCell + +- (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 { + + UIView * linV = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(15), kRealValue(15), 2, kRealValue(13))]; + linV.backgroundColor = UIColorHex(#21BEBD); + [self.contentView addSubview:linV]; + + self.sickNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(linV.right + kRealValue(10), kRealValue(15), 100, 16)]; + self.sickNameLabel.textAlignment = NSTextAlignmentLeft; + self.sickNameLabel.font = BOLDSYSTEMFONT(15); + self.sickNameLabel.textColor = CFontColor1; + [self.contentView addSubview:self.sickNameLabel]; + + self.oneKeyLabel = [[YYLabel alloc] initWithFrame:CGRectMake(kScreenWidth - kRealValue(15) - 130 , kRealValue(15), 130, 16)]; + self.oneKeyLabel.textAlignment = NSTextAlignmentRight; + self.oneKeyLabel.font = BOLDSYSTEMFONT(13); + self.oneKeyLabel.textColor = KRedColor; + self.oneKeyLabel.text = @"专家库一键咨询 >"; + self.oneKeyLabel.hidden = true; + [self.oneKeyLabel setTextTapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) { + [self doctorQuestion]; + }]; + [self.contentView addSubview:self.oneKeyLabel]; + + UIView * headView = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(15), self.sickNameLabel.bottom + kRealValue(12), kScreenWidth - kRealValue(30), kRealValue(40))]; + headView.backgroundColor = RGBA(33, 190, 189, 0.5); + [self.contentView addSubview:headView]; + + UILabel * nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, kRealValue(127), kRealValue(40))]; + nameLabel.text = @"名称"; + nameLabel.textAlignment = NSTextAlignmentCenter; + nameLabel.font = SYSTEMFONT(13); + [headView addSubview:nameLabel]; + + CGFloat tabWidth = (kScreenWidth - kRealValue(30) - kRealValue(127) - 4)/3; + + UIView * linName = [[UIView alloc] initWithFrame:CGRectMake(nameLabel.right, 0, 1, nameLabel.height)]; + linName.backgroundColor = CLineColor; + [headView addSubview:linName]; + + UILabel * reslutLabel = [[UILabel alloc] initWithFrame:CGRectMake(linName.right , 0, tabWidth, kRealValue(40))]; + reslutLabel.text = @"结果"; + reslutLabel.textAlignment = NSTextAlignmentCenter; + reslutLabel.font = SYSTEMFONT(13); + [headView addSubview:reslutLabel]; + + UIView * resName = [[UIView alloc] initWithFrame:CGRectMake(reslutLabel.right, 0, 1, nameLabel.height)]; + resName.backgroundColor = CLineColor; + [headView addSubview:resName]; + + UILabel * danweiLabel = [[UILabel alloc] initWithFrame:CGRectMake(resName.right, 0, tabWidth, kRealValue(40))]; + danweiLabel.text = @"单位"; + danweiLabel.textAlignment = NSTextAlignmentCenter; + danweiLabel.font = SYSTEMFONT(13); + [headView addSubview:danweiLabel]; + + UIView * danweiLine = [[UIView alloc] initWithFrame:CGRectMake(danweiLabel.right, 0, 1, nameLabel.height)]; + danweiLine.backgroundColor = CLineColor; + [headView addSubview:danweiLine]; + + UILabel * zhiLabel = [[UILabel alloc] initWithFrame:CGRectMake(danweiLine.right, 0, tabWidth, kRealValue(40))]; + zhiLabel.text = @"参考值"; + zhiLabel.textAlignment = NSTextAlignmentCenter; + zhiLabel.font = SYSTEMFONT(13); + [headView addSubview:zhiLabel]; +} + +- (void)setModel:(XJDThirdResultResModel *)model { + + _model = model; + + self.sickNameLabel.text = _model.peItemName; + +} + + +- (void)doctorQuestion { + + if (self.itemBlock) { + + self.itemBlock(self.model.third_tId); + } +} + +- (void)setQuestionType:(NSInteger)questionType { + + _questionType = questionType; + + if (_questionType == 2) { + self.oneKeyLabel.hidden = false; + }else + { + self.oneKeyLabel.hidden = true; + } + +} +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDimageReportTableViewCell.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDimageReportTableViewCell.h new file mode 100644 index 0000000..dc52194 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDimageReportTableViewCell.h @@ -0,0 +1,22 @@ +// +// XJDimageReportTableViewCell.h +// DoctorXinjiang +// +// Created by Apple on 2024/2/23. +// + +#import +#import "XJDHealthPhyReportModel.h" +NS_ASSUME_NONNULL_BEGIN + +typedef void(^lookUserReport)(NSString * lookUrl); + +@interface XJDimageReportTableViewCell : UITableViewCell + +@property (nonatomic, strong) XJDImageItemListModel * model; + +@property (nonatomic, copy) lookUserReport lookBlock; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDimageReportTableViewCell.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDimageReportTableViewCell.m new file mode 100644 index 0000000..b7bcaea --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/XJDimageReportTableViewCell.m @@ -0,0 +1,235 @@ +// +// imageReportTableViewCell.m +// DoctorXinjiang +// +// Created by Apple on 2024/2/23. +// + +#import "XJDimageReportTableViewCell.h" + +@interface XJDimageReportTableViewCell () + +@property (nonatomic, strong) UILabel * reportLabel; + +@property (nonatomic, strong) UIView * reportConetView; + +@property (nonatomic, strong) UILabel * resultLabel; + +@property (nonatomic, strong) UIView * conteLineView; + +@property (nonatomic, strong) NSMutableArray * buttonArray; +@property (nonatomic, strong) NSMutableArray * reportArray; +@property (nonatomic, strong) NSMutableArray * imageArray; + + +@end + +@implementation XJDimageReportTableViewCell + +- (NSMutableArray *)buttonArray { + + if (!_buttonArray) { + + _buttonArray = [[NSMutableArray alloc] init]; + } + return _buttonArray; +} + +- (NSMutableArray *)reportArray { + + if (!_reportArray) { + + _reportArray = [[NSMutableArray alloc] init]; + } + return _reportArray; +} + +- (NSMutableArray *)imnageArray { + + if (!_imageArray) { + + _imageArray = [[NSMutableArray alloc] init]; + } + return _imageArray; +} +- (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 { + + UIView * linV = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(15), kRealValue(15), 2, kRealValue(13))]; + linV.backgroundColor = UIColorHex(#21BEBD); + [self.contentView addSubview:linV]; + + self.reportLabel = [[UILabel alloc] initWithFrame:CGRectMake(linV.right + kRealValue(10), kRealValue(15), kScreenWidth - kRealValue(20), 16)]; + self.reportLabel.textAlignment = NSTextAlignmentLeft; + self.reportLabel.font = BOLDSYSTEMFONT(15); + self.reportLabel.textColor = CFontColor1; + self.reportLabel.text = @"--"; + [self.contentView addSubview:self.reportLabel]; + + self.reportConetView = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(15),self.reportLabel.bottom + kRealValue(15), kScreenWidth - kRealValue(30), kRealValue(13))]; + self.reportConetView.backgroundColor = RGBA(245, 247, 251, 1); + [self.contentView addSubview:self.reportConetView]; + + self.resultLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(16), kRealValue(15), self.reportConetView.width - kRealValue(32), 13)]; + self.resultLabel.textAlignment = NSTextAlignmentLeft; + self.resultLabel.font = MEDIUMFONT(13); + self.resultLabel.textColor = CFontColor1; + self.resultLabel.numberOfLines = 0; + self.resultLabel.text = @"--"; + [self.reportConetView addSubview:self.resultLabel]; + + self.conteLineView = [[UIView alloc] initWithFrame:CGRectMake(0,self.resultLabel.bottom + kRealValue(38), self.reportConetView.width, kRealValue(1))]; + self.conteLineView.backgroundColor = UIColorHex(#E7EAF2); + [self.reportConetView addSubview:self.conteLineView]; + +} + +- (void)setModel:(XJDImageItemListModel *)model { + + _model = model; + + self.reportLabel.text = _model.imageCheckName; + + self.resultLabel.text = _model.reportContent; + + self.resultLabel.height = _model.textHeight; + + if (_model.textHeight < 13) { + + self.conteLineView.top = self.resultLabel.bottom + kRealValue(38); + self.reportConetView.height = kRealValue(15) + 13 + kRealValue(38) + kRealValue(44); + } + else + { + self.conteLineView.top = self.resultLabel.bottom + kRealValue(18); + self.reportConetView.height = kRealValue(15) + _model.textHeight + kRealValue(18) + kRealValue(44); + + } + + + + + + + + for (UIButton * toolsBtn in self.buttonArray) { + [toolsBtn removeFromSuperview]; + } + [self.buttonArray removeAllObjects]; + [self.imnageArray removeAllObjects]; + [self.reportArray removeAllObjects]; + + //原始报告 + CGFloat buttonW = (self.reportConetView.width - kRealValue(75) )/ 4; //1行最多4个 + + NSArray * yuanshiArray = [_model.reportUrl componentsSeparatedByString:@","]; + [self.reportArray addObjectsFromArray:yuanshiArray]; + CGFloat lastX = 0; + for (int i = 0 ; i < yuanshiArray.count; i ++) { + + UIButton * lookYuanshi = [[UIButton alloc] initWithFrame:CGRectMake(self.reportConetView.width - kRealValue(15) - (buttonW + kRealValue(15)) * i, self.conteLineView.bottom + kRealValue(6), kRealValue(80), kRealValue(30))]; + [lookYuanshi setTitle:@"原始报告" forState:UIControlStateNormal]; + lookYuanshi.titleLabel.font = SYSTEMFONT(13); + lookYuanshi.layer.cornerRadius = 15.0; + lookYuanshi.layer.borderWidth = 1.0; + [lookYuanshi setTitleColor:UIColorHex(#21BEBD) forState:UIControlStateNormal]; + lookYuanshi.layer.borderColor = UIColorHex(#21BEBD).CGColor; + lookYuanshi.layer.masksToBounds = true; + lookYuanshi.tag = 2000+ i; + [self.buttonArray addObject:lookYuanshi]; + + } + //影像原片 + NSArray * yingxiangArray = [_model.imageShowUrl componentsSeparatedByString:@","]; + [self.imageArray addObjectsFromArray:yingxiangArray]; + for (int i = 0 ; i < yingxiangArray.count; i ++) { + + UIButton * lookyingxiang = [[UIButton alloc] initWithFrame:CGRectMake(kRealValue(15) - (buttonW + kRealValue(15)) * i, self.conteLineView.bottom + kRealValue(6), kRealValue(80), kRealValue(30))]; + [lookyingxiang setTitle:@"影像原片" forState:UIControlStateNormal]; + lookyingxiang.titleLabel.font = SYSTEMFONT(13); + lookyingxiang.layer.cornerRadius = 15.0; + lookyingxiang.layer.borderWidth = 1.0; + lookyingxiang.layer.borderColor = UIColorHex(#21BEBD).CGColor; + lookyingxiang.layer.masksToBounds = true; + [lookyingxiang setTitleColor:UIColorHex(#21BEBD) forState:UIControlStateNormal]; + + lookyingxiang.tag = 1000+ i; + [self.buttonArray addObject:lookyingxiang]; + } + + + + //布局多组按钮 + //一行的列数 + NSInteger cols = 4; + //label大小 + CGFloat labW = buttonW ; + CGFloat labH = kRealValue(30); + CGFloat pading = kRealValue(15); + //每一行的间距 + CGFloat rowMargin = kRealValue(15); + for (int index = 0; index < self.buttonArray.count ; index ++) { + //所在列 + NSInteger col = index % cols; + //所在行 + NSInteger row = index / cols; + + CGFloat shopX = col * (labW + rowMargin); + CGFloat shopY = row * (labH + rowMargin); + UIButton * toolsBtn = self.buttonArray[index]; + toolsBtn.frame = CGRectMake(self.reportConetView.width - shopX - pading - buttonW , self.conteLineView.bottom + kRealValue(6) + shopY, labW, labH); + if (index == self.buttonArray.count - 1) { + lastX = toolsBtn.bottom + kRealValue(7); + } + [toolsBtn addTarget:self action:@selector(lookImageReport:) forControlEvents:UIControlEventTouchUpInside]; + [self.reportConetView addSubview:toolsBtn]; + + } + self.reportConetView.height = lastX; + +} + +- (void)lookImageReport:(UIButton *)lookBtn { + + NSLog(@"%d",lookBtn.tag); + //影片原像 + if (lookBtn.tag < 2000) { + + if (self.lookBlock) { + self.lookBlock(self.imageArray[lookBtn.tag - 1000]); + } + + }else //原始报告 + { + if (self.lookBlock) { + self.lookBlock(self.reportArray[lookBtn.tag - 2000]); + } + } + + + + +} + + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/YXSickNameSubTableViewCell.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/YXSickNameSubTableViewCell.h deleted file mode 100644 index 12e1b94..0000000 --- a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionDetail(咨询详情)/YXSickNameSubTableViewCell.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// YXSickNameSubTableViewCell.h -// DoctorXinjiang -// -// Created by 仁康信息 on 2023/8/29. -// - -#import -#import "YXHealthPhyReportModel.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface YXSickNameSubTableViewCell : UITableViewCell - -@property (nonatomic, strong) YXThirdResultResModel * model; - -@end - -NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionRecord(咨询记录)/XJDAudioVideoRecordViewController.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionRecord(咨询记录)/XJDAudioVideoRecordViewController.h new file mode 100644 index 0000000..3cc07f9 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionRecord(咨询记录)/XJDAudioVideoRecordViewController.h @@ -0,0 +1,19 @@ +// +// XJDAudioVideoRecordViewController.h +// healthQuestion +// +// Created by 仁康信息 on 2023/4/28. +// + +#import "YXBaseViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDAudioVideoRecordViewController : YXBaseViewController + +@property (nonatomic, assign) NSInteger questionType; +@property (nonatomic, assign) NSInteger questionStatus; //待回复10 进行中20 已完成30 (时间充裕可优化枚举类型) + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionRecord(咨询记录)/XJDAudioVideoRecordViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionRecord(咨询记录)/XJDAudioVideoRecordViewController.m new file mode 100644 index 0000000..6d12538 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionRecord(咨询记录)/XJDAudioVideoRecordViewController.m @@ -0,0 +1,286 @@ +// +// XJDAudioVideoRecordViewController.m +// healthQuestion +// +// Created by 仁康信息 on 2023/4/28. +// + +#import "XJDAudioVideoRecordViewController.h" +#import "XJDQuestionRecoredTable.h" +#import "XJDQuestionDetailViewController.h" +#import "LYEmptyView.h" +#import "LYEmptyViewHeader.h" +@interface XJDAudioVideoRecordViewController () + +@property (nonatomic, strong) XJDQuestionRecoredTable * homeTable; + +@property (nonatomic, strong) NSMutableArray * buttonArray; + +@property (nonatomic, strong) NSMutableArray * dataArray; + +@property (nonatomic, assign) NSInteger pageNo; + +@property (nonatomic, copy) NSString * status; + +@end + +@implementation XJDAudioVideoRecordViewController + +- (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.navigationItem.title = @"视频咨询"; + [self createUI]; + [self createData]; +} + +- (void)createData { + + [self showMBProgressHUDWithString:@"数据加载中,请稍候..." autoHidden:NO]; + XJDNetAPI * listApi = [[XJDNetAPI alloc] init:self tag:@"LIST" NeedToken:@""]; + + NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; + [parmDic setObject:@(self.pageNo) forKey:@"pageNo"]; + [parmDic setObject:@(10) forKey:@"pageSize"]; + [parmDic setObject:@"2" forKey:@"type"]; + [parmDic setObject:self.status forKey:@"status"]; + [listApi GetQuestionRecoredList:parmDic]; + +} + +- (void)viewWillAppear:(BOOL)animated { + + [super viewWillAppear:animated]; + [self.homeTable.mj_header beginRefreshing]; + + +} +- (void)createUI { + + NSArray * array = @[@"待确认",@"进行中",@"已完成"]; + [self.buttonArray removeAllObjects]; + CGFloat w = kRealValue(66); + 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; + [self.view addSubview:listBtn]; + listBtn.tag = 100 + index; + [self.buttonArray addObject:listBtn]; + + } + + + + self.homeTable = [[XJDQuestionRecoredTable alloc] initWithFrame:CGRectMake(0, 50, kScreenWidth, kScreenHeight - kTopHeight - kRealValue(15) + 27 - SafetyAreaHeight - kRealValue(48)) style:UITableViewStyleGrouped]; + MJWeakSelf + self.homeTable.videoBlock = ^(XJDRecordIMListDateModel * _Nonnull model) { + + XJDQuestionDetailViewController * detailVC = [[XJDQuestionDetailViewController alloc] init]; + detailVC.question_id = model.Record_id; + [weakSelf.navigationController pushViewController:detailVC animated:YES]; + + }; + [self.view addSubview:self.homeTable]; + + + self.homeTable.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{ + weakSelf.pageNo = 1; + [self createData]; + + }]; + self.homeTable.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{ + weakSelf.pageNo ++; + [self createData]; + + }]; + + //初始化一个emptyView + + LYEmptyView *emptyView = [LYEmptyView emptyViewWithImage:[UIImage imageNamed:@"nodataPicture"] titleStr:@"暂无数据" detailStr:@""]; + +// LYEmptyView *emptyView = [LYEmptyView emptyActionViewWithImageStr:@"nodataPicture" +// titleStr:@"无数据" +// detailStr:@"请稍后再试!" +// btnTitleStr:@"重新加载" +// btnClickBlock:^{ +// [self createData]; +// }]; + //元素竖直方向的间距 + emptyView.subViewMargin = 20.f; + //标题颜色 + emptyView.titleLabTextColor = UIColorHex(#666666); + //描述字体 + emptyView.detailLabFont = [UIFont systemFontOfSize:16]; + //按钮背景色 + emptyView.imageSize = CGSizeMake(kRealValue(210), kRealValue(183)); + emptyView.contentViewY = kRealValue(160); + //设置空内容占位图 + self.homeTable.ly_emptyView = emptyView; +} + +-(void)setQuestionStatus:(NSInteger)questionStatus { + + _questionStatus = questionStatus; + + + + switch (_questionStatus) { + case 10: + for (UIButton * seleBtn in self.buttonArray) { + if (seleBtn.tag == 100) { + seleBtn.selected = YES; + seleBtn.backgroundColor = UIColorHex(#21BEBD); + }else + { + seleBtn.backgroundColor = UIColorHex(#DDDDDD); + } + } + self.status = @"1"; + [self createData]; + break; + case 20: + for (UIButton * seleBtn in self.buttonArray) { + if (seleBtn.tag == 101) { + seleBtn.selected = YES; + seleBtn.backgroundColor = UIColorHex(#21BEBD); + }else + { + seleBtn.backgroundColor = UIColorHex(#DDDDDD); + } + + } + self.status = @"2"; + [self createData]; + break; + case 30: + for (UIButton * seleBtn in self.buttonArray) { + if (seleBtn.tag == 102) { + seleBtn.selected = YES; + seleBtn.backgroundColor = UIColorHex(#21BEBD); + }else + { + seleBtn.backgroundColor = UIColorHex(#DDDDDD); + } + } + self.status = @"3"; + [self createData]; + break; + + default: + break; + } +} + +- (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:@"LIST"]) { + [self hiddenAllMBProgressHUD]; + if (self.pageNo == 1) { + [self.dataArray removeAllObjects]; + } + NSArray * array = response ; + + for (NSDictionary * dic in array) { + + XJDRecordIMListDateModel * model = [XJDRecordIMListDateModel modelWithDictionary:dic]; + + [self.dataArray addObject:model]; + } + self.homeTable.dataArray = self.dataArray; + + } + +} + + +- (void)statusChange:(UIButton *)statusBtn { + [self.dataArray removeAllObjects]; + if (statusBtn.tag == 100) { + self.status = @"1"; + } + if (statusBtn.tag == 101) { + self.status = @"2"; + + } + if (statusBtn.tag == 102) { + self.status = @"3"; + + } + [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); + } + + } +} + + + + + +/* +#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 diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionRecord(咨询记录)/XJDPictureRecordViewController.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionRecord(咨询记录)/XJDPictureRecordViewController.h new file mode 100644 index 0000000..1efaede --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionRecord(咨询记录)/XJDPictureRecordViewController.h @@ -0,0 +1,19 @@ +// +// XJDPictureRecordViewController.h +// healthQuestion +// +// Created by 仁康信息 on 2023/4/28. +// + +#import "YXBaseViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDPictureRecordViewController : YXBaseViewController + +@property (nonatomic, assign) NSInteger questionType; +@property (nonatomic, assign) NSInteger questionStatus; //待回复10 进行中20 已完成30 (时间充裕可优化枚举类型) + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionRecord(咨询记录)/XJDPictureRecordViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionRecord(咨询记录)/XJDPictureRecordViewController.m new file mode 100644 index 0000000..182c881 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionRecord(咨询记录)/XJDPictureRecordViewController.m @@ -0,0 +1,588 @@ +// +// XJDPictureRecordViewController.m +// healthQuestion +// +// Created by 仁康信息 on 2023/4/28. +// + +#import "XJDPictureRecordViewController.h" +#import "XJDQuestionRecoredTable.h" +#import "XJDQuestionRecordModel.h" +#import "XJDRecordIMListDateModel.h" +#import "ChatViewController.h" + +#import "TUIConversationListBaseDataProvider.h" + +#import +#import +#import +#import +#import "TUIConversationCellData.h" +#import "LYEmptyView.h" +#import "LYEmptyViewHeader.h" +@interface XJDPictureRecordViewController () + +@property (nonatomic, strong) XJDQuestionRecoredTable * homeTable; + +@property (nonatomic, strong) NSMutableArray * buttonArray; + +@property (nonatomic, strong) NSMutableArray * dataArray; + +@property (nonatomic, strong) NSMutableArray * IMDataArray; + + +@property (nonatomic, strong) NSMutableArray * groupIDArray; + +@property (nonatomic, strong) NSMutableArray * jingxingArray; + +@property (nonatomic, assign) NSInteger pageNo; + +@property (nonatomic, copy) NSString * status; + +@property (nonatomic, assign) NSInteger tfReply; + + +@end + +@implementation XJDPictureRecordViewController + +- (NSMutableArray *)buttonArray { + + if (!_buttonArray) { + + _buttonArray = [[NSMutableArray alloc] init]; + + } + return _buttonArray; +} + +- (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 *)IMDataArray { + + if (!_IMDataArray) { + _IMDataArray = [[NSMutableArray alloc] init]; + } + return _IMDataArray; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. + self.isHidenNaviBar = false; + self.navigationItem.title = @"图文咨询"; + self.pageNo = 1; + [self loginImAccount]; + [self createUI]; + // self 为 id 类型 + [[V2TIMManager sharedInstance] addConversationListener:self]; +} + +- (void)createUI { + + NSArray * array = @[@"待回复",@"进行中",@"已完成"]; + [self.buttonArray removeAllObjects]; + CGFloat w = kRealValue(66); + 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 = 100 + index; + [self.view addSubview:listBtn]; + [self.buttonArray addObject:listBtn]; + + } + + + + self.homeTable = [[XJDQuestionRecoredTable alloc] initWithFrame:CGRectMake(0, 50, kScreenWidth, kScreenHeight - kTopHeight - kRealValue(15) + 27 - SafetyAreaHeight - kRealValue(48)) style:UITableViewStyleGrouped]; + self.homeTable.recordBlock = ^(XJDRecordIMListDateModel * _Nonnull model) { + + if ([ESCTUIManager TUIUserStatus] == false) { + + + [self loginImAccount]; + return; + } + + ChatViewController * chatVC = [[ChatViewController alloc] init]; + chatVC.isGroupID = YES; + chatVC.chatID = model.imId; + chatVC.isVideo = false; + chatVC.eableSendReport = YES; + chatVC.eableMapTools = false; + chatVC.eableMapTools = false; + chatVC.navTitle = model.memberName; + chatVC.eablehaveHelathData = YES; + chatVC.pictureEnd_id = model.Record_id; + chatVC.questionType = 2; + chatVC.memberSex = model.memberSex; + if ([model.contentStatus intValue] >= 4) + { + chatVC.isHideKeyBord = true; + } + [self.navigationController pushViewController:chatVC animated:YES]; + + + + }; + [self.view addSubview:self.homeTable]; + + + + __weak __typeof(self) weakSelf = self; + self.homeTable.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{ + weakSelf.pageNo = 1; + if ([self.status intValue] == 0) { + [self waitReplayTUIList]; + } + if ([self.status intValue] == 1) { + [self getChatList]; + } + if ([self.status intValue] == 2) { + [self createData]; + } + + + + }]; + self.homeTable.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{ + weakSelf.pageNo ++; + if ([self.status intValue] == 0) { + [self waitReplayTUIList]; + } + if ([self.status intValue] == 1) { + [self getChatList]; + } + if ([self.status intValue] == 2) { + [self createData]; + } + + }]; + + //初始化一个emptyView + + LYEmptyView *emptyView = [LYEmptyView emptyViewWithImage:[UIImage imageNamed:@"nodataPicture"] titleStr:@"暂无数据" detailStr:@""]; + +// LYEmptyView *emptyView = [LYEmptyView emptyActionViewWithImageStr:@"nodataPicture" +// titleStr:@"无数据" +// detailStr:@"请稍后再试!" +// btnTitleStr:@"重新加载" +// btnClickBlock:^{ +// [self createData]; +// }]; + //元素竖直方向的间距 + emptyView.subViewMargin = 20.f; + //标题颜色 + emptyView.titleLabTextColor = UIColorHex(#666666); + //描述字体 + emptyView.detailLabFont = [UIFont systemFontOfSize:16]; + //按钮背景色 + emptyView.imageSize = CGSizeMake(kRealValue(210), kRealValue(183)); + emptyView.contentViewY = kRealValue(160); + //设置空内容占位图 + self.homeTable.ly_emptyView = emptyView; +} + +- (void)viewWillAppear:(BOOL)animated { + + [super viewWillAppear:animated]; + + [self.homeTable.mj_header beginRefreshing]; + + +} + +- (void)createData { + + [self showMBProgressHUDWithString:@"数据加载中,请稍候..." autoHidden:false]; + XJDNetAPI * listApi = [[XJDNetAPI alloc] init:self tag:@"LIST" NeedToken:@""]; + + NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; + [parmDic setObject:@(self.pageNo) forKey:@"pageNo"]; + [parmDic setObject:@(10) forKey:@"pageSize"]; + [parmDic setObject:@"1" forKey:@"type"]; + [parmDic setObject:self.status forKey:@"status"]; + [listApi GetQuestionRecoredList:parmDic]; + +} + +//待回复 +- (void)waitReplayTUIList { + + V2TIMConversationListFilter *filter = [[V2TIMConversationListFilter alloc] init]; + filter.hasUnreadCount = NO; + [[V2TIMManager sharedInstance] getConversationListByFilter:filter nextSeq:self.pageNo - 1 count:100 succ:^(NSArray *list, uint64_t nextSeq, BOOL isFinished) { + // 获取会话列表成功,list 为会话列表 + [self.groupIDArray removeAllObjects]; + [self.IMDataArray removeAllObjects]; + for (V2TIMConversation * v2Model in list) { + if ( !ValidStr(v2Model.groupID)) { + [self.groupIDArray addObject: v2Model.groupID]; + } + [self.IMDataArray addObject:v2Model]; + + } + [self postGroupArray:self.groupIDArray]; + } fail:^(int code, NSString *desc) { + // 获取会话列表失败 + [self loginImAccount]; + }]; + +} + +//获取腾讯im会话列表 +- (void)getChatList { + + + V2TIMConversationListFilter *filter = [[V2TIMConversationListFilter alloc] init]; +// filter.type = V2TIM_C2C; //拉取单聊会话 + filter.type = V2TIM_GROUP; //拉取群聊会话 + [[V2TIMManager sharedInstance] getConversationListByFilter:filter nextSeq:self.pageNo - 1 count:50 succ:^(NSArray *list, uint64_t nextSeq, BOOL isFinished) { + // 获取会话列表成功,list 为会话列表 + [self.groupIDArray removeAllObjects]; + [self.IMDataArray removeAllObjects]; + DLog(@"%@",list); + for (V2TIMConversation * v2Model in list) { + [self.groupIDArray addObject: [NSString stringWithFormat:@"%@",v2Model.groupID] ]; + [self.IMDataArray addObject:v2Model]; + } + [self postIngGroupArray:self.groupIDArray]; + } fail:^(int code, NSString *desc) { + // 获取会话列表失败 + [self loginImAccount]; + }]; + + +} + +#pragma mark:上传id数组 +- (void)postGroupArray:(NSArray *)array { + + NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; + + //tfReply : 待回复0 进行中1 + [parmDic setObject:array forKey:@"imIds"]; + [parmDic setObject:@"0" forKey:@"tfReply"]; + + [self showMBProgressHUDWithString:@"数据加载中,请稍候..." autoHidden:false]; + XJDNetAPI * recordApi = [[XJDNetAPI alloc] init:self tag:@"GROUPID" NeedToken:@""]; + [recordApi PostGroupIDArray:parmDic]; +} + + +- (void)postIngGroupArray:(NSArray *)array { + + NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; + + //tfReply : 待回复0 进行中1 + [parmDic setObject:array forKey:@"imIds"]; + [parmDic setObject:@"1" forKey:@"tfReply"]; + + [self showMBProgressHUDWithString:@"数据加载中,请稍候..." autoHidden:false]; + XJDNetAPI * recordApi = [[XJDNetAPI alloc] init:self tag:@"GROUPIDING" NeedToken:@""]; + [recordApi PostGroupIDArray:parmDic]; +} + + +-(void)setQuestionStatus:(NSInteger)questionStatus { + + _questionStatus = questionStatus; + + + + switch (_questionStatus) { + case 10: + for (UIButton * seleBtn in self.buttonArray) { + if (seleBtn.tag == 100) { + seleBtn.selected = YES; + seleBtn.backgroundColor = UIColorHex(#21BEBD); + }else + { + seleBtn.backgroundColor = UIColorHex(#DDDDDD); + } + } + self.status = @"0"; + [self waitReplayTUIList]; + break; + case 20: + for (UIButton * seleBtn in self.buttonArray) { + if (seleBtn.tag == 101) { + seleBtn.selected = YES; + seleBtn.backgroundColor = UIColorHex(#21BEBD); + }else + { + seleBtn.backgroundColor = UIColorHex(#DDDDDD); + } + + } + self.status = @"1"; + [self getChatList]; + break; + case 30: + for (UIButton * seleBtn in self.buttonArray) { + if (seleBtn.tag == 102) { + seleBtn.selected = YES; + seleBtn.backgroundColor = UIColorHex(#21BEBD); + }else + { + seleBtn.backgroundColor = UIColorHex(#DDDDDD); + } + } + self.status = @"2"; + [self createData]; + break; + + default: + break; + } +} + +- (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:@"LIST"]) { + [self hiddenAllMBProgressHUD]; + if (self.pageNo == 1) { + [self.dataArray removeAllObjects]; + } + NSArray * array = response ; + + for (NSDictionary * dic in array) { + + XJDRecordIMListDateModel * model = [XJDRecordIMListDateModel modelWithDictionary:dic]; + + [self.dataArray addObject:model]; + } + self.homeTable.dataArray = self.dataArray; + + } + + if ([tag isEqualToString:@"IMAPI"]) { + [self hiddenAllMBProgressHUD]; + NSDictionary * pamrDic = response; + + XJDIMUserInfoModel * model = [XJDIMUserInfoModel modelWithDictionary:pamrDic]; + + XJDIMUserInfoModel * iminfoModel = [[XJDIMUserInfoModel alloc] init]; + iminfoModel.IMInfo = pamrDic; + [XJDCommonUtils 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 的实现类,如果您不需要监听 IM SDK 的事件,这个步骤可以忽略。 + // 5. 初始化 IM SDK,调用这个接口后,可以立即调用登录接口。 + [[V2TIMManager sharedInstance] initSDK:[model.sdkAppId intValue] config:config]; + [ESCTUIManager loginInitTUISDKAppidWith:[model.sdkAppId intValue] UserID:model.userId userSig:model.userSig]; + if ([self.status intValue] == 0) { + [self waitReplayTUIList]; + } + if ([self.status intValue] == 1) { + [self getChatList]; + } + + + + } + if ([tag isEqualToString:@"GROUPID"]) { + [self hiddenAllMBProgressHUD]; + + NSArray * array = response; + [self.jingxingArray removeAllObjects]; +// for ( V2TIMConversation * v2Model in self.IMDataArray) { + + for (NSDictionary * parmDic in array) { + + XJDRecordIMListDateModel * model = [ XJDRecordIMListDateModel modelWithDictionary:parmDic]; + for ( V2TIMConversation * v2Model in self.IMDataArray) { + if ([model.imId isEqualToString:v2Model.groupID]) { + DLog(@"------------%d",v2Model.unreadCount); + model.unRedMessage = [NSString stringWithFormat:@"%d",v2Model.unreadCount]; + } + } + [self.jingxingArray addObject:model]; + } +// } + + self.homeTable.dataArray = self.jingxingArray; + } + if ([tag isEqualToString:@"GROUPIDING"]) { + [self hiddenAllMBProgressHUD]; + + NSArray * array = response; + [self.jingxingArray removeAllObjects]; +// for ( V2TIMConversation * v2Model in self.IMDataArray) { + + for (NSDictionary * parmDic in array) { + + XJDRecordIMListDateModel * model = [ XJDRecordIMListDateModel modelWithDictionary:parmDic]; + for ( V2TIMConversation * v2Model in self.IMDataArray) { + if ([model.imId isEqualToString:v2Model.groupID]) { + DLog(@"------------%d",v2Model.unreadCount); + model.unRedMessage = [NSString stringWithFormat:@"%d",v2Model.unreadCount]; + } + } + [self.jingxingArray addObject:model]; + } +// } + + self.homeTable.dataArray = self.jingxingArray; + } + +} + + +- (void)statusChange:(UIButton *)statusBtn { + + if (statusBtn.tag == 100) { + self.status = @"0"; + self.tfReply = 0; + [self waitReplayTUIList]; + } + if (statusBtn.tag == 101) { + self.status = @"1"; + self.tfReply = 1; + [self getChatList]; + + } + if (statusBtn.tag == 102) { + self.status = @"2"; + [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)loginImAccount { + + + XJDNetAPI * proctocolApi = [[XJDNetAPI alloc] init:self tag:@"IMAPI" NeedToken:nil]; + [proctocolApi GetIMLoginAccount:nil]; + + + +} + +- (void)onNewConversation:(NSArray *)conversationList { + // 收到会话新增通知,conversationList 为新增的会话 + [self updateConversation:conversationList]; +} + + +- (void)onConversationChanged:(NSArray *)conversationList { + // 收到会话变更通知,conversationList 中为变更后的会话对象 + [self updateConversation:conversationList]; +} + + + + +- (void)onConversationDeleted:(NSArray *)conversationIDList { + // 会话被删除 +} + + +- (void)onTotalUnreadMessageCountChanged:(UInt64) totalUnreadCount { + // 会话未读总数变化 +} + + + + +- (void)onUnreadMessageCountChangedByFilter:(V2TIMConversationListFilter *)filter totalUnreadCount:(UInt64)totalUnreadCount { + // 过滤条件下的会话未读总数变化 +} + + +- (void)updateConversation:(NSArray *)convList { + // 更新 UI 会话列表,如果 UI 会话列表已经存在该新增/变更的会话,就替换之;如果没有,就新增一个会话对象 + [self.homeTable.mj_header beginRefreshing]; +} + + + +//- (CGFloat)verticalOffsetForEmptyDataSet:(UIScrollView *)scrollView +//{ +// return -self.homeTable.frame.size.height; +//} +/* +#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 diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionRecord(咨询记录)/XJDQustionRecordViewController.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionRecord(咨询记录)/XJDQustionRecordViewController.h new file mode 100644 index 0000000..f715e8e --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionRecord(咨询记录)/XJDQustionRecordViewController.h @@ -0,0 +1,20 @@ +// +// XJDQustionRecordViewController.h +// healthQuestion +// +// Created by 仁康信息 on 2023/4/28. +// + +#import "YXBaseViewController.h" + +NS_ASSUME_NONNULL_BEGIN + + +@interface XJDQustionRecordViewController : YXBaseViewController + +@property (nonatomic, assign) NSInteger questionType; +@property (nonatomic, assign) NSInteger questionStatus; //待回复10 进行中20 已完成30 (时间充裕可优化枚举类型) + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionRecord(咨询记录)/XJDQustionRecordViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionRecord(咨询记录)/XJDQustionRecordViewController.m new file mode 100644 index 0000000..50f1469 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionRecord(咨询记录)/XJDQustionRecordViewController.m @@ -0,0 +1,255 @@ +// +// QustionRecordViewController.m +// healthQuestion +// +// Created by 仁康信息 on 2023/4/28. +// + +#import "XJDQustionRecordViewController.h" +#import "XJDAudioVideoRecordViewController.h" +#import "XJDPictureRecordViewController.h" + +@interface XJDQustionRecordViewController () + +/** 顶部控件*/ +@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 XJDQustionRecordViewController + +#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.title = @"咨询记录"; + self.view.backgroundColor = UIColorBackground; + [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 { + //questionStatus //待回复10 进行中20 已完成30 (时间充裕可优化枚举类型) + XJDPictureRecordViewController * pictureVc = [[XJDPictureRecordViewController alloc] init]; + pictureVc.view.backgroundColor = UIColorBackground; + pictureVc.navigationItem.title = @"图文咨询"; + pictureVc.questionStatus = self.questionStatus; + [self addChildViewController:pictureVc]; + + // + XJDAudioVideoRecordViewController * videoVc = [[XJDAudioVideoRecordViewController alloc] init]; + videoVc.view.backgroundColor = UIColorBackground; + videoVc.navigationItem.title = @"视频咨询"; + videoVc.questionStatus = self.questionStatus; + [self addChildViewController:videoVc]; +} + +#pragma mark - 设置导航条内容 +- (void)setupNavgationBar { + UIScrollView *topView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 1, kScreenHeight, 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 = [UIFont systemFontOfSize:15]; + + btnX = i * btnW; + + titleButton.frame = CGRectMake(btnX, 0, btnW, btnH); + + // 监听按钮点击 + [titleButton addTarget:self action:@selector(titleClick:) forControlEvents:UIControlEventTouchUpInside]; + + [_topView addSubview:titleButton]; + if (i == self.questionType - 1) { + // 添加下划线 + // 下划线宽度 = 按钮文字宽度 + // 下划线中心点x = 按钮中心点x + CGFloat h = 3; + CGFloat y = kRealValue(46) ; + UIView *lineView =[[UIView alloc] init]; + // 位置和尺寸 + lineView.height = h; + // 先计算文字尺寸,在给label去赋值 + [titleButton.titleLabel sizeToFit]; + lineView.width = kScreenWidth/2 - 30; + 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 diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionStatistics(咨询统计)/XJDQuestionStatisticsViewController.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionStatistics(咨询统计)/XJDQuestionStatisticsViewController.h new file mode 100644 index 0000000..37765fd --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionStatistics(咨询统计)/XJDQuestionStatisticsViewController.h @@ -0,0 +1,16 @@ +// +// XJDQuestionStatisticsViewController.h +// healthQuestion +// +// Created by 仁康信息 on 2023/4/26. +// + +#import "YXBaseViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDQuestionStatisticsViewController : YXBaseViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionStatistics(咨询统计)/XJDQuestionStatisticsViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionStatistics(咨询统计)/XJDQuestionStatisticsViewController.m new file mode 100644 index 0000000..5818bb1 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/QuestionStatistics(咨询统计)/XJDQuestionStatisticsViewController.m @@ -0,0 +1,514 @@ +// +// XJDQuestionStatisticsViewController.m +// healthQuestion +// +// Created by 仁康信息 on 2023/4/26. +// + +#import "XJDQuestionStatisticsViewController.h" +#import "AAOptions.h" +#import "AAChartView.h" +#import "NSDate+Calendar.h" +#import "BRDatePickerView.h" +#import "XJDQuestionStaticsModel.h" +#import "XJDBillViewController.h" +@interface XJDQuestionStatisticsViewController () + +@property (nonatomic, strong) AAChartView * aaChartView; + +@property (nonatomic, strong) UILabel * moneyLabel; + +@property (nonatomic, strong) UILabel * leftMoneyLabel; + +@property (nonatomic, strong) UILabel * rightMoneyLabel; + +@property (nonatomic, strong) YYLabel * monthLabel; + +@property (nonatomic, copy) NSString * quesDate; + +@property (nonatomic, strong) NSMutableArray * dataArray; + +@end + +@implementation XJDQuestionStatisticsViewController + +- (NSMutableArray *)dataArray { + if(!_dataArray) { + + _dataArray = [[NSMutableArray alloc] init]; + } + return _dataArray; + +} + +//- (AAChartModel *)configurePieChart { +// return AAChartModel.new +// .chartTypeSet(AAChartTypePie) +// .marginSet(@[@0,@0,@0,@60]) +// .colorsThemeSet(@[@"#407FFF",@"#A682E6"]) +// .dataLabelsEnabledSet(true)//是否直接显示扇形图数据 +// .seriesSet(@[ +// AASeriesElement.new +// .innerSizeSet(@"60%")//内部圆环半径大小占比 +// .sizeSet(@150)//尺寸大小 +// .nameSet(@"人数") +// .borderWidthSet(@0)//描边的宽度 +// .allowPointSelectSet(true)//是否允许在点击数据点标记(扇形图点击选中的块发生位移) +// .statesSet(AAStates.new +// .hoverSet(AAHover.new +// .enabledSet(false)//禁用点击区块之后出现的半透明遮罩层 +// ) +// +// +// ) +// .dataSet(@[ +// @[@"图文咨询", @50], +// @{@"sliced": @true, +// @"selected": @true, +// @"name": @"音视频咨询", +// @"y": @50, }, +// +//// @[@"Safari", @88.5], +//// @[@"Opera", @46.0], +//// @[@"Others", @223.0], +// ])]); +//} +- (AAOptions *)adjustPieChartTitleAndDataLabelFontStyle { + AAOptions *aaOptions = AAOptions.new + .chartSet(AAChart.new.typeSet(AAChartTypePie)) + .titleSet(AATitle.new + .useHTMLSet(true) + .textSet(@" 170
\ + 咨询方式 ")//标题文本内容 + .alignSet(AAChartAlignTypeCenter)//标题水平居中 + .verticalAlignSet(AAChartVerticalAlignTypeMiddle)//标题垂直居中 + .ySet(@0)//标题相对于垂直对齐的偏移量,取值范围:图表的上边距(chart.spacingTop )到图表的下边距(chart.spacingBottom),可以是负值,单位是px。默认值和字体大小有关。 + ) + .colorsSet(@[@"#407FFF",@"#A682E6"])//设置颜色主题 + .seriesSet(@[ + AASeriesElement.new + .nameSet(@"人数") + .sizeSet(@150)//环形图的半径大小 + .innerSizeSet(@"60%")//内部圆环半径大小占比 + .allowPointSelectSet(false)//是否允许在点击数据点标记(扇形图点击选中的块发生位移) + .dataLabelsSet(AADataLabels.new + .enabledSet(true) + .useHTMLSet(true) + .distanceSet(@20)//扇形图百分比线的长度 + .formatSet(@"{point.name} {point.y}") + ) + + .dataSet(@[ + @[@"图文咨询", @110], + @[@"视频咨询", @10], + ]), + ]); + return aaOptions; +} + + +- (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]; + [self createData]; + [self createEarmingsData]; + +} + + +- (void)createUI { + + UIScrollView * mainScrollview = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)]; + mainScrollview.backgroundColor = UIColorHex(#EEEEEE); + [self.view addSubview:mainScrollview]; + //顶部背景收益 + UIImageView * moneyImg = [[UIImageView alloc] initWithFrame:CGRectMake(kRealValue(15), kRealValue(10), kScreenWidth - kRealValue(30), kRealValue(150))]; + moneyImg.userInteractionEnabled = YES; + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapGesture:)]; + [moneyImg addGestureRecognizer:tap]; + moneyImg.image = [UIImage imageNamed:@"statusticBackImg"]; + [mainScrollview addSubview:moneyImg]; + + UILabel * titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(15), kRealValue(12), 300, 12)]; + titleLabel.text = @"未结算收益"; + titleLabel.textColor = KWhiteColor; + titleLabel.textAlignment = NSTextAlignmentLeft; + titleLabel.font = MEDIUMFONT(12); + [moneyImg addSubview:titleLabel]; + + self.moneyLabel = [[UILabel alloc] initWithFrame:CGRectMake(0,titleLabel.bottom + kRealValue(23), moneyImg.width, 18)]; + self.moneyLabel.text = @"¥7900"; + self.moneyLabel.textColor = KWhiteColor; + self.moneyLabel.textAlignment = NSTextAlignmentCenter; + self.moneyLabel.font = MEDIUMFONT(23); + [moneyImg addSubview:self.moneyLabel]; + + UIView * linView = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(22),self.moneyLabel.bottom + kRealValue(24), moneyImg.width - kRealValue(44), 1)]; + linView.backgroundColor = KWhiteColor; + [moneyImg addSubview:linView]; + + UILabel * leijiLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(22),linView.bottom + kRealValue(10), moneyImg.width/2, 11)]; + leijiLabel.text = @"累计总收益(税前)"; + leijiLabel.textColor = KWhiteColor; + leijiLabel.textAlignment = NSTextAlignmentLeft; + leijiLabel.font = MEDIUMFONT(11); + [moneyImg addSubview:leijiLabel]; + + self.leftMoneyLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(22),leijiLabel.bottom + kRealValue(10), moneyImg.width/2, 11)]; + self.leftMoneyLabel.text = @"¥--"; + self.leftMoneyLabel.textColor = KWhiteColor; + self.leftMoneyLabel.textAlignment = NSTextAlignmentLeft; + self.leftMoneyLabel.font = BOLDSYSTEMFONT(16); + [moneyImg addSubview:self.leftMoneyLabel]; + + + UILabel * leijiRightLabel = [[UILabel alloc] initWithFrame:CGRectMake(moneyImg.width/2 ,linView.bottom + kRealValue(10), moneyImg.width/2 - kRealValue(40) , 11)]; + leijiRightLabel.text = @"已结算(税前)"; + leijiRightLabel.textColor = KWhiteColor; + leijiRightLabel.textAlignment = NSTextAlignmentRight; + leijiRightLabel.font = MEDIUMFONT(11); + [moneyImg addSubview:leijiRightLabel]; + + self.rightMoneyLabel = [[UILabel alloc] initWithFrame:CGRectMake(moneyImg.width/2,leijiLabel.bottom + kRealValue(10), moneyImg.width/2 - kRealValue(40), 16)]; + self.rightMoneyLabel.text = @"¥--0"; + self.rightMoneyLabel.textColor = KWhiteColor; + self.rightMoneyLabel.textAlignment = NSTextAlignmentRight; + self.rightMoneyLabel.font = BOLDSYSTEMFONT(16); + [moneyImg addSubview:self.rightMoneyLabel]; + + //月份选择 + UIView * topView = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(15), moneyImg.bottom + kRealValue(15), kScreenWidth - kRealValue(30), kRealValue(44))]; + topView.backgroundColor = KWhiteColor; + topView.layer.cornerRadius = 10.0f; + topView.layer.masksToBounds = true; + [mainScrollview addSubview:topView]; + + UIImageView * sattisImg = [[UIImageView alloc] initWithFrame:CGRectMake(kRealValue(17), kRealValue(15), kRealValue(14), kRealValue(14))]; + sattisImg.image = IMAGE_NAMED(@"smallStatis_icon"); + [topView addSubview:sattisImg]; + + UILabel * monthsLabel = [[UILabel alloc] initWithFrame:CGRectMake(sattisImg.right + kRealValue(9),0, moneyImg.width/2, kRealValue(44))]; + monthsLabel.text = @"月度统计"; + monthsLabel.textColor = CFontColor1; + monthsLabel.textAlignment = NSTextAlignmentLeft; + monthsLabel.font = BOLDSYSTEMFONT(15); + [topView addSubview:monthsLabel]; + + NSDate * currentDate = [NSDate date]; + YYLabel * monthLabel = [[YYLabel alloc]initWithFrame:CGRectMake(topView.width - 190, 0, 160, kRealValue(44))]; + self.quesDate = [NSString stringWithFormat:@"%ld-%02ld",currentDate.year,currentDate.month]; + monthLabel.text = [NSString stringWithFormat:@"%ld年%ld月 ",currentDate.year,currentDate.month]; + monthLabel.textColor = UIColorHex(#999999); + self.monthLabel = monthLabel; + [topView addSubview:monthLabel]; + + UIImage * image = [UIImage imageNamed:@"garyDown"]; + + NSMutableAttributedString * roomAttri = [[NSMutableAttributedString alloc] initWithString:monthLabel.text]; + + NSMutableAttributedString * roomAttachText = [NSMutableAttributedString attachmentStringWithContent:image contentMode:UIViewContentModeCenter attachmentSize:CGSizeMake(10, 10) alignToFont:[UIFont boldSystemFontOfSize:13] alignment:YYTextVerticalAlignmentCenter]; //content:内容  size:图片尺寸 alignToFont:字符串内字体的格式 + [roomAttri appendAttributedString:roomAttachText]; + + monthLabel.attributedText = roomAttri; + + monthLabel.textAlignment = NSTextAlignmentRight; + + [monthLabel setTextTapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) { + + [self selectedMonth]; + }]; + + //统计图 + UIView * chatView = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(15), topView.bottom + kRealValue(8), kScreenWidth - kRealValue(30), kRealValue(300))]; + chatView.backgroundColor = KWhiteColor; + chatView.layer.cornerRadius = 10; + chatView.layer.masksToBounds = true; + [mainScrollview addSubview:chatView]; + + UILabel * chatTopLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(15),kRealValue(16), 200, kRealValue(15))]; + chatTopLabel.text = @"分类统计"; + chatTopLabel.textColor = CFontColor1; + chatTopLabel.textAlignment = NSTextAlignmentLeft; + chatTopLabel.font = BOLDSYSTEMFONT(15); + [chatView addSubview:chatTopLabel]; + + self.aaChartView = [[AAChartView alloc]init]; + self.aaChartView.delegate = self; + self.aaChartView.frame = CGRectMake(0, chatTopLabel.bottom, chatView.width, chatView.height - kRealValue(30)); + ////禁用 AAChartView 滚动效果(默认不禁用) + self.aaChartView.scrollEnabled = NO; + [chatView addSubview:self.aaChartView]; +// [_aaChartView aa_drawChartWithOptions:self.adjustPieChartTitleAndDataLabelFontStyle]; + //列表统计 + //统计图 + UIView * bottomView = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(15), chatView.bottom + kRealValue(8), kScreenWidth - kRealValue(30), kRealValue(175))]; + bottomView.backgroundColor = KWhiteColor; + bottomView.layer.cornerRadius = 10; + bottomView.layer.masksToBounds = true; + [mainScrollview addSubview:bottomView]; + + UILabel * bottomLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(15),0, moneyImg.width/2, kRealValue(44))]; + bottomLabel.text = @"分类统计"; + bottomLabel.textColor = CFontColor1; + bottomLabel.textAlignment = NSTextAlignmentLeft; + bottomLabel.font = BOLDSYSTEMFONT(15); + [bottomView addSubview:bottomLabel]; + +// YYLabel * lookLabel = [[YYLabel alloc]initWithFrame:CGRectMake(topView.width - 170, 0, 160, kRealValue(44))]; +// lookLabel.text = @"查看明细 >"; +// lookLabel.textColor = UIColorHex(#3390FF); +// lookLabel.font = MEDIUMFONT(11); +// lookLabel.textAlignment = NSTextAlignmentRight; +// [bottomView addSubview:lookLabel]; +// +// [lookLabel setTextTapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) { +// +// [self selectedMonth]; +// }]; + UIView * conView = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(17), bottomLabel.bottom + kRealValue(15), bottomView.width - kRealValue(34), 90)]; + conView.layer.borderWidth = 1.0; + conView.layer.borderColor = UIColorHex(#E0E0E0).CGColor; + [bottomView addSubview:conView]; + + UIView * tabTitleView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, bottomView.width - kRealValue(34), 30)]; + tabTitleView.backgroundColor = UIColorHex(#EFEFEF); + [conView addSubview:tabTitleView]; + + NSArray * array = @[@"类别",@"进行中",@"已完成",@"合计"]; + for (int i = 0; i < 4; i ++) { + + UILabel * conteLabel = [[UILabel alloc] init]; + conteLabel.frame = CGRectMake( tabTitleView.width/4 * i, 0 , tabTitleView.width/4,tabTitleView.height); + conteLabel.text = array[i]; + conteLabel.textColor = CFontColor1; + conteLabel.textAlignment = NSTextAlignmentCenter; + conteLabel.font = SYSTEMFONT(10); + [tabTitleView addSubview:conteLabel]; + } + + UIView * tabLineView = [[UIView alloc] initWithFrame:CGRectMake(0, 60, conView.width, 1)]; + tabLineView.backgroundColor = UIColorHex(#E0E0E0); + [conView addSubview:tabLineView]; + + NSArray * dataArray =@[@[@"图文咨询",@"2",@"8",@"10"],@[@"视频咨询",@"2",@"5",@"7"]]; + + for (int i = 0; i < dataArray.count; i ++) { + + UIView * tab = [self createTabconteWithFrame:CGRectMake(0, tabTitleView.bottom + i * 30, tabTitleView.width, 30) withArray:dataArray[i] withTag:100 + i * 10]; + [conView addSubview:tab]; + + } + mainScrollview.contentSize = CGSizeMake(kScreenWidth , bottomView.bottom + 100); +} + + +- (void)selectedMonth { + + BRDatePickerView *datePickerView = [[BRDatePickerView alloc]init]; + // 2.设置属性 + datePickerView.pickerMode = BRDatePickerModeYM; + 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.quesDate = [NSString stringWithFormat:@"%ld-%02ld",selectDate.year,selectDate.month]; + self.monthLabel.text = [NSString stringWithFormat:@"%@ ",selectValue]; + UIImage * image = [UIImage imageNamed:@"garyDown"]; + NSMutableAttributedString * roomAttri = [[NSMutableAttributedString alloc] initWithString:self.monthLabel.text]; + + NSMutableAttributedString * roomAttachText = [NSMutableAttributedString attachmentStringWithContent:image contentMode:UIViewContentModeCenter attachmentSize:CGSizeMake(10, 10) alignToFont:[UIFont boldSystemFontOfSize:13] alignment:YYTextVerticalAlignmentCenter]; //content:内容  size:图片尺寸 alignToFont:字符串内字体的格式 + [roomAttri appendAttributedString:roomAttachText]; + + self.monthLabel.attributedText = roomAttri; + + self.monthLabel.textAlignment = NSTextAlignmentRight; + [self createData]; + }; + + datePickerView.pickerStyle = [BRPickerStyle pickerStyleWithThemeColor:UIColorHex(#21BEBD)]; + // 3.显示 + [datePickerView show]; + + +} + +- (UIView *)createTabconteWithFrame:(CGRect)frame + withArray:(NSArray *)conteArray + withTag:(NSInteger)labTag +{ + + UIView * connteView = [[UIView alloc] initWithFrame:frame]; + + for (int i = 0 ; i < conteArray.count; i ++) { + //100 110 + UILabel * conteLabel = [[UILabel alloc] init]; + conteLabel.frame = CGRectMake(connteView.width/4 * i, 0,connteView.width/4 , connteView.height); + conteLabel.text = conteArray[i]; + conteLabel.textColor = CFontColor1; + conteLabel.font = SYSTEMFONT(12); + conteLabel.textAlignment = NSTextAlignmentCenter; + conteLabel.tag = labTag + 10 + i ; + DLog(@"------------%@----------%ld",conteLabel.text, conteLabel.tag); + [connteView addSubview:conteLabel]; + + } + + + + + return connteView; + +} + +- (void)aaChartView:(AAChartView *)aaChartView moveOverEventWithMessage:(AAMoveOverEventMessageModel *)message { + + NSDictionary *messageDic = @{ + @"category":message.category, + @"index":@(message.index), + @"name":message.name, + @"offset":message.offset, + @"x":message.x, + @"y":message.y + }; + + NSNumber *plotX = message.offset[@"plotX"]; + +// self.tipLab.hidden = NO; +// self.tipLab.text = [NSString stringWithFormat:@"%f",[message.y floatValue]]; +// self.tipLab.centerX = [plotX floatValue]+6+50; +// + NSLog(@"mes:%@", messageDic); + } + + +- (void)createData { + + XJDNetAPI * workApi = [[XJDNetAPI alloc] init:self tag:@"QUSTIONAPI" NeedToken:@""]; + NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; + [parmDic setObject: self.quesDate forKey:@"date"]; + [workApi GetQuestionStatistics:parmDic]; + +} + +- (void)createEarmingsData { + + XJDNetAPI * workApi = [[XJDNetAPI alloc] init:self tag:@"EARNINGAPI" NeedToken:@""]; + NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; + [workApi GetStatisticsEarnings:parmDic]; + +} + + +- (void)Failed:(NSString*)message tag:(NSString*)tag +{ + [self hiddenAllMBProgressHUD]; + +} + + +- (void)Sucess:(id)response tag:(NSString*)tag +{ + [self hiddenAllMBProgressHUD]; + if ([tag isEqualToString:@"QUSTIONAPI"]) { + + NSArray * array = response; + [self.dataArray removeAllObjects]; + for (NSDictionary * dic in array) { + + XJDQuestionStaticsModel * model = [XJDQuestionStaticsModel modelWithDictionary:dic]; + [self.dataArray addObject:model]; + } + NSInteger pictureNum; + NSInteger videoNum; + NSInteger allNumber; + XJDQuestionStaticsModel * picmodel; + XJDQuestionStaticsModel * videomodel; + if (self.dataArray.count>=2) { + picmodel = self.dataArray[0]; + pictureNum = [picmodel.total integerValue]; + videomodel = self.dataArray[1]; + videoNum = [videomodel.total integerValue]; + } + + NSString *str2 = @" 咨询方式 "; + AAOptions *aaOptions = AAOptions.new + .chartSet(AAChart.new.typeSet(AAChartTypePie)) + .titleSet(AATitle.new + .useHTMLSet(true) + .textSet(str2)//标题文本内容 + .alignSet(AAChartAlignTypeCenter)//标题水平居中 + .verticalAlignSet(AAChartVerticalAlignTypeMiddle)//标题垂直居中 + .ySet(@0)//标题相对于垂直对齐的偏移量,取值范围:图表的上边距(chart.spacingTop )到图表的下边距(chart.spacingBottom),可以是负值,单位是px。默认值和字体大小有关。 + ) + .colorsSet(@[@"#407FFF",@"#A682E6"])//设置颜色主题 + .seriesSet(@[ + AASeriesElement.new + .nameSet(@"人数") + .sizeSet(@150)//环形图的半径大小 + .innerSizeSet(@"60%")//内部圆环半径大小占比 + .allowPointSelectSet(false)//是否允许在点击数据点标记(扇形图点击选中的块发生位移) + .dataLabelsSet(AADataLabels.new + .enabledSet(true) + .useHTMLSet(true) + .distanceSet(@20)//扇形图百分比线的长度 + .formatSet(@"{point.name} {point.y}") + ) + + .dataSet(@[ + @[@"图文咨询", @(pictureNum)], + @[@"视频咨询", @(videoNum)], + ]), + ]); + [self.aaChartView aa_drawChartWithOptions:aaOptions]; +// / 110 111 112 113 114 + +// 120 121 122 123 124 + UILabel * videoLabel = [self.view viewWithTag:111]; + videoLabel.text = [NSString stringWithFormat:@"%@",picmodel.inProgress]; + UILabel * videoReplyLabel = [self.view viewWithTag:112]; + videoReplyLabel.text = [NSString stringWithFormat:@"%@",picmodel.completed]; + UILabel * videoComplLabel = [self.view viewWithTag:113]; + videoComplLabel.text = [NSString stringWithFormat:@"%@",picmodel.total]; + + UILabel * picLabel = [self.view viewWithTag:121]; + picLabel.text = [NSString stringWithFormat:@"%@",videomodel.inProgress]; + UILabel * picReplyLabel = [self.view viewWithTag:122]; + picReplyLabel.text = [NSString stringWithFormat:@"%@",videomodel.completed]; + UILabel * pciCompLabel = [self.view viewWithTag:123]; + pciCompLabel.text = [NSString stringWithFormat:@"%@",videomodel.total]; + } + if ([tag isEqualToString:@"EARNINGAPI"]) { + NSDictionary * responDic = response; + + self.moneyLabel.text = [NSString stringWithFormat:@"¥%.2f",[[responDic objectForKey:@"unsettled"] floatValue]]; + self.leftMoneyLabel.text = [NSString stringWithFormat:@"¥%.2f",[[responDic objectForKey:@"sumIncome"] floatValue]]; + self.rightMoneyLabel.text = [NSString stringWithFormat:@"¥%.2f",[[responDic objectForKey:@"sumPaymentMoney"] floatValue]]; + + } +} +//咨询收益 +- (void)handleTapGesture:(id)sender { + + XJDBillViewController * billVC = [[XJDBillViewController alloc] init]; + + [self.navigationController pushViewController:billVC 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 diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/StopQuestionSetting(停诊设置)/StopAnnouncementViewController.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/StopQuestionSetting(停诊设置)/StopAnnouncementViewController.h deleted file mode 100644 index cadf9ef..0000000 --- a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/StopQuestionSetting(停诊设置)/StopAnnouncementViewController.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// YXStopAnnouncementViewController.h -// healthQuestion -// -// Created by 仁康信息 on 2023/5/5. -// - -#import "HQBaseViewController.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface YXStopAnnouncementViewController : HQBaseViewController - -@end - -NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/StopQuestionSetting(停诊设置)/XJDStopAnnouncementViewController.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/StopQuestionSetting(停诊设置)/XJDStopAnnouncementViewController.h new file mode 100644 index 0000000..b9bd0be --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/StopQuestionSetting(停诊设置)/XJDStopAnnouncementViewController.h @@ -0,0 +1,15 @@ +// +// XJDStopAnnouncementViewController.h +// healthQuestion +// +// Created by 仁康信息 on 2023/5/5. +// + + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDStopAnnouncementViewController : YXBaseViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/StopQuestionSetting(停诊设置)/XJDStopAnnouncementViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/StopQuestionSetting(停诊设置)/XJDStopAnnouncementViewController.m new file mode 100644 index 0000000..4e42089 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/StopQuestionSetting(停诊设置)/XJDStopAnnouncementViewController.m @@ -0,0 +1,387 @@ +// +// YXStopAnnouncementViewController.m +// healthQuestion +// +// Created by 仁康信息 on 2023/5/5. +// + +#import "XJDStopAnnouncementViewController.h" +#import "ZHTagListView.h" +#import "BRDatePickerView.h" +#import "NSDate+Calendar.h" +#import "UIPlaceHolderTextView.h" +#import "XJDStopReasonModel.h" +#import "XJDStopQuestionPopView.h" + +@interface XJDStopAnnouncementViewController () + +@property (nonatomic, strong) UIView * announceView; + +@property (nonatomic, strong) YYLabel * starLabel; + +@property (nonatomic, strong) YYLabel * endLabel; + +@property (nonatomic, strong) UIPlaceHolderTextView * textView; + +@property (nonatomic, strong) ZHTagListView *tagList; + +@property (nonatomic, strong) UILabel * timeLabel; + +@property (nonatomic, strong) UILabel * centerLabel; + +@property (nonatomic, strong) UILabel * gonggaoLabel; + +@property (nonatomic, copy) NSString * reasonString; + +@property (nonatomic, strong) NSDate * starDate; +@property (nonatomic, strong) NSDate * endDate; + +@property (nonatomic, strong) NSMutableArray * reasonArray; + +@end + +@implementation XJDStopAnnouncementViewController + +- (NSMutableArray *)reasonArray { + + if (!_reasonArray) { + _reasonArray = [[NSMutableArray alloc] init]; + } + return _reasonArray; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. + self.view.backgroundColor = UIColorHex(#EEEEEE); + self.isHidenNaviBar = false; + self.navigationItem.title = @"暂停服务公告"; + [self createUI]; + [self getReasonData]; +} + +- (void)createUI { + + UIView * announceView = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(15), kRealValue(10), kScreenWidth - kRealValue(30), kRealValue(388))]; + announceView.layer.cornerRadius = 10; + announceView.backgroundColor = KWhiteColor; + announceView.layer.masksToBounds = true; + self.announceView = announceView; + [self.view addSubview:announceView]; + + UILabel * resouLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(15), kRealValue(20), 60, 13)]; + resouLabel.textColor = CFontColor1; + resouLabel.font = MEDIUMFONT(14); + resouLabel.text = @"暂停原因"; + [announceView addSubview:resouLabel]; + + + NSMutableArray *_dataSource = @[@" ",@" ",@" ",@" "].mutableCopy; + + ZHTagListConfiguration *config = [ZHTagListConfiguration defaultConfiguration]; + config.tagTextColor = CFontColor1; + config.tagTextMargin = 11; + config.tagHeight = 27; + config.tagTextFont = SYSTEMFONT(13); + config.tagListViewInset = UIEdgeInsetsMake(15, 15, 15, 10); + + ZHTagListView *tagList = [[ZHTagListView alloc] initWithFrame:CGRectMake(resouLabel.right, 0, announceView.width - resouLabel.right - kRealValue(10), 0) configuration:config tagTexts:_dataSource]; + tagList.backgroundColor = KWhiteColor; + [announceView addSubview:tagList]; + self.tagList = tagList; + [tagList.tagButtonList enumerateObjectsUsingBlock:^(UIButton * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { +// [obj setBackgroundColor:KRedColor]; + + }]; + [tagList setTagClickHandler:^(ZHTagListView *tagListView, NSString *tagText, NSUInteger index) { + UIButton * btn = tagListView.tagButtonList[index]; + self.reasonString = tagText; + for (UIButton * selectBtn in tagListView.tagButtonList) { + if (selectBtn == btn ) { + selectBtn.backgroundColor = UIColorHex(#21BEBD); + [selectBtn setTitleColor:KWhiteColor forState:UIControlStateNormal]; + }else + { + selectBtn.backgroundColor = KClearColor; + [selectBtn setTitleColor:CFontColor1 forState:UIControlStateNormal]; + } + } + }]; + + UILabel * timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(15),tagList.bottom + kRealValue(15), 60, 13)]; + timeLabel.textColor = CFontColor1; + timeLabel.font = MEDIUMFONT(14); + timeLabel.text = @"暂停时间"; + self.timeLabel = timeLabel; + [announceView addSubview:timeLabel]; + + NSDateFormatter *formater = [[ NSDateFormatter alloc] init]; + [formater setDateFormat:@"yyyy-MM-dd"];// 时间格式 + NSDate *currentDate = [NSDate date];//获取当前日期 + NSString *currentDateStr = [formater stringFromDate:currentDate]; + self.starDate = currentDate; + self.endDate = currentDate; + self.starLabel = [[YYLabel alloc] initWithFrame:CGRectMake(timeLabel.right + kRealValue(15),tagList.bottom + kRealValue(12), 102, 30)]; + self.starLabel.textColor = CFontColor1; + self.starLabel.font = MEDIUMFONT(14); + self.starLabel.text = currentDateStr; + self.starLabel.layer.cornerRadius = 5; + self.starLabel.layer.borderWidth = 1.0f; + self.starLabel.layer.borderColor = UIColorHex(#CCCCCC).CGColor; + self.starLabel.textAlignment = NSTextAlignmentCenter; + MJWeakSelf + [self.starLabel setTextTapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) { + [weakSelf selectStarOnclick]; + }]; + [announceView addSubview:self.starLabel]; + + UILabel * centerLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.starLabel.right ,tagList.bottom + kRealValue(12), 44, 30)]; + centerLabel.textColor = CFontColor1; + centerLabel.font = MEDIUMFONT(14); + centerLabel.text = @"至"; + self.centerLabel = centerLabel; + centerLabel.textAlignment = NSTextAlignmentCenter; + [announceView addSubview:centerLabel]; + + self.endLabel = [[YYLabel alloc] initWithFrame:CGRectMake(centerLabel.right,tagList.bottom + kRealValue(12), self.starLabel.width, self.starLabel.height)]; + self.endLabel.textColor = CFontColor1; + self.endLabel.font = MEDIUMFONT(14); + self.endLabel.text = currentDateStr; + self.endLabel.layer.cornerRadius = 5; + self.endLabel.layer.borderWidth = 1.0f; + self.endLabel.layer.borderColor = UIColorHex(#CCCCCC).CGColor; + self.endLabel.textAlignment = NSTextAlignmentCenter; + + [self.endLabel setTextTapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) { + [weakSelf selectEndOnclick]; + }]; + [announceView addSubview:self.endLabel]; + + UILabel * gonggaoLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(15),self.endLabel.bottom + kRealValue(23), 60, 13)]; + gonggaoLabel.textColor = CFontColor1; + gonggaoLabel.font = MEDIUMFONT(14); + gonggaoLabel.text = @"暂停公告"; + self.gonggaoLabel = gonggaoLabel; + [announceView addSubview:gonggaoLabel]; + + self.textView = [[UIPlaceHolderTextView alloc] initWithFrame:CGRectMake(kRealValue(15), gonggaoLabel.bottom + kRealValue(15), announceView.width - kRealValue(30), kRealValue(179))]; + self.textView.placeholder = @"请输入暂停公告"; + self.textView.font = SYSTEMFONT(14); + self.textView.layer.cornerRadius = 5; + self.textView.layer.masksToBounds = true; + self.textView.backgroundColor = UIColorHex(#EFEFEF); + [announceView addSubview:self.textView]; + + UIButton * publishBtn = [[UIButton alloc] initWithFrame:CGRectMake(kRealValue(111), kScreenHeight - kTopHeight - SafetyAreaHeight - kRealValue(56), kScreenWidth - kRealValue(222), kRealValue(35))]; + [publishBtn setTitle:@"发布" forState:UIControlStateNormal]; + [publishBtn setTitleColor:UIColorHex(#21BEBD) forState:UIControlStateNormal]; + publishBtn.titleLabel.font = SYSTEMFONT(14); + publishBtn.layer.cornerRadius = 18; + publishBtn.layer.borderColor = UIColorHex(#21BEBD).CGColor; + publishBtn.layer.borderWidth = 1.0; + publishBtn.layer.masksToBounds = true; + publishBtn.backgroundColor = KWhiteColor; + [publishBtn addTarget:self action:@selector(publishAction) forControlEvents:UIControlEventTouchUpInside]; + [self.view addSubview:publishBtn]; +} + +- (void)getReasonData { + + XJDNetAPI * workApi = [[XJDNetAPI alloc] init:self tag:@"ReasonAPI" NeedToken:@""]; + NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; + [parmDic setObject:@"doctor_stop_reason_type" forKey:@"dictKey"]; + [workApi GetPublishServerReason:parmDic]; + +} + +- (void)selectStarOnclick { + self.starLabel.layer.borderColor = UIColorHex(#21BEBD).CGColor; + // 1.创建日期选择器 + BRDatePickerView *datePickerView = [[BRDatePickerView alloc]init]; + // 2.设置属性 + datePickerView.pickerMode = BRDatePickerModeYMD; + datePickerView.title = @"选择暂停日期"; + // datePickerView.selectValue = @"2019-10-30"; + datePickerView.minDate = [NSDate br_setYear:2003 month:3 day:12]; + datePickerView.maxDate = [NSDate br_setYear:2050 month:3 day:12]; + datePickerView.isAutoSelect = YES; + datePickerView.showUnitType = BRShowUnitTypeOnlyCenter; + datePickerView.resultBlock = ^(NSDate *selectDate, NSString *selectValue) { + NSLog(@"选择的值:%@", selectValue); + self.starDate = selectDate; + self.starLabel.text = selectValue; + }; + + datePickerView.pickerStyle = [BRPickerStyle pickerStyleWithThemeColor:UIColorHex(#21BEBD)]; + // 3.显示 + [datePickerView show]; +} + +- (void)selectEndOnclick { + self.endLabel.layer.borderColor = UIColorHex(#21BEBD).CGColor; + + // 1.创建日期选择器 + BRDatePickerView *datePickerView = [[BRDatePickerView alloc]init]; + // 2.设置属性 + datePickerView.pickerMode = BRDatePickerModeYMD; + datePickerView.title = @"选择暂停日期"; + // datePickerView.selectValue = @"2019-10-30"; + datePickerView.minDate = [NSDate br_setYear:2003 month:3 day:12]; + datePickerView.maxDate = [NSDate br_setYear:2050 month:3 day:12]; + datePickerView.isAutoSelect = YES; + datePickerView.showUnitType = BRShowUnitTypeOnlyCenter; + datePickerView.resultBlock = ^(NSDate *selectDate, NSString *selectValue) { + NSLog(@"选择的值:%@", selectValue); + self.endDate = selectDate; + self.endLabel.text = selectValue; + }; + + datePickerView.pickerStyle = [BRPickerStyle pickerStyleWithThemeColor:UIColorHex(#21BEBD)]; + // 3.显示 + [datePickerView show]; +} + +#pragma mark:发布 + +- (void)publishAction { + if (ValidStr(self.reasonString)) { + + [MBProgressHUD showErrorMessage:@"请选择暂停原因"]; + return; + } + if (ValidStr(self.textView.text)) { + + [MBProgressHUD showErrorMessage:@"请输入公告"]; + return; + } + + //查询当前咨询 + [self showMBProgressHUDWithString:@"发布中,请稍候..." autoHidden:false]; + NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; + + NSTimeInterval starLong =[self.starDate timeIntervalSince1970]*1000; // *1000 是精确到毫秒,不乘就是精确到秒 + NSString * starString = [NSString stringWithFormat:@"%.0f", starLong]; //转为字符型 + + NSTimeInterval endLong =[self.endDate timeIntervalSince1970]*1000; // *1000 是精确到毫秒,不乘就是精确到秒 + NSString * endString = [NSString stringWithFormat:@"%.0f", endLong]; //转为字符型 + + [parmDic setObject:starString forKey:@"startTime"]; + [parmDic setObject:endString forKey:@"endTime"]; + XJDNetAPI * workApi = [[XJDNetAPI alloc] init:self tag:@"CURRENTAPI" NeedToken:@""]; + [workApi GetCurrentServerNumber:parmDic]; +// + + +} + +- (void)addPublishDate { + + NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; + + NSTimeInterval starLong =[self.starDate timeIntervalSince1970]*1000; // *1000 是精确到毫秒,不乘就是精确到秒 + NSString * startDayLong = [NSString stringWithFormat:@"%.0f", starLong]; //转为字符型 + + NSTimeInterval endLong =[self.endDate timeIntervalSince1970]*1000; // *1000 是精确到毫秒,不乘就是精确到秒 + NSString * endDayLong = [NSString stringWithFormat:@"%.0f", endLong]; //转为字符型 + + NSDateFormatter *formater = [[ NSDateFormatter alloc] init]; + [formater setDateFormat:@"yyyy-MM-dd"];// 时间格式 + + if (endLong < starLong) { + + [EasyTextView showErrorText:@"结束时间小于开始时间,请重新选择"]; + return; + } + + NSString *starDateStr = [formater stringFromDate:self.starDate]; + NSString *endDateStr = [formater stringFromDate:self.endDate]; + + [parmDic setObject:self.reasonString forKey:@"stopReason"]; + [parmDic setObject:startDayLong forKey:@"startDayLong"]; + [parmDic setObject:endDayLong forKey:@"endDayLong"]; + [parmDic setObject:self.textView.text forKey:@"notice"]; + [parmDic setObject:@"" forKey:@"doctorId"]; + [parmDic setObject:endDateStr forKey:@"endDay"]; + [parmDic setObject:starDateStr forKey:@"startDay"]; + + + XJDNetAPI * workApi = [[XJDNetAPI alloc] init:self tag:@"ADDAPI" NeedToken:@""]; + [workApi PostStopPublishServer:parmDic]; + + + +} +- (void)Failed:(NSString*)message tag:(NSString*)tag +{ + [EasyTextView showErrorText:message]; + [self hiddenAllMBProgressHUD]; + +} + + +- (void)Sucess:(id)response tag:(NSString*)tag +{ + + if ([tag isEqualToString:@"ReasonAPI"]) { + NSArray * resArray = response; + NSMutableArray * textArray = [[NSMutableArray alloc] init]; + for (NSDictionary * resDic in resArray) { + + XJDStopReasonModel * model = [XJDStopReasonModel modelWithDictionary:resDic]; + [textArray addObject:model.text]; + [self.reasonArray addObject:model]; + } + self.tagList.tags = textArray; + //布局 + self.starLabel.top = self.tagList.bottom + kRealValue(12); + self.centerLabel.top = self.starLabel.top; + self.endLabel.top = self.starLabel.top; + self.gonggaoLabel.top = self.endLabel.bottom + kRealValue(23); + self.textView.top = self.gonggaoLabel.bottom + kRealValue(15); + self.announceView.bottom = self.textView.bottom + kRealValue(20); + self.announceView.top = kRealValue(15); + self.timeLabel.top = self.tagList.bottom + kRealValue(15); + + } + if ([tag isEqualToString:@"CURRENTAPI"]) { + [self addPublishDate]; + //转换为时间戳 +// NSString * resString = response; +// +// if ([resString integerValue] == 0 ) { +// [self addPublishDate]; +// +// }else +// { +// +// XJDStopQuestionPopView * popview = [[XJDStopQuestionPopView alloc] initWithFrame:[UIScreen mainScreen].bounds]; +// popview.questionNumber = resString; +// popview.publisBlock = ^{ +// [self addPublishDate]; +// }; +// [[UIApplication sharedApplication].keyWindow addSubview:popview]; +// popview.alpha = 0; +// [UIView animateWithDuration:0.5 animations:^{ +// popview.alpha = 1; +// } completion:^(BOOL finished) { +// }]; +// } + } + if ([tag isEqualToString:@"ADDAPI"]) { + [self hiddenAllMBProgressHUD]; + [self.navigationController popViewControllerAnimated: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 diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/StopQuestionSetting(停诊设置)/XJDStopQuestionCauseViewController.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/StopQuestionSetting(停诊设置)/XJDStopQuestionCauseViewController.h new file mode 100644 index 0000000..c1e21db --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/StopQuestionSetting(停诊设置)/XJDStopQuestionCauseViewController.h @@ -0,0 +1,16 @@ +// +// XJDStopQuestionCauseViewController.h +// healthQuestion +// +// Created by 仁康信息 on 2023/4/30. +// + +#import "YXBaseViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDStopQuestionCauseViewController : YXBaseViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/StopQuestionSetting(停诊设置)/XJDStopQuestionCauseViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/StopQuestionSetting(停诊设置)/XJDStopQuestionCauseViewController.m new file mode 100644 index 0000000..15c20f8 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/StopQuestionSetting(停诊设置)/XJDStopQuestionCauseViewController.m @@ -0,0 +1,40 @@ +// +// XJDStopQuestionCauseViewController.m +// healthQuestion +// +// Created by 仁康信息 on 2023/4/30. +// + +#import "XJDStopQuestionCauseViewController.h" + +@interface XJDStopQuestionCauseViewController () + +@end + +@implementation XJDStopQuestionCauseViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. + self.isHidenNaviBar = false; + self.navigationItem.title = @"暂停服务"; + [self createUI]; + +} + +- (void)createUI { + + + +} +/* +#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 diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/StopQuestionSetting(停诊设置)/XJDStopQuestionSettingVC.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/StopQuestionSetting(停诊设置)/XJDStopQuestionSettingVC.h new file mode 100644 index 0000000..1175ab6 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/StopQuestionSetting(停诊设置)/XJDStopQuestionSettingVC.h @@ -0,0 +1,16 @@ +// +// XJDStopQuestionSettingVC.h +// healthQuestion +// +// Created by 仁康信息 on 2023/4/29. +// + +#import "YXBaseViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDStopQuestionSettingVC : YXBaseViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/StopQuestionSetting(停诊设置)/XJDStopQuestionSettingVC.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/StopQuestionSetting(停诊设置)/XJDStopQuestionSettingVC.m new file mode 100644 index 0000000..2cbbb42 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/StopQuestionSetting(停诊设置)/XJDStopQuestionSettingVC.m @@ -0,0 +1,185 @@ +// +// XJDStopQuestionSettingVC.m +// healthQuestion +// +// Created by 仁康信息 on 2023/4/29. +// + +#import "XJDStopQuestionSettingVC.h" +#import "XJDStopQuestionTableView.h" +#import "XJDStopQuestionPopView.h" +#import "XJDStopServiceModel.h" +#import "XJDStopAnnouncementViewController.h" +@interface XJDStopQuestionSettingVC () + +@property (nonatomic, strong) XJDStopQuestionTableView * homeTable; + +@property (nonatomic, strong) NSMutableArray * dataArray; + +@property (nonatomic, assign) NSInteger pageNo; + +@property (nonatomic, assign) NSInteger pageSize; + +@end + +@implementation XJDStopQuestionSettingVC + + +- (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.view.backgroundColor = UIColorHex(#EFEFEF); + self.navigationItem.title = @"暂停服务"; + self.pageNo =1; + self.pageSize = 10; + [self createUI]; + [self createData]; +} + +- (void)viewWillAppear:(BOOL)animated { + + [super viewWillAppear:animated] ; + + [self.homeTable.mj_header beginRefreshing]; + +} +- (void)createUI { + + + UIButton * stopPublish = [[UIButton alloc] init]; + [stopPublish setTitle:@"发布暂停公告" forState:UIControlStateNormal]; + [stopPublish setTitleColor:UIColorHex(#21BEBD) forState:UIControlStateNormal]; + [stopPublish addTarget:self action:@selector(publishAction) forControlEvents:UIControlEventTouchUpInside]; + stopPublish.layer.borderColor = UIColorHex(#21BEBD).CGColor; + stopPublish.layer.borderWidth = 1.0; + stopPublish.layer.cornerRadius = 17; + [self.view addSubview:stopPublish]; + + [stopPublish mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.mas_offset(150); + make.bottom.mas_offset(-30); + make.height.mas_offset(36); + make.centerX.mas_equalTo(self.view); + }]; + + self.homeTable = [[XJDStopQuestionTableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped]; + self.homeTable.changeBlock = ^(NSString * _Nullable record_id) { + DLog(@"%@",record_id); + [self chageServiceStatus:record_id]; + }; + [self.view addSubview:self.homeTable]; + + [self.homeTable mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.left.right.mas_offset(0); + make.bottom.mas_equalTo(stopPublish.mas_top).offset(-10); + }]; + + __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)publishAction { + + + + XJDStopAnnouncementViewController * publishVC = [[XJDStopAnnouncementViewController alloc] init]; + + [self.navigationController pushViewController:publishVC animated:YES]; +} + +- (void)createData { + + + NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; + + [parmDic setObject:@(self.pageNo) forKey:@"pageNo"]; + [parmDic setObject:@(self.pageSize) forKey:@"pageSize"]; + + XJDNetAPI * workApi = [[XJDNetAPI alloc] init:self tag:@"RECORDAPI" NeedToken:@""]; + + [workApi GetSPublishServerRecored:parmDic]; + +} + + +- (void)chageServiceStatus:(NSString *)recordID { + [self showMBProgressHUDWithString:@"恢复中,请稍候" autoHidden:false]; + NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; + [parmDic setObject:recordID forKey:@"id"]; + [parmDic setObject:@"1" forKey:@"serviceStatus"]; + + XJDNetAPI * workApi = [[XJDNetAPI alloc] init:self tag:@"CHAGEAPI" NeedToken:@""]; + [workApi GetChangePublishServer:parmDic]; + +} + +- (void)Failed:(NSString*)message tag:(NSString*)tag +{ + + [self.homeTable.mj_header endRefreshing]; + [self.homeTable.mj_footer endRefreshing]; + [self hiddenAllMBProgressHUD]; +} + + +- (void)Sucess:(id)response tag:(NSString*)tag +{ + + [self.homeTable.mj_header endRefreshing]; + [self.homeTable.mj_footer endRefreshing]; + if ([tag isEqualToString:@"RECORDAPI"]) { + NSDictionary * resDic = response; + if (self.pageNo == 1) { + + [self.dataArray removeAllObjects]; + } + XJDStopServiceModel * model = [XJDStopServiceModel modelWithDictionary:resDic]; + + for (XJDStopServiceListModel * listModel in model.records ) { + + [self.dataArray addObject:listModel]; + } + self.homeTable.dataArray = self.dataArray; + } + if ([tag isEqualToString:@"CHAGEAPI"]) { + [self hiddenAllMBProgressHUD]; + [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 diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/XJDBasicHealthInfoViewController.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/XJDBasicHealthInfoViewController.h new file mode 100644 index 0000000..ebb84fe --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/XJDBasicHealthInfoViewController.h @@ -0,0 +1,16 @@ +// +// BasicHealthInfoViewController.h +// healthQuestion +// +// Created by 仁康信息 on 2023/5/4. +// + +#import "YXBaseViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDBasicHealthInfoViewController : YXBaseViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/XJDBasicHealthInfoViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/XJDBasicHealthInfoViewController.m new file mode 100644 index 0000000..65765a3 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/XJDBasicHealthInfoViewController.m @@ -0,0 +1,48 @@ +// +// BasicHealthInfoViewController.m +// healthQuestion +// +// Created by 仁康信息 on 2023/5/4. +// + +#import "XJDBasicHealthInfoViewController.h" +#import "XJDBasicHealthInfoView.h" + + +@interface XJDBasicHealthInfoViewController () + + + +@end + +@implementation XJDBasicHealthInfoViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + self.isHidenNaviBar = false; + self.title = @"基本健康信息"; + self.view.backgroundColor = UIColorHex(#EEEEEE); + [self createUI]; + // Do any additional setup after loading the view. +} + +- (void)createUI { + + XJDBasicHealthInfoView * infoView = [[XJDBasicHealthInfoView alloc] initWithFrame:CGRectMake(kRealValue(15), kRealValue(15), kScreenWidth - kRealValue(30), kRealValue(286))]; + infoView.backgroundColor = [UIColor whiteColor]; + infoView.layer.cornerRadius = 10.0; + infoView.layer.masksToBounds = true; + [self.view addSubview:infoView]; +} + +/* +#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 diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/XJDHomePageViewController.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/XJDHomePageViewController.h new file mode 100644 index 0000000..0781f6d --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/XJDHomePageViewController.h @@ -0,0 +1,18 @@ +// +// XJDHomePageViewController.h +// healthQuestion +// +// Created by xulei on 2022/8/17. +// + +#import "YXBaseViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDHomePageViewController : YXBaseViewController + + + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/XJDHomePageViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/XJDHomePageViewController.m new file mode 100644 index 0000000..c852599 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/XJDHomePageViewController.m @@ -0,0 +1,774 @@ +// +// XJDHomePageViewController.m +// healthQuestion +// +// Created by xulei on 2022/8/17. +// + +#import "XJDHomePageViewController.h" +#import "XJDQuestionDetailViewController.h" +#import "XJDHomePageModel.h" +#import "ChatViewController.h" +#import "MJRefresh.h" +#import "XJDShowPromptPopView.h" +#import "XJDQuestionStatisticsViewController.h" +#import "XJDQustionRecordViewController.h" +#import "XJDStopQuestionSettingVC.h" +#import "XJDBasicHealthInfoViewController.h" +#import "XJDRefuseQuestionPopView.h" +#import "XJDHistoricalRecordViewController.h" +#import "XJDFileDataDetailViewController.h" +#import "XJDStopAnnouncementViewController.h" +#import "XJDBillDetailViewController.h" +#import "TUIC2CChatViewController.h" +#import "XJDDoctorInfoModel.h" +#import "PSAppInfo.h" +#import "PSCheckVersion.h" +@interface XJDHomePageViewController () + +@property (nonatomic, strong) UIScrollView * mainScrollView; + +@property (nonatomic, strong) UILabel * nameLabel; + +@property (nonatomic, strong) UILabel * workLabel; + +@property (nonatomic, strong) UILabel * hospatilLabel; + +@property (nonatomic, strong) UIImageView * heardImage; + +@property (nonatomic, strong) UILabel * messageLabel; +@property (nonatomic, copy) NSString * smallGroup; + +@end + +@implementation XJDHomePageViewController + +- (void)viewDidLoad { + + [super viewDidLoad]; + [self createUI]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(updateHomeDate) + name:KNotificAgreeMapDelegate + object:nil]; + + //前缀请求 + [self chageUrlService]; + [[V2TIMManager sharedInstance] addSimpleMsgListener:self]; + [[TUICallEngine createInstance] addObserver:self]; + + self.isHidenNaviBar = false; + self.StatusBarStyle = UIStatusBarStyleDefault; + self.view.backgroundColor = CViewBgColor; + self.navigationItem.title = @"健康专家库"; + + [self docotrUserInfo]; + [self creatSmallHelpNumber]; + [PSCheckVersion checkVersionCompulsoryUpdate]; + +} + +- (void)updateHomeDate { + + [self docotrUserInfo]; + [self creatSmallHelpNumber]; + +} + +#pragma mark:请求前缀 +- (void)chageUrlService { + + AFHTTPSessionManager *session=[AFHTTPSessionManager manager]; + // AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; + + session.responseSerializer.acceptableContentTypes=[NSSet setWithObjects:@"application/json",@"text/json",@"text/javascript",@"text/html",@"text/plain", nil]; + //超时时间 + + session.requestSerializer.timeoutInterval= 30.f; + session.responseSerializer = [AFHTTPResponseSerializer serializer]; + + session.requestSerializer = [AFJSONRequestSerializer serializer]; + + session.securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone]; + + NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; + + // 获取应用的版本号 + NSString * version = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]; + // 将版本号按照点(.)分割成数组 + NSArray * components = [version componentsSeparatedByString:@"."]; + + // 获取数组中的最后一个元素 + NSString * lastComponent = [components lastObject]; + // 如果需要将其转换为整数 + NSInteger lastNumber = [lastComponent integerValue]; + + [parmDic setObject:@(lastNumber) forKey:@"version"]; + [parmDic setObject:@"health.Employees.tools" forKey:@"pkg"]; + + + [session GET:@"https://base.icdat.cn/v2/url" parameters:parmDic headers:nil progress:^(NSProgress * _Nonnull downloadProgress) { + + } success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { + + NSString * dataString = [[NSString alloc] initWithData:responseObject encoding:NSUTF8StringEncoding]; + DLog(@"response\n%@\n",dataString); + NSData *requestData = [dataString dataUsingEncoding:NSUTF8StringEncoding]; + + id myResult = [NSJSONSerialization JSONObjectWithData:requestData options:NSJSONReadingMutableContainers error:nil]; + //判断是否为字典 + if ([myResult isKindOfClass:[NSDictionary class]]) { + + NSDictionary *response = (NSDictionary *)myResult; + if ([response.allKeys containsObject:@"result"]) { + NSDictionary * resultDic = [response objectForKey:@"result"]; + + if ([resultDic.allKeys containsObject:@"api"]) { + [[NSUserDefaults standardUserDefaults] setObject:[resultDic objectForKey:@"api"] forKey:@"HTTPS"]; + [[NSUserDefaults standardUserDefaults] synchronize]; + } + if ([resultDic.allKeys containsObject:@"h5"]) { + [[NSUserDefaults standardUserDefaults] setObject:[resultDic objectForKey:@"h5"] forKey:@"IntervenH5"]; + [[NSUserDefaults standardUserDefaults] synchronize]; + } + if ([resultDic.allKeys containsObject:@"h5Host"]) { + [[NSUserDefaults standardUserDefaults] setObject:[resultDic objectForKey:@"h5Host"] forKey:@"H5DevHost"]; + [[NSUserDefaults standardUserDefaults] synchronize]; + } + if ([resultDic.allKeys containsObject:@"health"]) { + [[NSUserDefaults standardUserDefaults] setObject:[resultDic objectForKey:@"health"] forKey:@"BASEURL"]; + [[NSUserDefaults standardUserDefaults] synchronize]; + } + } + } + + } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { + NSString * statusCode = [error.userInfo objectForKey:@"NSLocalizedDescription"]; + + }]; +} + + +- (void)viewWillAppear:(BOOL)animated { + + [super viewWillAppear:animated]; + [self.mainScrollView.mj_header beginRefreshing]; + +} +- (void)createUI { + + self.mainScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight - kTopHeight)]; + [self.view addSubview:self.mainScrollView]; + + UIView * linV = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 0.5)]; + [self.mainScrollView addSubview:linV]; + + XJDUserInfo * user = [XJDCommonUtils keyedUnarchiverWithKey:LoginUserInfo]; + + UIView * topBack = [[UIView alloc] initWithFrame:CGRectMake(0, linV.bottom, kScreenWidth, kRealValue(130))]; + topBack.backgroundColor = UIColorHex(#21BEBD); + [self.mainScrollView addSubview:topBack]; + + self.nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(16), kRealValue(19), 100, 20)]; + self.nameLabel.textColor = KWhiteColor; + self.nameLabel.font = SYSTEMFONT(21); + self.nameLabel.text = user.realname; + CGFloat w = [XJDCommonUtils getLengthFromText:self.nameLabel.text andFontSize:21]; + self.nameLabel.width = w; + self.nameLabel.textAlignment = NSTextAlignmentLeft; + [topBack addSubview:self.nameLabel]; + + self.workLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.nameLabel.right + kRealValue(12), kRealValue(25), 100, 13)]; + self.workLabel.textColor = KWhiteColor; + self.workLabel.font = SYSTEMFONT(13); + self.workLabel.textAlignment = NSTextAlignmentLeft; + [topBack addSubview:self.workLabel]; + + self.hospatilLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(15), self.nameLabel.bottom + kRealValue(17), kScreenWidth - kRealValue(65), 20)]; + self.hospatilLabel.textColor = KWhiteColor; + self.hospatilLabel.font = SYSTEMFONT(13); +// self.hospatilLabel.text = [NSString stringWithFormat:@"%@ %@",user.phone,user.sex_dictText]; + self.hospatilLabel.textAlignment = NSTextAlignmentLeft; + [topBack addSubview:self.hospatilLabel]; + + self.heardImage = [[UIImageView alloc] initWithFrame:CGRectMake(kScreenWidth - kRealValue(24) - 60, kRealValue(10), 60, 60)]; + self.heardImage.backgroundColor = KWhiteColor; + self.heardImage.layer.cornerRadius = 30.0; + self.heardImage.layer.masksToBounds = true; + [topBack addSubview:self.heardImage]; + + + +// UIView * questionView = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(15), self.heardImage.bottom + kRealValue(23), kScreenWidth - kRealValue(30), kRealValue(132) * 2 + kRealValue(10))]; +// questionView.backgroundColor = KRedColor; +// questionView.layer.cornerRadius = 10.0; +//// [XJDCommonUtils addShadowToView:questionView]; +// [self.view addSubview:questionView]; + + NSArray * array = @[@[@"图文咨询",@"通过图片、文字的形式进行咨询"],@[@"视频咨询",@"通过语音视频电话的形式进行咨询"]]; + NSArray * timearray = @[@[@"0",@"0"],@[@"0",@"0"]]; + NSArray * TagArray = @[@"100",@"200"]; + UIView * lastView; + for (int i = 0; i < 2 ; i ++) { + + UIView * listView = [self createQuestionFrame:CGRectMake(kRealValue(15) , self.heardImage.bottom + kRealValue(23) + 10 * i + kRealValue(132) * i, kScreenWidth - kRealValue(30), kRealValue(132)) Image:@"" withTitle:array[i][0] withDesTitle:array[i][1] withTime:timearray[i][0] numberCount:timearray[i][1] withTag:[TagArray[i] intValue]]; + listView.backgroundColor = KWhiteColor; + if (i == 1) { + lastView = listView; + } + + UIButton * topBackbtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, listView.width, listView.height - 46)]; + topBackbtn.tag = 1000 + i; + [topBackbtn addTarget:self action:@selector(topAction:) forControlEvents:UIControlEventTouchUpInside]; + [listView addSubview:topBackbtn]; + [self.mainScrollView addSubview:listView]; + } + + UIView * smallView= [[UIView alloc] initWithFrame:CGRectMake(kRealValue(15), lastView.bottom + kRealValue(10), kScreenWidth - kRealValue(30), kRealValue(80))]; + smallView.backgroundColor = KWhiteColor; + smallView.layer.cornerRadius = 10.0; + smallView.layer.masksToBounds = YES; + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapGesture:)]; + [smallView addGestureRecognizer:tap]; + [self.mainScrollView addSubview:smallView]; + + UIImageView * leftImg = [[UIImageView alloc] initWithFrame:CGRectMake(24, 24, 40, 40)]; + leftImg.layer.cornerRadius = 20.0f; + leftImg.layer.masksToBounds = true; + leftImg.image = [UIImage imageNamed:@"home_small"] ; + [smallView addSubview:leftImg]; + + UILabel * titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(leftImg.right + kRealValue(15), kRealValue(28), kScreenWidth - kRealValue(65), 14)]; + titleLabel.textColor = UIColorHex(#333333); + titleLabel.font = BOLDSYSTEMFONT(14); + titleLabel.text = @"小助手"; + titleLabel.textAlignment = NSTextAlignmentLeft; + [smallView addSubview:titleLabel]; + + UILabel * desLabel = [[UILabel alloc] initWithFrame:CGRectMake(leftImg.right + kRealValue(15), titleLabel.bottom + kRealValue(10), kScreenWidth - kRealValue(65), 11)]; + desLabel.textColor = UIColorHex(#666666); + desLabel.font = SYSTEMFONT(11); + desLabel.text = @"联系小助手获取相关帮助和支持"; + desLabel.textAlignment = NSTextAlignmentLeft; + [smallView addSubview:desLabel]; + + UILabel * dayLabel = [[UILabel alloc] initWithFrame:CGRectMake(smallView.width - kRealValue(11) - 100, kRealValue(23), 100, 11)]; + dayLabel.textColor = UIColorHex(#999999); + dayLabel.font = SYSTEMFONT(11); + dayLabel.text = @""; + dayLabel.textAlignment = NSTextAlignmentRight; + self.messageLabel = dayLabel; + [smallView addSubview:dayLabel]; + +// UILabel * messageLabel = [[UILabel alloc] initWithFrame:CGRectMake(smallView.width - kRealValue(20) - 12 ,dayLabel.bottom + kRealValue(12) ,14, 14)]; +// messageLabel.textColor = KWhiteColor; +// messageLabel.font = SYSTEMFONT(10); +// messageLabel.text = @"-"; +// messageLabel.textAlignment = NSTextAlignmentCenter; +// messageLabel.layer.cornerRadius = 7; +// messageLabel.layer.masksToBounds = true; +// messageLabel.backgroundColor = UIColorHex(#21BEBD); + +// [smallView addSubview:messageLabel]; + MJWeakSelf + self.mainScrollView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{ + // 进入刷新状态后会自动调用这个block + [weakSelf createMessageNumber]; + [weakSelf creatSmallHelpNumber]; + + }]; + + // 马上进入刷新状态 + // 拉取群聊历史消息 + // 首次拉取,lastMsg 设置为 null + // 再次拉取时,lastMsg 可以使用返回的消息列表中的最后一条消息 + + +} + +- (void)createMessageNumber { + + XJDNetAPI * homeApi = [[XJDNetAPI alloc] init:self tag:@"HOMEAPI" NeedToken:@""]; + + [homeApi getHomeData:nil]; + +} + +- (void)docotrUserInfo { + + XJDNetAPI * homeApi = [[XJDNetAPI alloc] init:self tag:@"DoctorINFO" NeedToken:@""]; + + [homeApi GetInquireDoctorInfo:nil]; + +} + +- (void)handleTapGesture:(id)sender { + + if ([ESCTUIManager TUIUserStatus] == false) { + + + [self loginImAccount]; + } + [self showMBProgressHUDWithString:@"加载中..." autoHidden:false]; + XJDNetAPI * homeApi = [[XJDNetAPI alloc] init:self tag:@"FOUNDSMALLAPI" NeedToken:@""]; + + [homeApi getHomeFoundSmallHelpData:nil]; + +} + +- (void)creatSmallHelpNumber { + + XJDNetAPI * homeApi = [[XJDNetAPI alloc] init:self tag:@"SMALLAPI" NeedToken:@""]; + + [homeApi getHomeSmallData:nil]; + +} + +- (void)Failed:(NSString*)message tag:(NSString*)tag +{ + [self hiddenAllMBProgressHUD]; + [self.mainScrollView.mj_header endRefreshing]; + +} + + +- (void)Sucess:(id)response tag:(NSString*)tag +{ + [self hiddenAllMBProgressHUD]; + + + if ([tag isEqualToString:@"HOMEAPI"]) { + [self.mainScrollView.mj_header endRefreshing]; + NSDictionary * dic = response ; + +// 图文咨询:pictureUnReply 待回复 pictureIng进行中 pictureFinish已完成 视频咨询: videoUnReply待确认 videoIng进行中 videoFinish已完成 + + UILabel * pictur_wait = [self.view viewWithTag:100]; + if ([dic.allKeys containsObject:@"pictureUnReply"]) { + if ([[dic objectForKey:@"pictureUnReply"] intValue] == 0) { + pictur_wait.hidden = YES; + }else + { + pictur_wait.hidden = false; + pictur_wait.text = [NSString stringWithFormat:@"%@",[dic objectForKey:@"pictureUnReply"]]; + } + + } + + UILabel * pictur_ing = [self.view viewWithTag:110]; + + if ([dic.allKeys containsObject:@"pictureIng"]) { + if ([[dic objectForKey:@"pictureIng"] intValue] == 0) { + pictur_ing.hidden = YES; + }else + { + pictur_ing.hidden = false; + pictur_ing.text = [NSString stringWithFormat:@"%@",[dic objectForKey:@"pictureIng"]]; + } + + } + + UILabel * pictur_end = [self.view viewWithTag:120]; + + if ([dic.allKeys containsObject:@"pictureFinish"]) { + if ([[dic objectForKey:@"pictureFinish"] intValue] == 0) { + pictur_end.hidden = YES; + }else + { + pictur_end.hidden = false; + pictur_end.text = [NSString stringWithFormat:@"%@",[dic objectForKey:@"pictureFinish"]]; + } + + } + + UILabel * video_wait = [self.view viewWithTag:200]; + if ([dic.allKeys containsObject:@"videoUnReply"]) { + if ([[dic objectForKey:@"videoUnReply"] intValue] == 0) { + video_wait.hidden = YES; + }else + { + video_wait.hidden = false; + video_wait.text = [NSString stringWithFormat:@"%@",[dic objectForKey:@"videoUnReply"]]; + } + + } + + UILabel * video_ing = [self.view viewWithTag:210]; + + if ([dic.allKeys containsObject:@"videoIng"]) { + if ([[dic objectForKey:@"videoIng"] intValue] == 0) { + video_ing.hidden = YES; + }else + { + video_ing.hidden = false; + video_ing.text = [NSString stringWithFormat:@"%@",[dic objectForKey:@"videoIng"]]; + } + + } + + UILabel * video_end = [self.view viewWithTag:220]; + + if ([dic.allKeys containsObject:@"videoFinish"]) { + if ([[dic objectForKey:@"videoFinish"] intValue] == 0) { + video_end.hidden = YES; + }else + { + video_end.hidden = false; + video_end.text = [NSString stringWithFormat:@"%@",[dic objectForKey:@"videoFinish"]]; + } + + } + + } + if ([tag isEqualToString:@"SMALLAPI"]) { + [self.mainScrollView.mj_header endRefreshing]; + NSString * result = response; + if (!ValidStr(result)) { + self.smallGroup = result; + [self loginImAccount]; + + } + + } + if ([tag isEqualToString:@"FOUNDSMALLAPI"]) { + + NSDictionary * responDic = response; + + XJDSmallHelpModel * helpModel = [XJDSmallHelpModel modelWithDictionary:responDic]; + + if ([ESCTUIManager TUIUserStatus] == false) { + + + [self loginImAccount]; + return; + } + + ChatViewController * chatVC = [[ChatViewController alloc] init]; + chatVC.isGroupID = false; + chatVC.chatID = helpModel.groupId; + chatVC.smallHelp_id = helpModel.help_Id; + chatVC.member = helpModel.member; + chatVC.isVideo = false; + chatVC.eableSendReport = YES; + chatVC.eableMapTools = false; + chatVC.navTitle = @"小助手"; + chatVC.eablehaveHelathData = YES; + chatVC.questionType = 1; + chatVC.memberSex = @"2"; + [self hiddenAllMBProgressHUD]; + [self.navigationController pushViewController:chatVC animated:YES]; + + + } + if ([tag isEqualToString:@"loginIMAPI"]) { + + NSDictionary * pamrDic = response; + + XJDIMUserInfoModel * model = [XJDIMUserInfoModel modelWithDictionary:pamrDic]; + + XJDIMUserInfoModel * iminfoModel = [[XJDIMUserInfoModel alloc] init]; + iminfoModel.IMInfo = pamrDic; + [XJDCommonUtils 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 的实现类,如果您不需要监听 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]; + + [V2TIMManager.sharedInstance getGroupHistoryMessageList:[NSString stringWithFormat:@"%@",self.smallGroup] count:20 lastMsg:nil succ:^(NSArray *msgs) { + // 记录下次拉取的 lastMsg,用于下次拉取 + V2TIMMessage *lastMsg = msgs.lastObject; + NSLog(@"success, %@", msgs); + + NSDateFormatter *date = [[NSDateFormatter alloc]init]; + [date setDateFormat:@"HH:mm:ss"]; + NSString *dateString = [date stringFromDate:lastMsg.timestamp]; + + if (!ValidStr(dateString)) { + dispatch_async(dispatch_get_main_queue(), ^{ + self.messageLabel.text = [NSString stringWithFormat:@"%@",dateString]; + }); + }else + { + dispatch_async(dispatch_get_main_queue(), ^{ + self.messageLabel.text = @""; + }); + + } + + } fail:^(int code, NSString *desc) { + NSLog(@"fail, %d, %@", code, desc); + }]; + } + + if ([tag isEqualToString:@"DoctorINFO"]) { + + NSDictionary * parDic = response; + + XJDDoctorInfoModel * model = [XJDDoctorInfoModel modelWithDictionary:parDic]; + self.nameLabel.text = model.doctorName; + self.workLabel.text = [NSString stringWithFormat:@"%@",model.doctorTitle] ; + CGFloat workW = [XJDCommonUtils getLengthFromText:self.workLabel.text andFontSize:13]; + self.workLabel.width = workW; + self.hospatilLabel.text = [NSString stringWithFormat:@"%@ %@",model.resourceName,model.departmentName]; + + NSString * photo = [NSString stringWithFormat:@"%@%@",ResourceAddress,model.photo]; + + NSString * str1 = @"\\"; + + photo = [photo stringByReplacingOccurrencesOfString:str1 withString:@"/"]; + + NSString *encodedString3 = CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)photo, (CFStringRef)@"!$&'()*+,-./:;=?@_~%#[]", NULL, kCFStringEncodingUTF8)); + + [self.heardImage sd_setImageWithURL:[NSURL URLWithString:encodedString3] placeholderImage:[UIImage imageNamed:@"doctorNoImage"]]; + } + + +} + +- (void)topAction:(UIButton *)btn { + + + XJDQustionRecordViewController * recoredVC = [[XJDQustionRecordViewController alloc] init]; + //图文待回复 + if (btn.tag == 1000) { + + recoredVC.questionType = 1; + + } + //视频待确认 + if (btn.tag == 1001) { + + recoredVC.questionType = 2; + + } + recoredVC.questionStatus = 10; + [self.navigationController pushViewController:recoredVC animated:YES]; +} +- (void)loginImAccount { + + XJDNetAPI * proctocolApi = [[XJDNetAPI alloc] init:self tag:@"loginIMAPI" NeedToken:nil]; + [proctocolApi GetIMLoginAccount:nil]; + +} + + +- (UIView *)createQuestionFrame:(CGRect)frame + Image:(NSString *)imageName + withTitle:(NSString *)title + withDesTitle:(NSString *)desTitle + withTime:(NSString *)time + numberCount:(NSString *)number + withTag:(NSInteger)NumberTag{ + + UIView * view = [[UIView alloc] initWithFrame:frame]; + view.layer.cornerRadius = 10.0; + view.backgroundColor = KWhiteColor; + view.layer.masksToBounds = YES; + + UIImageView * leftImg = [[UIImageView alloc] initWithFrame:CGRectMake(24, 24, 40, 40)]; + leftImg.layer.cornerRadius = 20.0f; + leftImg.layer.masksToBounds = true; + if ([title isEqualToString:@"图文咨询"]) { + leftImg.image = [UIImage imageNamed:@"home_PictureQustion"]; + } + if ([title isEqualToString:@"视频咨询"]) { + leftImg.image = [UIImage imageNamed:@"home_VideoQustion"]; + } + if ([title isEqualToString:@"小助手"]) { + leftImg.image = [UIImage imageNamed:@"home_small"]; + } + leftImg.backgroundColor = [UIColor greenColor]; + [view addSubview:leftImg]; + + UILabel * titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(leftImg.right + kRealValue(15), kRealValue(28), kScreenWidth - kRealValue(65), 14)]; + titleLabel.textColor = UIColorHex(#333333); + titleLabel.font = BOLDSYSTEMFONT(14); + titleLabel.text = title; + titleLabel.textAlignment = NSTextAlignmentLeft; + [view addSubview:titleLabel]; + + UILabel * desLabel = [[UILabel alloc] initWithFrame:CGRectMake(leftImg.right + kRealValue(15), titleLabel.bottom + kRealValue(10), kScreenWidth - kRealValue(65), 11)]; + desLabel.textColor = UIColorHex(#666666); + desLabel.font = SYSTEMFONT(11); + desLabel.text = desTitle; + desLabel.textAlignment = NSTextAlignmentLeft; + [view addSubview:desLabel]; + + UIView * linView = [[UIView alloc] initWithFrame:CGRectMake(0, desLabel.bottom + kRealValue(26), view.width, 1)]; + linView.backgroundColor = UIColorHex(#E0E0E0); + [view addSubview:linView]; + + UIView * cowView = [[UIView alloc] initWithFrame:CGRectMake(view.width/3, linView.bottom + kRealValue(8), 1, 28)]; + cowView.backgroundColor = UIColorHex(#E0E0E0); + [view addSubview:cowView]; + + UIView * cowTwoView = [[UIView alloc] initWithFrame:CGRectMake(view.width/3 * 2, linView.bottom + kRealValue(8), 1, 28)]; + cowTwoView.backgroundColor = UIColorHex(#E0E0E0); + [view addSubview:cowTwoView]; + + //待回复 + UIButton * replayBtn = [[UIButton alloc] initWithFrame:CGRectMake(0 , linView.bottom ,view.width/3 , 45)]; + + if ([title isEqualToString:@"图文咨询"]) { + [replayBtn setTitle:@"待回复" forState:UIControlStateNormal]; + + } + if ([title isEqualToString:@"视频咨询"]) { + [replayBtn setTitle:@"待确认" forState:UIControlStateNormal]; + + } + [replayBtn setTitleColor:CFontColor1 forState:UIControlStateNormal]; + replayBtn.titleLabel.font = SYSTEMFONT(13); + replayBtn.tag = NumberTag + 1000; + [replayBtn addTarget:self action:@selector(daihuifuAction:) forControlEvents:UIControlEventTouchUpInside]; + [view addSubview:replayBtn]; + + + + UILabel * numLabel = [[UILabel alloc] initWithFrame:CGRectMake(replayBtn.width - kRealValue(22) - 12 ,kRealValue(15) ,12, 12)]; + numLabel.textColor = KWhiteColor; + numLabel.font = SYSTEMFONT(10); + numLabel.text = number; + numLabel.textAlignment = NSTextAlignmentCenter; + numLabel.layer.cornerRadius = 6; + numLabel.layer.masksToBounds = true; + numLabel.backgroundColor = UIColorHex(#21BEBD); + numLabel.tag = NumberTag; + [replayBtn addSubview:numLabel]; + //进行中 + UIButton * qustionBtn = [[UIButton alloc] initWithFrame:CGRectMake(view.width/3 , linView.bottom ,view.width/3 , 45)]; + [qustionBtn setTitle:@"进行中" forState:UIControlStateNormal]; + [qustionBtn setTitleColor:CFontColor1 forState:UIControlStateNormal]; + qustionBtn.titleLabel.font = SYSTEMFONT(13); + qustionBtn.tag = NumberTag + 1001; + [qustionBtn addTarget:self action:@selector(jingxingAction:) forControlEvents:UIControlEventTouchUpInside]; + + [view addSubview:qustionBtn]; + + UILabel * jingxingLabel = [[UILabel alloc] initWithFrame:CGRectMake(qustionBtn.width - kRealValue(22) - 12 ,kRealValue(15) ,12, 12)]; + jingxingLabel.textColor = KWhiteColor; + jingxingLabel.font = SYSTEMFONT(10); + jingxingLabel.text = number; + jingxingLabel.textAlignment = NSTextAlignmentCenter; + jingxingLabel.layer.cornerRadius = 6; + jingxingLabel.layer.masksToBounds = true; + jingxingLabel.backgroundColor = UIColorHex(#21BEBD); + jingxingLabel.tag = NumberTag + 10; + [qustionBtn addSubview:jingxingLabel]; + + //完成 + UIButton * wanchengBtn = [[UIButton alloc] initWithFrame:CGRectMake(view.width/3 * 2 , linView.bottom ,view.width/3 , 45)]; + [wanchengBtn setTitle:@"已完成" forState:UIControlStateNormal]; + [wanchengBtn setTitleColor:CFontColor1 forState:UIControlStateNormal]; + wanchengBtn.titleLabel.font = SYSTEMFONT(13); + wanchengBtn.tag = NumberTag + 1002; + [wanchengBtn addTarget:self action:@selector(wanchengAction:) forControlEvents:UIControlEventTouchUpInside]; + [view addSubview:wanchengBtn]; + + UILabel * wanchengLabel = [[UILabel alloc] initWithFrame:CGRectMake(qustionBtn.width - kRealValue(22) - 12 ,kRealValue(15) ,14, 14)]; + wanchengLabel.textColor = KWhiteColor; + wanchengLabel.font = SYSTEMFONT(10); + wanchengLabel.text = number; + wanchengLabel.textAlignment = NSTextAlignmentCenter; + wanchengLabel.layer.cornerRadius = 7; + wanchengLabel.layer.masksToBounds = true; + wanchengLabel.backgroundColor = UIColorHex(#21BEBD); + wanchengLabel.tag = NumberTag + 20; + [wanchengBtn addSubview:wanchengLabel]; + + return view; +} + +#pragma mark:待回复 +- (void)daihuifuAction:(UIButton *)daihuifuBtn { + XJDQustionRecordViewController * recoredVC = [[XJDQustionRecordViewController alloc] init]; + //图文待回复 + if (daihuifuBtn.tag == 1100) { + + recoredVC.questionType = 1; + + } + //音视频待回复 + if (daihuifuBtn.tag == 1200) { + + recoredVC.questionType = 2; + } + recoredVC.questionStatus = 10; + [self.navigationController pushViewController:recoredVC animated:YES]; +} +#pragma mark:进行中 +- (void)jingxingAction:(UIButton *)jingxingBtn { + XJDQustionRecordViewController * recoredVC = [[XJDQustionRecordViewController alloc] init]; + //图文待回复 + if (jingxingBtn.tag == 1101) { + + recoredVC.questionType = 1; + + } + //视频待确认 + if (jingxingBtn.tag == 1201) { + + recoredVC.questionType = 2; + + } + recoredVC.questionStatus = 20; + [self.navigationController pushViewController:recoredVC animated:YES]; +} +#pragma mark:已完成 +- (void)wanchengAction:(UIButton *)wancgengBtn { + + XJDQustionRecordViewController * recoredVC = [[XJDQustionRecordViewController alloc] init]; + //图文待回复 + if (wancgengBtn.tag == 1102) { + + recoredVC.questionType = 1; + + } + //音视频待回复 + if (wancgengBtn.tag == 1202) { + + recoredVC.questionType = 2; + } + recoredVC.questionStatus = 30; + [self.navigationController pushViewController:recoredVC animated:YES]; +} + +- (void)pictureQuestionAction { + + XJDStopQuestionSettingVC * detailVC = [[XJDStopQuestionSettingVC alloc] init]; + + [self.navigationController pushViewController:detailVC animated:YES]; +} + + +//在线时票据过期:此时您需要生成新的 userSig,并再次重新调用初始化。 +- (void)onKickedOffline { + + [XJDCommonUtils 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 diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/billDetail(账单明细)/XJDBillDetailViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/billDetail(账单明细)/XJDBillDetailViewController.m index 3b9bb27..c50aab6 100644 --- a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/billDetail(账单明细)/XJDBillDetailViewController.m +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/billDetail(账单明细)/XJDBillDetailViewController.m @@ -7,12 +7,12 @@ #import "XJDBillDetailViewController.h" #import "BRDatePickerView.h" -#import "BillListTable.h" -#import "YXBillListModel.h" +#import "XJDBillListTable.h" +#import "XJDBillListModel.h" @interface XJDBillDetailViewController () -@property (nonatomic, strong) BillListTable * homeTable; +@property (nonatomic, strong) XJDBillListTable * homeTable; @property (nonatomic, assign) NSInteger pageNo; @@ -43,7 +43,7 @@ - (void)setupUI { - self.homeTable = [[BillListTable alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped]; + self.homeTable = [[XJDBillListTable alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped]; MJWeakSelf [self.view addSubview:self.homeTable]; @@ -76,7 +76,7 @@ [parmDic setObject:@"3" forKey:@"type"]; [parmDic setObject:self.timeString forKey:@"date"]; - YXNetAPI * billAPI = [[YXNetAPI alloc] init:self tag:@"BillAPI" NeedToken:@""]; + XJDNetAPI * billAPI = [[XJDNetAPI alloc] init:self tag:@"BillAPI" NeedToken:@""]; [billAPI GetBillListData:parmDic]; @@ -102,7 +102,7 @@ NSDictionary * dic = response; - YXBillListModel * model = [YXBillListModel modelWithDictionary:dic]; + XJDBillListModel * model = [XJDBillListModel modelWithDictionary:dic]; self.homeTable.dataArray = model.records; } diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/billDetail(账单明细)/XJDBillListViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/billDetail(账单明细)/XJDBillListViewController.m index 826ab4e..d2fab59 100644 --- a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/billDetail(账单明细)/XJDBillListViewController.m +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/billDetail(账单明细)/XJDBillListViewController.m @@ -6,13 +6,13 @@ // #import "XJDBillListViewController.h" -#import "BillListTable.h" +#import "XJDBillListTable.h" #import "XJDWithdrawCashDetailViewController.h" -#import "YXBillListModel.h" +#import "XJDBillListModel.h" @interface XJDBillListViewController () -@property (nonatomic, strong) BillListTable * homeTable; +@property (nonatomic, strong) XJDBillListTable * homeTable; @property (nonatomic, assign) NSInteger pageNo; @property (nonatomic, strong) NSMutableArray * dataArray; @@ -40,7 +40,7 @@ - (void)setupUI { - self.homeTable = [[BillListTable alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped]; + self.homeTable = [[XJDBillListTable alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped]; MJWeakSelf self.homeTable.detailBlock = ^(NSString * _Nonnull billString) { @@ -77,7 +77,7 @@ [parmDic setObject:@(10) forKey:@"pageSize"]; [parmDic setObject:@"1" forKey:@"type"]; - YXNetAPI * billAPI = [[YXNetAPI alloc] init:self tag:@"BillAPI" NeedToken:@""]; + XJDNetAPI * billAPI = [[XJDNetAPI alloc] init:self tag:@"BillAPI" NeedToken:@""]; [billAPI GetBillListData:parmDic]; @@ -103,7 +103,7 @@ NSDictionary * dic = response; - YXBillListModel * model = [YXBillListModel modelWithDictionary:dic]; + XJDBillListModel * model = [XJDBillListModel modelWithDictionary:dic]; self.homeTable.dataArray = model.records; } diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/billDetail(账单明细)/XJDBillWithDrawViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/billDetail(账单明细)/XJDBillWithDrawViewController.m index fbb0256..d437fee 100644 --- a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/billDetail(账单明细)/XJDBillWithDrawViewController.m +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/billDetail(账单明细)/XJDBillWithDrawViewController.m @@ -6,12 +6,12 @@ // #import "XJDBillWithDrawViewController.h" -#import "BillListTable.h" -#import "YXBillListModel.h" +#import "XJDBillListTable.h" +#import "XJDBillListModel.h" #import "XJDWithdrawCashDetailViewController.h" @interface XJDBillWithDrawViewController () -@property (nonatomic, strong) BillListTable * homeTable; +@property (nonatomic, strong) XJDBillListTable * homeTable; @property (nonatomic, assign) NSInteger pageNo; @property (nonatomic, strong) NSMutableArray * dataArray; @@ -41,7 +41,7 @@ - (void)setupUI { - self.homeTable = [[BillListTable alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped]; + self.homeTable = [[XJDBillListTable alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped]; MJWeakSelf self.homeTable.detailBlock = ^(NSString * _Nonnull billString) { @@ -78,7 +78,7 @@ [parmDic setObject:@(10) forKey:@"pageSize"]; [parmDic setObject:@"2" forKey:@"type"]; - YXNetAPI * billAPI = [[YXNetAPI alloc] init:self tag:@"BillAPI" NeedToken:@""]; + XJDNetAPI * billAPI = [[XJDNetAPI alloc] init:self tag:@"BillAPI" NeedToken:@""]; [billAPI GetBillListData:parmDic]; @@ -104,7 +104,7 @@ NSDictionary * dic = response; - YXBillListModel * model = [YXBillListModel modelWithDictionary:dic]; + XJDBillListModel * model = [XJDBillListModel modelWithDictionary:dic]; self.homeTable.dataArray = model.records; } diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/billDetail(账单明细)/XJDWithdrawCashDetailViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/billDetail(账单明细)/XJDWithdrawCashDetailViewController.m index 40324ad..f7e9f14 100644 --- a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/billDetail(账单明细)/XJDWithdrawCashDetailViewController.m +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/billDetail(账单明细)/XJDWithdrawCashDetailViewController.m @@ -6,13 +6,13 @@ // #import "XJDWithdrawCashDetailViewController.h" -#import "BillDtailTable.h" -#import "YXwithDrawDetailModel.h" +#import "XJDBillDtailTable.h" +#import "XJDWithDrawDetailModel.h" @interface XJDWithdrawCashDetailViewController () @property (nonatomic, strong) UILabel * moneyLabel; @property (nonatomic, strong) UILabel * aroundLabel; -@property (nonatomic, strong) BillDtailTable * homeTable; +@property (nonatomic, strong) XJDBillDtailTable * homeTable; @end @@ -60,7 +60,7 @@ - self.homeTable = [[BillDtailTable alloc] initWithFrame:CGRectMake(kRealValue(15), tishiLabel.bottom + kRealValue(22), kScreenWidth - kRealValue(30), kScreenHeight - tishiLabel.bottom - kRealValue(68) - kTopHeight) style:UITableViewStyleGrouped]; + self.homeTable = [[XJDBillDtailTable alloc] initWithFrame:CGRectMake(kRealValue(15), tishiLabel.bottom + kRealValue(22), kScreenWidth - kRealValue(30), kScreenHeight - tishiLabel.bottom - kRealValue(68) - kTopHeight) style:UITableViewStyleGrouped]; self.homeTable.layer.cornerRadius = 10; self.homeTable.layer.masksToBounds = true; [self.view addSubview:self.homeTable]; @@ -72,7 +72,7 @@ NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; [parmDic setObject:self.bill_id forKey:@"id"]; - YXNetAPI * deatilApi = [[YXNetAPI alloc] init:self tag:@"DETAILAPI" NeedToken:@""]; + XJDNetAPI * deatilApi = [[XJDNetAPI alloc] init:self tag:@"DETAILAPI" NeedToken:@""]; [deatilApi withDrawDetailsData:parmDic]; } @@ -96,7 +96,7 @@ NSDictionary * dic = response; - YXwithDrawDetailModel * model = [YXwithDrawDetailModel modelWithDictionary:dic]; + XJDWithDrawDetailModel * model = [XJDWithDrawDetailModel modelWithDictionary:dic]; self.moneyLabel.text =[NSString stringWithFormat:@"%@",model.paymentMoney] ; self.aroundLabel.text = [NSString stringWithFormat:@"到账:%@",model.realityMoney] ; diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/workSetting(排班设置)/XJDworkSetingViewController.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/workSetting(排班设置)/XJDworkSetingViewController.h new file mode 100644 index 0000000..39141cb --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/workSetting(排班设置)/XJDworkSetingViewController.h @@ -0,0 +1,16 @@ +// +// XJDworkSetingViewController.h +// healthQuestion +// +// Created by 仁康信息 on 2023/8/6. +// + +#import "YXBaseViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDworkSetingViewController : YXBaseViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/workSetting(排班设置)/XJDworkSetingViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/workSetting(排班设置)/XJDworkSetingViewController.m new file mode 100644 index 0000000..a7736a3 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/controller/workSetting(排班设置)/XJDworkSetingViewController.m @@ -0,0 +1,490 @@ +// +// XJDworkSetingViewController.m +// healthQuestion +// +// Created by 仁康信息 on 2023/8/6. +// + +#import "XJDworkSetingViewController.h" +#import "XJDWorkSettingModel.h" +#import "XJDCustomSchedulingViewController.h" + + +@interface XJDworkSetingViewController () + +@property (nonatomic, strong) UIScrollView * mainScrollview; + +@property (nonatomic, strong) UISwitch * rightSlider; + +@property (nonatomic, strong) UIView * workView; + +@property (nonatomic, strong) UIView * jumpView; + +@property (nonatomic, strong) UISwitch * jumpSwithch; + +@property (nonatomic, strong) UIButton * submitBtn; + +@property (nonatomic, strong) UIButton * customBtn; + + +@property (nonatomic, assign) BOOL isVideo; + +@property (nonatomic, assign) BOOL isJump; + +//7个id +@property (nonatomic, copy) NSString * oneID; +@property (nonatomic, copy) NSString * twoID; +@property (nonatomic, copy) NSString * threeID; +@property (nonatomic, copy) NSString * fourID; +@property (nonatomic, copy) NSString * fiveID; +@property (nonatomic, copy) NSString * sixID; +@property (nonatomic, copy) NSString * sevenID; +@property (nonatomic, copy) NSArray * peopleArray; + + +@end + +@implementation XJDworkSetingViewController + +#pragma mark:懒加载 + + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. + self.isHidenNaviBar = false; + self.navigationItem.title = @"视频排班"; + [self createUI]; + [self createData]; +} + +- (void)createUI { + + self.mainScrollview = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)]; + self.mainScrollview.backgroundColor = CViewBgColor; + [self.view addSubview:self.mainScrollview]; + + UIView * workView = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(15), kRealValue(12), kScreenWidth - kRealValue(30), kRealValue(382))]; + workView.layer.cornerRadius = 10; + workView.layer.masksToBounds = YES; + self.workView = workView; + workView.backgroundColor = KWhiteColor; + [self.mainScrollview addSubview:workView]; + + + NSArray * array = @[@"周一",@"周二",@"周三",@"周四",@"周五",@"周六",@"周天"]; + + CGFloat viewW = self.workView.width - kRealValue(30); + + for (int i = 0; i < array.count; i++) { + + UIView * weekView = [self createWorkView:CGRectMake(kRealValue(15), kRealValue(40) + 15 + kRealValue(45) * i, viewW, kRealValue(35)) withWeek:array[i] withAmTag:100 +i withPmTag:200 + i]; + [self.workView addSubview:weekView]; + + } + + UILabel * questionTitle = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(15), kRealValue(18),200, 15)]; + questionTitle.textAlignment = NSTextAlignmentLeft; + questionTitle.textColor = UIColorHex(#333333); + questionTitle.font = BOLDSYSTEMFONT(15); + questionTitle.text = @"视频咨询"; + [workView addSubview:questionTitle]; + + + self.rightSlider = [[UISwitch alloc] initWithFrame:CGRectMake(workView.width - kRealValue(52), kRealValue(11), kRealValue(40), 30)]; + [self.rightSlider setOn:NO animated:YES]; + [self.rightSlider setOnTintColor: UIColorHex(#59D5D4)]; + self.rightSlider.transform = CGAffineTransformMakeScale(0.6, 0.6); + self.isVideo = false; + [self.rightSlider addTarget:self action:@selector(switchChange:) forControlEvents:UIControlEventValueChanged]; + [workView addSubview:self.rightSlider]; + + + + + UIView * jumpView = [[UIView alloc] initWithFrame:CGRectMake(workView.left, workView.bottom + kRealValue(10), workView.width, kRealValue(44))]; + jumpView.layer.cornerRadius = 10.0; + jumpView.layer.masksToBounds = YES; + jumpView.backgroundColor = KWhiteColor; + self.jumpView = jumpView; + [self.mainScrollview addSubview:jumpView]; + + + UILabel * jumpLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(15), 0, 200, kRealValue(44))]; + jumpLabel.textColor = CFontColor1; + jumpLabel.text = @"自动跳过法定节假日?"; + jumpLabel.font = MEDIUMFONT(14); + jumpLabel.textAlignment = NSTextAlignmentLeft; + [jumpView addSubview:jumpLabel]; + + + + self.jumpSwithch = [[UISwitch alloc] initWithFrame:CGRectMake(jumpView.width - kRealValue(52), kRealValue(9), kRealValue(40), 30)]; + [self.jumpSwithch setOn:NO animated:YES]; + [self.jumpSwithch setOnTintColor: UIColorHex(#59D5D4)]; + self.jumpSwithch.transform = CGAffineTransformMakeScale(0.6, 0.6); + self.isJump = false; + [self.jumpSwithch addTarget:self action:@selector(jumpChange:) forControlEvents:UIControlEventValueChanged]; + [jumpView addSubview:self.jumpSwithch]; + + UIButton * submitBtn = [[UIButton alloc] initWithFrame:CGRectMake(20, jumpView.bottom + kRealValue(98), 160, 35)]; + submitBtn.backgroundColor = KWhiteColor; + submitBtn.layer.cornerRadius = 20; + submitBtn.layer.borderColor = UIColorHex(#21BEBD).CGColor; + submitBtn.layer.borderWidth = 1.0f; + [submitBtn setTitle:@"生成排班" forState:UIControlStateNormal]; + [submitBtn setTitleColor:UIColorHex(#21BEBD) forState:UIControlStateNormal]; + submitBtn.centerX = self.view.centerX; + [submitBtn addTarget:self action:@selector(submitTimeAction) forControlEvents:UIControlEventTouchUpInside]; + submitBtn.titleLabel.font = SYSTEMFONT(14); + self.submitBtn = submitBtn; + [self.mainScrollview addSubview:submitBtn]; + +// UIButton * customBtn = [[UIButton alloc] initWithFrame:CGRectMake(20, submitBtn.bottom + kRealValue(10), 160, 35)]; +// customBtn.centerX = self.view.centerX; +// customBtn.titleLabel.font = SYSTEMFONT(14); +// customBtn.backgroundColor = KClearColor; +// [customBtn setTitle:@"自定义排班" forState:UIControlStateNormal]; +// [customBtn setTitleColor:UIColorHex(#21BEBD) forState:UIControlStateNormal]; +// [customBtn addTarget:self action:@selector(customAction) forControlEvents:UIControlEventTouchUpInside]; +// [self.view addSubview:customBtn]; +// self.customBtn = customBtn; +// [self.mainScrollview addSubview:submitBtn]; + + self.mainScrollview.contentSize = CGSizeMake(kScreenWidth, submitBtn.bottom + kRealValue(22)); +} + + +- (void)createData { + + XJDNetAPI * workApi = [[XJDNetAPI alloc] init:self tag:@"WEEKAPI" NeedToken:@""]; + NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; + [workApi GetDoctorWorkSetting:parmDic]; + + +} + +- (UIView *)createWorkView:(CGRect)frame withWeek:(NSString *)week withAmTag:(NSInteger)amTag withPmTag:(NSInteger)pmTag { + + UIView * view = [[UIView alloc] initWithFrame:frame]; + view.layer.cornerRadius = 18; + view.backgroundColor = UIColorHex(#E0E0E0); + view.layer.masksToBounds = YES; + + UILabel * weekLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(26), 0, kRealValue(63), view.height)]; + weekLabel.textAlignment = NSTextAlignmentLeft; + weekLabel.textColor = UIColorHex(#333333); + weekLabel.font = SYSTEMFONT(13); + weekLabel.text = week; + [view addSubview:weekLabel]; + CGFloat amWidth = [XJDCommonUtils getLengthFromText:@"上午" andFontSize:13]; + UILabel * amLabel = [[UILabel alloc] initWithFrame:CGRectMake(weekLabel.right, 0, amWidth, view.height)]; + amLabel.text = @"上午"; + amLabel.textAlignment = NSTextAlignmentLeft; + amLabel.textColor = UIColorHex(#333333); + amLabel.font = SYSTEMFONT(13); + [view addSubview:amLabel]; + + UITextField * pepleField = [[UITextField alloc] initWithFrame:CGRectMake(amLabel.right +5 , 5, 38, view.height - 10)]; + pepleField.backgroundColor = KWhiteColor; + pepleField.layer.cornerRadius = 5.0; + pepleField.layer.masksToBounds = YES; + pepleField.textAlignment = NSTextAlignmentCenter; + pepleField.font = SYSTEMFONT(13); + pepleField.keyboardType = UIKeyboardTypeNumberPad; + pepleField.tag = amTag; + [view addSubview:pepleField]; + + CGFloat peoWidth = [XJDCommonUtils getLengthFromText:@"人" andFontSize:13]; + UILabel * peoLabel = [[UILabel alloc] initWithFrame:CGRectMake(pepleField.right + 5, 0, peoWidth, view.height)]; + peoLabel.text = @"人"; + peoLabel.textAlignment = NSTextAlignmentLeft; + peoLabel.textColor = UIColorHex(#333333); + peoLabel.font = SYSTEMFONT(13); + [view addSubview:peoLabel]; + + UILabel * rightPeoLabel = [[UILabel alloc] initWithFrame:CGRectMake(view.width - kRealValue(23) - peoWidth, 0, peoWidth, view.height)]; + rightPeoLabel.text = @"人"; + rightPeoLabel.textAlignment = NSTextAlignmentLeft; + rightPeoLabel.textColor = UIColorHex(#333333); + rightPeoLabel.font = SYSTEMFONT(13); + + [view addSubview:rightPeoLabel]; + + UITextField * pmField = [[UITextField alloc] initWithFrame:CGRectMake(rightPeoLabel.left - 5 - 38 , 5, 38, view.height - 10)]; + pmField.backgroundColor = KWhiteColor; + pmField.layer.cornerRadius = 5.0; + pmField.textAlignment = NSTextAlignmentCenter; + pmField.font = SYSTEMFONT(13); + pmField.layer.masksToBounds = YES; + pmField.tag = pmTag; + pmField.keyboardType = UIKeyboardTypeNumberPad; + [view addSubview:pmField]; + + UILabel * pmLabel = [[UILabel alloc] initWithFrame:CGRectMake(pmField.left - amWidth - 5, 0, amWidth, view.height)]; + pmLabel.text = @"下午"; + pmLabel.textAlignment = NSTextAlignmentLeft; + pmLabel.textColor = UIColorHex(#333333); + pmLabel.font = SYSTEMFONT(13); + [view addSubview:pmLabel]; + + return view; +} + +- (void) switchChange:(UISwitch*)sw { + + self.isVideo = sw.on; + + +} + +- (void)jumpChange:(UISwitch*)sw { + + self.isJump = sw.on; +} + + +- (void)submitTimeAction { + + NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; + NSMutableArray * dataArray = [[NSMutableArray alloc] init]; + + if (self.isVideo == true) { + //有时间用模型吧 + + //周一 + UITextField * oneAmField = [self.view viewWithTag:100]; + UITextField * onePmField = [self.view viewWithTag:200]; + if ([oneAmField.text integerValue] > 0 ||[onePmField.text integerValue] > 0 ) { + NSString * oneDic = [self createSubmitData:oneAmField.text PMtext:onePmField.text Withweek:@"1" withWeekID:self.oneID]; + [dataArray addObject:oneDic]; + } + //周二 + UITextField * twoAmField = [self.view viewWithTag:101]; + UITextField * twoPmField = [self.view viewWithTag:201]; + if ([twoAmField.text integerValue] > 0 ||[twoPmField.text integerValue] > 0 ) { + NSString * twoDic = [self createSubmitData:twoAmField.text PMtext:twoPmField.text Withweek:@"2" withWeekID:self.twoID]; + [dataArray addObject:twoDic]; + } + //周三 + UITextField * threeAmField = [self.view viewWithTag:102]; + UITextField * threePmField = [self.view viewWithTag:202]; + if ([threeAmField.text integerValue] > 0 ||[threePmField.text integerValue] > 0 ) { + NSString * threeDic = [self createSubmitData:threeAmField.text PMtext:threePmField.text Withweek:@"3" withWeekID:self.threeID]; + [dataArray addObject:threeDic]; + } + //周四 + UITextField * fourAmField = [self.view viewWithTag:103]; + UITextField * fourPmField = [self.view viewWithTag:203]; + if ([fourAmField.text integerValue] > 0 ||[fourPmField.text integerValue] > 0 ) { + NSString * fourDic = [self createSubmitData:fourAmField.text PMtext:fourPmField.text Withweek:@"4" withWeekID:self.fourID]; + [dataArray addObject:fourDic]; + } + //周五 + UITextField * fiveAmField = [self.view viewWithTag:104]; + UITextField * fivePmField = [self.view viewWithTag:204]; + if ([fiveAmField.text integerValue] > 0 ||[fivePmField.text integerValue] > 0 ) { + NSString * fiveDic = [self createSubmitData:fiveAmField.text PMtext:fivePmField.text Withweek:@"5" withWeekID:self.fiveID]; + [dataArray addObject:fiveDic]; + } + //周六 + UITextField * sixAmField = [self.view viewWithTag:105]; + UITextField * sixPmField = [self.view viewWithTag:205]; + if ([sixAmField.text integerValue] > 0 ||[sixPmField.text integerValue] > 0 ) { + NSString * sixDic = [self createSubmitData:sixAmField.text PMtext:sixPmField.text Withweek:@"6" withWeekID:self.sixID]; + [dataArray addObject:sixDic]; + } + //周天 + UITextField * sevenAmField = [self.view viewWithTag:106]; + UITextField * sevenPmField = [self.view viewWithTag:206]; + if ([sevenAmField.text integerValue] > 0 ||[sevenPmField.text integerValue] > 0 ) { + NSString * sevenDic = [self createSubmitData:sevenAmField.text PMtext:sevenPmField.text Withweek:@"7" withWeekID:self.sevenID]; + [dataArray addObject:sevenDic]; + } + + if (dataArray.count == 0) { + [EasyTextView showErrorText:@"请输入就诊人数"]; + return; + } + // 创建一个包含对象的数组 + [parmDic setObject:dataArray forKey:@"list"]; + + } + else + { + NSArray * array = [NSArray modelArrayWithClass:[XJDWorkTimeModel class] json:self.peopleArray]; + + for (XJDWorkTimeModel * model in self.peopleArray) { + NSString * jsonString = [model modelToJSONObject]; + [dataArray addObject:jsonString]; + } + [parmDic setObject:dataArray forKey:@"list"]; + } +// //是否开启音视频 +// self.isVideo; +// //是否自动跳过节假日 +// self.isJump; +// tfDefault 自排班已去掉 + [parmDic setObject:@(1) forKey:@"audioStatus"]; + + if (self.isVideo == true) { + [parmDic setObject:@(1) forKey:@"audioStatus"]; + + }else if (self.isVideo == false) { + [parmDic setObject:@(0) forKey:@"audioStatus"]; + } + + + if (self.isJump == true) { + [parmDic setObject:@(1) forKey:@"tfJumpHoliday"]; + + }else if (self.isJump == false) { + [parmDic setObject:@(0) forKey:@"tfJumpHoliday"]; + } + + [parmDic setObject:@(0) forKey:@"tfDefault"]; + + [self showMBProgressHUDWithString:@"正在设置" autoHidden:false]; + XJDNetAPI * workApi = [[XJDNetAPI alloc] init:self tag:@"WorkAPI" NeedToken:@""]; + + + + [workApi PostDoctorWorkTime:parmDic]; + + +} + +- (NSString *)createSubmitData:(NSString *)amText + PMtext:(NSString *)pmText + Withweek:(NSString *)week + withWeekID:(NSString *)weekID{ + + NSMutableDictionary * dic = [[NSMutableDictionary alloc] init]; + NSInteger type = 0; + if ([amText integerValue] > 0 || [pmText intValue] > 0) { + + if ([amText integerValue] > 0) { + [dic setObject:[NSString stringWithFormat:@"%@",amText] forKey:@"amNum"]; + type = 0; + } + if ([pmText integerValue] > 0) { + [dic setObject:[NSString stringWithFormat:@"%@",pmText] forKey:@"pmNum"]; + type = 1; + } + if ([amText integerValue] > 0 && [pmText intValue] > 0) { + type = 2; + } + [dic setObject:[NSString stringWithFormat:@"%@",weekID] forKey:@"id"]; + [dic setObject:@(type) forKey:@"type"]; + [dic setObject:week forKey:@"week"]; + [dic setObject:@(self.isJump) forKey:@"tfJumpHoliday"]; + [dic setObject:@(self.isVideo) forKey:@"audioStatus"]; + + } + XJDWorkTimeModel * model = [XJDWorkTimeModel modelWithDictionary:dic]; + NSString * jsonString = [model modelToJSONObject]; + return jsonString; +} + +- (void)Failed:(NSString*)message tag:(NSString*)tag +{ + [self hiddenAllMBProgressHUD]; + +} + + +- (void)Sucess:(id)response tag:(NSString*)tag +{ + [self hiddenAllMBProgressHUD]; + if ([tag isEqualToString:@"WorkAPI"]) { + [self hiddenAllMBProgressHUD]; + [self showMBProgressHUDOnlyWithString:response]; + } + if ([tag isEqualToString:@"WEEKAPI"]) { + + NSDictionary * resDic = response; + + XJDWorkSettingModel * model = [XJDWorkSettingModel modelWithDictionary:resDic]; + + [self.jumpSwithch setOn:[model.tfJumpHoliday boolValue] animated:YES]; + [self.rightSlider setOn:[model.audioStatus boolValue] animated:YES]; + + [self switchChange:self.rightSlider]; + self.peopleArray = model.list; + for (XJDWorkTimeModel * timeModel in model.list) { + + //周一 + [self haveDoctorWorkTime:timeModel]; + + } + } + + +} + +- (void)haveDoctorWorkTime:(XJDWorkTimeModel *)timeModel { + + if ([timeModel.week intValue] == 1) { + self.oneID = timeModel.work_id; + UITextField * oneAmField = [self.view viewWithTag:100]; + UITextField * onePmField = [self.view viewWithTag:200]; + oneAmField.text = timeModel.amNum; + onePmField.text = timeModel.pmNum; + } + if ([timeModel.week intValue] == 2) { + self.twoID = timeModel.work_id; + UITextField * twoAmField = [self.view viewWithTag:101]; + UITextField * twoPmField = [self.view viewWithTag:201]; + twoAmField.text = timeModel.amNum; + twoPmField.text = timeModel.pmNum; + } + if ([timeModel.week intValue] == 3) { + self.threeID = timeModel.work_id; + UITextField * threeAmField = [self.view viewWithTag:102]; + UITextField * threePmField = [self.view viewWithTag:202]; + threeAmField.text = timeModel.amNum; + threePmField.text = timeModel.pmNum; + } + if ([timeModel.week intValue] == 4) { + self.fourID = timeModel.work_id; + UITextField * fourAmField = [self.view viewWithTag:103]; + UITextField * fourPmField = [self.view viewWithTag:203]; + fourAmField.text = timeModel.amNum; + fourPmField.text = timeModel.pmNum; + } + if ([timeModel.week intValue] == 5) { + self.fiveID = timeModel.work_id; + UITextField * fiveAmField = [self.view viewWithTag:104]; + UITextField * fivePmField = [self.view viewWithTag:204]; + fiveAmField.text = timeModel.amNum; + fivePmField.text = timeModel.pmNum; + } + if ([timeModel.week intValue] == 6) { + self.sixID = timeModel.work_id; + UITextField * sixAmField = [self.view viewWithTag:105]; + UITextField * sixPmField = [self.view viewWithTag:205]; + sixAmField.text = timeModel.amNum; + sixPmField.text = timeModel.pmNum; + } + if ([timeModel.week intValue] == 7) { + self.sevenID = timeModel.work_id; + UITextField * sevenAmField = [self.view viewWithTag:106]; + UITextField * sevenPmField = [self.view viewWithTag:206]; + sevenAmField.text = timeModel.amNum; + sevenPmField.text = timeModel.pmNum; + } + + +} + +- (void)customAction { + + XJDCustomSchedulingViewController * customvc = [[XJDCustomSchedulingViewController alloc] init]; + + [self.navigationController pushViewController:customvc animated:YES]; + +} + + + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDCancelReasonModel.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDCancelReasonModel.h new file mode 100644 index 0000000..2df0546 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDCancelReasonModel.h @@ -0,0 +1,21 @@ +// +// XJDCancelReasonModel.h +// healthQuestion +// +// Created by 仁康信息 on 2023/8/17. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDCancelReasonModel : NSObject + +@property (nonatomic, strong) NSString * value; +@property (nonatomic, strong) NSString * text; +@property (nonatomic, strong) NSString * label; +@property (nonatomic, strong) NSString * title; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDCancelReasonModel.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDCancelReasonModel.m new file mode 100644 index 0000000..dd0be35 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDCancelReasonModel.m @@ -0,0 +1,12 @@ +// +// XJDCancelReasonModel.m +// healthQuestion +// +// Created by 仁康信息 on 2023/8/17. +// + +#import "XJDCancelReasonModel.h" + +@implementation XJDCancelReasonModel + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/YXDoctorInfoModel.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDDoctorInfoModel.h similarity index 87% rename from DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/YXDoctorInfoModel.h rename to DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDDoctorInfoModel.h index c858182..24a592e 100644 --- a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/YXDoctorInfoModel.h +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDDoctorInfoModel.h @@ -1,5 +1,5 @@ // -// YXDoctorInfoModel.h +// XJDDoctorInfoModel.h // healthQuestion // // Created by 仁康信息 on 2023/8/4. @@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN -@interface YXDoctorGoodSicknessModel : NSObject +@interface XJDDoctorGoodSicknessModel : NSObject @property (nonatomic, copy) NSString * sicks_id; @@ -20,13 +20,13 @@ NS_ASSUME_NONNULL_BEGIN @end -@interface YXDoctorInfoModel : NSObject +@interface XJDDoctorInfoModel : NSObject @property (nonatomic, copy) NSString * doctor_Id; @property (nonatomic, copy) NSString * sex; -@property (nonatomic, strong) NSArray * goodAtSicknessName; +@property (nonatomic, strong) NSArray * goodAtSicknessName; @property (nonatomic, copy) NSString * doctorJob_dictText; diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDDoctorInfoModel.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDDoctorInfoModel.m new file mode 100644 index 0000000..6d3c768 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDDoctorInfoModel.m @@ -0,0 +1,42 @@ +// +// XJDDoctorInfoModel.m +// healthQuestion +// +// Created by 仁康信息 on 2023/8/4. +// + +#import "XJDDoctorInfoModel.h" + + +@implementation XJDDoctorGoodSicknessModel + ++ (NSDictionary *)modelCustomPropertyMapper +{ + NSDictionary * dic =@{@"sicks_id" :@"id"}; + return dic; +} + + +@end + +@implementation XJDDoctorInfoModel + ++ (NSDictionary *)modelCustomPropertyMapper +{ + NSDictionary * dic =@{@"doctor_Id" :@"id"}; + return dic; +} + + + ++ (NSDictionary *)modelContainerPropertyGenericClass +{ + + + return @{@"goodAtSicknessName":[XJDDoctorGoodSicknessModel class], + }; + +} + + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/HQHomePageModel.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDHomePageModel.h similarity index 83% rename from DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/HQHomePageModel.h rename to DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDHomePageModel.h index 4eb17db..d00970a 100644 --- a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/HQHomePageModel.h +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDHomePageModel.h @@ -1,5 +1,5 @@ // -// YXHomePageModel.h +// XJDHomePageModel.h // healthQuestion // // Created by 仁康信息 on 2022/9/9. @@ -8,7 +8,7 @@ #import NS_ASSUME_NONNULL_BEGIN -@interface YXHomePageModel : NSObject +@interface XJDHomePageModel : NSObject @property (nonatomic, copy) NSString * imageName; @@ -17,7 +17,7 @@ NS_ASSUME_NONNULL_BEGIN @end -@interface HQProjectModel : NSObject +@interface XJDProjectModel : NSObject @property (nonatomic, copy) NSString * imageName; @@ -30,7 +30,7 @@ NS_ASSUME_NONNULL_BEGIN @end -@interface HQSmallHelpModel : NSObject +@interface XJDSmallHelpModel : NSObject @property (nonatomic, copy) NSString * groupId; diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDHomePageModel.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDHomePageModel.m new file mode 100644 index 0000000..923e179 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDHomePageModel.m @@ -0,0 +1,32 @@ +// +// XJDHomePageModel.m +// healthQuestion +// +// Created by 仁康信息 on 2022/9/9. +// + +#import "XJDHomePageModel.h" + +@implementation XJDHomePageModel + +@end + + + +@implementation XJDProjectModel + +@end + + +@implementation XJDSmallHelpModel + ++ (NSDictionary *)modelCustomPropertyMapper +{ + NSDictionary * dic =@{@"help_Id" :@"id"}; + return dic; +} + +@end + + + diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDHospitalModel.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDHospitalModel.h new file mode 100644 index 0000000..dab82f2 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDHospitalModel.h @@ -0,0 +1,25 @@ +// +// XJDHospitalModel.h +// healthQuestion +// +// Created by 仁康信息 on 2022/9/19. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDHospitalModel : NSObject + +@property (nonatomic, copy) NSString * hospitalName; + +@property (nonatomic, copy) NSString * hospitalImage; + +@property (nonatomic, copy) NSString * hospitalId; + +@property (nonatomic, assign) BOOL isChoose; + + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDHospitalModel.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDHospitalModel.m new file mode 100644 index 0000000..9ed1818 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDHospitalModel.m @@ -0,0 +1,18 @@ +// +// XJDHospitalModel.m +// healthQuestion +// +// Created by 仁康信息 on 2022/9/19. +// + +#import "XJDHospitalModel.h" + +@implementation XJDHospitalModel + ++ (NSDictionary *)modelCustomPropertyMapper +{ + NSDictionary * dic =@{@"hospitalId" :@"id"}; + return dic; +} + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDProjectListModel.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDProjectListModel.h new file mode 100644 index 0000000..0767077 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDProjectListModel.h @@ -0,0 +1,33 @@ +// +// XJDProjectListModel.h +// healthQuestion +// +// Created by 仁康信息 on 2022/10/12. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDSubProjectListModel : NSObject + +@property (nonatomic, copy) NSString * imageName; + +@property (nonatomic, copy) NSString * projectName; + +@end + +@interface XJDProjectListModel : NSObject + +@property (nonatomic, assign) BOOL isShow; + +@property (nonatomic, assign) BOOL isSelected; + +@property (nonatomic, copy) NSString * projectName; + +@property (nonatomic, strong) NSArray* subData; + + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDProjectListModel.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDProjectListModel.m new file mode 100644 index 0000000..cd5c36e --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDProjectListModel.m @@ -0,0 +1,27 @@ +// +// XJDProjectListModel.m +// healthQuestion +// +// Created by 仁康信息 on 2022/10/12. +// + +#import "XJDProjectListModel.h" + +@implementation XJDSubProjectListModel + +@end + + + +@implementation XJDProjectListModel + ++ (NSDictionary *)modelContainerPropertyGenericClass +{ + + + return @{@"subData":[XJDSubProjectListModel class], + }; + +} + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/QuestionBodyReportModel.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDQuestionBodyReportModel.h similarity index 81% rename from DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/QuestionBodyReportModel.h rename to DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDQuestionBodyReportModel.h index 1261807..1807fbf 100644 --- a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/QuestionBodyReportModel.h +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDQuestionBodyReportModel.h @@ -1,5 +1,5 @@ // -// YXQuestionBodyReportModel.h +// XJDQuestionBodyReportModel.h // healthQuestion // // Created by 仁康信息 on 2023/8/16. @@ -9,7 +9,7 @@ NS_ASSUME_NONNULL_BEGIN -@interface YXQuestionBodyReportModel : NSObject +@interface XJDQuestionBodyReportModel : NSObject @property (nonatomic, strong) NSString * insertdate; @property (nonatomic, strong) NSString * tjrq; diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDQuestionBodyReportModel.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDQuestionBodyReportModel.m new file mode 100644 index 0000000..55a836e --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDQuestionBodyReportModel.m @@ -0,0 +1,12 @@ +// +// XJDQuestionBodyReportModel.m +// healthQuestion +// +// Created by 仁康信息 on 2023/8/16. +// + +#import "XJDQuestionBodyReportModel.h" + +@implementation XJDQuestionBodyReportModel + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/QuestionRecordModel.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDQuestionRecordModel.h similarity index 95% rename from DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/QuestionRecordModel.h rename to DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDQuestionRecordModel.h index 34d7327..083c662 100644 --- a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/QuestionRecordModel.h +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDQuestionRecordModel.h @@ -1,5 +1,5 @@ // -// YXQuestionRecordModel.h +// XJDQuestionRecordModel.h // healthQuestion // // Created by 仁康信息 on 2023/8/15. @@ -9,7 +9,7 @@ NS_ASSUME_NONNULL_BEGIN -@interface YXQuestionRecordModel : NSObject +@interface XJDQuestionRecordModel : NSObject @property (nonatomic, copy) NSString * record_id; @property (nonatomic, copy) NSString * memberId; diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDQuestionRecordModel.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDQuestionRecordModel.m new file mode 100644 index 0000000..84cea7f --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDQuestionRecordModel.m @@ -0,0 +1,19 @@ +// +// XJDQuestionRecordModel.m +// healthQuestion +// +// Created by 仁康信息 on 2023/8/15. +// + +#import "XJDQuestionRecordModel.h" + +@implementation XJDQuestionRecordModel + ++ (NSDictionary *)modelCustomPropertyMapper +{ + NSDictionary * dic =@{@"record_id" :@"id"}; + return dic; +} + + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/YXQuestionStaticsModel.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDQuestionStaticsModel.h similarity index 82% rename from DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/YXQuestionStaticsModel.h rename to DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDQuestionStaticsModel.h index c827962..321d5c4 100644 --- a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/YXQuestionStaticsModel.h +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDQuestionStaticsModel.h @@ -1,5 +1,5 @@ // -// YXQuestionStaticsModel.h +// XJDQuestionStaticsModel.h // healthQuestion // // Created by 仁康信息 on 2023/8/8. @@ -9,7 +9,7 @@ NS_ASSUME_NONNULL_BEGIN -@interface YXQuestionStaticsModel : NSObject +@interface XJDQuestionStaticsModel : NSObject @property (nonatomic, copy) NSString * total; diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDQuestionStaticsModel.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDQuestionStaticsModel.m new file mode 100644 index 0000000..59283f8 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDQuestionStaticsModel.m @@ -0,0 +1,12 @@ +// +// XJDQuestionStaticsModel.m +// healthQuestion +// +// Created by 仁康信息 on 2023/8/8. +// + +#import "XJDQuestionStaticsModel.h" + +@implementation XJDQuestionStaticsModel + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDRecordIMListDateModel.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDRecordIMListDateModel.h new file mode 100644 index 0000000..378765b --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDRecordIMListDateModel.h @@ -0,0 +1,50 @@ +// +// RecordIMListDateModel.h +// healthQuestion +// +// Created by 仁康信息 on 2023/8/15. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDRecordIMListDateModel : NSObject +@property (nonatomic, strong) NSString * Record_id; +@property (nonatomic, strong) NSString * rejectReason; +@property (nonatomic, strong) NSString * fromAccount; +@property (nonatomic, strong) NSString * memberName; +@property (nonatomic, strong) NSString * hospitalLevel; +@property (nonatomic, strong) NSString * contentStatus; +@property (nonatomic, strong) NSString * schedulingDateId; +@property (nonatomic, strong) NSString * amPm; +@property (nonatomic, strong) NSString * toAccountName; +@property (nonatomic, strong) NSString * memberSex; +@property (nonatomic, strong) NSString * contentType; +@property (nonatomic, strong) NSString * reasonType; + +@property (nonatomic, strong) NSString * week; +@property (nonatomic, strong) NSString * toAccount; +@property (nonatomic, strong) NSString * sessionType; +@property (nonatomic, strong) NSString * medicalRecordsId; +@property (nonatomic, strong) NSString * toAccountHead; +@property (nonatomic, strong) NSString * toAccountTitle; +@property (nonatomic, strong) NSString * createTimeLong; +@property (nonatomic, strong) NSString * tfOwn; +@property (nonatomic, strong) NSString * memberId; + +@property (nonatomic, strong) NSString * doctorStartTime; +@property (nonatomic, strong) NSString * departmentName; +@property (nonatomic, strong) NSString * tfReply; +@property (nonatomic, strong) NSString * doctorEndTimeLong; +@property (nonatomic, strong) NSString * sessionDate; +@property (nonatomic, strong) NSString * imId; +@property (nonatomic, strong) NSString * createTime; +@property (nonatomic, strong) NSString * memberAge; +@property (nonatomic, strong) NSString * resourceName; + +@property (nonatomic, strong) NSString * unRedMessage; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDRecordIMListDateModel.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDRecordIMListDateModel.m new file mode 100644 index 0000000..720fe0a --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDRecordIMListDateModel.m @@ -0,0 +1,19 @@ +// +// YXRecordIMListDateModel.m +// healthQuestion +// +// Created by 仁康信息 on 2023/8/15. +// + +#import "XJDRecordIMListDateModel.h" + +@implementation XJDRecordIMListDateModel + + ++ (NSDictionary *)modelCustomPropertyMapper +{ + NSDictionary * dic =@{@"Record_id" :@"id"}; + return dic; +} + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDRecoredListDetailModel.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDRecoredListDetailModel.h new file mode 100644 index 0000000..229cfeb --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDRecoredListDetailModel.h @@ -0,0 +1,142 @@ +// +// XJDRecoredListDetailModel.h +// healthQuestion +// +// Created by 仁康信息 on 2023/8/16. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDRecoredDetailConsessionModel : NSObject + +@property (nonatomic, copy) NSString * consession_id; + +@property (nonatomic, copy) NSString * memberId; + +@property (nonatomic, copy) NSString * toAccount; + +@property (nonatomic, copy) NSString * fromAccount; + +@property (nonatomic, copy) NSString * memberName; + +@property (nonatomic, copy) NSString * memberSex; + +@property (nonatomic, copy) NSString * memberAge; + +@property (nonatomic, copy) NSString * createTime; + +@property (nonatomic, copy) NSString * sessionDate; + +@property (nonatomic, copy) NSString * week; + +@property (nonatomic, copy) NSString * amPm; + +@property (nonatomic, copy) NSString * sessionType; + +@property (nonatomic, copy) NSString * weight; + +@property (nonatomic, copy) NSString * contentStatus; + +@property (nonatomic, copy) NSString * reasonType; + +@property (nonatomic, copy) NSString * rejectReason; + +@property (nonatomic, copy) NSString * imId; + +@property (nonatomic, copy) NSString * doctorStartTimeLong; + +@property (nonatomic, copy) NSString * doctorEndTimeLong; +@property (nonatomic, copy) NSString * sessionDateLong; +@property (nonatomic, copy) NSString * contentType; +@property (nonatomic, copy) NSString * doctorStartTime; + +@end + + +@interface XJDRecoredconMedicalRecordsListDO : NSObject + +@property (nonatomic, copy) NSString * dangan_id; +@property (nonatomic, copy) NSString * recordsName; +@property (nonatomic, copy) NSString * medicalDescribe; +@property (nonatomic, copy) NSString * tfPermission; +@property (nonatomic, copy) NSString * image; +@property (nonatomic, copy) NSString * createTime; +@property (nonatomic, copy) NSString * haveTimeValue; +@property (nonatomic, copy) NSString * tfLookValue; +@property (nonatomic, copy) NSString * tfLook; +@property (nonatomic, copy) NSString * desire; +@property (nonatomic, copy) NSString * lookOffice; +@property (nonatomic, copy) NSString * lookMedicalName; + +@end + +@interface XJDRecoredDetailHealthModel : NSObject + +@property (nonatomic, strong) NSString * answerValue; +@property (nonatomic, strong) NSString * answerKey; + +@end + + +@interface XJDRecoredDetailIMListModel : NSObject + + +@property (nonatomic, copy) NSString * endTime; + +@property (nonatomic, copy) NSString * startTime; + +@property (nonatomic, copy) NSString * endTimeLong; + +@property (nonatomic, copy) NSString * startTimLong; + +@property (nonatomic, copy) NSString * type; // 1约定时间 2通话时长 + + +@end + +@interface XJDRecoredListDetailModel : NSObject + +@property (nonatomic, strong) NSArray * imList; + +@property (nonatomic, strong) NSArray * answer; + +@property (nonatomic, strong) NSDictionary * conSession; + +@property (nonatomic, strong) NSDictionary * conFamilyMembersDO; + +@property (nonatomic, strong) NSDictionary * conMedicalRecordsListDO; + +@property (nonatomic, strong) NSDictionary * conMedicalRecordsDO; + +@property (nonatomic, copy) NSString * idNo; + +@property (nonatomic, copy) NSString * conEvaluateDO; + +@property (nonatomic, copy) NSString * createTime; + +@end + + +@interface XJDReocrdconFamilyMembersDO : NSObject + +@property (nonatomic, copy) NSString * name; + +@property (nonatomic, copy) NSString * gender; + +@property (nonatomic, copy) NSString * height; + +@property (nonatomic, copy) NSString * weight; + +@property (nonatomic, copy) NSString * familyRelation; + +@property (nonatomic, copy) NSString * groupId; + +@property (nonatomic, copy) NSString * age; + +@property (nonatomic, copy) NSString * family_id; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDRecoredListDetailModel.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDRecoredListDetailModel.m new file mode 100644 index 0000000..55bd989 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDRecoredListDetailModel.m @@ -0,0 +1,86 @@ +// +// XJDRecoredListDetailModel.m +// healthQuestion +// +// Created by 仁康信息 on 2023/8/16. +// + +#import "XJDRecoredListDetailModel.h" + +@implementation XJDRecoredDetailConsessionModel + ++ (NSDictionary *)modelCustomPropertyMapper +{ + NSDictionary * dic =@{@"consession_id" :@"id"}; + return dic; +} + +@end +// +@implementation XJDRecoredconMedicalRecordsListDO + ++ (NSDictionary *)modelCustomPropertyMapper +{ + NSDictionary * dic =@{@"dangan_id" :@"id"}; + return dic; +} + + +@end + + +@implementation XJDRecoredDetailHealthModel + +//+ (NSDictionary *)modelContainerPropertyGenericClass +//{ +// +// return @{ +// @"childList":[QuestionOptionChildListModel class], +// +// }; +//} +// +//+ (NSDictionary *)modelCustomPropertyMapper +//{ +// NSDictionary * dic =@{@"option_id" :@"id"}; +// return dic; +//} + +@end + + +@implementation XJDRecoredDetailIMListModel + + + +@end + + +@implementation XJDRecoredListDetailModel + + ++ (NSDictionary *)modelContainerPropertyGenericClass +{ + + + return @{@"imList":[XJDRecoredDetailIMListModel class], + @"answer":[XJDRecoredDetailHealthModel class], + }; + +} +@end + +@implementation XJDReocrdconFamilyMembersDO + + + ++ (NSDictionary *)modelCustomPropertyMapper +{ + NSDictionary * dic =@{@"family_id" :@"id"}; + return dic; +} + + +@end + + diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDStopReasonModel.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDStopReasonModel.h new file mode 100644 index 0000000..8570680 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDStopReasonModel.h @@ -0,0 +1,25 @@ +// +// YXStopReasonModel.h +// healthQuestion +// +// Created by 仁康信息 on 2023/8/9. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDStopReasonModel : NSObject + +@property (nonatomic, copy) NSString * value; + +@property (nonatomic, copy) NSString * label; + +@property (nonatomic, copy) NSString * title; + +@property (nonatomic, copy) NSString * text; + + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDStopReasonModel.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDStopReasonModel.m new file mode 100644 index 0000000..2993339 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDStopReasonModel.m @@ -0,0 +1,12 @@ +// +// XJDStopReasonModel.m +// healthQuestion +// +// Created by 仁康信息 on 2023/8/9. +// + +#import "XJDStopReasonModel.h" + +@implementation XJDStopReasonModel + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/StopServiceModel.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDStopServiceModel.h similarity index 82% rename from DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/StopServiceModel.h rename to DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDStopServiceModel.h index 6247a36..6a06759 100644 --- a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/StopServiceModel.h +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDStopServiceModel.h @@ -1,5 +1,5 @@ // -// YXStopServiceModel.h +// XJDStopServiceModel.h // healthQuestion // // Created by 仁康信息 on 2023/8/9. @@ -9,7 +9,7 @@ NS_ASSUME_NONNULL_BEGIN -@interface YXStopServiceListModel : NSObject +@interface XJDStopServiceListModel : NSObject @property (nonatomic, copy) NSString * record_id; @@ -36,7 +36,7 @@ NS_ASSUME_NONNULL_BEGIN @end -@interface YXStopServiceModel : NSObject +@interface XJDStopServiceModel : NSObject @property (nonatomic, strong) NSArray * orders; @@ -46,7 +46,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, assign) NSInteger total; -@property (nonatomic, strong) NSArray * records; +@property (nonatomic, strong) NSArray * records; @end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDStopServiceModel.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDStopServiceModel.m new file mode 100644 index 0000000..111c421 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDStopServiceModel.m @@ -0,0 +1,33 @@ +// +// XJDStopServiceModel.m +// healthQuestion +// +// Created by 仁康信息 on 2023/8/9. +// + +#import "XJDStopServiceModel.h" + +@implementation XJDStopServiceListModel + + ++ (NSDictionary *)modelCustomPropertyMapper +{ + NSDictionary * dic =@{@"record_id" :@"id"}; + return dic; +} + + +@end + +@implementation XJDStopServiceModel + ++ (NSDictionary *)modelContainerPropertyGenericClass +{ + + + return @{@"records":[XJDStopServiceListModel class], + }; + +} + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDToolsModel.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDToolsModel.h new file mode 100644 index 0000000..470ecb0 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDToolsModel.h @@ -0,0 +1,21 @@ +// +// XJDToolsModel.h +// healthQuestion +// +// Created by 仁康信息 on 2022/9/28. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDToolsModel : NSObject + +/** + * 标题 + */ +@property (nonatomic, copy) NSString *title; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDToolsModel.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDToolsModel.m new file mode 100644 index 0000000..5a3488b --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDToolsModel.m @@ -0,0 +1,13 @@ +// +// XJDToolsModel.m +// healthQuestion +// +// Created by 仁康信息 on 2022/9/28. +// + +#import "XJDToolsModel.h" + +@implementation XJDToolsModel + + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/withDrawDetailModel.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDWithDrawDetailModel.h similarity index 97% rename from DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/withDrawDetailModel.h rename to DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDWithDrawDetailModel.h index 7652421..ccbe0dd 100644 --- a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/withDrawDetailModel.h +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDWithDrawDetailModel.h @@ -9,7 +9,7 @@ NS_ASSUME_NONNULL_BEGIN -@interface YXwithDrawDetailModel : NSObject +@interface XJDWithDrawDetailModel : NSObject @property (nonatomic, copy) NSString * wraw_Id; @property (nonatomic, copy) NSString * sessionId; diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDWithDrawDetailModel.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDWithDrawDetailModel.m new file mode 100644 index 0000000..4983d0a --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDWithDrawDetailModel.m @@ -0,0 +1,19 @@ +// +// withDrawDetailModel.m +// healthQuestion +// +// Created by 仁康信息 on 2023/8/18. +// + +#import "XJDWithDrawDetailModel.h" + +@implementation XJDWithDrawDetailModel + + ++ (NSDictionary *)modelCustomPropertyMapper +{ + NSDictionary * dic =@{@"wraw_Id" :@"id"}; + return dic; +} + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDWorkSettingModel.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDWorkSettingModel.h new file mode 100644 index 0000000..13d28c5 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDWorkSettingModel.h @@ -0,0 +1,50 @@ +// +// XJDWorkSettingModel.h +// healthQuestion +// +// Created by 仁康信息 on 2023/8/7. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDWorkTimeModel : NSObject + +@property (nonatomic, copy) NSString * amNum; + +@property (nonatomic, copy) NSString * pmNum; + +@property (nonatomic, copy) NSString * week; + +@property (nonatomic, copy) NSString * checked; + +@property (nonatomic, copy) NSString * consultSwitchOn; + +@property (nonatomic, copy) NSString * itemType; + +@property (nonatomic, copy) NSString * tfDefault; + +@property (nonatomic, copy) NSString * tfJumpHoliday; + +@property (nonatomic, copy) NSString * type; + +@property (nonatomic, copy) NSString * timePeriod; + +@property (nonatomic, copy) NSString * work_id; + +@end + +@interface XJDWorkSettingModel : NSObject + +@property (nonatomic, copy) NSString * tfDefault; + +@property (nonatomic, copy) NSString * audioStatus; + +@property (nonatomic, copy) NSString * tfJumpHoliday; + +@property (nonatomic, strong) NSArray * list; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDWorkSettingModel.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDWorkSettingModel.m new file mode 100644 index 0000000..6bd3c79 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/XJDWorkSettingModel.m @@ -0,0 +1,35 @@ +// +// XJDWorkSettingModel.m +// healthQuestion +// +// Created by 仁康信息 on 2023/8/7. +// + +#import "XJDWorkSettingModel.h" + + +@implementation XJDWorkTimeModel + ++ (NSDictionary *)modelCustomPropertyMapper +{ + NSDictionary * dic =@{@"work_id" :@"id"}; + return dic; +} + + +@end + +@implementation XJDWorkSettingModel + ++ (NSDictionary *)modelContainerPropertyGenericClass +{ + + + return @{@"list":[XJDWorkTimeModel class], + }; + +} + + + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/YXCancelReasonModel.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/YXCancelReasonModel.m deleted file mode 100644 index 8213e4c..0000000 --- a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/YXCancelReasonModel.m +++ /dev/null @@ -1,12 +0,0 @@ -// -// YXCancelReasonModel.m -// healthQuestion -// -// Created by 仁康信息 on 2023/8/17. -// - -#import "YXCancelReasonModel.h" - -@implementation YXCancelReasonModel - -@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/YXQuestionBodyReportModel.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/YXQuestionBodyReportModel.m deleted file mode 100644 index d1a06ff..0000000 --- a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/YXQuestionBodyReportModel.m +++ /dev/null @@ -1,12 +0,0 @@ -// -// YXQuestionBodyReportModel.m -// healthQuestion -// -// Created by 仁康信息 on 2023/8/16. -// - -#import "YXQuestionBodyReportModel.h" - -@implementation YXQuestionBodyReportModel - -@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/YXQuestionStaticsModel.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/YXQuestionStaticsModel.m deleted file mode 100644 index c02ef60..0000000 --- a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/YXQuestionStaticsModel.m +++ /dev/null @@ -1,12 +0,0 @@ -// -// YXQuestionStaticsModel.m -// healthQuestion -// -// Created by 仁康信息 on 2023/8/8. -// - -#import "YXQuestionStaticsModel.h" - -@implementation YXQuestionStaticsModel - -@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/YXStopReasonModel.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/YXStopReasonModel.m deleted file mode 100644 index c3c785d..0000000 --- a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/model/YXStopReasonModel.m +++ /dev/null @@ -1,12 +0,0 @@ -// -// YXStopReasonModel.m -// healthQuestion -// -// Created by 仁康信息 on 2023/8/9. -// - -#import "YXStopReasonModel.h" - -@implementation YXStopReasonModel - -@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/BasicHealthInfo(基本健康信息)/XJDBasicHealthInfoView.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/BasicHealthInfo(基本健康信息)/XJDBasicHealthInfoView.h new file mode 100644 index 0000000..c2be6ca --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/BasicHealthInfo(基本健康信息)/XJDBasicHealthInfoView.h @@ -0,0 +1,20 @@ +// +// XJDBasicHealthInfoView.h +// healthQuestion +// +// Created by 仁康信息 on 2023/5/4. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDBasicHealthInfoView : UIView + +@property (nonatomic, strong) NSArray * dataArray; + +@property (nonatomic, assign) CGFloat healthHeight; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/BasicHealthInfo(基本健康信息)/XJDBasicHealthInfoView.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/BasicHealthInfo(基本健康信息)/XJDBasicHealthInfoView.m new file mode 100644 index 0000000..d889891 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/BasicHealthInfo(基本健康信息)/XJDBasicHealthInfoView.m @@ -0,0 +1,135 @@ +// +// XJDBasicHealthInfoView.m +// healthQuestion +// +// Created by 仁康信息 on 2023/5/4. +// + +#import "XJDBasicHealthInfoView.h" +#import "XJDRecoredListDetailModel.h" + +@interface XJDBasicHealthInfoView () + +@property (nonatomic, strong) NSMutableArray * leftArray; + +@property (nonatomic, strong) NSMutableArray * rightArray; + +@property (nonatomic, strong) UILabel * lastLabel; + +@end + +@implementation XJDBasicHealthInfoView + +/* +// Only override drawRect: if you perform custom drawing. +// An empty implementation adversely affects performance during animation. +- (void)drawRect:(CGRect)rect { + // Drawing code +} +*/ + +- (NSMutableArray *)leftArray { + + if (!_leftArray) { + _leftArray = [[NSMutableArray alloc] init]; + } + return _leftArray; +} + +- (NSMutableArray *)rightArray { + + if (!_rightArray) { + + _rightArray = [[NSMutableArray alloc] init]; + } + return _rightArray; +} + + +- (instancetype)initWithFrame:(CGRect)frame { + + if (self = [super initWithFrame:frame]) { + self.backgroundColor = KWhiteColor; + [self createUI]; + + } + + return self; +} + + +- (void)createUI { + + + NSArray * leftArray = @[@"饮食习惯:",@"烟酒习惯:",@"既往史:",@"家族史:",@"过敏史:",@"用药史:"]; + NSArray * rightArray = @[@"",@"",@"",@"",@"",@""]; + + for (int i = 0; i < leftArray.count; i ++) { + + + UILabel * leftLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(18), kRealValue(20) + 47 * i, 100, 13)]; + leftLabel.text =leftArray[i]; + leftLabel.font = MEDIUMFONT(13); + leftLabel.textAlignment = NSTextAlignmentLeft; + leftLabel.textColor = UIColorHex(#666666); + CGFloat w = [XJDCommonUtils getLengthFromText:leftLabel.text andFontSize:13]; + leftLabel.width = w; + [self addSubview:leftLabel]; + [self.leftArray addObject:leftLabel]; + + UILabel * rightLabel = [[UILabel alloc] initWithFrame:CGRectMake(leftLabel.right, leftLabel.top, self.width - leftLabel.right, 13)]; + rightLabel.text =rightArray[i]; + rightLabel.font = MEDIUMFONT(13); + rightLabel.textAlignment = NSTextAlignmentLeft; + rightLabel.textColor = UIColorHex(#333333); + [self addSubview:rightLabel]; + + [self.rightArray addObject:rightLabel]; + + } + + +} + +- (void)setDataArray:(NSArray *)dataArray { + + _dataArray = dataArray; + for (UILabel * leftLabel in self.leftArray) { + [leftLabel removeFromSuperview]; + } + for (UILabel * rightLabel in self.rightArray) { + [rightLabel removeFromSuperview]; + } + [self.leftArray removeAllObjects]; + [self.rightArray removeAllObjects]; + + for (int i = 0; i < _dataArray.count; i ++) { + + XJDRecoredDetailHealthModel * model = _dataArray[i]; + + UILabel * leftLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(18), kRealValue(20) + 14 + 30 * i, 100, 13)]; + leftLabel.text = model.answerKey; + leftLabel.font = MEDIUMFONT(13); + leftLabel.textAlignment = NSTextAlignmentLeft; + leftLabel.textColor = UIColorHex(#666666); + [self addSubview:leftLabel]; + + + UILabel * rightLabel = [[UILabel alloc] initWithFrame:CGRectMake(leftLabel.right, leftLabel.top, self.width - leftLabel.right, 13)]; + rightLabel.text = model.answerValue; + rightLabel.font = MEDIUMFONT(13); + rightLabel.textAlignment = NSTextAlignmentLeft; + [self addSubview:rightLabel]; + [self.leftArray addObject:leftLabel]; + [self.rightArray addObject:rightLabel]; + + if (i == _dataArray.count - 1) { + self.lastLabel = rightLabel; + } + } + self.healthHeight = self.lastLabel.bottom + kRealValue(20); + +} + + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/BillDetailView(账单详情)/XJDBillDetailTableViewCell.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/BillDetailView(账单详情)/XJDBillDetailTableViewCell.h new file mode 100644 index 0000000..2bef8ad --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/BillDetailView(账单详情)/XJDBillDetailTableViewCell.h @@ -0,0 +1,21 @@ +// +// XJDBillDetailTableViewCell.h +// healthQuestion +// +// Created by 仁康信息 on 2023/5/5. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDBillDetailTableViewCell : UITableViewCell + +@property (nonatomic, copy) NSString * leftString; + +@property (nonatomic, copy) NSString * rightString; + + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/BillDetailView(账单详情)/XJDBillDetailTableViewCell.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/BillDetailView(账单详情)/XJDBillDetailTableViewCell.m new file mode 100644 index 0000000..a3425d4 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/BillDetailView(账单详情)/XJDBillDetailTableViewCell.m @@ -0,0 +1,90 @@ +// +// XJDBillDetailTableViewCell.m +// healthQuestion +// +// Created by 仁康信息 on 2023/5/5. +// + +#import "XJDBillDetailTableViewCell.h" + +@interface XJDBillDetailTableViewCell () + +@property (nonatomic, strong) UILabel * leftLabel; + +@property (nonatomic, strong) UILabel * rightLabel; + +@end + +@implementation XJDBillDetailTableViewCell + +- (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.leftLabel = [[UILabel alloc] init]; + self.leftLabel.textColor = UIColorHex(#666666); + self.leftLabel.font = BOLDSYSTEMFONT(14); + self.leftLabel.textAlignment = NSTextAlignmentLeft; + [self.contentView addSubview:self.leftLabel]; + + [self.leftLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_offset(15); + make.top.mas_offset(kRealValue(30)); + make.height.mas_offset(13); + }]; + [self.leftLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal]; + + self.rightLabel = [[UILabel alloc] init]; + self.rightLabel.textColor = UIColorHex(#333333); + self.rightLabel.font = BOLDSYSTEMFONT(13); + self.rightLabel.numberOfLines = 0; + self.rightLabel.textAlignment = NSTextAlignmentRight; + [self.contentView addSubview:self.rightLabel]; + + [self layoutIfNeeded]; + [self.rightLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.mas_offset(-18); + make.left.mas_equalTo(self.leftLabel.mas_right).offset(8); + make.top.mas_equalTo(self.leftLabel); + make.bottom.mas_offset(-5); + }]; + [self.rightLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal]; + + +} + +- (void)setLeftString:(NSString *)leftString { + _leftString = leftString; + + self.leftLabel.text = _leftString; + +} + +- (void)setRightString:(NSString *)rightString { + + _rightString = rightString; + + self.rightLabel.text = rightString; + +} + +@end + diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/BillDetailView(账单详情)/XJDBillDtailTable.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/BillDetailView(账单详情)/XJDBillDtailTable.h new file mode 100644 index 0000000..363b1d4 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/BillDetailView(账单详情)/XJDBillDtailTable.h @@ -0,0 +1,21 @@ +// +// XJDBillDtailTable.h +// healthQuestion +// +// Created by 仁康信息 on 2023/5/5. +// + +#import +#import "XJDWithDrawDetailModel.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDBillDtailTable : UITableView + +@property (nonatomic, strong) NSDictionary * dic; + +@property (nonatomic, strong) XJDWithDrawDetailModel * model; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/BillDetailView(账单详情)/XJDBillDtailTable.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/BillDetailView(账单详情)/XJDBillDtailTable.m new file mode 100644 index 0000000..9d638b8 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/BillDetailView(账单详情)/XJDBillDtailTable.m @@ -0,0 +1,126 @@ +// +// XJDBillDtailTable.m +// healthQuestion +// +// Created by 仁康信息 on 2023/5/5. +// + +#import "XJDBillDtailTable.h" +#import "XJDBillDetailTableViewCell.h" + +@interface XJDBillDtailTable () + +@end + +@implementation XJDBillDtailTable + + +- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style { + + if (self = [super initWithFrame:frame style:style]) { + + [self createUI]; + } + + return self; +} + +- (void)createUI { + + self.delegate = self; + self.dataSource = self; + self.backgroundColor = UIColor.whiteColor; + self.showsVerticalScrollIndicator = false; + self.showsHorizontalScrollIndicator = false; + self.separatorStyle = UITableViewCellSeparatorStyleNone; + self.estimatedRowHeight = 60; + self.rowHeight = UITableViewAutomaticDimension; + + + +} + +- (void)setModel:(XJDWithDrawDetailModel *)model { + + _model = model; + [self reloadData]; + +} + +#pragma mark - tableview的代理方法 +//组数 +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return 1; +} +//每组多少行 +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return 9; +} +//注册cell +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + NSArray * array; + + + XJDBillDetailTableViewCell * cell = [self dequeueReusableCellWithIdentifier:@"BILLCELL"]; + + if (!cell) { + + cell = [[XJDBillDetailTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"BILLCELL"]; + } + if (self.model) { + array = @[@[@"流水号:",[NSString stringWithFormat:@"%@",self.model.wraw_Id] ],@[@"提现方:",self.model.withdrawalName],@[@"提现方式:",self.model.withdraw],@[@"收款账号:",self.model.paymentAccount],@[@"提现金额:",[NSString stringWithFormat:@"%@",self.model.paymentMoney]],@[@"实际到账金额:",[NSString stringWithFormat:@"%@",self.model.realityMoney]],@[@"提现说明:",self.model.remarks],@[@"账户金额:",[NSString stringWithFormat:@"%@",self.model.accountMoney]],@[@"提现时间",[NSString stringWithFormat:@"%@",self.model.paymentTime]]]; + cell.leftString= array[indexPath.row][0]; + cell.rightString= array[indexPath.row][1]; + } + + cell.backgroundColor = KWhiteColor; + cell.selectionStyle = UITableViewCellSelectionStyleNone; + return cell; + +} + +- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { + + return CGFLOAT_MIN; +} + +- (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 * videoView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kRealValue(10))]; + + return videoView; + +} +////cell点击事件 +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + + + +} + + +@end + + + diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/BillDetailView(账单详情)/XJDBillListTable.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/BillDetailView(账单详情)/XJDBillListTable.h new file mode 100644 index 0000000..967f1ec --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/BillDetailView(账单详情)/XJDBillListTable.h @@ -0,0 +1,22 @@ +// +// XJDBillListTable.h +// healthQuestion +// +// Created by 仁康信息 on 2023/5/5. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef void(^lookBillDetail)(NSString * billString); + +@interface XJDBillListTable : UITableView + +@property (nonatomic, strong) NSArray * dataArray; + +@property (nonatomic, copy) lookBillDetail detailBlock; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/BillDetailView(账单详情)/XJDBillListTable.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/BillDetailView(账单详情)/XJDBillListTable.m new file mode 100644 index 0000000..f964b04 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/BillDetailView(账单详情)/XJDBillListTable.m @@ -0,0 +1,125 @@ +// +// XJDBillListTable.m +// healthQuestion +// +// Created by 仁康信息 on 2023/5/5. +// + +#import "XJDBillListTable.h" +#import "XJDBillListTableViewCell.h" + + +@interface XJDBillListTable () + +@end + +@implementation XJDBillListTable + + +- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style { + + if (self = [super initWithFrame:frame style:style]) { + + [self createUI]; + } + + return self; +} + +- (void)createUI { + + 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 +{ + + XJDBillListTableViewCell * cell = [self dequeueReusableCellWithIdentifier:@"BILLCELL"]; + + if (!cell) { + + cell = [[XJDBillListTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"BILLCELL"]; + } + cell.backgroundColor = KWhiteColor; + cell.layer.cornerRadius = 10.0; + cell.layer.masksToBounds = true; + cell.selectionStyle = UITableViewCellSelectionStyleNone; + cell.model = self.dataArray[indexPath.section]; + return cell; + +} + +- (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 * videoView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kRealValue(10))]; + + return videoView; + +} +////cell点击事件 +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + YXBillListDetailModel * model = self.dataArray[indexPath.section]; + + if (self.detailBlock) { + + self.detailBlock(model.bill_id); + } + +} + + +@end + + diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/BillDetailView(账单详情)/XJDBillListTableViewCell.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/BillDetailView(账单详情)/XJDBillListTableViewCell.h new file mode 100644 index 0000000..faeeb60 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/BillDetailView(账单详情)/XJDBillListTableViewCell.h @@ -0,0 +1,18 @@ +// +// XJDBillListTableViewCell.h +// healthQuestion +// +// Created by 仁康信息 on 2023/5/5. +// + +#import +#import "XJDBillListModel.h" +NS_ASSUME_NONNULL_BEGIN + +@interface XJDBillListTableViewCell : UITableViewCell + +@property (nonatomic, strong) YXBillListDetailModel * model; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/BillDetailView(账单详情)/XJDBillListTableViewCell.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/BillDetailView(账单详情)/XJDBillListTableViewCell.m new file mode 100644 index 0000000..f8ea052 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/BillDetailView(账单详情)/XJDBillListTableViewCell.m @@ -0,0 +1,115 @@ +// +// XJDBillListTableViewCell.m +// healthQuestion +// +// Created by 仁康信息 on 2023/5/5. +// + +#import "XJDBillListTableViewCell.h" + +@interface XJDBillListTableViewCell () + +@property (nonatomic, strong) UILabel * typeLabel; + +@property (nonatomic, strong) UILabel * timeLabel; + +@property (nonatomic, strong) UILabel * moneyLabel; + +@property (nonatomic, strong) UILabel * billLabel; + +@end + +@implementation XJDBillListTableViewCell + +- (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.typeLabel = [[UILabel alloc] init]; + self.typeLabel.text = @""; + self.typeLabel.textColor = CFontColor1; + self.typeLabel.font = BOLDSYSTEMFONT(14); + self.typeLabel.textAlignment = NSTextAlignmentLeft; + [self.contentView addSubview:self.typeLabel]; + + [self.typeLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_offset(18); + make.top.mas_offset(15); + make.height.mas_offset(14); + make.width.mas_offset(90); + }]; + + self.moneyLabel = [[UILabel alloc] init]; + self.moneyLabel.text = @""; + self.moneyLabel.textColor = UIColorHex(#21BEBD); + self.moneyLabel.font = BOLDSYSTEMFONT(16); + self.moneyLabel.textAlignment = NSTextAlignmentRight; + [self.contentView addSubview:self.moneyLabel]; + + [self.moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.mas_offset(-18); + make.top.mas_offset(19); + make.height.mas_offset(13); + make.width.mas_offset(200); + }]; + + self.timeLabel = [[UILabel alloc] init]; + + self.timeLabel.textColor = UIColorHex(#999999); + self.timeLabel.font = BOLDSYSTEMFONT(12); + self.timeLabel.textAlignment = NSTextAlignmentLeft; + [self.contentView addSubview:self.timeLabel]; + + [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_offset(18); + make.top.mas_equalTo(self.typeLabel.mas_bottom).offset(10); + make.height.mas_offset(13); + make.bottom.mas_offset(-16); + }]; + [self.timeLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal]; + + self.billLabel = [[UILabel alloc] init]; + + self.billLabel.textColor = UIColorHex(#333333); + self.billLabel.font = MEDIUMFONT(12); + self.billLabel.textAlignment = NSTextAlignmentRight; + [self.contentView addSubview:self.billLabel]; + + [self.billLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.mas_offset(-18); + make.top.mas_equalTo(self.typeLabel.mas_bottom).offset(10); + make.height.mas_offset(13); + make.bottom.mas_offset(-16); + }]; + [self.billLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal]; +} + +- (void)setModel:(YXBillListDetailModel *)model { + + _model = model; + self.typeLabel.text = _model.operateType_dictText; + self.moneyLabel.text = [NSString stringWithFormat:@"%.2f",[_model.income floatValue]]; + self.timeLabel.text = _model.createTime; + self.billLabel.text = [NSString stringWithFormat:@"余额:%.2f",[_model.accountMoney floatValue]]; +} +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/DetailUserInfoView.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/DetailUserInfoView.h deleted file mode 100644 index 642bf23..0000000 --- a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/DetailUserInfoView.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// DetailUserInfoView.h -// healthQuestion -// -// Created by 仁康信息 on 2023/4/27. -// - -#import -#import "YXRecoredListDetailModel.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface DetailUserInfoView : UIView - -@property (nonatomic, strong) YXReocrdconFamilyMembersDO * userInfo; - -@end - -NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDDetailTitleView.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDDetailTitleView.h new file mode 100644 index 0000000..151f645 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDDetailTitleView.h @@ -0,0 +1,18 @@ +// +// DetailTitleView.h +// healthQuestion +// +// Created by 仁康信息 on 2023/4/27. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDDetailTitleView : UIView + +@property (nonatomic, copy) NSString * createTime; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDDetailTitleView.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDDetailTitleView.m new file mode 100644 index 0000000..6613743 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDDetailTitleView.m @@ -0,0 +1,66 @@ +// +// XJDDetailTitleView.m +// healthQuestion +// +// Created by 仁康信息 on 2023/4/27. +// + +#import "XJDDetailTitleView.h" + +@interface XJDDetailTitleView () + +@property (nonatomic, strong) UILabel * timeLabel; + +@end + +@implementation XJDDetailTitleView + +/* +// 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 * headImg = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.width, 33)]; + headImg.image = IMAGE_NAMED(@"userinfoTitleImg"); + [self addSubview:headImg]; + + UIImageView * leftImg = [[UIImageView alloc] initWithFrame:CGRectMake(kRealValue(16), 10, 15, 15)]; + leftImg.image = IMAGE_NAMED(@"questionLeft_icon"); + [headImg addSubview:leftImg]; + + UILabel * titleLabel = [[UILabel alloc] init]; + titleLabel.frame = CGRectMake(leftImg.right + kRealValue(7),10 , 80, 14); + titleLabel.textAlignment = NSTextAlignmentLeft; + titleLabel.text = @"咨询人信息"; + titleLabel.font = BOLDSYSTEMFONT(14); + [self addSubview:titleLabel]; + + self.timeLabel = [[UILabel alloc] initWithFrame:CGRectMake( headImg.width/2 - kRealValue(10) , 8 , headImg.width/2 -kRealValue(10) , 15)]; + self.timeLabel.text = @"--"; + self.timeLabel.font = SYSTEMFONT(10); + self.timeLabel.textAlignment = NSTextAlignmentRight; + self.timeLabel.textColor = KWhiteColor; + [headImg addSubview:self.timeLabel]; + +} + +- (void)setCreateTime:(NSString *)createTime { + _createTime = createTime; + self.timeLabel.text = [NSString stringWithFormat:@"生成时间:%@",_createTime]; +} + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDDetailUserInfoView.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDDetailUserInfoView.h new file mode 100644 index 0000000..3cd9d6a --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDDetailUserInfoView.h @@ -0,0 +1,19 @@ +// +// XJDDetailUserInfoView.h +// healthQuestion +// +// Created by 仁康信息 on 2023/4/27. +// + +#import +#import "XJDRecoredListDetailModel.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDDetailUserInfoView : UIView + +@property (nonatomic, strong) XJDReocrdconFamilyMembersDO * userInfo; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDDetailUserInfoView.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDDetailUserInfoView.m new file mode 100644 index 0000000..fbea0da --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDDetailUserInfoView.m @@ -0,0 +1,114 @@ +// +// XJDDetailUserInfoView.m +// healthQuestion +// +// Created by 仁康信息 on 2023/4/27. +// + +#import "XJDDetailUserInfoView.h" + +@interface XJDDetailUserInfoView () + + +@end + +@implementation XJDDetailUserInfoView + +/* +// 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 { + + + //一行的列数 + NSInteger cols = 3; + //label大小 + CGFloat labW = (self.width - kRealValue(46) ) / 3 ; + CGFloat labH = 13; + CGFloat pading = 0; + //每一行的间距 + CGFloat rowMargin = kRealValue(20); + for (int i = 0; i < 5; i ++) { + //所在列 + NSInteger col = i % cols; + //所在行 + NSInteger row = i / cols; + + CGFloat shopX = col * (labW ); + CGFloat shopY = row * (labH + rowMargin); + UILabel * nameLabel = [[UILabel alloc] init]; + nameLabel.frame = CGRectMake( kRealValue(18) + shopX,kRealValue(23) + shopY, labW, labH); + nameLabel.textAlignment = NSTextAlignmentLeft; + nameLabel.text = @""; + nameLabel.font = SYSTEMFONT(13); + nameLabel.tag = 100 + i; + [self addSubview:nameLabel]; + + } + UIView * lineV = [[UIView alloc] initWithFrame:CGRectMake(0, self.height, self.width, 1)]; + lineV.backgroundColor = UIColorHex(#E0E0E0); + [self addSubview:lineV]; +} + +- (void)setUserInfo:(XJDReocrdconFamilyMembersDO *)userInfo { + + _userInfo = userInfo; + + UILabel * nameLabel = [self viewWithTag:100]; + + nameLabel.text = [NSString stringWithFormat:@"姓名:%@",_userInfo.name]; + + NSString * sexString = [_userInfo.gender integerValue] == 1 ? @"女":@"男"; + + UILabel * sexLabel = [self viewWithTag:101]; + + sexLabel.text = [NSString stringWithFormat:@"性别:%@",sexString]; + + UILabel * ageLabel = [self viewWithTag:102]; + + ageLabel.text = [NSString stringWithFormat:@"年龄:%@",_userInfo.age]; + + + UILabel * shengaoLabel = [self viewWithTag:103]; + + NSString * heightString ; + if (ValidStr(_userInfo.height)) { + heightString = @"--"; + } + else + { + heightString = _userInfo.height; + } + shengaoLabel.text = [NSString stringWithFormat:@"身高:%@cm",heightString]; + + NSString * weightString ; + if (ValidStr(_userInfo.height)) { + weightString = @"--"; + } + else + { + weightString = _userInfo.weight; + } + UILabel * weightLabel = [self viewWithTag:104]; + + weightLabel.text = [NSString stringWithFormat:@"体重:%@kg",weightString]; + +} + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDQuestionAppointmentTimeView.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDQuestionAppointmentTimeView.h new file mode 100644 index 0000000..50e29f0 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDQuestionAppointmentTimeView.h @@ -0,0 +1,33 @@ +// +// XJDQuestionAppointmentTimeView.h +// healthQuestion +// +// Created by 仁康信息 on 2023/4/27. +// + +#import +#import "XJDRecoredListDetailModel.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDQuestionAppointmentTimeView : UIView + +//@property (nonatomic, assign) BOOL ishide; +// +//@property (nonatomic, strong) XJDRecoredListDetailModel * model; +// +//@property (nonatomic, strong) NSArray * imList; +// +//@property (nonatomic, assign) CGFloat timeHeight; +//@property (nonatomic, strong) DoctorReportDoctorInfoModel * doctorModel; +//@property (nonatomic, strong) DoctorReportConSessionModel * sessionModel; +@property (nonatomic, strong) XJDRecoredListDetailModel * model; + +@property (nonatomic, assign) CGFloat doctorinfoHeight; + +@property (nonatomic, assign) bool isJujue; + + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDQuestionAppointmentTimeView.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDQuestionAppointmentTimeView.m new file mode 100644 index 0000000..95dafe0 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDQuestionAppointmentTimeView.m @@ -0,0 +1,401 @@ +// +// XJDQuestionAppointmentTimeView.m +// healthQuestion +// +// Created by 仁康信息 on 2023/4/27. +// + +#import "XJDQuestionAppointmentTimeView.h" +#import "NSDate+BRPickerView.h" +@interface XJDQuestionAppointmentTimeView () + +@property (nonatomic, strong) NSMutableArray * labsArray; + +@property (nonatomic, strong) UILabel * timeLabel; + +@property (nonatomic, strong) UILabel * questionTypeLabel; + +@property (nonatomic, strong) UILabel * starTimeLabel; + +@property (nonatomic, strong) UIButton * collectBtn; + +@property (nonatomic, strong) UIView * starTimeView ; //开始时间视图 +@property (nonatomic, strong) UIView * jujueView ; //拒绝视图 +@property (nonatomic, strong) UIView * cancelQuestionView ; //取消视图 +@property (nonatomic, strong) UIView * questionRecordView ; //咨询记录 + + +@property (nonatomic, strong) UILabel * jujueyuanyinLab ; //拒绝原因 +@property (nonatomic, strong) UILabel * jujueBeizhuLab ; //拒绝备注 +@property (nonatomic, strong) UILabel * beizhuLabel ; //拒绝备注 +@property (nonatomic, strong) UILabel * cancelTimeLabel ; //取消时间 +@property (nonatomic, strong) UILabel * recordStarLabel ; //取消时间 + +@end + +@implementation XJDQuestionAppointmentTimeView + +/* +// Only override drawRect: if you perform custom drawing. +// An empty implementation adversely affects performance during animation. +- (void)drawRect:(CGRect)rect { + // Drawing code +} +*/ + +#pragma mark:懒加载 +- (NSMutableArray *)labsArray { + + if (!_labsArray) { + + _labsArray = [[NSMutableArray alloc] init]; + } + return _labsArray; +} + +- (instancetype)initWithFrame:(CGRect)frame { + + if (self = [super initWithFrame:frame]) { + + [self createUI]; + + } + + return self; +} + +- (void)createUI { + + + UIView * lineV = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(15), 0, self.width - kRealValue(30), 0.1)]; + lineV.backgroundColor = UIColorHex(#E0E0E0); + [self addSubview:lineV]; + + UILabel * leftTimeLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(15),lineV.bottom + kRealValue(20), 100, 14)]; + leftTimeLabel.text = @"预约时间"; + leftTimeLabel.font = MEDIUMFONT(14); + leftTimeLabel.textColor = CFontColor1; + leftTimeLabel.textAlignment = NSTextAlignmentLeft; + [self addSubview:leftTimeLabel]; + + self.timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.width - 300 - 19,lineV.bottom + kRealValue(20), 300, 14)]; + self.timeLabel.text = @""; + self.timeLabel.font = [UIFont systemFontOfSize:13]; + self.timeLabel.textColor = CFontColor1; + self.timeLabel.textAlignment = NSTextAlignmentRight; + [self addSubview:self.timeLabel]; + + + //从这里开始不一样 + + UIView * starTimeView = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(15), self.timeLabel.bottom + kRealValue(20), self.width- kRealValue(30) , 30)]; + self.starTimeView = starTimeView; + starTimeView.hidden = YES; + [self addSubview:starTimeView]; + + UILabel * starLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, kRealValue(14), 100, 14)]; + starLabel.text = @"开始时间"; + starLabel.font = MEDIUMFONT(14); + starLabel.textColor = CFontColor1; + starLabel.textAlignment = NSTextAlignmentLeft; + [starTimeView addSubview:starLabel]; + + self.starTimeLabel = [[UILabel alloc] initWithFrame:CGRectMake(starTimeView.width - 300 , kRealValue(14), 300, 14)]; + self.starTimeLabel.text = @""; + self.starTimeLabel.font = [UIFont systemFontOfSize:13];; + self.starTimeLabel.textColor = CFontColor1; + self.starTimeLabel.textAlignment = NSTextAlignmentRight; + [starTimeView addSubview:self.starTimeLabel]; + starTimeView.height = starLabel.bottom + kRealValue(10); + self.starTimeView.hidden = YES; + // 1 拒绝 + + UIView * jujueView = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(15), self.timeLabel.bottom + kRealValue(20), self.width - kRealValue(30), 30)]; + self.jujueView = jujueView; + jujueView.hidden = true; + [self addSubview:jujueView]; + + UILabel * jujueLabel = [[UILabel alloc] initWithFrame:CGRectMake(0,0, 100, 14)]; + jujueLabel.text = @"拒绝原因"; + jujueLabel.font = MEDIUMFONT(14); + jujueLabel.textColor = CFontColor1; + jujueLabel.textAlignment = NSTextAlignmentLeft; + [jujueView addSubview:jujueLabel]; + + UILabel * jujueyuanyinLab = [[UILabel alloc] initWithFrame:CGRectMake(jujueLabel.right + 10, 0, jujueView.width - 100 -15 , 15)]; + jujueyuanyinLab.text = @""; + jujueyuanyinLab.font = [UIFont systemFontOfSize:13]; + self.jujueyuanyinLab = jujueyuanyinLab; + self.jujueyuanyinLab.numberOfLines = 0; + jujueyuanyinLab.textColor = CFontColor1; + jujueyuanyinLab.textAlignment = NSTextAlignmentRight; + [jujueView addSubview:jujueyuanyinLab]; + + + UILabel * beizhuLabel = [[UILabel alloc] initWithFrame:CGRectMake(0,jujueLabel.bottom + kRealValue(20), 100, 14)]; + beizhuLabel.text = @"拒绝备注"; + beizhuLabel.font = MEDIUMFONT(14); + beizhuLabel.textColor = CFontColor1; + beizhuLabel.textAlignment = NSTextAlignmentLeft; + self.beizhuLabel = beizhuLabel; + [jujueView addSubview:beizhuLabel]; + + self.jujueBeizhuLab = [[UILabel alloc] initWithFrame:CGRectMake(beizhuLabel.right + 10, jujueLabel.bottom + kRealValue(20), jujueView.width - 15 - jujueLabel.width, 22)]; + self.jujueBeizhuLab.text = @""; + self.jujueBeizhuLab.font = [UIFont systemFontOfSize:13]; + self.jujueBeizhuLab.numberOfLines = 0; + self.jujueBeizhuLab.textColor = CFontColor1; + self.jujueBeizhuLab.textAlignment = NSTextAlignmentRight; + [jujueView addSubview:self.jujueBeizhuLab]; +// + + // 取消 + self.cancelQuestionView = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(15), self.timeLabel.bottom + kRealValue(16), self.width - kRealValue(30), 30)]; + [self addSubview:self.cancelQuestionView]; + +// UIView * cancellineType = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(15), 0, self.width - kRealValue(30), 1)]; +// cancellineType.backgroundColor = UIColorHex(#E0E0E0); +// [self.cancelQuestionView addSubview:cancellineType]; + + UILabel * cancelStarLabel = [[UILabel alloc] initWithFrame:CGRectMake(0,kRealValue(14), 100, 14)]; + cancelStarLabel.text = @"预计开始时间"; + cancelStarLabel.font = MEDIUMFONT(14); + cancelStarLabel.textColor = CFontColor1; + cancelStarLabel.textAlignment = NSTextAlignmentLeft; + [self.cancelQuestionView addSubview:cancelStarLabel]; + + UILabel * openLabel = [[UILabel alloc] initWithFrame:CGRectMake(0,cancelStarLabel.bottom + kRealValue(13), 150, 12)]; + openLabel.text = @"请打开APP并保证网络流畅"; + openLabel.font = MEDIUMFONT(11); + openLabel.textColor = UIColorHex(#999999); + openLabel.textAlignment = NSTextAlignmentLeft; + [self.cancelQuestionView addSubview:openLabel]; + + self.cancelTimeLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.width - 300 - 19, kRealValue(14), 300, 22)]; + self.cancelTimeLabel.text = @""; + self.cancelTimeLabel.font = BOLDSYSTEMFONT(13); + self.cancelTimeLabel.textColor = UIColorHex(#999999); + self.cancelTimeLabel.textAlignment = NSTextAlignmentRight; + [self.cancelQuestionView addSubview:self.cancelTimeLabel]; + //中划线 + NSDictionary *attribtDic = @{NSStrikethroughStyleAttributeName: [NSNumber numberWithInteger:NSUnderlineStyleSingle]}; + NSMutableAttributedString *attribtStr = [[NSMutableAttributedString alloc]initWithString: self.cancelTimeLabel.text attributes:attribtDic]; + // 赋值 + self.cancelTimeLabel.attributedText = attribtStr; + + self.cancelQuestionView.height = openLabel.bottom + kRealValue(10); + + //咨询记录 + + self.questionRecordView = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(15), self.starTimeView.bottom + kRealValue(10), self.width - kRealValue(30), 30)]; + self.questionRecordView.backgroundColor = KWhiteColor; + [self addSubview:self.questionRecordView]; + + + UILabel * recordStarLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, kRealValue(14), 100, 14)]; + recordStarLabel.text = @"咨询记录"; + recordStarLabel.font = MEDIUMFONT(14); + recordStarLabel.textColor = CFontColor1; + recordStarLabel.textAlignment = NSTextAlignmentLeft; + self.recordStarLabel = recordStarLabel; + [self.questionRecordView addSubview:recordStarLabel]; + + // 赋值 + self.questionRecordView.height = recordStarLabel.bottom + kRealValue(10); + + + + self.doctorinfoHeight = self.cancelQuestionView.bottom + kRealValue(15); +} + + +- (void)setModel:(XJDRecoredListDetailModel *)model { + _model = model; + + + XJDRecoredDetailConsessionModel * sessionModel = [XJDRecoredDetailConsessionModel modelWithDictionary:_model.conSession]; + + + //状态数据 + NSString * timeString = [XJDCommonUtils getTimeFromTimestamp:[sessionModel.sessionDateLong integerValue] andDateFormat:@"YYYY年MM月dd日"]; + NSString * weekString; + NSArray * weekArray = @[@"周一",@"周二",@"周三",@"周四",@"周五",@"周六",@"周天"]; + NSString * amString = [sessionModel.amPm integerValue] == 1 ? @"下午":@"上午"; + if ( [sessionModel.week integerValue] >= 1) { + weekString = weekArray[[sessionModel.week integerValue] - 1]; + } + self.timeLabel.text = [NSString stringWithFormat:@"%@ %@ %@",timeString,weekString,amString]; + + + + //预约状态 1待确认 2待开始 3已开始 4待评价 5已完成 + // 6 拒绝 7取消 8 超时 + if ( [sessionModel.contentStatus integerValue] == 6) { //拒绝 + + self.jujueView.hidden = false; + self.starTimeView.hidden = true; + self.cancelQuestionView.hidden = true; + self.jujueyuanyinLab.text = sessionModel.reasonType; + self.jujueBeizhuLab.text = sessionModel.rejectReason; + CGFloat labH = [XJDCommonUtils getSpaceLabelHeight: self.jujueyuanyinLab AndLeftisTrue:false withStr:self.jujueyuanyinLab.text withFont:[UIFont systemFontOfSize:14] withWidth: self.jujueyuanyinLab.width withLineSpacing:2]; + + CGFloat beizhulabH = [XJDCommonUtils getSpaceLabelHeight: self.jujueBeizhuLab AndLeftisTrue:false withStr:self.jujueBeizhuLab.text withFont:[UIFont systemFontOfSize:14] withWidth: self.jujueyuanyinLab.width withLineSpacing:2]; + + //布局 + self.questionRecordView.height = 0; + self.jujueView.top = self.timeLabel.bottom + kRealValue(16); + self.jujueyuanyinLab.top = 1; + self.jujueBeizhuLab.height = beizhulabH; + self.jujueBeizhuLab.top = self.jujueyuanyinLab.bottom + kRealValue(16); + self.beizhuLabel.top = self.jujueyuanyinLab.bottom + kRealValue(16); + self.jujueView.height = self.beizhuLabel.bottom+ 15; + self.questionRecordView.top = self.jujueView.bottom; + self.doctorinfoHeight = self.questionRecordView.bottom + kRealValue(12); + self.recordStarLabel.hidden = true; + +// NSDictionary *attribtDic = @{NSStrikethroughStyleAttributeName: [NSNumber numberWithInteger:NSUnderlineStyleSingle]}; +// NSMutableAttributedString *attribtStr = [[NSMutableAttributedString alloc]initWithString: self.timeLabel.text attributes:attribtDic]; +// // 类型 + NSDictionary * typeattribtDic = @{NSStrikethroughStyleAttributeName: [NSNumber numberWithInteger:NSUnderlineStyleSingle]}; + NSMutableAttributedString * typeattribtStr = [[NSMutableAttributedString alloc]initWithString: self.timeLabel.text attributes:typeattribtDic]; + self.timeLabel.attributedText = typeattribtStr; +// self.doctorinfoHeight = self.questionTypeLabel.bottom + kRealValue(15); + } + if ( [sessionModel.contentStatus integerValue] == 1 || [sessionModel.contentStatus integerValue] == 2) { //待确认 + + self.jujueView.hidden = true ; + self.starTimeView.hidden = true; + self.cancelQuestionView.hidden = true; + self.questionRecordView.hidden = YES; + if ( ValidStr(sessionModel.doctorStartTime)) { //如果医生开始时间为空 那么不显示 + + self.starTimeView.hidden = true; + }else + { + self.starTimeView.hidden = false; + self.starTimeLabel.text = [XJDCommonUtils getTimeFromTimestamp:[sessionModel.sessionDateLong integerValue] andDateFormat:@"YYYY年MM月dd日 HH:mm"]; + } + + self.doctorinfoHeight = self.timeLabel.bottom + kRealValue(20); + } + if ( [sessionModel.contentStatus integerValue] == 7) { //取消 + + self.jujueView.hidden = YES; + self.starTimeView.hidden = YES; + self.cancelQuestionView.hidden = false; + self.questionRecordView.hidden = YES; + self.jujueyuanyinLab.text = sessionModel.reasonType; + CGFloat labH = [XJDCommonUtils getSpaceLabelHeight: self.jujueyuanyinLab AndLeftisTrue:true withStr:self.jujueyuanyinLab.text withFont:[UIFont systemFontOfSize:14 weight:UIFontWeightMedium] withWidth: self.jujueyuanyinLab.width withLineSpacing:5]; + self.jujueyuanyinLab.height = labH; + self.jujueView.hidden = YES; + self.doctorinfoHeight = self.timeLabel.bottom + kRealValue(20); + } + if ( [sessionModel.contentStatus integerValue] == 3 || [sessionModel.contentStatus integerValue] == 4 || [sessionModel.contentStatus integerValue] == 5) { //在线咨询 + for (UILabel * currentlab in self.labsArray) { + + [currentlab removeFromSuperview]; + } + [self.labsArray removeAllObjects]; + + self.jujueView.hidden = true ; + self.starTimeView.hidden = false; + self.cancelQuestionView.hidden = true; + self.questionRecordView.hidden = false; + if ( ValidStr(sessionModel.doctorStartTime)) { //如果医生开始时间为空 那么不显示 + + self.starTimeView.hidden = true; + }else + { + self.starTimeView.hidden = false; + NSString * doctorStar = [XJDCommonUtils getTimeFromTimestamp:[sessionModel.doctorStartTimeLong integerValue] andDateFormat:@"YYYY年MM月dd日 HH:mm"]; + NSString * doctorend = [XJDCommonUtils getTimeFromTimestamp:[sessionModel.doctorEndTimeLong integerValue] andDateFormat:@"HH:mm"]; + + self.starTimeLabel.text = [NSString stringWithFormat:@"%@~%@",doctorStar,doctorend]; + } + + NSArray * recordArray = _model.imList; + CGFloat height = 30; + for (int i = 0 ; i < recordArray.count; i ++) { + + XJDRecoredDetailIMListModel * imModel = recordArray[i]; + + + UILabel * recordLabel = [[UILabel alloc] initWithFrame:CGRectMake(14, 45 + 25 * i, self.questionRecordView.width -14, 20)]; + recordLabel.textAlignment = NSTextAlignmentLeft; + recordLabel.font = SYSTEMFONT(15); + NSString * questionType = @""; + NSString * timeString; + if (ValidStr(imModel.startTime) || ValidStr(imModel.endTime)) { + + timeString = @"时长:--"; + }else + { + timeString = [self dateTimeDifferenceWithStartTime:imModel.startTime endTime:imModel.endTime]; + } + if ([imModel.type intValue] == 2) { + questionType = @"视频咨询"; + recordLabel.text = [NSString stringWithFormat:@"%@:%@ %@",questionType,imModel.startTime,timeString]; + }else + { + questionType = @"约定时间"; + NSString * doctorStar = [XJDCommonUtils getTimeFromTimestamp:[imModel.startTimLong integerValue] andDateFormat:@"YYYY-MM-dd HH:mm"]; + NSString * doctorend = [XJDCommonUtils getTimeFromTimestamp:[imModel.endTimeLong integerValue] andDateFormat:@"HH:mm"]; + recordLabel.text = [NSString stringWithFormat:@"%@:%@~%@",questionType,doctorStar,doctorend]; + } + recordLabel.textColor = CFontColor1; + + + + + if (i == recordArray.count - 1) { + + height = recordLabel.bottom; + self.questionRecordView.height = kRealValue(14) + height; + } + [self.questionRecordView addSubview:recordLabel]; + [self.labsArray addObject:recordLabel]; + } + + + self.doctorinfoHeight = self.questionRecordView.bottom + kRealValue(10); + } + + +} + + +-(NSString *)dateTimeDifferenceWithStartTime:(NSString *)startTime endTime:(NSString *)endTime{ + NSDateFormatter *date = [[NSDateFormatter alloc]init]; + [date setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; + NSDate *startD =[date dateFromString:startTime]; + NSDate *endD = [date dateFromString:endTime]; + NSTimeInterval start = [startD timeIntervalSince1970]*1; + NSTimeInterval end = [endD timeIntervalSince1970]*1; + NSTimeInterval value = end - start; + int second = (int)value %60;//秒 + int minute = (int)value /60%60; + int house = (int)value % (24 * 3600)/3600; + int day = (int)value / (24 * 3600); + NSString *str; + if (day != 0) { + str = [NSString stringWithFormat:@"时长:%d天%d小时%d分%d秒",day,house,minute,second]; + }else if (day==0 && house != 0) { + str = [NSString stringWithFormat:@"时长:%d小时%d分%d秒",house,minute,second]; + }else if (day== 0 && house== 0 && minute!=0) { + str = [NSString stringWithFormat:@"时长:%d分%d秒",minute,second]; + }else{ + str = [NSString stringWithFormat:@"时长:%d秒",second]; + } + + return str; +} + + +///将时间戳转为日期时间 + +/// @param timestamp 时间戳 + +/// @param dateFormat 日期样式 YYYY-MM-dd HH:mm:ss + + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDQuestionFileDataView.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDQuestionFileDataView.h new file mode 100644 index 0000000..e640879 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDQuestionFileDataView.h @@ -0,0 +1,25 @@ +// +// XJDQuestionFileDataView.h +// healthQuestion +// +// Created by 仁康信息 on 2023/4/28. +// + +#import +#import "XJDRecoredListDetailModel.h" + +NS_ASSUME_NONNULL_BEGIN + +typedef void(^lookDetailBlock)(); + +@interface XJDQuestionFileDataView : UIView + +@property (nonatomic, assign) CGFloat fileHeight; + +@property (nonatomic, copy) lookDetailBlock fileBlock; + +@property (nonatomic, strong) XJDRecoredconMedicalRecordsListDO * model; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDQuestionFileDataView.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDQuestionFileDataView.m new file mode 100644 index 0000000..da2daec --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDQuestionFileDataView.m @@ -0,0 +1,103 @@ +// +// XJDQuestionFileDataView.m +// healthQuestion +// +// Created by 仁康信息 on 2023/4/28. +// + +#import "XJDQuestionFileDataView.h" + +@interface XJDQuestionFileDataView () + +@property (nonatomic, strong) UILabel * timeLabel; +@property (nonatomic, strong) UILabel * fileLabel; +@end + +@implementation XJDQuestionFileDataView + +/* +// 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 * timelineV = [[UIView alloc] initWithFrame:CGRectMake(0, 1, self.width , 1)]; + timelineV.backgroundColor = UIColorHex(#E0E0E0); + [self addSubview:timelineV]; + + UILabel * titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(18), kRealValue(15), 100, 14)]; + titleLabel.text = @"档案"; + titleLabel.font = BOLDSYSTEMFONT(13); + titleLabel.textAlignment = NSTextAlignmentLeft; + [self addSubview:titleLabel]; + + UILabel * timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(18), kRealValue(15), self.width - kRealValue(33), 14)]; + self.timeLabel = timeLabel; + timeLabel.text = @"生成时间:2020年05月05日 周四 上午"; + timeLabel.font = MEDIUMFONT(11); + timeLabel.textColor = UIColorHex(#999999); + timeLabel.textAlignment = NSTextAlignmentRight; + [self addSubview:timeLabel]; + + UILabel * fileLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(18),titleLabel.bottom+ kRealValue(25), self.width - kRealValue(36), 34)]; + fileLabel.text = @""; + fileLabel.numberOfLines = 2; + fileLabel.font = MEDIUMFONT(13); + fileLabel.textColor = UIColorHex(#333333); + fileLabel.textAlignment = NSTextAlignmentLeft; + self.fileLabel = fileLabel; + [self addSubview:fileLabel]; + +// CGFloat fileHeight = [HQCommonUtils getSpaceLabelHeight:fileLabel withStr:fileLabel.text withFont:[UIFont systemFontOfSize:13 weight:UIFontWeightMedium] withWidth:fileLabel.width withLineSpacing:5]; +// fileLabel.height = fileHeight; + + YYLabel * detailLabel = [[YYLabel alloc] initWithFrame:CGRectMake(self.width - 100 - kRealValue(18), fileLabel.bottom + kRealValue(11), 100, 12)]; + detailLabel.text = @"查看详情 >"; + detailLabel.textColor = UIColorHex(#3390FF); + detailLabel.font = MEDIUMFONT(11); + detailLabel.textAlignment = NSTextAlignmentRight; + [self addSubview:detailLabel]; + + [detailLabel setTextTapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) { + [self lookMDetail]; + }]; + + UIView * lineV = [[UIView alloc] initWithFrame:CGRectMake(0, detailLabel.bottom, kScreenWidth - kRealValue(30), 14)]; + lineV.backgroundColor = KWhiteColor; + [self addSubview:lineV]; + + self.fileHeight = lineV.bottom; +} + +- (void)lookMDetail { + + if (self.fileBlock) { + + self.fileBlock(); + } + +} + +- (void)setModel:(XJDRecoredconMedicalRecordsListDO *)model { + + _model = model; + + self.fileLabel.text = [NSString stringWithFormat:@"问题描述:%@",_model.medicalDescribe] ; + self.timeLabel.text = [NSString stringWithFormat:@"更新时间:%@",_model.createTime]; + +} +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDQuestionHealthInfoView.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDQuestionHealthInfoView.h new file mode 100644 index 0000000..d2124fe --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDQuestionHealthInfoView.h @@ -0,0 +1,19 @@ +// +// XJDQuestionHealthInfoView.h +// healthQuestion +// +// Created by 仁康信息 on 2023/4/28. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDQuestionHealthInfoView : UIView + +@property (nonatomic, strong) NSArray * questionArray; + +@property (nonatomic, assign) CGFloat healthHeight; +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDQuestionHealthInfoView.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDQuestionHealthInfoView.m new file mode 100644 index 0000000..2531c85 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDQuestionHealthInfoView.m @@ -0,0 +1,140 @@ +// +// XJDQuestionHealthInfoView.m +// healthQuestion +// +// Created by 仁康信息 on 2023/4/28. +// + +#import "XJDQuestionHealthInfoView.h" +#import "XJDRecoredListDetailModel.h" +@interface XJDQuestionHealthInfoView () + +@property (nonatomic, strong) NSMutableArray * leftArray; + +@property (nonatomic, strong) NSMutableArray * rightArray; + +@property (nonatomic, strong) UILabel * lastLabel; + +@end + +@implementation XJDQuestionHealthInfoView + +/* +// Only override drawRect: if you perform custom drawing. +// An empty implementation adversely affects performance during animation. +- (void)drawRect:(CGRect)rect { + // Drawing code +} +*/ +- (NSMutableArray *)leftArray { + + if (!_leftArray) { + _leftArray = [[NSMutableArray alloc] init]; + } + return _leftArray; +} + +- (NSMutableArray *)rightArray { + + if (!_rightArray) { + + _rightArray = [[NSMutableArray alloc] init]; + } + return _rightArray; +} + +- (instancetype)initWithFrame:(CGRect)frame { + + if (self = [super initWithFrame:frame]) { + + [self createUI]; + + } + + return self; +} + + +- (void)createUI { + + + UILabel * titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(18), kRealValue(22), 100, 14)]; + titleLabel.text = @"基本健康信息"; + titleLabel.font = BOLDSYSTEMFONT(13); + titleLabel.textAlignment = NSTextAlignmentLeft; + [self addSubview:titleLabel]; + + NSArray * leftArray = @[@"饮食习惯:",@"烟酒习惯:",@"既往史:",@"家族史:",@"过敏史:",@"用药史:"]; + NSArray * rightArray = @[@"",@"",@"",@"",@"",@""]; + + for (int i = 0; i < leftArray.count; i ++) { + + + UILabel * leftLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(18), titleLabel.bottom + kRealValue(20) + 30 * i, 100, 13)]; + leftLabel.text =leftArray[i]; + leftLabel.font = MEDIUMFONT(13); + leftLabel.textAlignment = NSTextAlignmentLeft; + leftLabel.textColor = UIColorHex(#666666); + CGFloat w = [XJDCommonUtils getLengthFromText:titleLabel.text andFontSize:13]; + leftLabel.width = w; + [self addSubview:leftLabel]; + + + UILabel * rightLabel = [[UILabel alloc] initWithFrame:CGRectMake(leftLabel.right, leftLabel.top, self.width - leftLabel.right, 13)]; + rightLabel.text =rightArray[i]; + rightLabel.font = MEDIUMFONT(13); + rightLabel.textAlignment = NSTextAlignmentLeft; + [self addSubview:rightLabel]; + + [self.leftArray addObject:leftLabel]; + [self.rightArray addObject:rightLabel]; + + } + + +} + +- (void)setQuestionArray:(NSArray *)questionArray { + _questionArray = questionArray; + + + for (UILabel * leftLabel in self.leftArray) { + [leftLabel removeFromSuperview]; + } + for (UILabel * rightLabel in self.rightArray) { + [rightLabel removeFromSuperview]; + } + [self.leftArray removeAllObjects]; + [self.rightArray removeAllObjects]; + + for (int i = 0; i < _questionArray.count; i ++) { + +// NSDictionary * dic = _questionArray[i]; + XJDRecoredDetailHealthModel * model = _questionArray[i]; + + UILabel * leftLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(18), kRealValue(42) + 14 + 30 * i, 100, 13)]; + leftLabel.text = [NSString stringWithFormat:@"%@:",model.answerKey] ; + leftLabel.font = MEDIUMFONT(13); + leftLabel.textAlignment = NSTextAlignmentLeft; + leftLabel.textColor = UIColorHex(#666666); + CGFloat w = [XJDCommonUtils getLengthFromText:leftLabel.text andFontSize:13]; + [self addSubview:leftLabel]; + + + UILabel * rightLabel = [[UILabel alloc] initWithFrame:CGRectMake(leftLabel.right + kRealValue(25), leftLabel.top, self.width - leftLabel.right - kRealValue(25), 13)]; + rightLabel.text = model.answerValue; + rightLabel.font = MEDIUMFONT(13); + rightLabel.textAlignment = NSTextAlignmentLeft; + [self addSubview:rightLabel]; + + [self.leftArray addObject:leftLabel]; + [self.rightArray addObject:rightLabel]; + + if (i == _questionArray.count - 1) { + self.lastLabel = rightLabel; + } + } + self.healthHeight = self.lastLabel.bottom + kRealValue(30); + +} +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDQuestionReportView.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDQuestionReportView.h new file mode 100644 index 0000000..806b99e --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDQuestionReportView.h @@ -0,0 +1,22 @@ +// +// XJDQuestionReportView.h +// healthQuestion +// +// Created by 仁康信息 on 2023/4/28. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + + +@interface XJDQuestionReportView : UIView + +@property (nonatomic, strong) NSArray * dataArray; + +@property (nonatomic, assign) CGFloat reportHeight; + + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDQuestionReportView.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDQuestionReportView.m new file mode 100644 index 0000000..1d55acc --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/DetailUserinfoView(咨询人信息)/XJDQuestionReportView.m @@ -0,0 +1,91 @@ +// +// XJDQuestionReportView.m +// healthQuestion +// +// Created by 仁康信息 on 2023/4/28. +// + +#import "XJDQuestionReportView.h" + +@interface XJDQuestionReportView () + +@property (nonatomic, strong) UILabel * timeLabel; + +@property (nonatomic, strong) UILabel * hospatilLabel; + + +@end + +@implementation XJDQuestionReportView + +/* +// 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 { + + UILabel * titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(18), kRealValue(24), 100, 14)]; + titleLabel.text = @"体检报告"; + titleLabel.font = BOLDSYSTEMFONT(13); + titleLabel.textAlignment = NSTextAlignmentLeft; + [self addSubview:titleLabel]; + + UILabel * timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(18), kRealValue(25), self.width - kRealValue(33), 14)]; + self.timeLabel = timeLabel; + timeLabel.text = @"生成时间:--"; + timeLabel.font = MEDIUMFONT(10); + timeLabel.textColor = UIColorHex(#999999); + timeLabel.textAlignment = NSTextAlignmentRight; + [self addSubview:timeLabel]; + + self.hospatilLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(18), titleLabel.bottom + kRealValue(17), self.width - kRealValue(36), 13)]; + self.hospatilLabel.text = @""; + self.hospatilLabel.font = BOLDSYSTEMFONT(13); + self.hospatilLabel.textAlignment = NSTextAlignmentLeft; + [self addSubview:self.hospatilLabel]; +// + YYLabel * detailLabel = [[YYLabel alloc] initWithFrame:CGRectMake(self.width - 100 - kRealValue(18), titleLabel.bottom + kRealValue(17), 100, 12)]; + detailLabel.text = @"查看详情 >"; + detailLabel.textColor = UIColorHex(#3390FF); + detailLabel.font = MEDIUMFONT(11); + detailLabel.textAlignment = NSTextAlignmentRight; + [self addSubview:detailLabel]; + + [detailLabel setTextTapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) { +// [self lookMDetail]; + }]; + +} + +//- (void)lookMDetail{ +// +// if (self.baogaoBlock) { +// self.baogaoBlock(self.bodyModel); +// } +//} +// +// +//- (void)setBodyModel:(YXPhyscialReportListModel *)bodyModel { +// +// _bodyModel = bodyModel; +// +// self.timeLabel.text = [NSString stringWithFormat:@"上传时间:%@年",_bodyModel.medicalYear]; +// self.hospatilLabel.text = [NSString stringWithFormat:@"%@ %@",_bodyModel.medicalYear,_bodyModel.hospitalName]; +// self.reportHeight = self.hospatilLabel.bottom + kRealValue(20); +//} +// + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/FileDataDetailView(档案详情)/XJDFileDataDeatilCenterView.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/FileDataDetailView(档案详情)/XJDFileDataDeatilCenterView.h new file mode 100644 index 0000000..d6b65ab --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/FileDataDetailView(档案详情)/XJDFileDataDeatilCenterView.h @@ -0,0 +1,21 @@ +// +// XJDFileDataDeatilCenterView.h +// healthQuestion +// +// Created by 仁康信息 on 2023/5/4. +// + +#import +#import "XJDRecoredListDetailModel.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDFileDataDeatilCenterView : UIView + +@property (nonatomic, assign) CGFloat questionH; + +@property (nonatomic, strong) XJDRecoredconMedicalRecordsListDO * medicalModel; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/FileDataDetailView(档案详情)/XJDFileDataDeatilCenterView.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/FileDataDetailView(档案详情)/XJDFileDataDeatilCenterView.m new file mode 100644 index 0000000..8e15143 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/FileDataDetailView(档案详情)/XJDFileDataDeatilCenterView.m @@ -0,0 +1,318 @@ +// +// XJDFileDataDeatilCenterView.m +// healthQuestion +// +// Created by 仁康信息 on 2023/5/4. +// + +#import "XJDFileDataDeatilCenterView.h" +#import "XLPhotoBrowser.h" + +@interface XJDFileDataDeatilCenterView () + +@property (nonatomic, strong) UILabel * firstQuestionLabel; + +@property (nonatomic, strong) UILabel * firstAnswerLabel; + +@property (nonatomic, strong) UILabel * secendQuestionLabel; + +@property (nonatomic, strong) UILabel * secendAnswerLabel; + +@property (nonatomic, strong) UILabel * thirdQuestionLabel; + +@property (nonatomic, strong) UILabel * thirdAnswerLabel; + +@property (nonatomic, strong) UILabel * fourthQuestionLabel; + +@property (nonatomic, strong) UILabel * fourthAnswerLabel; + +@property (nonatomic, strong) UILabel * fifthQuestionLabel; + +@property (nonatomic, strong) UILabel * fifthAnswerLabel; + +@property (nonatomic, strong) UILabel * thirdQuestionTitleLabel; + +@property (nonatomic, strong) UIView * hospatilView; + +@property (nonatomic, strong) UILabel * roomLabel; + +@property (nonatomic, strong) UILabel * disNameLabel; + +@property (nonatomic, strong) UIView * pictureView; + +@property (nonatomic, strong) UIView * twoView; + +@property (nonatomic, strong) UIView * thirdView; + +@property (nonatomic, strong) UIView * fourView; + +@property (nonatomic, strong) UILabel * numberLabel; + +@property (nonatomic, strong) UIScrollView * pictScrollView; + +@property (nonatomic, strong) NSMutableArray * pictureArray; + +@end + + +@implementation XJDFileDataDeatilCenterView + +- (NSMutableArray *)pictureArray { + + if (!_pictureArray) { + _pictureArray = [[NSMutableArray alloc] init]; + } + return _pictureArray; +} + +- (instancetype)initWithFrame:(CGRect)frame { + + if (self = [super initWithFrame:frame]) { + + [self createUI]; + + } + + return self; +} + +- (void)createUI { + + self.backgroundColor = KWhiteColor; + //第一个问题 + self.firstQuestionLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(20), kRealValue(24), self.width - kRealValue(30), 14)]; + self.firstQuestionLabel.text = @"1.本次问题持续多久了?"; + self.firstQuestionLabel.font = BOLDSYSTEMFONT(14); + self.firstQuestionLabel.textAlignment = NSTextAlignmentLeft; + self.firstQuestionLabel.textColor = UIColorHex(#333333); + [self addSubview:self.firstQuestionLabel]; + + UIView * firstView = [[UIView alloc] initWithFrame:CGRectMake(0, self.firstQuestionLabel.bottom + kRealValue(15), self.width, 35)]; + firstView.backgroundColor = UIColorHex(#EFEFEF); + [self addSubview:firstView]; + + UIView * lineOne = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 3, 35)]; + lineOne.backgroundColor = UIColorHex(#809999); + [firstView addSubview:lineOne]; + + self.firstAnswerLabel = [[UILabel alloc] initWithFrame:CGRectMake(lineOne.right + kRealValue(18), 0, self.width - kRealValue(48), 35)]; + self.firstAnswerLabel.text = @"--"; + self.firstAnswerLabel.font = MEDIUMFONT(12); + self.firstAnswerLabel.textAlignment = NSTextAlignmentLeft; + self.firstAnswerLabel.textColor = UIColorHex(#333333); + [firstView addSubview:self.firstAnswerLabel]; + + //第二个问题 + self.secendQuestionLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(20), firstView.bottom + kRealValue(15), self.width - kRealValue(30), 14)]; + self.secendQuestionLabel.text = @"2.咨询人的问题"; + self.secendQuestionLabel.font = BOLDSYSTEMFONT(14); + self.secendQuestionLabel.textAlignment = NSTextAlignmentLeft; + self.secendQuestionLabel.textColor = UIColorHex(#333333); + [self addSubview:self.secendQuestionLabel]; + + UIView * twoView = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(10), self.secendQuestionLabel.bottom + kRealValue(15), self.width - kRealValue(20), 70)]; + twoView.backgroundColor = UIColorHex(#EFEFEF); + twoView.layer.cornerRadius = 10; + self.twoView = twoView; + twoView.layer.masksToBounds = true; + [self addSubview:twoView]; + + self.secendAnswerLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(15), 11, twoView.width - kRealValue(50), 35)]; + self.secendAnswerLabel.text = @""; + self.secendAnswerLabel.numberOfLines = 0; + self.secendAnswerLabel.font = MEDIUMFONT(12); + self.secendAnswerLabel.textAlignment = NSTextAlignmentLeft; + self.secendAnswerLabel.textColor = UIColorHex(#333333); + self.secendAnswerLabel.height = [XJDCommonUtils getSpaceLabelHeight:self.secendAnswerLabel AndLeftisTrue:true withStr:self.secendAnswerLabel.text withFont:[UIFont systemFontOfSize:12 weight:UIFontWeightMedium] withWidth:twoView.width - kRealValue(50) withLineSpacing:5]; + [twoView addSubview:self.secendAnswerLabel]; + //图片 + self.pictureView = [[UIView alloc] initWithFrame:CGRectMake(0, twoView.bottom + kRealValue(12), self.width, 110)]; + [self addSubview: self.pictureView]; + + UILabel * pictureLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(10), 0, 140, 35)]; + pictureLabel.text = @"上传报告或者患处照片"; + pictureLabel.font = MEDIUMFONT(12); + pictureLabel.textAlignment = NSTextAlignmentLeft; + pictureLabel.textColor = UIColorHex(#666666); + [self.pictureView addSubview:pictureLabel]; + + UILabel * showLabel = [[UILabel alloc] initWithFrame:CGRectMake(140, 0, 100, 35)]; + showLabel.text = @"(仅自己和医生可见)"; + showLabel.font = MEDIUMFONT(11); + showLabel.textAlignment = NSTextAlignmentLeft; + showLabel.textColor = UIColorHex(#333333); + [self.pictureView addSubview:showLabel]; + + UILabel * numberLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.width - 10 - 50, 0, 50, 35)]; + numberLabel.text = @"-/8"; + numberLabel.font = MEDIUMFONT(11); + numberLabel.textAlignment = NSTextAlignmentRight; + numberLabel.textColor = UIColorHex(#333333); + self.numberLabel = numberLabel; + [self.pictureView addSubview:numberLabel]; + + UIScrollView * pictScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(pictureLabel.left, pictureLabel.bottom, self.width - kRealValue(20), 62)]; + self.pictScrollView = pictScrollView; + [self.pictureView addSubview:pictScrollView]; + + //第三个问题 + self.thirdQuestionTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(20),self.pictureView.bottom + kRealValue(10), self.width - kRealValue(30), 14)]; + self.thirdQuestionTitleLabel.text = @"3.咨询人是否去医院就诊过?"; + self.thirdQuestionTitleLabel.font = BOLDSYSTEMFONT(14); + self.thirdQuestionTitleLabel.textAlignment = NSTextAlignmentLeft; + self.thirdQuestionTitleLabel.textColor = UIColorHex(#333333); + [self addSubview:self.thirdQuestionTitleLabel]; + + UIView * thirdView = [[UIView alloc] initWithFrame:CGRectMake(0, self.thirdQuestionTitleLabel.bottom + kRealValue(15), self.width, 35)]; + thirdView.backgroundColor = UIColorHex(#EFEFEF); + self.thirdView = thirdView; + [self addSubview:thirdView]; + + UIView * linethird = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 3, 35)]; + linethird.backgroundColor = UIColorHex(#809999); + [thirdView addSubview:linethird]; + + self.thirdQuestionLabel = [[UILabel alloc] initWithFrame:CGRectMake(lineOne.right + kRealValue(18), 0, self.width - kRealValue(48), 35)]; + self.thirdQuestionLabel.text = @"A 就诊过"; + self.thirdQuestionLabel.font = MEDIUMFONT(12); + self.thirdQuestionLabel.textAlignment = NSTextAlignmentLeft; + self.thirdQuestionLabel.textColor = UIColorHex(#333333); + [thirdView addSubview:self.thirdQuestionLabel]; + + self.hospatilView = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(8), thirdView.bottom + kRealValue(16), self.width - kRealValue(16), 67)]; + self.hospatilView.backgroundColor = UIColorHex(#EFEFEF); + self.hospatilView.layer.cornerRadius = 10; + self.hospatilView.layer.masksToBounds = true; + [self addSubview:self.hospatilView]; + + self.roomLabel = [[UILabel alloc] initWithFrame:CGRectMake(lineOne.right + kRealValue(16), kRealValue(12), self.hospatilView.width - kRealValue(20), 13)]; + self.roomLabel.text = @"就诊医院及科室:--"; + self.roomLabel.font = MEDIUMFONT(12); + self.roomLabel.textAlignment = NSTextAlignmentLeft; + self.roomLabel.textColor = UIColorHex(#333333); + [self.hospatilView addSubview:self.roomLabel]; + + self.disNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(lineOne.right + kRealValue(16), self.roomLabel.bottom + kRealValue(17) , self.hospatilView.width - kRealValue(20), 13)]; + self.disNameLabel.text = @"诊断结果:--"; + self.disNameLabel.font = MEDIUMFONT(12); + self.disNameLabel.textAlignment = NSTextAlignmentLeft; + self.disNameLabel.textColor = UIColorHex(#333333); + [self.hospatilView addSubview:self.disNameLabel]; + //第4个问题 + self.fourthQuestionLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(20), self.hospatilView.bottom + kRealValue(21), self.width - kRealValue(30), 14)]; + self.fourthQuestionLabel.text = @"4.咨询人期望得到的帮助?"; + self.fourthQuestionLabel.font = BOLDSYSTEMFONT(14); + self.fourthQuestionLabel.textAlignment = NSTextAlignmentLeft; + self.fourthQuestionLabel.textColor = UIColorHex(#333333); + [self addSubview:self.fourthQuestionLabel]; + + UIView *fourView = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(10), self.fourthQuestionLabel.bottom + kRealValue(15), self.width - kRealValue(20), 70)]; + fourView.backgroundColor = UIColorHex(#EFEFEF); + fourView.layer.cornerRadius = 10; + fourView.layer.masksToBounds = true; + self.fourView = fourView; + [self addSubview:fourView]; + + self.fourthAnswerLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(15), 11, fourView.width - kRealValue(50), 35)]; + self.fourthAnswerLabel.text = @""; + self.fourthAnswerLabel.numberOfLines = 0; + self.fourthAnswerLabel.font = MEDIUMFONT(12); + self.fourthAnswerLabel.textAlignment = NSTextAlignmentLeft; + self.fourthAnswerLabel.textColor = UIColorHex(#333333); + self.fourthAnswerLabel.height = [XJDCommonUtils getSpaceLabelHeight:self.fourthAnswerLabel AndLeftisTrue:true withStr:self.fourthAnswerLabel.text withFont:[UIFont systemFontOfSize:12 weight:UIFontWeightMedium] withWidth:twoView.width - kRealValue(50) withLineSpacing:5]; + [fourView addSubview:self.fourthAnswerLabel]; + + self.questionH = fourView.bottom + kRealValue(20); +} + + +- (void)setMedicalModel:(XJDRecoredconMedicalRecordsListDO *)medicalModel { + + _medicalModel = medicalModel; + [self.pictureArray removeAllObjects]; + self.firstAnswerLabel.text = _medicalModel.haveTimeValue; + self.secendAnswerLabel.text = _medicalModel.medicalDescribe; + self.secendAnswerLabel.height = [XJDCommonUtils getSpaceLabelHeight:self.secendAnswerLabel AndLeftisTrue:true withStr:self.secendAnswerLabel.text withFont:[UIFont systemFontOfSize:12 weight:UIFontWeightMedium] withWidth: self.width - kRealValue(20) - kRealValue(50) withLineSpacing:5]; + self.twoView.height = self.secendAnswerLabel.bottom + kRealValue(25); + if (!ValidStr(_medicalModel.image)) { + NSArray * array = [_medicalModel.image componentsSeparatedByString:@","]; + self.numberLabel.text = [NSString stringWithFormat:@"%d/9",array.count]; + for (int i = 0 ; i < array.count; i ++) { + + self.pictureView.top = self.twoView.bottom + kRealValue(15); + + NSString * photo = [NSString stringWithFormat:@"%@%@",ResourceAddress,array[i]]; + + NSString * str1 = @"\\"; + + photo = [photo stringByReplacingOccurrencesOfString:str1 withString:@"/"]; + + NSString *encodedString3 = CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)photo, (CFStringRef)@"!$&'()*+,-./:;=?@_~%#[]", NULL, kCFStringEncodingUTF8)); + + [self.pictureArray addObject:encodedString3]; + + UIImageView * picView = [[UIImageView alloc] initWithFrame:CGRectMake(66 * i, 0 , 60, 60)]; + picView.backgroundColor = [UIColor grayColor]; + picView.layer.cornerRadius = 5.0; + picView.layer.masksToBounds = true; + picView.userInteractionEnabled = true; + [picView sd_setImageWithURL:[NSURL URLWithString:encodedString3] placeholderImage:PLACEHOLD_IMG]; + + UIButton * imgbtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, picView.width, picView.height)]; + [imgbtn addTarget:self action:@selector(lookPicture:) forControlEvents:UIControlEventTouchUpInside]; + imgbtn.tag = 100 + i; + [picView addSubview:imgbtn]; + [self.pictScrollView addSubview:picView]; + + + } + + }else + { + self.pictureView.hidden = YES; + self.thirdQuestionTitleLabel.top = self.twoView.bottom + kRealValue(10); + self.thirdView.top = self.thirdQuestionTitleLabel.bottom + kRealValue(15); + } + + self.thirdQuestionLabel.text = _medicalModel.tfLookValue; + + if ([_medicalModel.tfLook integerValue] == 0) { + self.hospatilView.hidden = YES; + self.fourthQuestionLabel.top = self.thirdView.bottom + kRealValue(16); + self.fourView.top = self.fourthQuestionLabel.bottom + kRealValue(15); + + } + if ([_medicalModel.tfLook integerValue] == 1) { + self.hospatilView.hidden = false; + self.roomLabel.text = [NSString stringWithFormat:@"就诊医院及科室:%@",_medicalModel.lookOffice] ; + self.disNameLabel.text = [NSString stringWithFormat:@"诊断结果:%@",_medicalModel.lookMedicalName]; + self.fourthQuestionLabel.top = self.hospatilView.bottom + kRealValue(16); + self.fourView.top = self.fourthQuestionLabel.bottom + kRealValue(15); + + } + + self.fourthAnswerLabel.text = _medicalModel.desire; + + self.fourthAnswerLabel.height = [XJDCommonUtils getSpaceLabelHeight:self.fourthAnswerLabel AndLeftisTrue:true withStr:self.fourthAnswerLabel.text withFont:[UIFont systemFontOfSize:12 weight:UIFontWeightMedium] withWidth: self.width - kRealValue(20) - kRealValue(50) withLineSpacing:5]; + self.fourView.height = self.fourthAnswerLabel.bottom + kRealValue(25); + self.questionH = self.fourView.bottom + kRealValue(20); + + +} + +- (void)lookPicture:(UIButton *)indexBtn { + + XLPhotoBrowser *browser = [XLPhotoBrowser showPhotoBrowserWithImages:self.pictureArray currentImageIndex:indexBtn.tag - 100]; + + browser.browserStyle = XLPhotoBrowserStyleSimple; // 微博样式 + + // 自定义pageControl的一些属性 + browser.pageDotColor = [UIColor purpleColor]; ///< 此属性针对动画样式的pagecontrol无效 + browser.currentPageDotColor = [UIColor greenColor]; + browser.pageControlStyle = XLPhotoBrowserPageControlStyleClassic;///< 修改底部pagecontrol的样式为系统样式,默认是弹性动画的样式 + + +} + + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/HistoryRecordView(历史记录)/XJDHistoryRecordTable.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/HistoryRecordView(历史记录)/XJDHistoryRecordTable.h new file mode 100644 index 0000000..80ffbad --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/HistoryRecordView(历史记录)/XJDHistoryRecordTable.h @@ -0,0 +1,18 @@ +// +// HistoryRecordTable.h +// healthQuestion +// +// Created by 仁康信息 on 2023/5/4. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDHistoryRecordTable : UITableView + +@property (nonatomic, strong) NSArray * dataArray; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/HistoryRecordView(历史记录)/XJDHistoryRecordTable.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/HistoryRecordView(历史记录)/XJDHistoryRecordTable.m new file mode 100644 index 0000000..4ef92d4 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/HistoryRecordView(历史记录)/XJDHistoryRecordTable.m @@ -0,0 +1,118 @@ +// +// XJDHistoryRecordTable.m +// healthQuestion +// +// Created by 仁康信息 on 2023/5/4. +// + +#import "XJDHistoryRecordTable.h" +#import "XJDHistoryRecordTableViewCell.h" + +@interface XJDHistoryRecordTable () + +@end + +@implementation XJDHistoryRecordTable + + +- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style { + + if (self = [super initWithFrame:frame style:style]) { + + [self createUI]; + } + + return self; +} + +- (void)createUI { + + 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 10; +} +//每组多少行 +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return 1; +} +//注册cell +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + + XJDHistoryRecordTableViewCell * cell = [self dequeueReusableCellWithIdentifier:@"VIDEOCELL"]; + + if (!cell) { + + cell = [[XJDHistoryRecordTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"VIDEOCELL"]; + } + cell.backgroundColor = KWhiteColor; + cell.layer.cornerRadius = 10.0; + + cell.selectionStyle = UITableViewCellSelectionStyleNone; + return cell; + +} + +- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { + + return kRealValue(12); +} + +- (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 * videoView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kRealValue(12))]; + + return videoView; + +} +////cell点击事件 +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + + +} + + +@end + + diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/HistoryRecordView(历史记录)/XJDHistoryRecordTableViewCell.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/HistoryRecordView(历史记录)/XJDHistoryRecordTableViewCell.h new file mode 100644 index 0000000..b035fcb --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/HistoryRecordView(历史记录)/XJDHistoryRecordTableViewCell.h @@ -0,0 +1,16 @@ +// +// XJDHistoryRecordTableViewCell.h +// healthQuestion +// +// Created by 仁康信息 on 2023/5/4. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDHistoryRecordTableViewCell : UITableViewCell + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/HistoryRecordView(历史记录)/XJDHistoryRecordTableViewCell.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/HistoryRecordView(历史记录)/XJDHistoryRecordTableViewCell.m new file mode 100644 index 0000000..8e0badf --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/HistoryRecordView(历史记录)/XJDHistoryRecordTableViewCell.m @@ -0,0 +1,153 @@ +// +// XJDHistoryRecordTableViewCell.m +// healthQuestion +// +// Created by 仁康信息 on 2023/5/4. +// + +#import "XJDHistoryRecordTableViewCell.h" + + +@interface XJDHistoryRecordTableViewCell () + + +@property (nonatomic, strong) UILabel * typeLabel; +@property (nonatomic, strong) UILabel * statusLabel; +@property (nonatomic, strong) UILabel * nameLabel; +@property (nonatomic, strong) UILabel * ageLabel; +@property (nonatomic, strong) UILabel * timeLabel; +@property (nonatomic, strong) UILabel * cardLabel; +@property (nonatomic, strong) UILabel * canisLabel; + +@end + + +@implementation XJDHistoryRecordTableViewCell + +- (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.typeLabel = [[UILabel alloc] init]; + self.typeLabel.text = @" 视频咨询 "; + self.typeLabel.layer.cornerRadius = 5.0; + self.typeLabel.layer.masksToBounds = true; + self.typeLabel.layer.borderColor = UIColorHex(#21BEBD).CGColor; + self.typeLabel.layer.borderWidth = 1.0f; + self.typeLabel.textColor = UIColorHex(#21BEBD); + self.typeLabel.font = SYSTEMFONT(11); + [self.contentView addSubview:self.typeLabel]; + + [self.typeLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_offset(10); + make.top.mas_offset(12); + make.height.mas_offset(21); + }]; + [self.typeLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal]; + + self.nameLabel = [[UILabel alloc] init]; + self.nameLabel.text = @"张三"; + self.nameLabel.textColor = CFontColor1; + self.nameLabel.font = BOLDSYSTEMFONT(14); + [self.contentView addSubview:self.nameLabel]; + + [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.typeLabel.mas_right).offset(5); + make.top.mas_offset(16); + make.height.mas_offset(14); + }]; + [self.nameLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal]; + + self.ageLabel = [[UILabel alloc] init]; + self.ageLabel.text = @"(男/38岁)"; + self.ageLabel.textColor = CFontColor2; + self.ageLabel.font = BOLDSYSTEMFONT(14); + [self.contentView addSubview:self.ageLabel]; + + [self.ageLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.nameLabel.mas_right); + make.top.mas_offset(16); + make.height.mas_offset(14); + }]; + [self.ageLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal]; + + self.timeLabel = [[UILabel alloc] init]; + self.timeLabel.text = @"2023-01-05 14:23:56"; + self.timeLabel.textColor = UIColorHex(#999999); + self.timeLabel.font = BOLDSYSTEMFONT(14); + self.timeLabel.textAlignment = NSTextAlignmentRight; + [self.contentView addSubview:self.timeLabel]; + + [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.mas_equalTo(@-15); + make.top.mas_offset(12); + make.height.mas_offset(11); + }]; + [self.timeLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal]; + + self.cardLabel = [[UILabel alloc] init]; + self.cardLabel.text = @"610456198905167894"; + self.cardLabel.textColor = UIColorHex(#999999); + self.cardLabel.font = MEDIUMFONT(13); + [self.contentView addSubview:self.cardLabel]; + + [self.cardLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(@15); + make.top.mas_equalTo(self.typeLabel.mas_bottom).offset(12); + make.height.mas_offset(11); + }]; + [self.cardLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal]; + + self.statusLabel = [[UILabel alloc] init]; + self.statusLabel.text = @"已完成"; + self.statusLabel.textColor = UIColorHex(#16C716); + self.statusLabel.font = BOLDSYSTEMFONT(14); + self.statusLabel.textAlignment = NSTextAlignmentRight; + [self.contentView addSubview:self.statusLabel]; + + [self.statusLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.mas_equalTo(@-15); + make.top.mas_equalTo(self.timeLabel.mas_bottom).offset(24); + make.height.mas_offset(14); + make.width.mas_offset(90); + }]; + + self.canisLabel = [[UILabel alloc] init]; + self.canisLabel.text = @"症状:高血压、糖尿病 肾结石"; + self.canisLabel.textColor = CFontColor1; + self.canisLabel.font = MEDIUMFONT(14); + self.canisLabel.textAlignment = NSTextAlignmentLeft; + [self.contentView addSubview:self.canisLabel]; + + [self.canisLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(@14); + make.top.mas_equalTo(self.cardLabel.mas_bottom).offset(10); + make.height.mas_offset (18); + make.bottom.mas_offset(-18); + make.right.mas_offset(-15); + + }]; + + +} + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/HistoryRecordView(历史记录)/XJDSearchView.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/HistoryRecordView(历史记录)/XJDSearchView.h new file mode 100644 index 0000000..89f1368 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/HistoryRecordView(历史记录)/XJDSearchView.h @@ -0,0 +1,24 @@ +// +// XJDSearchView.h +// DoctorXinjiang +// +// Created by 仁康信息 on 2023/4/13. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef void(^searchOnclick)(NSString * fieldtext); + +@interface XJDSearchView : UIView + +@property (nonatomic, strong) NSString * searchPlacehold; + +@property (nonatomic, strong) UITextField * searchField; + +@property (nonatomic, copy) searchOnclick searchBlock; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/HistoryRecordView(历史记录)/XJDSearchView.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/HistoryRecordView(历史记录)/XJDSearchView.m new file mode 100644 index 0000000..1de3f11 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/HistoryRecordView(历史记录)/XJDSearchView.m @@ -0,0 +1,97 @@ +// +// XJDSearchView.m +// DoctorXinjiang +// +// Created by 仁康信息 on 2023/4/13. +// + +#import "XJDSearchView.h" + +@interface XJDSearchView () + + +@end + +@implementation XJDSearchView + +- (instancetype)initWithFrame:(CGRect)frame { + + if (self = [super initWithFrame:frame]) { + + [self createUI]; + } + + return self; +} + +- (void)createUI { + + self.searchField = [[UITextField alloc] initWithFrame:CGRectMake(kRealValue(15), 0, kScreenWidth - kRealValue(65), 35)]; + self.searchField.returnKeyType = UIReturnKeySearch; + self.searchField.delegate = self; + self.searchField.layer.cornerRadius = 18.0f; + self.searchField.layer.masksToBounds = true; + self.searchField.backgroundColor = UIColorHex(#F1F1F1); + //搜索图标 + + UIView * leftView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 37, 35)]; + + UIImageView *view = [[UIImageView alloc] init]; + //设置图片控制器的的图片 + view.image = [UIImage imageNamed:@"searchLeftIcon"]; + //设置图片的frame + view.width = 15; + view.height = 15; + view.center= leftView.center; + //左边搜索图标的模式 + view.contentMode = UIViewContentModeCenter; + [leftView addSubview:view]; + self.searchField.leftView = leftView; + //左边搜索图标总是显示 + self.searchField.leftViewMode = UITextFieldViewModeAlways; + //右边删除所有图标 + self.searchField.clearButtonMode = UITextFieldViewModeAlways; + + [self addSubview:self.searchField]; + + UIButton * seachBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.searchField.right, 0, 50, 35)]; + [seachBtn setTitle:@"搜索" forState:UIControlStateNormal]; + seachBtn.titleLabel.font = SYSTEMFONT(13); + [seachBtn setTitleColor:CFontColor2 forState:UIControlStateNormal]; + [seachBtn addTarget:self action:@selector(searchAction) forControlEvents:UIControlEventTouchUpInside]; + [self addSubview:seachBtn]; + +} + +- (void)setSearchPlacehold:(NSString *)searchPlacehold { + + _searchPlacehold = searchPlacehold; + + NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc] initWithString:_searchPlacehold attributes: + @{NSForegroundColorAttributeName:[UIColor grayColor], + NSFontAttributeName:SYSTEMFONT(13)} + ]; + self.searchField.attributedPlaceholder = attrString; + +} + +- (BOOL)textFieldShouldReturn:(UITextField*)theTextField { + + [theTextField resignFirstResponder]; + + if (self.searchBlock) { + + self.searchBlock(theTextField.text); + } + return YES; +} + +- (void)searchAction { + + if (self.searchBlock) { + + self.searchBlock(self.searchField.text); + } +} + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/HospitalSelected/HospitalSelectedTableViewCell.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/HospitalSelected/HospitalSelectedTableViewCell.h deleted file mode 100644 index 00ec822..0000000 --- a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/HospitalSelected/HospitalSelectedTableViewCell.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// HospitalSelectedTableViewCell.h -// healthQuestion -// -// Created by 仁康信息 on 2022/9/19. -// - -#import -#import "YXHospitalModel.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface HospitalSelectedTableViewCell : UITableViewCell - -@property (nonatomic, strong) YXHospitalModel * model; - -@end - -NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/HospitalSelected/XJDHospitalSelectedTableViewCell.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/HospitalSelected/XJDHospitalSelectedTableViewCell.h new file mode 100644 index 0000000..74e5762 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/HospitalSelected/XJDHospitalSelectedTableViewCell.h @@ -0,0 +1,19 @@ +// +// XJDHospitalSelectedTableViewCell.h +// healthQuestion +// +// Created by 仁康信息 on 2022/9/19. +// + +#import +#import "XJDHospitalModel.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDHospitalSelectedTableViewCell : UITableViewCell + +@property (nonatomic, strong) XJDHospitalModel * model; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/HospitalSelected/XJDHospitalSelectedTableViewCell.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/HospitalSelected/XJDHospitalSelectedTableViewCell.m new file mode 100644 index 0000000..6debb07 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/HospitalSelected/XJDHospitalSelectedTableViewCell.m @@ -0,0 +1,97 @@ +// +// XJDHospitalSelectedTableViewCell.m +// healthQuestion +// +// Created by 仁康信息 on 2022/9/19. +// + +#import "XJDHospitalSelectedTableViewCell.h" + +@interface XJDHospitalSelectedTableViewCell ( ) + +@property (nonatomic, strong) UIImageView * hospitalImage; + +@property (nonatomic, strong) UILabel * hospitalName; + +@property (nonatomic, strong) UIButton * sureButton; + +@end + +@implementation XJDHospitalSelectedTableViewCell + +- (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.hospitalImage = [[UIImageView alloc] init]; + self.hospitalImage.backgroundColor = [UIColor orangeColor]; + [self.contentView addSubview:self.hospitalImage]; + + self.hospitalName = [[UILabel alloc] init]; + self.hospitalName.textAlignment = NSTextAlignmentLeft; + self.hospitalName.font = SYSTEMFONT(15); + self.hospitalName.textColor = CFontColor1; + [self.contentView addSubview:self.hospitalName]; + + self.sureButton = [[UIButton alloc] init]; + [self.sureButton setImage:IMAGE_NAMED(@"chooseCircle") forState:UIControlStateNormal]; + [self.sureButton setImage:IMAGE_NAMED(@"closeImage") forState:UIControlStateSelected]; + [self.sureButton addTarget:self action:@selector(hospitalChoose) forControlEvents:UIControlEventTouchUpInside]; + self.sureButton.selected = true; + self.sureButton.userInteractionEnabled = true; + [self.contentView addSubview:self.sureButton]; + + + [self.hospitalImage mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(@20); + make.top.mas_equalTo(@0); + make.width.height.mas_equalTo(44); + }]; + + [self.sureButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.mas_equalTo(@-17); + make.width.height.mas_equalTo(@25); + make.centerY.mas_equalTo(self.hospitalImage); + }]; + + [self.hospitalName mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.hospitalImage.mas_right).offset(12); + make.right.mas_equalTo(self.sureButton.mas_left).offset(-10); + make.top.mas_equalTo(@15); + make.height.mas_equalTo(@16); + }]; + + +} + + +- (void)hospitalChoose { + + + +} + +- (void)setModel:(XJDHospitalModel *)model { + _model = model; + self.hospitalName.text = [NSString stringWithFormat:@"%@",_model.hospitalName]; + self.sureButton.selected = model.isChoose; +} +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/HospitalSelected/XJDHospitalSelectedView.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/HospitalSelected/XJDHospitalSelectedView.h new file mode 100644 index 0000000..eb2a9c5 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/HospitalSelected/XJDHospitalSelectedView.h @@ -0,0 +1,23 @@ +// +// XJDHospitalSelectedView.h +// healthQuestion +// +// Created by 仁康信息 on 2022/9/19. +// + +#import +#import "XJDHospitalSelectedTableViewCell.h" + +NS_ASSUME_NONNULL_BEGIN + +typedef void(^hospotalSelectBlock)(NSString * hospalalName); + +@interface XJDHospitalSelectedView : UIView + +@property (nonatomic, strong) NSArray * dataArray; + +@property (nonatomic, copy) hospotalSelectBlock hospatlBlcok; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/HospitalSelected/XJDHospitalSelectedView.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/HospitalSelected/XJDHospitalSelectedView.m new file mode 100644 index 0000000..9705df9 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/HospitalSelected/XJDHospitalSelectedView.m @@ -0,0 +1,206 @@ +// +// XJDHospitalSelectedView.m +// healthQuestion +// +// Created by 仁康信息 on 2022/9/19. +// + +#import "XJDHospitalSelectedView.h" + +@interface XJDHospitalSelectedView () + +@property (nonatomic,strong)UITableView * tableView; + +@end + +@implementation XJDHospitalSelectedView + + +- (instancetype)initWithFrame:(CGRect)frame { + + if (self = [super initWithFrame:frame]) { + + self.backgroundColor = RGBA(51, 59, 66,0.7); + [self createUI]; + } + + return self; +} + +- (void)createUI { + + UIView * centerView = [[UIView alloc] init]; + centerView.layer.masksToBounds = true; + centerView.layer.cornerRadius = 4; + centerView.backgroundColor = [UIColor whiteColor]; + [self addSubview:centerView]; + + UIView * headView = [[UIView alloc] init]; + headView.backgroundColor = KWhiteColor; + [centerView addSubview:headView]; + + UILabel * headLabel = [[UILabel alloc] init]; + headLabel.text = @"选择医院"; + headLabel.textColor = CFontColor1; + headLabel.font = BOLDSYSTEMFONT(16); + headLabel.textAlignment = NSTextAlignmentCenter; + [headView addSubview:headLabel]; + + + self.tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped]; + self.tableView.delegate = self; + self.tableView.dataSource = self; + self.tableView.backgroundColor = KWhiteColor; + self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; + [centerView addSubview:self.tableView]; + + UIButton * bottomBtn = [[UIButton alloc] init]; + [bottomBtn setBackgroundColor:UIColorHex(#BD130B)]; + [bottomBtn setTitle:@"确定" forState:UIControlStateNormal]; + [bottomBtn setTitleColor:KWhiteColor forState:UIControlStateNormal]; + [centerView addSubview:bottomBtn]; + + UIButton * closeBtn = [[UIButton alloc] init]; + [closeBtn setImage:IMAGE_NAMED(@"closeImage") forState:UIControlStateNormal]; + [closeBtn addTarget:self action:@selector(closePopView) forControlEvents:UIControlEventTouchUpInside]; + [self addSubview:closeBtn]; + + [centerView mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(kScreenWidth -30); + make.centerX.mas_equalTo(self); + make.height.mas_equalTo(@376); + make.top.mas_equalTo(@172); + }]; + + [headView mas_makeConstraints:^(MASConstraintMaker *make) { + make.height.mas_equalTo(@50); + make.width.top.mas_equalTo(centerView); + }]; + + [headLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.mas_equalTo(0); + make.top.mas_equalTo(@17); + make.height.mas_equalTo(@16); + }]; + + [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.mas_equalTo(0); + make.top.mas_equalTo(headView.mas_bottom).offset(18); + make.bottom.mas_equalTo(bottomBtn.mas_top).offset(-20); + }]; + + [bottomBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(@290); + make.centerX.mas_equalTo(centerView); + make.bottom.mas_equalTo(@-20); + }]; + + [closeBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.mas_equalTo(self); + make.top.mas_equalTo(centerView.mas_bottom).offset(26); + make.height.width.mas_equalTo(@32); + }]; + + + +} + +- (void)setDataArray:(NSArray *)dataArray { + _dataArray = dataArray; + [self.tableView reloadData]; +} + + +#pragma mark - tableview的代理方法 +//组数 +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return 1; +} +//每组多少行 +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return self.dataArray.count; +} +//注册cell +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + + XJDHospitalSelectedTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"HospitalCELL"]; + if (!cell) { + + cell = [[XJDHospitalSelectedTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"HospitalCELL"]; + } + cell.backgroundColor = KWhiteColor; + cell.model = self.dataArray[indexPath.row]; + cell.selectionStyle = UITableViewCellSelectionStyleNone; + return cell; + +} +//每行高度 +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath +{ + + + return kRealValue(55); +} + +- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { + + return CGFLOAT_MIN; +} + +- (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 { + + + return [UIView new]; + +} +////cell点击事件 +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + + XJDHospitalModel * model = self.dataArray[indexPath.row]; + + for (XJDHospitalModel * subModel in self.dataArray) { + + if (subModel == model) { + subModel.isChoose = true; + }else + { + subModel.isChoose = false; + } + } + [self.tableView reloadData]; + if (self.hospatlBlcok) { + + self.hospatlBlcok(@"西安市中医院"); + } + +} + +- (void)closePopView { + + [self removeFromSuperview]; +} + +@end + + + + diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/MoveAddDelete/XJDLIfeManagerFooterView.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/MoveAddDelete/XJDLIfeManagerFooterView.h new file mode 100644 index 0000000..d57bef2 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/MoveAddDelete/XJDLIfeManagerFooterView.h @@ -0,0 +1,13 @@ +// +// XJDLIfeManagerFooterView.h +// shan +// +// Created by aDu on 2016/12/7. +// Copyright © 2016年 DuKaiShun. All rights reserved. +// + +#import + +@interface XJDLIfeManagerFooterView : UICollectionReusableView + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/MoveAddDelete/XJDLIfeManagerFooterView.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/MoveAddDelete/XJDLIfeManagerFooterView.m new file mode 100644 index 0000000..f7848f7 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/MoveAddDelete/XJDLIfeManagerFooterView.m @@ -0,0 +1,22 @@ +// +// XJDLIfeManagerFooterView.m +// shan +// +// Created by aDu on 2016/12/7. +// Copyright © 2016年 DuKaiShun. All rights reserved. +// + +#import "XJDLIfeManagerFooterView.h" + +@implementation XJDLIfeManagerFooterView + +- (id)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + self.backgroundColor = [UIColor grayColor]; + } + return self; +} + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/MoveAddDelete/XJDLifeManagerCell.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/MoveAddDelete/XJDLifeManagerCell.h new file mode 100644 index 0000000..7cae448 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/MoveAddDelete/XJDLifeManagerCell.h @@ -0,0 +1,28 @@ +// +// XJDLifeManagerCell.h +// shan +// +// Created by aDu on 2016/12/5. +// Copyright © 2016年 DuKaiShun. All rights reserved. +// + +#import +#import "XJDToolsModel.h" + +@interface XJDLifeManagerCell : UICollectionViewCell + +@property (nonatomic, strong) UILabel *titleLabel; +@property (nonatomic, strong) UIButton *button; +@property (nonatomic, strong) XJDToolsModel *model; + +@property (nonatomic, assign) BOOL inEditState; //是否处于编辑状态 + +- (void)setModel:(XJDToolsModel *)model indexPaht:(NSIndexPath *)indexPath exist:(BOOL)exist; + +- (void)setDataAry:(NSMutableArray *)dataAry groupAry:(NSMutableArray *)groupAry indexPath:(NSIndexPath *)indexPath; + +@property (nonatomic, strong) UILabel *messageLabel; + +- (void)addMeaageLabel; + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/MoveAddDelete/XJDLifeManagerCell.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/MoveAddDelete/XJDLifeManagerCell.m new file mode 100644 index 0000000..92166b0 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/MoveAddDelete/XJDLifeManagerCell.m @@ -0,0 +1,157 @@ +// +// XJDLifeManagerCell.m +// shan +// +// Created by aDu on 2016/12/5. +// Copyright © 2016年 DuKaiShun. All rights reserved. +// + +#import "XJDLifeManagerCell.h" +#import "Masonry.h" + +@interface XJDLifeManagerCell () + +@property (nonatomic, strong) UIImageView *imageView; + +@end + +@implementation XJDLifeManagerCell + +- (id)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + self.backgroundColor = [UIColor whiteColor]; + + [self.imageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(self).with.insets(UIEdgeInsetsMake(10, 15, 15, 15)); + }]; + + [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.equalTo(self.imageView.mas_bottom); + make.bottom.equalTo(self.mas_bottom); + make.left.and.right.equalTo(self); + }]; + + [self.button mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.equalTo(self.mas_top); + make.right.equalTo(self.mas_right); + make.height.equalTo(@15); + make.width.equalTo(@15); + }]; + self.button.hidden = YES; + } + return self; +} + +- (void)addMeaageLabel +{ + [self.messageLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(self).insets(UIEdgeInsetsMake(0, 0, 0, 0)); + }]; +} + +- (void)setModel:(XJDToolsModel *)model indexPaht:(NSIndexPath *)indexPath exist:(BOOL)exist +{ + if (_model != model) { + self.titleLabel.text = model.title; + if (indexPath.section == 0) { + [self.button setBackgroundImage:[UIImage imageNamed:@"life_reduce"] forState:UIControlStateNormal]; + self.button.userInteractionEnabled = YES; + } else { + if (exist) { + [self.button setBackgroundImage:[UIImage imageNamed:@"life_exist"] forState:UIControlStateNormal]; + self.button.userInteractionEnabled = NO; + } else { + [self.button setBackgroundImage:[UIImage imageNamed:@"life_add"] forState:UIControlStateNormal]; + self.button.userInteractionEnabled = YES; + } + } + } + _model = model; +} + +- (void)setDataAry:(NSMutableArray *)dataAry groupAry:(NSMutableArray *)groupAry indexPath:(NSIndexPath *)indexPath +{ + XJDToolsModel *model; + if (indexPath.section == 0) { + model = dataAry[indexPath.row]; + } else { + model = groupAry[indexPath.row]; + } + self.titleLabel.text = model.title; + if (indexPath.section == 0) { + self.button.userInteractionEnabled = YES; + [self.button setBackgroundImage:[UIImage imageNamed:@"life_reduce"] forState:UIControlStateNormal]; + } else { + if ([dataAry containsObject:model]) { + self.button.userInteractionEnabled = NO; + [self.button setBackgroundImage:[UIImage imageNamed:@"life_exist"] forState:UIControlStateNormal]; + } else { + self.button.userInteractionEnabled = YES; + [self.button setBackgroundImage:[UIImage imageNamed:@"life_add"] forState:UIControlStateNormal]; + } + } +} + +#pragma mark - 是否处于编辑状态 + +- (void)setInEditState:(BOOL)inEditState +{ + if (inEditState && _inEditState != inEditState) { + self.layer.borderWidth = 0.5; + self.layer.borderColor = [UIColor grayColor].CGColor; + self.button.hidden = NO; + } else { + self.layer.borderColor = [UIColor clearColor].CGColor; + self.button.hidden = YES; + } +} + +#pragma mark - init + +- (UIImageView *)imageView +{ + if (!_imageView) { + _imageView = [[UIImageView alloc] init]; + _imageView.image = [UIImage imageNamed:@"wallet_payChange"]; + [self addSubview:_imageView]; + } + return _imageView; +} + +- (UILabel *)titleLabel +{ + if (!_titleLabel) { + _titleLabel = [[UILabel alloc] init]; + _titleLabel.font = [UIFont systemFontOfSize:14]; + _titleLabel.textAlignment = NSTextAlignmentCenter; + [self addSubview:_titleLabel]; + } + return _titleLabel; +} + +- (UILabel *)messageLabel +{ + if (!_messageLabel) { + _messageLabel = [[UILabel alloc] init]; + _messageLabel.font = [UIFont systemFontOfSize:12]; + _messageLabel.textColor = [UIColor grayColor]; + _messageLabel.textAlignment = NSTextAlignmentCenter; + _messageLabel.text = @"您还未添加任何应用\n长按下面的应用可以添加"; + [self addSubview:_messageLabel]; + } + return _messageLabel; +} + +- (UIButton *)button +{ + if (!_button) { + _button = [UIButton buttonWithType:UIButtonTypeCustom]; + _button.layer.cornerRadius = 7.5; + [self addSubview:_button]; + } + return _button; +} + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/MoveAddDelete/XJDLifeManagerHeaderView.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/MoveAddDelete/XJDLifeManagerHeaderView.h new file mode 100644 index 0000000..90926c5 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/MoveAddDelete/XJDLifeManagerHeaderView.h @@ -0,0 +1,15 @@ +// +// XJDLifeManagerHeaderView.h +// shan +// +// Created by aDu on 2016/12/7. +// Copyright © 2016年 DuKaiShun. All rights reserved. +// + +#import + +@interface XJDLifeManagerHeaderView : UICollectionReusableView + +@property (nonatomic, strong) UILabel *headLabel; + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/MoveAddDelete/XJDLifeManagerHeaderView.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/MoveAddDelete/XJDLifeManagerHeaderView.m new file mode 100644 index 0000000..c0e73c7 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/MoveAddDelete/XJDLifeManagerHeaderView.m @@ -0,0 +1,32 @@ +// +// XJDLifeManagerHeaderView.m +// shan +// +// Created by aDu on 2016/12/7. +// Copyright © 2016年 DuKaiShun. All rights reserved. +// + +#import "XJDLifeManagerHeaderView.h" + +@implementation XJDLifeManagerHeaderView + +- (id)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + [self addSubview:self.headLabel]; + } + return self; +} + +- (UILabel *)headLabel +{ + if (!_headLabel) { + _headLabel = [UILabel new]; + _headLabel.font = [UIFont systemFontOfSize:16]; + _headLabel.frame = CGRectMake(16, 0, 150, 20); + } + return _headLabel; +} + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/MoveAddDelete/XJDLifeManagerLayout.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/MoveAddDelete/XJDLifeManagerLayout.h new file mode 100644 index 0000000..cd9a8e6 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/MoveAddDelete/XJDLifeManagerLayout.h @@ -0,0 +1,30 @@ +// +// XJDLifeManagerLayout.h +// shan +// +// Created by aDu on 2016/12/6. +// Copyright © 2016年 DuKaiShun. All rights reserved. +// + +#import + +@protocol XJDLifeManagerDelegate + +/** + * 更新数据源 + */ +- (void)moveItemAtIndexPath:(NSIndexPath *)formPath toIndexPath:(NSIndexPath *)toPath; + +/** + * 改变编辑状态 + */ +- (void)didChangeEditState:(BOOL)inEditState; + +@end + +@interface XJDLifeManagerLayout : UICollectionViewFlowLayout + +@property (nonatomic, assign) BOOL inEditState; //检测是否处于编辑状态 +@property (nonatomic, weak) id delegate; + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/MoveAddDelete/XJDLifeManagerLayout.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/MoveAddDelete/XJDLifeManagerLayout.m new file mode 100644 index 0000000..44425ff --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/MoveAddDelete/XJDLifeManagerLayout.m @@ -0,0 +1,156 @@ +// +// XJDLifeManagerLayout.m +// shan +// +// Created by aDu on 2016/12/6. +// Copyright © 2016年 DuKaiShun. All rights reserved. +// + +#import "XJDLifeManagerLayout.h" +#import "XJDLifeManagerCell.h" +#import "XJDToolsModel.h" + +@interface XJDLifeManagerLayout () + +@property (nonatomic, strong) UILongPressGestureRecognizer *longGesture; +@property (nonatomic, strong) NSIndexPath *currentIndexPath; //当前indexPath +@property (nonatomic, assign) CGPoint movePoint; //移动的中心点 +@property (nonatomic, strong) UIView *moveView; //移动的视图 + +@end + +@implementation XJDLifeManagerLayout + +- (id)initWithCoder:(NSCoder *)aDecoder +{ + self = [super initWithCoder:aDecoder]; + if (self) { + [self configureObserver]; + } + return self; +} + +- (instancetype)init +{ + self = [super init]; + if (self) { + [self configureObserver]; + } + return self; +} + +#pragma mark - 添加观察者 + +- (void)configureObserver +{ + [self addObserver:self forKeyPath:@"collectionView" options:NSKeyValueObservingOptionNew context:nil]; +} + +- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context +{ + if ([keyPath isEqualToString:@"collectionView"]) { + [self setUpGestureRecognizers]; + } else { + [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; + } +} + +#pragma mark - 长按手势 + +- (void)setUpGestureRecognizers +{ + if (self.collectionView == nil) { + return; + } + _longGesture = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longGesture:)]; + _longGesture.minimumPressDuration = 0.3f; //时间长短 + _longGesture.delegate = self; + [self.collectionView addGestureRecognizer:_longGesture]; +} + +#pragma mark - 手势动画 + +- (void)longGesture:(UILongPressGestureRecognizer *)gesture +{ + if (!self.inEditState) { + [self setInEditState:YES]; + } + switch (gesture.state) { + case UIGestureRecognizerStateBegan: { //手势开始 + CGPoint location = [gesture locationInView:self.collectionView]; + //找到当前点击的cell的位置 + NSIndexPath *indexPath = [self.collectionView indexPathForItemAtPoint:location]; + //判断哪个分区可以被点击并且移动 + if (indexPath == nil || indexPath.section != 0) return; + self.currentIndexPath = indexPath; + UICollectionViewCell *targetCell = [self.collectionView cellForItemAtIndexPath:self.currentIndexPath]; + //得到当前cell的映射(截图) + self.moveView = [targetCell snapshotViewAfterScreenUpdates:YES]; + //隐藏被点击的cell + targetCell.hidden = YES; + //给截图添加上边框,如果不添加的话,截图有一部分是没有边框的,具体原因也没有找到 + self.moveView.layer.borderWidth = 0.5; + self.moveView.layer.borderColor = [UIColor grayColor].CGColor; + [self.collectionView addSubview:self.moveView]; + //放大截图 + self.moveView.transform = CGAffineTransformMakeScale(1.1, 1.1); + self.moveView.center = targetCell.center; + } + break; + case UIGestureRecognizerStateChanged: { //手势在变化 + CGPoint point = [gesture locationInView:self.collectionView]; + //更新cell的位置 + self.moveView.center = point; + NSIndexPath *indexPath = [self.collectionView indexPathForItemAtPoint:point]; + if (indexPath == nil) return; + if (indexPath.section == self.currentIndexPath.section && indexPath.section == 0) { + //通过代理去改变数据源 + if ([self.delegate respondsToSelector:@selector(moveItemAtIndexPath:toIndexPath:)]) { + [self.delegate moveItemAtIndexPath:self.currentIndexPath toIndexPath:indexPath]; + } + //移动的方法 + [self.collectionView moveItemAtIndexPath:self.currentIndexPath toIndexPath:indexPath]; + self.currentIndexPath = indexPath; + } + } + break; + case UIGestureRecognizerStateEnded: { //手势结束 + UICollectionViewCell *cell = [self.collectionView cellForItemAtIndexPath:self.currentIndexPath]; + //手势结束后,把截图隐藏,显示出原先的cell + [UIView animateWithDuration:0.25 animations:^{ + self.moveView.center = cell.center; + } completion:^(BOOL finished) { + [self.moveView removeFromSuperview]; + cell.hidden = NO; + self.moveView = nil; + self.currentIndexPath = nil; + [self.collectionView reloadData]; + }]; + } + break; + default: + break; + } +} + +#pragma mark - 处于编辑状态 + +- (void)setInEditState:(BOOL)inEditState +{ + if (_inEditState != inEditState) { + //通过代理方法改变处于编辑状态的cell + if (_delegate && [_delegate respondsToSelector:@selector(didChangeEditState:)]) { + [_delegate didChangeEditState:inEditState]; + } + } + _inEditState = inEditState; +} + +#pragma mark - 移除观察者 + +- (void)dealloc +{ + [self removeObserver:self forKeyPath:@"collectionView"]; +} + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/QuestionRecordView/QuestionRecordTableViewCell.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/QuestionRecordView/QuestionRecordTableViewCell.h deleted file mode 100644 index 7e44b2f..0000000 --- a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/QuestionRecordView/QuestionRecordTableViewCell.h +++ /dev/null @@ -1,20 +0,0 @@ -// -// QuestionRecordTableViewCell.h -// healthQuestion -// -// Created by 仁康信息 on 2023/4/28. -// - -#import -#import "YXQuestionRecordModel.h" -#import "YXRecordIMListDateModel.h" -NS_ASSUME_NONNULL_BEGIN - -@interface QuestionRecordTableViewCell : UITableViewCell - -@property (nonatomic, strong) YXRecordIMListDateModel * IMModel; -//@property (nonatomic, strong) YXQuestionRecordModel * model; - -@end - -NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/QuestionRecordView/XJDQuestionRecordTableViewCell.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/QuestionRecordView/XJDQuestionRecordTableViewCell.h new file mode 100644 index 0000000..1ee5ce5 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/QuestionRecordView/XJDQuestionRecordTableViewCell.h @@ -0,0 +1,20 @@ +// +// XJDQuestionRecordTableViewCell.h +// healthQuestion +// +// Created by 仁康信息 on 2023/4/28. +// + +#import +#import "XJDQuestionRecordModel.h" +#import "XJDRecordIMListDateModel.h" +NS_ASSUME_NONNULL_BEGIN + +@interface XJDQuestionRecordTableViewCell : UITableViewCell + +@property (nonatomic, strong) XJDRecordIMListDateModel * IMModel; +//@property (nonatomic, strong) YXQuestionRecordModel * model; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/QuestionRecordView/XJDQuestionRecordTableViewCell.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/QuestionRecordView/XJDQuestionRecordTableViewCell.m new file mode 100644 index 0000000..97a72f9 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/QuestionRecordView/XJDQuestionRecordTableViewCell.m @@ -0,0 +1,171 @@ +// +// XJDQuestionRecordTableViewCell.m +// healthQuestion +// +// Created by 仁康信息 on 2023/4/28. +// + +#import "XJDQuestionRecordTableViewCell.h" + +@interface XJDQuestionRecordTableViewCell () + +@property (nonatomic, strong) UILabel * nameLabel; + +@property (nonatomic, strong) UILabel * ageLabel; + +@property (nonatomic, strong) UILabel * timeLabel; + +@property (nonatomic, strong) UILabel * diseaseLabel; + +@property (nonatomic, strong) UILabel * numberLabel; + + +@end + +@implementation XJDQuestionRecordTableViewCell + +- (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 { + + UIView * backView = [[UIView alloc] init]; + backView.backgroundColor = KWhiteColor; + backView.layer.cornerRadius = 10.0; + backView.layer.masksToBounds = true; + [self.contentView addSubview:backView]; + [backView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_offset(15); + make.top.mas_offset(0); + make.right.mas_offset(-15); + make.bottom.mas_offset(-5); + }]; + + self.nameLabel = [[UILabel alloc] init]; + self.nameLabel.text = @"--"; + self.nameLabel.font = SYSTEMFONT(14); + self.nameLabel.textAlignment = NSTextAlignmentLeft; + self.nameLabel.textColor = CFontColor1; + [backView addSubview:self.nameLabel]; + + [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.top.mas_offset(15); + make.height.mas_offset(13); + }]; + [self.nameLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal]; + + self.ageLabel = [[UILabel alloc] init]; + self.ageLabel.text = @"(--)"; + self.ageLabel.font = SYSTEMFONT(13); + self.ageLabel.textColor = UIColorHex(#999999); + self.ageLabel.textAlignment = NSTextAlignmentLeft; + [backView addSubview:self.ageLabel]; + + [self.ageLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_offset(15); + make.left.mas_equalTo(self.nameLabel.mas_right).offset(2); + make.height.mas_offset(13); + }]; + [self.ageLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal]; + + self.timeLabel = [[UILabel alloc] init]; + + self.timeLabel.font = SYSTEMFONT(13); + self.timeLabel.textColor = UIColorHex(#999999); + self.timeLabel.textAlignment = NSTextAlignmentLeft; + [backView addSubview:self.timeLabel]; + + [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.nameLabel.mas_bottom).offset(15); + make.left.mas_equalTo(self.nameLabel); + make.right.mas_offset(-15); + make.height.mas_offset(13); + make.bottom.mas_offset(-10); + }]; + + self.numberLabel = [[UILabel alloc] init]; + self.numberLabel.text = @"5"; + self.numberLabel.font = MEDIUMFONT(13); + self.numberLabel.textColor =KWhiteColor; + self.numberLabel.textAlignment = NSTextAlignmentCenter; + self.numberLabel.backgroundColor = UIColorHex(#21BEBD); + self.numberLabel.layer.cornerRadius = 8; + self.numberLabel.layer.masksToBounds = true; + [backView addSubview:self.numberLabel]; + + [self.numberLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.nameLabel.mas_bottom).offset(5); + make.right.mas_equalTo(@-15); + make.height.width.mas_offset(15); + }]; + +// self.diseaseLabel = [[UILabel alloc] init]; +// self.diseaseLabel.text = @"症状:高血压、糖尿病症状:高血压、糖尿病症状:高血压、糖尿病症状:高血压、糖尿病症状:高血压、糖尿病症状:高血压、糖尿病"; +// self.diseaseLabel.font = MEDIUMFONT(13); +// self.diseaseLabel.numberOfLines = 0; +// self.diseaseLabel.textColor = UIColorHex(#333333); +// self.diseaseLabel.textAlignment = NSTextAlignmentLeft; +// [backView addSubview:self.diseaseLabel]; +// +// [self.diseaseLabel mas_makeConstraints:^(MASConstraintMaker *make) { +// make.top.mas_equalTo(self.nameLabel.mas_bottom).offset(16); +// make.left.mas_equalTo(@15); +// make.right.mas_equalTo(self.numberLabel.mas_left).offset(-8); +// make.bottom.mas_offset(-20); +// }]; +// +// [self.diseaseLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal]; + +} + +//- (void)setModel:(YXQuestionRecordModel *)model { +// +// _model = model; +// +// self.nameLabel.text = model.memberName; +// NSString * sexString = [_model.memberSex intValue] == 1 ? @"女":@"男"; +// self.ageLabel.text = [NSString stringWithFormat:@"(%@%@)",_model.memberAge,sexString]; +// self.timeLabel.text = _model.createTime; +//// self.numberLabel.text = [NSString stringWithFormat:@"%@",_model.] +//} + +- (void)setIMModel:(XJDRecordIMListDateModel *)IMModel { + + _IMModel = IMModel; + + self.nameLabel.text = _IMModel.memberName; + NSString * sexString = [_IMModel.memberSex intValue] == 1 ? @"女":@"男"; + self.ageLabel.text = [NSString stringWithFormat:@"(%@/%@岁)",sexString,_IMModel.memberAge]; + self.timeLabel.text = _IMModel.createTime; + if ([_IMModel.unRedMessage integerValue] != 0) { + self.numberLabel.hidden = NO; + self.numberLabel.text = [NSString stringWithFormat:@"%@",_IMModel.unRedMessage]; + }else + { + self.numberLabel.hidden = YES; + } + +} + + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/QuestionRecordView/XJDQuestionRecoredTable.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/QuestionRecordView/XJDQuestionRecoredTable.h new file mode 100644 index 0000000..84e389c --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/QuestionRecordView/XJDQuestionRecoredTable.h @@ -0,0 +1,25 @@ +// +// XJDQuestionRecoredTable.h +// healthQuestion +// +// Created by 仁康信息 on 2023/4/28. +// + +#import +#import "XJDRecordIMListDateModel.h" + +NS_ASSUME_NONNULL_BEGIN + +typedef void(^RecoredQuestionListClick)(XJDRecordIMListDateModel * _Nonnull model ); +typedef void(^VideoRecoredQuestionListClick)(XJDRecordIMListDateModel * _Nonnull model ); + +@interface XJDQuestionRecoredTable : UITableView + +@property (nonatomic, strong) NSArray * dataArray; + +@property (nonatomic, copy) RecoredQuestionListClick recordBlock; +@property (nonatomic, copy) VideoRecoredQuestionListClick videoBlock; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/QuestionRecordView/XJDQuestionRecoredTable.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/QuestionRecordView/XJDQuestionRecoredTable.m new file mode 100644 index 0000000..1b6dd48 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/QuestionRecordView/XJDQuestionRecoredTable.m @@ -0,0 +1,141 @@ +// +// XJDQuestionRecoredTable.m +// healthQuestion +// +// Created by 仁康信息 on 2023/4/28. +// + +#import "XJDQuestionRecoredTable.h" +#import "XJDQuestionRecordTableViewCell.h" + + +@interface XJDQuestionRecoredTable () + + +@end + + +@implementation XJDQuestionRecoredTable + + +- (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 +{ + + XJDQuestionRecordTableViewCell * cell = [self dequeueReusableCellWithIdentifier:@"STATUSCELL"]; + if (!cell) { + + cell = [[XJDQuestionRecordTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"STATUSCELL"]; + } + cell.backgroundColor = KClearColor; + + cell.IMModel = self.dataArray[indexPath.section]; + cell.selectionStyle = UITableViewCellSelectionStyleNone; + return cell; + + + +} +//每行高度 +//- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath +//{ +// return kRealValue(77); +//} + +- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { + + return kRealValue(5); +} + +- (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 +{ + XJDRecordIMListDateModel * IMModel = self.dataArray[indexPath.section]; + + if (self.recordBlock) { + + self.recordBlock(IMModel); + } + if (self.videoBlock) { + + self.videoBlock(IMModel); + } + +} + + +@end + + + diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/StopQuestion(停止咨询)/XJDStopQuestionPopView.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/StopQuestion(停止咨询)/XJDStopQuestionPopView.h new file mode 100644 index 0000000..2de0054 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/StopQuestion(停止咨询)/XJDStopQuestionPopView.h @@ -0,0 +1,22 @@ +// +// XJDStopQuestionPopView.h +// healthQuestion +// +// Created by 仁康信息 on 2023/4/30. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef void(^surePublishBlock)(); + +@interface XJDStopQuestionPopView : UIView + +@property (nonatomic, copy) NSString * questionNumber; + +@property (nonatomic, copy) surePublishBlock publisBlock; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/StopQuestion(停止咨询)/XJDStopQuestionPopView.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/StopQuestion(停止咨询)/XJDStopQuestionPopView.m new file mode 100644 index 0000000..4c59ab1 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/StopQuestion(停止咨询)/XJDStopQuestionPopView.m @@ -0,0 +1,148 @@ +// +// XJDStopQuestionPopView.m +// healthQuestion +// +// Created by 仁康信息 on 2023/4/30. +// + +#import "XJDStopQuestionPopView.h" + +@interface XJDStopQuestionPopView () + +@property (nonatomic, strong) UILabel * questionLabel ; +@property (nonatomic, strong) UILabel * publishLabel ; + +@end + +@implementation XJDStopQuestionPopView + +/* +// 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.backgroundColor = RGBA(0, 0, 0, 0.3); + + UIView * popView = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(56), kRealValue(176), kScreenWidth - kRealValue(112), kRealValue(253))]; + + popView.backgroundColor = KWhiteColor; + + popView.layer.cornerRadius = 10.0f; + + popView.layer.masksToBounds = true; + + [self addSubview:popView]; + + UILabel * titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, kRealValue(20), popView.width, 14)]; + titleLabel.text = @"系统提示"; + titleLabel.font = SYSTEMFONT(14); + titleLabel.textAlignment = NSTextAlignmentCenter; + titleLabel.textColor = CFontColor1; + [popView addSubview:titleLabel]; + + UILabel * stopLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(16), titleLabel.bottom + kRealValue(17), popView.width - kRealValue(32), 34)]; + stopLabel.text = @"您当前设置的暂停时间段有正在进行中的咨询:"; + stopLabel.font = SYSTEMFONT(13); + stopLabel.numberOfLines = 2; + stopLabel.textAlignment = NSTextAlignmentLeft; + stopLabel.textColor = UIColorHex(#666666); + [popView addSubview:stopLabel]; + + UIView * questionView = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(14),stopLabel.bottom + kRealValue(9), popView.width - kRealValue(28), kRealValue(44))]; + + questionView.backgroundColor = RGBA(33, 190, 189, 0.3); + + questionView.layer.cornerRadius = 10.0f; + + questionView.layer.masksToBounds = true; + + [popView addSubview:questionView]; + + UIImageView * iconImg = [[UIImageView alloc] initWithFrame:CGRectMake(kRealValue(32), kRealValue(17), 10, 10)]; + iconImg.image = [UIImage imageNamed:@"stopPopIcon"]; + [questionView addSubview:iconImg]; + + UILabel * questionLabel = [[UILabel alloc] initWithFrame:CGRectMake(iconImg.right + kRealValue(5),0, popView.width - 50, questionView.height)]; + questionLabel.text = @"视频咨询:1"; + questionLabel.font = SYSTEMFONT(13); + questionLabel.textAlignment = NSTextAlignmentLeft; + questionLabel.textColor = CFontColor1; + self.questionLabel = questionLabel; + [questionView addSubview:questionLabel]; + + + + UILabel * publishLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(16),questionView.bottom + kRealValue(11), popView.width - kRealValue(32), 34)]; + publishLabel.text = @"发布后,这2个咨询将被系统自动取消,确认是否发布?"; + self.publishLabel = publishLabel; + publishLabel.font = SYSTEMFONT(13); + publishLabel.textAlignment = NSTextAlignmentLeft; + publishLabel.numberOfLines = 0; + publishLabel.textColor = CFontColor1; + [popView addSubview:publishLabel]; + + UIView * rowLin = [[UIView alloc] initWithFrame:CGRectMake(0, popView.height - kRealValue(49), popView.width, 1)]; + rowLin.backgroundColor = UIColorHex(#E0E0E0); + [popView addSubview:rowLin]; + + + + UIButton * cancelbtn = [[UIButton alloc] initWithFrame:CGRectMake(0, rowLin.bottom , popView.width/2, 48)]; + + [cancelbtn setTitle:@"取消" forState:UIControlStateNormal]; + cancelbtn.titleLabel.font = SYSTEMFONT(13); + [cancelbtn setTitleColor:UIColorHex(#666666) forState:UIControlStateNormal]; + [cancelbtn addTarget:self action:@selector(cancelAction) forControlEvents:UIControlEventTouchUpInside]; + [popView addSubview:cancelbtn]; + + UIButton * pubbtn = [[UIButton alloc] initWithFrame:CGRectMake(popView.width/2, rowLin.bottom , popView.width/2, 48)]; + [pubbtn setTitle:@"发布" forState:UIControlStateNormal]; + [pubbtn setTitleColor:UIColorHex(#21BEBD) forState:UIControlStateNormal]; + [pubbtn addTarget:self action:@selector(publishSureAction) forControlEvents:UIControlEventTouchUpInside]; + pubbtn.titleLabel.font = SYSTEMFONT(13); + + [popView addSubview:pubbtn]; + + + UIView * cowLin = [[UIView alloc] initWithFrame:CGRectMake(popView.width/2 - 1, popView.height - kRealValue(49), 1, kRealValue(49))]; + cowLin.backgroundColor = UIColorHex(#E0E0E0); + [popView addSubview:cowLin]; +} + +-(void)cancelAction { + + [self removeFromSuperview]; +} + +- (void)publishSureAction { + + if (self.publisBlock) { + self.publisBlock(); + } + +} +- (void)setQuestionNumber:(NSString *)questionNumber { + + _questionNumber = questionNumber; + + self.questionLabel.text = [NSString stringWithFormat:@"视频咨询:%@",_questionNumber]; + self.publishLabel.text = [NSString stringWithFormat:@"发布后,这%@个咨询将被系统自动取消,确认是否发布?", _questionNumber]; +} + + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/StopQuestion(停止咨询)/XJDStopQuestionTableView.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/StopQuestion(停止咨询)/XJDStopQuestionTableView.h new file mode 100644 index 0000000..07a1750 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/StopQuestion(停止咨询)/XJDStopQuestionTableView.h @@ -0,0 +1,21 @@ +// +// StopQuestionView.h +// healthQuestion +// +// Created by 仁康信息 on 2023/4/29. +// + +#import +#import "XJDStopQuestionTableViewCell.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDStopQuestionTableView : UITableView + +@property (nonatomic, strong) NSArray * dataArray; + +@property (nonatomic, copy) chageServiceStatus changeBlock; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/StopQuestion(停止咨询)/XJDStopQuestionTableView.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/StopQuestion(停止咨询)/XJDStopQuestionTableView.m new file mode 100644 index 0000000..e45a9be --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/StopQuestion(停止咨询)/XJDStopQuestionTableView.m @@ -0,0 +1,135 @@ +// +// StopQuestionView.m +// healthQuestion +// +// Created by 仁康信息 on 2023/4/29. +// + +#import "XJDStopQuestionTableView.h" +#import "BRPickerView.h" + +@interface XJDStopQuestionTableView () + + +@end + + +@implementation XJDStopQuestionTableView + + +- (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 +{ + + XJDStopQuestionTableViewCell * cell = [self dequeueReusableCellWithIdentifier:@"STATUSCELL"]; + if (!cell) { + + cell = [[XJDStopQuestionTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"STATUSCELL"]; + } + cell.backgroundColor = KClearColor; + cell.model = self.dataArray[indexPath.section]; + cell.changeBlock = ^(NSString * _Nullable record_id) { + self.changeBlock(record_id); + }; + cell.selectionStyle = UITableViewCellSelectionStyleNone; + return cell; +} +//每行高度 +//- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath +//{ +// return kRealValue(77); +//} + +- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { + + return kRealValue(32); +} + +- (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 { + + + XJDStopServiceListModel * model = self.dataArray[section]; + UIView * footerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kRealValue(32))]; + + UILabel * timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, 0, kScreenWidth, kRealValue(32))]; + NSDate * starDate = [NSDate br_dateFromString:model.startDay dateFormat:@"yyyy-MM-dd"]; + timeLabel.text = [NSString stringWithFormat:@"%ld年%ld月",starDate.year,starDate.month]; + + timeLabel.textAlignment = NSTextAlignmentLeft; + timeLabel.font = SYSTEMFONT(15); + [footerView addSubview:timeLabel]; + + return footerView; + +} +////cell点击事件 +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + + +} + + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/StopQuestion(停止咨询)/XJDStopQuestionTableViewCell.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/StopQuestion(停止咨询)/XJDStopQuestionTableViewCell.h new file mode 100644 index 0000000..6a5f33e --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/StopQuestion(停止咨询)/XJDStopQuestionTableViewCell.h @@ -0,0 +1,23 @@ +// +// XJDStopQuestionTableViewCell.h +// healthQuestion +// +// Created by 仁康信息 on 2023/4/29. +// + +#import +#import "XJDStopServiceModel.h" + +typedef void(^chageServiceStatus)(NSString * _Nullable record_id); + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDStopQuestionTableViewCell : UITableViewCell + +@property (nonatomic, strong) XJDStopServiceListModel * model; + +@property (nonatomic, copy) chageServiceStatus changeBlock; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/StopQuestion(停止咨询)/XJDStopQuestionTableViewCell.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/StopQuestion(停止咨询)/XJDStopQuestionTableViewCell.m new file mode 100644 index 0000000..11373d3 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/StopQuestion(停止咨询)/XJDStopQuestionTableViewCell.m @@ -0,0 +1,205 @@ +// +// XJDStopQuestionTableViewCell.m +// healthQuestion +// +// Created by 仁康信息 on 2023/4/29. +// + +#import "XJDStopQuestionTableViewCell.h" + +@interface XJDStopQuestionTableViewCell () + +@property (nonatomic, strong) UIImageView * linImg; + +@property (nonatomic, strong) UIView * backView; + +@property (nonatomic, strong) UIButton * statusBtn; + +@property (nonatomic, strong) UILabel * timeLabel; + +@property (nonatomic, strong) UILabel * resourLabel; + +@property (nonatomic, strong) UILabel * gonggaoLabel; + +@property (nonatomic, strong) UILabel * statusLabel; + + +@end + +@implementation XJDStopQuestionTableViewCell + +- (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 { + + UIImageView * linv = [[UIImageView alloc] init]; +// [linv setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"xuxian"]]]; + linv.image = [UIImage imageNamed:@"xuxian"]; + linv.contentMode = UIViewContentModeScaleToFill; + linv.clipsToBounds = YES; + self.linImg = linv; + [self.contentView addSubview:linv]; + + [self.linImg mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_offset(27); + make.top.mas_offset(-15); + make.width.mas_offset(1); + make.bottom.mas_offset(15); + }]; + + self.backView = [[UIView alloc] init]; + self.backView.backgroundColor = KWhiteColor; + self.backView.layer.cornerRadius = 10; + [XJDCommonUtils addShadowToView:self.backView]; + [self.contentView addSubview:self.backView]; + + [self.backView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_offset(40); + make.top.mas_offset(0); + make.right.mas_offset(-15); + make.bottom.mas_offset(-10); + }]; + + self.timeLabel = [[UILabel alloc] init]; + self.timeLabel.text = @"暂停时间:2023-02-10 ~ 03-29"; + self.timeLabel.font = SYSTEMFONT(13);; + self.timeLabel.textAlignment = NSTextAlignmentLeft; + [self.backView addSubview:self.timeLabel]; + + [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.top.mas_offset(15); + make.height.mas_offset(13); + }]; + [self.timeLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal]; + + + UILabel * stopTitleLabel = [[UILabel alloc] init]; + stopTitleLabel.text = @"暂停原因:"; + stopTitleLabel.font = SYSTEMFONT(13); + stopTitleLabel.textAlignment = NSTextAlignmentRight; + [self.backView addSubview:stopTitleLabel]; + + [stopTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_offset(13); + make.top.mas_equalTo(self.timeLabel.mas_bottom).offset(20); + make.height.mas_equalTo(@13); + }]; + + [stopTitleLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal]; + + + + self.resourLabel = [[UILabel alloc] init]; + + self.resourLabel.font = SYSTEMFONT(13); + self.resourLabel.textAlignment = NSTextAlignmentCenter; + [self.backView addSubview:self.resourLabel]; + + [self.resourLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(stopTitleLabel.mas_right).offset(8); + make.top.mas_equalTo(self.timeLabel.mas_bottom).offset(12); + make.height.mas_equalTo(@27); + }]; + [self.resourLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal]; + + + UILabel * gonggaoTitleLabel = [[UILabel alloc] init]; + gonggaoTitleLabel.font = SYSTEMFONT(13); + gonggaoTitleLabel.textAlignment = NSTextAlignmentLeft; + gonggaoTitleLabel.numberOfLines = 0; + self.gonggaoLabel = gonggaoTitleLabel; + [self.backView addSubview:gonggaoTitleLabel]; + + [gonggaoTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_offset(13); + make.right.mas_offset(-24); + make.bottom.mas_equalTo(@-30); + make.top.mas_equalTo(self.resourLabel.mas_bottom).offset(14); + }]; + + [gonggaoTitleLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal]; + + self.statusBtn = [[UIButton alloc] init]; + [self.statusBtn setTitle:@"开启咨询" forState:UIControlStateNormal]; + [self.statusBtn setTitleColor:KWhiteColor forState:UIControlStateNormal]; + self.statusBtn.titleLabel.font = SYSTEMFONT(13); + self.statusBtn.layer.cornerRadius = 5.0; + self.statusBtn.layer.masksToBounds = YES; + self.statusBtn.backgroundColor = UIColorHex(#21BEBD); + [self.statusBtn addTarget:self action:@selector(statusChange) forControlEvents:UIControlEventTouchUpInside]; + [self.backView addSubview:self.statusBtn]; + + [self.statusBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.mas_offset(-5); + make.right.mas_offset(-10); + make.width.mas_offset(70); + make.height.mas_offset(25); + }]; + +} + +- (void)setModel:(XJDStopServiceListModel *)model { + + _model = model; + self.timeLabel.text = [NSString stringWithFormat:@"暂停时间:%@~%@",_model.startDay,model.endDay]; + self.resourLabel.text = [NSString stringWithFormat:@"%@",_model.stopReason]; + + NSString * gonggaoString = [NSString stringWithFormat:@"暂停公告:%@",_model.notice]; + NSMutableAttributedString *attriString = + [[NSMutableAttributedString alloc] initWithString:gonggaoString]; + NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; + [paragraphStyle setLineSpacing:10]; + //设置距离 + [attriString addAttribute:NSParagraphStyleAttributeName + value:paragraphStyle + range:NSMakeRange(0, [gonggaoString length])]; + self.gonggaoLabel.attributedText = attriString; + if (_model.serviceStatus == 1) { + + [self.statusBtn setTitle:@"已结束" forState:UIControlStateNormal]; + [self.statusBtn setTitleColor:CFontColor1 forState:UIControlStateNormal]; + self.statusBtn.backgroundColor =KClearColor; + self.statusBtn.userInteractionEnabled = NO; + + } + if (_model.serviceStatus == 0) { + [self.statusBtn setTitle:@"恢复服务" forState:UIControlStateNormal]; + [self.statusBtn setTitleColor:KWhiteColor forState:UIControlStateNormal]; + self.statusBtn.backgroundColor = UIColorHex(#21BEBD); + self.statusBtn.userInteractionEnabled = YES; + + + } +} + +- (void)statusChange { + + if (self.changeBlock) { + self.changeBlock(self.model.record_id); + } + +} + + + + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/XJDTTestView.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/XJDTTestView.h new file mode 100644 index 0000000..9049efd --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/XJDTTestView.h @@ -0,0 +1,13 @@ +// +// XJDTTestView.h +// DTPaperTeacher +// +// Created by syyy on 2023/5/6. +// + +#import + +@interface XJDTTestView : UIView +@property (nonatomic ,copy) void(^returnBlock)(NSString *startTime, NSString *endTime); +@end + diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/XJDTTestView.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/XJDTTestView.m new file mode 100644 index 0000000..e5fb199 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/XJDTTestView.m @@ -0,0 +1,329 @@ +// +// XJDTTestView.m +// DTPaperTeacher +// +// Created by syyy on 2023/5/6. +// + +#import "XJDTTestView.h" + +@interface XJDTTestView (){ + int _type;//0开始 1结束 +} +@property (nonatomic, strong) UIView *backView; +@property (nonatomic, strong) YYLabel *titleLab; +@property (nonatomic, strong) UILabel *centerLab; +@property (nonatomic, strong) UIButton *closeBtn; +@property (nonatomic, strong) UIButton *startBtn; +@property (nonatomic, strong) UIButton *endBtn; +@property (nonatomic, strong) UILabel * showTimeLabel; + +@property (nonatomic, strong) NSMutableArray *monthAndDayArr; +@property (nonatomic, strong) NSMutableArray *hourArr; +@property (nonatomic, strong) NSMutableArray *minArr; +@property (nonatomic, strong) UIPickerView *pickerView; + +@property (nonatomic, copy) NSString *monthStr; +@property (nonatomic, copy) NSString *hourStr; +@property (nonatomic, copy) NSString *minStr; + +@property (nonatomic, copy) NSString *startTime; +@property (nonatomic, copy) NSString *endTime; + +@end + +@implementation XJDTTestView + +-(NSMutableArray *)monthAndDayArr{ + if (_monthAndDayArr == nil) { + _monthAndDayArr = [NSMutableArray arrayWithCapacity:0]; + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; + [dateFormatter setDateFormat:@"MM月dd日 EEEE"]; + for (int i = 0; i < 7; i++) { + NSDate *Day = [NSDate dateWithTimeInterval:24*60*60*i sinceDate:[NSDate date]]; + NSString *DateStr = [dateFormatter stringFromDate:Day]; + + DateStr = [DateStr stringByReplacingOccurrencesOfString:@"Saturday" withString:@"星期六"]; + DateStr = [DateStr stringByReplacingOccurrencesOfString:@"Sunday" withString:@"星期日"]; + DateStr = [DateStr stringByReplacingOccurrencesOfString:@"Monday" withString:@"星期一"]; + DateStr = [DateStr stringByReplacingOccurrencesOfString:@"Tuesday" withString:@"星期二"]; + DateStr = [DateStr stringByReplacingOccurrencesOfString:@"Wednesday" withString:@"星期三"]; + DateStr = [DateStr stringByReplacingOccurrencesOfString:@"Thursday" withString:@"星期四"]; + DateStr = [DateStr stringByReplacingOccurrencesOfString:@"Friday" withString:@"星期五"]; + + [_monthAndDayArr addObject:DateStr]; + } + } + return _monthAndDayArr; +} + +-(NSMutableArray *)hourArr{ + if (_hourArr == nil) { + _hourArr = [NSMutableArray arrayWithCapacity:0]; + for (int i = 0; i < 24; i++) { + if (i<10) { + [_hourArr addObject:[NSString stringWithFormat:@"0%d", i]]; + }else{ + [_hourArr addObject:[NSString stringWithFormat:@"%d", i]]; + } + } + } + return _hourArr; +} + +-(NSMutableArray *)minArr{ + if (_minArr == nil) { + _minArr = [NSMutableArray arrayWithCapacity:0]; + for (int i = 0; i < 60; i++) { + if (i<10) { + [_minArr addObject:[NSString stringWithFormat:@"0%d", i]]; + }else{ + [_minArr addObject:[NSString stringWithFormat:@"%d", i]]; + } + } + } + return _minArr; +} + +-(instancetype)initWithFrame:(CGRect)frame{ + if (self = [super initWithFrame:frame]) { + + [self configUI]; + + [self configData]; + } + return self; +} + +-(void)configUI{ + self.backgroundColor = RGBA(0, 0, 0, 0.5); + + self.backView = [[UIView alloc]initWithFrame:CGRectMake(0, [UIScreen mainScreen].bounds.size.height - 300, [UIScreen mainScreen].bounds.size.width, 300)]; + self.backView.backgroundColor = UIColor.whiteColor; + [self addSubview:self.backView]; + UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.backView.bounds byRoundingCorners:UIRectCornerTopRight | UIRectCornerTopLeft cornerRadii:CGSizeMake(12, 12)]; + CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; + maskLayer.frame = self.backView.bounds; + maskLayer.path = maskPath.CGPath; + self.backView.layer.mask = maskLayer; + + self.titleLab = [[YYLabel alloc]initWithFrame:CGRectMake(20, 10, 200, 20)]; + self.titleLab.text = @"取消"; + self.titleLab.textColor = CFontColor1; + self.titleLab.font = BOLDSYSTEMFONT(13); + [self.backView addSubview:self.titleLab]; + [self.titleLab setTextTapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) { + [self removeFromSuperview]; + } ]; + + self.closeBtn = [[UIButton alloc]initWithFrame:CGRectMake(self.backView.frame.size.width - 75, 10, 55, 20)]; +// [self.closeBtn setImage:[UIImage imageNamed:@"close_Icon"] forState:UIControlStateNormal]; + [self.closeBtn setTitle:@"确定" forState:UIControlStateNormal]; + [self.closeBtn setTitleColor:CFontColor1 forState:UIControlStateNormal]; + self.closeBtn.titleLabel.font = BOLDSYSTEMFONT(13); + [self.closeBtn addTarget:self action:@selector(closeAct) forControlEvents:UIControlEventTouchUpInside]; + [self.backView addSubview:self.closeBtn]; + + + self.startBtn = [[UIButton alloc]initWithFrame:CGRectMake(20, self.titleLab.bottom + 25, self.backView.frame.size.width/2 - 35, 33)]; + [self.startBtn setTitleColor:UIColor.blackColor forState:UIControlStateNormal]; + self.startBtn.layer.cornerRadius = 5; + self.startBtn.layer.masksToBounds = YES; + self.startBtn.layer.borderWidth = 1; + self.startBtn.layer.borderColor = UIColorHex(#21BEBD).CGColor; + [self.startBtn setTitle:@"开始时间" forState:UIControlStateNormal]; + self.startBtn.titleLabel.font = SYSTEMFONT(13); + [self.startBtn addTarget:self action:@selector(startBtnAct) forControlEvents:UIControlEventTouchUpInside]; + [self.backView addSubview:self.startBtn]; + +// UIImageView * time1imge = [[UIImageView alloc] initWithFrame:CGRectMake(kRealValue(10), 9, 15, 15)]; +// time1imge.image = [UIImage imageNamed:@"smallTime"]; +// [self.startBtn addSubview:time1imge]; + + self.endBtn = [[UIButton alloc]initWithFrame:CGRectMake(self.backView.frame.size.width/2 + 15, self.startBtn.top, self.startBtn.width, self.startBtn.height)]; + [self.endBtn setTitleColor:UIColor.blackColor forState:UIControlStateNormal]; + self.endBtn.layer.cornerRadius = 6; + self.endBtn.layer.masksToBounds = YES; + self.endBtn.layer.borderWidth = 1; + self.endBtn.layer.borderColor = UIColorHex(#999999).CGColor; + self.endBtn.titleLabel.font = SYSTEMFONT(13); + [self.endBtn setTitle:@"结束时间" forState:UIControlStateNormal]; + [self.endBtn addTarget:self action:@selector(endBtnAct) forControlEvents:UIControlEventTouchUpInside]; + [self.backView addSubview:self.endBtn]; + +// UIImageView * time2imge = [[UIImageView alloc] initWithFrame:CGRectMake(kRealValue(10), 9, 15, 15)]; +// time2imge.image = [UIImage imageNamed:@"smallTime"]; +// [self.endBtn addSubview:time2imge]; + + self.centerLab = [[UILabel alloc]initWithFrame:CGRectMake(self.backView.frame.size.width/2 - 7.5, 60, 15, 25)]; + self.centerLab.text = @"至"; + self.centerLab.textAlignment = NSTextAlignmentCenter; + self.centerLab.font = SYSTEMFONT(13); + [self.backView addSubview:self.centerLab]; + + self.showTimeLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 12, 100, 25)]; + self.showTimeLabel.text = @"预计开始时间"; + self.showTimeLabel.textAlignment = NSTextAlignmentCenter; + self.showTimeLabel.font = SYSTEMFONT(16); + self.showTimeLabel.centerX = self.backView.centerX; + [self.backView addSubview:self.showTimeLabel]; + + self.pickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(0, 80, [UIScreen mainScreen].bounds.size.width, 200)]; + self.pickerView.delegate = self; + self.pickerView.dataSource = self; + [self.backView addSubview:self.pickerView]; + + UILabel *lab = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 10, 50)]; + lab.center = CGPointMake(self.pickerView.center.x + 115, self.pickerView.frame.size.height/2 -1); + lab.text = @":"; + [self.pickerView addSubview:lab]; +} + +-(void)configData{ + + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; + [dateFormatter setDateFormat:@"HH-mm"]; + NSDate *currentdate = [NSDate date]; + NSString *DateStr = [dateFormatter stringFromDate:currentdate]; + NSArray *timearr = [DateStr componentsSeparatedByString:@"-"]; + [self.pickerView selectRow:[timearr[0] integerValue] inComponent:1 animated:NO ]; + [self.pickerView selectRow:[timearr[1] integerValue] inComponent:2 animated:NO ]; + self.monthStr = self.monthAndDayArr[0]; + self.hourStr = timearr[0]; + self.minStr = timearr[1]; +// [self setStartAndEndData]; +} + +-(void)setStartAndEndData{ + NSDate *currentdate = [NSDate date]; + if (_type == 0) { + NSString * startTime = [NSString stringWithFormat:@"%ld年%@%@%@",(long)currentdate.year, [self.monthStr substringToIndex:6],self.hourStr,self.minStr]; + self.startTime = [NSString stringWithFormat:@"%ld",(long)[self timeSwitchTimestamp:startTime]] ; + [self.startBtn setTitle:[NSString stringWithFormat:@"%@ %@:%@", self.monthStr,self.hourStr,self.minStr] forState:UIControlStateNormal]; + + }else{ + NSString * currEndTime = [NSString stringWithFormat:@"%ld年%@%@%@",(long)currentdate.year, [self.monthStr substringToIndex:6],self.hourStr,self.minStr]; + self.endTime = [NSString stringWithFormat:@"%ld",(long)[self timeSwitchTimestamp:currEndTime]] ; + [self.endBtn setTitle:[NSString stringWithFormat:@"%@ %@:%@", self.monthStr,self.hourStr,self.minStr] forState:UIControlStateNormal]; + + } +} + +- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView{ + return 3; +} + +- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component{ + if (component == 0) return self.monthAndDayArr.count; + if (component == 1) return self.hourArr.count; + if (component == 2) return self.minArr.count; + return 0; +} + +-(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component{ + if (component == 0) return [self.monthAndDayArr objectAtIndex:row]; + if (component == 1) return [self.hourArr objectAtIndex:row]; + if (component == 2) return [self.minArr objectAtIndex:row]; + return @""; +} + +-(CGFloat)pickerView:(UIPickerView *)pickerView rowHeightForComponent:(NSInteger)component{ + return 50; +} + +-(CGFloat)pickerView:(UIPickerView *)pickerView widthForComponent:(NSInteger)component{ + if (component == 0) + { + return 220; + } + else + { + return 50; + } +} + +-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{ + if (component == 0) { + self.monthStr = self.monthAndDayArr[row]; + }else if (component == 1){ + self.hourStr = self.hourArr[row]; + }else if (component == 2){ + self.minStr = self.minArr[row]; + } + [self setStartAndEndData]; +} + +-(void)startBtnAct{ + _type = 0; + self.showTimeLabel.text = @"预计开始时间"; + self.startBtn.layer.borderColor = UIColorHex(#21BEBD).CGColor; + self.endBtn.layer.borderColor = UIColorHex(#999999).CGColor; +} + +-(void)endBtnAct{ + _type = 1; + self.showTimeLabel.text = @"预计结束时间"; + self.startBtn.layer.borderColor = UIColorHex(#999999).CGColor; + self.endBtn.layer.borderColor = UIColorHex(#21BEBD).CGColor; + +} + +-(void)closeAct{ + + if (_type == 0 ){ + + self.startBtn.layer.borderColor = UIColorHex(#21BEBD).CGColor; + self.endBtn.layer.borderColor = UIColorHex(#21BEBD).CGColor; + _type = 1; + }else + { + _type = 0; + if (self.startBtn.currentTitle.length == 4 ) { + [EasyTextView showErrorText:@"请选择开始时间"]; + return; + } + if ([self.startTime doubleValue] < [self.endTime doubleValue]) { + + } else if ([self.startTime doubleValue] > [self.endTime doubleValue]) { + [EasyTextView showErrorText:@"结束时间不能小于开始时间"]; + return; + } else if ([self.startTime doubleValue] == [self.endTime doubleValue]) { + + } + if (self.returnBlock) { + self.returnBlock(self.startTime, self.endTime); + } + [self removeFromSuperview]; + + } + + + + +} + +- (NSInteger)timeSwitchTimestamp:(NSString *)formatTime{ + + NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; + + [formatter setDateStyle:NSDateFormatterMediumStyle]; + + [formatter setTimeStyle:NSDateFormatterShortStyle]; + + [formatter setDateFormat:@"yyyy年MM月dd日HHmm"]; //(@"YYYY-MM-dd hh:mm:ss") ----------设置你想要的格式,hh与HH的区别:分别表示12小时制,24小时制 + + NSTimeZone* timeZone = [NSTimeZone timeZoneWithName:@"Asia/Beijing"]; + + [formatter setTimeZone:timeZone]; + + NSDate* date = [formatter dateFromString:formatTime]; //------------将字符串按formatter转成nsdate + + //时间转时间戳的方法: + NSInteger timeSp = [[NSNumber numberWithDouble:[date timeIntervalSince1970]*1000] integerValue]; + + NSLog(@"将某个时间转化成 时间戳timeSp:%ld",(long)timeSp); //时间戳的值 + + return timeSp; + +} +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/refuseQuestion(拒绝咨询)/XJDRefuseQuestionPopView.h b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/refuseQuestion(拒绝咨询)/XJDRefuseQuestionPopView.h new file mode 100644 index 0000000..3b72635 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/refuseQuestion(拒绝咨询)/XJDRefuseQuestionPopView.h @@ -0,0 +1,26 @@ +// +// RefuseQuestionPopView.h +// healthQuestion +// +// Created by 仁康信息 on 2023/5/4. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef void(^refuseQuestionBlock)(NSString * beizhuString,NSString * reasourString); + +typedef void(^cancelReasonBlock)(); + + +@interface XJDRefuseQuestionPopView : UIView + +@property (nonatomic, copy) refuseQuestionBlock popBlock; +@property (nonatomic, copy) cancelReasonBlock upBlock; + +@property (nonatomic, strong) NSArray * dataArray; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/refuseQuestion(拒绝咨询)/XJDRefuseQuestionPopView.m b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/refuseQuestion(拒绝咨询)/XJDRefuseQuestionPopView.m new file mode 100644 index 0000000..a5bc524 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/HomePage/view/refuseQuestion(拒绝咨询)/XJDRefuseQuestionPopView.m @@ -0,0 +1,271 @@ +// +// XJDRefuseQuestionPopView.m +// healthQuestion +// +// Created by 仁康信息 on 2023/5/4. +// + +#import "XJDRefuseQuestionPopView.h" +#import "UIPlaceHolderTextView.h" +#import "XJDCancelReasonModel.h" +@interface XJDRefuseQuestionPopView () + +@property (nonatomic, strong) UIPlaceHolderTextView * beizhuTextView; + +@property (nonatomic, strong) YYLabel * questionLabel; +@property (nonatomic, strong) UITableView * reasourTable; + +@property (nonatomic, copy) NSString * reasour_id; +@property (nonatomic, copy) NSString * reasour_text; + +@end + +@implementation XJDRefuseQuestionPopView + +/* +// 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.backgroundColor = RGBA(0, 0, 0, 0.3); + + UIView * popView = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(47), kRealValue(176), kScreenWidth - kRealValue(94), kRealValue(323))]; + + popView.backgroundColor = KWhiteColor; + + popView.layer.cornerRadius = 10.0f; + + popView.layer.masksToBounds = true; + +// UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapGesture:)]; +// [popView addGestureRecognizer:tap]; + + [self addSubview:popView]; + + UILabel * titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, kRealValue(20), popView.width, 14)]; + titleLabel.text = @"拒绝原因"; + titleLabel.font = SYSTEMFONT(14); + titleLabel.textAlignment = NSTextAlignmentCenter; + titleLabel.textColor = CFontColor1; + [popView addSubview:titleLabel]; + + UILabel * stopLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(27), titleLabel.bottom + kRealValue(28), 40, 13)]; + stopLabel.text = @"原因:"; + stopLabel.font = MEDIUMFONT(13); + stopLabel.textAlignment = NSTextAlignmentRight; + stopLabel.textColor = UIColorHex(#666666); + [popView addSubview:stopLabel]; + + + UIView * questionView = [[UIView alloc] initWithFrame:CGRectMake(stopLabel.right + kRealValue(9),titleLabel.bottom + kRealValue(18), popView.width - stopLabel.right - kRealValue(35), kRealValue(30))]; + questionView.backgroundColor = KWhiteColor; + questionView.layer.cornerRadius = 10.0f; + questionView.layer.borderColor = UIColorHex(#CCCCCC).CGColor; + questionView.layer.borderWidth = 1.0; + questionView.layer.masksToBounds = true; + [popView addSubview:questionView]; + + UIButton * pubbtn = [[UIButton alloc] initWithFrame:CGRectMake(questionView.width - kRealValue(9) - 13, kRealValue(11), 13, 8)]; + [pubbtn setImage:[UIImage imageNamed:@"garyDown"] forState:UIControlStateNormal]; + [pubbtn addTarget:self action:@selector(cancelReasonAction) forControlEvents:UIControlEventTouchUpInside]; + [questionView addSubview:pubbtn]; + + YYLabel * questionLabel = [[YYLabel alloc] initWithFrame:CGRectMake(kRealValue(13),0, popView.width - kRealValue(22) - 13, questionView.height)]; + questionLabel.text = @"时间不合适"; + self.questionLabel = questionLabel; + questionLabel.font = SYSTEMFONT(13); + questionLabel.textAlignment = NSTextAlignmentLeft; + questionLabel.textColor = CFontColor1; + [questionLabel setTextTapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) { + [self cancelReasonAction]; + }]; + [questionView addSubview:questionLabel]; + + + + + + UILabel * beizhuLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(27), questionView.bottom + kRealValue(27), 40, 13)]; + beizhuLabel.text = @"备注:"; + beizhuLabel.font = MEDIUMFONT(13); + beizhuLabel.textAlignment = NSTextAlignmentRight; + beizhuLabel.textColor = UIColorHex(#666666); + [popView addSubview:beizhuLabel]; + + self.beizhuTextView = [[UIPlaceHolderTextView alloc] initWithFrame:CGRectMake(stopLabel.right + kRealValue(9),questionView.bottom + kRealValue(19), questionView.width, 132)]; + self.beizhuTextView.layer.cornerRadius = 5.0f; + self.beizhuTextView.layer.masksToBounds = true; + self.beizhuTextView.layer.borderColor = UIColorHex(#CCCCCC).CGColor; + self.beizhuTextView.layer.borderWidth = 1.0; + self.beizhuTextView.placeholder = @"请输入拒绝原因详细说明"; + self.beizhuTextView.placeholderColor = UIColorHex(#999999); + self.beizhuTextView.font = SYSTEMFONT(13); + [popView addSubview: self.beizhuTextView]; + + + + + UIButton * cancelbtn = [[UIButton alloc] initWithFrame:CGRectMake(popView.width - kRealValue(15) - 15 , kRealValue(15) , 15, 15)]; + [cancelbtn setImage:[UIImage imageNamed:@"close_Icon"] forState:UIControlStateNormal]; + [cancelbtn addTarget:self action:@selector(cancelAction) forControlEvents:UIControlEventTouchUpInside]; + [popView addSubview:cancelbtn]; + + UIButton * submit = [[UIButton alloc] initWithFrame:CGRectMake(kRealValue(65), self.beizhuTextView.bottom + kRealValue(30) , popView.width - kRealValue(130), 35)]; + [submit setTitle:@"提交" forState:UIControlStateNormal]; + [submit setTitleColor:KWhiteColor forState:UIControlStateNormal]; + [submit setBackgroundColor:UIColorHex(#21BEBD)]; + submit.layer.cornerRadius =17.5; + submit.layer.masksToBounds = true; + submit.titleLabel.font = SYSTEMFONT(14); + [submit addTarget:self action:@selector(subitAction) forControlEvents:UIControlEventTouchUpInside]; + [popView addSubview:submit]; + + + self.reasourTable = [[UITableView alloc] initWithFrame:CGRectMake(questionView.left + kRealValue(5), questionView.bottom, questionView.width - kRealValue(10), kRealValue(90)) style:UITableViewStyleGrouped]; + self.reasourTable.delegate = self; + self.reasourTable.dataSource = self; + self.reasourTable.backgroundColor = KWhiteColor; + self.reasourTable.hidden = YES; + [popView addSubview:self.reasourTable]; + + self.reasourTable.layer.shadowColor = RGBA(0, 0, 0, 0.3).CGColor; + + self.reasourTable.layer.shadowOffset = CGSizeMake(0, 0); + + self.reasourTable.layer.shadowOpacity = 1; + + self.reasourTable.clipsToBounds = false; + + +} + +- (void)subitAction { + + if (self.popBlock) { + + self.popBlock(self.beizhuTextView.text, self.reasour_id); + } +} + + +-(void)cancelAction { + + [self removeFromSuperview]; + +} + +- (void)handleTapGesture:(id)sender { + + self.reasourTable.hidden = true; +} + +- (void)cancelReasonAction { + + self.reasourTable.hidden = false; + +} + +- (void)setDataArray:(NSArray *)dataArray { + + _dataArray = dataArray; + if (_dataArray.count > 0) { + XJDCancelReasonModel * model = _dataArray[0]; + self.reasour_id = model.value; + self.questionLabel.text = model.text; + } + + [self.reasourTable reloadData]; + +} + +#pragma mark - tableview的代理方法 +//组数 +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return 1; +} +//每组多少行 +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return self.dataArray.count; +} +//注册cell +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + XJDCancelReasonModel * model = self.dataArray[indexPath.row]; + UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"STATUSCELL"]; + if (!cell) { + + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"STATUSCELL"]; + } + cell.backgroundColor = KWhiteColor; + cell.selectionStyle = UITableViewCellSelectionStyleNone; + cell.textLabel.text = model.text; + cell.textLabel.font = SYSTEMFONT(13); + return cell; + + + +} +//每行高度 +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath +{ + return kRealValue(30); +} + +- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { + + return CGFLOAT_MIN; +} + +- (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 { + + + return [UIView new]; + +} +////cell点击事件 +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + + XJDCancelReasonModel * model = self.dataArray[indexPath.row]; + self.reasour_id = model.value; + self.questionLabel.text = model.text; + self.reasourTable.hidden = YES; +} + + +@end + diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/Login/XJDLoginFoundPasswordViewController.h b/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/Login/XJDLoginFoundPasswordViewController.h new file mode 100644 index 0000000..8b7a2fc --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/Login/XJDLoginFoundPasswordViewController.h @@ -0,0 +1,17 @@ +// +// XJDLoginFoundPasswordViewController.h +// DoctorXinjiang +// +// Created by 仁康信息 on 2023/5/22. +// + +#import "YXBaseViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDLoginFoundPasswordViewController : YXBaseViewController + + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/Login/XJDLoginFoundPasswordViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/Login/XJDLoginFoundPasswordViewController.m new file mode 100644 index 0000000..649109a --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/Login/XJDLoginFoundPasswordViewController.m @@ -0,0 +1,209 @@ +// +// XJDLoginFoundPasswordViewController.m +// DoctorXinjiang +// +// Created by 仁康信息 on 2023/5/22. +// + +#import "XJDLoginFoundPasswordViewController.h" +#import "XJDLoginSetPasswordViewController.h" +#import "LVKeyboard.h" +#import "MQTextField.h" + +@interface XJDLoginFoundPasswordViewController () + +@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 XJDLoginFoundPasswordViewController + +- (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"]; + + XJDNetAPI * chageApi = [[XJDNetAPI 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; + + XJDLoginSetPasswordViewController * password = [[XJDLoginSetPasswordViewController 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 diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/Login/XJDLoginProtocolWebViewController.h b/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/Login/XJDLoginProtocolWebViewController.h new file mode 100644 index 0000000..0a0689f --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/Login/XJDLoginProtocolWebViewController.h @@ -0,0 +1,16 @@ +// +// XJDLoginProtocolWebViewController.h +// healthQuestion +// +// Created by 仁康信息 on 2024/1/12. +// + +#import "YXBaseWebViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDLoginProtocolWebViewController : YXBaseWebViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/Login/XJDLoginProtocolWebViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/Login/XJDLoginProtocolWebViewController.m new file mode 100644 index 0000000..d2a56df --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/Login/XJDLoginProtocolWebViewController.m @@ -0,0 +1,32 @@ +// +// XJDLoginProtocolWebViewController.m +// healthQuestion +// +// Created by 仁康信息 on 2024/1/12. +// + +#import "XJDLoginProtocolWebViewController.h" + +@interface XJDLoginProtocolWebViewController () + +@end + +@implementation XJDLoginProtocolWebViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. + self.isHidenNaviBar = false; +} + +/* +#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 diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/Login/XJDLoginSetPasswordViewController.h b/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/Login/XJDLoginSetPasswordViewController.h new file mode 100644 index 0000000..6726223 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/Login/XJDLoginSetPasswordViewController.h @@ -0,0 +1,18 @@ +// +// LoginSetPasswordViewController.h +// DoctorXinjiang +// +// Created by 仁康信息 on 2023/5/22. +// + +#import "YXBaseViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDLoginSetPasswordViewController : YXBaseViewController + +@property (nonatomic, copy) NSString * result; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/Login/XJDLoginSetPasswordViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/Login/XJDLoginSetPasswordViewController.m new file mode 100644 index 0000000..9e02a99 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/Login/XJDLoginSetPasswordViewController.m @@ -0,0 +1,178 @@ +// +// LoginSetPasswordViewController.m +// DoctorXinjiang +// +// Created by 仁康信息 on 2023/5/22. +// + +#import "XJDLoginSetPasswordViewController.h" +#import "RSAObjC.h" + +@interface XJDLoginSetPasswordViewController () + +@property (nonatomic, strong) UITextField * phoneTextFild; +@property (nonatomic, strong) UITextField * codeTextFild; + + +@end + + +@implementation XJDLoginSetPasswordViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + 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]; + + 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]; + + + 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]; + [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 { + + + + if (ValidStr(self.phoneTextFild.text) || ValidStr(self.codeTextFild.text)) { + [EasyTextView showErrorText:@"请输入新密码"]; + return; + } + if ([self 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"]; + + XJDNetAPI * chageApi = [[XJDNetAPI 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]; + } + +} +/* +#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 diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/Login/HQRegisterViewController.h b/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/Login/XJDRegisterViewController.h similarity index 76% rename from DoctorXinjiang/DoctorXinjiang/Project/Login_Register/Login/HQRegisterViewController.h rename to DoctorXinjiang/DoctorXinjiang/Project/Login_Register/Login/XJDRegisterViewController.h index 77ccc8b..8055441 100644 --- a/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/Login/HQRegisterViewController.h +++ b/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/Login/XJDRegisterViewController.h @@ -9,7 +9,7 @@ NS_ASSUME_NONNULL_BEGIN -@interface YXRegisterViewController : YXBaseViewController +@interface XJDRegisterViewController : YXBaseViewController @end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/Login/XJDRegisterViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/Login/XJDRegisterViewController.m new file mode 100644 index 0000000..5967fae --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/Login/XJDRegisterViewController.m @@ -0,0 +1,262 @@ +// +// XJDRegisterViewController.m +// healthQuestion +// +// Created by 仁康信息 on 2024/1/26. +// + +#import "XJDRegisterViewController.h" +#import "XJDLoginProtocolWebViewController.h" +@interface XJDRegisterViewController () + +@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 XJDRegisterViewController + +- (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 { + + XJDNetAPI * agreeAPI = [[XJDNetAPI alloc] init:self tag:@"AGREEAPI" NeedToken:@""]; + + [agreeAPI getUserAgreementPrivacy:nil]; +} + +// 跳转用户协议 +- (void)tap +{ + + XJDLoginProtocolWebViewController * webVC= [[XJDLoginProtocolWebViewController 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) { + + XJDIMUserInfoModel * model = [XJDIMUserInfoModel modelWithDictionary:parmDic]; + if ([model.value integerValue] == 1) { + self.protocolString = model.text; + } + [dataArray addObject:model]; + + } + + } +} + + +- (void)Failed:(NSString*)message tag:(NSString*)tag +{ + [MBProgressHUD showInfoMessage: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 *)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 diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/XJDIMUserInfoModel.h b/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/XJDIMUserInfoModel.h new file mode 100644 index 0000000..dfeb032 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/XJDIMUserInfoModel.h @@ -0,0 +1,29 @@ +// +// XJDIMUserInfoModel.h +// DoctorXinjiang +// +// Created by 仁康信息 on 2023/6/29. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDIMUserInfoModel : NSObject + +@property (nonatomic, strong) NSDictionary *IMInfo; + + +@property (nonatomic, copy) NSString * sdkAppId; + +@property (nonatomic, copy) NSString * userSig; + +@property (nonatomic, copy) NSString * userId; + +@property (nonatomic, copy) NSString * value; +@property (nonatomic, copy) NSString * text; +@property (nonatomic, copy) NSString * title; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/XJDIMUserInfoModel.m b/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/XJDIMUserInfoModel.m new file mode 100644 index 0000000..6b96b04 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/XJDIMUserInfoModel.m @@ -0,0 +1,43 @@ +// +// IMUserInfoModel.m +// DoctorXinjiang +// +// Created by 仁康信息 on 2023/6/29. +// + +#import "XJDIMUserInfoModel.h" + +@implementation XJDIMUserInfoModel + +- (void)encodeWithCoder:(NSCoder *)aCoder +{ + [aCoder encodeObject:self.sdkAppId forKey:@"sdkAppId"]; + [aCoder encodeObject:self.userSig forKey:@"userSig"]; + [aCoder encodeObject:self.userId forKey:@"userId"]; + + +} +- (id)initWithCoder:(NSCoder *)aDecoder +{ + self = [super init]; + if (self) + { + self.userId = [aDecoder decodeObjectForKey:@"userId"]; + self.userSig = [aDecoder decodeObjectForKey:@"userSig"]; + self.sdkAppId = [aDecoder decodeObjectForKey:@"sdkAppId"]; + + } + return self; +} + + +-(void)setIMInfo:(NSDictionary *)IMInfo { + + _IMInfo = IMInfo; + self.sdkAppId = [_IMInfo objectForKey:@"sdkAppId"]; + self.userSig = [_IMInfo objectForKey:@"userSig"]; + self.userId = [_IMInfo objectForKey:@"userId"]; + +} + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/register/YXLoginViewController.h b/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/register/XJDLoginViewController.h similarity index 75% rename from DoctorXinjiang/DoctorXinjiang/Project/Login_Register/register/YXLoginViewController.h rename to DoctorXinjiang/DoctorXinjiang/Project/Login_Register/register/XJDLoginViewController.h index 8c7d580..45a97fd 100644 --- a/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/register/YXLoginViewController.h +++ b/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/register/XJDLoginViewController.h @@ -9,7 +9,7 @@ NS_ASSUME_NONNULL_BEGIN -@interface YXLoginViewController : YXBaseViewController +@interface XJDLoginViewController : YXBaseViewController @end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/register/XJDLoginViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/register/XJDLoginViewController.m new file mode 100644 index 0000000..1dfc8d5 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/register/XJDLoginViewController.m @@ -0,0 +1,506 @@ +// +// HQLoginViewController.m +// healthQuestion +// +// Created by xulei on 2022/8/16. +// + +#import "XJDLoginViewController.h" +#import "TUIC2CChatViewController.h" +#import "XJDLoginFoundPasswordViewController.h" +#import "XJDIMUserInfoModel.h" +#import "XJDLoginProtocolWebViewController.h" +#import "RSAObjC.h" +#import "XJDRegisterViewController.h" +#import "UIDevice+model.h" +#import "LVKeyboard.h" +#import "XJDModifyPasswordViewController.h" + +@interface XJDLoginViewController () + +@property (nonatomic, strong) UITextField * userNameField; + +@property (nonatomic, strong) UITextField * passwordField; + +@property (nonatomic, strong) UIButton * logoBtn; + +@property (nonatomic, strong) UIView * loginView; + +@property (nonatomic, strong) UIButton * privacyPolicyBtn; + +@property (nonatomic, strong) UIButton * agreenBtn; + +@property (nonatomic, strong) UIButton * regisBtn; + +@property (nonatomic, strong) XJDIMUserInfoModel * model ; + +@property (nonatomic, strong) NSMutableArray * dataArray; + +@property (nonatomic, strong) LVKeyboard *keyboard; + +@property (nonatomic, strong) UIButton *toggleButton; + +@end + +@implementation XJDLoginViewController + +- (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(@"loginTitle_Img"); + [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"); + [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; + self.userNameField.autocapitalizationType = UITextAutocapitalizationTypeNone; + + [loginView addSubview:accountField ]; +// +// + UITextField *passwordField = [[UITextField 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), kScreenWidth - 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), kScreenWidth - 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 * 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]; + [self.view addSubview:self.agreenBtn]; + if ([agree intValue] == 1) { + self.agreenBtn.selected = true; + }else + { + self.agreenBtn.selected = false; + } + //隐私 + YYLabel * yslabel = [[YYLabel alloc] initWithFrame:CGRectMake(self.agreenBtn.right + kRealValue(5) ,self.agreenBtn.top , kScreenWidth - self.agreenBtn.right - kRealValue(47), 40)]; + [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:UIColor.blueColor]; + [attributed setTextHighlight:protocolHightlight range:[string rangeOfString:@"《用户协议》"]]; + + YYTextHighlight * layHightlight = [[YYTextHighlight alloc] init]; + layHightlight.userInfo = @{@"隐私":@"《隐私政策》"}; + [layHightlight setColor:UIColor.blueColor]; + [attributed setTextHighlight:layHightlight range:[string rangeOfString:@"《隐私政策》"]]; + + + YYTextHighlight * shuoHightlight = [[YYTextHighlight alloc] init]; + shuoHightlight.userInfo = @{@"说明":@"《相关法律说明》"}; + [shuoHightlight setColor:UIColor.blueColor]; + [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) { + NSLog(@"%@, %@, %@, %@", containerView, text.string, NSStringFromRange(range), NSStringFromCGRect(rect)); + NSString *string = [text.string substringWithRange:range]; + NSLog(@"\n %@", string); + if ([string containsString:@"用户协议"]){ + for (XJDIMUserInfoModel * model in self.dataArray) { + + if ([model.value integerValue] == 1) { + + XJDLoginProtocolWebViewController * webVC= [[XJDLoginProtocolWebViewController alloc] init]; + webVC.webTitle = @"用户协议"; + webVC.webUrl = [NSString stringWithFormat:@"%@%@",IntervenH5,model.text]; + [self.navigationController pushViewController:webVC animated:YES]; + } + + } + + } + if ([string containsString:@"隐私政策"]){ + for (XJDIMUserInfoModel * model in self.dataArray) { + if ([model.value integerValue] == 2) { + + XJDLoginProtocolWebViewController * webVC= [[XJDLoginProtocolWebViewController alloc] init]; + webVC.webTitle = @"隐私政策"; + webVC.webUrl = [NSString stringWithFormat:@"%@%@",IntervenH5,model.text]; + [self.navigationController pushViewController:webVC animated:YES]; + } + } + } + if ([string containsString:@"相关法律说明"]){ + for (XJDIMUserInfoModel * model in self.dataArray) { + if ([model.value integerValue] == 3) { + + XJDLoginProtocolWebViewController * webVC= [[XJDLoginProtocolWebViewController alloc] init]; + webVC.webTitle = @"相关法律说明"; + webVC.webUrl = [NSString stringWithFormat:@"%@%@",IntervenH5,model.text]; + [self.navigationController pushViewController:webVC animated:YES]; + } + } + } + }; + +} + +- (void)togglePasswordVisibility { + self.passwordField.secureTextEntry = !self.passwordField.secureTextEntry; + self.toggleButton.selected = !self.toggleButton.selected; +} + +#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) { + + XJDLoginFoundPasswordViewController * modifVC = [[XJDLoginFoundPasswordViewController alloc] init]; + [self.navigationController pushViewController:modifVC animated:YES]; + + }]; + [alertController addAction:cancelAction]; + [alertController addAction:sureAction]; + + [self presentViewController:alertController animated:YES completion:nil]; + + + 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]; + NSLog(@"加密后:%@", encryptStr); + + [self showMBProgressHUDWithString:@"登录中" autoHidden:YES]; + + NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; + + [parmDic setObject:self.userNameField.text forKey:@"username"]; + [parmDic setObject:encryptStr forKey:@"password"]; + + //新增 + UIDevice *currentDevice = [UIDevice currentDevice]; + NSString * phone = [currentDevice getCurrentDeviceModel]; +// NSString * system = [NSString stringWithFormat:@"%.1f",CurrentSystemVersion] ; + [parmDic setObject:phone forKey:@"deviceType"]; + [parmDic setObject:@(CurrentSystemVersion) forKey:@"deviceSystem"]; + + XJDNetAPI * proctocolApi = [[XJDNetAPI alloc] init:self tag:@"LOGINGAPI" NeedToken:nil]; + [proctocolApi PostLogin:parmDic]; + + + +} + +- (void)createData { + + XJDNetAPI * agreeAPI = [[XJDNetAPI alloc] init:self tag:@"AGREEAPI" NeedToken:@""]; + + [agreeAPI getUserAgreementPrivacy:nil]; + +} + +- (void)ishiderRegisData { + + + XJDNetAPI * versionAPI = [[XJDNetAPI alloc] init:self tag:@"VERSIONAPI" NeedToken:@""]; + + [versionAPI getVesionHideRegis:@{@"type":@"app_update_doctor_ios"}]; + + +} + +#pragma mark -网络请求处理 +- (void)Failed:(NSString*)message tag:(NSString*)tag +{ + + [self hiddenAllMBProgressHUD]; + [EasyTextView showErrorText:message]; +} +- (void)Sucess:(id)response tag:(NSString*)tag +{ + [self hiddenAllMBProgressHUD]; + if ([tag isEqualToString:@"LOGINGAPI"]) { + + NSDictionary * dic = response; + XJDUserInfo * user = [[XJDUserInfo alloc] init]; + user.userInfo = [dic objectForKey:@"userInfo"]; + user.token = [dic objectForKey:@"token"]; + [XJDCommonUtils keyedArchiverWithData:user key:LoginUserInfo]; + [[NSUserDefaults standardUserDefaults] setObject:@"1" forKey:@"LOGINAgree"]; + [[NSUserDefaults standardUserDefaults] synchronize]; + KPostNotification(KNotificationLoginStateChange, @YES); + //登录im +#if DEBUG + [self loginImAccount]; + +#else + [self loginImAccount]; + +#endif + } + if ([tag isEqualToString:@"IMAPI"]) { + + NSDictionary * pamrDic = response; + + XJDIMUserInfoModel * model = [XJDIMUserInfoModel modelWithDictionary:pamrDic]; + + XJDIMUserInfoModel * iminfoModel = [[XJDIMUserInfoModel alloc] init]; + iminfoModel.IMInfo = pamrDic; + [XJDCommonUtils 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 的实现类,如果您不需要监听 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]; + + TUICallEngine * engin = [TUICallEngine createInstance]; + + [engin init:[model.sdkAppId intValue] userId:model.userId userSig:model.userSig succ:^{ + [engin addObserver:self]; + } fail:^(int code, NSString * _Nullable errMsg) { + + }]; + + + } + if ([tag isEqualToString:@"AGREEAPI"]) { + + NSArray * array = response; + + for (NSDictionary * parmDic in array) { + + XJDIMUserInfoModel * model = [XJDIMUserInfoModel modelWithDictionary:parmDic]; + + [self.dataArray addObject:model]; + + } + + } + + if ([tag isEqualToString:@"VERSIONAPI"]) { + + NSString * version = response; + + NSBundle *mainBundle = [NSBundle mainBundle]; + if (mainBundle) { + NSString *version = [mainBundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"]; + + if([version floatValue] < [version floatValue]) { + self.regisBtn.hidden = true; + }else + { + self.regisBtn.hidden = false; + } + } + } +} + +- (void)loginImAccount { + + + XJDNetAPI * proctocolApi = [[XJDNetAPI alloc] init:self tag:@"IMAPI" NeedToken:nil]; + [proctocolApi GetIMLoginAccount:nil]; + + + +} + + +- (void)agreeProtocolAction:(UIButton *)agreeBtn { + + agreeBtn.selected = !agreeBtn.selected; + + +} +#pragma mark:找回密码 +- (void)foundUserPasswordAction { + + XJDLoginFoundPasswordViewController * foundVC = [[XJDLoginFoundPasswordViewController alloc] init]; + + [self.navigationController pushViewController:foundVC animated:YES]; +} + +#pragma mark:注册 +- (void)regisAction { + + XJDRegisterViewController * forgetVc = [[XJDRegisterViewController 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]; +} +@end + diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/XJDAboutUsViewController.h b/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/XJDAboutUsViewController.h new file mode 100644 index 0000000..2f6e80d --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/XJDAboutUsViewController.h @@ -0,0 +1,16 @@ +// +// XJDAboutUsViewController.h +// healthQuestion +// +// Created by 仁康信息 on 2024/1/15. +// + +#import "YXBaseViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDAboutUsViewController : YXBaseViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/XJDAboutUsViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/XJDAboutUsViewController.m new file mode 100644 index 0000000..87b27f0 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/XJDAboutUsViewController.m @@ -0,0 +1,236 @@ +// +// XJDAboutUsViewController.m +// healthQuestion +// +// Created by 仁康信息 on 2024/1/15. +// + +#import "XJDAboutUsViewController.h" +#import "XJDLoginProtocolWebViewController.h" + +@interface XJDAboutUsViewController () + +@property (nonatomic, strong) UITableView * homeTableView; + +@property (nonatomic, strong) NSMutableArray * dataArray; + +@end + +@implementation XJDAboutUsViewController + +- (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 { + + XJDNetAPI * agreeAPI = [[XJDNetAPI 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) { + + XJDIMUserInfoModel * model = [XJDIMUserInfoModel modelWithDictionary:parmDic]; + + [self.dataArray addObject:model]; + + } + + } +} + + +#pragma mark - DataSource +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + if (section == 0) { + return 2; + } + 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) { + + for (XJDIMUserInfoModel * model in self.dataArray) { + + if ([model.value integerValue] == 1) { + + XJDLoginProtocolWebViewController * webVC= [[XJDLoginProtocolWebViewController alloc] init]; + webVC.webTitle = @"用户协议"; + webVC.webUrl = [NSString stringWithFormat:@"%@%@",IntervenH5,model.text]; + [self.navigationController pushViewController:webVC animated:YES]; + } + + } + } + if (indexPath.row == 1) { + + for (XJDIMUserInfoModel * model in self.dataArray) { + + if ([model.value integerValue] == 2) { + + XJDLoginProtocolWebViewController * webVC= [[XJDLoginProtocolWebViewController 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 diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/XJDGoodAtSicksViewController.h b/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/XJDGoodAtSicksViewController.h new file mode 100644 index 0000000..a26ab49 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/XJDGoodAtSicksViewController.h @@ -0,0 +1,24 @@ +// +// XJDGoodAtSicksViewController.h +// healthQuestion +// +// Created by 仁康信息 on 2023/8/10. +// + +#import "YXBaseViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +typedef void(^SelectedSickBlock)(NSArray * sicksArray); + +@interface XJDGoodAtSicksViewController : YXBaseViewController + +@property (nonatomic, copy) NSString * departmentId; + +@property (nonatomic, strong) NSMutableArray * sicksArray; + +@property (nonatomic, copy) SelectedSickBlock sicksBlock; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/XJDGoodAtSicksViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/XJDGoodAtSicksViewController.m new file mode 100644 index 0000000..725af89 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/XJDGoodAtSicksViewController.m @@ -0,0 +1,251 @@ +// +// XJDGoodAtSicksViewController.m +// healthQuestion +// +// Created by 仁康信息 on 2023/8/10. +// + +#import "XJDGoodAtSicksViewController.h" +#import "XJDCustomDelectedView.h" +#import "XJDDoctorInfoModel.h" +#import "ZHTagListView.h" + +@interface XJDGoodAtSicksViewController () + +@property (nonatomic, strong) NSMutableArray * customArray; + +@property (nonatomic, strong) NSMutableArray * customDataArray; + +@property (nonatomic, strong) NSMutableArray * needArray; + +@property (nonatomic, strong) UIScrollView * mainScrollView; + +@property (nonatomic, strong) ZHTagListView *tagList; + +@property (nonatomic, copy) NSString * reasonString; + +@property (nonatomic, strong) NSArray * buttonArray; + +@end + + +@implementation XJDGoodAtSicksViewController + +- (NSMutableArray *)customArray { + + if(!_customArray) { + _customArray = [[NSMutableArray alloc] init]; + } + return _customArray; +} + + +- (NSMutableArray *)needArray { + + if(!_needArray) { + _needArray = [[NSMutableArray alloc] init]; + } + return _needArray; +} + + +- (NSMutableArray *)customDataArray { + + if (!_customDataArray) { + + _customDataArray = [[NSMutableArray alloc] init]; + } + + return _customDataArray; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. + self.view.backgroundColor = KWhiteColor; + self.isHidenNaviBar = false; + self.navigationItem.title = @"擅长病种"; + [self addNavigationItemWithTitles:@[@"确认"] isLeft:false target:self action:@selector(sureAction) tags:@[@"1111"]]; + [self createUI]; + [self createData]; +} + +- (void)sureAction { + +// NSMutableArray * needArray = [[NSMutableArray alloc] init]; + //如果不点击 + + + for (XJDDoctorGoodSicknessModel * model in self.customDataArray) { + + for (NSString * sickName in self.sicksArray) { + + if ([sickName isEqualToString:model.sicksName]) { + + [self.needArray addObject:model]; + } + + } + } + self.sicksBlock(self.needArray); + //如果点击 + [self.navigationController popViewControllerAnimated:YES]; + + +} + + +- (void)createUI { + + self.mainScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)]; + [self.view addSubview:self.mainScrollView]; + + NSMutableArray *_dataSource = @[@" ",@" ",@" ",@" "].mutableCopy; + + ZHTagListConfiguration *config = [ZHTagListConfiguration defaultConfiguration]; +// config.tagTextColor = UIColorHex(#21BEBD); + config.tagTextMargin = 11; + config.tagHeight = 27; + config.tagTextFont = SYSTEMFONT(14); + config.tagMaxWidth = kScreenWidth - kRealValue(30); + config.tagListViewInset = UIEdgeInsetsMake(15, 15, 15, 10); + + + ZHTagListView *tagList = [[ZHTagListView alloc] initWithFrame:CGRectMake(kRealValue(15), 0, self.mainScrollView.width - kRealValue(30), 0) configuration:config tagTexts:_dataSource]; + tagList.backgroundColor = KWhiteColor; + [self.mainScrollView addSubview:tagList]; + self.tagList = tagList; + [tagList.tagButtonList enumerateObjectsUsingBlock:^(UIButton * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { +// [obj setBackgroundColor:KRedColor]; + + }]; + + +} + + + +- (void)createData { + + NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; + + [parmDic setObject:self.departmentId forKey:@"departmentId"]; + + XJDNetAPI * homeApi = [[XJDNetAPI alloc] init:self tag:@"ROOMINFO" NeedToken:@""]; + + [homeApi GetInquireDoctorRoomInfo:parmDic]; + +} +- (void)Failed:(NSString*)message tag:(NSString*)tag +{ + [self hiddenAllMBProgressHUD]; + +} + + +- (void)Sucess:(id)response tag:(NSString*)tag +{ + [self hiddenAllMBProgressHUD]; + + + if ([tag isEqualToString:@"ROOMINFO"]) { + + NSArray * resArray = response; + + NSMutableArray * dataArray = [[NSMutableArray alloc] init]; + + for (NSDictionary * dic in resArray) { + XJDDoctorGoodSicknessModel * sickModel = [XJDDoctorGoodSicknessModel modelWithDictionary:dic]; + [self.customDataArray addObject:sickModel]; + [dataArray addObject:sickModel.sicksName]; + } + //一样的数据 + NSMutableArray * samArray = [[NSMutableArray alloc] init]; + NSMutableArray * difArray = [[NSMutableArray alloc] init]; + + for ( NSString * allName in dataArray) { + + for (NSString * samString in self.sicksArray) { + + if ([allName isEqualToString:samString]) + { + [samArray addObject:allName]; + }else + { + [difArray addObject:allName]; + } + } + } + + + self.tagList.tags = dataArray; + + [self.tagList.tagButtonList enumerateObjectsUsingBlock:^(UIButton * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + + for (NSString * samString in samArray) { + + if ([obj.currentTitle isEqualToString:samString]) + { + [obj setTitleColor:UIColorHex(#21BEBD) forState:UIControlStateNormal]; + obj.selected = true; + obj.layer.borderColor = UIColorHex(#21BEBD).CGColor; + break; + }else + { + [obj setTitleColor:CFontColor1 forState:UIControlStateNormal]; + obj.selected = false; + obj.layer.borderColor = UIColorHex(#666666).CGColor; + } + + } + + + + }]; + + + NSMutableArray * clickArray = [[NSMutableArray alloc] initWithArray:self.sicksArray]; + + [self.tagList setTagClickHandler:^(ZHTagListView *tagListView, NSString *tagText, NSUInteger index) { + UIButton * btn = tagListView.tagButtonList[index]; + self.reasonString = tagText; + btn.selected = !btn.selected; + if (btn.selected == true) { + [btn setTitleColor:UIColorHex(#21BEBD) forState:UIControlStateNormal]; + btn.selected = true; + btn.layer.borderColor = UIColorHex(#21BEBD).CGColor; + }else + { + [btn setTitleColor:CFontColor1 forState:UIControlStateNormal]; + btn.selected = false; + btn.layer.borderColor = UIColorHex(#666666).CGColor; + } + [clickArray removeAllObjects]; + for (UIButton * seleBtn in tagListView.tagButtonList) { + + if (seleBtn.selected == true) { + + [clickArray addObject:seleBtn.currentTitle]; + + } + + } + self.sicksArray = clickArray; + }]; + } + + +} + + +/* +#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 diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/register/HQRegisterViewController.h b/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/XJDMineViewController.h similarity index 62% rename from DoctorXinjiang/DoctorXinjiang/Project/Login_Register/register/HQRegisterViewController.h rename to DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/XJDMineViewController.h index 02eb0ff..6f0df19 100644 --- a/DoctorXinjiang/DoctorXinjiang/Project/Login_Register/register/HQRegisterViewController.h +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/XJDMineViewController.h @@ -1,5 +1,5 @@ // -// YXRegisterViewController.h +// XJDMineViewController.h // healthQuestion // // Created by xulei on 2022/8/17. @@ -9,7 +9,7 @@ NS_ASSUME_NONNULL_BEGIN -@interface YXRegisterViewController : YXBaseViewController +@interface XJDMineViewController : YXBaseViewController @end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/XJDMineViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/XJDMineViewController.m new file mode 100644 index 0000000..377a9e8 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/XJDMineViewController.m @@ -0,0 +1,412 @@ +// +// XJDMineViewController.m +// healthQuestion +// +// Created by xulei on 2022/8/17. +// + +#import "XJDMineViewController.h" +#import "GraphView.h" +#import "AAChartKit.h" +#import "XJDQuestionStatisticsViewController.h" +#import "XJDStopAnnouncementViewController.h" +#import "XJDUserCenterInfoViewController.h" +#import "XJDModifyPasswordViewController.h" +#import "XJDSchedulingSettingViewController.h" +#import "XJDDoctorInfoModel.h" +#import "XJDworkSetingViewController.h" +#import "XJDStopQuestionSettingVC.h" +#import "XJDHomePageModel.h" +#import "ChatViewController.h" +#import "TUIC2CChatViewController.h" +#import "XJDAboutUsViewController.h" +@interface XJDMineViewController () + +@property (strong, nonatomic) AAChartView * aaChartView; + +@property (strong, nonatomic) AAChartModel * configureAreaChartThreshold; + +@property (nonatomic, strong) UILabel * nameLabel; + +@property (nonatomic, strong) UILabel * workLabel; + +@property (nonatomic, strong) UILabel * hospatilLabel; + +@property (nonatomic, strong) UIImageView * heardImage; + +@property (nonatomic, strong) NSMutableArray * dataArray; + +@end + +@implementation XJDMineViewController + +#pragma mark:懒加载 + +- (NSMutableArray *)dataArray { + + if (!_dataArray) { + _dataArray = [[NSMutableArray alloc] init]; + } + return _dataArray; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + self.isHidenNaviBar = false; + self.view.backgroundColor = UIColorHex(#EFEFEF); + self.navigationItem.title = @"我的"; + [self createUI]; +} + +- (void)viewWillAppear:(BOOL)animated { + + [super viewWillAppear:animated]; + [self docotrUserInfo]; + + +} + +- (void)docotrUserInfo { + + XJDNetAPI * homeApi = [[XJDNetAPI alloc] init:self tag:@"DoctorINFO" NeedToken:@""]; + + [homeApi GetInquireDoctorInfo:nil]; + +} + + +- (void) createUI{ + self.nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(16), kRealValue(19), 100, 20)]; + self.nameLabel.textColor = CFontColor1; + self.nameLabel.font = SYSTEMFONT(21); + self.nameLabel.text = @""; + self.nameLabel.textAlignment = NSTextAlignmentLeft; + [self.view addSubview:self.nameLabel]; + + self.workLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.nameLabel.right + kRealValue(12), kRealValue(25), 100, 13)]; + self.workLabel.textColor = CFontColor1; + self.workLabel.font = SYSTEMFONT(13); + self.workLabel.text = @""; + CGFloat workW = [XJDCommonUtils getLengthFromText:self.workLabel.text andFontSize:13]; + self.workLabel.width = workW; + self.workLabel.textAlignment = NSTextAlignmentLeft; + [self.view addSubview:self.workLabel]; + + self.hospatilLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(15), self.nameLabel.bottom + kRealValue(17), kScreenWidth - kRealValue(65), 20)]; + self.hospatilLabel.textColor = CFontColor1; + self.hospatilLabel.font = SYSTEMFONT(13); + self.hospatilLabel.text = @""; + self.hospatilLabel.textAlignment = NSTextAlignmentLeft; + [self.view addSubview:self.hospatilLabel]; + + self.heardImage = [[UIImageView alloc] initWithFrame:CGRectMake(kScreenWidth - kRealValue(24) - 60, kRealValue(10), 60, 60)]; + self.heardImage.layer.cornerRadius = 30.0; + self.heardImage.layer.masksToBounds = true; + [self.view addSubview:self.heardImage]; + + UIView * toolsView = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(15), self.heardImage.bottom + kRealValue(22), kScreenWidth - kRealValue(30), kRealValue(104))]; + toolsView.backgroundColor = KWhiteColor; + toolsView.layer.cornerRadius = 10; + toolsView.layer.masksToBounds = true; + [self.view addSubview:toolsView]; + [XJDCommonUtils addShadowToView:toolsView]; + + CGFloat mager = (toolsView.width - kRealValue(28) - kRealValue(47) * 4)/3; + + NSArray * array = @[@[@"小助手",@"smallHelp_icon"],@[@"咨询统计",@"questionStatistics_icon"],@[@"排班设置",@"schedulingSeting_icon"],@[@"暂停服务",@"stopHelp_icon"]]; + for (int i = 0; i < array.count; i ++) { + + UIImageView * toolsImg = [[UIImageView alloc] initWithFrame:CGRectMake(kRealValue(14) + (kRealValue(47) + mager) * i , kRealValue(17), kRealValue(47), kRealValue(47))]; + toolsImg.image = [UIImage imageNamed:array[i][1]]; + [toolsView addSubview:toolsImg]; + + UILabel * titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(toolsImg.left-kRealValue(10), toolsImg.bottom + kRealValue(10), toolsImg.width + kRealValue(20), 13)]; + titleLabel.text = array[i][0]; + titleLabel.font = SYSTEMFONT(13); + titleLabel.textColor = CFontColor1; + titleLabel.textAlignment = NSTextAlignmentCenter; + [toolsView addSubview:titleLabel]; + + UIButton * clickBtn = [[UIButton alloc] initWithFrame:CGRectMake(toolsImg.left, kRealValue(17), toolsImg.width, kRealValue(80))]; + clickBtn.tag = 500+ i; + [clickBtn addTarget:self action:@selector(toolsAction:) forControlEvents:UIControlEventTouchUpInside]; + [toolsView addSubview:clickBtn]; + } + + UIView * infoView = [[UIView alloc] initWithFrame:CGRectMake(toolsView.left, toolsView.bottom + kRealValue(10), toolsView.width, kRealValue(150))]; + infoView.backgroundColor = KWhiteColor; + infoView.layer.cornerRadius = 5; + infoView.layer.masksToBounds = true; + [self.view addSubview:infoView]; + [XJDCommonUtils addShadowToView:infoView]; + + UITableView * table = [[UITableView alloc] initWithFrame:CGRectMake(toolsView.left, toolsView.bottom + kRealValue(10), toolsView.width, kRealValue(150))]; + table.delegate = self; + table.dataSource = self; + table.backgroundColor = KWhiteColor; + table.showsVerticalScrollIndicator = false; + table.showsHorizontalScrollIndicator = false; + table.layer.cornerRadius = 5; + table.layer.masksToBounds = true; + table.scrollEnabled = false; + table.separatorStyle = UITableViewCellSeparatorStyleSingleLine; + [self.view addSubview:table]; + [XJDCommonUtils addShadowToView:table]; + + + UIButton * outLoginBtn = [[UIButton alloc] initWithFrame:CGRectMake(kRealValue(48), kScreenHeight - kTabBarHeight - kTopHeight -kRealValue(100) , kScreenWidth - kRealValue(96), kRealValue(40))]; + outLoginBtn.backgroundColor = KWhiteColor; + [outLoginBtn setTitle:@"退出登录" forState:UIControlStateNormal]; + [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 addTarget:self action:@selector(outLoginUserinfo) forControlEvents:UIControlEventTouchUpInside]; + outLoginBtn.layer.borderWidth = 1.0f; + [self.view addSubview:outLoginBtn]; + +} + +- (void)toolsAction:(UIButton *)toolsBtn { + + switch (toolsBtn.tag) { + case 500: + { + XJDNetAPI * homeApi = [[XJDNetAPI alloc] init:self tag:@"FOUNDSMALLAPI" NeedToken:@""]; + [homeApi getHomeFoundSmallHelpData:nil]; + //小助手 + } + break; + case 501: + { + //咨询统计 + XJDQuestionStatisticsViewController * statisVc = [[XJDQuestionStatisticsViewController alloc] init]; + + [self.navigationController pushViewController:statisVc animated:YES]; + + } + break; + case 502: + { + //时间 +// SchedulingSettingViewController * timeVc = [[SchedulingSettingViewController alloc] init]; +// +// [self.navigationController pushViewController:timeVc animated:YES]; + XJDworkSetingViewController * statisVc = [[XJDworkSetingViewController alloc] init]; + + [self.navigationController pushViewController:statisVc animated:YES]; + + } + break; + case 503: + { + //暂停服务 + XJDStopQuestionSettingVC * stopVC = [[XJDStopQuestionSettingVC alloc] init]; + + [self.navigationController pushViewController:stopVC animated:YES]; + } + break; + + default: + break; + } + +} + +#pragma mark - tableview的代理方法 +//组数 +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return 1; +} +//每组多少行 +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return 3; +} + +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { + + return kRealValue(50); + +} +//注册cell +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + + NSArray * array = @[@[@"个人信息设置",@"mainHeard_icon"],@[@"账号安全设置(修改密码)",@"AccountSafety_icon"],@[@"关于我们",@"aboutUS_Icon"]]; + + UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"BILLCELL"]; + + if (!cell) { + + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"BILLCELL"]; + } + cell.backgroundColor = KWhiteColor; + cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; + cell.selectionStyle = UITableViewCellSelectionStyleNone; + cell.imageView.image = [UIImage imageNamed:array[indexPath.row][1]]; + cell.textLabel.text = array[indexPath.row][0]; + cell.textLabel.font = SYSTEMFONT(14); + cell.textLabel.textColor = CFontColor1; + return cell; + +} + + +////cell点击事件 +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + if (indexPath.row == 0) { + + XJDUserCenterInfoViewController * infoVC = [[XJDUserCenterInfoViewController alloc] init]; + + [self.navigationController pushViewController:infoVC animated:YES]; + } + if (indexPath.row == 1) { + + XJDModifyPasswordViewController * modifVC = [[XJDModifyPasswordViewController alloc] init]; + + [self.navigationController pushViewController:modifVC animated:YES]; + + } + if (indexPath.row == 2) { + + XJDAboutUsViewController * aboutVC = [[XJDAboutUsViewController alloc] init]; + + [self.navigationController pushViewController:aboutVC animated:YES]; + } + +} + +- (void)Failed:(NSString*)message tag:(NSString*)tag +{ + [self hiddenAllMBProgressHUD]; + +} + + +- (void)Sucess:(id)response tag:(NSString*)tag +{ + [self hiddenAllMBProgressHUD]; + + + if ([tag isEqualToString:@"DoctorINFO"]) { + + NSDictionary * parDic = response; + + XJDDoctorInfoModel * model = [XJDDoctorInfoModel modelWithDictionary:parDic]; + self.nameLabel.text = model.doctorName; + CGFloat w = [XJDCommonUtils getLengthFromText:self.nameLabel.text andFontSize:21]; + self.nameLabel.width = w; + self.workLabel.text = [NSString stringWithFormat:@"%@",model.doctorTitle] ; + self.workLabel.left = self.nameLabel.right + kRealValue(10); + CGFloat workW = [XJDCommonUtils getLengthFromText:self.workLabel.text andFontSize:13]; + self.workLabel.width = workW; + self.hospatilLabel.text = [NSString stringWithFormat:@"%@ %@",model.resourceName,model.departmentName]; + + NSString * photo = [NSString stringWithFormat:@"%@%@",ResourceAddress,model.photo]; + + NSString * str1 = @"\\"; + + photo = [photo stringByReplacingOccurrencesOfString:str1 withString:@"/"]; + + NSString *encodedString3 = CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)photo, (CFStringRef)@"!$&'()*+,-./:;=?@_~%#[]", NULL, kCFStringEncodingUTF8)); + + [self.heardImage sd_setImageWithURL:[NSURL URLWithString:encodedString3] placeholderImage:[UIImage imageNamed:@"doctorNoImage"]]; + } + if ([tag isEqualToString:@"FOUNDSMALLAPI"]) { + + NSDictionary * responDic = response; + + XJDSmallHelpModel * helpModel = [XJDSmallHelpModel modelWithDictionary:responDic]; + + if ([ESCTUIManager TUIUserStatus] == false) { + + + [self loginImAccount]; + return; + } + + ChatViewController * chatVC = [[ChatViewController alloc] init]; + chatVC.isGroupID = YES; + chatVC.chatID = helpModel.groupId; + chatVC.smallHelp_id = helpModel.help_Id; + chatVC.member = helpModel.member; + chatVC.isVideo = YES; + chatVC.eableSendReport = YES; + chatVC.eableMapTools = false; + chatVC.isVideo = false; + chatVC.navTitle = @"小助手"; + chatVC.eablehaveHelathData = YES; + chatVC.memberSex = @"2"; + [self.navigationController pushViewController:chatVC animated:YES]; + } + if ([tag isEqualToString:@"loginIMAPI"]) { + + NSDictionary * pamrDic = response; + + XJDIMUserInfoModel * model = [XJDIMUserInfoModel modelWithDictionary:pamrDic]; + + XJDIMUserInfoModel * iminfoModel = [[XJDIMUserInfoModel alloc] init]; + iminfoModel.IMInfo = pamrDic; + [XJDCommonUtils 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 的实现类,如果您不需要监听 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]; + + XJDNetAPI * homeApi = [[XJDNetAPI alloc] init:self tag:@"FOUNDSMALLAPI" NeedToken:@""]; + + [homeApi getHomeFoundSmallHelpData:nil]; + } + + +} + +- (void)loginImAccount { + + XJDNetAPI * proctocolApi = [[XJDNetAPI alloc] init:self tag:@"loginIMAPI" NeedToken:nil]; + [proctocolApi GetIMLoginAccount: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) { + [XJDCommonUtils keyedArchiverWithData:nil key:LoginUserInfo]; + [ESCTUIManager outLoginTUISDK]; + KPostNotification(KNotificationLoginStateChange, @NO); + }]; + [alertController addAction:cancelAction]; + [alertController addAction:sureAction]; + + [self presentViewController:alertController animated:YES completion:nil]; +} + +/* +#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 diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/XJDUserCenterInfoViewController.h b/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/XJDUserCenterInfoViewController.h new file mode 100644 index 0000000..9d37f7e --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/XJDUserCenterInfoViewController.h @@ -0,0 +1,16 @@ +// +// XJDUserCenterInfoViewController.h +// healthQuestion +// +// Created by 仁康信息 on 2023/5/6. +// + +#import "YXBaseViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDUserCenterInfoViewController : YXBaseViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/XJDUserCenterInfoViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/XJDUserCenterInfoViewController.m new file mode 100644 index 0000000..28f2b3e --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/XJDUserCenterInfoViewController.m @@ -0,0 +1,631 @@ +// +// XJDUserCenterInfoViewController.m +// healthQuestion +// +// Created by 仁康信息 on 2023/5/6. +// + +#import "XJDUserCenterInfoViewController.h" +#import "XJDCustomDelectedView.h" +#import "UIPlaceHolderTextView.h" +#import "XJDUserAddGoodPopView.h" +#import "XJDDoctorInfoModel.h" +#import "XJDGoodAtSicksViewController.h" + +@interface XJDUserCenterInfoViewController () + +@property (nonatomic, strong) NSMutableArray * customArray; + +@property (nonatomic, strong) NSMutableArray * customDataArray; + +@property (nonatomic, strong) NSMutableArray * sicksArray; + + +@property (nonatomic, copy) NSString *departmentId; +@property (nonatomic, copy) NSString *doctor_Id; + + +@property (nonatomic, strong) UIScrollView * mainScrollView; + +@property (nonatomic, strong) UIPlaceHolderTextView * shanchangTextView; + +@property (nonatomic, strong) UIPlaceHolderTextView * jianjieTextView; + +@property (nonatomic, strong) UIImageView * headImg; + +@property(nonatomic,strong) UIAlertController *sheetVC;//选择框 + +@property (nonatomic, strong) UIView * bingView;//擅长病种 + +@property (nonatomic, strong) UIView * shangView;//个人擅长 + +@property (nonatomic, strong) UILabel * sinceLabel ; + +@property (nonatomic, assign) CGFloat sinceW ; + + +@end + +@implementation XJDUserCenterInfoViewController + + +-(UIAlertController *)sheetVC +{ + + if (!_sheetVC) { + _sheetVC=[UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet]; + + UIAlertAction *takePhoto=[UIAlertAction actionWithTitle:@"拍照" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + [self takePhoto]; + }]; + UIAlertAction *chosePhoto=[UIAlertAction actionWithTitle:@"去相册中选择" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + [self pushImagePickerController]; + }]; + UIAlertAction *cancel=[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) { + }]; + + + + if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) + { + [_sheetVC addAction:takePhoto]; + } + [_sheetVC addAction:chosePhoto]; + [_sheetVC addAction:cancel]; + } + return _sheetVC; + +} + +- (NSMutableArray *)customArray { + + if (!_customArray) { + + _customArray = [[NSMutableArray alloc] init]; + } + + return _customArray; +} + +- (NSMutableArray *)customDataArray { + + if (!_customDataArray) { + + _customDataArray = [[NSMutableArray alloc] init]; + } + + return _customDataArray; +} + +- (NSMutableArray *)sicksArray { + + if (!_sicksArray) { + + _sicksArray = [[NSMutableArray alloc] init]; + } + + return _sicksArray; + +} +- (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 docotrUserInfo]; + +} + +- (void)docotrUserInfo { + + [self showMBProgressHUDWithString:@"数据加载中,请稍候" autoHidden:false]; + XJDNetAPI * homeApi = [[XJDNetAPI alloc] init:self tag:@"DoctorINFO" NeedToken:@""]; + + [homeApi GetInquireDoctorInfo:nil]; + +} + +- (void)createUI { + + UIScrollView * mainScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth,kScreenHeight - kTopHeight - SafetyAreaHeight - 50)]; + self.mainScrollView = mainScrollView; + [self.view addSubview:mainScrollView]; + + UIView * topView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 260)]; + topView.backgroundColor = KWhiteColor; + [mainScrollView addSubview:topView]; + + UILabel * headLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(16), kRealValue(24), 100, 14)]; + headLabel.text = @"头像"; + headLabel.textColor = CFontColor1; + headLabel.font = SYSTEMFONT(14); + headLabel.textAlignment = NSTextAlignmentLeft; + [topView addSubview:headLabel]; + + UIImageView * accowImg = [[UIImageView alloc] initWithFrame:CGRectMake(kScreenWidth - kRealValue(15) - 12, kRealValue(25), 16, 22)]; + accowImg.image = [UIImage imageNamed:@"garyRight"]; + [topView addSubview:accowImg]; + + UIImageView * headImg = [[UIImageView alloc] initWithFrame:CGRectMake(accowImg.left - 57 , kRealValue(8), 45, 45)]; + self.headImg = headImg; + headImg.userInteractionEnabled = true; + [topView addSubview:headImg]; + + UIButton * changeBtn = [[UIButton alloc] initWithFrame:CGRectMake(kScreenWidth - 77, 0, 77, headImg.height)]; + [changeBtn addTarget:self action:@selector(chageUserHeard) forControlEvents:UIControlEventTouchUpInside]; + [topView addSubview:changeBtn]; + + NSArray * titleArray = @[@[@"姓名",@"请输入姓名"],@[@"医院",@"请输入医院名称"],@[@"科室",@"请输入科室"],@[@"职称",@"请输入职称"]]; + for (int i = 0 ; i < titleArray.count; i ++) { + + UIView * lineView = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(14), headImg.bottom + 9 + i * kRealValue(45), kScreenWidth - kRealValue(28), 1)]; + lineView.backgroundColor = UIColorHex(#E0E0E0); + [topView addSubview:lineView]; + + UILabel * leftLabel = [[UILabel alloc] initWithFrame:CGRectMake(headLabel.left, lineView.bottom + kRealValue(15), 100, 14)]; + leftLabel.text = titleArray[i][0] ; + leftLabel.textColor = CFontColor1; + leftLabel.textAlignment = NSTextAlignmentLeft; + leftLabel.font = MEDIUMFONT(14); + [topView addSubview:leftLabel]; + + UITextField * inputField = [[UITextField alloc] initWithFrame:CGRectMake(topView.width - kRealValue(17) - 200, leftLabel.top, 200, 15)]; + inputField.placeholder = titleArray[i][1] ; + inputField.font = SYSTEMFONT(14); + inputField.textAlignment = NSTextAlignmentRight; + inputField.tag = 10 + i; + [topView addSubview:inputField]; + } + //擅长病种 + UIView * bingView = [[UIView alloc] initWithFrame:CGRectMake(0, topView.bottom + kRealValue(10), kScreenWidth, kRealValue(200))]; + bingView.backgroundColor = KWhiteColor; + self.bingView = bingView; + [mainScrollView addSubview:bingView]; + + UILabel * sinceLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(16), kRealValue(24), 55, 14)]; + sinceLabel.text = @"擅长病种"; + sinceLabel.textColor = CFontColor1; + sinceLabel.font = SYSTEMFONT(14); + sinceLabel.textAlignment = NSTextAlignmentLeft; + self.sinceLabel = sinceLabel; + CGFloat sinceW = [XJDCommonUtils getLengthFromText:sinceLabel.text andFontSize:14]; + self.sinceW = sinceW; + sinceLabel.width = sinceW + 10; + [bingView addSubview:sinceLabel]; + + UIButton * addTagBtn = [[UIButton alloc] initWithFrame:CGRectMake(kScreenWidth - kRealValue(10) - kRealValue(50), kRealValue(15), kRealValue(49), kRealValue(27))]; + [addTagBtn setTitle:@"添加" forState:UIControlStateNormal]; + [addTagBtn setTitleColor:UIColorHex(#21BEBD) forState:UIControlStateNormal]; + [addTagBtn setBackgroundColor:KWhiteColor]; + [addTagBtn addTarget:self action:@selector(addUserInfo) forControlEvents:UIControlEventTouchUpInside]; + addTagBtn.layer.borderWidth = 1.0; + addTagBtn.layer.masksToBounds = YES; + addTagBtn.titleLabel.font = SYSTEMFONT(14); + addTagBtn.layer.cornerRadius = 13; + addTagBtn.layer.borderColor = UIColorHex(#21BEBD).CGColor; + [bingView addSubview:addTagBtn]; + + + CGFloat pointX = sinceLabel.right; + CGFloat pointY = 10; + CGFloat allWidth = kScreenWidth-sinceW- 20; + UIFont *titleFont = [UIFont systemFontOfSize:14]; + for(int i = 0; i < self.customDataArray.count; i++) { + +// CGRect rect = [array[i] boundingRectWithSize:CGSizeMake(MAXFLOAT, 25) options:NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName : titleFont} context:nil]; + CGFloat width = 22; + + if (pointX + width > allWidth) {//换行 + pointX = sinceLabel.right;//X从新开始 + pointY += 40;//换行后Y+ + } + XJDCustomDelectedView * custView = [[XJDCustomDelectedView alloc] initWithFrame:CGRectMake(pointX, pointY, width, 25)]; + custView.delectBlock = ^(NSInteger btnTag) { + [self reloadCustomView:btnTag]; + }; + custView.btntag = 100 + i; + pointX += (width + 10);//每次X都加上宽和间距5 + + [bingView addSubview:custView]; + [self.customArray addObject:custView]; + } + UIView * lastView = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(15), sinceLabel.bottom + kRealValue(10), 100, 13)]; + if (self.customArray.count > 0) { + + lastView = [self.customArray lastObject]; + } + bingView.height = lastView.bottom + 20; + + //个人擅长页面 + UIView * shangView = [[UIView alloc] initWithFrame:CGRectMake(0, bingView.bottom, kScreenWidth, kRealValue(500))]; + shangView.backgroundColor = KWhiteColor; + self.shangView = shangView; + [mainScrollView addSubview:shangView]; + + UILabel * gerenLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(16), 0, sinceLabel.width, 14)]; + gerenLabel.text = @"个人擅长"; + gerenLabel.textColor = CFontColor1; + gerenLabel.font = SYSTEMFONT(14); + gerenLabel.textAlignment = NSTextAlignmentLeft; + [shangView addSubview:gerenLabel]; + + self.shanchangTextView = [[UIPlaceHolderTextView alloc] initWithFrame:CGRectMake(kRealValue(14), gerenLabel.bottom + kRealValue(15), kScreenWidth - kRealValue(28), 179)]; + self.shanchangTextView.placeholder = @"请输入个人擅长方向"; + self.shanchangTextView.font = SYSTEMFONT(14); + self.shanchangTextView.backgroundColor = UIColorHex(#EFEFEF); + self.shanchangTextView.layer.cornerRadius = 5; + self.shanchangTextView.layer.masksToBounds = true; + [shangView addSubview:self.shanchangTextView]; + + UILabel * jianjieLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(16), self.shanchangTextView.bottom + kRealValue(23), sinceLabel.width, 14)]; + jianjieLabel.text = @"个人简介"; + jianjieLabel.textColor = CFontColor1; + jianjieLabel.font = MEDIUMFONT(14); + jianjieLabel.textAlignment = NSTextAlignmentLeft; + [shangView addSubview:jianjieLabel]; + + self.jianjieTextView = [[UIPlaceHolderTextView alloc] initWithFrame:CGRectMake(kRealValue(14), jianjieLabel.bottom + kRealValue(15), kScreenWidth - kRealValue(28), 179)]; + self.jianjieTextView.placeholder = @"请输入个人简介"; + self.jianjieTextView.font = SYSTEMFONT(14); + self.jianjieTextView.backgroundColor = UIColorHex(#EFEFEF); + self.jianjieTextView.layer.cornerRadius = 5; + self.jianjieTextView.layer.masksToBounds = true; + [shangView addSubview:self.jianjieTextView]; + + shangView.height = self.jianjieTextView.bottom + kRealValue(33); + + + + + UIButton * saveBtn = [[UIButton alloc] initWithFrame:CGRectMake(kRealValue(47), kScreenHeight - SafetyAreaHeight - kTopHeight - 40, kScreenWidth - kRealValue(94), 40)]; + saveBtn.backgroundColor = KWhiteColor; + saveBtn.layer.cornerRadius = 20.0f; + saveBtn.layer.masksToBounds = true; + [saveBtn setTitle:@"保存" forState:UIControlStateNormal]; + [saveBtn setTitleColor:UIColorHex(#21BEBD) forState:UIControlStateNormal]; + saveBtn.titleLabel.font = SYSTEMFONT(14); + saveBtn.layer.borderColor = UIColorHex(#21BEBD).CGColor; + saveBtn.layer.borderWidth = 1.0f; + [saveBtn addTarget:self action:@selector(saveUserInfo) forControlEvents:UIControlEventTouchUpInside]; + [self.view addSubview:saveBtn]; + mainScrollView.contentSize = CGSizeMake(kScreenWidth, shangView.bottom + SafetyAreaHeight + kRealValue(50)); + +} + +#pragma mark:删除病种 + +- (void)reloadCustomView:(NSInteger)btnTag { + + [self.customDataArray removeObjectAtIndex:btnTag]; + [self.sicksArray removeObjectAtIndex:btnTag]; + [self reloadCenterView:self.customDataArray]; +} + +#pragma marr:更新中间视图 + +- (void)reloadCenterView:(NSMutableArray *)customArray { + + for (XJDCustomDelectedView * cusView in self.customArray) { + + [cusView removeFromSuperview]; + } + + CGFloat pointX = self.sinceLabel.right; + CGFloat pointY = 10; + CGFloat allWidth = kScreenWidth-self.sinceW- 20; + UIFont *titleFont = [UIFont systemFontOfSize:14]; + for(int i = 0; i < customArray.count; i++) { + + CGRect rect = [customArray[i] boundingRectWithSize:CGSizeMake(MAXFLOAT, 25) options:NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName : titleFont} context:nil]; + CGFloat width = rect.size.width +22; + + if (pointX + width > allWidth) {//换行 + pointX = self.sinceLabel.right;//X从新开始 + pointY += 40;//换行后Y+ + } + XJDCustomDelectedView * custView = [[XJDCustomDelectedView alloc] initWithFrame:CGRectMake(pointX, pointY, width, 25)]; + custView.delectBlock = ^(NSInteger btnTag) { + [self reloadCustomView:btnTag]; + }; + custView.btntag = 100 + i; + custView.titleString = customArray[i]; + pointX += (width + 10);//每次X都加上宽和间距5 + + [self.bingView addSubview:custView]; + [self.customArray addObject:custView]; + } + UIView * lastView = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(15), self.sinceLabel.bottom + kRealValue(10), 100, 13)]; + if (self.customArray.count > 0) { + + lastView = [self.customArray lastObject]; + } + self.bingView.height = lastView.bottom + 30; + self.shangView.frame = CGRectMake(0, self.bingView.bottom, kScreenWidth, kRealValue(500)); + self.shangView.height = self.jianjieTextView.bottom + kRealValue(33); + self.mainScrollView.contentSize = CGSizeMake(kScreenWidth, self.shangView.bottom + SafetyAreaHeight + kRealValue(50)); + +} + +#pragma mark:添加擅长病种 +- (void)addUserInfo { + +// userAddGoodPopView * popView = [[userAddGoodPopView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)]; +// MJWeakSelf +// popView.popBlock = ^(NSString * _Nonnull inputString) +// { +// +// [weakSelf.customDataArray addObject:inputString]; +// [weakSelf reloadCenterView:weakSelf.customDataArray]; +// }; +// popView.alpha = 0; +// +// [kAppWindow addSubview:popView]; +// +// [UIView animateWithDuration:0.5 animations:^{ +// popView.alpha = 1; +// }]; + XJDGoodAtSicksViewController * goodVC = [[XJDGoodAtSicksViewController alloc] init]; + goodVC.departmentId = self.departmentId; + goodVC.sicksArray = self.customDataArray; + goodVC.sicksBlock = ^(NSArray * _Nonnull sicksArray) { + [self.customDataArray removeAllObjects]; + [self.sicksArray removeAllObjects]; + + self.sicksArray = sicksArray.mutableCopy; + + for (XJDDoctorGoodSicknessModel * sickModel in sicksArray) { + + [self.customDataArray addObject:sickModel.sicksName]; + [self reloadCenterView:self.customDataArray]; + + } + }; + [self.navigationController pushViewController:goodVC animated:YES]; +} + +#pragma mark:更新头像 +- (void)chageUserHeard { + + [self presentViewController:self.sheetVC animated:YES completion:nil]; + +} + +- (void)pushImagePickerController +{ + UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init]; + imagePickerController.delegate = self; + imagePickerController.allowsEditing = YES; + imagePickerController.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum; + [self presentViewController:imagePickerController animated:YES completion:^{}]; +} + +- (void)takePhoto +{ + // 跳转到相机或相册页面 + UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init]; + imagePickerController.delegate = self; + imagePickerController.allowsEditing = YES; + imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera; + [self presentViewController:imagePickerController animated:YES completion:^{}]; +} + +#pragma mark - image picker delegte +- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info +{ + [picker dismissViewControllerAnimated:YES completion:^{}]; + //先把图片转成NSData + NSString *type = [info objectForKey:UIImagePickerControllerMediaType]; + //当选择的类型是图片 + if ([type isEqualToString:@"public.image"]) + { + //先把图片转成NSData + UIImage* image = [info objectForKey:@"UIImagePickerControllerOriginalImage"]; + + NSData *data; + if (UIImagePNGRepresentation(image) == nil) + { + data = UIImageJPEGRepresentation(image, 1.0); + } + else + { + data = UIImagePNGRepresentation(image); + } + self.headImg.image=image; + + //上传图片 + [self upHeardPhoto]; + + //图片保存的路径 + //这里将图片放在沙盒的documents文件夹中 + NSString * DocumentsPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]; + + //文件管理器 + NSFileManager *fileManager = [NSFileManager defaultManager]; + + //把刚刚图片转换的data对象拷贝至沙盒中 并保存为image.png + [fileManager createDirectoryAtPath:DocumentsPath withIntermediateDirectories:YES attributes:nil error:nil]; + [fileManager createFileAtPath:[DocumentsPath stringByAppendingString:@"/image.png"] contents:data attributes:nil]; + [picker dismissViewControllerAnimated:YES completion:nil ]; + } + + +} +- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker +{ + [self dismissViewControllerAnimated:YES completion:^{}]; +} + +- (void)Failed:(NSString*)message tag:(NSString*)tag +{ + [self hiddenAllMBProgressHUD]; + +} + + +- (void)Sucess:(id)response tag:(NSString*)tag +{ + [self hiddenAllMBProgressHUD]; + + + if ([tag isEqualToString:@"DoctorINFO"]) { + + NSDictionary * parDic = response; + + XJDDoctorInfoModel * model = [XJDDoctorInfoModel modelWithDictionary:parDic]; + self.doctor_Id = model.doctor_Id; + //姓名 + UITextField * nameField = [self.view viewWithTag:10]; + nameField.text = model.doctorName; + //医院 + UITextField * hospitalField = [self.view viewWithTag:11]; + hospitalField.text = model.resourceName; + //科室 + UITextField * roomField = [self.view viewWithTag:12]; + roomField.text = model.departmentName; + //职称 + UITextField * workField = [self.view viewWithTag:13]; + workField.text = model.doctorTitle; + + NSString * photo = [NSString stringWithFormat:@"%@%@",ResourceAddress,model.photo]; + + NSString * str1 = @"\\"; + + photo = [photo stringByReplacingOccurrencesOfString:str1 withString:@"/"]; + + NSString *encodedString3 = CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)photo, (CFStringRef)@"!$&'()*+,-./:;=?@_~%#[]", NULL, kCFStringEncodingUTF8)); + + [self.headImg sd_setImageWithURL:[NSURL URLWithString:encodedString3] placeholderImage:PLACEHOLD_IMG]; + // + [self.customArray removeAllObjects]; + self.sicksArray = model.goodAtSicknessName; + for (XJDDoctorGoodSicknessModel * sickModel in model.goodAtSicknessName) { + [self.customDataArray addObject:sickModel.sicksName]; + [self reloadCenterView:self.customDataArray]; + + } + //个人擅长 + self.shanchangTextView.text = model.goodAt; + //个人简介 + self.jianjieTextView.text = model.introduction; + self.departmentId = model.departmentId; + + } + if ([tag isEqualToString:@"UPLOADAPI"]) + { + NSMutableArray * imageUrlArray = [[NSMutableArray alloc] init]; + + NSArray * array = response; + + [imageUrlArray addObjectsFromArray:array]; + + NSString * headImg ; + for (NSString * imageString in imageUrlArray) { + + headImg = imageString; + } + [self updateUserHeard:headImg]; + } + if ([tag isEqualToString:@"DOCTORINFO"]) { + + [self.navigationController popViewControllerAnimated:YES]; + } + +} + +#pragma mark:上传图片 + +- (void)upHeardPhoto { + + [self showMBProgressHUDWithString:@"上传中" autoHidden:NO]; + + NSMutableArray * photoArray = [[NSMutableArray alloc] init]; + + [photoArray addObject:self.headImg.image]; + + XJDNetAPI * upApi = [[XJDNetAPI alloc] init:self tag:@"UPLOADAPI" NeedToken:@""]; + + [upApi postImageArrayUpload:photoArray]; +} + +#pragma mark:更新头像 + +- (void)updateUserHeard:(NSString *)heardImg { + + NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; + + [parmDic setObject:heardImg forKey:@"avatar"]; + + XJDNetAPI * upApi = [[XJDNetAPI alloc] init:self tag:@"AVATAR" NeedToken:@""]; + + [upApi updateUserAvatar:parmDic]; + +} + +#pragma mark:保存 +- (void)saveUserInfo { + + NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; + + //姓名 + UITextField * nameField = [self.view viewWithTag:10]; + [parmDic setObject:nameField.text forKey:@"doctorName"]; + //医院 + UITextField * hospitalField = [self.view viewWithTag:11]; + [parmDic setObject:hospitalField.text forKey:@"resourceName"]; + //科室 + UITextField * roomField = [self.view viewWithTag:12]; + [parmDic setObject:roomField.text forKey:@"departmentName"]; + //职称 + UITextField * workField = [self.view viewWithTag:13]; + [parmDic setObject:workField.text forKey:@"doctorTitle"]; + //擅长病重 +// for (DoctorGoodSicknessModel * sickModel in self.sicksArray) { +// [self.customDataArray addObject:sickModel.sicksName]; +// [self reloadCenterView:self.customDataArray]; +// } + NSMutableArray * array = [[NSMutableArray alloc] init]; + NSMutableString *resultString = [[NSMutableString alloc] init]; + + for (XJDDoctorGoodSicknessModel * sickMode in self.sicksArray) { + NSMutableDictionary * sickDic = [[NSMutableDictionary alloc] init]; + [sickDic setObject:sickMode.sicks_id forKey:@"id"]; + [sickDic setObject:sickMode.sicksName forKey:@"sicksName"]; + [array addObject:sickDic]; + [resultString appendString:sickMode.sicks_id]; + [resultString appendString:@","]; + // 移除末尾的拼接字符 + + } + //去掉最后符合 + if ([resultString length] > 0) { + [resultString deleteCharactersInRange:NSMakeRange([resultString length] - 1, 1)]; + } + [parmDic setObject:array forKey:@"goodAtSicknessName"]; + //个人简介 + + [parmDic setObject:resultString forKey:@"goodAtSickness"]; + + [parmDic setObject:self.shanchangTextView.text forKey:@"goodAt"]; + + [parmDic setObject:self.jianjieTextView.text forKey:@"introduction"]; + [parmDic setObject:self.departmentId forKey:@"departmentId"]; + [parmDic setObject:self.doctor_Id forKey:@"id"]; + XJDNetAPI * infoApi = [[XJDNetAPI alloc] init:self tag:@"DOCTORINFO" NeedToken:@""]; + + [infoApi postUpdateDoctorInfo:parmDic]; +} + +/* +#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 diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/modifyPassword(修改密码)/XJDModifyPasswordViewController.h b/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/modifyPassword(修改密码)/XJDModifyPasswordViewController.h new file mode 100644 index 0000000..714ac25 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/modifyPassword(修改密码)/XJDModifyPasswordViewController.h @@ -0,0 +1,18 @@ +// +// XJDModifyPasswordViewController.h +// healthQuestion +// +// Created by 仁康信息 on 2023/5/8. +// + +#import "YXBaseViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDModifyPasswordViewController : YXBaseViewController + +@property (nonatomic, copy) NSString * result; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/modifyPassword(修改密码)/XJDModifyPasswordViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/modifyPassword(修改密码)/XJDModifyPasswordViewController.m new file mode 100644 index 0000000..1cf74a7 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/modifyPassword(修改密码)/XJDModifyPasswordViewController.m @@ -0,0 +1,214 @@ +// +// XJDModifyPasswordViewController.m +// healthQuestion +// +// Created by 仁康信息 on 2023/5/8. +// + +#import "XJDModifyPasswordViewController.h" + +#import "XJDLineTextField.h" +#import "RSAObjC.h" +#import "LVKeyboard.h" + +@interface XJDModifyPasswordViewController () + +@property (nonatomic, strong) XJDLineTextField * oldPasswordField; + +@property (nonatomic, strong) XJDLineTextField * nowPasswordField; + +@property (nonatomic, strong) XJDLineTextField * againPasswordField; + +@end + +@implementation XJDModifyPasswordViewController + +- (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, 156)]; + topview.backgroundColor = KWhiteColor; + [self.view addSubview:topview]; + + self.oldPasswordField = [self createTextFieldWithFrame:CGRectMake(kRealValue(16), 0, kScreenWidth - kRealValue(32), 52) withLeftText:@"原密码" isShow:false]; + self.oldPasswordField.placeholder = @"请输入原密码"; + self.oldPasswordField.backgroundColor = KWhiteColor; + self.oldPasswordField.delegate = self; +// [self.oldPasswordField becomeFirstResponder]; + [topview addSubview:self.oldPasswordField]; + + self.nowPasswordField = [self createTextFieldWithFrame:CGRectMake(kRealValue(16), self.oldPasswordField.bottom, kScreenWidth - kRealValue(32), 52) withLeftText:@"新密码" isShow:YES]; + self.nowPasswordField.backgroundColor = KWhiteColor; + self.nowPasswordField.placeholder = @"请输入新密码"; + self.nowPasswordField.delegate = self; + [topview addSubview:self.nowPasswordField]; + + self.againPasswordField = [self createTextFieldWithFrame:CGRectMake(kRealValue(16), self.nowPasswordField.bottom, kScreenWidth - kRealValue(32), 52) withLeftText:@"确认密码" isShow:YES]; + self.againPasswordField.backgroundColor = KWhiteColor; + self.againPasswordField.placeholder = @"再次输入新密码"; + self.againPasswordField.delegate = self; + [topview addSubview:self.againPasswordField]; + + UILabel * showLabel = [[UILabel alloc] initWithFrame:CGRectMake(kRealValue(16), topview.bottom + kRealValue(14), kScreenWidth - kRealValue(32), 40)]; + showLabel.text = @"温馨提示:密码需要为12-32位(包含数字、大写、小写字母、特殊字符)"; + showLabel.textColor = UIColorHex(#999999); + showLabel.font = SYSTEMFONT(13); + showLabel.numberOfLines = 2; + showLabel.textAlignment = NSTextAlignmentLeft; + [self.view addSubview:showLabel]; + + + UIButton * submitBtn = [[UIButton alloc] init]; + submitBtn.backgroundColor = KWhiteColor; + submitBtn.layer.cornerRadius = 20; + submitBtn.layer.borderColor = UIColorHex(#21BEBD).CGColor; + submitBtn.layer.borderWidth = 1.0f; + [submitBtn setTitle:@"提交" forState:UIControlStateNormal]; + [submitBtn setTitleColor:UIColorHex(#21BEBD) forState:UIControlStateNormal]; + [submitBtn addTarget:self action:@selector(submitPasswordAction) forControlEvents:UIControlEventTouchUpInside]; + submitBtn.titleLabel.font = SYSTEMFONT(14); + [self.view addSubview:submitBtn]; + + [submitBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.height.mas_offset(40); + make.left.mas_equalTo(@47); + make.right.mas_offset(-47); + make.top.mas_equalTo(showLabel.mas_bottom).offset(60); + }]; +} + +- (XJDLineTextField *)createTextFieldWithFrame:(CGRect)frame + withLeftText:(NSString *)leftString + isShow:(BOOL)isShow{ + + XJDLineTextField * textField = [[XJDLineTextField alloc] initWithFrame:frame]; + + UIView * leftView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 90, 52)]; + UILabel * leftLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, kRealValue(15), leftView.width, 13)]; + leftLabel.centerY = leftView.centerY; + leftLabel.textColor = CFontColor2; + leftLabel.text = leftString; + leftLabel.textAlignment = NSTextAlignmentLeft; + leftLabel.font = MEDIUMFONT(13); + [leftView addSubview:leftLabel]; + textField.leftView = leftView; + textField.leftViewMode = UITextFieldViewModeAlways; + textField.secureTextEntry = isShow; + + return textField; + +} + +- (void)submitPasswordAction { + + if ( (self.nowPasswordField.text.length >= 33 && self.oldPasswordField.text.length < 12) || (self.againPasswordField.text.length >= 33 && self.againPasswordField.text.length < 12)) { + + [MBProgressHUD showErrorMessage:@"请输入12-32位的密码"]; + return; + + } + + if (!isValidPassword(self.nowPasswordField.text) || !isValidPassword(self.againPasswordField.text)) { + [EasyTextView showErrorText:@"请按照密码规则,请重新输入"]; + return; + } + + if (![self.nowPasswordField.text isEqualToString:self.againPasswordField.text]) { + + [MBProgressHUD showErrorMessage:@"两次输入不一致,请重新输入"]; + return; + } + //username 登录账号 oldpassword 老密码 password 新密码 confirmpassword 二次确认的密码 + XJDUserInfo * user = [XJDCommonUtils keyedUnarchiverWithKey:LoginUserInfo]; + + + NSString * publish_key = @" MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCmZfR/bA9X3vp86y1aEpvwzXJYKRRF1fLau2+05/ZtaITLpV8bhkmSf3neSy/Q9gAdvG75Fr73E+GWE+K5b0BpvIS1jDGo319+PpZR39SaZTKZ27XFXrosmJTZutN79t819HS1VseleunHAFgMVufE9U5jP6LGzl/wbkSy01GhzwIDAQAB"; + + // 原始数据,要加密的字符串 + NSString * oldString = self.oldPasswordField.text; + + // RSA 加密,使用字符串格式的公钥私钥加密解密, RSAPublickKey 为公钥字符串(NSString 格式) + NSString * oldEncryptStr = [RSAObjC encrypt:oldString PublicKey:publish_key]; + NSLog(@"加密后:%@", oldEncryptStr); + + + + NSString * password = self.nowPasswordField.text; + NSString * passwordEncryptStr = [RSAObjC encrypt:password PublicKey:publish_key]; + + NSString * confirmpassword = self.againPasswordField.text; + NSString * confirmEncryptStr = [RSAObjC encrypt:confirmpassword PublicKey:publish_key]; + + NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; + [parmDic setObject:user.username forKey:@"username"]; + [parmDic setObject:oldEncryptStr forKey:@"oldpassword"]; + [parmDic setObject:passwordEncryptStr forKey:@"password"]; + [parmDic setObject:confirmEncryptStr forKey:@"confirmpassword"]; + XJDNetAPI * passwordApi = [[XJDNetAPI alloc] init:self tag:@"PASSWORDAPI" NeedToken:@""]; + [passwordApi updateDoctorLoginPassword:parmDic]; +} + +- (void)Failed:(NSString*)message tag:(NSString*)tag +{ + [EasyTextView showErrorText:message]; + +} + + +- (void)Sucess:(id)response tag:(NSString*)tag +{ + + + if ([tag isEqualToString:@"PASSWORDAPI"]) { + NSString * message = response; + + [EasyTextView showSuccessText:message]; + + + + double delayInSeconds = 2.0; + dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC); + dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ + [self.navigationController popToRootViewControllerAnimated:YES]; + }); + + } +} +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]; +} + +- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { + if ([string isEqualToString:@"!"]) { // 检测是否是中文感叹号 + NSString *newString = [textField.text stringByReplacingCharactersInRange:range withString:@"!"]; // 将其替换为英文感叹号 + textField.text = newString; + return NO; + } + return 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 diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/schedulingSetting(排班设置)/XJDCustomSchedulingViewController.h b/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/schedulingSetting(排班设置)/XJDCustomSchedulingViewController.h new file mode 100644 index 0000000..1e60bba --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/schedulingSetting(排班设置)/XJDCustomSchedulingViewController.h @@ -0,0 +1,16 @@ +// +// XJDCustomSchedulingViewController.h +// healthQuestion +// +// Created by 仁康信息 on 2023/5/9. +// + +#import "YXBaseViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDCustomSchedulingViewController : YXBaseViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/schedulingSetting(排班设置)/XJDCustomSchedulingViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/schedulingSetting(排班设置)/XJDCustomSchedulingViewController.m new file mode 100644 index 0000000..e127655 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/schedulingSetting(排班设置)/XJDCustomSchedulingViewController.m @@ -0,0 +1,73 @@ +// +// XJDCustomSchedulingViewController.m +// healthQuestion +// +// Created by 仁康信息 on 2023/5/9. +// + +#import "XJDCustomSchedulingViewController.h" +#import "XJDCustomSchedulingTable.h" +#import "XJDAddSchedulingTimeTableViewCell.h" + +@interface XJDCustomSchedulingViewController () + +@property (nonatomic, strong) XJDCustomSchedulingTable * homeTable; + +@end + +@implementation XJDCustomSchedulingViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + self.view.backgroundColor = UIColorHex(#EFEFEF); + self.isHidenNaviBar = false; + self.navigationItem.title = @"排班设置"; + [self createUI]; + // Do any additional setup after loading the view. +} + +- (void)createUI { + + UIButton * submitBtn = [[UIButton alloc] init]; + submitBtn.backgroundColor = KWhiteColor; + submitBtn.layer.cornerRadius = 20; + submitBtn.layer.borderColor = UIColorHex(#21BEBD).CGColor; + submitBtn.layer.borderWidth = 1.0f; + [submitBtn setTitle:@"生成排班" forState:UIControlStateNormal]; + [submitBtn setTitleColor:UIColorHex(#21BEBD) forState:UIControlStateNormal]; + [submitBtn addTarget:self action:@selector(submitTimeAction) forControlEvents:UIControlEventTouchUpInside]; + submitBtn.titleLabel.font = SYSTEMFONT(14); + [self.view addSubview:submitBtn]; + + [submitBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(@150); + make.height.mas_offset(34); + make.centerX.mas_equalTo(self.view); + make.bottom.mas_equalTo(@-10); + }]; + + self.homeTable = [[XJDCustomSchedulingTable alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped]; + self.homeTable.backgroundColor = UIColorHex(#EFEFEF); + self.homeTable.addDelegate = self; + [self.view addSubview:self.homeTable]; + + [self.homeTable mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.top.mas_offset(15); + make.right.mas_offset(-15); + make.bottom.mas_equalTo(submitBtn.mas_top).offset(-15); + }]; + + +} + +/* +#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 diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/schedulingSetting(排班设置)/XJDSchedulingSettingViewController.h b/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/schedulingSetting(排班设置)/XJDSchedulingSettingViewController.h new file mode 100644 index 0000000..7865884 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/schedulingSetting(排班设置)/XJDSchedulingSettingViewController.h @@ -0,0 +1,16 @@ +// +// XJDSchedulingSettingViewController.h +// healthQuestion +// +// Created by 仁康信息 on 2023/5/8. +// + +#import "YXBaseViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDSchedulingSettingViewController : YXBaseViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/schedulingSetting(排班设置)/XJDSchedulingSettingViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/schedulingSetting(排班设置)/XJDSchedulingSettingViewController.m new file mode 100644 index 0000000..b9565e2 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/controller/schedulingSetting(排班设置)/XJDSchedulingSettingViewController.m @@ -0,0 +1,133 @@ +// +// XJDSchedulingSettingViewController.m +// healthQuestion +// +// Created by 仁康信息 on 2023/5/8. +// + +#import "XJDSchedulingSettingViewController.h" +#import "XJDSchedulingSetingTable.h" +#import "XJDSchedulingSettingModel.h" +#import "XJDAddSchedulingTimeTableViewCell.h" +#import "XJDTTestView.h" +#import "XJDCustomSchedulingViewController.h" + +@interface XJDSchedulingSettingViewController () + +@property (nonatomic, strong) XJDSchedulingSetingTable * homeTable; + +@end + +@implementation XJDSchedulingSettingViewController + +- (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]; + [self createData]; +} + +- (void)createUI { + + UIButton * customBtn = [[UIButton alloc] init]; + customBtn.backgroundColor = KClearColor; + [customBtn setTitle:@"自定义排班" forState:UIControlStateNormal]; + [customBtn setTitleColor:UIColorHex(#21BEBD) forState:UIControlStateNormal]; + [customBtn addTarget:self action:@selector(customAction) forControlEvents:UIControlEventTouchUpInside]; + customBtn.titleLabel.font = SYSTEMFONT(14); + [self.view addSubview:customBtn]; + + [customBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.height.mas_offset(40); + make.left.mas_equalTo(@113); + make.right.mas_offset(-133); + make.bottom.mas_equalTo(-20); + }]; + + + UIButton * submitBtn = [[UIButton alloc] init]; + submitBtn.backgroundColor = KWhiteColor; + submitBtn.layer.cornerRadius = 20; + submitBtn.layer.borderColor = UIColorHex(#21BEBD).CGColor; + submitBtn.layer.borderWidth = 1.0f; + [submitBtn setTitle:@"生成排班" forState:UIControlStateNormal]; + [submitBtn setTitleColor:UIColorHex(#21BEBD) forState:UIControlStateNormal]; + [submitBtn addTarget:self action:@selector(submitTimeAction) forControlEvents:UIControlEventTouchUpInside]; + submitBtn.titleLabel.font = SYSTEMFONT(14); + [self.view addSubview:submitBtn]; + + [submitBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.height.width.left.right.mas_equalTo(customBtn); + make.bottom.mas_equalTo(customBtn.mas_top).offset(-10); + }]; + + + + self.homeTable = [[XJDSchedulingSetingTable alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped]; + self.homeTable.backgroundColor = UIColorHex(#EFEFEF); + self.homeTable.addDelegate = self; + [self.view addSubview:self.homeTable]; + + [self.homeTable mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.top.mas_offset(15); + make.right.mas_offset(-15); + make.bottom.mas_equalTo(submitBtn.mas_top).offset(-15); + }]; + + + +} + +- (void)createData { + + NSArray * dataArray = @[@{@"time":@"08:00-12:00",@"isSelected":@NO},@{@"time":@"08:00-12:00",@"isSelected":@YES},@{@"time":@"08:00-12:00",@"isSelected":@NO}]; + + NSMutableArray * timeArray = [[NSMutableArray alloc] init]; + + for (NSDictionary * parDic in dataArray) { + + XJDSchedulingSettingModel * model = [XJDSchedulingSettingModel modelWithDictionary:parDic]; + + [timeArray addObject:model]; + } +// [timeArray removeAllObjects]; + self.homeTable.timeArray = timeArray; +} +#pragma mark:新增时间段 +- (void)addSchedulingTime { + + XJDTTestView *vi = [[XJDTTestView alloc]initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)]; + [kAppWindow addSubview:vi]; + vi.returnBlock = ^(NSString *startTime, NSString *endTime) { + NSLog(@"开始时间 = %@", startTime); + NSLog(@"结束时间 = %@", endTime); + + }; + +} + +- (void)submitTimeAction { + + +} + +- (void)customAction { + + XJDCustomSchedulingViewController * customvc = [[XJDCustomSchedulingViewController alloc] init]; + + [self.navigationController pushViewController:customvc 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 diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/model/HQMineModel.h b/DoctorXinjiang/DoctorXinjiang/Project/Mine/model/HQMineModel.h deleted file mode 100644 index a05da04..0000000 --- a/DoctorXinjiang/DoctorXinjiang/Project/Mine/model/HQMineModel.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// HQMineModel.h -// healthQuestion -// -// Created by 仁康信息 on 2022/9/9. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface HQMineModel : NSObject - - -@end - -NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/model/HQMineModel.m b/DoctorXinjiang/DoctorXinjiang/Project/Mine/model/HQMineModel.m deleted file mode 100644 index 6850ec1..0000000 --- a/DoctorXinjiang/DoctorXinjiang/Project/Mine/model/HQMineModel.m +++ /dev/null @@ -1,12 +0,0 @@ -// -// HQMineModel.m -// healthQuestion -// -// Created by 仁康信息 on 2022/9/9. -// - -#import "HQMineModel.h" - -@implementation HQMineModel - -@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/model/XJDBillListModel.h b/DoctorXinjiang/DoctorXinjiang/Project/Mine/model/XJDBillListModel.h new file mode 100644 index 0000000..17572c8 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/model/XJDBillListModel.h @@ -0,0 +1,40 @@ +// +// YXBillListModel.h +// healthQuestion +// +// Created by 仁康信息 on 2023/8/17. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface YXBillListDetailModel : NSObject + +@property (nonatomic, copy) NSString * bill_id; +@property (nonatomic, copy) NSString * sessionId; +@property (nonatomic, copy) NSString * userId; +@property (nonatomic, copy) NSString * userName; +@property (nonatomic, copy) NSString * operateType; +@property (nonatomic, copy) NSString * operateType_dictText; +@property (nonatomic, copy) NSString * incomeTime; +@property (nonatomic, copy) NSString * accountMoney; +@property (nonatomic, copy) NSString * income; +@property (nonatomic, copy) NSString * waterType; +@property (nonatomic, copy) NSString * operateTypeName; +@property (nonatomic, copy) NSString * createTime; + +@end + + +@interface XJDBillListModel : NSObject + +@property (nonatomic, copy) NSArray * records; +@property (nonatomic, copy) NSString * optimizeCountSql; +@property (nonatomic, copy) NSString * searchCount; +@property (nonatomic, copy) NSString * total; + + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/model/XJDBillListModel.m b/DoctorXinjiang/DoctorXinjiang/Project/Mine/model/XJDBillListModel.m new file mode 100644 index 0000000..05d410a --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/model/XJDBillListModel.m @@ -0,0 +1,32 @@ +// +// XJDBillListModel.m +// healthQuestion +// +// Created by 仁康信息 on 2023/8/17. +// + +#import "XJDBillListModel.h" + +@implementation YXBillListDetailModel + + ++ (NSDictionary *)modelCustomPropertyMapper +{ + NSDictionary * dic =@{@"bill_id" :@"id"}; + return dic; +} + +@end + +@implementation XJDBillListModel + ++ (NSDictionary *)modelContainerPropertyGenericClass +{ + + + return @{@"records":[YXBillListDetailModel class], + }; + +} + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/model/XJDSchedulingSettingModel.h b/DoctorXinjiang/DoctorXinjiang/Project/Mine/model/XJDSchedulingSettingModel.h new file mode 100644 index 0000000..f2f1c5f --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/model/XJDSchedulingSettingModel.h @@ -0,0 +1,20 @@ +// +// XJDSchedulingSettingModel.h +// healthQuestion +// +// Created by 仁康信息 on 2023/5/8. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDSchedulingSettingModel : NSObject + +@property (nonatomic, copy) NSString * time; + +@property (nonatomic, assign) BOOL isSelected; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/model/XJDSchedulingSettingModel.m b/DoctorXinjiang/DoctorXinjiang/Project/Mine/model/XJDSchedulingSettingModel.m new file mode 100644 index 0000000..80e0d4e --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/model/XJDSchedulingSettingModel.m @@ -0,0 +1,12 @@ +// +// XJDSchedulingSettingModel.m +// healthQuestion +// +// Created by 仁康信息 on 2023/5/8. +// + +#import "XJDSchedulingSettingModel.h" + +@implementation XJDSchedulingSettingModel + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/model/YXSchedulingSettingModel.m b/DoctorXinjiang/DoctorXinjiang/Project/Mine/model/YXSchedulingSettingModel.m deleted file mode 100644 index 6b6cfe1..0000000 --- a/DoctorXinjiang/DoctorXinjiang/Project/Mine/model/YXSchedulingSettingModel.m +++ /dev/null @@ -1,12 +0,0 @@ -// -// YXSchedulingSettingModel.m -// healthQuestion -// -// Created by 仁康信息 on 2023/5/8. -// - -#import "YXSchedulingSettingModel.h" - -@implementation YXSchedulingSettingModel - -@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/CustomScheduling(自定义排班)/CustomSchedulingTable.h b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/CustomScheduling(自定义排班)/CustomSchedulingTable.h deleted file mode 100644 index 11155ad..0000000 --- a/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/CustomScheduling(自定义排班)/CustomSchedulingTable.h +++ /dev/null @@ -1,28 +0,0 @@ -// -// YXCustomSchedulingTable.h -// healthQuestion -// -// Created by 仁康信息 on 2023/5/9. -// - -#import -#import "YXSectionOneTableViewCell.h" -#import "YXTimeDisanceTableViewCell.h" -#import "YXAddSchedulingTimeTableViewCell.h" -#import "YXVideoAudioTableViewCell.h" -#import "YXSchedulingDateTableViewCell.h" -#import "YXJumpHolidayTableViewCell.h" -#import "WeakTitleTableViewCell.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface YXCustomSchedulingTable : UITableView - -@property (nonatomic, strong) NSArray * timeArray; - -@property (nonatomic, weak)id addDelegate; - - -@end - -NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/CustomScheduling(自定义排班)/XJDCustomSchedulingTable.h b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/CustomScheduling(自定义排班)/XJDCustomSchedulingTable.h new file mode 100644 index 0000000..32d3bf8 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/CustomScheduling(自定义排班)/XJDCustomSchedulingTable.h @@ -0,0 +1,28 @@ +// +// XJDCustomSchedulingTable.h +// healthQuestion +// +// Created by 仁康信息 on 2023/5/9. +// + +#import +#import "XJDSectionOneTableViewCell.h" +#import "XJDTimeDisanceTableViewCell.h" +#import "XJDAddSchedulingTimeTableViewCell.h" +#import "XJDVideoAudioTableViewCell.h" +#import "XJDSchedulingDateTableViewCell.h" +#import "XJDJumpHolidayTableViewCell.h" +#import "XJDWeakTitleTableViewCell.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDCustomSchedulingTable : UITableView + +@property (nonatomic, strong) NSArray * timeArray; + +@property (nonatomic, weak)id addDelegate; + + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/CustomScheduling(自定义排班)/XJDCustomSchedulingTable.m b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/CustomScheduling(自定义排班)/XJDCustomSchedulingTable.m new file mode 100644 index 0000000..731bb67 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/CustomScheduling(自定义排班)/XJDCustomSchedulingTable.m @@ -0,0 +1,305 @@ +// +// XJDCustomSchedulingTable.m +// healthQuestion +// +// Created by 仁康信息 on 2023/5/9. +// + +#import "XJDCustomSchedulingTable.h" + + +@interface XJDCustomSchedulingTable () + + +@end + + +@implementation XJDCustomSchedulingTable + + +- (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 setSeparatorColor:KWhiteColor]; + self.rowHeight = UITableViewAutomaticDimension; + +} + +- (void)setTimeArray:(NSArray *)timeArray { + + _timeArray = timeArray; + + [self reloadData]; + +} + +#pragma mark - tableview的代理方法 +//组数 +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return 3; +} +//每组多少行 +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + + if (section == 0 ) { + + return self.timeArray.count + 4; + } + if (section == 1) { + + return 3; + } + + return 1; +} +//注册cell +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + + if (indexPath.section == 0) { + + if (indexPath.row == 0) { + XJDSectionOneTableViewCell * cell = [self dequeueReusableCellWithIdentifier:@"SECTIONONE"]; + if (!cell) { + + cell = [[XJDSectionOneTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"SECTIONONE"]; + } + cell.backgroundColor = KWhiteColor; + cell.sectionTitle = @"选择时间"; + cell.isShow = true; + cell.selectionStyle = UITableViewCellSelectionStyleNone; + return cell; + } + if (indexPath.row == 1) { + + XJDWeakTitleTableViewCell * weekCell = [self dequeueReusableCellWithIdentifier:@"WEEKEDCELL"]; + if (!weekCell) { + + weekCell = [[XJDWeakTitleTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"WEEKEDCELL"]; + } + weekCell.backgroundColor = KWhiteColor; + weekCell.selectionStyle = UITableViewCellSelectionStyleNone; + return weekCell; + + } + if (indexPath.row == 2) { + + XJDSectionOneTableViewCell * cell = [self dequeueReusableCellWithIdentifier:@"SECTIONONE"]; + if (!cell) { + + cell = [[XJDSectionOneTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"SECTIONONE"]; + } + cell.backgroundColor = KWhiteColor; + cell.sectionTitle = @"在线时间"; + cell.isShow = true; + cell.selectionStyle = UITableViewCellSelectionStyleNone; + return cell; + } + else if ( indexPath.row >2 && indexPath.row <= self.timeArray.count ) { + + XJDTimeDisanceTableViewCell * timeCell = [self dequeueReusableCellWithIdentifier:@"TIMECELL"]; + if (!timeCell) { + + timeCell = [[XJDTimeDisanceTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"TIMECELL"]; + } + timeCell.model = self.timeArray[indexPath.row - 1]; + timeCell.backgroundColor = KWhiteColor; + timeCell.selectionStyle = UITableViewCellSelectionStyleNone; + return timeCell; + + }else { + XJDAddSchedulingTimeTableViewCell * addCell = [self dequeueReusableCellWithIdentifier:@"ADDCELL"]; + if (!addCell) { + + addCell = [[XJDAddSchedulingTimeTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"ADDCELL"]; + } + addCell.addDelegate = self.addDelegate; + addCell.backgroundColor = KWhiteColor; + addCell.selectionStyle = UITableViewCellSelectionStyleNone; + return addCell; + + } + + } + if (indexPath.section == 1) { + + if (indexPath.row == 0) { + XJDSectionOneTableViewCell * cell = [self dequeueReusableCellWithIdentifier:@"SECTIIONTWO"]; + if (!cell) { + + cell = [[XJDSectionOneTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"SECTIIONTWO"]; + } + cell.sectionTitle = @"视频咨询"; + cell.isShow = false; + cell.backgroundColor = KWhiteColor; + cell.selectionStyle = UITableViewCellSelectionStyleNone; + return cell; + }else { + + XJDVideoAudioTableViewCell * videoCell = [self dequeueReusableCellWithIdentifier:@"VIDEOCELL"]; + if (!videoCell) { + + videoCell = [[XJDVideoAudioTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"VIDEOCELL"]; + } + videoCell.backgroundColor = KWhiteColor; + if (indexPath.row == 1) { videoCell.leftString = @"上午"; } + if (indexPath.row == 2) { videoCell.leftString = @"下午"; } + videoCell.selectionStyle = UITableViewCellSelectionStyleNone; + return videoCell; + } + } + + if (indexPath.section == 2) { + + XJDJumpHolidayTableViewCell * jumpcell = [self dequeueReusableCellWithIdentifier:@"JUMPCELL"]; + if (!jumpcell) { + + jumpcell = [[XJDJumpHolidayTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"JUMPCELL"]; + } + jumpcell.backgroundColor = KWhiteColor; + jumpcell.selectionStyle = UITableViewCellSelectionStyleNone; + return jumpcell; + } + + return UITableViewCell.new; + + +} +//每行高度 +//- (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; +} + + +////cell点击事件 +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + + +} + +-(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 + + + diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/CustomScheduling(自定义排班)/YXWeakTitleTableViewCell.h b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/CustomScheduling(自定义排班)/XJDWeakTitleTableViewCell.h similarity index 63% rename from DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/CustomScheduling(自定义排班)/YXWeakTitleTableViewCell.h rename to DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/CustomScheduling(自定义排班)/XJDWeakTitleTableViewCell.h index 57da7d9..2d867c3 100644 --- a/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/CustomScheduling(自定义排班)/YXWeakTitleTableViewCell.h +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/CustomScheduling(自定义排班)/XJDWeakTitleTableViewCell.h @@ -1,5 +1,5 @@ // -// YXWeakTitleTableViewCell.h +// XJDWeakTitleTableViewCell.h // healthQuestion // // Created by 仁康信息 on 2023/5/9. @@ -9,7 +9,7 @@ NS_ASSUME_NONNULL_BEGIN -@interface YXWeakTitleTableViewCell : UITableViewCell +@interface XJDWeakTitleTableViewCell : UITableViewCell @end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/CustomScheduling(自定义排班)/XJDWeakTitleTableViewCell.m b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/CustomScheduling(自定义排班)/XJDWeakTitleTableViewCell.m new file mode 100644 index 0000000..b6f4fab --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/CustomScheduling(自定义排班)/XJDWeakTitleTableViewCell.m @@ -0,0 +1,65 @@ +// +// XJDWeakTitleTableViewCell.m +// healthQuestion +// +// Created by 仁康信息 on 2023/5/9. +// + +#import "XJDWeakTitleTableViewCell.h" + +@implementation XJDWeakTitleTableViewCell + +- (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 * weekedArray = @[@"周一",@"周二",@"周三",@"周四",@"周五",@"周六",@"周天"]; + + CGFloat w = (kScreenWidth - 46 )/ 7; + + UIButton * lastBtn; + for (int i = 0; i < weekedArray.count; i ++) { + + UIButton * weekendBtn = [[UIButton alloc] init]; + [weekendBtn setTitle:weekedArray[i] forState:UIControlStateNormal]; + weekendBtn.titleLabel.font = MEDIUMFONT(13); + [weekendBtn setTitleColor:KWhiteColor forState:UIControlStateSelected]; + [weekendBtn setTitleColor:CFontColor1 forState:UIControlStateNormal]; + + [self.contentView addSubview:weekendBtn]; + + [weekendBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.mas_offset(w); + make.height.mas_offset(45); + make.top.mas_offset(2); + make.left.equalTo (lastBtn ? lastBtn.mas_right: @17); + make.bottom.equalTo (@-10); + }]; + lastBtn = weekendBtn; + if (i == 0) { + + weekendBtn.selected = true; + } + + } + +} +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/YXAddSchedulingTimeTableViewCell.h b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDAddSchedulingTimeTableViewCell.h similarity index 74% rename from DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/YXAddSchedulingTimeTableViewCell.h rename to DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDAddSchedulingTimeTableViewCell.h index 8b79015..83a8e2c 100644 --- a/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/YXAddSchedulingTimeTableViewCell.h +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDAddSchedulingTimeTableViewCell.h @@ -1,5 +1,5 @@ // -// YXAddSchedulingTimeTableViewCell.h +// XJDAddSchedulingTimeTableViewCell.h // healthQuestion // // Created by 仁康信息 on 2023/5/8. @@ -15,7 +15,7 @@ NS_ASSUME_NONNULL_BEGIN @end -@interface YXAddSchedulingTimeTableViewCell : UITableViewCell +@interface XJDAddSchedulingTimeTableViewCell : UITableViewCell @property (nonatomic, weak)id addDelegate; diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDAddSchedulingTimeTableViewCell.m b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDAddSchedulingTimeTableViewCell.m new file mode 100644 index 0000000..bb47e83 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDAddSchedulingTimeTableViewCell.m @@ -0,0 +1,64 @@ +// +// XJDAddSchedulingTimeTableViewCell.m +// healthQuestion +// +// Created by 仁康信息 on 2023/5/8. +// + +#import "XJDAddSchedulingTimeTableViewCell.h" + +@implementation XJDAddSchedulingTimeTableViewCell + +- (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 { + + UIButton * addBtn = [[UIButton alloc] init]; + + [addBtn setTitle:@" 新增时间段" forState:UIControlStateNormal]; + [addBtn setTitleColor:UIColorHex(#21BEBD) forState:UIControlStateNormal]; + addBtn.titleLabel.font = SYSTEMFONT(14); + [addBtn setImage:[UIImage imageNamed:@"addQuestionPeople"] forState:UIControlStateNormal]; + [addBtn addTarget:self action:@selector(addQuestionTime) forControlEvents:UIControlEventTouchUpInside]; + [self.contentView addSubview:addBtn]; + + [addBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.mas_offset(0); + make.top.mas_offset(10); + make.height.mas_offset(30); + make.bottom.mas_offset(-10); + }]; +} + +- (void)addQuestionTime { + + if ([self.addDelegate respondsToSelector:@selector(addSchedulingTime)]) { + + [self.addDelegate addSchedulingTime]; + } + +} + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/YXJumpHolidayTableViewCell.h b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDJumpHolidayTableViewCell.h similarity index 62% rename from DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/YXJumpHolidayTableViewCell.h rename to DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDJumpHolidayTableViewCell.h index c443768..862924e 100644 --- a/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/YXJumpHolidayTableViewCell.h +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDJumpHolidayTableViewCell.h @@ -1,5 +1,5 @@ // -// YXJumpHolidayTableViewCell.h +// XJDJumpHolidayTableViewCell.h // healthQuestion // // Created by 仁康信息 on 2023/5/8. @@ -9,7 +9,7 @@ NS_ASSUME_NONNULL_BEGIN -@interface YXJumpHolidayTableViewCell : UITableViewCell +@interface XJDJumpHolidayTableViewCell : UITableViewCell @end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDJumpHolidayTableViewCell.m b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDJumpHolidayTableViewCell.m new file mode 100644 index 0000000..b1fc19b --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDJumpHolidayTableViewCell.m @@ -0,0 +1,82 @@ +// +// XJDJumpHolidayTableViewCell.m +// healthQuestion +// +// Created by 仁康信息 on 2023/5/8. +// + +#import "XJDJumpHolidayTableViewCell.h" + + +@interface XJDJumpHolidayTableViewCell () + +@property (nonatomic, strong) UILabel * sectionLabel; + +@property (nonatomic, strong) UISwitch * rightSlider; + +@end + + +@implementation XJDJumpHolidayTableViewCell + +- (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.sectionLabel = [[UILabel alloc] init]; + self.sectionLabel.textColor = CFontColor1; + self.sectionLabel.text = @"自动跳过法定节假日?"; + self.sectionLabel.font = MEDIUMFONT(14); + self.sectionLabel.textAlignment = NSTextAlignmentLeft; + [self.contentView addSubview:self.sectionLabel]; + + [self.sectionLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_offset(15); + make.top.height.mas_offset(15); + make.width.mas_offset(200); + make.bottom.mas_offset(-20); + }]; + + self.rightSlider = [[UISwitch alloc] init]; + [self.rightSlider setOn:YES animated:YES]; + [self.rightSlider setOnTintColor: UIColorHex(#59D5D4)]; + self.rightSlider.transform = CGAffineTransformMakeScale(0.6, 0.6); + [self.rightSlider addTarget:self action:@selector(switchChange:) forControlEvents:UIControlEventValueChanged]; + [self.contentView addSubview:self.rightSlider]; + + [self.rightSlider mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.mas_offset(-15); + make.top.mas_offset(15); + make.height.mas_offset(17); + make.bottom.mas_offset(-20); + }]; +} + +- (void) switchChange:(UISwitch*)sw { + if(sw.on == YES) { + NSLog(@"开关切换为开"); + } else if(sw.on == NO) { + NSLog(@"开关切换为关"); + } +} + + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDSchedulingDateTableViewCell.h b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDSchedulingDateTableViewCell.h new file mode 100644 index 0000000..c598e1c --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDSchedulingDateTableViewCell.h @@ -0,0 +1,17 @@ +// +// XJDSchedulingDateTableViewCell.h +// healthQuestion +// +// Created by 仁康信息 on 2023/5/8. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDSchedulingDateTableViewCell : UITableViewCell + +@property (nonatomic, copy) NSString * weekString; +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDSchedulingDateTableViewCell.m b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDSchedulingDateTableViewCell.m new file mode 100644 index 0000000..b127d0d --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDSchedulingDateTableViewCell.m @@ -0,0 +1,150 @@ +// +// XJDSchedulingDateTableViewCell.m +// healthQuestion +// +// Created by 仁康信息 on 2023/5/8. +// + +#import "XJDSchedulingDateTableViewCell.h" + +@interface XJDSchedulingDateTableViewCell () + +@property (nonatomic, strong) UIButton * leftBtn; + +@property (nonatomic, strong) UIButton * centerBtn; + +@property (nonatomic, strong) UIButton * rightBtn; + +@property (nonatomic, strong) NSMutableArray * buttonArray; +@end + +@implementation XJDSchedulingDateTableViewCell + +- (NSMutableArray *)buttonArray { + + if (!_buttonArray) { + + _buttonArray = [[NSMutableArray alloc] init]; + } + return _buttonArray; +} + +- (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 { + + UIView * backView = [[UIView alloc] init]; + backView.backgroundColor = UIColorHex(#E0E0E0); + backView.layer.cornerRadius = 18; + backView.layer.masksToBounds = true; + [self.contentView addSubview:backView]; + + [backView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_offset(15); + make.right.mas_offset(-15); + make.height.mas_offset(35); + make.top.mas_offset(0); + make.bottom.mas_offset(-10); + }]; + + self.leftBtn = [[UIButton alloc] init]; + [self.leftBtn setTitle:@"周一" forState:UIControlStateNormal]; + [self.leftBtn setImage:[UIImage imageNamed:@"square_nomal"] forState:UIControlStateNormal]; + [self.leftBtn setImage:[UIImage imageNamed:@"square_selected"] forState:UIControlStateSelected]; + [self.leftBtn setTitleColor:CFontColor1 forState:UIControlStateNormal]; + self.leftBtn.titleLabel.font = SYSTEMFONT(13); + [self.leftBtn addTarget:self action:@selector(weakButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + [backView addSubview:self.leftBtn]; + + [self.leftBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.bottom.mas_offset(0); + make.width.mas_offset(100); + make.height.mas_equalTo(backView); + }]; + + self.centerBtn = [[UIButton alloc] init]; + [self.centerBtn setTitle:@" 上午" forState:UIControlStateNormal]; + [self.centerBtn setImage:[UIImage imageNamed:@"square_nomal"] forState:UIControlStateNormal]; + [self.centerBtn setImage:[UIImage imageNamed:@"square_selected"] forState:UIControlStateSelected]; + [self.centerBtn setTitleColor:CFontColor1 forState:UIControlStateNormal]; + self.centerBtn.titleLabel.font = SYSTEMFONT(13); + [self.centerBtn addTarget:self action:@selector(morningButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + + [backView addSubview:self.centerBtn]; + + [self.centerBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.bottom.mas_offset(0); + make.width.mas_offset(100); + make.centerX.mas_equalTo(backView); + }]; + + self.rightBtn = [[UIButton alloc] init]; + [self.rightBtn setTitle:@" 下午" forState:UIControlStateNormal]; + [self.rightBtn setImage:[UIImage imageNamed:@"square_nomal"] forState:UIControlStateNormal]; + [self.rightBtn setImage:[UIImage imageNamed:@"square_selected"] forState:UIControlStateSelected]; + [self.rightBtn setTitleColor:CFontColor1 forState:UIControlStateNormal]; + self.rightBtn.titleLabel.font = SYSTEMFONT(13); + [self.rightBtn addTarget:self action:@selector(afternoonButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + [backView addSubview:self.rightBtn]; + + [self.rightBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.bottom.mas_offset(0); + make.width.mas_offset(100); + make.right.mas_offset(-10); + }]; + + +} + +- (void)setWeekString:(NSString *)weekString { + + _weekString = weekString; + + + [self.leftBtn setTitle:_weekString forState:UIControlStateNormal]; + +} + +- (void)weakButtonAction:(UIButton *)weakBtn { + + weakBtn.selected = !weakBtn.selected; + + self.centerBtn.selected = weakBtn.selected; + self.rightBtn.selected = weakBtn.selected; +} + +- (void)morningButtonAction:(UIButton *)morningBtn { + + morningBtn.selected = !morningBtn.selected; + if (morningBtn.selected) { + self.leftBtn.selected = YES; + } +} + +- (void)afternoonButtonAction:(UIButton *)afterBtn { + + afterBtn.selected = !afterBtn.selected; + if (afterBtn.selected) { + self.leftBtn.selected = YES; + } +} + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDSchedulingSetingTable.h b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDSchedulingSetingTable.h new file mode 100644 index 0000000..17a5465 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDSchedulingSetingTable.h @@ -0,0 +1,27 @@ +// +// XJDSchedulingSetingTable.h +// healthQuestion +// +// Created by 仁康信息 on 2023/5/8. +// + +#import +#import "XJDSectionOneTableViewCell.h" +#import "XJDTimeDisanceTableViewCell.h" +#import "XJDAddSchedulingTimeTableViewCell.h" +#import "XJDVideoAudioTableViewCell.h" +#import "XJDSchedulingDateTableViewCell.h" +#import "XJDJumpHolidayTableViewCell.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDSchedulingSetingTable : UITableView + +@property (nonatomic, strong) NSArray * timeArray; + +@property (nonatomic, weak)id addDelegate; + + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDSchedulingSetingTable.m b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDSchedulingSetingTable.m new file mode 100644 index 0000000..ba71939 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDSchedulingSetingTable.m @@ -0,0 +1,308 @@ +// +// XJDSchedulingSetingTable.m +// healthQuestion +// +// Created by 仁康信息 on 2023/5/8. +// + +#import "XJDSchedulingSetingTable.h" + + +@interface XJDSchedulingSetingTable () + + +@end + + +@implementation XJDSchedulingSetingTable + + +- (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 setSeparatorColor:KWhiteColor]; + self.rowHeight = UITableViewAutomaticDimension; + +} + +- (void)setTimeArray:(NSArray *)timeArray { + + _timeArray = timeArray; + + [self reloadData]; + +} + +#pragma mark - tableview的代理方法 +//组数 +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return 4; +} +//每组多少行 +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + + if (section == 0 ) { + + return self.timeArray.count + 2; + } + if (section == 1) { + + return 3; + } + if (section == 2) { + + return 8; + } + return 1; +} +//注册cell +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + + if (indexPath.section == 0) { + + if (indexPath.row == 0) { + XJDSectionOneTableViewCell * cell = [self dequeueReusableCellWithIdentifier:@"SECTIONONE"]; + if (!cell) { + + cell = [[XJDSectionOneTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"SECTIONONE"]; + } + cell.backgroundColor = KWhiteColor; + cell.sectionTitle = @"在线时间"; + cell.isShow = true; + cell.selectionStyle = UITableViewCellSelectionStyleNone; + return cell; + }else if ( indexPath.row > 0 && indexPath.row <= self.timeArray.count ) { + + XJDTimeDisanceTableViewCell * timeCell = [self dequeueReusableCellWithIdentifier:@"TIMECELL"]; + if (!timeCell) { + + timeCell = [[XJDTimeDisanceTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"TIMECELL"]; + } + timeCell.model = self.timeArray[indexPath.row - 1]; + timeCell.backgroundColor = KWhiteColor; + timeCell.selectionStyle = UITableViewCellSelectionStyleNone; + return timeCell; + + }else { + XJDAddSchedulingTimeTableViewCell * addCell = [self dequeueReusableCellWithIdentifier:@"ADDCELL"]; + if (!addCell) { + + addCell = [[XJDAddSchedulingTimeTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"ADDCELL"]; + } + addCell.addDelegate = self.addDelegate; + addCell.backgroundColor = KWhiteColor; + addCell.selectionStyle = UITableViewCellSelectionStyleNone; + return addCell; + + } + + } + if (indexPath.section == 1) { + + if (indexPath.row == 0) { + XJDSectionOneTableViewCell * cell = [self dequeueReusableCellWithIdentifier:@"SECTIIONTWO"]; + if (!cell) { + + cell = [[XJDSectionOneTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"SECTIIONTWO"]; + } + cell.sectionTitle = @"视频咨询"; + cell.isShow = false; + cell.backgroundColor = KWhiteColor; + cell.selectionStyle = UITableViewCellSelectionStyleNone; + return cell; + }else { + + XJDVideoAudioTableViewCell * videoCell = [self dequeueReusableCellWithIdentifier:@"VIDEOCELL"]; + if (!videoCell) { + + videoCell = [[XJDVideoAudioTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"VIDEOCELL"]; + } + videoCell.backgroundColor = KWhiteColor; + if (indexPath.row == 1) { videoCell.leftString = @"上午"; } + if (indexPath.row == 2) { videoCell.leftString = @"下午"; } + videoCell.selectionStyle = UITableViewCellSelectionStyleNone; + return videoCell; + } + } + if (indexPath.section == 2) { + + if (indexPath.row == 0) { + XJDSectionOneTableViewCell * cell = [self dequeueReusableCellWithIdentifier:@"SECTIIONTHREE"]; + if (!cell) { + + cell = [[XJDSectionOneTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"SECTIIONTHREE"]; + } + cell.backgroundColor = KWhiteColor; + cell.sectionTitle = @"日期"; + cell.isShow = true; + cell.selectionStyle = UITableViewCellSelectionStyleNone; + return cell; + }else + { + NSArray * array = @[@" 周一",@" 周二",@" 周三",@" 周四",@" 周五",@" 周六",@" 周天"]; + XJDSchedulingDateTableViewCell * dateCell = [self dequeueReusableCellWithIdentifier:@"DATACELL"]; + if (!dateCell) { + + dateCell = [[XJDSchedulingDateTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"DATACELL"]; + } + dateCell.weekString = array[indexPath.row - 1]; + dateCell.backgroundColor = KWhiteColor; + dateCell.selectionStyle = UITableViewCellSelectionStyleNone; + return dateCell; + } + } + if (indexPath.section == 3) { + + XJDJumpHolidayTableViewCell * jumpcell = [self dequeueReusableCellWithIdentifier:@"JUMPCELL"]; + if (!jumpcell) { + + jumpcell = [[XJDJumpHolidayTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"JUMPCELL"]; + } + jumpcell.backgroundColor = KWhiteColor; + jumpcell.selectionStyle = UITableViewCellSelectionStyleNone; + return jumpcell; + } + + return UITableViewCell.new; + + +} +//每行高度 +//- (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; +} + + +////cell点击事件 +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + + +} + +-(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 + + + diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDSectionOneTableViewCell.h b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDSectionOneTableViewCell.h new file mode 100644 index 0000000..b3b0f97 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDSectionOneTableViewCell.h @@ -0,0 +1,20 @@ +// +// XJDSectionOneTableViewCell.h +// healthQuestion +// +// Created by 仁康信息 on 2023/5/8. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDSectionOneTableViewCell : UITableViewCell + +@property (nonatomic, copy) NSString * sectionTitle; + +@property (nonatomic, assign) BOOL isShow; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDSectionOneTableViewCell.m b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDSectionOneTableViewCell.m new file mode 100644 index 0000000..1938722 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDSectionOneTableViewCell.m @@ -0,0 +1,93 @@ +// +// XJDSectionOneTableViewCell.m +// healthQuestion +// +// Created by 仁康信息 on 2023/5/8. +// + +#import "XJDSectionOneTableViewCell.h" + + +@interface XJDSectionOneTableViewCell () + +@property (nonatomic, strong) UILabel * sectionLabel; + +@property (nonatomic, strong) UISwitch * rightSlider; + +@end + + +@implementation XJDSectionOneTableViewCell + +- (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.sectionLabel = [[UILabel alloc] init]; + self.sectionLabel.textColor = CFontColor1; + self.sectionLabel.font = BOLDSYSTEMFONT(15); + self.sectionLabel.textAlignment = NSTextAlignmentLeft; + [self.contentView addSubview:self.sectionLabel]; + + [self.sectionLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_offset(15); + make.top.height.mas_offset(15); + make.width.mas_offset(100); + make.bottom.mas_offset(-20); + }]; + + self.rightSlider = [[UISwitch alloc] init]; + [self.rightSlider setOn:YES animated:YES]; + [self.rightSlider setOnTintColor: UIColorHex(#59D5D4)]; + self.rightSlider.transform = CGAffineTransformMakeScale(0.6, 0.6); + [self.rightSlider addTarget:self action:@selector(switchChange:) forControlEvents:UIControlEventValueChanged]; + [self.contentView addSubview:self.rightSlider]; + + [self.rightSlider mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.mas_offset(-15); + make.top.mas_offset(15); + make.height.mas_offset(17); + make.bottom.mas_offset(-20); + }]; +} + +- (void) switchChange:(UISwitch*)sw { + if(sw.on == YES) { + NSLog(@"开关切换为开"); + } else if(sw.on == NO) { + NSLog(@"开关切换为关"); + } +} + +- (void)setSectionTitle:(NSString *)sectionTitle { + + _sectionTitle = sectionTitle; + + self.sectionLabel.text = _sectionTitle; +} + +- (void)setIsShow:(BOOL)isShow { + + _isShow = isShow; + + self.rightSlider.hidden = _isShow; +} +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDTimeDisanceTableViewCell.h b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDTimeDisanceTableViewCell.h new file mode 100644 index 0000000..3b65ac5 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDTimeDisanceTableViewCell.h @@ -0,0 +1,19 @@ +// +// XJDTimeDisanceTableViewCell.h +// healthQuestion +// +// Created by 仁康信息 on 2023/5/8. +// + +#import +#import "XJDSchedulingSettingModel.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDTimeDisanceTableViewCell : UITableViewCell + +@property (nonatomic, strong) XJDSchedulingSettingModel * model; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDTimeDisanceTableViewCell.m b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDTimeDisanceTableViewCell.m new file mode 100644 index 0000000..d9cb5a5 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDTimeDisanceTableViewCell.m @@ -0,0 +1,100 @@ +// +// XJDTimeDisanceTableViewCell.m +// healthQuestion +// +// Created by 仁康信息 on 2023/5/8. +// + +#import "XJDTimeDisanceTableViewCell.h" + +@interface XJDTimeDisanceTableViewCell () + +@property (nonatomic, strong) UILabel * timeLabel; + +@property (nonatomic, strong) UISwitch * rightSlider; + + +@end + +@implementation XJDTimeDisanceTableViewCell + +- (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.timeLabel = [[UILabel alloc] init]; + self.timeLabel.textColor = UIColorHex(#333333); + self.timeLabel.font = MEDIUMFONT(13); + self.timeLabel.textAlignment = NSTextAlignmentLeft; + [self.contentView addSubview:self.timeLabel]; + + [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_offset(15); + make.top.height.mas_offset(15); + make.width.mas_offset(200); + make.bottom.mas_offset(-20); + }]; + + self.rightSlider = [[UISwitch alloc] init]; + [self.rightSlider setOn:YES animated:YES]; + [self.rightSlider setOnTintColor: UIColorHex(#59D5D4)]; + self.rightSlider.transform = CGAffineTransformMakeScale(0.6, 0.6); + [self.rightSlider addTarget:self action:@selector(switchChange:) forControlEvents:UIControlEventValueChanged]; + [self.contentView addSubview:self.rightSlider]; + + [self.rightSlider mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.mas_offset(-15); + make.top.mas_offset(15); + make.height.mas_offset(17); + make.bottom.mas_offset(-20); + }]; + + UIView * lineV = [[UIView alloc] init]; + lineV.backgroundColor = UIColorHex(#E0E0E0); + [self.contentView addSubview:lineV]; + + [lineV mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.mas_offset(0); + make.height.mas_offset(1); + make.bottom.mas_offset(0); + }]; + +} + +- (void) switchChange:(UISwitch*)sw { + if(sw.on == YES) { + NSLog(@"开关切换为开"); + } else if(sw.on == NO) { + NSLog(@"开关切换为关"); + } +} + +- (void)setModel:(XJDSchedulingSettingModel *)model { + + _model = model; + + self.timeLabel.text = _model.time; + + [self.rightSlider setOn:_model.isSelected]; + +} +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDVideoAudioTableViewCell.h b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDVideoAudioTableViewCell.h new file mode 100644 index 0000000..76452a4 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDVideoAudioTableViewCell.h @@ -0,0 +1,18 @@ +// +// XJDVideoAudioTableViewCell.h +// healthQuestion +// +// Created by 仁康信息 on 2023/5/8. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDVideoAudioTableViewCell : UITableViewCell + +@property (nonatomic, copy) NSString * leftString; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDVideoAudioTableViewCell.m b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDVideoAudioTableViewCell.m new file mode 100644 index 0000000..4728bfc --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/XJDVideoAudioTableViewCell.m @@ -0,0 +1,110 @@ +// +// XJDVideoAudioTableViewCell.m +// healthQuestion +// +// Created by 仁康信息 on 2023/5/8. +// + +#import "XJDVideoAudioTableViewCell.h" + +@interface XJDVideoAudioTableViewCell () + +@property (nonatomic, strong) UILabel * leftLabel; + +@property (nonatomic, strong) UITextField * numberField; + +@end + +@implementation XJDVideoAudioTableViewCell + +- (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.leftLabel = [[UILabel alloc] init]; + self.leftLabel.textColor = UIColorHex(#333333); + self.leftLabel.font = BOLDSYSTEMFONT(13); + self.leftLabel.textAlignment = NSTextAlignmentLeft; + [self.contentView addSubview:self.leftLabel]; + + [self.leftLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_offset(28); + make.top.height.mas_offset(20); + make.width.mas_offset(40); + make.bottom.mas_offset(-20); + }]; + + UILabel * maxLabel = [[UILabel alloc] init]; + maxLabel.textColor = UIColorHex(#333333); + maxLabel.font = MEDIUMFONT(14); + maxLabel.text = @"最大可预约"; + maxLabel.textAlignment = NSTextAlignmentLeft; + [self.contentView addSubview:maxLabel]; + + [maxLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.leftLabel.mas_right).offset(20); + make.top.height.mas_offset(20); + make.bottom.mas_offset(-20); + }]; + [maxLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal]; + + self.numberField = [[UITextField alloc] init]; + self.numberField.layer.cornerRadius = 5.0; + self.numberField.layer.masksToBounds = true; + self.numberField.layer.borderColor = UIColorHex(#CCCCCC).CGColor; + self.numberField.layer.borderWidth = 1.0f; + self.numberField.keyboardType = UIKeyboardTypeNumberPad; + [self.contentView addSubview:self.numberField]; + + [self.numberField mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(maxLabel.mas_right).offset(11); + make.height.mas_offset(30); + make.width.mas_offset(58); + make.bottom.mas_offset(-15); + }]; + + UILabel * peopleLabel = [[UILabel alloc] init]; + peopleLabel.textColor = UIColorHex(#333333); + peopleLabel.font = MEDIUMFONT(14); + peopleLabel.text = @"人"; + peopleLabel.textAlignment = NSTextAlignmentLeft; + [self.contentView addSubview:peopleLabel]; + + [peopleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.numberField.mas_right).offset(10); + make.top.height.mas_offset(20); + make.bottom.mas_offset(-20); + make.width.mas_offset(35); + }]; +} + +- (void)setLeftString:(NSString *)leftString { + + _leftString = leftString; + + self.leftLabel.text = _leftString; + + +} + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/YXTimeDisanceTableViewCell.h b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/YXTimeDisanceTableViewCell.h deleted file mode 100644 index 67d48d7..0000000 --- a/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/SchedulingSettingView(排班设置)/YXTimeDisanceTableViewCell.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// YXTimeDisanceTableViewCell.h -// healthQuestion -// -// Created by 仁康信息 on 2023/5/8. -// - -#import -#import "YXSchedulingSettingModel.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface YXTimeDisanceTableViewCell : UITableViewCell - -@property (nonatomic, strong) YXSchedulingSettingModel * model; - -@end - -NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/XJDCustomDelectedView.h b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/XJDCustomDelectedView.h new file mode 100644 index 0000000..b907279 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/XJDCustomDelectedView.h @@ -0,0 +1,24 @@ +// +// XJDCustomDelectedView.h +// healthQuestion +// +// Created by 仁康信息 on 2023/5/6. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef void(^delectOneBlock)(NSInteger btnTag); + +@interface XJDCustomDelectedView : UIView + +@property (nonatomic, copy) NSString * titleString; + +@property (nonatomic, assign) NSInteger btntag; + +@property (nonatomic, copy) delectOneBlock delectBlock; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/XJDCustomDelectedView.m b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/XJDCustomDelectedView.m new file mode 100644 index 0000000..2b72c11 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/XJDCustomDelectedView.m @@ -0,0 +1,79 @@ +// +// XJDCustomDelectedView.m +// healthQuestion +// +// Created by 仁康信息 on 2023/5/6. +// + +#import "XJDCustomDelectedView.h" + +@interface XJDCustomDelectedView () + +@property (nonatomic, strong) UILabel * nameLabel; +@property (nonatomic, strong) UIButton * cancelBtn ; + +@end + +@implementation XJDCustomDelectedView + +/* +// 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 { + + UIButton * cancelBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.width - 18, 0, 18, 18)]; + [cancelBtn setImage:[UIImage imageNamed:@"delected_Icon"] forState:UIControlStateNormal]; + self.cancelBtn = cancelBtn; + [cancelBtn addTarget:self action:@selector(delectedAction:) forControlEvents:UIControlEventTouchUpInside]; + [self addSubview:cancelBtn]; + + + self.nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 7, self.width-10, 27)]; + self.nameLabel.textAlignment = NSTextAlignmentCenter; + self.nameLabel.textColor = CFontColor1; + self.nameLabel.font = SYSTEMFONT(13); + self.nameLabel.layer.borderColor = UIColorHex(#BBBBBB).CGColor; + self.nameLabel.layer.cornerRadius = 5.0; + self.nameLabel.layer.masksToBounds = true; + self.nameLabel.layer.borderWidth = 1.0f; + [self addSubview:self.nameLabel]; +} + +- (void)setBtntag:(NSInteger)btntag { + + _btntag = btntag; + self.cancelBtn.tag = _btntag; + + + +} + +- (void)setTitleString:(NSString *)titleString { + _titleString = titleString; + self.nameLabel.text = _titleString; +} + +- (void)delectedAction:(UIButton *)btn { + + if (self.delectBlock) { + + self.delectBlock(btn.tag - 100); + + } + +} +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/userAddGoodPopView.h b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/XJDUserAddGoodPopView.h similarity index 77% rename from DoctorXinjiang/DoctorXinjiang/Project/Mine/view/userAddGoodPopView.h rename to DoctorXinjiang/DoctorXinjiang/Project/Mine/view/XJDUserAddGoodPopView.h index 6b077eb..cf98cea 100644 --- a/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/userAddGoodPopView.h +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/XJDUserAddGoodPopView.h @@ -1,5 +1,5 @@ // -// YXuserAddGoodPopView.h +// XJDUserAddGoodPopView.h // healthQuestion // // Created by 仁康信息 on 2023/5/6. @@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN typedef void(^addBlcok)(NSString *inputString); -@interface YXuserAddGoodPopView : UIView +@interface XJDUserAddGoodPopView : UIView @property (nonatomic, copy) addBlcok popBlock; diff --git a/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/XJDUserAddGoodPopView.m b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/XJDUserAddGoodPopView.m new file mode 100644 index 0000000..ca2ab1c --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/Mine/view/XJDUserAddGoodPopView.m @@ -0,0 +1,108 @@ +// +// XJDUserAddGoodPopView.m +// healthQuestion +// +// Created by 仁康信息 on 2023/5/6. +// + +#import "XJDUserAddGoodPopView.h" +#import "UIPlaceHolderTextView.h" + +@interface XJDUserAddGoodPopView () + +@property (nonatomic, strong) UIPlaceHolderTextView * addTextView; + +@end + +@implementation XJDUserAddGoodPopView + +/* +// 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.backgroundColor = RGBA(0, 0, 0, 0.3); + + UIView * popView = [[UIView alloc] initWithFrame:CGRectMake(0, kScreenHeight - kRealValue(254), kScreenWidth, kRealValue(254))]; + popView.backgroundColor = KWhiteColor; + UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:popView.bounds byRoundingCorners:UIRectCornerTopRight | UIRectCornerTopLeft cornerRadii:CGSizeMake(10, 10)]; + CAShapeLayer *maskLayer = [[CAShapeLayer alloc]init]; + maskLayer.frame = popView.bounds; + maskLayer.path = maskPath.CGPath; + popView.layer.mask = maskLayer; + [self addSubview:popView]; + + UILabel * titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, kRealValue(26), popView.width, 14)]; + titleLabel.text = @"擅长病种"; + titleLabel.font = MEDIUMFONT(14); + titleLabel.textAlignment = NSTextAlignmentCenter; + titleLabel.textColor = CFontColor1; + [popView addSubview:titleLabel]; + + + UIPlaceHolderTextView * textView = [[UIPlaceHolderTextView alloc] initWithFrame:CGRectMake(kRealValue(16), titleLabel.bottom + kRealValue(32), kScreenWidth - kRealValue(32), kRealValue(90))]; + textView.backgroundColor = UIColorHex(#EFEFEF); + self.addTextView = textView; + textView.font = SYSTEMFONT(13); + textView.placeholder = @"请输入您擅长的病种"; + textView.layer.cornerRadius = 10; + textView.layer.masksToBounds = true; + [popView addSubview:textView]; + + UIButton * cancelbtn = [[UIButton alloc] initWithFrame:CGRectMake(popView.width - kRealValue(15) - 9 , kRealValue(15) , 9, 9)]; + [cancelbtn setImage:[UIImage imageNamed:@"close_Icon"] forState:UIControlStateNormal]; + [cancelbtn addTarget:self action:@selector(cancelAction) forControlEvents:UIControlEventTouchUpInside]; + [popView addSubview:cancelbtn]; + + UIButton * sureBtn = [[UIButton alloc] initWithFrame:CGRectMake(kRealValue(47) ,textView.bottom + kRealValue(31) , popView.width - kRealValue(94), 40)]; + sureBtn.backgroundColor = UIColorHex(#21BEBD); + sureBtn.layer.cornerRadius = 20; + [sureBtn setTitle:@"确定" forState:UIControlStateNormal]; + [sureBtn setTitleColor:KWhiteColor forState:UIControlStateNormal]; + sureBtn.titleLabel.font = MEDIUMFONT(14); + [sureBtn addTarget:self action:@selector(sureAction) forControlEvents:UIControlEventTouchUpInside]; + [popView addSubview:sureBtn]; + + + + + +} + +-(void)cancelAction { + + [self removeFromSuperview]; + +} + +- (void)sureAction { + + if (ValidStr(self.addTextView.text)) { + + [MBProgressHUD showErrorMessage:@"请输入内容"]; + return; + } + + if(self.popBlock) { + + self.popBlock(self.addTextView.text); + } + [self removeFromSuperview]; +} + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/ChatList/XJDChatListViewController.h b/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/ChatList/XJDChatListViewController.h new file mode 100644 index 0000000..a7b10bc --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/ChatList/XJDChatListViewController.h @@ -0,0 +1,16 @@ +// +// XJDChatListViewController.h +// DoctorXinjiang +// +// Created by 仁康信息 on 2023/2/13. +// + +#import "YXBaseViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDChatListViewController : YXBaseViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/ChatList/XJDChatListViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/ChatList/XJDChatListViewController.m new file mode 100644 index 0000000..7ee439e --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/ChatList/XJDChatListViewController.m @@ -0,0 +1,65 @@ +// +// XJDChatListViewController.m +// DoctorXinjiang +// +// Created by 仁康信息 on 2023/2/13. +// + +#import "XJDChatListViewController.h" +#import "TUIConversationListController.h" +#import "TUIC2CChatViewController.h" +#import "TUIConversationCell.h" +#import "ChatViewController.h" + +@interface XJDChatListViewController () + +@end + +@implementation XJDChatListViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. + self.isHidenNaviBar = false; + TUIConversationListController *vc = [[TUIConversationListController alloc] init]; + vc.delegate = self; + // 把 TUIConversationListController 添加到自己的 ViewController + [self addChildViewController:vc]; + [self.view addSubview:vc.view]; + +} + +//会话列表代理 + +- (void)conversationListController:(TUIConversationListController *)conversationController + didSelectConversation:(TUIConversationCell *)conversation +{ + + // 会话列表点击事件,通常是打开聊天界面 + TUIConversationCellData * data11 = conversation; +// // 创建会话信息 + + ChatViewController * chatVC = [[ChatViewController alloc] init]; + if (!ValidStr(data11.userID)) { + chatVC.chatID = data11.userID; + chatVC.isGroupID = false; + + }else + { + chatVC.chatID = data11.groupID; + chatVC.isGroupID = YES; + } + chatVC.navTitle = data11.title; + [self.navigationController pushViewController:chatVC animated:true]; +} +/* +#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 diff --git a/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/ChatViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/ChatViewController.m index 593c1cd..c864c8d 100644 --- a/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/ChatViewController.m +++ b/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/ChatViewController.m @@ -9,13 +9,13 @@ #import "TUIC2CChatViewController.h" #import "TUIMessageDataProvider.h" #import "TUIChatDataProvider.h" -#import "ChatMapViewController.h" +#import "XJDChatMapViewController.h" #import #import "TUIChatConfig.h" #import "EndSystemSoSCell.h" #import "XJDFileDataDetailViewController.h" #import "DoctorIDCardMessageCell.h" -#import "CurrentLocationViewController.h" +#import "XJDCurrentLocationViewController.h" #import #import #import "TUIGroupChatViewController.h" @@ -52,7 +52,7 @@ [[V2TIMManager sharedInstance] addSimpleMsgListener:self]; [[TUICallEngine createInstance] addObserver:self]; -// IMUserInfoModel * model = [HQCommonUtils keyedUnarchiverWithKey:IMLoginUserInfo]; +// IMUserInfoModel * model = [XJDCommonUtils keyedUnarchiverWithKey:IMLoginUserInfo]; // [[TUICallEngine createInstance] init:[model.sdkAppId intValue] userId:model.userId userSig:model.userSig succ:^{ // // } fail:^(int code, NSString * _Nullable errMsg) { @@ -70,7 +70,7 @@ // [ESCTUIManager createUITUIChatViewControllerisGroup:self.isGroupID chatConnetID:self.chatID isAudio:false isVideo:false]; - YXUserInfo * user = [HQCommonUtils keyedUnarchiverWithKey:LoginUserInfo]; + XJDUserInfo * user = [XJDCommonUtils keyedUnarchiverWithKey:LoginUserInfo]; TUIChatConversationModel *data = [[TUIChatConversationModel alloc] init]; //显示对方正在输入状态 @@ -168,7 +168,7 @@ #pragma mark:跳转到地图选择页 - (void)jumpChatMapView { - ChatMapViewController * mapVC = [[ChatMapViewController alloc] init]; + XJDChatMapViewController * mapVC = [[XJDChatMapViewController alloc] init]; MJWeakSelf mapVC.mapBlcok = ^(CLLocationCoordinate2D coordinate) { V2TIMMessage * message = [[V2TIMManager sharedInstance] createLocationMessage:@"位置" longitude:coordinate.longitude latitude:coordinate.latitude]; @@ -194,19 +194,19 @@ if (self.questionType == 1) { NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; [parmDic setObject:self.sosEnd_id forKey:@"id"]; - YXNetAPI * endApi = [[YXNetAPI alloc] init:self tag:@"ENDSOSAPI" NeedToken:@""]; + XJDNetAPI * endApi = [[XJDNetAPI alloc] init:self tag:@"ENDSOSAPI" NeedToken:@""]; [endApi PostEndSoSIMQuestion:parmDic]; } if (self.questionType == 2) { NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; [parmDic setObject:self.pictureEnd_id forKey:@"id"]; - YXNetAPI * endApi = [[YXNetAPI alloc] init:self tag:@"ENDPICTUREAPI" NeedToken:@""]; + XJDNetAPI * endApi = [[XJDNetAPI alloc] init:self tag:@"ENDPICTUREAPI" NeedToken:@""]; [endApi GetEndPictureEndIMQuestion:parmDic]; } if (!ValidStr(self.smallHelp_id)) { NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init]; [parmDic setObject:self.smallHelp_id forKey:@"id"]; - YXNetAPI * endApi = [[YXNetAPI alloc] init:self tag:@"ENDPICTUREAPI" NeedToken:@""]; + XJDNetAPI * endApi = [[XJDNetAPI alloc] init:self tag:@"ENDPICTUREAPI" NeedToken:@""]; [endApi GetEndPictureEndIMQuestion:parmDic]; } } @@ -360,7 +360,7 @@ // DLog(@"%@",cel.messageData.innerMessage.locationElem.longitude); - CurrentLocationViewController * currVC = [[CurrentLocationViewController alloc] init]; + XJDCurrentLocationViewController * currVC = [[XJDCurrentLocationViewController alloc] init]; currVC.longitude = cel.messageData.innerMessage.locationElem.longitude; currVC.latitude = cel.messageData.innerMessage.locationElem.latitude; [self.navigationController pushViewController:currVC animated:YES]; diff --git a/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/Controller/XJDChatMapViewController.h b/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/Controller/XJDChatMapViewController.h new file mode 100644 index 0000000..c49abfb --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/Controller/XJDChatMapViewController.h @@ -0,0 +1,20 @@ +// +// ChatMapViewController.h +// DoctorXinjiang +// +// Created by 仁康信息 on 2023/7/5. +// + +#import "YXBaseViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +typedef void(^sendUserSoSLocation)(CLLocationCoordinate2D coordinate); + +@interface XJDChatMapViewController : YXBaseViewController + +@property (nonatomic, copy) sendUserSoSLocation mapBlcok; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/Controller/XJDChatMapViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/Controller/XJDChatMapViewController.m new file mode 100644 index 0000000..8551b8d --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/Controller/XJDChatMapViewController.m @@ -0,0 +1,157 @@ +// +// XJDChatMapViewController.m +// DoctorXinjiang +// +// Created by 仁康信息 on 2023/7/5. +// + +#import "XJDChatMapViewController.h" + +@interface XJDChatMapViewController () +{ + CLLocationCoordinate2D coordinate; +} +@property (nonatomic, strong) MAMapView *mapView; +@property (nonatomic, strong) AMapSearchAPI *search; +@property (nonatomic, assign) BOOL userFirstLoca; +@end + +@implementation XJDChatMapViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + self.isHidenNaviBar = false; + self.navigationItem.title = @"选择位置"; + self.view.backgroundColor = KWhiteColor; + // Do any additional setup after loading the view. + [self createUI]; +} + +- (void)viewWillAppear:(BOOL)animated +{ + [super viewWillAppear:animated]; + + [self.mapView setCompassImage:[UIImage imageNamed:@"compass"]]; +} + +- (void)viewDidAppear:(BOOL)animated +{ + [super viewDidAppear:animated]; + + // 开启定位 + self.mapView.showsUserLocation = YES; + self.mapView.userTrackingMode = MAUserTrackingModeFollow; +} + +- (void)viewDidDisappear:(BOOL)animated +{ + [super viewDidDisappear:animated]; + [self.mapView setCompassImage:nil]; +} + +- (void)createUI { + + self.mapView = [[MAMapView alloc] initWithFrame:self.view.bounds]; + self.mapView.zoomLevel = 17; + self.mapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + self.mapView.userTrackingMode = MAUserTrackingModeFollow; + [self.view addSubview:self.mapView]; + self.search.delegate = self; + self.mapView.delegate = self; + [self addNavigationItemWithTitles:@[@"发送"] isLeft:NO target:self action:@selector(sendMapmessate) tags:@[@"100"]]; + +} + +- (void)sendMapmessate { + + if (self.userFirstLoca == NO) { + [self showMBProgressHUDOnlyWithString:@"正在获取您的位置,请稍候"]; + } + if (self.mapBlcok) { + self.mapBlcok(coordinate); + } + [self.navigationController popViewControllerAnimated:YES]; + + +} + +#pragma mark - MAMapviewDelegate +- (MAAnnotationView *)mapView:(MAMapView *)mapView viewForAnnotation:(id)annotation +{ + if ([annotation isKindOfClass:[MAPointAnnotation class]]) + { + + } + + return nil; +} + +#pragma mark - MAMapViewDelegate + +- (void)mapViewRequireLocationAuth:(CLLocationManager *)locationManager +{ + [locationManager requestAlwaysAuthorization]; +} + + +- (void)mapView:(MAMapView *)mapView didChangeUserTrackingMode:(MAUserTrackingMode)mode animated:(BOOL)animated +{ +} + + +- (void)mapView:(MAMapView *)mapView didUpdateUserLocation:(MAUserLocation *)userLocation updatingLocation:(BOOL)updatingLocation +{ + // 目的是只用第一次定位的数据,即用户的初始位置 + if (self.userFirstLoca == NO) { + self.userFirstLoca = YES; +// self.userFirstCoor = userLocation.location.coordinate; + coordinate = userLocation.location.coordinate; + MAPointAnnotation *ann = [[MAPointAnnotation alloc] init]; + ann.coordinate = userLocation.location.coordinate; + //固定Annotation并放置地图中心点 + ann.lockedToScreen = YES; + ann.lockedScreenPoint = CGPointMake(mapView.center.x, mapView.center.y); + [mapView addAnnotation:ann]; + } +} + +/* 地图移动结束后调用此接口 */ +- (void)mapView:(MAMapView *)mapView mapDidMoveByUser:(BOOL)wasUserAction +{ + // 将指定view坐标系的坐标转换为经纬度 + CLLocationCoordinate2D moveCoor = [mapView convertPoint:CGPointMake(mapView.center.x, mapView.center.y-64) toCoordinateFromView:mapView]; + + // 通过坐标点得到经纬度,从而进行反地理编码 + AMapReGeocodeSearchRequest *rego = [[AMapReGeocodeSearchRequest alloc] init]; + // 是否返回扩展信(因为我们需要得到附近地理位置信息,所以设为YES) + rego.requireExtension = YES; + rego.location = [AMapGeoPoint locationWithLatitude:moveCoor.latitude longitude:moveCoor.longitude]; + coordinate = CLLocationCoordinate2DMake(moveCoor.latitude , moveCoor.longitude); + [self.search AMapReGoecodeSearch:rego]; +} + +/* 逆地理编码查询回调函数 */ +- (void)onReGeocodeSearchDone:(AMapReGeocodeSearchRequest *)request response:(AMapReGeocodeSearchResponse *)response +{ + // reGeodeVC就是一个简单的tableView布局,数据来源就是response.regeocode.pois +} + +/* 这个是reGeodeVC点击tableViewCell的回调 */ +#pragma mark - ReGeocodeDelegate +-(void)selectAMapAPI:(AMapPOI *)poi +{ + // 将地图的中心点移至poi点 + coordinate = CLLocationCoordinate2DMake(poi.location.latitude, poi.location.longitude); + [self.mapView setCenterCoordinate:CLLocationCoordinate2DMake(poi.location.latitude, poi.location.longitude) 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 diff --git a/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/Controller/XJDCurrentLocationViewController.h b/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/Controller/XJDCurrentLocationViewController.h new file mode 100644 index 0000000..bebc54b --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/Controller/XJDCurrentLocationViewController.h @@ -0,0 +1,21 @@ +// +// XJDCurrentLocationViewController.h +// healthQuestion +// +// Created by 仁康信息 on 2023/8/15. +// + +#import "YXBaseViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDCurrentLocationViewController : YXBaseViewController + +@property (nonatomic, assign) double longitude; + +@property (nonatomic, assign) double latitude; + + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/Controller/XJDCurrentLocationViewController.m b/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/Controller/XJDCurrentLocationViewController.m new file mode 100644 index 0000000..bdf5e6b --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/Controller/XJDCurrentLocationViewController.m @@ -0,0 +1,138 @@ +// +// XJDCurrentLocationViewController.m +// healthQuestion +// +// Created by 仁康信息 on 2023/8/15. +// + +#import "XJDCurrentLocationViewController.h" + +@interface XJDCurrentLocationViewController () +{ + CLLocationCoordinate2D coordinate; +} +@property (nonatomic, strong) MAMapView *mapView; +@property (nonatomic, strong) AMapSearchAPI *search; +@property (nonatomic, assign) BOOL userFirstLoca; + +@end + +@implementation XJDCurrentLocationViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + self.isHidenNaviBar = false; + self.navigationItem.title = @"我的位置"; + self.view.backgroundColor = KWhiteColor; + // Do any additional setup after loading the view. + [self createUI]; +} + + +- (void)viewWillAppear:(BOOL)animated +{ + [super viewWillAppear:animated]; + +// [self.mapView setCompassImage:[UIImage imageNamed:@"pin"]]; +} + +- (void)viewDidAppear:(BOOL)animated +{ + [super viewDidAppear:animated]; + + +} + +- (void)viewDidDisappear:(BOOL)animated +{ + [super viewDidDisappear:animated]; + [self.mapView setCompassImage:nil]; +} + +- (void)createUI { + + self.mapView = [[MAMapView alloc] initWithFrame:self.view.bounds]; + self.mapView.zoomLevel = 17; + self.mapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + // 设置中心点时带动画效果 + [self.mapView setCenterCoordinate:CLLocationCoordinate2DMake(self.latitude, self.longitude) animated:YES]; + + [self.view addSubview:self.mapView]; + self.search.delegate = self; + self.mapView.delegate = self; + + MAPointAnnotation *pointAnnotation = [[MAPointAnnotation alloc] init]; + pointAnnotation.coordinate = CLLocationCoordinate2DMake(self.latitude, self.longitude); + [_mapView addAnnotation:pointAnnotation]; + +} + +#pragma mark - MAMapviewDelegate +- (MAAnnotationView *)mapView:(MAMapView *)mapView viewForAnnotation:(id)annotation +{ + if ([annotation isKindOfClass:[MAPointAnnotation class]]) + { + static NSString *pointReuseIndentifier = @"pointReuseIndentifier"; + MAPinAnnotationView*annotationView = (MAPinAnnotationView*)[mapView dequeueReusableAnnotationViewWithIdentifier:pointReuseIndentifier]; + if (annotationView == nil) + { + annotationView = [[MAPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:pointReuseIndentifier]; + } + annotationView.canShowCallout= YES; //设置气泡可以弹出,默认为NO + annotationView.animatesDrop = YES; //设置标注动画显示,默认为NO + annotationView.draggable = YES; //设置标注可以拖动,默认为NO + annotationView.pinColor = MAPinAnnotationColorPurple; + annotationView.centerOffset = CGPointMake(0, -18); +// annotationView.image = [UIImage imageNamed:@"pin"]; + return annotationView; + } + return nil; +} +#pragma mark - MAMapViewDelegate + +- (void)mapViewRequireLocationAuth:(CLLocationManager *)locationManager +{ + [locationManager requestAlwaysAuthorization]; +} + + +- (void)mapView:(MAMapView *)mapView didChangeUserTrackingMode:(MAUserTrackingMode)mode animated:(BOOL)animated +{ +} + + +- (void)mapView:(MAMapView *)mapView didUpdateUserLocation:(MAUserLocation *)userLocation updatingLocation:(BOOL)updatingLocation +{ + +} + +/* 地图移动结束后调用此接口 */ +- (void)mapView:(MAMapView *)mapView mapDidMoveByUser:(BOOL)wasUserAction +{ + +} + +/* 逆地理编码查询回调函数 */ +- (void)onReGeocodeSearchDone:(AMapReGeocodeSearchRequest *)request response:(AMapReGeocodeSearchResponse *)response +{ + // reGeodeVC就是一个简单的tableView布局,数据来源就是response.regeocode.pois +} + +/* 这个是reGeodeVC点击tableViewCell的回调 */ +#pragma mark - ReGeocodeDelegate +-(void)selectAMapAPI:(AMapPOI *)poi +{ + // 将地图的中心点移至poi点 + [self.mapView setCenterCoordinate:CLLocationCoordinate2DMake(self.latitude, self.longitude) 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 diff --git a/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/CustomChatCell/DoctorCardCell/DoctorIDCardMessageCell.m b/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/CustomChatCell/DoctorCardCell/DoctorIDCardMessageCell.m index dd05cbc..3572dbd 100644 --- a/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/CustomChatCell/DoctorCardCell/DoctorIDCardMessageCell.m +++ b/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/CustomChatCell/DoctorCardCell/DoctorIDCardMessageCell.m @@ -80,7 +80,7 @@ - (void)layoutSubviews { [super layoutSubviews]; - CGFloat w = [HQCommonUtils getLengthFromText:self.doctorNameLabel.text andFontSize:14]; + CGFloat w = [XJDCommonUtils getLengthFromText:self.doctorNameLabel.text andFontSize:14]; self.doctorImg.frame = CGRectMake(14, 18, 50, 50); self.doctorNameLabel.frame = CGRectMake(self.doctorImg.right + 14, 18, w, 20); diff --git a/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/CustomChatCell/EndSystemCell/EndSystemCellData.m b/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/CustomChatCell/EndSystemCell/EndSystemCellData.m index 83bb7be..3b544c0 100644 --- a/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/CustomChatCell/EndSystemCell/EndSystemCellData.m +++ b/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/CustomChatCell/EndSystemCell/EndSystemCellData.m @@ -41,7 +41,7 @@ // size.width += 20; // return size; UILabel * commanLabel = [[UILabel alloc] init]; - CGFloat h = [HQCommonUtils getSpaceLabelHeight:commanLabel AndLeftisTrue:true withStr:self.content withFont:[UIFont systemFontOfSize:14] withWidth:245 - 28 withLineSpacing:2]; + CGFloat h = [XJDCommonUtils getSpaceLabelHeight:commanLabel AndLeftisTrue:true withStr:self.content withFont:[UIFont systemFontOfSize:14] withWidth:245 - 28 withLineSpacing:2]; CGFloat textMaxWidth = 245.f; CGFloat textMaxHeight = h+10; diff --git a/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/CustomChatCell/EndSystemCell/EndSystemSoSCell.m b/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/CustomChatCell/EndSystemCell/EndSystemSoSCell.m index f6b4997..74cf4b5 100644 --- a/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/CustomChatCell/EndSystemCell/EndSystemSoSCell.m +++ b/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/CustomChatCell/EndSystemCell/EndSystemSoSCell.m @@ -87,7 +87,7 @@ - (void)layoutSubviews { [super layoutSubviews]; - CGFloat h = [HQCommonUtils getSpaceLabelHeight:self.commantLabel AndLeftisTrue:true withStr:self.commantLabel.text withFont:[UIFont systemFontOfSize:14] withWidth:self.container.width - 14 withLineSpacing:2]; + CGFloat h = [XJDCommonUtils getSpaceLabelHeight:self.commantLabel AndLeftisTrue:true withStr:self.commantLabel.text withFont:[UIFont systemFontOfSize:14] withWidth:self.container.width - 14 withLineSpacing:2]; self.systemTitleLabel.frame = CGRectMake(14, 18, 245 - 28, 20); self.commantLabel.frame = CGRectMake( 14, self.systemTitleLabel.bottom + 10, 245 - 28, h); diff --git a/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/CustomChatCell/HealthDataCustom/healthDataCustomCell.m b/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/CustomChatCell/HealthDataCustom/healthDataCustomCell.m index 43e1043..0d545cd 100644 --- a/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/CustomChatCell/HealthDataCustom/healthDataCustomCell.m +++ b/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/CustomChatCell/HealthDataCustom/healthDataCustomCell.m @@ -174,7 +174,7 @@ - self.questionNameLab.mm_sizeToFit().mm_top(21).mm_left(10).mm_width([HQCommonUtils getLengthFromText:self.questionNameLab.text andFontSize:15]).mm_height(16); + self.questionNameLab.mm_sizeToFit().mm_top(21).mm_left(10).mm_width([XJDCommonUtils getLengthFromText:self.questionNameLab.text andFontSize:15]).mm_height(16); self.sexLabel.mm_top(21).mm_left(self.questionNameLab.mm_w + 10 + 9).mm_width(100).mm_height(16); diff --git a/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/CustomChatCell/SendPhysicalModel/sendPhysicalCustomCell.m b/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/CustomChatCell/SendPhysicalModel/sendPhysicalCustomCell.m index b75881d..94be1ea 100644 --- a/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/CustomChatCell/SendPhysicalModel/sendPhysicalCustomCell.m +++ b/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/CustomChatCell/SendPhysicalModel/sendPhysicalCustomCell.m @@ -65,7 +65,7 @@ - (void)layoutSubviews { [super layoutSubviews]; - CGFloat h = [HQCommonUtils getSpaceLabelHeight:self.hospationLabel AndLeftisTrue:true withStr:self.hospationLabel.text withFont:[UIFont systemFontOfSize:14] withWidth:self.container.width - 14 withLineSpacing:2]; + CGFloat h = [XJDCommonUtils getSpaceLabelHeight:self.hospationLabel AndLeftisTrue:true withStr:self.hospationLabel.text withFont:[UIFont systemFontOfSize:14] withWidth:self.container.width - 14 withLineSpacing:2]; self.titleLabel.frame = CGRectMake(14, 18, 245 - 28, 20); self.hospationLabel.frame = CGRectMake( 14, self.titleLabel.bottom + 10, 245 - 28, h); diff --git a/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/CustomChatCell/StarMarkCustom/StarMarkCellData.m b/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/CustomChatCell/StarMarkCustom/StarMarkCellData.m index 1bee5d7..db76969 100644 --- a/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/CustomChatCell/StarMarkCustom/StarMarkCellData.m +++ b/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/CustomChatCell/StarMarkCustom/StarMarkCellData.m @@ -24,7 +24,7 @@ - (CGSize)contentSize { UILabel * hlabel = [[UILabel alloc] init]; - CGFloat h = [HQCommonUtils getSpaceLabelHeight:hlabel AndLeftisTrue:true withStr:self.reviewConnet withFont:[UIFont systemFontOfSize:13] withWidth: 245 - 30 withLineSpacing:5]; + CGFloat h = [XJDCommonUtils getSpaceLabelHeight:hlabel AndLeftisTrue:true withStr:self.reviewConnet withFont:[UIFont systemFontOfSize:13] withWidth: 245 - 30 withLineSpacing:5]; CGSize size = CGSizeMake(245,h + 80); return size; diff --git a/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/CustomChatCell/StarMarkCustom/StarMarkCustomCell.m b/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/CustomChatCell/StarMarkCustom/StarMarkCustomCell.m index 4d8c39c..c9c4b48 100644 --- a/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/CustomChatCell/StarMarkCustom/StarMarkCustomCell.m +++ b/DoctorXinjiang/DoctorXinjiang/Project/TUIChat/CustomChatCell/StarMarkCustom/StarMarkCustomCell.m @@ -76,7 +76,7 @@ self.pingneirongLabel.frame = CGRectMake(15, self.pinglunLabel.bottom + 14 , self.container.width - 30, 50); - CGFloat h = [HQCommonUtils getSpaceLabelHeight:self.pingneirongLabel AndLeftisTrue:true withStr:self.pingneirongLabel.text withFont:[UIFont systemFontOfSize:13] withWidth: self.container.width - 30 withLineSpacing:5]; + CGFloat h = [XJDCommonUtils getSpaceLabelHeight:self.pingneirongLabel AndLeftisTrue:true withStr:self.pingneirongLabel.text withFont:[UIFont systemFontOfSize:13] withWidth: self.container.width - 30 withLineSpacing:5]; self.pingneirongLabel.frame = CGRectMake(15, self.pinglunLabel.bottom + 14 , self.container.width - 30, h); diff --git a/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/AppIcon 1.appiconset/Contents.json b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/AppIcon 1.appiconset/Contents.json deleted file mode 100644 index df54288..0000000 --- a/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/AppIcon 1.appiconset/Contents.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "images" : [ - { - "filename" : "questionIcon.png", - "idiom" : "universal", - "platform" : "ios", - "size" : "1024x1024" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/AppIcon 1.appiconset/questionIcon.png b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/AppIcon 1.appiconset/questionIcon.png deleted file mode 100644 index 66b06c0..0000000 Binary files a/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/AppIcon 1.appiconset/questionIcon.png and /dev/null differ diff --git a/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/AppIcon.appiconset/Contents.json b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/AppIcon.appiconset/Contents.json index 2305880..6903cc1 100644 --- a/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,6 +1,7 @@ { "images" : [ { + "filename" : "图层 1@2x.png", "idiom" : "universal", "platform" : "ios", "size" : "1024x1024" @@ -12,6 +13,7 @@ "value" : "dark" } ], + "filename" : "图层 1@2x 1.png", "idiom" : "universal", "platform" : "ios", "size" : "1024x1024" @@ -23,6 +25,7 @@ "value" : "tinted" } ], + "filename" : "图层 1@2x 2.png", "idiom" : "universal", "platform" : "ios", "size" : "1024x1024" diff --git a/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/AppIcon.appiconset/图层 1@2x 1.png b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/AppIcon.appiconset/图层 1@2x 1.png new file mode 100644 index 0000000..e99b952 Binary files /dev/null and b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/AppIcon.appiconset/图层 1@2x 1.png differ diff --git a/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/AppIcon.appiconset/图层 1@2x 2.png b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/AppIcon.appiconset/图层 1@2x 2.png new file mode 100644 index 0000000..e99b952 Binary files /dev/null and b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/AppIcon.appiconset/图层 1@2x 2.png differ diff --git a/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/AppIcon.appiconset/图层 1@2x.png b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/AppIcon.appiconset/图层 1@2x.png new file mode 100644 index 0000000..e99b952 Binary files /dev/null and b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/AppIcon.appiconset/图层 1@2x.png differ diff --git a/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/homeTabar_nomarl.imageset/Contents.json b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/homeTabar_nomarl.imageset/Contents.json new file mode 100644 index 0000000..cc06957 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/homeTabar_nomarl.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "homeTabar_nomarl.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "homeTabar_nomarl@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "homeTabar_nomarl@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/homeTabar_nomarl.imageset/homeTabar_nomarl.png b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/homeTabar_nomarl.imageset/homeTabar_nomarl.png new file mode 100644 index 0000000..760ba2b Binary files /dev/null and b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/homeTabar_nomarl.imageset/homeTabar_nomarl.png differ diff --git a/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/homeTabar_nomarl.imageset/homeTabar_nomarl@2x.png b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/homeTabar_nomarl.imageset/homeTabar_nomarl@2x.png new file mode 100644 index 0000000..978a374 Binary files /dev/null and b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/homeTabar_nomarl.imageset/homeTabar_nomarl@2x.png differ diff --git a/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/homeTabar_nomarl.imageset/homeTabar_nomarl@3x.png b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/homeTabar_nomarl.imageset/homeTabar_nomarl@3x.png new file mode 100644 index 0000000..5a476a7 Binary files /dev/null and b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/homeTabar_nomarl.imageset/homeTabar_nomarl@3x.png differ diff --git a/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/homeTabar_selected.imageset/Contents.json b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/homeTabar_selected.imageset/Contents.json new file mode 100644 index 0000000..1e1c1e1 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/homeTabar_selected.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "homeTabar_selected.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "homeTabar_selected@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "homeTabar_selected@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/homeTabar_selected.imageset/homeTabar_selected.png b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/homeTabar_selected.imageset/homeTabar_selected.png new file mode 100644 index 0000000..6877729 Binary files /dev/null and b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/homeTabar_selected.imageset/homeTabar_selected.png differ diff --git a/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/homeTabar_selected.imageset/homeTabar_selected@2x.png b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/homeTabar_selected.imageset/homeTabar_selected@2x.png new file mode 100644 index 0000000..c5426a4 Binary files /dev/null and b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/homeTabar_selected.imageset/homeTabar_selected@2x.png differ diff --git a/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/homeTabar_selected.imageset/homeTabar_selected@3x.png b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/homeTabar_selected.imageset/homeTabar_selected@3x.png new file mode 100644 index 0000000..1747bd4 Binary files /dev/null and b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/homeTabar_selected.imageset/homeTabar_selected@3x.png differ diff --git a/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/mianTabar_nomarl.imageset/Contents.json b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/mianTabar_nomarl.imageset/Contents.json new file mode 100644 index 0000000..ec44ec8 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/mianTabar_nomarl.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "mianTabar_nomarl.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "mianTabar_nomarl@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "mianTabar_nomarl@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/mianTabar_nomarl.imageset/mianTabar_nomarl.png b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/mianTabar_nomarl.imageset/mianTabar_nomarl.png new file mode 100644 index 0000000..6a20a63 Binary files /dev/null and b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/mianTabar_nomarl.imageset/mianTabar_nomarl.png differ diff --git a/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/mianTabar_nomarl.imageset/mianTabar_nomarl@2x.png b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/mianTabar_nomarl.imageset/mianTabar_nomarl@2x.png new file mode 100644 index 0000000..faeac61 Binary files /dev/null and b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/mianTabar_nomarl.imageset/mianTabar_nomarl@2x.png differ diff --git a/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/mianTabar_nomarl.imageset/mianTabar_nomarl@3x.png b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/mianTabar_nomarl.imageset/mianTabar_nomarl@3x.png new file mode 100644 index 0000000..5948f9e Binary files /dev/null and b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/mianTabar_nomarl.imageset/mianTabar_nomarl@3x.png differ diff --git a/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/mianTabar_selected.imageset/Contents.json b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/mianTabar_selected.imageset/Contents.json new file mode 100644 index 0000000..b322e05 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/mianTabar_selected.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "mianTabar_selected.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "mianTabar_selected@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "mianTabar_selected@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/mianTabar_selected.imageset/mianTabar_selected.png b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/mianTabar_selected.imageset/mianTabar_selected.png new file mode 100644 index 0000000..030ac96 Binary files /dev/null and b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/mianTabar_selected.imageset/mianTabar_selected.png differ diff --git a/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/mianTabar_selected.imageset/mianTabar_selected@2x.png b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/mianTabar_selected.imageset/mianTabar_selected@2x.png new file mode 100644 index 0000000..734ed87 Binary files /dev/null and b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/mianTabar_selected.imageset/mianTabar_selected@2x.png differ diff --git a/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/mianTabar_selected.imageset/mianTabar_selected@3x.png b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/mianTabar_selected.imageset/mianTabar_selected@3x.png new file mode 100644 index 0000000..3d21d51 Binary files /dev/null and b/DoctorXinjiang/DoctorXinjiang/Supporting Files/Assets.xcassets/mianTabar_selected.imageset/mianTabar_selected@3x.png differ diff --git a/DoctorXinjiang/DoctorXinjiang/Supporting Files/PrefixHeader.pch b/DoctorXinjiang/DoctorXinjiang/Supporting Files/PrefixHeader.pch index 300c554..318f462 100644 --- a/DoctorXinjiang/DoctorXinjiang/Supporting Files/PrefixHeader.pch +++ b/DoctorXinjiang/DoctorXinjiang/Supporting Files/PrefixHeader.pch @@ -13,10 +13,10 @@ #import "FontAndColorMacros.h" #import "ThirdMacros.h" #import "StatusMacros.h" -#import "HQConst.h" -#import "HQCommonUtils.h" -#import "YXUserInfo.h" -#import "YXNetAPI.h" +#import "XJDConst.h" +#import "XJDCommonUtils.h" +#import "XJDUserInfo.h" +#import "XJDNetAPI.h" //基础类 #import "AppDelegate.h" #import "AppDelegate+AppService.h" @@ -25,7 +25,7 @@ #import "YXBaseTabBarController.h" #import "MBProgressHUD+XY.h" #import "AppManager.h" -#import "IMUserInfoModel.h" +#import "XJDIMUserInfoModel.h" #import "ESCTUIManager.h" //分类 #import "UIButton+NYS.h" diff --git a/DoctorXinjiang/DoctorXinjiang/Supporting Files/XJDConst.h b/DoctorXinjiang/DoctorXinjiang/Supporting Files/XJDConst.h new file mode 100644 index 0000000..7d6d617 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Supporting Files/XJDConst.h @@ -0,0 +1,18 @@ +// +// HQConst.h +// healthQuestion +// +// Created by xulei on 2022/8/12. +// + +#import + +#import + +extern NSString * const LoginUserInfo; + +extern NSString * const LoginSeccess; + +extern NSString * const LogoutSeccess; + +extern NSString * const IMLoginUserInfo; diff --git a/DoctorXinjiang/DoctorXinjiang/Supporting Files/XJDConst.m b/DoctorXinjiang/DoctorXinjiang/Supporting Files/XJDConst.m new file mode 100644 index 0000000..9caff8f --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Supporting Files/XJDConst.m @@ -0,0 +1,17 @@ +// +// XJDConst.m +// healthQuestion +// +// Created by xulei on 2022/8/12. +// + +#import "XJDConst.h" + + +NSString * const LoginUserInfo = @"LoginUserInfo"; + +NSString * const LoginSeccess = @"LoginSeccess"; + +NSString * const LogoutSeccess = @"LogoutSeccess"; + +NSString * const IMLoginUserInfo = @"IMUserInfo"; diff --git a/DoctorXinjiang/DoctorXinjiang/Utils/XJDCommonUtils.h b/DoctorXinjiang/DoctorXinjiang/Utils/XJDCommonUtils.h new file mode 100644 index 0000000..84b9900 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Utils/XJDCommonUtils.h @@ -0,0 +1,95 @@ +// +// XJDCommonUtils.h +// healthQuestion +// +// Created by xulei on 2022/8/16. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDCommonUtils : NSObject + + + +/** + * 判断APP是否第一次运行。使用UserDefault来记录的,key为RunCount + * @return 返回BOOL值。YES表示第一次运行APP,NO相反 + */ ++ (BOOL)isFirstRunApp; + +/** + * 判断用户是否第一次登录。使用UserDefault来记录的,key为LoginCount + * @return 返回BOOL值。YES表示第一次登录,NO相反 + */ ++ (BOOL)isFirstLogin; + +/** + * 判断APP是否登录 + */ ++ (BOOL)isLogin; + ++ (NSString *)SFZHID; + + ++ (NSString *)loginID; + +//判断密码是否满足 8位 包含大小写数字 ++ (BOOL )isOrNoPasswordStyle:(NSString *)passWordName; + +//归档和解归档 ++ (void)keyedArchiverWithData:(nullable id)responseObject key:(NSString *)key; ++ (nullable id)keyedUnarchiverWithKey:(NSString *)key; +//编码问题 ++(NSString*)DataTOjsonString:(id)object; + + +//计算UILabel的高度(带有行间距的情况) ++(CGFloat)getSpaceLabelHeight:(UILabel *)label + AndLeftisTrue:(BOOL)isLeft + withStr:(NSString*)str + withFont:(UIFont*)font + withWidth:(CGFloat)width + withLineSpacing:(CGFloat)linespace; + +//计算宽度 ++(CGFloat)getLengthFromText:(NSString *)text andFontSize:(CGFloat)fontSize; + + ++ (NSMutableAttributedString *)firstString:(NSString *)firstString + firstColor:(UIColor *)firstColor firstSize:(CGFloat)firstSize secondString:(NSString *)secondString secondColor:(UIColor *)secondColor secondSize:(CGFloat)secondSize + thirdString:(NSString *)thirdString thirdColor:(UIColor *)thirdColor thirdSize:(CGFloat)thirdSize; + +/* + 添加阴影 : 注意与贝塞尔裁圆 + */ ++ (void)addShadowToView:(UIView *)shadowView; + ++(UITextField*)createTextFieldWithplaceholder:(NSString*)placeholder passWord:(BOOL)YESorNO leftImageView:(UIView*)leftView isShowLeft:(BOOL)isLeft rightImageView:(UIView*)rightView isShowRight:(BOOL)isRigt Font:(float)font textColor:(UIColor *)color; + ++(BOOL)isMobileNumber:(NSString *)mobileNum; + + +///将时间戳转为日期时间 + +/// @param timestamp 时间戳 + +/// @param dateFormat 日期样式 YYYY-MM-dd HH:mm:ss + ++ (NSString *)getTimeFromTimestamp:(NSInteger )timestamp andDateFormat:(NSString *)dateFormat; + +///将日期时间转为时间戳 ++ (NSString *)getTimestampFromTime:(NSString *)CurrentTime; + +/* + 获取当前控制器 + */ + ++ (UIViewController *)getCurrentVC; + + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Utils/XJDCommonUtils.m b/DoctorXinjiang/DoctorXinjiang/Utils/XJDCommonUtils.m new file mode 100644 index 0000000..2bed42b --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Utils/XJDCommonUtils.m @@ -0,0 +1,435 @@ +// +// XJDCommonUtils.m +// healthQuestion +// +// Created by xulei on 2022/8/16. +// + +#import "XJDCommonUtils.h" +#import "XJDUserInfo.h" + +@implementation XJDCommonUtils + ++ (BOOL)isFirstRunApp +{ + NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; + NSInteger runCount = [ud integerForKey:@"RunCount"]; + if (0 == runCount) + { + [ud setInteger:++runCount forKey:@"RunCount"]; + [ud synchronize]; + return YES; + } + return NO; +} + ++ (BOOL)isFirstLogin +{ + NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; + NSInteger loginCount = [ud integerForKey:@"LoginCount"]; + if (0 == loginCount) + { + [ud setInteger:++loginCount forKey:@"LoginCount"]; + [ud synchronize]; + return YES; + } + return NO; +} + ++ (BOOL)isLogin +{ + if ([self keyedUnarchiverWithKey:LoginUserInfo] == nil) + { + return NO; + } + return YES; +} + + ++ (NSString *)loginID +{ + NSString *string = nil; + if ([self isLogin]) + { + XJDUserInfo *userInfo = [self keyedUnarchiverWithKey:LoginUserInfo]; + string = [NSString stringWithFormat:@"%@",userInfo.user_id]; + } + else + { + string = @"0"; + } + + + return string; +} + ++ (NSString *)SFZHID +{ + NSString *string = nil; + if ([self isLogin]) + { + XJDUserInfo *userInfo = [self keyedUnarchiverWithKey:LoginUserInfo]; + string = [NSString stringWithFormat:@"%@",userInfo.idCard]; + } + else + { + string = @""; + } + + + return string; +} + ++(CGFloat)getLengthFromText:(NSString *)text andFontSize:(CGFloat)fontSize{ + NSDictionary *attrbute = @{NSFontAttributeName:[UIFont systemFontOfSize:fontSize]}; + return [text boundingRectWithSize:CGSizeMake(MAXFLOAT, 50) + options:NSStringDrawingUsesLineFragmentOrigin attributes:attrbute context:nil].size.width;; +} +/*! + * @brief 把格式化的JSON格式的字符串转换成字典 + * @param jsonString JSON格式的字符串 + * @return 返回字典 + */ ++ (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString +{ + if (jsonString == nil) { + return nil; + } + + NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding]; + NSError *err; + NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonData + options:NSJSONReadingMutableContainers + error:&err]; + if(err) { + NSLog(@"json解析失败:%@",err); + return nil; + } + return dic; +} + + ++ (void)keyedArchiverWithData:(nullable id)responseObject key:(NSString *)key +{ + NSMutableData *saveData = [NSMutableData data]; + NSKeyedArchiver *keyedArchiver = [[NSKeyedArchiver alloc]initForWritingWithMutableData:saveData]; + [keyedArchiver encodeObject:responseObject forKey:key]; + [keyedArchiver finishEncoding]; + + // 获取沙盒目录 + NSString *fullPath = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:key]; + if ([[NSFileManager defaultManager] fileExistsAtPath:fullPath]) + { + [[NSFileManager defaultManager] removeItemAtPath:fullPath error:nil]; + } + //写到文件中 + [saveData writeToFile:fullPath atomically:YES]; +} ++ (nullable id)keyedUnarchiverWithKey:(NSString *)key +{ + // 获取数据目录 + NSString *fullPath = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:key]; + + NSData *saveData = [NSData dataWithContentsOfFile:fullPath]; + + NSKeyedUnarchiver *keyedUnarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:saveData]; + + return [keyedUnarchiver decodeObjectForKey:key]; +} ++(NSString*)DataTOjsonString:(id)object +{ + NSString *jsonString = nil; + NSError *error; + NSData *jsonData = [NSJSONSerialization dataWithJSONObject:object + options:NSJSONWritingPrettyPrinted + error:&error]; + if (!jsonData) { + } else { + jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; + } + return jsonString; +} +//计算UILabel的高度(带有行间距的情况) ++(CGFloat)getSpaceLabelHeight:(UILabel *)label + AndLeftisTrue:(BOOL)isLeft + withStr:(NSString*)str + withFont:(UIFont*)font + withWidth:(CGFloat)width + withLineSpacing:(CGFloat)linespace{ + NSMutableParagraphStyle *paraStyle = [[NSMutableParagraphStyle alloc] init]; + paraStyle.lineBreakMode = NSLineBreakByCharWrapping; + if(isLeft == true) { + paraStyle.alignment = NSTextAlignmentLeft; + }else + { + paraStyle.alignment = NSTextAlignmentRight; + } + //设置行间距 + paraStyle.lineSpacing = linespace; + paraStyle.hyphenationFactor = 1.0; + paraStyle.firstLineHeadIndent = 0.0; + paraStyle.paragraphSpacingBefore = 0.0; + paraStyle.headIndent = 0; + paraStyle.tailIndent = 0; + //设置字间距 NSKernAttributeName:@1.5f + NSDictionary *dic = @{NSFontAttributeName:font, + NSParagraphStyleAttributeName:paraStyle, + NSKernAttributeName:@1.0f + }; + if(str.length < 1) { + str = @" "; + } + NSAttributedString *attributeStr = [[NSAttributedString alloc] initWithString:str attributes:dic]; + label.attributedText = attributeStr; + CGSize size = [str boundingRectWithSize:CGSizeMake(width, MAXFLOAT) + options:NSStringDrawingUsesLineFragmentOrigin attributes:dic context:nil].size; + return size.height; +} + + ++ (NSMutableAttributedString *)firstString:(NSString *)firstString + firstColor:(UIColor *)firstColor firstSize:(CGFloat)firstSize secondString:(NSString *)secondString secondColor:(UIColor *)secondColor secondSize:(CGFloat)secondSize + thirdString:(NSString *)thirdString thirdColor:(UIColor *)thirdColor thirdSize:(CGFloat)thirdSize{ + + + + NSMutableAttributedString * firstPart = [[NSMutableAttributedString alloc] initWithString:firstString]; + NSDictionary * firstAttributes = @{ NSFontAttributeName:[UIFont boldSystemFontOfSize:firstSize],NSForegroundColorAttributeName:firstColor}; + [firstPart setAttributes:firstAttributes range:NSMakeRange(0,firstPart.length)]; + + NSMutableAttributedString * secondPart = [[NSMutableAttributedString alloc] initWithString:secondString]; + NSDictionary * secondAttributes = @{NSFontAttributeName:[UIFont systemFontOfSize:secondSize],NSForegroundColorAttributeName:secondColor}; + [secondPart setAttributes:secondAttributes range:NSMakeRange(0,secondPart.length)]; + [firstPart appendAttributedString:secondPart]; + + NSMutableAttributedString * thirdPart = [[NSMutableAttributedString alloc] initWithString:thirdString]; + NSDictionary * thirdAttributes = @{NSFontAttributeName:[UIFont systemFontOfSize:thirdSize],NSForegroundColorAttributeName:thirdColor}; + [thirdPart setAttributes:thirdAttributes range:NSMakeRange(0,thirdPart.length)]; + [firstPart appendAttributedString:thirdPart]; + + return firstPart; +} + ++ (void)addShadowToView:(UIView *)shadowView { + + shadowView.layer.masksToBounds = NO; + shadowView.backgroundColor = [UIColor whiteColor]; + shadowView.layer.shadowColor = [UIColor blackColor].CGColor; + shadowView.layer.shadowOffset = CGSizeMake(0, 4); + shadowView.layer.shadowOpacity = 0.15; + shadowView.layer.shadowRadius = 5; + shadowView.layer.cornerRadius = 8; + +} + ++(UITextField*)createTextFieldWithplaceholder:(NSString*)placeholder passWord:(BOOL)YESorNO leftImageView:(UIView*)leftView isShowLeft:(BOOL)isLeft rightImageView:(UIView*)rightView isShowRight:(BOOL)isRigt Font:(float)font textColor:(UIColor *)color +{ + UITextField*textField=[[UITextField alloc]init]; + //灰色提示框 + textField.placeholder=placeholder; + //文字对齐方式 + textField.textAlignment=NSTextAlignmentLeft; + textField.secureTextEntry=YESorNO; + + //边框 + //textField.borderStyle=UITextBorderStyleLine; + //键盘类型 + textField.returnKeyType=UIReturnKeyDone; + //关闭首字母大写 + textField.autocapitalizationType=NO; + //清除按钮 + textField.clearButtonMode=NO; + //左图片 + if (isLeft == true) { + + textField.leftView=leftView; + textField.leftViewMode=UITextFieldViewModeAlways; + } + if (isRigt == true) { + textField.rightView=rightView; + //编辑状态下一直存在 + textField.rightViewMode=UITextFieldViewModeAlways; + } + //右图片 + + //自定义键盘 + //textField.inputView + //字体 + textField.font=[UIFont systemFontOfSize:font]; + //字体颜色 + + textField.textColor = color; + + return textField; + +} + + ++ (BOOL)isOrNoPasswordStyle:(NSString *)passWordName + +{ + bool isAlow = true; + + if (passWordName.length >= 33) + + { + + isAlow = false; + + } + + else if ([self JudgeTheillegalCharacter:passWordName]) + + { + + isAlow = false; + + } + + else if (![self judgePassWordLegal:passWordName]) + + { + + isAlow = false; + + } + + return isAlow; + +} + ++ (BOOL)JudgeTheillegalCharacter:(NSString *)content{ + + //提示标签不能输入特殊字符 + + NSString *str =@"^[A-Za-z0-9\\u4e00-\u9fa5]+$"; + + NSPredicate* emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", str]; + + if (![emailTest evaluateWithObject:content]) { + + return YES; + + } + + return NO; + +} + ++ (BOOL)judgePassWordLegal:(NSString *)pass{ + + BOOL result ; + + // 判断长度大于6位后再接着判断是否同时包含数字和大小写字母 + + NSString * regex =@"^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,18}$"; + + NSPredicate *pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex]; + + result = [pred evaluateWithObject:pass]; + + + return result; + +} + ++(BOOL)isMobileNumber:(NSString *)mobileNum +{ + //手机号以13, 15,18,17开头,八个 \d 数字字符 + NSString *mobileRegex = @"[1][3456789][0-9]{9}"; + NSPredicate *mobilePredicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", mobileRegex]; + + return [mobilePredicate evaluateWithObject:mobileNum]; + +} + +///将时间戳转为日期时间 + +/// @param timestamp 时间戳 + +/// @param dateFormat 日期样式 YYYY-MM-dd HH:mm:ss + ++ (NSString *)getTimeFromTimestamp:(NSInteger )timestamp andDateFormat:(NSString *)dateFormat{ + + //将对象类型的时间转换为NSDate类型 +  NSTimeInterval _interval= timestamp / 1000.0; +   NSDate *date = [NSDate dateWithTimeIntervalSince1970:_interval]; +    NSDateFormatter *objDateformat = [[NSDateFormatter alloc] init]; + //设置时间格式 + + [objDateformat setDateFormat:dateFormat]; + + //将时间转换为字符串 + + NSString *timeStr = [objDateformat stringFromDate:date]; + + return timeStr; +} + ++ (NSString *)getTimestampFromTime:(NSString *)CurrentTime { + + NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; + + [formatter setDateStyle:NSDateFormatterMediumStyle]; + + [formatter setTimeStyle:NSDateFormatterShortStyle]; + + [formatter setDateFormat:@"yyyyMMddHHmmss"]; //(@"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]; +} + ++ (UIViewController *)getCurrentVC { + + return [self currentViewControllerWithRootViewController:[self getKeyWindow].rootViewController]; + +} + ++ (UIWindow *)getKeyWindow { + if (@available(iOS 13.0, *)) { + for (UIWindowScene* windowScene in [UIApplication sharedApplication].connectedScenes) { + if (windowScene.activationState == UISceneActivationStateForegroundActive) { + for (UIWindow *window in windowScene.windows) { + if (window.isKeyWindow) { + return window; + break; + } + } + } + } + } + else { + return [UIApplication sharedApplication].keyWindow; + } + return nil; +} + ++ (UIViewController*)currentViewControllerWithRootViewController:(UIViewController*)rootViewController { + if (rootViewController.presentedViewController) { + UIViewController* presentedViewController = rootViewController.presentedViewController; + return [self currentViewControllerWithRootViewController:presentedViewController]; + } else if ([rootViewController isKindOfClass:[UINavigationController class]]) { + UINavigationController* navigationController = (UINavigationController*)rootViewController; + return [self currentViewControllerWithRootViewController:navigationController.visibleViewController]; + } else if ([rootViewController isKindOfClass:[UITabBarController class]]) { + UITabBarController *tabBarController = (UITabBarController *)rootViewController; + return [self currentViewControllerWithRootViewController:tabBarController.selectedViewController]; + } else { + return rootViewController; + } +} + +@end diff --git a/DoctorXinjiang/DoctorXinjiang/Utils/XJDLineTextField.h b/DoctorXinjiang/DoctorXinjiang/Utils/XJDLineTextField.h new file mode 100644 index 0000000..d84b7ff --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Utils/XJDLineTextField.h @@ -0,0 +1,19 @@ +// +// XJDLineTextField.h +// healthQuestion +// +// Created by 仁康信息 on 2022/9/21. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XJDLineTextField : UITextField + +- (void)drawRect:(CGRect)rect; + + +@end + +NS_ASSUME_NONNULL_END diff --git a/DoctorXinjiang/DoctorXinjiang/Utils/XJDLineTextField.m b/DoctorXinjiang/DoctorXinjiang/Utils/XJDLineTextField.m new file mode 100644 index 0000000..dbaad73 --- /dev/null +++ b/DoctorXinjiang/DoctorXinjiang/Utils/XJDLineTextField.m @@ -0,0 +1,26 @@ +// +// XJDLineTextField.m +// healthQuestion +// +// Created by 仁康信息 on 2022/9/21. +// + +#import "XJDLineTextField.h" + +@implementation XJDLineTextField + +/* +// Only override drawRect: if you perform custom drawing. +// An empty implementation adversely affects performance during animation. +- (void)drawRect:(CGRect)rect { + // Drawing code +} +*/ + +- (void)drawRect:(CGRect)rect { + CGContextRef context = UIGraphicsGetCurrentContext(); + CGContextSetFillColorWithColor(context, UIColorHex(#E0E0E0).CGColor); + CGContextFillRect(context, CGRectMake(0, CGRectGetHeight(self.frame) - 0.5, CGRectGetWidth(self.frame), 0.5)); +} + +@end