Compare commits

...
2 Commits
Author SHA1 Message Date
jiayangyangandClaude Opus 4.7 f597c63ae0 chore: Pod更新、AppIcon替换、文件清理及配置调整
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-08-04 16:32:13 +08:00
jiayangyangandClaude Opus 4.7 2bcac71a19 feat(emergency): 专家端应急求助入口对齐员工端
- 首页新增员工应急求助入口,接口改用 myParticipatedOrders,1条直接进群聊,多条弹窗选择
- ChatViewController 加急救员流程:isFromFirstAid、群成员面板、工单弹窗
- 急救员入口隐藏语音通话/档案/结束咨询,标题写死"应急求助"
- XJDNetAPI 加 getMyParticipatedOrders/getActualGroupMemberList/getSearchEmployee/getSearchExpert/postAddGroupUser
- 拷贝 XJSelectContactViewController、XJParticipatedOrderModel、checkbox/order 等图标资源
- IM断线静默重登,异地登录弹提示跳登录页
- 首页数量标签默认隐藏,非零才显示

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-08-04 16:30:32 +08:00
70 changed files with 2932 additions and 442 deletions
@@ -11,7 +11,7 @@
18F6BBB52E0AA4FC00F8C4A2 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18F6BBB42E0AA4FC00F8C4A2 /* Security.framework */; };
18F6BBB92E0AA53D00F8C4A2 /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18F6BBB82E0AA53D00F8C4A2 /* CoreTelephony.framework */; };
18F6BBBB2E0AA57F00F8C4A2 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18F6BBBA2E0AA57F00F8C4A2 /* GLKit.framework */; };
DC560BA5B22ACA1774C7E09B /* libPods-DoctorXinjiang.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CAFC690E14C25C2FF40737B /* libPods-DoctorXinjiang.a */; };
47D1EF43FE64AEB378B7D80B /* libPods-DoctorXinjiang.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2AC2C8DFCE72D4FDEFFA0D22 /* libPods-DoctorXinjiang.a */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -32,6 +32,7 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
0C51BB554CF919A18FB142E9 /* Pods-DoctorXinjiang.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DoctorXinjiang.debug.xcconfig"; path = "Target Support Files/Pods-DoctorXinjiang/Pods-DoctorXinjiang.debug.xcconfig"; sourceTree = "<group>"; };
1883A96F2E0A4AD10055089B /* DoctorXinjiang.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DoctorXinjiang.app; sourceTree = BUILT_PRODUCTS_DIR; };
1883A98A2E0A4AD40055089B /* DoctorXinjiangTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DoctorXinjiangTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
1883A9942E0A4AD40055089B /* DoctorXinjiangUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DoctorXinjiangUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -41,9 +42,8 @@
18F6BBB72E0AA51500F8C4A2 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
18F6BBB82E0AA53D00F8C4A2 /* CoreTelephony.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = System/Library/Frameworks/CoreTelephony.framework; sourceTree = SDKROOT; };
18F6BBBA2E0AA57F00F8C4A2 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; };
7CAFC690E14C25C2FF40737B /* libPods-DoctorXinjiang.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-DoctorXinjiang.a"; sourceTree = BUILT_PRODUCTS_DIR; };
89026E00E1DDA04F74446DC0 /* Pods-DoctorXinjiang.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DoctorXinjiang.release.xcconfig"; path = "Target Support Files/Pods-DoctorXinjiang/Pods-DoctorXinjiang.release.xcconfig"; sourceTree = "<group>"; };
97D33B21A85118EF4503CDD0 /* Pods-DoctorXinjiang.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DoctorXinjiang.debug.xcconfig"; path = "Target Support Files/Pods-DoctorXinjiang/Pods-DoctorXinjiang.debug.xcconfig"; sourceTree = "<group>"; };
2AC2C8DFCE72D4FDEFFA0D22 /* libPods-DoctorXinjiang.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-DoctorXinjiang.a"; sourceTree = BUILT_PRODUCTS_DIR; };
AB6256E214245FBA66E71FC4 /* Pods-DoctorXinjiang.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DoctorXinjiang.release.xcconfig"; path = "Target Support Files/Pods-DoctorXinjiang/Pods-DoctorXinjiang.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */
@@ -85,7 +85,7 @@
18F6BBB52E0AA4FC00F8C4A2 /* Security.framework in Frameworks */,
18F6BBBB2E0AA57F00F8C4A2 /* GLKit.framework in Frameworks */,
18F6BBB92E0AA53D00F8C4A2 /* CoreTelephony.framework in Frameworks */,
DC560BA5B22ACA1774C7E09B /* libPods-DoctorXinjiang.a in Frameworks */,
47D1EF43FE64AEB378B7D80B /* libPods-DoctorXinjiang.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -137,7 +137,7 @@
18F6BBB72E0AA51500F8C4A2 /* libz.tbd */,
18F6BBB62E0AA50A00F8C4A2 /* libc++.tbd */,
18F6BBB42E0AA4FC00F8C4A2 /* Security.framework */,
7CAFC690E14C25C2FF40737B /* libPods-DoctorXinjiang.a */,
2AC2C8DFCE72D4FDEFFA0D22 /* libPods-DoctorXinjiang.a */,
);
name = Frameworks;
sourceTree = "<group>";
@@ -145,8 +145,8 @@
4222692EAAF776967D8AE608 /* Pods */ = {
isa = PBXGroup;
children = (
97D33B21A85118EF4503CDD0 /* Pods-DoctorXinjiang.debug.xcconfig */,
89026E00E1DDA04F74446DC0 /* Pods-DoctorXinjiang.release.xcconfig */,
0C51BB554CF919A18FB142E9 /* Pods-DoctorXinjiang.debug.xcconfig */,
AB6256E214245FBA66E71FC4 /* Pods-DoctorXinjiang.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
@@ -158,12 +158,12 @@
isa = PBXNativeTarget;
buildConfigurationList = 1883A99D2E0A4AD40055089B /* Build configuration list for PBXNativeTarget "DoctorXinjiang" */;
buildPhases = (
ACAA23BB1AA67269CD6F784B /* [CP] Check Pods Manifest.lock */,
5D513971A5AEAF177B467A28 /* [CP] Check Pods Manifest.lock */,
1883A96B2E0A4AD10055089B /* Sources */,
1883A96C2E0A4AD10055089B /* Frameworks */,
1883A96D2E0A4AD10055089B /* Resources */,
CB8DD4E9BE8895D6A39A5E05 /* [CP] Embed Pods Frameworks */,
8D069A0A4EBD8020808E6454 /* [CP] Copy Pods Resources */,
D66A00D755FEEBA744E89395 /* [CP] Embed Pods Frameworks */,
A2C3C662F5522670CF770A4A /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@@ -288,26 +288,7 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
8D069A0A4EBD8020808E6454 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-DoctorXinjiang/Pods-DoctorXinjiang-resources.sh\"\n";
showEnvVarsInLog = 0;
};
ACAA23BB1AA67269CD6F784B /* [CP] Check Pods Manifest.lock */ = {
5D513971A5AEAF177B467A28 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -329,7 +310,26 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
CB8DD4E9BE8895D6A39A5E05 /* [CP] Embed Pods Frameworks */ = {
A2C3C662F5522670CF770A4A /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-DoctorXinjiang/Pods-DoctorXinjiang-resources.sh\"\n";
showEnvVarsInLog = 0;
};
D66A00D755FEEBA744E89395 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -390,16 +390,15 @@
/* Begin XCBuildConfiguration section */
1883A99E2E0A4AD40055089B /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 97D33B21A85118EF4503CDD0 /* Pods-DoctorXinjiang.debug.xcconfig */;
baseConfigurationReference = 0C51BB554CF919A18FB142E9 /* Pods-DoctorXinjiang.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = A7CC5LW224;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
EXCLUDED_ARCHS = "";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64 = "arm64 arm64e armv7 armv7s armv6 armv8 EXCLUDED_ARCHS=$(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT))";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/DoctorXinjiang/ThirdParty",
@@ -421,12 +420,12 @@
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UIUserInterfaceStyle = Light;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 1.0.8;
PRODUCT_BUNDLE_IDENTIFIER = com.questionTools.DoctorXinjiang;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
@@ -435,20 +434,22 @@
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
TARGETED_DEVICE_FAMILY = 1;
VALID_ARCHS = "armv7 arm64 x86_64";
};
name = Debug;
};
1883A99F2E0A4AD40055089B /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 89026E00E1DDA04F74446DC0 /* Pods-DoctorXinjiang.release.xcconfig */;
baseConfigurationReference = AB6256E214245FBA66E71FC4 /* Pods-DoctorXinjiang.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = A7CC5LW224;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
EXCLUDED_ARCHS = arm64;
EXCLUDED_ARCHS = "";
EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64 = "arm64 arm64e armv7 armv7s armv6 armv8 EXCLUDED_ARCHS=$(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT))";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/DoctorXinjiang/ThirdParty",
@@ -470,12 +471,12 @@
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UIUserInterfaceStyle = Light;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 1.0.8;
PRODUCT_BUNDLE_IDENTIFIER = com.questionTools.DoctorXinjiang;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
@@ -484,6 +485,7 @@
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
TARGETED_DEVICE_FAMILY = 1;
VALID_ARCHS = "armv7 arm64 x86_64";
};
name = Release;
};
@@ -0,0 +1,102 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1630"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1883A96E2E0A4AD10055089B"
BuildableName = "DoctorXinjiang.app"
BlueprintName = "DoctorXinjiang"
ReferencedContainer = "container:DoctorXinjiang.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
<Testables>
<TestableReference
skipped = "NO"
parallelizable = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1883A9892E0A4AD40055089B"
BuildableName = "DoctorXinjiangTests.xctest"
BlueprintName = "DoctorXinjiangTests"
ReferencedContainer = "container:DoctorXinjiang.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO"
parallelizable = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1883A9932E0A4AD40055089B"
BuildableName = "DoctorXinjiangUITests.xctest"
BlueprintName = "DoctorXinjiangUITests"
ReferencedContainer = "container:DoctorXinjiang.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1883A96E2E0A4AD10055089B"
BuildableName = "DoctorXinjiang.app"
BlueprintName = "DoctorXinjiang"
ReferencedContainer = "container:DoctorXinjiang.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1883A96E2E0A4AD10055089B"
BuildableName = "DoctorXinjiang.app"
BlueprintName = "DoctorXinjiang"
ReferencedContainer = "container:DoctorXinjiang.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -47,22 +47,17 @@
#define ResourceAddress [NSString stringWithFormat:@"%@/file/show/",Http]
////新增
//#define Http [[NSUserDefaults standardUserDefaults] objectForKey:@"HTTPS"] ?: @"https://default.url"
//#define H5DevHost [[NSUserDefaults standardUserDefaults] objectForKey:@"H5DevHost"] ?: @"https://api.cqygjk.com"
//#define IntervenH5 [[NSUserDefaults standardUserDefaults] objectForKey:@"H5DevHost"] ?: @"api.cqygjk.com"
//#define Http UserDefaultObjectForKey(@"HTTPS")//
//#define H5DevHost UserDefaultObjectForKey(@"H5DevHost")//
//#define IntervenH5 UserDefaultObjectForKey(@"IntervenH5")
//正式
//#define Http @"https://api-jkglpt.iosp.ydpt.tech"//
//#define H5DevHost @"api-jkglpt.iosp.ydpt.tech"//
//#define IntervenH5 @"https://console-jkglpt.iosp.ydpt.tech"
//#define SCHEME @"https" //
#define Http @"https://xjgateway.mcrm.vip:8888"//
#define H5DevHost @"xjgateway.mcrm.vip:8888"//
#define IntervenH5 @"https://xjconsole.mcrm.vip:8888"
//开发环境地址
//#define Http @"http://cqyt.dev.yg.dt.io"//
//#define H5DevHost @"cqyt.dev.yg.dt.io"//
//#define IntervenH5 @"http://cms.dev.yg.dt.io"
//测试
#define Http @"https://xj-api.yixiong-tech.com:8081"//
#define H5DevHost @"xjxc-api.mcrm.vip:8888"//
#define IntervenH5 @"http://10.10.10.228:23006/"
#define SCHEME @"https" //
#endif /* StatusMacros_h */
@@ -28,7 +28,7 @@
//高德key
#define AMAPSDKKEY @"0017de4b0745e1e1be58e9fa89b66f56"
#define AMAPSDKKEY @"03d421594e9dea3dcdc527b6ebda0b66"
//友盟appster
@@ -100,5 +100,15 @@
- (void)GetDoctorPhyscialIDCardSearch:(NSMutableDictionary *)parmDic;
- (void)getHistoryReportById:(NSMutableDictionary *)parmDic;
- (void)getSendVideoStart:(NSMutableDictionary *)pamraDic;
//版本更新
- (void)GetAppVesionUpdata:(NSMutableDictionary *)parmDic;
#pragma mark - 应急求助
- (void)getSOSDoctorRecordList:(NSMutableDictionary *)parmDic;
- (void)getSOSDoctorDetailInfo:(NSMutableDictionary *)parmDic;
- (void)getMyParticipatedOrders:(NSMutableDictionary *)parmDic;
- (void)getActualGroupMemberList:(NSMutableDictionary *)parmDic;
- (void)getSearchEmployee:(NSMutableDictionary *)parmDic;
- (void)getSearchExpert:(NSMutableDictionary *)parmDic;
- (void)postAddGroupUser:(NSMutableDictionary *)parmDic;
@end
@@ -323,11 +323,49 @@
}
//结束咨询
- (void)getABMUpdate:(NSMutableDictionary *)parmDic {
[httpRequest httpGetRequest:@"https://base.icdat.cn/latest" params:parmDic];
}
//版本更新
- (void)GetAppVesionUpdata:(NSMutableDictionary *)parmDic {
[httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-system/version/getSysVersionDetailByPackageName",Http] params:parmDic];
}
#pragma mark - 应急求助
- (void)getSOSDoctorRecordList:(NSMutableDictionary *)parmDic {
[httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-emergency/api/emergency/order/initUserOrderPage",Http] params:parmDic];
}
- (void)getSOSDoctorDetailInfo:(NSMutableDictionary *)parmDic {
[httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-emergency/api/emergency/order/orderInfo",Http] params:parmDic];
}
- (void)getMyParticipatedOrders:(NSMutableDictionary *)parmDic {
[httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-emergency/api/emergency/order/myParticipatedOrders",Http] params:parmDic];
}
- (void)getActualGroupMemberList:(NSMutableDictionary *)parmDic {
[httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-emergency/api/emergency/order/getActualGroupMemberList",Http] params:parmDic];
}
- (void)getSearchEmployee:(NSMutableDictionary *)parmDic {
[httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-emergency/api/emergency/order/searchEmployee",Http] params:parmDic];
}
- (void)getSearchExpert:(NSMutableDictionary *)parmDic {
[httpRequest httpGetRequest:[NSString stringWithFormat:@"%@/health-emergency/api/emergency/order/searchExpert",Http] params:parmDic];
}
- (void)postAddGroupUser:(NSMutableDictionary *)parmDic {
[httpRequest httpPostRequest:[NSString stringWithFormat:@"%@/health-emergency/api/emergency/addGroupUser",Http] params:parmDic];
}
@end
@@ -149,6 +149,7 @@
XJDQuestionHealthInfoView * healthView = [[XJDQuestionHealthInfoView alloc] initWithFrame:CGRectMake(0, fileView.bottom +1, kScreenWidth - kRealValue(30), kRealValue(1))];
healthView.backgroundColor = KWhiteColor;
self.healthView = healthView;
self.healthView.hidden = true;
self.questionStartView.layer.cornerRadius = 10.0;
[self.mainScrollView addSubview:healthView];
//体检报告
@@ -24,7 +24,12 @@
#import "XJDDoctorInfoModel.h"
#import "PSAppInfo.h"
#import "PSCheckVersion.h"
@interface XJDHomePageViewController ()<V2TIMSimpleMsgListener,V2TIMSDKListener,TUIMessageCellDelegate,TUIBaseMessageControllerDelegate,TUICallObserver>
#import "UPAppVesionModel.h"
#import "PSCheckVersionView.h"
#import "XJParticipatedOrderModel.h"
@interface XJDHomePageViewController ()<V2TIMSimpleMsgListener,V2TIMSDKListener,TUIMessageCellDelegate,TUIBaseMessageControllerDelegate,TUICallObserver,UITableViewDelegate,UITableViewDataSource>
@property (nonatomic, strong) UIScrollView * mainScrollView;
@@ -37,12 +42,33 @@
@property (nonatomic, strong) UIImageView * heardImage;
@property (nonatomic, strong) UILabel * messageLabel;
@property (nonatomic, copy) NSString * smallGroup;
@property (nonatomic, strong) PSCheckVersionView * checkVersionView;
@property (nonatomic, strong) UIView * coverView;
@property (nonatomic, strong) NSMutableArray<XJParticipatedOrderModel *> *orderList;
@property (nonatomic, assign) NSInteger orderPage;
@property (nonatomic, strong) UITableView *orderPopupTable;
@property (nonatomic, assign) NSInteger selectedOrderIndex;
@end
@implementation XJDHomePageViewController
- (UIView *)coverView {
if (!_coverView) {
_coverView = [[UIView alloc] initWithFrame:[UIScreen mainScreen].bounds];
_coverView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5f];
}
return _coverView;
}
- (void)viewDidLoad {
[super viewDidLoad];
@@ -54,7 +80,6 @@
object:nil];
//前缀请求
[self chageUrlService];
[[V2TIMManager sharedInstance] addSimpleMsgListener:self];
[[TUICallEngine createInstance] addObserver:self];
@@ -62,10 +87,9 @@
self.StatusBarStyle = UIStatusBarStyleDefault;
self.view.backgroundColor = CViewBgColor;
self.navigationItem.title = @"健康专家库";
[self getUpDateinfo];
[self docotrUserInfo];
[self creatSmallHelpNumber];
[PSCheckVersion checkVersionCompulsoryUpdate];
}
@@ -76,84 +100,12 @@
}
#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];
// TODO: 接口恢复后取消注释
// [self.mainScrollView.mj_header beginRefreshing];
}
- (void)createUI {
@@ -242,14 +194,14 @@
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.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.text = @"联系全科医生获取相关帮助和支持";
desLabel.textAlignment = NSTextAlignmentLeft;
[smallView addSubview:desLabel];
@@ -271,6 +223,41 @@
// messageLabel.backgroundColor = UIColorHex(#21BEBD);
// [smallView addSubview:messageLabel];
// 员工应急求助入口
UIView * sosView = [[UIView alloc] initWithFrame:CGRectMake(kRealValue(15), smallView.bottom + kRealValue(10), kScreenWidth - kRealValue(30), 90)];
sosView.backgroundColor = KWhiteColor;
sosView.layer.cornerRadius = 10.0;
sosView.layer.masksToBounds = YES;
UITapGestureRecognizer *sosTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(sosEmergencyAction)];
[sosView addGestureRecognizer:sosTap];
[self.mainScrollView addSubview:sosView];
// 图标 40x40 上下居中
UIImageView * sosIcon = [[UIImageView alloc] initWithFrame:CGRectMake(20, (90 - 40) / 2, 40, 40)];
sosIcon.image = [UIImage imageNamed:@"home_sos_icon"];
sosIcon.layer.cornerRadius = 20;
sosIcon.layer.masksToBounds = YES;
sosIcon.backgroundColor = UIColorHex(#21BEBD);
[sosView addSubview:sosIcon];
// 标题
UILabel * sosTitle = [[UILabel alloc] initWithFrame:CGRectMake(sosIcon.right + 12, (90 - 14 - 6 - 12) / 2, sosView.width - sosIcon.right - 32, 14)];
sosTitle.text = @"员工应急求助";
sosTitle.textColor = UIColorHex(#262626);
sosTitle.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
[sosView addSubview:sosTitle];
// 副标题
UILabel * sosSubTitle = [[UILabel alloc] initWithFrame:CGRectMake(sosIcon.right + 12, sosTitle.bottom + 10, sosView.width - sosIcon.right - 32, 12)];
sosSubTitle.text = @"专家视频连线,守护员工健康";
sosSubTitle.textColor = UIColorHex(#6A6A6A);
sosSubTitle.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
[sosView addSubview:sosSubTitle];
// 设置 scrollView 可滚动范围
self.mainScrollView.contentSize = CGSizeMake(kScreenWidth, sosView.bottom + 30);
MJWeakSelf
self.mainScrollView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
// 进入刷新状态后会自动调用这个block
@@ -317,6 +304,21 @@
}
#pragma mark:更新
- (void)getUpDateinfo {
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
// 获取应用的版本号
[parmDic setObject:@"com.questionTools.DoctorXinjiang" forKey:@"packageName"];
[parmDic setObject:@"2" forKey:@"androidOrIos"];
XJDNetAPI * homeRemakerApi = [[XJDNetAPI alloc] init:self tag:@"UPVERSION" NeedToken:@""];
[homeRemakerApi GetAppVesionUpdata:parmDic];
}
- (void)creatSmallHelpNumber {
XJDNetAPI * homeApi = [[XJDNetAPI alloc] init:self tag:@"SMALLAPI" NeedToken:@""];
@@ -452,7 +454,7 @@
chatVC.isVideo = false;
chatVC.eableSendReport = YES;
chatVC.eableMapTools = false;
chatVC.navTitle = @"小助手";
chatVC.navTitle = @"全科医生";
chatVC.eablehaveHelathData = YES;
chatVC.questionType = 1;
chatVC.memberSex = @"2";
@@ -531,9 +533,110 @@
[self.heardImage sd_setImageWithURL:[NSURL URLWithString:encodedString3] placeholderImage:[UIImage imageNamed:@"doctorNoImage"]];
}
if ([tag isEqualToString:@"UPVERSION"]) {
NSDictionary * dic = response;
UPAppVesionModel * model = [UPAppVesionModel modelWithDictionary:dic];
// 避免1.0.10 跟 1.0.1 出错
NSString *version =
[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
NSString *versionCode =
[version stringByReplacingOccurrencesOfString:@"." withString:@""];
NSInteger loctaionVesion = [versionCode integerValue];
NSDictionary * infoDic = @{
@"version":[NSString stringWithFormat:@"%@",model.versionName] ,
@"releaseNotes":model.updateContent,
@"currentVersionReleaseDate":model.updateTime};
PSAppInfo * info = [[PSAppInfo alloc] initWithDict:infoDic];
//是否需要强制更新
BOOL isNeed = [model.forced integerValue] == 1 ? YES : NO;
if ( model.versionNo > loctaionVesion) {
[self show:info isNeedUpdate:isNeed];
}else
{
DLog(@"不需要更新");
}
}
if ([tag isEqualToString:@"myParticipatedOrders"]) {
[self hiddenAllMBProgressHUD];
NSDictionary *dic = [response isKindOfClass:[NSDictionary class]] ? response : nil;
NSArray *records = dic[@"records"];
if (![records isKindOfClass:[NSArray class]] || records.count == 0) {
[EasyTextView showErrorText:@"暂无进行中的应急工单"];
return;
}
NSMutableArray *models = [NSMutableArray array];
for (NSDictionary *d in records) {
[models addObject:[XJParticipatedOrderModel modelWithDictionary:d]];
}
if (models.count == 1 && [dic[@"total"] integerValue] == 1) {
XJParticipatedOrderModel *m = models.firstObject;
ChatViewController *chatVC = [[ChatViewController alloc] init];
chatVC.isGroupID = YES;
chatVC.isFromFirstAid = YES;
chatVC.isVideo = YES;
chatVC.chatID = m.sessionId;
chatVC.navTitle = @"应急求助";
[self.navigationController pushViewController:chatVC animated:YES];
return;
}
self.orderList = models;
[self showOrderListPopup:self.orderList];
}
}
//是否需要更新
- (void)show:(PSAppInfo *)info isNeedUpdate:(BOOL)isNeed {
__weak typeof(self)weakSelf = self;
if(isNeed == true) { //强制更新
self.checkVersionView = [[PSCheckVersionView alloc]
initWithAppInfo:info
confirm:^{
[weakSelf jumpAppStoreUpdate];
}];
}else {
self.checkVersionView = [[PSCheckVersionView alloc] initWithAppInfo:info confirm:^{
[weakSelf jumpAppStoreUpdate];
} cancel:^{
[self.coverView removeFromSuperview];
}];
}
[self.coverView addSubview:self.checkVersionView];
[self.checkVersionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.equalTo(self.coverView).multipliedBy(0.75);
make.height.equalTo(self.coverView).multipliedBy(0.33);
make.center.equalTo(self.coverView);
}];
[[UIApplication sharedApplication].keyWindow.rootViewController.view addSubview:self.coverView];
}
- (void)jumpAppStoreUpdate {
//强制退出
exit(0);
}
- (void)topAction:(UIButton *)btn {
@@ -583,7 +686,7 @@
if ([title isEqualToString:@"视频咨询"]) {
leftImg.image = [UIImage imageNamed:@"home_VideoQustion"];
}
if ([title isEqualToString:@"小助手"]) {
if ([title isEqualToString:@"全科医生"]) {
leftImg.image = [UIImage imageNamed:@"home_small"];
}
leftImg.backgroundColor = [UIColor greenColor];
@@ -643,6 +746,7 @@
numLabel.layer.masksToBounds = true;
numLabel.backgroundColor = UIColorHex(#21BEBD);
numLabel.tag = NumberTag;
numLabel.hidden = YES;
[replayBtn addSubview:numLabel];
//进行中
UIButton * qustionBtn = [[UIButton alloc] initWithFrame:CGRectMake(view.width/3 , linView.bottom ,view.width/3 , 45)];
@@ -663,6 +767,7 @@
jingxingLabel.layer.masksToBounds = true;
jingxingLabel.backgroundColor = UIColorHex(#21BEBD);
jingxingLabel.tag = NumberTag + 10;
jingxingLabel.hidden = YES;
[qustionBtn addSubview:jingxingLabel];
//完成
@@ -683,6 +788,7 @@
wanchengLabel.layer.masksToBounds = true;
wanchengLabel.backgroundColor = UIColorHex(#21BEBD);
wanchengLabel.tag = NumberTag + 20;
wanchengLabel.hidden = YES;
[wanchengBtn addSubview:wanchengLabel];
return view;
@@ -750,25 +856,317 @@
}
//在线时票据过期:此时您需要生成新的 userSig,并再次重新调用初始化。
// 异地登录/账号被踢:弹提示回到登录页
- (void)onKickedOffline {
[XJDCommonUtils keyedArchiverWithData:nil key:LoginUserInfo];
[ESCTUIManager outLoginTUISDK];
KPostNotification(KNotificationLoginStateChange, @NO);
[XJDCommonUtils keyedArchiverWithData:nil key:LoginUserInfo];
dispatch_async(dispatch_get_main_queue(), ^{
[EasyTextView showErrorText:@"账号在其他设备登录,请重新登录"];
KPostNotification(KNotificationLoginStateChange, @NO);
});
}
- (void)onConnectFailed:(int)code err:(NSString *)err {
[self loginImAccount];
}
#pragma mark - ————— 应急求助 —————
/*
#pragma mark - Navigation
- (void)sosEmergencyAction {
[self showMBProgressHUDWithString:@"加载中..." autoHidden:false];
// 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.
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:@(1) forKey:@"pageNo"];
[parmDic setObject:@"10" forKey:@"pageSize"];
XJDNetAPI * api = [[XJDNetAPI alloc] init:self tag:@"myParticipatedOrders" NeedToken:@""];
[api getMyParticipatedOrders:parmDic];
}
#pragma mark - 工单列表弹窗
- (void)showOrderListPopup:(NSArray<XJParticipatedOrderModel *> *)models {
self.selectedOrderIndex = -1;
UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow;
UIView *mask = [[UIView alloc] initWithFrame:keyWindow.bounds];
mask.backgroundColor = [UIColor colorWithWhite:0 alpha:0.4];
mask.tag = 9001;
[keyWindow addSubview:mask];
CGFloat panelW = kScreenWidth - 46;
CGFloat panelH = 490;
CGFloat panelX = 23;
CGFloat panelY = (kScreenHeight - panelH) * 0.45;
UIView *panel = [[UIView alloc] initWithFrame:CGRectMake(panelX, panelY, panelW, panelH)];
panel.backgroundColor = KWhiteColor;
panel.layer.cornerRadius = 23;
panel.layer.masksToBounds = YES;
panel.tag = 9002;
[keyWindow addSubview:panel];
UILabel *titleLbl = [[UILabel alloc] init];
titleLbl.text = @"请选择正在应急的工单";
titleLbl.font = [UIFont systemFontOfSize:18 weight:UIFontWeightBold];
titleLbl.textColor = UIColorHex(0x252535);
[titleLbl sizeToFit];
titleLbl.top = 24;
titleLbl.centerX = panelW / 2;
[panel addSubview:titleLbl];
UIButton *closeBtn = [[UIButton alloc] initWithFrame:CGRectMake(panelW - 20 - 24, 21, 24, 24)];
closeBtn.backgroundColor = UIColorHex(0xF1F5F9);
closeBtn.layer.cornerRadius = 12;
UILabel *xLbl = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 24, 24)];
xLbl.text = @"\u2715"; xLbl.font = [UIFont systemFontOfSize:13];
xLbl.textColor = UIColorHex(0x77849E); xLbl.textAlignment = NSTextAlignmentCenter;
[closeBtn addSubview:xLbl];
[closeBtn addTarget:self action:@selector(dismissOrderPopup) forControlEvents:UIControlEventTouchUpInside];
[panel addSubview:closeBtn];
CGFloat sep1Y = titleLbl.bottom + 16;
UIView *sep1 = [[UIView alloc] initWithFrame:CGRectMake(0, sep1Y, panelW, 1)];
sep1.backgroundColor = UIColorHex(0xEAECFA);
[panel addSubview:sep1];
CGFloat btnH = 44;
UIButton *confirmBtn = [[UIButton alloc] initWithFrame:CGRectMake(20, panelH - 12 - btnH, panelW - 40, btnH)];
confirmBtn.backgroundColor = UIColorHex(0x2EB8B2);
confirmBtn.layer.cornerRadius = 12;
[confirmBtn setTitle:@"确认选择" forState:UIControlStateNormal];
[confirmBtn setTitleColor:KWhiteColor forState:UIControlStateNormal];
confirmBtn.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightBold];
[confirmBtn addTarget:self action:@selector(onConfirmOrderSelection) forControlEvents:UIControlEventTouchUpInside];
[panel addSubview:confirmBtn];
CGFloat sep2Y = confirmBtn.top - 12;
UIView *sep2 = [[UIView alloc] initWithFrame:CGRectMake(0, sep2Y, panelW, 1)];
sep2.backgroundColor = UIColorHex(0xEAECFA);
[panel addSubview:sep2];
CGFloat tableY = sep1Y + 1, tableH = sep2Y - tableY;
self.orderPopupTable = [[UITableView alloc] initWithFrame:CGRectMake(0, tableY, panelW, tableH) style:UITableViewStylePlain];
self.orderPopupTable.delegate = self;
self.orderPopupTable.dataSource = self;
self.orderPopupTable.separatorStyle = UITableViewCellSeparatorStyleNone;
self.orderPopupTable.showsVerticalScrollIndicator = NO;
self.orderPopupTable.backgroundColor = KWhiteColor;
self.orderPopupTable.rowHeight = UITableViewAutomaticDimension;
self.orderPopupTable.estimatedRowHeight = 160;
if (@available(iOS 15.0, *)) { self.orderPopupTable.sectionHeaderTopPadding = 0; }
self.orderPopupTable.contentInset = UIEdgeInsetsZero;
__weak typeof(self) wk = self;
self.orderPopupTable.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
wk.orderPage = 1; NSMutableDictionary *p = [NSMutableDictionary dictionary];
p[@"pageNo"] = @(1); p[@"pageSize"] = @(10);
[[[XJDNetAPI alloc] init:wk tag:@"myParticipatedOrders" NeedToken:@""] getMyParticipatedOrders:p];
}];
self.orderPopupTable.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
wk.orderPage++; NSMutableDictionary *p = [NSMutableDictionary dictionary];
p[@"pageNo"] = @(wk.orderPage); p[@"pageSize"] = @(10);
[[[XJDNetAPI alloc] init:wk tag:@"myParticipatedOrders" NeedToken:@""] getMyParticipatedOrders:p];
}];
[panel addSubview:self.orderPopupTable];
panel.alpha = 0;
[UIView animateWithDuration:0.25 animations:^{ panel.alpha = 1; }];
}
- (void)dismissOrderPopup {
[[UIApplication.sharedApplication.keyWindow viewWithTag:9001] removeFromSuperview];
[[UIApplication.sharedApplication.keyWindow viewWithTag:9002] removeFromSuperview];
}
- (void)onConfirmOrderSelection {
if (self.selectedOrderIndex < 0 || self.selectedOrderIndex >= self.orderList.count) return;
XJParticipatedOrderModel *m = self.orderList[self.selectedOrderIndex];
[self dismissOrderPopup];
ChatViewController *chatVC = [[ChatViewController alloc] init];
chatVC.isGroupID = YES;
chatVC.isFromFirstAid = YES;
chatVC.isVideo = YES;
chatVC.chatID = m.sessionId;
chatVC.navTitle = @"应急求助";
[self.navigationController pushViewController:chatVC animated:YES];
}
#pragma mark - 工单列表 TableView
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if (tableView == self.orderPopupTable) return self.orderList.count;
return 0;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
if (tableView == self.orderPopupTable) return 0.01;
return 0;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
if (tableView == self.orderPopupTable) return [UIView new];
return nil;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cid = @"OrderCell";
if (tableView != self.orderPopupTable) return [UITableViewCell new];
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cid];
XJParticipatedOrderModel *m = self.orderList[indexPath.row];
BOOL selected = (indexPath.row == self.selectedOrderIndex);
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cid];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.backgroundColor = KWhiteColor;
UIView *container = [[UIView alloc] init];
container.tag = 200;
container.layer.cornerRadius = 8;
container.layer.borderWidth = 1;
[cell.contentView addSubview:container];
[container mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.top.equalTo(cell.contentView).offset(12);
make.right.equalTo(cell.contentView).offset(-12);
make.bottom.equalTo(cell.contentView);
}];
UILabel *nameLbl = [[UILabel alloc] init];
nameLbl.tag = 201;
nameLbl.font = [UIFont systemFontOfSize:15 weight:UIFontWeightBold];
[container addSubview:nameLbl];
[nameLbl mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.top.equalTo(container).offset(16);
}];
UIImageView *indicator = [[UIImageView alloc] init];
indicator.tag = 202;
indicator.contentMode = UIViewContentModeScaleAspectFit;
[container addSubview:indicator];
[indicator mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(container).offset(-16);
make.top.equalTo(container).offset(14);
make.size.mas_equalTo(CGSizeMake(18, 18));
}];
UIView *deptBg = [[UIView alloc] init];
deptBg.tag = 209;
deptBg.layer.cornerRadius = 4;
deptBg.layer.masksToBounds = YES;
[container addSubview:deptBg];
[deptBg mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(container).offset(16);
make.top.equalTo(nameLbl.mas_bottom).offset(8);
make.height.mas_equalTo(20);
}];
UILabel *deptLbl = [[UILabel alloc] init];
deptLbl.tag = 203;
deptLbl.font = [UIFont systemFontOfSize:11 weight:UIFontWeightBold];
deptLbl.textAlignment = NSTextAlignmentCenter;
[deptBg addSubview:deptLbl];
[deptLbl mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(deptBg).offset(8);
make.right.equalTo(deptBg).offset(-8);
make.top.equalTo(deptBg).offset(3);
make.bottom.equalTo(deptBg).offset(-3);
}];
UIView *line = [[UIView alloc] init];
line.tag = 204;
line.backgroundColor = UIColorHex(0xEAECFA);
[container addSubview:line];
[line mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(container).offset(16);
make.right.equalTo(container).offset(-16);
make.top.equalTo(deptLbl.mas_bottom).offset(12);
make.height.mas_equalTo(1);
}];
UIImageView *orgIcon = [[UIImageView alloc] init];
orgIcon.tag = 205;
orgIcon.contentMode = UIViewContentModeScaleAspectFit;
[container addSubview:orgIcon];
[orgIcon mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(container).offset(16);
make.top.equalTo(line.mas_bottom).offset(12);
make.size.mas_equalTo(CGSizeMake(16, 16));
}];
UILabel *orgLbl = [[UILabel alloc] init];
orgLbl.tag = 206;
orgLbl.font = [UIFont systemFontOfSize:13 weight:UIFontWeightMedium];
orgLbl.numberOfLines = 0;
[container addSubview:orgLbl];
[orgLbl mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(orgIcon.mas_right).offset(8);
make.top.equalTo(line.mas_bottom).offset(12);
make.right.equalTo(container).offset(-16);
}];
UIImageView *timeIcon = [[UIImageView alloc] init];
timeIcon.tag = 207;
timeIcon.contentMode = UIViewContentModeScaleAspectFit;
[container addSubview:timeIcon];
[timeIcon mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(container).offset(16);
make.top.equalTo(orgLbl.mas_bottom).offset(15);
make.size.mas_equalTo(CGSizeMake(16, 16));
}];
UILabel *timeLbl = [[UILabel alloc] init];
timeLbl.tag = 208;
timeLbl.font = [UIFont systemFontOfSize:13 weight:UIFontWeightMedium];
[container addSubview:timeLbl];
[timeLbl mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(timeIcon.mas_right).offset(8);
make.centerY.equalTo(timeIcon);
make.right.equalTo(container).offset(-16);
make.bottom.equalTo(container).offset(-16);
}];
}
UIView *container = [cell.contentView viewWithTag:200];
UILabel *nameLbl = [container viewWithTag:201];
UIImageView *indicator = [container viewWithTag:202];
UIView *deptBg = [container viewWithTag:209];
UILabel *deptLbl = [container viewWithTag:203];
UIImageView *orgIcon = [container viewWithTag:205];
UILabel *orgLbl = [container viewWithTag:206];
UIImageView *timeIcon = [container viewWithTag:207];
UILabel *timeLbl = [container viewWithTag:208];
if (selected) {
container.layer.borderColor = UIColorHex(0x2EB8B280).CGColor;
container.backgroundColor = UIColorHex(0x2EB8B20F);
deptLbl.textColor = UIColorHex(0x2EB8B2); deptBg.backgroundColor = UIColorHex(0x2EB8B21A);
orgLbl.textColor = UIColorHex(0x2EB8B2);
timeLbl.textColor = UIColorHex(0x2EB8B2);
} else {
container.layer.borderColor = UIColorHex(0xE6E6EA).CGColor;
container.backgroundColor = KWhiteColor;
deptLbl.textColor = UIColorHex(0x77849E); deptBg.backgroundColor = UIColorHex(0x77849E1A);
orgLbl.textColor = UIColorHex(0x77849E);
timeLbl.textColor = UIColorHex(0x77849E);
}
nameLbl.textColor = UIColorHex(0x252535);
nameLbl.text = m.salvageUserName ?: @"--";
deptLbl.text = [NSString stringWithFormat:@" %@ ", m.deptName ?: @""];
indicator.image = [UIImage imageNamed:selected ? @"order_selected" : @"order_unselected"];
orgIcon.image = [UIImage imageNamed:selected ? @"org_selected" : @"org_unselected"];
orgLbl.text = m.orgName ?: @"";
timeIcon.image = [UIImage imageNamed:selected ? @"time_selected" : @"time_unselected"];
timeLbl.text = m.createTime.length > 0 ? [NSString stringWithFormat:@"求助时间:%@", m.createTime] : @"";
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if (tableView == self.orderPopupTable) {
self.selectedOrderIndex = indexPath.row;
[tableView reloadData];
}
}
*/
@end
@@ -0,0 +1,16 @@
//
// XJDSOSDoctorDetailVC.h
// DoctorXinjiang
//
#import "YXBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface XJDSOSDoctorDetailVC : YXBaseViewController
@property (nonatomic, copy) NSString * sessionId;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,131 @@
//
// XJDSOSDoctorDetailVC.m
// DoctorXinjiang
//
#import "XJDSOSDoctorDetailVC.h"
#import "XJDSOSDoctorDetailInfoModel.h"
#import "XJDSOSDoctorModel.h"
@interface XJDSOSDoctorDetailVC ()
@property (nonatomic, strong) UIScrollView * mainScrollView;
@property (nonatomic, strong) XJDSOSDoctorDetailInfoModel * detailModel;
@end
@implementation XJDSOSDoctorDetailVC
- (void)viewDidLoad {
[super viewDidLoad];
self.isHidenNaviBar = false;
self.navigationItem.title = @"应急就医";
self.view.backgroundColor = CViewBgColor;
[self createUI];
[self loadData];
}
- (void)createUI {
self.mainScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight - kTopHeight)];
self.mainScrollView.backgroundColor = CViewBgColor;
[self.view addSubview:self.mainScrollView];
}
- (void)loadData {
[self showMBProgressHUDWithString:@"加载中..." autoHidden:false];
NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
[parmDic setObject:self.sessionId forKey:@"id"];
XJDNetAPI * detailApi = [[XJDNetAPI alloc] init:self tag:@"SOSDETAIL" NeedToken:@""];
[detailApi getSOSDoctorDetailInfo:parmDic];
}
- (void)Failed:(NSString*)message tag:(NSString*)tag {
[self hiddenAllMBProgressHUD];
[EasyTextView showErrorText:message];
}
- (void)Sucess:(id)response tag:(NSString*)tag {
if ([tag isEqualToString:@"SOSDETAIL"]) {
[self hiddenAllMBProgressHUD];
NSDictionary * dic = response;
self.detailModel = [XJDSOSDoctorDetailInfoModel modelWithDictionary:dic];
[self buildDetailUI];
}
}
- (void)buildDetailUI {
CGFloat topY = 10;
CGFloat cardW = kScreenWidth - 30;
CGFloat cardX = 15;
// 工单信息卡片
UIView * infoCard = [self createInfoCard:CGRectMake(cardX, topY, cardW, 0)];
[self.mainScrollView addSubview:infoCard];
topY = infoCard.bottom + 10;
self.mainScrollView.contentSize = CGSizeMake(kScreenWidth, topY + 20);
}
- (UIView *)createInfoCard:(CGRect)frame {
UIView * card = [[UIView alloc] initWithFrame:frame];
card.backgroundColor = KWhiteColor;
card.layer.cornerRadius = 10;
card.layer.masksToBounds = YES;
CGFloat y = 15;
CGFloat leftX = 15;
CGFloat rightX = card.width - 15;
// 标题
UILabel * titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(leftX, y, card.width - 30, 16)];
titleLabel.text = @"工单信息";
titleLabel.font = BOLDSYSTEMFONT(16);
titleLabel.textColor = CFontColor1;
[card addSubview:titleLabel];
y = titleLabel.bottom + 15;
NSArray * infos = @[
@[@"求助人", self.detailModel.initiatorUserName ?: @"--"],
@[@"求助人性别", [self.detailModel.initiatorUserSex integerValue] == 1 ? @"" : @""],
@[@"求助人年龄", self.detailModel.initiatorUserAge ?: @"--"],
@[@"求助人手机", self.detailModel.initiatorUserMobile ?: @"--"],
@[@"求助人部门", self.detailModel.initiatorUserDepart ?: @"--"],
@[@"派单医院", self.detailModel.sendOrderHospital ?: @"--"],
@[@"接单医生", self.detailModel.stationUserName ?: @"--"],
@[@"医生手机", self.detailModel.stationUserMobile ?: @"--"],
@[@"医生部门", self.detailModel.stationUserDepart ?: @"--"],
@[@"状态", self.detailModel.orderStatus_dictText ?: @"--"],
@[@"创建时间", self.detailModel.createTime ?: @"--"],
];
for (NSArray * info in infos) {
UIView * row = [self createInfoRow:CGRectMake(leftX, y, card.width - 30, 32) label:info[0] value:info[1]];
[card addSubview:row];
y = row.bottom;
}
card.height = y + 15;
return card;
}
- (UIView *)createInfoRow:(CGRect)frame label:(NSString *)label value:(NSString *)value {
UIView * row = [[UIView alloc] initWithFrame:frame];
UILabel * labelL = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, frame.size.height)];
labelL.text = label;
labelL.font = SYSTEMFONT(14);
labelL.textColor = UIColorHex(#666666);
[row addSubview:labelL];
UILabel * valueL = [[UILabel alloc] initWithFrame:CGRectMake(110, 0, frame.size.width - 110, frame.size.height)];
valueL.text = value;
valueL.font = SYSTEMFONT(14);
valueL.textColor = CFontColor1;
valueL.textAlignment = NSTextAlignmentRight;
[row addSubview:valueL];
return row;
}
@end
@@ -0,0 +1,26 @@
//
// UPAppVesionModel.h
// DoctorXinjiang
//
// Created by Apple on 2025/12/25.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface UPAppVesionModel : NSObject
@property (nonatomic, copy) NSString * deviceType;
@property (nonatomic, strong) NSArray * ignoreFlag;
@property (nonatomic, copy) NSString * appUrl;
@property (nonatomic, copy) NSString * appStatus;
@property (nonatomic, copy) NSString * forced;
@property (nonatomic, assign) NSInteger versionNo;
@property (nonatomic, copy) NSString * updateContent;
@property (nonatomic, copy) NSString * versionName;
@property (nonatomic, copy) NSString * updateTime;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,12 @@
//
// UPAppVesionModel.m
// DoctorXinjiang
//
// Created by Apple on 2025/12/25.
//
#import "UPAppVesionModel.h"
@implementation UPAppVesionModel
@end
@@ -0,0 +1,103 @@
//
// XJDSOSDoctorDetailInfoModel.h
// DoctorXinjiang
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface XJDSOSDoctorDetailHistory : NSObject
@property (nonatomic, copy) NSString * status;
@property (nonatomic, copy) NSString * stationUserId;
@property (nonatomic, copy) NSString * stationUserName;
@property (nonatomic, copy) NSString * stationUserSex;
@property (nonatomic, copy) NSString * accept_dictText;
@property (nonatomic, copy) NSString * updateTime;
@property (nonatomic, copy) NSString * stationBusiness_dictText;
@property (nonatomic, copy) NSString * sendOrderHospital;
@property (nonatomic, copy) NSString * orderId;
@property (nonatomic, copy) NSString * stationBusiness;
@property (nonatomic, copy) NSString * createTime;
@property (nonatomic, copy) NSString * createBy;
@property (nonatomic, copy) NSString * history_id;
@property (nonatomic, copy) NSString * transferOrderTime;
@end
@interface XJDSOSDoctorDetailInfoModel : NSObject
@property (nonatomic, copy) NSString * createTimeEnd;
@property (nonatomic, copy) NSString * majorSalvageOpinion;
@property (nonatomic, copy) NSString * infoDesc;
@property (nonatomic, copy) NSString * delFlag;
@property (nonatomic, copy) NSString * detail_id;
@property (nonatomic, copy) NSString * initiatorUserDepart;
@property (nonatomic, copy) NSString * stationUserMobile;
@property (nonatomic, copy) NSString * memo;
@property (nonatomic, copy) NSString * orderDetail;
@property (nonatomic, copy) NSString * stationUserAvatar;
@property (nonatomic, copy) NSString * updateBy;
@property (nonatomic, copy) NSString * sessionNow;
@property (nonatomic, copy) NSString * stationUserSex;
@property (nonatomic, copy) NSString * stationUserId;
@property (nonatomic, copy) NSString * isDispatch_dictText;
@property (nonatomic, copy) NSString * createBy;
@property (nonatomic, copy) NSString * stationRejectionTime;
@property (nonatomic, copy) NSString * initiatorUserName;
@property (nonatomic, copy) NSString * salvageUserAge;
@property (nonatomic, copy) NSString * createTime;
@property (nonatomic, copy) NSString * resourceId;
@property (nonatomic, copy) NSString * operationUserSex;
@property (nonatomic, copy) NSString * stationBusiness;
@property (nonatomic, copy) NSString * majorUserSex;
@property (nonatomic, copy) NSString * status;
@property (nonatomic, copy) NSString * operationUserName;
@property (nonatomic, copy) NSString * stationUserDepart;
@property (nonatomic, copy) NSString * salvageUserSecondDepart;
@property (nonatomic, copy) NSString * majorUserId;
@property (nonatomic, copy) NSString * initiatorUserSex;
@property (nonatomic, strong) NSArray<XJDSOSDoctorDetailHistory *> * orderSendRecordList;
@property (nonatomic, copy) NSString * stationBusiness_dictText;
@property (nonatomic, copy) NSString * majorResponseTime;
@property (nonatomic, copy) NSString * salvageUserMobile;
@property (nonatomic, copy) NSString * initiatorUserId;
@property (nonatomic, copy) NSString * orderStatus;
@property (nonatomic, copy) NSString * salvageUserAvatar;
@property (nonatomic, copy) NSString * initiatorType;
@property (nonatomic, copy) NSString * initiatorUserAge;
@property (nonatomic, copy) NSString * sessionId;
@property (nonatomic, copy) NSString * salvageUserName;
@property (nonatomic, copy) NSString * initiatorUserMobile;
@property (nonatomic, copy) NSString * stationUserName;
@property (nonatomic, copy) NSString * updateTime;
@property (nonatomic, copy) NSString * operationUserMobile;
@property (nonatomic, copy) NSString * majorUserName;
@property (nonatomic, copy) NSString * isDispatch;
@property (nonatomic, copy) NSString * orderStatus_dictText;
@property (nonatomic, copy) NSString * resourceName;
@property (nonatomic, copy) NSString * initiatorUserSecondDepart;
@property (nonatomic, copy) NSString * salvageUserDepart;
@property (nonatomic, copy) NSString * orderOverTime;
@property (nonatomic, copy) NSString * initiatorUserIdCard;
@property (nonatomic, copy) NSString * initiatorUserAvatar;
@property (nonatomic, copy) NSString * salvageUserId;
@property (nonatomic, copy) NSString * operationUserId;
@property (nonatomic, copy) NSString * operationResponseTime;
@property (nonatomic, copy) NSString * stationResponseTime;
@property (nonatomic, copy) NSString * operationSendOrderTime;
@property (nonatomic, assign) BOOL isFill;
@property (nonatomic, copy) NSString * sendOrderHospital;
@property (nonatomic, copy) NSString * salvageUserIdCard;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,33 @@
//
// XJDSOSDoctorDetailInfoModel.m
// DoctorXinjiang
//
#import "XJDSOSDoctorDetailInfoModel.h"
@implementation XJDSOSDoctorDetailHistory
+ (NSDictionary *)modelCustomPropertyMapper
{
NSDictionary * dic =@{@"history_id" :@"id"};
return dic;
}
@end
@implementation XJDSOSDoctorDetailInfoModel
+ (NSDictionary *)modelContainerPropertyGenericClass
{
return @{
@"orderSendRecordList":[XJDSOSDoctorDetailHistory class]
};
}
+ (NSDictionary *)modelCustomPropertyMapper
{
NSDictionary * dic =@{@"detail_id" :@"id"};
return dic;
}
@end
@@ -0,0 +1,32 @@
//
// XJDSOSDoctorModel.h
// DoctorXinjiang
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface XJDSOSDoctorRecordListModel : NSObject
@property (nonatomic, copy) NSString * sos_id;
@property (nonatomic, copy) NSString * sessionId;
@property (nonatomic, copy) NSString * initiatorUserId;
@property (nonatomic, copy) NSString * initiatorUserName;
@property (nonatomic, copy) NSString * createTime;
@property (nonatomic, copy) NSString * initiatorUserSex;
@property (nonatomic, copy) NSString * orderStatus_dictText;
@property (nonatomic, copy) NSString * sendOrderHospital;
@property (nonatomic, copy) NSString * stationBusiness;
@property (nonatomic, copy) NSString * orderStatus;
@property (nonatomic, copy) NSString * stationBusiness_dictText;
@end
@interface XJDSOSDoctorModel : NSObject
@property (nonatomic, strong) NSArray <XJDSOSDoctorRecordListModel *>* records;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,27 @@
//
// XJDSOSDoctorModel.m
// DoctorXinjiang
//
#import "XJDSOSDoctorModel.h"
@implementation XJDSOSDoctorRecordListModel
+ (NSDictionary *)modelCustomPropertyMapper
{
NSDictionary * dic =@{@"sos_id" :@"id"};
return dic;
}
@end
@implementation XJDSOSDoctorModel
+ (NSDictionary *)modelContainerPropertyGenericClass
{
return @{
@"records":[XJDSOSDoctorRecordListModel class]
};
}
@end
@@ -0,0 +1,24 @@
//
// XJParticipatedOrderModel.h
// XinjiangProject
//
// 急救员 - 我参与的应急工单
//
#import <Foundation/Foundation.h>
@interface XJParticipatedOrderModel : NSObject
@property (nonatomic, copy) NSString *orderId;
@property (nonatomic, copy) NSString *sessionId;
@property (nonatomic, copy) NSString *salvageUserName;
@property (nonatomic, copy) NSString *salvageUserSex;
@property (nonatomic, copy) NSString *salvageUserAvatar;
@property (nonatomic, assign) NSInteger salvageUserAge;
@property (nonatomic, copy) NSString *salvageUserMobile;
@property (nonatomic, copy) NSString *orgName;
@property (nonatomic, copy) NSString *deptName;
@property (nonatomic, copy) NSString *orderStatus;
@property (nonatomic, copy) NSString *createTime;
@end
@@ -0,0 +1,15 @@
//
// XJParticipatedOrderModel.m
// XinjiangProject
//
#import "XJParticipatedOrderModel.h"
@implementation XJParticipatedOrderModel
+ (NSDictionary *)modelCustomPropertyMapper {
return @{@"createTime": @"initTime"};
}
@end
@@ -1,18 +0,0 @@
//
// DetailTitleView.h
// healthQuestion
//
// Created by 仁康信息 on 2023/4/27.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface DetailTitleView : UIView
@property (nonatomic, copy) NSString * createTime;
@end
NS_ASSUME_NONNULL_END
@@ -1,28 +0,0 @@
//
// SYLifeManagerCell.h
// shan
//
// Created by aDu on 2016/12/5.
// Copyright © 2016年 DuKaiShun. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "YXToolsModel.h"
@interface SYLifeManagerCell : UICollectionViewCell
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UIButton *button;
@property (nonatomic, strong) YXToolsModel *model;
@property (nonatomic, assign) BOOL inEditState; //是否处于编辑状态
- (void)setModel:(YXToolsModel *)model indexPaht:(NSIndexPath *)indexPath exist:(BOOL)exist;
- (void)setDataAry:(NSMutableArray *)dataAry groupAry:(NSMutableArray *)groupAry indexPath:(NSIndexPath *)indexPath;
@property (nonatomic, strong) UILabel *messageLabel;
- (void)addMeaageLabel;
@end
@@ -1,157 +0,0 @@
//
// SYLifeManagerCell.m
// shan
//
// Created by aDu on 2016/12/5.
// Copyright © 2016年 DuKaiShun. All rights reserved.
//
#import "SYLifeManagerCell.h"
#import "Masonry.h"
@interface SYLifeManagerCell ()
@property (nonatomic, strong) UIImageView *imageView;
@end
@implementation SYLifeManagerCell
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
self.backgroundColor = [UIColor whiteColor];
[self.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self).with.insets(UIEdgeInsetsMake(10, 15, 15, 15));
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.imageView.mas_bottom);
make.bottom.equalTo(self.mas_bottom);
make.left.and.right.equalTo(self);
}];
[self.button mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.mas_top);
make.right.equalTo(self.mas_right);
make.height.equalTo(@15);
make.width.equalTo(@15);
}];
self.button.hidden = YES;
}
return self;
}
- (void)addMeaageLabel
{
[self.messageLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self).insets(UIEdgeInsetsMake(0, 0, 0, 0));
}];
}
- (void)setModel:(YXToolsModel *)model indexPaht:(NSIndexPath *)indexPath exist:(BOOL)exist
{
if (_model != model) {
self.titleLabel.text = model.title;
if (indexPath.section == 0) {
[self.button setBackgroundImage:[UIImage imageNamed:@"life_reduce"] forState:UIControlStateNormal];
self.button.userInteractionEnabled = YES;
} else {
if (exist) {
[self.button setBackgroundImage:[UIImage imageNamed:@"life_exist"] forState:UIControlStateNormal];
self.button.userInteractionEnabled = NO;
} else {
[self.button setBackgroundImage:[UIImage imageNamed:@"life_add"] forState:UIControlStateNormal];
self.button.userInteractionEnabled = YES;
}
}
}
_model = model;
}
- (void)setDataAry:(NSMutableArray *)dataAry groupAry:(NSMutableArray *)groupAry indexPath:(NSIndexPath *)indexPath
{
YXToolsModel *model;
if (indexPath.section == 0) {
model = dataAry[indexPath.row];
} else {
model = groupAry[indexPath.row];
}
self.titleLabel.text = model.title;
if (indexPath.section == 0) {
self.button.userInteractionEnabled = YES;
[self.button setBackgroundImage:[UIImage imageNamed:@"life_reduce"] forState:UIControlStateNormal];
} else {
if ([dataAry containsObject:model]) {
self.button.userInteractionEnabled = NO;
[self.button setBackgroundImage:[UIImage imageNamed:@"life_exist"] forState:UIControlStateNormal];
} else {
self.button.userInteractionEnabled = YES;
[self.button setBackgroundImage:[UIImage imageNamed:@"life_add"] forState:UIControlStateNormal];
}
}
}
#pragma mark - 是否处于编辑状态
- (void)setInEditState:(BOOL)inEditState
{
if (inEditState && _inEditState != inEditState) {
self.layer.borderWidth = 0.5;
self.layer.borderColor = [UIColor grayColor].CGColor;
self.button.hidden = NO;
} else {
self.layer.borderColor = [UIColor clearColor].CGColor;
self.button.hidden = YES;
}
}
#pragma mark - init
- (UIImageView *)imageView
{
if (!_imageView) {
_imageView = [[UIImageView alloc] init];
_imageView.image = [UIImage imageNamed:@"wallet_payChange"];
[self addSubview:_imageView];
}
return _imageView;
}
- (UILabel *)titleLabel
{
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.font = [UIFont systemFontOfSize:14];
_titleLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:_titleLabel];
}
return _titleLabel;
}
- (UILabel *)messageLabel
{
if (!_messageLabel) {
_messageLabel = [[UILabel alloc] init];
_messageLabel.font = [UIFont systemFontOfSize:12];
_messageLabel.textColor = [UIColor grayColor];
_messageLabel.textAlignment = NSTextAlignmentCenter;
_messageLabel.text = @"您还未添加任何应用\n长按下面的应用可以添加";
[self addSubview:_messageLabel];
}
return _messageLabel;
}
- (UIButton *)button
{
if (!_button) {
_button = [UIButton buttonWithType:UIButtonTypeCustom];
_button.layer.cornerRadius = 7.5;
[self addSubview:_button];
}
return _button;
}
@end
@@ -0,0 +1,19 @@
//
// XJDSOSDoctorTableView.h
// DoctorXinjiang
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
typedef void(^sosDoctorListActionBlock)(NSString * sessionId, NSString * hospitalId);
@interface XJDSOSDoctorTableView : UITableView
@property (nonatomic, strong) NSArray * dataArray;
@property (nonatomic, copy) sosDoctorListActionBlock recordBlock;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,87 @@
//
// XJDSOSDoctorTableView.m
// DoctorXinjiang
//
#import "XJDSOSDoctorTableView.h"
#import "XJDSOSDoctorTableViewCell.h"
@interface XJDSOSDoctorTableView ()<UITableViewDelegate,UITableViewDataSource>
@end
@implementation XJDSOSDoctorTableView
- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style {
if (self = [super initWithFrame:frame style:style]) {
[self createUI];
}
return self;
}
- (void)createUI {
if (@available(iOS 11.0, *)) {
self.estimatedRowHeight = 0;
self.estimatedSectionFooterHeight = 0;
self.estimatedSectionHeaderHeight = 0;
self.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}
self.delegate = self;
self.dataSource = self;
self.backgroundColor = UIColor.clearColor;
self.showsVerticalScrollIndicator = false;
self.showsHorizontalScrollIndicator = false;
self.separatorStyle = UITableViewCellSeparatorStyleNone;
self.estimatedRowHeight = 60;
self.rowHeight = UITableViewAutomaticDimension;
}
- (void)setDataArray:(NSArray *)dataArray {
_dataArray = dataArray;
[self reloadData];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return self.dataArray.count;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 1;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
XJDSOSDoctorTableViewCell * cell = [self dequeueReusableCellWithIdentifier:@"STATUSCELL"];
if (!cell) {
cell = [[XJDSOSDoctorTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"STATUSCELL"];
}
cell.model = self.dataArray[indexPath.section];
cell.backgroundColor = KWhiteColor;
cell.layer.cornerRadius = 10;
cell.layer.masksToBounds = YES;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
return 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 {
return [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 10)];
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
XJDSOSDoctorRecordListModel * model = self.dataArray[indexPath.section];
if (self.recordBlock) {
self.recordBlock(model.sos_id, model.sos_id);
}
}
@end
@@ -0,0 +1,17 @@
//
// XJDSOSDoctorTableViewCell.h
// DoctorXinjiang
//
#import <UIKit/UIKit.h>
#import "XJDSOSDoctorModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface XJDSOSDoctorTableViewCell : UITableViewCell
@property (nonatomic, strong) XJDSOSDoctorRecordListModel * model;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,99 @@
//
// XJDSOSDoctorTableViewCell.m
// DoctorXinjiang
//
#import "XJDSOSDoctorTableViewCell.h"
@interface XJDSOSDoctorTableViewCell ()
@property (nonatomic, strong) UILabel * nameLabel;
@property (nonatomic, strong) UILabel * timeLabel;
@property (nonatomic, strong) YYLabel * lookDetail;
@property (nonatomic, strong) UILabel * statusLabel;
@end
@implementation XJDSOSDoctorTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
[self createUI];
}
return self;
}
- (void)createUI {
self.nameLabel = [[UILabel alloc] init];
self.nameLabel.textColor = CFontColor1;
self.nameLabel.font = BOLDSYSTEMFONT(14);
self.nameLabel.textAlignment = NSTextAlignmentLeft;
[self.contentView addSubview:self.nameLabel];
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_offset(15);
make.top.mas_offset(16);
make.height.mas_offset(14);
}];
[self.nameLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
self.timeLabel = [[UILabel alloc] init];
self.timeLabel.textColor = UIColorHex(#333333);
self.timeLabel.font = MEDIUMFONT(14);
self.timeLabel.textAlignment = NSTextAlignmentLeft;
[self.contentView addSubview:self.timeLabel];
[self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_offset(15);
make.top.mas_equalTo(self.nameLabel.mas_bottom).offset(14);
make.height.mas_offset(14);
make.bottom.mas_offset(-20);
}];
[self.timeLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
UIImageView * accowImg = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"garyRight"]];
[self.contentView addSubview:accowImg];
[accowImg mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_offset(-15);
make.top.mas_offset(16);
make.height.mas_offset(14);
make.width.mas_offset(8);
}];
self.lookDetail = [[YYLabel alloc] init];
self.lookDetail.textColor = UIColorHex(#999999);
self.lookDetail.font = MEDIUMFONT(13);
self.lookDetail.text = @"查看详情";
self.lookDetail.textAlignment = NSTextAlignmentRight;
[self.contentView addSubview:self.lookDetail];
[self.lookDetail mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(accowImg.mas_left).offset(-6);
make.top.mas_offset(16);
make.height.mas_offset(14);
make.width.mas_offset(100);
}];
self.statusLabel = [[UILabel alloc] init];
self.statusLabel.textColor = UIColorHex(#16C716);
self.statusLabel.font = MEDIUMFONT(14);
self.statusLabel.textAlignment = NSTextAlignmentRight;
[self.contentView addSubview:self.statusLabel];
[self.statusLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_offset(-15);
make.top.mas_equalTo(self.lookDetail.mas_bottom).offset(18);
make.height.mas_offset(13);
}];
}
- (void)setModel:(XJDSOSDoctorRecordListModel *)model {
_model = model;
self.nameLabel.text = [NSString stringWithFormat:@"求助人:%@",_model.initiatorUserName];
self.timeLabel.text = [NSString stringWithFormat:@"求救时间:%@",_model.createTime];
self.statusLabel.text = model.orderStatus_dictText;
}
@end
@@ -76,7 +76,7 @@
UIImageView * cenetrImg = [[UIImageView alloc] initWithFrame:CGRectMake(0, kRealValue(70), kRealValue(68), kRealValue(68))];
cenetrImg.centerX = self.view.centerX;
cenetrImg.image = IMAGE_NAMED(@"login_icon");
cenetrImg.image = IMAGE_NAMED(@"loginCenterIcon");
[self.view addSubview:cenetrImg];
@@ -113,7 +113,7 @@
CGFloat mager = (toolsView.width - kRealValue(28) - kRealValue(47) * 4)/3;
NSArray * array = @[@[@"小助手",@"smallHelp_icon"],@[@"咨询统计",@"questionStatistics_icon"],@[@"排班设置",@"schedulingSeting_icon"],@[@"暂停服务",@"stopHelp_icon"]];
NSArray * array = @[@[@"全科医生",@"smallHelp_icon"],@[@"咨询统计",@"questionStatistics_icon"],@[@"排班设置",@"schedulingSeting_icon"],@[@"暂停服务",@"stopHelp_icon"]];
for (int i = 0; i < array.count; i ++) {
UIImageView * toolsImg = [[UIImageView alloc] initWithFrame:CGRectMake(kRealValue(14) + (kRealValue(47) + mager) * i , kRealValue(17), kRealValue(47), kRealValue(47))];
@@ -338,7 +338,7 @@
chatVC.eableSendReport = YES;
chatVC.eableMapTools = false;
chatVC.isVideo = false;
chatVC.navTitle = @"小助手";
chatVC.navTitle = @"全科医生";
chatVC.eablehaveHelathData = YES;
chatVC.memberSex = @"2";
[self.navigationController pushViewController:chatVC animated:YES];
@@ -54,6 +54,12 @@ NS_ASSUME_NONNULL_BEGIN
//咨询人男女
@property (nonatomic, copy) NSString * memberSex;
// 急救员入口标记
@property (nonatomic, assign) BOOL isFromFirstAid;
// 从急救员入口进入应急群聊
- (void)enterChatWithSessionId:(NSString *)sessionId title:(NSString *)title;
@end
NS_ASSUME_NONNULL_END
@@ -19,6 +19,13 @@
#import <TUICallEngine/TUICallEngine.h>
#import <TUICallEngine/TUICallObserver.h>
#import "TUIGroupChatViewController.h"
#import <TUICallKit/TUICallKit.h>
#import "TUICallingUserManager.h"
#import "TUICallingUserModel.h"
#import "XJParticipatedOrderModel.h"
#import "XJSelectContactViewController.h"
#import <MJRefresh/MJRefresh.h>
#import <TUICore/TUIDefine.h>
//自定义map
#define BussinessID_CustomMap @"TIMLocationElem"
//自定义评论
@@ -31,7 +38,7 @@
@class TUIChatDataProvider;
@interface ChatViewController ()<V2TIMSimpleMsgListener,TUIChatBaseDataProviderDelegate,IMCustomDeleagte,TUIMessageCellDelegate,TUIBaseMessageControllerDelegate,TUICallObserver>
@interface ChatViewController ()<V2TIMSimpleMsgListener,TUIChatBaseDataProviderDelegate,IMCustomDeleagte,TUIMessageCellDelegate,TUIBaseMessageControllerDelegate,TUICallObserver,V2TIMConversationListener,V2TIMGroupListener,UIGestureRecognizerDelegate,UITableViewDelegate,UITableViewDataSource>
@property (nonatomic, strong) TUIC2CChatViewController * vc;
@property (nonatomic, strong) TUIGroupChatViewController * groupvc;
@@ -39,6 +46,18 @@
@property (nonatomic, assign) CGFloat starNumber;
@property (nonatomic, strong) NSString * evlationConnte;
// 急救员相关
@property (nonatomic, strong) UIView *memberPanel;
@property (nonatomic, strong) UIView *memberOverlay;
@property (nonatomic, strong) UITableView *memberTableView;
@property (nonatomic, strong) UILabel *memberTitleLabel;
@property (nonatomic, strong) NSMutableArray<NSDictionary *> *memberList;
@property (nonatomic, strong) UIImageView *refreshIcon;
@property (nonatomic, strong) NSMutableArray<XJParticipatedOrderModel *> *orderList;
@property (nonatomic, assign) NSInteger orderPage;
@property (nonatomic, strong) UITableView *orderPopupTable;
@property (nonatomic, assign) NSInteger selectedOrderIndex;
@end
@implementation ChatViewController
@@ -52,6 +71,8 @@
[[V2TIMManager sharedInstance] addSimpleMsgListener:self];
[[TUICallEngine createInstance] addObserver:self];
[[V2TIMManager sharedInstance] addConversationListener:self];
[[V2TIMManager sharedInstance] addGroupListener:self];
// IMUserInfoModel * model = [XJDCommonUtils keyedUnarchiverWithKey:IMLoginUserInfo];
// [[TUICallEngine createInstance] init:[model.sdkAppId intValue] userId:model.userId userSig:model.userSig succ:^{
//
@@ -78,16 +99,22 @@
// 显示翻译按钮
// TUIChatConfig.defaultConfig.enableTextTranslation = YES;
//不显示视频和语音
[TUIChatConfig defaultConfig].enableVideoCall = self.isVideo; // YES:开启,NO:关闭
[TUIChatConfig defaultConfig].enableAudioCall = self.isVideo; // YES:开启,NO:关闭
[TUIChatConfig defaultConfig].enableVideoCall = self.isVideo;
[TUIChatConfig defaultConfig].enableAudioCall = self.isFromFirstAid ? NO : self.isVideo;
[TUIChatConfig defaultConfig].backgroudColor = UIColorHex(#EEEEEE);
[TUIConfig defaultConfig].defaultAvatarImage = [UIImage imageNamed:@"heard_man"];
[TUIConfig defaultConfig].avatarType = TAvatarTypeRounded;
TUIChatConfig.defaultConfig.enableTypingStatus = NO;
//是否显示发送报告
[TUIChatConfig defaultConfig].enableSendReportCall = self.eableSendReport;
[TUIChatConfig defaultConfig].enableSendReportCall = true;
[TUIChatConfig defaultConfig].enableSendHealthDataCall = self.eablehaveHelathData;
[TUIChatConfig defaultConfig].enableMapCall = self.eableMapTools;
// 急救员入口隐藏结束咨询、档案、语音通话
if (self.isFromFirstAid) {
[TUIChatConfig defaultConfig].enableEndConsultation = NO;
[TUIChatConfig defaultConfig].enableSendHealthDataCall = YES;
}
TUIConfig *config = [TUIConfig defaultConfig];
config.avatarType = TAvatarTypeRounded;
// 修改默认头像
@@ -140,6 +167,16 @@
// 把 TUIC2CChatViewController 添加到自己的 ViewController
// 右上角三个点(仅急救员入口显示)
if (self.isFromFirstAid) {
UIButton *moreBtn = [UIButton buttonWithType:UIButtonTypeSystem];
[moreBtn setTitle:@"···" forState:UIControlStateNormal];
moreBtn.titleLabel.font = [UIFont boldSystemFontOfSize:22];
[moreBtn setTitleColor:KWhiteColor forState:UIControlStateNormal];
[moreBtn addTarget:self action:@selector(moreAction) forControlEvents:UIControlEventTouchUpInside];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:moreBtn];
}
if ([self.tfNew integerValue] == 1) {
[ESCTUIManager sendGroupVideo:self.chatID withUserIdList:self.member];
@@ -366,45 +403,6 @@
[self.navigationController pushViewController:currVC animated:YES];
}
#pragma mark:网络请求
- (void)Failed:(NSString*)message tag:(NSString*)tag
{
[self showMBProgressHUDOnlyWithString:message];
[self hiddenAllMBProgressHUD];
}
- (void)Sucess:(id)response tag:(NSString*)tag
{
if ([tag isEqualToString:@"ENDSOSAPI"])
{
NSDictionary * parmDic = response;
if( self.isGroupID == false) {
self.vc.inputController.view.hidden = YES;
}else
{
self.groupvc.inputController.view.hidden = YES;
}
}
if ([tag isEqualToString:@"ENDPICTUREAPI"]) {
if( self.isGroupID == false) {
self.vc.inputController.view.hidden = YES;
}else
{
self.groupvc.inputController.view.hidden = YES;
}
}
if ([tag isEqualToString:@"DoctorSource"]) {
}
}
- (void)doctorSourceWithStarNumaber:(CGFloat)starNumer withContext:(NSString *)connet isKnow:(NSString *)isNiming{
// NSMutableDictionary * parmDic = [[NSMutableDictionary alloc] init];
@@ -532,6 +530,639 @@
}
*/
#pragma mark - ————— 急救员 —————
- (void)enterChatWithSessionId:(NSString *)sessionId title:(NSString *)title {
if (!sessionId.length) return;
ChatViewController *chatVC = [[ChatViewController alloc] init];
chatVC.isGroupID = YES;
chatVC.isFromFirstAid = YES;
chatVC.isVideo = YES;
chatVC.chatID = sessionId;
chatVC.navTitle = title ?: @"应急求助";
[self.navigationController pushViewController:chatVC animated:YES];
}
- (void)callFirstAiderAction {
[self showMBProgressHUDWithString:@"加载中..." autoHidden:false];
self.orderPage = 1;
NSMutableDictionary *params = [NSMutableDictionary dictionary];
params[@"pageNo"] = @(self.orderPage);
params[@"pageSize"] = @(10);
XJDNetAPI *api = [[XJDNetAPI alloc] init:self tag:@"myParticipatedOrders" NeedToken:@""];
[api getMyParticipatedOrders:params];
}
#pragma mark - 工单列表弹窗
- (void)showOrderListPopup:(NSArray<XJParticipatedOrderModel *> *)models {
self.selectedOrderIndex = -1;
UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow;
UIView *mask = [[UIView alloc] initWithFrame:keyWindow.bounds];
mask.backgroundColor = [UIColor colorWithWhite:0 alpha:0.4];
mask.tag = 9001;
[keyWindow addSubview:mask];
CGFloat panelW = kScreenWidth - 46;
CGFloat panelH = 490;
CGFloat panelX = 23;
CGFloat panelY = (kScreenHeight - panelH) * 0.45;
UIView *panel = [[UIView alloc] initWithFrame:CGRectMake(panelX, panelY, panelW, panelH)];
panel.backgroundColor = KWhiteColor;
panel.layer.cornerRadius = 23;
panel.layer.masksToBounds = YES;
panel.tag = 9002;
[keyWindow addSubview:panel];
UILabel *titleLbl = [[UILabel alloc] init];
titleLbl.text = @"请选择正在应急的工单";
titleLbl.font = [UIFont systemFontOfSize:18 weight:UIFontWeightBold];
titleLbl.textColor = UIColorHex(0x252535);
[titleLbl sizeToFit];
titleLbl.top = 24;
titleLbl.centerX = panelW / 2;
[panel addSubview:titleLbl];
UIButton *closeBtn = [[UIButton alloc] initWithFrame:CGRectMake(panelW - 20 - 24, 21, 24, 24)];
closeBtn.backgroundColor = UIColorHex(0xF1F5F9);
closeBtn.layer.cornerRadius = 12;
UILabel *xLbl = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 24, 24)];
xLbl.text = @""; xLbl.font = [UIFont systemFontOfSize:13];
xLbl.textColor = UIColorHex(0x77849E); xLbl.textAlignment = NSTextAlignmentCenter;
[closeBtn addSubview:xLbl];
[closeBtn addTarget:self action:@selector(dismissOrderPopup) forControlEvents:UIControlEventTouchUpInside];
[panel addSubview:closeBtn];
CGFloat sep1Y = titleLbl.bottom + 16;
UIView *sep1 = [[UIView alloc] initWithFrame:CGRectMake(0, sep1Y, panelW, 1)];
sep1.backgroundColor = UIColorHex(0xEAECFA);
[panel addSubview:sep1];
CGFloat btnH = 44;
UIButton *confirmBtn = [[UIButton alloc] initWithFrame:CGRectMake(20, panelH - 12 - btnH, panelW - 40, btnH)];
confirmBtn.backgroundColor = UIColorHex(0x2EB8B2);
confirmBtn.layer.cornerRadius = 12;
[confirmBtn setTitle:@"确认选择" forState:UIControlStateNormal];
[confirmBtn setTitleColor:KWhiteColor forState:UIControlStateNormal];
confirmBtn.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightBold];
[confirmBtn addTarget:self action:@selector(onConfirmOrderSelection) forControlEvents:UIControlEventTouchUpInside];
[panel addSubview:confirmBtn];
CGFloat sep2Y = confirmBtn.top - 12;
UIView *sep2 = [[UIView alloc] initWithFrame:CGRectMake(0, sep2Y, panelW, 1)];
sep2.backgroundColor = UIColorHex(0xEAECFA);
[panel addSubview:sep2];
CGFloat tableY = sep1Y + 1, tableH = sep2Y - tableY;
self.orderPopupTable = [[UITableView alloc] initWithFrame:CGRectMake(0, tableY, panelW, tableH) style:UITableViewStylePlain];
self.orderPopupTable.delegate = self;
self.orderPopupTable.dataSource = self;
self.orderPopupTable.separatorStyle = UITableViewCellSeparatorStyleNone;
self.orderPopupTable.showsVerticalScrollIndicator = NO;
self.orderPopupTable.backgroundColor = KWhiteColor;
self.orderPopupTable.rowHeight = UITableViewAutomaticDimension;
self.orderPopupTable.estimatedRowHeight = 160;
if (@available(iOS 15.0, *)) { self.orderPopupTable.sectionHeaderTopPadding = 0; }
self.orderPopupTable.contentInset = UIEdgeInsetsZero;
__weak typeof(self) wk = self;
self.orderPopupTable.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
wk.orderPage = 1; NSMutableDictionary *p = [NSMutableDictionary dictionary];
p[@"pageNo"] = @(1); p[@"pageSize"] = @(10);
[[[XJDNetAPI alloc] init:wk tag:@"myParticipatedOrders" NeedToken:@""] getMyParticipatedOrders:p];
}];
self.orderPopupTable.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
wk.orderPage++; NSMutableDictionary *p = [NSMutableDictionary dictionary];
p[@"pageNo"] = @(wk.orderPage); p[@"pageSize"] = @(10);
[[[XJDNetAPI alloc] init:wk tag:@"myParticipatedOrders" NeedToken:@""] getMyParticipatedOrders:p];
}];
[panel addSubview:self.orderPopupTable];
panel.alpha = 0;
[UIView animateWithDuration:0.25 animations:^{ panel.alpha = 1; }];
}
- (void)dismissOrderPopup {
[[UIApplication.sharedApplication.keyWindow viewWithTag:9001] removeFromSuperview];
[[UIApplication.sharedApplication.keyWindow viewWithTag:9002] removeFromSuperview];
}
- (void)onConfirmOrderSelection {
if (self.selectedOrderIndex < 0 || self.selectedOrderIndex >= self.orderList.count) return;
XJParticipatedOrderModel *m = self.orderList[self.selectedOrderIndex];
[self dismissOrderPopup];
[self enterChatWithSessionId:m.sessionId title:m.salvageUserName];
}
#pragma mark - 群成员侧滑面板
- (void)moreAction {
if (!self.isGroupID) return;
if (self.memberPanel) { [self hideMemberPanel]; return; }
UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow;
CGFloat panelW = kScreenWidth - 94;
self.memberOverlay = [[UIView alloc] initWithFrame:keyWindow.bounds];
self.memberOverlay.backgroundColor = RGBA(0, 0, 0, 0.4);
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hideMemberPanel)];
[self.memberOverlay addGestureRecognizer:tap];
[keyWindow addSubview:self.memberOverlay];
self.memberPanel = [[UIView alloc] initWithFrame:CGRectMake(kScreenWidth, 0, panelW, kScreenHeight)];
self.memberPanel.backgroundColor = KWhiteColor;
[keyWindow addSubview:self.memberPanel];
UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, panelW, kStatusBarHeight + 44)];
headerView.backgroundColor = KWhiteColor;
[self.memberPanel addSubview:headerView];
self.memberTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(12, kStatusBarHeight, panelW - 56, 44)];
self.memberTitleLabel.text = @"群成员";
self.memberTitleLabel.textAlignment = NSTextAlignmentLeft;
self.memberTitleLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium];
self.memberTitleLabel.textColor = UIColorHex(0x070809);
[headerView addSubview:self.memberTitleLabel];
UIButton *closeBtn = [[UIButton alloc] initWithFrame:CGRectMake(panelW - 44, kStatusBarHeight, 44, 44)];
[closeBtn setTitle:@"" forState:UIControlStateNormal];
[closeBtn setTitleColor:UIColorHex(0x070809) forState:UIControlStateNormal];
[closeBtn addTarget:self action:@selector(hideMemberPanel) forControlEvents:UIControlEventTouchUpInside];
[headerView addSubview:closeBtn];
UIView *headerLine = [[UIView alloc] initWithFrame:CGRectMake(12, headerView.bounds.size.height - 1, panelW - 12, 1)];
headerLine.backgroundColor = UIColorHex(0xEAECF1);
[headerView addSubview:headerLine];
CGFloat tableY = kStatusBarHeight + 44;
self.memberTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, tableY, panelW, kScreenHeight - tableY) style:UITableViewStylePlain];
self.memberTableView.delegate = self;
self.memberTableView.dataSource = self;
self.memberTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
self.memberTableView.rowHeight = 68;
self.memberTableView.tableFooterView = [self makeAddMemberFooterView:panelW];
[self.memberPanel addSubview:self.memberTableView];
[UIView animateWithDuration:0.25 animations:^{
self.memberPanel.frame = CGRectMake(kScreenWidth - panelW, 0, panelW, kScreenHeight);
}];
[self loadGroupMembers];
}
- (UIView *)makeAddMemberFooterView:(CGFloat)panelW {
UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, panelW, 20 + 49 + 57)];
footer.backgroundColor = KWhiteColor;
UIButton *refreshBtn = [[UIButton alloc] initWithFrame:CGRectMake(11, 12, panelW - 22, 49)];
refreshBtn.backgroundColor = KWhiteColor;
refreshBtn.layer.cornerRadius = 8;
refreshBtn.layer.borderWidth = 1;
refreshBtn.layer.borderColor = UIColorHex(0xCCCCCC).CGColor;
[refreshBtn setTitle:@" 更新群成员" forState:UIControlStateNormal];
[refreshBtn setTitleColor:UIColorHex(0x070809) forState:UIControlStateNormal];
refreshBtn.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
[refreshBtn addTarget:self action:@selector(refreshMemberList) forControlEvents:UIControlEventTouchUpInside];
[footer addSubview:refreshBtn];
self.refreshIcon = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 18, 18)];
self.refreshIcon.image = [UIImage imageNamed:@"yuanxunhuan"];
self.refreshIcon.contentMode = UIViewContentModeScaleAspectFit;
CGFloat rTitleW = [refreshBtn.titleLabel.text sizeWithAttributes:@{NSFontAttributeName: refreshBtn.titleLabel.font}].width;
CGFloat rIconX = (panelW - 22 - rTitleW) / 2;
self.refreshIcon.center = CGPointMake(rIconX, 49 / 2);
[refreshBtn addSubview:self.refreshIcon];
UIButton *addBtn = [[UIButton alloc] initWithFrame:CGRectMake(11, 12 + 49 + 8, panelW - 22, 49)];
addBtn.backgroundColor = [UIColorHex(0x2EB8B2) colorWithAlphaComponent:0.12];
addBtn.layer.cornerRadius = 8;
addBtn.layer.borderWidth = 1;
addBtn.layer.borderColor = UIColorHex(0x2EB8B2).CGColor;
[addBtn addTarget:self action:@selector(addMemberAction) forControlEvents:UIControlEventTouchUpInside];
UIImageView *icon = [[UIImageView alloc] initWithFrame:CGRectMake(0, (49 - 18) / 2, 18, 18)];
icon.image = [UIImage imageNamed:@"firstAid_add_icon"];
icon.contentMode = UIViewContentModeScaleAspectFit;
[addBtn addSubview:icon];
UILabel *btnTitle = [[UILabel alloc] init];
btnTitle.text = @"添加成员";
btnTitle.textColor = UIColorHex(0x2EB8B2);
btnTitle.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
[btnTitle sizeToFit];
CGFloat totalW = 18 + 6 + btnTitle.bounds.size.width;
icon.frame = CGRectMake((addBtn.bounds.size.width - totalW) / 2, (49 - 18) / 2, 18, 18);
btnTitle.frame = CGRectMake(icon.frame.origin.x + 18 + 6, (49 - btnTitle.bounds.size.height) / 2, btnTitle.bounds.size.width, btnTitle.bounds.size.height);
[addBtn addSubview:btnTitle];
[footer addSubview:addBtn];
return footer;
}
- (void)hideMemberPanel {
CGFloat panelW = kScreenWidth - 94;
[UIView animateWithDuration:0.25 animations:^{
self.memberPanel.frame = CGRectMake(kScreenWidth, 0, panelW, kScreenHeight);
} completion:^(BOOL finished) {
[self.memberOverlay removeFromSuperview];
[self.memberPanel removeFromSuperview];
self.memberOverlay = nil;
self.memberPanel = nil;
self.memberTableView = nil;
self.memberList = nil;
}];
}
- (void)refreshMemberList {
CABasicAnimation *rotation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
rotation.toValue = @(M_PI * 2);
rotation.duration = 0.6;
rotation.repeatCount = HUGE_VALF;
[self.refreshIcon.layer addAnimation:rotation forKey:@"refreshRotation"];
[self loadGroupMembers];
}
- (void)loadGroupMembers {
[self showMBProgressHUDWithString:@"加载中..." autoHidden:NO];
self.memberList = [NSMutableArray array];
NSMutableDictionary *params = [NSMutableDictionary dictionary];
[params setObject:self.chatID forKey:@"sessionId"];
XJDNetAPI *api = [[XJDNetAPI alloc] init:self tag:@"GROUPMEMBERLIST" NeedToken:@""];
[api getActualGroupMemberList:params];
}
- (NSString *)memberTypeNameFromValue:(NSInteger)memberType {
switch (memberType) {
case -1: return @"发起人";
case 0: return @"操作人员";
case 1: return @"专业人员";
case 2: return @"员工";
default: return @"";
}
}
- (void)addMemberAction {
[self hideMemberPanel];
XJSelectContactViewController *selectVC = [[XJSelectContactViewController alloc] init];
selectVC.chatID = self.chatID;
selectVC.groupId = self.chatID;
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:selectVC];
nav.modalPresentationStyle = UIModalPresentationFullScreen;
UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow;
[keyWindow.rootViewController presentViewController:nav animated:YES completion:nil];
}
- (void)callMemberAction:(UIButton *)sender {
UITableViewCell *cell = (UITableViewCell *)sender.superview.superview;
NSIndexPath *indexPath = [self.memberTableView indexPathForCell:cell];
if (!indexPath || indexPath.row >= self.memberList.count) return;
NSDictionary *member = self.memberList[indexPath.row];
NSString *phone = member[@"phone"];
if (phone.length == 0) {
[EasyTextView showErrorText:@"暂无手机号"];
return;
}
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel://%@", phone]] options:nil completionHandler:nil];
}
- (void)loginImAccount {
XJDNetAPI *api = [[XJDNetAPI alloc] init:self tag:@"loginIMAPI" NeedToken:nil];
[api GetIMLoginAccount:nil];
}
#pragma mark - V2TIMConversationListener
- (void)onConversationChanged:(NSArray<V2TIMConversation *> *)conversationList {}
- (void)onKickedOffline {
[XJDCommonUtils keyedArchiverWithData:nil key:LoginUserInfo];
[ESCTUIManager outLoginTUISDK];
KPostNotification(KNotificationLoginStateChange, @NO);
}
#pragma mark - V2TIMGroupListener
- (void)onMemberEnter:(NSString *)groupID memberList:(NSArray<V2TIMGroupMemberInfo *> *)memberList {
if ([groupID isEqualToString:self.chatID] && self.memberPanel) {
[self loadGroupMembers];
}
}
#pragma mark - ————— Network —————
- (void)Failed:(NSString*)message tag:(NSString*)tag
{
if ([tag isEqualToString:@"myParticipatedOrders"]) {
[self hiddenAllMBProgressHUD];
if (self.orderPage == 1) [EasyTextView showErrorText:message];
return;
}
[self showMBProgressHUDOnlyWithString:message];
[self hiddenAllMBProgressHUD];
}
- (void)Sucess:(id)response tag:(NSString*)tag
{
if ([tag isEqualToString:@"ENDSOSAPI"])
{
NSDictionary * parmDic = response;
if( self.isGroupID == false) {
self.vc.inputController.view.hidden = YES;
}else
{
self.groupvc.inputController.view.hidden = YES;
}
}
if ([tag isEqualToString:@"ENDPICTUREAPI"]) {
if( self.isGroupID == false) {
self.vc.inputController.view.hidden = YES;
}else
{
self.groupvc.inputController.view.hidden = YES;
}
}
if ([tag isEqualToString:@"DoctorSource"]) {
}
if ([tag isEqualToString:@"myParticipatedOrders"]) {
[self hiddenAllMBProgressHUD];
NSDictionary *dic = [response isKindOfClass:[NSDictionary class]] ? response : nil;
NSArray *records = dic[@"records"];
if (![records isKindOfClass:[NSArray class]] || records.count == 0) {
if (self.orderPage == 1) [EasyTextView showErrorText:@"暂无进行中的应急工单"];
return;
}
NSMutableArray *models = [NSMutableArray array];
for (NSDictionary *d in records) {
[models addObject:[XJParticipatedOrderModel modelWithDictionary:d]];
}
if (models.count == 1 && self.orderPage == 1 && [dic[@"total"] integerValue] == 1) {
XJParticipatedOrderModel *m = models.firstObject;
[self enterChatWithSessionId:m.sessionId title:m.salvageUserName];
return;
}
if (self.orderPage == 1) {
self.orderList = models;
[self showOrderListPopup:self.orderList];
} else {
[self.orderList addObjectsFromArray:models];
[self.orderPopupTable reloadData];
}
[self.orderPopupTable.mj_header endRefreshing];
[self.orderPopupTable.mj_footer endRefreshing];
if (records.count < 10) [self.orderPopupTable.mj_footer endRefreshingWithNoMoreData];
return;
}
if ([tag isEqualToString:@"GROUPMEMBERLIST"]) {
[self hiddenAllMBProgressHUD];
[self.memberList removeAllObjects];
NSArray *list = [response isKindOfClass:[NSDictionary class]] ? response[@"result"] : response;
if ([list isKindOfClass:[NSArray class]]) {
[self.memberList addObjectsFromArray:list];
}
self.memberTitleLabel.text = [NSString stringWithFormat:@"群成员(%lu)", (unsigned long)self.memberList.count];
[self.memberTableView reloadData];
[self.refreshIcon.layer removeAnimationForKey:@"refreshRotation"];
return;
}
if ([tag isEqualToString:@"loginIMAPI"]) {
[self hiddenAllMBProgressHUD];
NSDictionary *pamrDic = response;
NSInteger sdkAppId = [[pamrDic objectForKey:@"sdkAppId"] intValue];
NSString *userId = [pamrDic objectForKey:@"userId"];
NSString *userSig = [pamrDic objectForKey:@"userSig"];
[ESCTUIManager loginInitTUISDKAppidWith:sdkAppId UserID:userId userSig:userSig];
[self callFirstAiderAction];
return;
}
}
#pragma mark - ————— UITableView —————
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if (tableView == self.memberTableView) return self.memberList.count;
if (tableView == self.orderPopupTable) return self.orderList.count;
return 0;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (tableView == self.memberTableView) return 68;
if (tableView == self.orderPopupTable) return 160;
return 44;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (tableView == self.memberTableView) return [self memberCellForRowAtIndexPath:indexPath];
if (tableView == self.orderPopupTable) return [self orderCellForRowAtIndexPath:indexPath];
return [UITableViewCell new];
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if (tableView == self.orderPopupTable) {
self.selectedOrderIndex = indexPath.row;
[tableView reloadData];
}
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
#pragma mark - 群成员 Cell
- (UITableViewCell *)memberCellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellId = @"MemberCell";
NSDictionary *member = self.memberList[indexPath.row];
CGFloat panelW = kScreenWidth - 94;
UITableViewCell *cell = [self.memberTableView dequeueReusableCellWithIdentifier:cellId];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
UIImageView *avatar = [[UIImageView alloc] initWithFrame:CGRectMake(12, 11, 45, 45)];
avatar.tag = 100;
avatar.layer.cornerRadius = 8;
avatar.layer.masksToBounds = YES;
[cell.contentView addSubview:avatar];
UILabel *nameLabel = [[UILabel alloc] init];
nameLabel.tag = 101;
nameLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium];
nameLabel.textColor = UIColorHex(0x070809);
[cell.contentView addSubview:nameLabel];
UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(70, 42, panelW - 132, 14)];
titleLabel.tag = 102;
titleLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightRegular];
titleLabel.textColor = UIColorHex(0x808080);
[cell.contentView addSubview:titleLabel];
UIButton *phoneBtn = [[UIButton alloc] initWithFrame:CGRectMake(panelW - 47, 20, 32, 32)];
phoneBtn.tag = 103;
[phoneBtn setImage:[UIImage imageNamed:@"firstAid_phone_icon"] forState:UIControlStateNormal];
[phoneBtn addTarget:self action:@selector(callMemberAction:) forControlEvents:UIControlEventTouchUpInside];
[cell.contentView addSubview:phoneBtn];
UIView *line = [[UIView alloc] initWithFrame:CGRectMake(70, 67, panelW - 70, 1)];
line.tag = 104;
line.backgroundColor = UIColorHex(0xEAECF1);
[cell.contentView addSubview:line];
}
UIImageView *avatar = [cell.contentView viewWithTag:100];
UILabel *nameLabel = [cell.contentView viewWithTag:101];
UILabel *titleLabel = [cell.contentView viewWithTag:102];
NSString *userName = member[@"userName"] ?: @"";
nameLabel.text = userName;
CGSize nameSize = [userName sizeWithAttributes:@{NSFontAttributeName: nameLabel.font}];
nameLabel.frame = CGRectMake(70, 15, nameSize.width, 17);
titleLabel.text = [self memberTypeNameFromValue:[member[@"memberType"] integerValue]];
NSString *avatarPath = member[@"avatar"];
if (avatarPath.length > 0) {
NSString *fullUrl = [avatarPath hasPrefix:@"http"] ? avatarPath : [NSString stringWithFormat:@"%@%@", ResourceAddress, avatarPath];
[avatar sd_setImageWithURL:[NSURL URLWithString:fullUrl] placeholderImage:[UIImage imageNamed:@"heard_man"]];
} else {
avatar.image = [UIImage imageNamed:@"heard_man"];
}
return cell;
}
#pragma mark - 工单 Cell
- (UITableViewCell *)orderCellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cid = @"OrderCell";
XJParticipatedOrderModel *m = self.orderList[indexPath.row];
BOOL selected = (indexPath.row == self.selectedOrderIndex);
CGFloat panelW = kScreenWidth - 46;
UITableViewCell *cell = [self.orderPopupTable dequeueReusableCellWithIdentifier:cid];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cid];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.backgroundColor = KWhiteColor;
UIView *container = [[UIView alloc] init];
container.tag = 200;
container.layer.cornerRadius = 8;
container.layer.borderWidth = 1;
[cell.contentView addSubview:container];
[container mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.top.equalTo(cell.contentView).offset(12);
make.right.equalTo(cell.contentView).offset(-12);
make.bottom.equalTo(cell.contentView);
}];
UILabel *nameLbl = [[UILabel alloc] init];
nameLbl.tag = 201;
nameLbl.font = [UIFont systemFontOfSize:15 weight:UIFontWeightBold];
[container addSubview:nameLbl];
[nameLbl mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.top.equalTo(container).offset(16);
}];
UIImageView *indicator = [[UIImageView alloc] init];
indicator.tag = 202;
indicator.contentMode = UIViewContentModeScaleAspectFit;
[container addSubview:indicator];
[indicator mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(container).offset(-16);
make.top.equalTo(container).offset(14);
make.size.mas_equalTo(CGSizeMake(18, 18));
}];
UIView *line = [[UIView alloc] init];
line.tag = 204;
line.backgroundColor = UIColorHex(0xEAECFA);
[container addSubview:line];
[line mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(container).offset(16);
make.right.equalTo(container).offset(-16);
make.top.equalTo(nameLbl.mas_bottom).offset(12);
make.height.mas_equalTo(1);
}];
UIImageView *orgIcon = [[UIImageView alloc] init];
orgIcon.tag = 205;
orgIcon.contentMode = UIViewContentModeScaleAspectFit;
[container addSubview:orgIcon];
[orgIcon mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(container).offset(16);
make.top.equalTo(line.mas_bottom).offset(12);
make.size.mas_equalTo(CGSizeMake(16, 16));
}];
UILabel *orgLbl = [[UILabel alloc] init];
orgLbl.tag = 206;
orgLbl.font = [UIFont systemFontOfSize:13 weight:UIFontWeightMedium];
orgLbl.numberOfLines = 0;
[container addSubview:orgLbl];
[orgLbl mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(orgIcon.mas_right).offset(8);
make.top.equalTo(line.mas_bottom).offset(12);
make.right.equalTo(container).offset(-16);
}];
UIImageView *timeIcon = [[UIImageView alloc] init];
timeIcon.tag = 207;
timeIcon.contentMode = UIViewContentModeScaleAspectFit;
[container addSubview:timeIcon];
[timeIcon mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(container).offset(16);
make.top.equalTo(orgLbl.mas_bottom).offset(15);
make.size.mas_equalTo(CGSizeMake(16, 16));
}];
UILabel *timeLbl = [[UILabel alloc] init];
timeLbl.tag = 208;
timeLbl.font = [UIFont systemFontOfSize:13 weight:UIFontWeightMedium];
[container addSubview:timeLbl];
[timeLbl mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(timeIcon.mas_right).offset(8);
make.centerY.equalTo(timeIcon);
make.right.equalTo(container).offset(-16);
make.bottom.equalTo(container).offset(-16);
}];
}
UIView *container = [cell.contentView viewWithTag:200];
UILabel *nameLbl = [container viewWithTag:201];
UIImageView *indicator = [container viewWithTag:202];
UIImageView *orgIcon = [container viewWithTag:205];
UILabel *orgLbl = [container viewWithTag:206];
UIImageView *timeIcon = [container viewWithTag:207];
UILabel *timeLbl = [container viewWithTag:208];
if (selected) {
container.layer.borderColor = UIColorHex(0x2EB8B280).CGColor;
container.backgroundColor = UIColorHex(0x2EB8B20F);
orgLbl.textColor = UIColorHex(0x2EB8B2);
timeLbl.textColor = UIColorHex(0x2EB8B2);
} else {
container.layer.borderColor = UIColorHex(0xE6E6EA).CGColor;
container.backgroundColor = KWhiteColor;
orgLbl.textColor = UIColorHex(0x77849E);
timeLbl.textColor = UIColorHex(0x77849E);
}
nameLbl.textColor = UIColorHex(0x252535);
nameLbl.text = m.salvageUserName ?: @"--";
indicator.image = [UIImage imageNamed:selected ? @"order_selected" : @"order_unselected"];
orgIcon.image = [UIImage imageNamed:selected ? @"org_selected" : @"org_unselected"];
orgLbl.text = m.orgName ?: @"";
timeIcon.image = [UIImage imageNamed:selected ? @"time_selected" : @"time_unselected"];
timeLbl.text = m.createTime.length > 0 ? [NSString stringWithFormat:@"求助时间:%@", m.createTime] : @"";
return cell;
}
@end
@@ -0,0 +1,17 @@
//
// XJSelectContactViewController.h
// XinjiangProject
//
#import "YXBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface XJSelectContactViewController : YXBaseViewController
@property (nonatomic, copy) NSString *chatID;
@property (nonatomic, copy) NSString *groupId;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,413 @@
//
// XJSelectContactViewController.m
// XinjiangProject
//
#import "XJSelectContactViewController.h"
#import "XJDNetAPI.h"
#import "TUICallingCommon.h"
#import "TUICallingUserManager.h"
#import "TUICallingUserModel.h"
#import "TUICallKit.h"
#import <TUICallEngine/TUICallEngine.h>
#import <ImSDK_Plus/ImSDK_Plus.h>
typedef NS_ENUM(NSUInteger, XJContactTab) {
XJContactTabEmployee = 0,
XJContactTabExpert = 1,
};
@interface XJSelectContactViewController ()<UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, assign) XJContactTab currentTab;
// 顶部切换
@property (nonatomic, strong) UIView *tabBgView;
@property (nonatomic, strong) UILabel *employeeTabLabel;
@property (nonatomic, strong) UILabel *expertTabLabel;
// 搜索
@property (nonatomic, strong) UITextField *searchField;
// 列表
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) NSMutableArray<NSDictionary *> *dataArray;
// 选中集合
@property (nonatomic, strong) NSMutableSet<NSString *> *selectedIds;
// 底部
@property (nonatomic, strong) UIView *bottomView;
@end
@implementation XJSelectContactViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.isHidenNaviBar = NO;
self.navigationItem.title = @"选择联系人";
self.view.backgroundColor = CViewBgColor;
self.currentTab = XJContactTabEmployee;
self.dataArray = [NSMutableArray array];
self.selectedIds = [NSMutableSet set];
[self createTopView];
[self createBottomView];
[self createTableView];
[self loadData];
}
- (void)viewDidLayoutSubviews {
[super viewDidLayoutSubviews];
CGFloat safeBottom = 0;
if (@available(iOS 11.0, *)) {
safeBottom = self.view.safeAreaInsets.bottom;
}
CGFloat bottomH = 60 + safeBottom;
self.bottomView.frame = CGRectMake(0, self.view.bounds.size.height - bottomH, kScreenWidth, bottomH);
CGFloat top = 94;
CGFloat tableBottom = self.bottomView.frame.origin.y - 15;
self.tableView.frame = CGRectMake(0, top, kScreenWidth, tableBottom - top);
}
#pragma mark - 顶部区域 (高度94)
- (void)createTopView {
UIView *container = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 94)];
container.backgroundColor = KWhiteColor;
[self.view addSubview:container];
// 搜索按钮(右侧)
UIButton *searchBtn = [[UIButton alloc] initWithFrame:CGRectMake(kScreenWidth - 56, 6, 56, 32)];
[searchBtn setTitle:@"搜索" forState:UIControlStateNormal];
searchBtn.titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
[searchBtn setTitleColor:UIColorHex(0x2EB8B2) forState:UIControlStateNormal];
[searchBtn addTarget:self action:@selector(didTapSearch) forControlEvents:UIControlEventTouchUpInside];
[container addSubview:searchBtn];
// 搜索框
UIView *searchBg = [[UIView alloc] initWithFrame:CGRectMake(15, 6, kScreenWidth - 15 - 56, 32)];
searchBg.backgroundColor = UIColorHex(0xF6F6F6);
searchBg.layer.cornerRadius = 8;
searchBg.layer.masksToBounds = YES;
[container addSubview:searchBg];
UIImageView *searchIcon = [[UIImageView alloc] initWithFrame:CGRectMake(12, (32 - 14) / 2, 14, 14)];
searchIcon.image = [UIImage imageNamed:@"searchLeftIcon"];
searchIcon.contentMode = UIViewContentModeScaleAspectFit;
[searchBg addSubview:searchIcon];
self.searchField = [[UITextField alloc] initWithFrame:CGRectMake(34, 0, searchBg.bounds.size.width - 34, 32)];
self.searchField.font = [UIFont systemFontOfSize:14];
self.searchField.returnKeyType = UIReturnKeySearch;
self.searchField.placeholder = @"请输入姓名搜索";
[self.searchField addTarget:self action:@selector(didTapSearch) forControlEvents:UIControlEventEditingDidEndOnExit];
[searchBg addSubview:self.searchField];
// 切换标签(搜索框底部 + 10)
CGFloat tabY = 6 + 32 + 10;
self.tabBgView = [[UIView alloc] initWithFrame:CGRectMake(17, tabY, kScreenWidth - 34, 36)];
self.tabBgView.backgroundColor = UIColorHex(0xE8EBF2);
self.tabBgView.layer.cornerRadius = 8;
self.tabBgView.layer.masksToBounds = YES;
[container addSubview:self.tabBgView];
CGFloat tabW = (self.tabBgView.bounds.size.width - 4) / 2;
CGFloat tabH = 32;
UIView *employeeBg = [[UIView alloc] initWithFrame:CGRectMake(2, 2, tabW, tabH)];
employeeBg.backgroundColor = KWhiteColor;
employeeBg.layer.cornerRadius = 8;
employeeBg.layer.masksToBounds = YES;
employeeBg.tag = 200;
[self.tabBgView addSubview:employeeBg];
self.employeeTabLabel = [[UILabel alloc] initWithFrame:employeeBg.bounds];
self.employeeTabLabel.text = @"邀请员工";
self.employeeTabLabel.textAlignment = NSTextAlignmentCenter;
self.employeeTabLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
self.employeeTabLabel.textColor = UIColorHex(0x2EB8B2);
self.employeeTabLabel.userInteractionEnabled = YES;
[employeeBg addSubview:self.employeeTabLabel];
[employeeBg addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTapEmployeeTab)]];
UIView *expertBg = [[UIView alloc] initWithFrame:CGRectMake(2 + tabW, 2, tabW, tabH)];
expertBg.backgroundColor = UIColorHex(0xE8EBF2);
expertBg.layer.cornerRadius = 8;
expertBg.layer.masksToBounds = YES;
expertBg.tag = 201;
[self.tabBgView addSubview:expertBg];
self.expertTabLabel = [[UILabel alloc] initWithFrame:expertBg.bounds];
self.expertTabLabel.text = @"邀请专家";
self.expertTabLabel.textAlignment = NSTextAlignmentCenter;
self.expertTabLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightRegular];
self.expertTabLabel.textColor = UIColorHex(0x808080);
self.expertTabLabel.userInteractionEnabled = YES;
[expertBg addSubview:self.expertTabLabel];
[expertBg addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTapExpertTab)]];
// 头部分割线
UIView *headerLine = [[UIView alloc] initWithFrame:CGRectMake(0, 93, kScreenWidth, 1)];
headerLine.backgroundColor = UIColorHex(0xEAECF1);
[container addSubview:headerLine];
}
#pragma mark - 底部区域
- (void)createBottomView {
self.bottomView = [[UIView alloc] initWithFrame:CGRectZero];
self.bottomView.backgroundColor = KWhiteColor;
[self.view addSubview:self.bottomView];
UIButton *confirmBtn = [[UIButton alloc] initWithFrame:CGRectMake(45, 8, kScreenWidth - 90, 44)];
confirmBtn.backgroundColor = UIColorHex(0x2EB8B1);
confirmBtn.layer.cornerRadius = 12;
confirmBtn.layer.masksToBounds = YES;
[confirmBtn setTitle:@"确定" forState:UIControlStateNormal];
[confirmBtn setTitleColor:UIColorHex(0xFFFFFF) forState:UIControlStateNormal];
confirmBtn.titleLabel.font = [UIFont boldSystemFontOfSize:18];
[confirmBtn addTarget:self action:@selector(didTapConfirm) forControlEvents:UIControlEventTouchUpInside];
[self.bottomView addSubview:confirmBtn];
}
#pragma mark - 列表
- (void)createTableView {
self.tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
self.tableView.delegate = self;
self.tableView.dataSource = self;
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
self.tableView.rowHeight = 70;
self.tableView.backgroundColor = CViewBgColor;
LYEmptyView *emptyView = [LYEmptyView emptyViewWithImageStr:@"empty_placeholder" titleStr:@"暂无数据" detailStr:@""];
emptyView.subViewMargin = 20.f;
emptyView.titleLabTextColor = CFontColor1;
emptyView.detailLabFont = [UIFont systemFontOfSize:17];
self.tableView.ly_emptyView = emptyView;
[self.view addSubview:self.tableView];
}
- (void)loadData {
[self showMBProgressHUDWithString:@"加载中..." autoHidden:NO];
[self.dataArray removeAllObjects];
[self.tableView reloadData];
NSMutableDictionary *params = [NSMutableDictionary dictionary];
if (self.groupId.length > 0) {
[params setObject:self.groupId forKey:@"excludeSessionId"];
}
NSString *keyword = self.searchField.text;
if (keyword.length > 0) {
[params setObject:keyword forKey:@"realname"];
}
[params setObject:@(1) forKey:@"pageNo"];
[params setObject:@(200) forKey:@"pageSize"];
NSString *tag = (self.currentTab == XJContactTabEmployee) ? @"SEARCH_EMPLOYEE" : @"SEARCH_EXPERT";
XJDNetAPI *api = [[XJDNetAPI alloc] init:self tag:tag NeedToken:@""];
if (self.currentTab == XJContactTabEmployee) {
[api getSearchEmployee:params];
} else {
[api getSearchExpert:params];
}
}
- (void)didTapSearch {
[self loadData];
}
- (void)didTapConfirm {
if (self.selectedIds.count == 0) {
[EasyTextView showErrorText:@"请先选择联系人"];
return;
}
[self showMBProgressHUDWithString:@"邀请中..." autoHidden:NO];
NSMutableDictionary *params = [NSMutableDictionary dictionary];
[params setObject:self.groupId forKey:@"groupId"];
[params setObject:[self.selectedIds allObjects] forKey:@"memberList"];
NSInteger memberType = (self.currentTab == XJContactTabEmployee) ? 1 : 0;
[params setObject:@(memberType) forKey:@"memberType"];
XJDNetAPI *api = [[XJDNetAPI alloc] init:self tag:@"ADDGROUPUSER" NeedToken:@""];
[api postAddGroupUser:params];
}
#pragma mark - 切换
- (void)didTapEmployeeTab {
if (self.currentTab == XJContactTabEmployee) return;
self.currentTab = XJContactTabEmployee;
[self updateTabStyle];
[self loadData];
}
- (void)didTapExpertTab {
if (self.currentTab == XJContactTabExpert) return;
self.currentTab = XJContactTabExpert;
[self updateTabStyle];
[self loadData];
}
- (void)updateTabStyle {
UIView *employeeBg = [self.tabBgView viewWithTag:200];
UIView *expertBg = [self.tabBgView viewWithTag:201];
if (self.currentTab == XJContactTabEmployee) {
employeeBg.backgroundColor = KWhiteColor;
self.employeeTabLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
self.employeeTabLabel.textColor = UIColorHex(0x2EB8B2);
expertBg.backgroundColor = UIColorHex(0xE8EBF2);
self.expertTabLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightRegular];
self.expertTabLabel.textColor = UIColorHex(0x808080);
} else {
expertBg.backgroundColor = KWhiteColor;
self.expertTabLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
self.expertTabLabel.textColor = UIColorHex(0x2EB8B2);
employeeBg.backgroundColor = UIColorHex(0xE8EBF2);
self.employeeTabLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightRegular];
self.employeeTabLabel.textColor = UIColorHex(0x808080);
}
}
#pragma mark - UITableView
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.dataArray.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellId = @"SelectContactCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.backgroundColor = KWhiteColor;
UIImageView *avatar = [[UIImageView alloc] initWithFrame:CGRectMake(15, 12, 45, 45)];
avatar.tag = 100;
avatar.layer.cornerRadius = 12;
avatar.layer.masksToBounds = YES;
[cell.contentView addSubview:avatar];
UILabel *nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(72, 17, kScreenWidth - 72 - 51, 18)];
nameLabel.tag = 101;
nameLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium];
nameLabel.textColor = UIColorHex(0x000000);
[cell.contentView addSubview:nameLabel];
UILabel *deptLabel = [[UILabel alloc] initWithFrame:CGRectMake(72, 39, kScreenWidth - 72 - 51, 14)];
deptLabel.tag = 102;
deptLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightRegular];
deptLabel.textColor = UIColorHex(0x808080);
[cell.contentView addSubview:deptLabel];
UIButton *checkBtn = [[UIButton alloc] initWithFrame:CGRectMake(kScreenWidth - 36, (70 - 21) / 2, 21, 21)];
checkBtn.tag = 103;
checkBtn.userInteractionEnabled = NO;
[cell.contentView addSubview:checkBtn];
UIView *line = [[UIView alloc] initWithFrame:CGRectMake(72, 70 - 1, kScreenWidth - 72, 1)];
line.tag = 104;
line.backgroundColor = UIColorHex(0xEAECF1);
[cell.contentView addSubview:line];
}
NSDictionary *contact = self.dataArray[indexPath.row];
UIImageView *avatar = [cell.contentView viewWithTag:100];
UILabel *nameLabel = [cell.contentView viewWithTag:101];
UILabel *deptLabel = [cell.contentView viewWithTag:102];
UIButton *checkBtn = [cell.contentView viewWithTag:103];
nameLabel.text = contact[@"realname"] ?: @"";
if (self.currentTab == XJContactTabEmployee) {
deptLabel.text = [NSString stringWithFormat:@"%@-%@", contact[@"orgName"] ?: @"", contact[@"deptName"] ?: @""];
} else {
deptLabel.text = contact[@"post_dictText"] ?: @"";
}
NSString *avatarPath = contact[@"avatar"];
if (avatarPath.length > 0) {
NSString *fullUrl = [avatarPath hasPrefix:@"http"] ? avatarPath : [NSString stringWithFormat:@"%@%@", ResourceAddress, avatarPath];
[avatar sd_setImageWithURL:[NSURL URLWithString:fullUrl] placeholderImage:[UIImage imageNamed:@"heard_man"]];
} else {
avatar.image = [UIImage imageNamed:@"heard_man"];
}
NSString *userId = contact[@"userId"] ?: @"";
BOOL selected = [self.selectedIds containsObject:userId];
NSString *iconName = selected ? @"firstAid_checkbox_selected" : @"firstAid_checkbox_unselected";
[checkBtn setImage:[UIImage imageNamed:iconName] forState:UIControlStateNormal];
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
NSDictionary *contact = self.dataArray[indexPath.row];
NSString *userId = contact[@"userId"] ?: @"";
if ([self.selectedIds containsObject:userId]) {
[self.selectedIds removeObject:userId];
} else {
[self.selectedIds addObject:userId];
}
[self.tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone];
}
#pragma mark - Network
- (void)Failed:(NSString *)message tag:(NSString *)tag {
[self hiddenAllMBProgressHUD];
[EasyTextView showErrorText:message];
}
- (void)Sucess:(id)response tag:(NSString *)tag {
[self hiddenAllMBProgressHUD];
if ([tag isEqualToString:@"SEARCH_EMPLOYEE"] || [tag isEqualToString:@"SEARCH_EXPERT"]) {
NSDictionary *dict = [response isKindOfClass:[NSDictionary class]] ? response : nil;
NSDictionary *result = dict[@"result"] ?: dict;
NSArray *records = result[@"records"];
if ([records isKindOfClass:[NSArray class]]) {
[self.dataArray addObjectsFromArray:records];
}
[self.tableView reloadData];
}
if ([tag isEqualToString:@"ADDGROUPUSER"]) {
[EasyTextView showSuccessText:@"邀请成功"];
NSArray *userIds = [self.selectedIds allObjects];
if (userIds.count > 0) {
[[TUICallEngine createInstance] inviteUser:userIds params:nil succ:^(NSArray<NSString *> *userIdList) {
[[V2TIMManager sharedInstance] getUsersInfo:userIdList succ:^(NSArray<V2TIMUserFullInfo *> *infoList) {
dispatch_async(dispatch_get_main_queue(), ^{
id mgr = [[TUICallKit createInstance] valueForKey:@"callingViewManager"];
id bgView = [mgr valueForKey:@"backgroundView"];
for (V2TIMUserFullInfo *info in infoList) {
CallingUserModel *model = [TUICallingCommon covertUser:info];
[TUICallingUserManager cacheUser:model];
if (bgView && [bgView respondsToSelector:@selector(userAdd:)]) {
[bgView performSelector:@selector(userAdd:) withObject:model];
}
}
});
} fail:nil];
} fail:nil];
}
if (self.presentingViewController) {
[self dismissViewControllerAnimated:YES completion:nil];
} else {
[self.navigationController popViewControllerAnimated:YES];
}
}
}
@end
Binary file not shown.

