专家端修改

This commit is contained in:
History
2025-07-14 10:04:46 +08:00
parent e84207f835
commit 762d407ddd
251 changed files with 18404 additions and 453 deletions
@@ -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)",
@@ -28,7 +28,7 @@
//高德key
#define AMAPSDKKEY @"6f5c1979535a0bea4965d033306c61a7"
#define AMAPSDKKEY @"0017de4b0745e1e1be58e9fa89b66f56"
//友盟appster
@@ -0,0 +1,104 @@
//
// API.h
// XZYNetworking
//
// Created by 仁康信息 on 2022/9/9.
// Copyright © 2022年 仁康信息. All rights reserved.
//
#import <Foundation/Foundation.h>
#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
@@ -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
@@ -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"]];
}
@@ -0,0 +1,36 @@
// XJDKeychainTool.h
// idleBuy
//
// Created by ios on 2018/5/28.
// Copyright © 2018年 ios. All rights reserved.
#import <Foundation/Foundation.h>
#import <Security/Security.h>
@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
@@ -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
@@ -0,0 +1,38 @@
//
// XJDUserInfo.h
// idleBuy
//
// Created by ios on 2018/5/30.
// Copyright © 2018年 ios. All rights reserved.
//
#import <Foundation/Foundation.h>
@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
@@ -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
@@ -7,7 +7,7 @@
#import "AppDelegate+AppService.h"
#import "YXBaseTabBarController.h"
#import "YXLoginViewController.h"
#import "XJDLoginViewController.h"
#import <IQKeyboardManager/IQKeyboardManager.h>
#import <AMapFoundationKit/AMapFoundationKit.h>
#import <AMapFoundationKit/AMapServices.h>
@@ -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);
@@ -1,25 +0,0 @@
//
// YXBaseTabBarController.h
// healthQuestion
//
// Created by xulei on 2022/8/12.
//
#import <UIKit/UIKit.h>
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
@@ -1,42 +0,0 @@
//
// YXBaseWebViewController.h
// healthQuestion
//
// Created by 仁康信息 on 2024/1/12.
//
#import "YXBaseViewController.h"
#import <WebKit/WebKit.h>
#import <JavaScriptCore/JavaScriptCore.h>
NS_ASSUME_NONNULL_BEGIN
typedef enum {
WkJSMessageTypeDefault = 0,
WkJSMessageTypeBack = 1,
}WkJSMessageType;
typedef enum {
RightDefaultType = 0,
RightCompleteType = 1,
}RightNavType;
@protocol WebJSExport <JSExport>
- (void)startFunction;
@end
@interface YXBaseWebViewController : YXBaseViewController<UIAlertViewDelegate,WKNavigationDelegate, WKUIDelegate, WebJSExport, WKScriptMessageHandler>
@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
@@ -7,8 +7,8 @@
#import "YXBaseTabBarController.h"
#import "HQTabBar.h"
#import "YXHomePageViewController.h"
#import "YXMineViewController.h"
#import "XJDHomePageViewController.h"
#import "XJDMineViewController.h"
@interface YXBaseTabBarController ()<UITabBarControllerDelegate>
@@ -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;
@@ -6,7 +6,7 @@
//
#import "YXBaseViewController.h"
#import "YXLoginViewController.h"
#import "XJDLoginViewController.h"
@interface YXBaseViewController ()<MBProgressHUDDelegate>
@@ -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];
}
@@ -0,0 +1,16 @@
//
// XJDShowPromptPopView.h
// healthQuestion
//
// Created by 仁康信息 on 2022/9/28.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface XJDShowPromptPopView : UIView
@end
NS_ASSUME_NONNULL_END
@@ -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
@@ -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);
//
@@ -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];
@@ -0,0 +1,20 @@
//
// XJDDownToolsManager.h
// DoctorXinjiang
//
// Created by 仁康信息 on 2023/12/1.
//
#import <Foundation/Foundation.h>
#import "ReaderViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface XJDDownToolsManager : NSObject <ReaderViewControllerDelegate>
+ (void)downLoadReportWithURL:(NSString *)PDFURL withFileName:(NSString *)fileName;
@end
NS_ASSUME_NONNULL_END
@@ -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
@@ -0,0 +1,99 @@
//
// XJDHealthPhyReportModel.h
// DoctorXinjiang
//
// Created by 仁康信息 on 2023/8/28.
//
#import <Foundation/Foundation.h>
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<XJDThirdResultResModel *> * 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<XJDSenResultResModel *> * senResultRes;
@property (nonatomic, strong) NSArray<XJDThirdResultResModel *> * 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<XJDResultItemResListModel *> * resultItemResList;
@property (nonatomic, strong) NSArray<XJDImageItemListModel *> * imageItemList;
@end
NS_ASSUME_NONNULL_END
@@ -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
@@ -0,0 +1,22 @@
//
// XJDLookReportImageViewController.h
// DoctorXinjiang
//
// Created by Apple on 2024/2/26.
//
#import <WebKit/WebKit.h>
#import <JavaScriptCore/JavaScriptCore.h>
NS_ASSUME_NONNULL_BEGIN
@interface XJDLookReportImageViewController : YXBaseViewController
@property (nonatomic, strong) NSString * webTitle;
@property (nonatomic, strong) NSString * webUrl;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,173 @@
//
// XJDLookReportImageViewController.m
// DoctorXinjiang
//
// Created by Apple on 2024/2/26.
//
#import "XJDLookReportImageViewController.h"
@interface XJDLookReportImageViewController ()<UINavigationControllerDelegate, UIImagePickerControllerDelegate>
@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
@@ -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
@@ -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 <ImSDK_Plus/ImSDK_Plus.h>
#import <TIMCommon/TIMDefine.h>
#import <TUICore/TUICore.h>
#import <TUICore/TUILogin.h>
#import "TUIConversationCellData.h"
@interface XJDQuestionDetailViewController ()<TUICallObserver>
@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<V2TIMSDKListener> 的实现类,如果您不需要监听 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
@@ -0,0 +1,19 @@
//
// XJDSickNameSubTableViewCell.h
// DoctorXinjiang
//
// Created by 仁康信息 on 2023/8/29.
//
#import <UIKit/UIKit.h>
#import "XJDHealthPhyReportModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface XJDSickNameSubTableViewCell : UITableViewCell
@property (nonatomic, strong) XJDThirdResultResModel * model;
@end
NS_ASSUME_NONNULL_END
@@ -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
@@ -0,0 +1,23 @@
//
// XJDSickNameTopTableViewCell.h
// DoctorXinjiang
//
// Created by 仁康信息 on 2023/8/29.
//
#import <UIKit/UIKit.h>
#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
@@ -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
@@ -0,0 +1,22 @@
//
// XJDimageReportTableViewCell.h
// DoctorXinjiang
//
// Created by Apple on 2024/2/23.
//
#import <UIKit/UIKit.h>
#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
@@ -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
@@ -1,19 +0,0 @@
//
// YXSickNameSubTableViewCell.h
// DoctorXinjiang
//
// Created by 仁康信息 on 2023/8/29.
//
#import <UIKit/UIKit.h>
#import "YXHealthPhyReportModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface YXSickNameSubTableViewCell : UITableViewCell
@property (nonatomic, strong) YXThirdResultResModel * model;
@end
NS_ASSUME_NONNULL_END
@@ -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
@@ -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
@@ -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
@@ -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 <ImSDK_Plus/ImSDK_Plus.h>
#import <TIMCommon/TIMDefine.h>
#import <TUICore/TUICore.h>
#import <TUICore/TUILogin.h>
#import "TUIConversationCellData.h"
#import "LYEmptyView.h"
#import "LYEmptyViewHeader.h"
@interface XJDPictureRecordViewController ()<V2TIMSDKListener,V2TIMConversationListener>
@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<V2TIMConversationListener> 类型
[[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<V2TIMConversation *> *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<V2TIMConversation *> *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<V2TIMSDKListener> 的实现类,如果您不需要监听 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<V2TIMConversation*> *)conversationList {
// 收到会话新增通知,conversationList 为新增的会话
[self updateConversation:conversationList];
}
- (void)onConversationChanged:(NSArray<V2TIMConversation*> *)conversationList {
// 收到会话变更通知,conversationList 中为变更后的会话对象
[self updateConversation:conversationList];
}
- (void)onConversationDeleted:(NSArray<NSString *> *)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
@@ -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
@@ -0,0 +1,255 @@
//
// QustionRecordViewController.m
// healthQuestion
//
// Created by 仁康信息 on 2023/4/28.
//
#import "XJDQustionRecordViewController.h"
#import "XJDAudioVideoRecordViewController.h"
#import "XJDPictureRecordViewController.h"
@interface XJDQustionRecordViewController ()<UICollectionViewDataSource,UICollectionViewDelegate>
/** 顶部控件*/
@property (nonatomic, weak) UIScrollView *topView;
/** 下划线 */
@property (nonatomic, weak) UIView *lineView;
/** 滚动视图 */
@property (nonatomic, weak) UICollectionView *collectionView;
/** 当前选中的按钮 */
@property (nonatomic, weak) UIButton *selectButton;
/** 按钮数组 */
@property (nonatomic, strong) NSMutableArray *titleButtons;
@end
@implementation 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
@@ -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
@@ -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 ()<AAChartViewEventDelegate>
@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(@"<span style=""color:#1E90FF;font-weight:thin;font-size:15px""> 170 </span> <br>\
<span style=""color:#A9A9A9;font-weight:thin;font-size:10px""> 咨询方式 </span>")//标题文本内容
.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(@"<b>{point.name}&nbsp{point.y}</b>")
)
.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 = @"</span> <span style=""color:#333333;text-align:center;font-weight:normal;font-size:15px""> 咨询方式 </span>";
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(@"<b>{point.name}&nbsp{point.y}</b>")
)
.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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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 ()<V2TIMSimpleMsgListener,V2TIMSDKListener,TUIMessageCellDelegate,TUIBaseMessageControllerDelegate,TUICallObserver>
@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<V2TIMSDKListener> 的实现类,如果您不需要监听 IM SDK 的事件,这个步骤可以忽略。
[[V2TIMManager sharedInstance] addIMSDKListener:self];
// 5. 初始化 IM SDK,调用这个接口后,可以立即调用登录接口。
[[V2TIMManager sharedInstance] initSDK:[model.sdkAppId intValue] config:config];
[ESCTUIManager loginInitTUISDKAppidWith:[model.sdkAppId intValue] UserID:model.userId userSig:model.userSig];
[V2TIMManager.sharedInstance getGroupHistoryMessageList:[NSString stringWithFormat:@"%@",self.smallGroup] count:20 lastMsg:nil succ:^(NSArray<V2TIMMessage *> *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
@@ -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;
}
@@ -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;
}
@@ -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;
}
@@ -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] ;
@@ -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
@@ -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
@@ -0,0 +1,21 @@
//
// XJDCancelReasonModel.h
// healthQuestion
//
// Created by 仁康信息 on 2023/8/17.
//
#import <Foundation/Foundation.h>
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
@@ -0,0 +1,12 @@
//
// XJDCancelReasonModel.m
// healthQuestion
//
// Created by 仁康信息 on 2023/8/17.
//
#import "XJDCancelReasonModel.h"
@implementation XJDCancelReasonModel
@end
@@ -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<YXDoctorGoodSicknessModel *> * goodAtSicknessName;
@property (nonatomic, strong) NSArray<XJDDoctorGoodSicknessModel *> * goodAtSicknessName;
@property (nonatomic, copy) NSString * doctorJob_dictText;
@@ -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
@@ -1,5 +1,5 @@
//
// YXHomePageModel.h
// XJDHomePageModel.h
// healthQuestion
//
// Created by 仁康信息 on 2022/9/9.
@@ -8,7 +8,7 @@
#import <Foundation/Foundation.h>
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;
@@ -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
@@ -0,0 +1,25 @@
//
// XJDHospitalModel.h
// healthQuestion
//
// Created by 仁康信息 on 2022/9/19.
//
#import <Foundation/Foundation.h>
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
@@ -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
@@ -0,0 +1,33 @@
//
// XJDProjectListModel.h
// healthQuestion
//
// Created by 仁康信息 on 2022/10/12.
//
#import <Foundation/Foundation.h>
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<XJDSubProjectListModel *>* subData;
@end
NS_ASSUME_NONNULL_END
@@ -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
@@ -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;
@@ -0,0 +1,12 @@
//
// XJDQuestionBodyReportModel.m
// healthQuestion
//
// Created by 仁康信息 on 2023/8/16.
//
#import "XJDQuestionBodyReportModel.h"
@implementation XJDQuestionBodyReportModel
@end
@@ -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;
@@ -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
@@ -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;
@@ -0,0 +1,12 @@
//
// XJDQuestionStaticsModel.m
// healthQuestion
//
// Created by 仁康信息 on 2023/8/8.
//
#import "XJDQuestionStaticsModel.h"
@implementation XJDQuestionStaticsModel
@end
@@ -0,0 +1,50 @@
//
// RecordIMListDateModel.h
// healthQuestion
//
// Created by 仁康信息 on 2023/8/15.
//
#import <Foundation/Foundation.h>
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
@@ -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
@@ -0,0 +1,142 @@
//
// XJDRecoredListDetailModel.h
// healthQuestion
//
// Created by 仁康信息 on 2023/8/16.
//
#import <Foundation/Foundation.h>
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<XJDRecoredDetailIMListModel *> * imList;
@property (nonatomic, strong) NSArray<XJDRecoredDetailHealthModel *> * 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
@@ -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
@@ -0,0 +1,25 @@
//
// YXStopReasonModel.h
// healthQuestion
//
// Created by 仁康信息 on 2023/8/9.
//
#import <Foundation/Foundation.h>
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
@@ -0,0 +1,12 @@
//
// XJDStopReasonModel.m
// healthQuestion
//
// Created by 仁康信息 on 2023/8/9.
//
#import "XJDStopReasonModel.h"
@implementation XJDStopReasonModel
@end
@@ -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<YXStopServiceListModel *> * records;
@property (nonatomic, strong) NSArray<XJDStopServiceListModel *> * records;
@end
@@ -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
@@ -0,0 +1,21 @@
//
// XJDToolsModel.h
// healthQuestion
//
// Created by 仁康信息 on 2022/9/28.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface XJDToolsModel : NSObject
/**
* 标题
*/
@property (nonatomic, copy) NSString *title;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,13 @@
//
// XJDToolsModel.m
// healthQuestion
//
// Created by 仁康信息 on 2022/9/28.
//
#import "XJDToolsModel.h"
@implementation XJDToolsModel
@end
@@ -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;
@@ -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
@@ -0,0 +1,50 @@
//
// XJDWorkSettingModel.h
// healthQuestion
//
// Created by 仁康信息 on 2023/8/7.
//
#import <Foundation/Foundation.h>
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<XJDWorkTimeModel *> * list;
@end
NS_ASSUME_NONNULL_END
@@ -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
@@ -1,12 +0,0 @@
//
// YXCancelReasonModel.m
// healthQuestion
//
// Created by 仁康信息 on 2023/8/17.
//
#import "YXCancelReasonModel.h"
@implementation YXCancelReasonModel
@end
@@ -1,12 +0,0 @@
//
// YXQuestionBodyReportModel.m
// healthQuestion
//
// Created by 仁康信息 on 2023/8/16.
//
#import "YXQuestionBodyReportModel.h"
@implementation YXQuestionBodyReportModel
@end
@@ -1,12 +0,0 @@
//
// YXQuestionStaticsModel.m
// healthQuestion
//
// Created by 仁康信息 on 2023/8/8.
//
#import "YXQuestionStaticsModel.h"
@implementation YXQuestionStaticsModel
@end
@@ -1,12 +0,0 @@
//
// YXStopReasonModel.m
// healthQuestion
//
// Created by 仁康信息 on 2023/8/9.
//
#import "YXStopReasonModel.h"
@implementation YXStopReasonModel
@end
@@ -0,0 +1,20 @@
//
// XJDBasicHealthInfoView.h
// healthQuestion
//
// Created by 仁康信息 on 2023/5/4.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface XJDBasicHealthInfoView : UIView
@property (nonatomic, strong) NSArray * dataArray;
@property (nonatomic, assign) CGFloat healthHeight;
@end
NS_ASSUME_NONNULL_END
@@ -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
@@ -0,0 +1,21 @@
//
// XJDBillDetailTableViewCell.h
// healthQuestion
//
// Created by 仁康信息 on 2023/5/5.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface XJDBillDetailTableViewCell : UITableViewCell
@property (nonatomic, copy) NSString * leftString;
@property (nonatomic, copy) NSString * rightString;
@end
NS_ASSUME_NONNULL_END
@@ -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
@@ -0,0 +1,21 @@
//
// XJDBillDtailTable.h
// healthQuestion
//
// Created by 仁康信息 on 2023/5/5.
//
#import <UIKit/UIKit.h>
#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
@@ -0,0 +1,126 @@
//
// XJDBillDtailTable.m
// healthQuestion
//
// Created by 仁康信息 on 2023/5/5.
//
#import "XJDBillDtailTable.h"
#import "XJDBillDetailTableViewCell.h"
@interface XJDBillDtailTable ()<UITableViewDelegate,UITableViewDataSource>
@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
@@ -0,0 +1,22 @@
//
// XJDBillListTable.h
// healthQuestion
//
// Created by 仁康信息 on 2023/5/5.
//
#import <UIKit/UIKit.h>
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
@@ -0,0 +1,125 @@
//
// XJDBillListTable.m
// healthQuestion
//
// Created by 仁康信息 on 2023/5/5.
//
#import "XJDBillListTable.h"
#import "XJDBillListTableViewCell.h"
@interface XJDBillListTable ()<UITableViewDelegate,UITableViewDataSource>
@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

Some files were not shown because too many files have changed in this diff Show More