After

Width:  |  Height:  |  Size: 153 KiB

@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "图层 1@2x.png",
"filename" : "6、健康油我~专家端.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
@@ -13,7 +13,7 @@
"value" : "dark"
}
],
"filename" : "图层 1@2x 1.png",
"filename" : "6、健康油我~专家端 1.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
@@ -25,7 +25,7 @@
"value" : "tinted"
}
],
"filename" : "图层 1@2x 2.png",
"filename" : "6、健康油我~专家端 2.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

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

After

Width:  |  Height:  |  Size: 2.3 KiB

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "firstAid_checkbox_unselected.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "order_selected.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

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

After

Width:  |  Height:  |  Size: 1.9 KiB

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

After

Width:  |  Height:  |  Size: 787 B

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

After

Width:  |  Height:  |  Size: 766 B

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

After

Width:  |  Height:  |  Size: 1.7 KiB

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

After

Width:  |  Height:  |  Size: 1.7 KiB

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

After

Width:  |  Height:  |  Size: 3.8 KiB

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

After

Width:  |  Height:  |  Size: 60 KiB

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

After

Width:  |  Height:  |  Size: 1.1 KiB

@@ -2,25 +2,12 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleAllowMixedLocalizations</key>
<key>UIDesignRequiresCompatibility</key>
<true/>
<key>CFBundleLocalizations</key>
<array>
<string>zh</string>
</array>
<key>Localization native development region</key>
<string>China</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict/>
</dict>
</dict>
</plist>
@@ -26,7 +26,6 @@
self.sellerName = dict[@"sellerName"];
self.fileSize = dict[@"fileSizeBytes"];
self.screenshotUrls = dict[@"screenshotUrls"];
self.releaseDate = [self formatReleaseDate];
self.fileSize = [self formatFileSizeByMB];
}
@@ -36,16 +35,18 @@
- (NSString *)formatReleaseDate {
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
dateFormatter.dateFormat = @"yyyy-MM-dd'T'HH:mm:ssZ";
NSDate *date = [dateFormatter dateFromString:self.releaseDate];
NSTimeZone* timeZone = [NSTimeZone timeZoneWithName:@"Asia/Shanghai"];
[dateFormatter setTimeZone:timeZone];
dateFormatter.dateFormat = @"yyyy-MM-dd HH:mm";
NSString *releaseDate= [dateFormatter stringFromDate:date];
dateFormatter.dateFormat = @"yyyy-MM-dd HH:mm:ss";
return releaseDate;
NSDate *date = [dateFormatter dateFromString:self.releaseDate];
if (!date) return @"";
dateFormatter.timeZone = [NSTimeZone timeZoneWithName:@"Asia/Shanghai"];
dateFormatter.dateFormat = @"yyyy-MM-dd HH:mm";
return [dateFormatter stringFromDate:date];
}
- (NSString *)formatFileSizeByMB {
CGFloat fileSizeByMB = ([self.fileSize integerValue] /(1000 *1000));
@@ -84,7 +84,7 @@
self.titleLabel.textColor = kRGBColor(23, 24, 28);
self.titleLabel.font = [UIFont systemFontOfSize:16.0f];;
self.titleLabel.textAlignment = NSTextAlignmentLeft;
self.titleLabel.text = @"新版本";
self.titleLabel.text = @"发现新版本";
[self.contentView addSubview:self.titleLabel];
self.latestVersionLabel = [[UILabel alloc] init];
@@ -98,7 +98,7 @@
self.packetSizeLabel = [[UILabel alloc] init];
self.packetSizeLabel.textColor = kRGBColor(119, 119, 119);
self.packetSizeLabel.font = [UIFont systemFontOfSize:12.0f];
self.packetSizeLabel.text = [NSString stringWithFormat:@"包大小: %@",self.appInfo.fileSize];
// self.packetSizeLabel.text = [NSString stringWithFormat:@"包大小: %@",self.appInfo.fileSize];
self.packetSizeLabel.textAlignment = NSTextAlignmentLeft;
[self.contentView addSubview:self.packetSizeLabel];
@@ -142,11 +142,14 @@
self.confirmButton.titleLabel.font = [UIFont systemFontOfSize:16.0f];
[self.confirmButton setTitleColor:kRGBColor(69, 149, 236)
forState:UIControlStateNormal];
[self.confirmButton setTitle:@"立即更新" forState:UIControlStateNormal];
[self.confirmButton setTitle:@"请前往移动平台更新" forState:UIControlStateNormal];
[self addSubview:self.confirmButton];
[self.confirmButton addTarget:self action:@selector(confirmButtonDidClicked) forControlEvents:UIControlEventTouchUpInside];
if (!self.isCompulsoryUpdate) {
[self.confirmButton setTitle:@"我知道了" forState:UIControlStateNormal];
self.centerLineView = [[UIView alloc] init];
self.centerLineView.backgroundColor = kRGBColor(223, 223, 223);
[self addSubview:self.centerLineView];
+7 -7
View File
@@ -41,10 +41,10 @@ PODS:
- ReactiveObjC (3.1.1)
- SDCycleScrollView (1.82):
- SDWebImage (>= 5.0.0)
- SDWebImage (5.21.1):
- SDWebImage/Core (= 5.21.1)
- SDWebImage/Core (5.21.1)
- SDWebImageWebPCoder (0.14.6):
- SDWebImage (5.21.3):
- SDWebImage/Core (= 5.21.3)
- SDWebImage/Core (5.21.3)
- SDWebImageWebPCoder (0.15.0):
- libwebp (~> 1.0)
- SDWebImage/Core (~> 5.17)
- SJBaseVideoPlayer (3.7.6):
@@ -466,7 +466,7 @@ EXTERNAL SOURCES:
CHECKOUT OPTIONS:
AAChartKit:
:commit: a0e79474d7428e2617e16310a0ad4584f561f081
:commit: cef69e092a87a0a6357f3bcb046529d8f93ef447
:git: https://github.com/AAChartModel/AAChartKit.git
SPEC CHECKSUMS:
@@ -483,8 +483,8 @@ SPEC CHECKSUMS:
MJRefresh: 2fe7fb43a5167ceda20bb7e63f130c04fd1814a5
ReactiveObjC: 011caa393aa0383245f2dcf9bf02e86b80b36040
SDCycleScrollView: a0d74c3384caa72bdfc81470bdbc8c14b3e1fbcf
SDWebImage: f29024626962457f3470184232766516dee8dfea
SDWebImageWebPCoder: e38c0a70396191361d60c092933e22c20d5b1380
SDWebImage: 16309af6d214ba3f77a7c6f6fdda888cb313a50a
SDWebImageWebPCoder: 0e06e365080397465cc73a7a9b472d8a3bd0f377
SJBaseVideoPlayer: f15debaa8c1e27b63bdefc8caeec515e9c71d079
SJUIKit: a40111941e408cc17d4c1c23495aa92999e814b0
SJVideoPlayer: 4f09814f58522e0975cb2dccfda925f6c8643467
+24
View File
@@ -0,0 +1,24 @@
//
// MapMessageCustomCell.h
// EscortProject
//
// Created by 仁康信息 on 2023/7/7.
//
#import "TUIMessageCell.h"
#import "MapMessageCustomCellData.h"
#import <TIMCommon/TUIBubbleMessageCell.h>
#import <TIMCommon/TUIMessageCell.h>
NS_ASSUME_NONNULL_BEGIN
@interface MapMessageCustomCell : TUIBubbleMessageCell
@property UILabel * myTextLabel; // 展示文本
@property UIImageView * mapImage; //
@property MapMessageCustomCellData * cellData;
- (void)fillWithData:(MapMessageCustomCellData *)data;
@end
NS_ASSUME_NONNULL_END
+72
View File
@@ -0,0 +1,72 @@
//
// MapMessageCustomCell.m
// EscortProject
//
// Created by 仁康信息 on 2023/7/7.
//
#import "MapMessageCustomCell.h"
@implementation MapMessageCustomCell
- (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
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
self.container.layer.cornerRadius = 8;
self.container.layer.masksToBounds = YES;
self.container.backgroundColor = UIColor.whiteColor;
self.myTextLabel = [[UILabel alloc] init];
self.myTextLabel.textAlignment = NSTextAlignmentLeft;
self.myTextLabel.font = [UIFont systemFontOfSize:14];
self.myTextLabel.numberOfLines = 0;
[self.container addSubview:self.myTextLabel];
self.mapImage = [[UIImageView alloc] init];
[self.container addSubview:self.mapImage];
}
return self;
}
- (void)fillWithData:(MapMessageCustomCellData *)data;
{
[super fillWithData:data];
self.bubbleView.image = nil;
self.myTextLabel.text = data.text.length > 0 ? data.text : @"我的位置";
[self.mapImage sd_setImageWithURL:[NSURL URLWithString:data.MapPictureImg] placeholderImage:nil];
[self setNeedsLayout];
}
- (void)layoutSubviews
{
[super layoutSubviews];
CGFloat containerW = self.container.bounds.size.width;
CGFloat containerH = self.container.bounds.size.height;
CGFloat padding = 10;
CGFloat textWidth = containerW - padding * 2;
CGSize textSize = [self.myTextLabel sizeThatFits:CGSizeMake(textWidth, CGFLOAT_MAX)];
CGFloat textHeight = textSize.height + 12;
self.myTextLabel.mm_left(padding).mm_top(6).mm_width(textWidth).mm_height(textHeight);
CGFloat mapTop = self.myTextLabel.mm_y + textHeight;
self.mapImage.mm_left(0).mm_top(mapTop).mm_width(containerW).mm_height(containerH - mapTop);
}
@end
+21
View File
@@ -0,0 +1,21 @@
//
// MapMessageCustomCellData.h
// EscortProject
//
// Created by 仁康信息 on 2023/7/7.
//
#import "TUIMessageCellData.h"
#import <TIMCommon/TUIBubbleMessageCellData.h>
NS_ASSUME_NONNULL_BEGIN
@interface MapMessageCustomCellData : TUIBubbleMessageCellData
@property (nonatomic, copy) NSString *text;
@property (nonatomic, copy) NSString * MapPictureImg;
@end
NS_ASSUME_NONNULL_END
+79
View File
@@ -0,0 +1,79 @@
//
// MapMessageCustomCellData.m
// EscortProject
//
// Created by 仁康信息 on 2023/7/7.
//
#import "MapMessageCustomCellData.h"
#import "MapMessageCustomCell.h"
#import<CommonCrypto/CommonDigest.h>
@implementation MapMessageCustomCellData
+ (TUIMessageCellData *)getCellData:(V2TIMMessage *)message{
// NSDictionary *param = [NSJSONSerialization JSONObjectWithData:message.locationElem.desc options:NSJSONReadingAllowFragments error:nil];
MapMessageCustomCellData *cellData = [[MapMessageCustomCellData alloc] initWithDirection:message.isSelf ? MsgDirectionOutgoing : MsgDirectionIncoming];
cellData.innerMessage = message;
cellData.msgID = message.msgID;
cellData.text = message.locationElem.desc;
cellData.MapPictureImg = [self mapLocationImage:message.locationElem.longitude Withlation:message.locationElem.latitude];
cellData.reuseId = @"MapMessageCustomCell";
cellData.showAvatar = true;
// cellData.avatarUrl = [NSURL URLWithString:message.faceURL];
return cellData;
}
+ (NSString *)mapLocationImage:(CGFloat)longLation Withlation:(CGFloat)lation {
// 0: self.longLation,self.lation
NSString * staciUrl = @"https://restapi.amap.com/v3/staticmap?key=e9926badd26aaa766d13439c88a83f2d";
NSString * mapKey = @"e9926badd26aaa766d13439c88a83f2d";
NSString * loctaionUrl = @"https://a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png";
NSString * needMdString = [NSString stringWithFormat:@"key=%@&location=%f,%f&markers=-1,%@,0:%f,%f&size=700*500&zoom=15124d58f7223ac9738312a8d187a21f2b",mapKey,longLation,lation,loctaionUrl,longLation,lation];
NSString * mapUrl = [NSString stringWithFormat:@"%@&location=%f,%f&markers=-1,%@,0:%f,%f&size=700*500&zoom=15&sig=%@",staciUrl,longLation,lation,loctaionUrl,longLation,lation,[self md5:needMdString]];
return mapUrl;
}
//md加密
+ (NSString *)md5:(NSString *)str
{
const char *cStr = [str UTF8String];
unsigned char result[16];
CC_MD5(cStr, strlen(cStr), result); // This is the md5 call
return [NSString stringWithFormat:
@"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
result[0], result[1], result[2], result[3],
result[4], result[5], result[6], result[7],
result[8], result[9], result[10], result[11],
result[12], result[13], result[14], result[15]
];
}
- (CGSize)contentSize
{
CGFloat textMaxWidth = 245.f;
CGFloat textLabelWidth = textMaxWidth - 20; // 左右各 10 边距
CGRect rect = [self.text boundingRectWithSize:CGSizeMake(textLabelWidth, MAXFLOAT)
options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading
attributes:@{ NSFontAttributeName : [UIFont systemFontOfSize:14] }
context:nil];
CGFloat textHeight = ceil(rect.size.height) + 12; // 上下各 6pt
CGFloat totalHeight = textHeight + 140; // 文字 + 地图图片
return CGSizeMake(textMaxWidth, totalHeight);
}
@end