Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
b22fcea8
Commit
b22fcea8
authored
Mar 05, 2024
by
pete谢兆麟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
相片裁剪 识别逻辑UI
parent
ab689462
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
728 additions
and
60 deletions
+728
-60
project.pbxproj
galaxy/galaxy.xcodeproj/project.pbxproj
+20
-0
YHImagePickerView.swift
...ainApplicantInformation(主申请人信息)/V/YHImagePickerView.swift
+1
-4
YHImageClipperViewController.swift
...s(流程)/WorkExperience/C/YHImageClipperViewController.swift
+149
-0
YHImageResultViewController.swift
...ss(流程)/WorkExperience/C/YHImageResultViewController.swift
+86
-0
YHWorkExperienceViewController.swift
...流程)/WorkExperience/C/YHWorkExperienceViewController.swift
+10
-36
YHWorkIntroductionViewController.swift
...)/WorkExperience/C/YHWorkIntroductionViewController.swift
+6
-19
YHClipperButton.swift
...ServiceProcess(流程)/WorkExperience/V/YHClipperButton.swift
+62
-0
YHClipperView.swift
...)/ServiceProcess(流程)/WorkExperience/V/YHClipperView.swift
+291
-0
YHResultBottomView.swift
...viceProcess(流程)/WorkExperience/V/YHResultBottomView.swift
+59
-0
YHWorkResponsibilitiesTableViewCell.swift
...orkExperience/V/YHWorkResponsibilitiesTableViewCell.swift
+0
-1
Contents.json
...viceCenter/工作经验/image_clipper_back.imageset/Contents.json
+22
-0
image_clipper_back@2x.png
...作经验/image_clipper_back.imageset/image_clipper_back@2x.png
+0
-0
image_clipper_back@3x.png
...作经验/image_clipper_back.imageset/image_clipper_back@3x.png
+0
-0
Contents.json
...ceCenter/工作经验/image_clipper_cannal.imageset/Contents.json
+22
-0
image_clipper_cannal@2x.png
...image_clipper_cannal.imageset/image_clipper_cannal@2x.png
+0
-0
image_clipper_cannal@3x.png
...image_clipper_cannal.imageset/image_clipper_cannal@3x.png
+0
-0
No files found.
galaxy/galaxy.xcodeproj/project.pbxproj
View file @
b22fcea8
...
@@ -74,6 +74,11 @@
...
@@ -74,6 +74,11 @@
0468D47E2B68CEA200CFB916
/* YHImagePickerView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0468D47D2B68CEA200CFB916
/* YHImagePickerView.swift */
;
};
0468D47E2B68CEA200CFB916
/* YHImagePickerView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0468D47D2B68CEA200CFB916
/* YHImagePickerView.swift */
;
};
0468D4802B6914E600CFB916
/* YHSelectCountryViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0468D47F2B6914E600CFB916
/* YHSelectCountryViewController.swift */
;
};
0468D4802B6914E600CFB916
/* YHSelectCountryViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0468D47F2B6914E600CFB916
/* YHSelectCountryViewController.swift */
;
};
0468D4822B6A2A8500CFB916
/* YHSelectCountryViewModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0468D4812B6A2A8500CFB916
/* YHSelectCountryViewModel.swift */
;
};
0468D4822B6A2A8500CFB916
/* YHSelectCountryViewModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0468D4812B6A2A8500CFB916
/* YHSelectCountryViewModel.swift */
;
};
0469750E2B96C0B900A0CB66
/* YHImageClipperViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0469750D2B96C0B900A0CB66
/* YHImageClipperViewController.swift */
;
};
046975102B96C13700A0CB66
/* YHClipperView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0469750F2B96C13700A0CB66
/* YHClipperView.swift */
;
};
046975122B96C77000A0CB66
/* YHClipperButton.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
046975112B96C77000A0CB66
/* YHClipperButton.swift */
;
};
046975162B96EB2200A0CB66
/* YHImageResultViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
046975152B96EB2200A0CB66
/* YHImageResultViewController.swift */
;
};
046975182B96EEB200A0CB66
/* YHResultBottomView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
046975172B96EEB200A0CB66
/* YHResultBottomView.swift */
;
};
04808C062B4686510056D53C
/* ATAuthSDK.bundle in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04808C042B4686510056D53C
/* ATAuthSDK.bundle */
;
};
04808C062B4686510056D53C
/* ATAuthSDK.bundle in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04808C042B4686510056D53C
/* ATAuthSDK.bundle */
;
};
04808C082B4686C10056D53C
/* ATAuthSDK_D.framework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04808C032B4686510056D53C
/* ATAuthSDK_D.framework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
04808C082B4686C10056D53C
/* ATAuthSDK_D.framework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04808C032B4686510056D53C
/* ATAuthSDK_D.framework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
049A48A82B49417300D0C641
/* YHAboutUsViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
049A48A72B49417300D0C641
/* YHAboutUsViewController.swift */
;
};
049A48A82B49417300D0C641
/* YHAboutUsViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
049A48A72B49417300D0C641
/* YHAboutUsViewController.swift */
;
};
...
@@ -377,6 +382,11 @@
...
@@ -377,6 +382,11 @@
0468D47D2B68CEA200CFB916
/* YHImagePickerView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHImagePickerView.swift
;
sourceTree
=
"<group>"
;
};
0468D47D2B68CEA200CFB916
/* YHImagePickerView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHImagePickerView.swift
;
sourceTree
=
"<group>"
;
};
0468D47F2B6914E600CFB916
/* YHSelectCountryViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHSelectCountryViewController.swift
;
sourceTree
=
"<group>"
;
};
0468D47F2B6914E600CFB916
/* YHSelectCountryViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHSelectCountryViewController.swift
;
sourceTree
=
"<group>"
;
};
0468D4812B6A2A8500CFB916
/* YHSelectCountryViewModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHSelectCountryViewModel.swift
;
sourceTree
=
"<group>"
;
};
0468D4812B6A2A8500CFB916
/* YHSelectCountryViewModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHSelectCountryViewModel.swift
;
sourceTree
=
"<group>"
;
};
0469750D2B96C0B900A0CB66
/* YHImageClipperViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHImageClipperViewController.swift
;
sourceTree
=
"<group>"
;
};
0469750F2B96C13700A0CB66
/* YHClipperView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHClipperView.swift
;
sourceTree
=
"<group>"
;
};
046975112B96C77000A0CB66
/* YHClipperButton.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHClipperButton.swift
;
sourceTree
=
"<group>"
;
};
046975152B96EB2200A0CB66
/* YHImageResultViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHImageResultViewController.swift
;
sourceTree
=
"<group>"
;
};
046975172B96EEB200A0CB66
/* YHResultBottomView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHResultBottomView.swift
;
sourceTree
=
"<group>"
;
};
04808C032B4686510056D53C
/* ATAuthSDK_D.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
path
=
ATAuthSDK_D.framework
;
sourceTree
=
"<group>"
;
};
04808C032B4686510056D53C
/* ATAuthSDK_D.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
path
=
ATAuthSDK_D.framework
;
sourceTree
=
"<group>"
;
};
04808C042B4686510056D53C
/* ATAuthSDK.bundle */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"wrapper.plug-in"
;
path
=
ATAuthSDK.bundle
;
sourceTree
=
"<group>"
;
};
04808C042B4686510056D53C
/* ATAuthSDK.bundle */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"wrapper.plug-in"
;
path
=
ATAuthSDK.bundle
;
sourceTree
=
"<group>"
;
};
049A48A72B49417300D0C641
/* YHAboutUsViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHAboutUsViewController.swift
;
sourceTree
=
"<group>"
;
};
049A48A72B49417300D0C641
/* YHAboutUsViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHAboutUsViewController.swift
;
sourceTree
=
"<group>"
;
};
...
@@ -918,6 +928,8 @@
...
@@ -918,6 +928,8 @@
04E86E562B848D5A00A35F4B
/* YHWorkIntroductionViewController.swift */
,
04E86E562B848D5A00A35F4B
/* YHWorkIntroductionViewController.swift */
,
04E86E582B84AD6200A35F4B
/* YHWorkExampleViewController.swift */
,
04E86E582B84AD6200A35F4B
/* YHWorkExampleViewController.swift */
,
04E86E692B87352600A35F4B
/* YHCompanySelectViewController.swift */
,
04E86E692B87352600A35F4B
/* YHCompanySelectViewController.swift */
,
0469750D2B96C0B900A0CB66
/* YHImageClipperViewController.swift */
,
046975152B96EB2200A0CB66
/* YHImageResultViewController.swift */
,
);
);
path
=
C
;
path
=
C
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
...
@@ -942,6 +954,9 @@
...
@@ -942,6 +954,9 @@
04E86E3D2B834FC100A35F4B
/* YHWorkExperienceTextItemView.swift */
,
04E86E3D2B834FC100A35F4B
/* YHWorkExperienceTextItemView.swift */
,
04E86E5A2B84BF2000A35F4B
/* YHWorkExampleTypeView.swift */
,
04E86E5A2B84BF2000A35F4B
/* YHWorkExampleTypeView.swift */
,
04E86E5C2B84CC9700A35F4B
/* YHWorkExampleMessageView.swift */
,
04E86E5C2B84CC9700A35F4B
/* YHWorkExampleMessageView.swift */
,
0469750F2B96C13700A0CB66
/* YHClipperView.swift */
,
046975112B96C77000A0CB66
/* YHClipperButton.swift */
,
046975172B96EEB200A0CB66
/* YHResultBottomView.swift */
,
);
);
path
=
V
;
path
=
V
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
...
@@ -1832,12 +1847,14 @@
...
@@ -1832,12 +1847,14 @@
A5FD63C52B637EE000D1D9DA
/* YHSubmitAllInfoCheckView.swift in Sources */
,
A5FD63C52B637EE000D1D9DA
/* YHSubmitAllInfoCheckView.swift in Sources */
,
A5ACE9442B4564F7002C94D2
/* Array+Extension.swift in Sources */
,
A5ACE9442B4564F7002C94D2
/* Array+Extension.swift in Sources */
,
0468D4282B50D4AF00CFB916
/* YHPrivacyAlertView.swift in Sources */
,
0468D4282B50D4AF00CFB916
/* YHPrivacyAlertView.swift in Sources */
,
046975102B96C13700A0CB66
/* YHClipperView.swift in Sources */
,
A58556C22B6C8412003746B2
/* YHScoreResultModel.swift in Sources */
,
A58556C22B6C8412003746B2
/* YHScoreResultModel.swift in Sources */
,
0468D47A2B68A08600CFB916
/* YHAddressPickViewTableViewCell.swift in Sources */
,
0468D47A2B68A08600CFB916
/* YHAddressPickViewTableViewCell.swift in Sources */
,
0468D4342B56587B00CFB916
/* YHOSSManager.swift in Sources */
,
0468D4342B56587B00CFB916
/* YHOSSManager.swift in Sources */
,
A596C3A42B84D9100067BBB8
/* YHOtherInfoSessionView.swift in Sources */
,
A596C3A42B84D9100067BBB8
/* YHOtherInfoSessionView.swift in Sources */
,
A5234E372B70802400A33433
/* YHBasicInfoCellModel.swift in Sources */
,
A5234E372B70802400A33433
/* YHBasicInfoCellModel.swift in Sources */
,
A5C382D12B5FAAB300C5E65C
/* YHContactItemModel.swift in Sources */
,
A5C382D12B5FAAB300C5E65C
/* YHContactItemModel.swift in Sources */
,
046975182B96EEB200A0CB66
/* YHResultBottomView.swift in Sources */
,
A5FD63EF2B68902400D1D9DA
/* YHPreviewInfoNameAndSubNameItemView.swift in Sources */
,
A5FD63EF2B68902400D1D9DA
/* YHPreviewInfoNameAndSubNameItemView.swift in Sources */
,
A5ACE9522B4564F7002C94D2
/* YHServiceCenterMainViewController.swift in Sources */
,
A5ACE9522B4564F7002C94D2
/* YHServiceCenterMainViewController.swift in Sources */
,
A5C5B2FD2B55361700A7C5D1
/* YHBannerModel.swift in Sources */
,
A5C5B2FD2B55361700A7C5D1
/* YHBannerModel.swift in Sources */
,
...
@@ -1861,6 +1878,8 @@
...
@@ -1861,6 +1878,8 @@
04E86E322B81EA1000A35F4B
/* YHWorkItemAddView.swift in Sources */
,
04E86E322B81EA1000A35F4B
/* YHWorkItemAddView.swift in Sources */
,
A5C5B2FB2B5535DF00A7C5D1
/* YHHomeBannerView.swift in Sources */
,
A5C5B2FB2B5535DF00A7C5D1
/* YHHomeBannerView.swift in Sources */
,
A5F78C822B68F39600EEA170
/* YHPreviewInfoCell.swift in Sources */
,
A5F78C822B68F39600EEA170
/* YHPreviewInfoCell.swift in Sources */
,
046975122B96C77000A0CB66
/* YHClipperButton.swift in Sources */
,
0469750E2B96C0B900A0CB66
/* YHImageClipperViewController.swift in Sources */
,
A5ACE94B2B4564F7002C94D2
/* YHHUDRotatingImageView.swift in Sources */
,
A5ACE94B2B4564F7002C94D2
/* YHHUDRotatingImageView.swift in Sources */
,
041B52DD2B60A889007EBCEB
/* YHTest.swift in Sources */
,
041B52DD2B60A889007EBCEB
/* YHTest.swift in Sources */
,
04E86E0F2B70DE9400A35F4B
/* YHSpouseInfoContainerVC.swift in Sources */
,
04E86E0F2B70DE9400A35F4B
/* YHSpouseInfoContainerVC.swift in Sources */
,
...
@@ -1896,6 +1915,7 @@
...
@@ -1896,6 +1915,7 @@
04E86E2F2B81EA1000A35F4B
/* YHWorkExperienceListViewController.swift in Sources */
,
04E86E2F2B81EA1000A35F4B
/* YHWorkExperienceListViewController.swift in Sources */
,
042F88932B84AEF0008B60BD
/* YHQuestionInfo.swift in Sources */
,
042F88932B84AEF0008B60BD
/* YHQuestionInfo.swift in Sources */
,
A5ACE93F2B4564F7002C94D2
/* UIViewController+Extension.swift in Sources */
,
A5ACE93F2B4564F7002C94D2
/* UIViewController+Extension.swift in Sources */
,
046975162B96EB2200A0CB66
/* YHImageResultViewController.swift in Sources */
,
042FBBD62B67BDD500F9DE23
/* YHBrotherInfoVC.swift in Sources */
,
042FBBD62B67BDD500F9DE23
/* YHBrotherInfoVC.swift in Sources */
,
A5ACE9472B4564F7002C94D2
/* YHHUD.swift in Sources */
,
A5ACE9472B4564F7002C94D2
/* YHHUD.swift in Sources */
,
A5ACE9412B4564F7002C94D2
/* Dictionary+Extension.swift in Sources */
,
A5ACE9412B4564F7002C94D2
/* Dictionary+Extension.swift in Sources */
,
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/MainApplicantInformation(主申请人信息)/V/YHImagePickerView.swift
View file @
b22fcea8
...
@@ -173,8 +173,6 @@ class YHImagePickerView: UIView {
...
@@ -173,8 +173,6 @@ class YHImagePickerView: UIView {
imagePicker
.
delegate
=
self
imagePicker
.
delegate
=
self
//设置来源
//设置来源
imagePicker
.
sourceType
=
.
camera
imagePicker
.
sourceType
=
.
camera
//允许编辑
imagePicker
.
allowsEditing
=
true
//打开相机
//打开相机
UIViewController
.
current
?
.
present
(
imagePicker
,
animated
:
true
,
completion
:
{
()
->
Void
in
UIViewController
.
current
?
.
present
(
imagePicker
,
animated
:
true
,
completion
:
{
()
->
Void
in
...
@@ -190,7 +188,6 @@ class YHImagePickerView: UIView {
...
@@ -190,7 +188,6 @@ class YHImagePickerView: UIView {
let
imagePicker
=
UIImagePickerController
()
let
imagePicker
=
UIImagePickerController
()
imagePicker
.
delegate
=
self
imagePicker
.
delegate
=
self
imagePicker
.
sourceType
=
.
photoLibrary
imagePicker
.
sourceType
=
.
photoLibrary
imagePicker
.
allowsEditing
=
true
// 这一句,开始调用图库
// 这一句,开始调用图库
UIViewController
.
current
?
.
present
(
imagePicker
,
animated
:
true
)
UIViewController
.
current
?
.
present
(
imagePicker
,
animated
:
true
)
}
}
...
@@ -304,7 +301,7 @@ extension YHImagePickerView: UINavigationControllerDelegate, UIImagePickerContro
...
@@ -304,7 +301,7 @@ extension YHImagePickerView: UINavigationControllerDelegate, UIImagePickerContro
"businessCode"
:
"4001001"
"businessCode"
:
"4001001"
]
]
// 创建MultipartFormData对象
// 创建MultipartFormData对象
var
multipartFormData
=
MultipartFormData
()
let
multipartFormData
=
MultipartFormData
()
// 将图片添加到multipartFormData中
// 将图片添加到multipartFormData中
multipartFormData
.
append
(
imageData
,
withName
:
"file"
,
fileName
:
"image.jpg"
,
mimeType
:
"image/jpeg"
)
multipartFormData
.
append
(
imageData
,
withName
:
"file"
,
fileName
:
"image.jpg"
,
mimeType
:
"image/jpeg"
)
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/WorkExperience/C/YHImageClipperViewController.swift
0 → 100644
View file @
b22fcea8
//
// YHImageClipperViewController.swift
// galaxy
//
// Created by EDY on 2024/3/5.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
/*
let clipperVC = YHImageClipperViewController()
clipperVC.setBaseImg(image, resultImgSize: clippedImgSize!, type: clipperType)
clipperVC.cancelClippedHandler = {
}
clipperVC.successClippedHandler = {[weak self]img in
if self?.clippedImageHandler != nil{
self?.clippedImageHandler!(img)
}
}
self.pushViewController(clipperVC, animated: true)
*/
import
UIKit
class
YHImageClipperViewController
:
YHBaseViewController
{
typealias
CancelClippedHandlerBlock
=
()
->
Void
typealias
SuccessClippedHandlerBlock
=
(
_
content
:
String
)
->
Void
//MARK Public
public
var
cancelClippedHandler
:
CancelClippedHandlerBlock
?
public
var
successClippedHandler
:
SuccessClippedHandlerBlock
?
public
func
setBaseImg
(
_
baseImg
:
UIImage
,
resultImgSize
:
CGSize
,
type
:
YHClipperType
)
{
clipperView
=
YHClipperView
(
frame
:
CGRect
(
x
:
0
,
y
:
(
isIphoneX
()
?
88
:
64
),
width
:
KScreenWidth
,
height
:
KScreenHeight
-
k_Height_safeAreaInsetsBottom
()
-
54
-
(
isIphoneX
()
?
88
:
64
)))
clipperView
?
.
resultImgSize
=
resultImgSize
clipperView
?
.
baseImg
=
baseImg
clipperView
?
.
type
=
type
self
.
view
.
addSubview
(
clipperView
!
)
}
//MARK Private
private
var
clipperView
:
YHClipperView
?
private
var
cannalButton
:
YHClipperButton
!
private
var
backImageButton
:
YHClipperButton
!
private
var
sureButton
:
UIButton
!
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
view
.
backgroundColor
=
.
black
self
.
hidesBottomBarWhenPushed
=
true
if
#available(iOS 11.0, *)
{
}
else
{
self
.
automaticallyAdjustsScrollViewInsets
=
false
}
// Do any additional setup after loading the view.
setView
()
}
func
setView
()
{
sureButton
=
{
let
button
=
UIButton
(
type
:
.
custom
)
button
.
titleLabel
?
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
15
)
button
.
backgroundColor
=
UIColor
(
hex
:
0x2274ee
)
button
.
contentHorizontalAlignment
=
.
center
button
.
setTitle
(
"确认"
,
for
:
.
normal
)
button
.
setTitleColor
(
UIColor
(
hex
:
0xffffff
),
for
:
.
normal
)
button
.
layer
.
cornerRadius
=
kCornerRadius6
button
.
clipsToBounds
=
true
button
.
addTarget
(
self
,
action
:
#selector(
sureBtnClick
)
,
for
:
.
touchUpInside
)
return
button
}()
view
.
addSubview
(
sureButton
)
sureButton
.
snp
.
makeConstraints
{
make
in
make
.
right
.
equalTo
(
-
16
)
make
.
bottom
.
equalTo
(
-
10
-
k_Height_safeAreaInsetsBottom
())
make
.
height
.
equalTo
(
44
)
make
.
width
.
equalTo
(
93
)
}
cannalButton
=
{
let
button
=
YHClipperButton
()
button
.
setContent
(
"image_clipper_cannal"
,
"取消"
)
button
.
addTarget
(
self
,
action
:
#selector(
cannalBtnClick
)
,
for
:
.
touchUpInside
)
return
button
}()
view
.
addSubview
(
cannalButton
)
cannalButton
.
snp
.
makeConstraints
{
make
in
make
.
centerY
.
equalTo
(
sureButton
.
snp
.
centerY
)
make
.
left
.
equalTo
(
30
)
make
.
height
.
equalTo
(
44
)
make
.
width
.
equalTo
(
30
)
}
backImageButton
=
{
let
button
=
YHClipperButton
()
button
.
setContent
(
"image_clipper_back"
,
"复原"
)
button
.
addTarget
(
self
,
action
:
#selector(
backImageBtnClick
)
,
for
:
.
touchUpInside
)
return
button
}()
view
.
addSubview
(
backImageButton
)
backImageButton
.
snp
.
makeConstraints
{
make
in
make
.
centerY
.
equalTo
(
sureButton
.
snp
.
centerY
)
make
.
left
.
equalTo
(
80
)
make
.
height
.
equalTo
(
44
)
make
.
width
.
equalTo
(
30
)
}
}
@objc
private
func
cannalBtnClick
()
{
if
cancelClippedHandler
!=
nil
{
cancelClippedHandler
!
()
}
self
.
navigationController
?
.
popViewController
()
}
@objc
private
func
backImageBtnClick
()
{
// if cancelClippedHandler != nil {
// cancelClippedHandler!()
// }
}
@objc
private
func
sureBtnClick
()
{
let
clippedImg
=
self
.
clipperView
?
.
clipImg
()
let
vc
=
YHImageResultViewController
()
vc
.
img
=
clippedImg
vc
.
successHandlerBlock
=
{
[
weak
self
]
result
in
guard
let
self
=
self
else
{
return
}
if
successClippedHandler
!=
nil
{
successClippedHandler
!
(
result
)
}
}
self
.
navigationController
?
.
pushViewController
(
vc
)
}
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
navigationController
?
.
isNavigationBarHidden
=
false
}
override
func
didReceiveMemoryWarning
()
{
super
.
didReceiveMemoryWarning
()
// Dispose of any resources that can be recreated.
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/WorkExperience/C/YHImageResultViewController.swift
0 → 100644
View file @
b22fcea8
//
// YHImageResultViewController.swift
// galaxy
//
// Created by EDY on 2024/3/5.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHImageResultViewController
:
YHBaseViewController
{
typealias
SuccessHandlerBlock
=
(
_
relult
:
String
)
->
Void
var
successHandlerBlock
:
SuccessHandlerBlock
?
var
resultView
:
UIImageView
!
var
bottomView
:
YHResultBottomView
!
var
img
:
UIImage
!
var
viewModel
:
YHWorkExperienceViewModel
!
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
viewModel
=
YHWorkExperienceViewModel
()
gk_navTitle
=
"照片"
setView
()
// Do any additional setup after loading the view.
}
func
setView
()
{
resultView
=
{
let
step
=
UIImageView
()
step
.
contentMode
=
.
scaleAspectFit
step
.
image
=
img
return
step
}()
view
.
addSubview
(
resultView
)
resultView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalTo
(
k_Height_NavigationtBarAndStatuBar
)
make
.
left
.
right
.
equalTo
(
view
)
make
.
bottom
.
equalTo
(
-
k_Height_safeAreaInsetsBottom
()
-
54
)
}
bottomView
=
{
let
bottom
=
YHResultBottomView
()
bottom
.
nextblock
=
{[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
YHHUD
.
show
(
.
progress
(
message
:
""
))
self
.
viewModel
.
uploadImage
(
self
.
img
)
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
guard
let
url
=
success
else
{
return
}
self
.
viewModel
.
getPublicImageUrl
(
url
)
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
guard
let
url
=
success
else
{
return
}
self
.
viewModel
.
requestFileMessage
(
url
)
{[
weak
self
]
success
,
model
,
error
in
guard
let
self
=
self
else
{
return
}
if
success
{
YHHUD
.
hide
()
if
let
block
=
self
.
successHandlerBlock
{
block
(
model
?
.
content
??
""
)
let
mineVC
=
YHWorkExperienceViewController
()
var
targetVC
:
UIViewController
!
for
controller
in
self
.
navigationController
!.
viewControllers
{
if
controller
.
isKind
(
of
:
mineVC
.
classForCoder
)
{
targetVC
=
controller
}
}
if
targetVC
!=
nil
{
self
.
navigationController
?
.
popToViewController
(
targetVC
,
animated
:
true
)
}
}
}
else
{
YHHUD
.
hide
()
YHHUD
.
flash
(
message
:
error
?
.
errorMsg
??
""
)
}
}
}
}
}
return
bottom
}()
view
.
addSubview
(
bottomView
)
bottomView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
bottom
.
equalTo
(
view
)
make
.
height
.
equalTo
(
k_Height_safeAreaInsetsBottom
()
+
64
)
}
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/WorkExperience/C/YHWorkExperienceViewController.swift
View file @
b22fcea8
...
@@ -238,27 +238,14 @@ extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSo
...
@@ -238,27 +238,14 @@ extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSo
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
YHImagePickerView
.
show
()
{[
weak
self
]
image
in
YHImagePickerView
.
show
()
{[
weak
self
]
image
in
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
YHHUD
.
show
(
.
progress
(
message
:
""
))
let
clipperVC
=
YHImageClipperViewController
()
self
.
viewModel
.
uploadImage
(
image
)
{[
weak
self
]
success
,
error
in
clipperVC
.
setBaseImg
(
image
,
resultImgSize
:
CGSize
(
width
:
300
,
height
:
300
),
type
:
.
Stay
)
guard
let
self
=
self
else
{
return
}
clipperVC
.
successClippedHandler
=
{[
weak
self
]
result
in
guard
let
url
=
success
else
{
return
}
self
.
viewModel
.
getPublicImageUrl
(
url
)
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
guard
let
url
=
success
else
{
return
}
self
.
viewModel
.
mainModel
.
wduty
=
result
self
.
viewModel
.
requestFileMessage
(
url
)
{[
weak
self
]
success
,
model
,
error
in
guard
let
self
=
self
else
{
return
}
if
success
{
YHHUD
.
hide
()
self
.
viewModel
.
mainModel
.
wduty
=
model
?
.
content
??
""
cell
.
dataSource
=
viewModel
.
mainModel
.
wduty
cell
.
dataSource
=
viewModel
.
mainModel
.
wduty
}
else
{
YHHUD
.
hide
()
YHHUD
.
flash
(
message
:
error
?
.
errorMsg
??
""
)
}
}
}
}
}
self
.
navigationController
?
.
pushViewController
(
clipperVC
,
animated
:
true
)
}
}
}
}
return
cell
return
cell
...
@@ -294,27 +281,14 @@ extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSo
...
@@ -294,27 +281,14 @@ extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSo
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
YHImagePickerView
.
show
()
{[
weak
self
]
image
in
YHImagePickerView
.
show
()
{[
weak
self
]
image
in
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
YHHUD
.
show
(
.
progress
(
message
:
""
))
let
clipperVC
=
YHImageClipperViewController
()
self
.
viewModel
.
uploadImage
(
image
)
{[
weak
self
]
success
,
error
in
clipperVC
.
setBaseImg
(
image
,
resultImgSize
:
CGSize
(
width
:
300
,
height
:
300
),
type
:
.
Stay
)
guard
let
self
=
self
else
{
return
}
clipperVC
.
successClippedHandler
=
{[
weak
self
]
result
in
guard
let
url
=
success
else
{
return
}
self
.
viewModel
.
getPublicImageUrl
(
url
)
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
guard
let
url
=
success
else
{
return
}
self
.
viewModel
.
mainModel
.
highlights
=
result
self
.
viewModel
.
requestFileMessage
(
url
)
{[
weak
self
]
success
,
model
,
error
in
guard
let
self
=
self
else
{
return
}
if
success
{
YHHUD
.
hide
()
self
.
viewModel
.
mainModel
.
highlights
=
model
?
.
content
??
""
cell
.
dataSource
=
viewModel
.
mainModel
.
highlights
cell
.
dataSource
=
viewModel
.
mainModel
.
highlights
}
else
{
YHHUD
.
hide
()
YHHUD
.
flash
(
message
:
error
?
.
errorMsg
??
""
)
}
}
}
}
}
self
.
navigationController
?
.
pushViewController
(
clipperVC
,
animated
:
true
)
}
}
}
}
return
cell
return
cell
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/WorkExperience/C/YHWorkIntroductionViewController.swift
View file @
b22fcea8
...
@@ -205,27 +205,14 @@ class YHWorkIntroductionViewController: YHBaseViewController {
...
@@ -205,27 +205,14 @@ class YHWorkIntroductionViewController: YHBaseViewController {
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
YHImagePickerView
.
show
()
{[
weak
self
]
image
in
YHImagePickerView
.
show
()
{[
weak
self
]
image
in
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
YHHUD
.
show
(
.
progress
(
message
:
"加载中"
))
let
clipperVC
=
YHImageClipperViewController
()
self
.
viewModel
.
uploadImage
(
image
)
{[
weak
self
]
success
,
error
in
clipperVC
.
setBaseImg
(
image
,
resultImgSize
:
CGSize
(
width
:
300
,
height
:
300
),
type
:
.
Stay
)
clipperVC
.
successClippedHandler
=
{[
weak
self
]
result
in
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
guard
let
url
=
success
else
{
return
}
self
.
dataSource
.
project_highlights
=
result
self
.
viewModel
.
getPublicImageUrl
(
url
)
{[
weak
self
]
success
,
error
in
self
.
messageTextField
.
text
=
result
guard
let
self
=
self
else
{
return
}
guard
let
url
=
success
else
{
return
}
self
.
viewModel
.
requestFileMessage
(
url
)
{[
weak
self
]
success
,
model
,
error
in
guard
let
self
=
self
else
{
return
}
if
success
{
YHHUD
.
hide
()
self
.
dataSource
.
project_highlights
=
model
?
.
content
self
.
messageTextField
.
text
=
model
?
.
content
}
else
{
YHHUD
.
hide
()
YHHUD
.
flash
(
message
:
error
?
.
errorMsg
??
""
)
}
}
}
}
}
self
.
navigationController
?
.
pushViewController
(
clipperVC
,
animated
:
true
)
}
}
}
}
return
view
return
view
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/WorkExperience/V/YHClipperButton.swift
0 → 100644
View file @
b22fcea8
//
// YHClipperButton.swift
// galaxy
//
// Created by EDY on 2024/3/5.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHClipperButton
:
UIButton
{
var
topImageView
:
UIImageView
!
var
bottomTitleLabel
:
UILabel
!
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
setView
()
}
required
init
?(
coder
:
NSCoder
)
{
fatalError
(
"init(coder:) has not been implemented"
)
}
func
setView
()
{
topImageView
=
{
let
view
=
UIImageView
()
return
view
}()
addSubview
(
topImageView
)
topImageView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
centerX
.
equalToSuperview
()
make
.
width
.
height
.
equalTo
(
21
)
}
bottomTitleLabel
=
{
let
label
=
UILabel
()
label
.
font
=
UIFont
.
PFSC_B
(
ofSize
:
11
)
label
.
textAlignment
=
.
center
label
.
textColor
=
UIColor
.
white
return
label
}()
addSubview
(
bottomTitleLabel
)
bottomTitleLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
bottom
.
equalToSuperview
()
make
.
height
.
equalTo
(
15
)
}
}
func
setContent
(
_
image
:
String
,
_
title
:
String
)
{
bottomTitleLabel
.
text
=
title
topImageView
.
image
=
UIImage
(
named
:
image
)
}
/*
// Only override draw() if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
override func draw(_ rect: CGRect) {
// Drawing code
}
*/
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/WorkExperience/V/YHClipperView.swift
0 → 100644
View file @
b22fcea8
//
// YHClipperView.swift
// galaxy
//
// Created by EDY on 2024/3/5.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
enum
YHClipperType
{
case
Move
case
Stay
}
class
YHClipperView
:
UIView
{
public
var
resultImgSize
:
CGSize
?{
didSet
{
self
.
setClipperView
()
}
}
public
var
type
:
YHClipperType
=
.
Move
public
var
baseImg
:
UIImage
?{
didSet
{
var
width
=
baseImg
?
.
size
.
width
??
0
var
height
=
baseImg
?
.
size
.
height
??
0
if
width
!=
self
.
frame
.
size
.
width
{
width
=
self
.
frame
.
size
.
width
}
height
=
(
baseImg
?
.
size
.
height
??
0
)
!
/
(
baseImg
?
.
size
.
width
??
0
)
!
*
width
if
height
<
(
self
.
clipperView
?
.
frame
.
size
.
height
??
0
)
!
{
height
=
(
self
.
clipperView
?
.
frame
.
size
.
height
??
0
)
!
}
width
=
(
baseImg
?
.
size
.
width
??
0
)
!
/
(
baseImg
?
.
size
.
height
??
0
)
!
*
height
let
img
=
baseImg
?
.
scaledToSize
(
newSize
:
CGSize
(
width
:
width
,
height
:
height
),
withScale
:
false
)
self
.
baseImgView
?
.
image
=
img
self
.
baseImgView
?
.
frame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
(
img
?
.
size
.
width
)
!
,
height
:
(
img
?
.
size
.
height
)
!
)
correctBackImgView
()
}
}
private
let
minWidth
:
CGFloat
=
60
private
var
clipperView
:
UIImageView
?
private
lazy
var
baseImgView
:
UIImageView
?
=
{
let
baseImgView
=
UIImageView
()
self
.
addSubview
(
baseImgView
)
self
.
sendSubviewToBack
(
baseImgView
)
return
baseImgView
}()
private
lazy
var
fillLayer
:
CAShapeLayer
?
=
{
let
fillLayer
=
CAShapeLayer
()
fillLayer
.
fillRule
=
CAShapeLayerFillRule
.
evenOdd
fillLayer
.
fillColor
=
UIColor
.
black
.
cgColor
fillLayer
.
opacity
=
0.5
self
.
layer
.
addSublayer
(
fillLayer
)
return
fillLayer
}()
private
var
panTouch
:
CGPoint
?
private
var
scaleDistance
:
CGFloat
=
0
//缩放距离
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
loadSubViews
()
}
//MARK Public
public
func
clipImg
()
->
UIImage
{
let
scale
=
UIScreen
.
main
.
scale
*
(
self
.
baseImgView
?
.
image
?
.
size
.
width
)
!/
(
self
.
baseImgView
?
.
frame
.
size
.
width
)
!
let
rect
=
self
.
convert
((
self
.
clipperView
?
.
frame
)
!
,
to
:
self
.
baseImgView
)
let
rect2
=
CGRect
(
x
:
rect
.
origin
.
x
*
scale
,
y
:
rect
.
origin
.
y
*
scale
,
width
:
rect
.
size
.
width
*
scale
,
height
:
rect
.
size
.
height
*
scale
)
let
cgImg
=
self
.
baseImgView
?
.
image
?
.
cgImage
?
.
cropping
(
to
:
rect2
)
let
clippedImg
=
UIImage
.
init
(
cgImage
:
cgImg
!
)
return
clippedImg
}
private
func
loadSubViews
()
{
self
.
layer
.
contentsGravity
=
CALayerContentsGravity
.
resizeAspect
}
private
func
setClipperView
()
{
let
kscWidth
=
UIScreen
.
main
.
bounds
.
size
.
width
let
kscHeight
=
UIScreen
.
main
.
bounds
.
size
.
height
-
64
var
width
=
kscWidth
var
height
=
kscHeight
if
(
self
.
resultImgSize
?
.
width
)
!
>
((
self
.
resultImgSize
?
.
height
??
0
)
!
/
height
*
width
)
{
height
=
kscWidth
/
(
self
.
resultImgSize
?
.
width
??
0
)
!
*
(
self
.
resultImgSize
?
.
height
??
0
)
!
}
else
{
width
=
kscHeight
/
(
self
.
resultImgSize
?
.
height
??
0
)
!
*
(
self
.
resultImgSize
?
.
width
??
0
)
!
}
let
y
=
(
kscHeight
-
height
)
/
2
let
x
=
(
kscWidth
-
width
)
/
2
clipperView
=
UIImageView
(
frame
:
CGRect
(
x
:
x
,
y
:
y
,
width
:
width
,
height
:
height
))
clipperView
?
.
layer
.
borderColor
=
UIColor
.
white
.
cgColor
clipperView
?
.
layer
.
borderWidth
=
2
self
.
addSubview
(
clipperView
!
)
correctFillLayer
()
}
//MARK Touches (注意问题::::)
override
func
touchesBegan
(
_
touches
:
Set
<
UITouch
>
,
with
event
:
UIEvent
?)
{
let
allTouches
=
event
?
.
allTouches
switch
allTouches
?
.
count
{
case
1
?:
panTouch
=
allTouches
?
.
first
?
.
location
(
in
:
self
)
break
default
:
break
}
}
override
func
touchesMoved
(
_
touches
:
Set
<
UITouch
>
,
with
event
:
UIEvent
?)
{
self
.
willChangeValue
(
forKey
:
"crop"
)
let
allTouches
=
event
?
.
allTouches
switch
allTouches
?
.
count
{
case
1
?:
let
touchCurrent
=
allTouches
?
.
first
?
.
location
(
in
:
self
)
let
x
=
(
touchCurrent
?
.
x
??
0
)
!
-
(
panTouch
?
.
x
??
0
)
!
let
y
=
(
touchCurrent
?
.
y
??
0
)
!
-
(
panTouch
?
.
y
??
0
)
!
switch
type
{
case
.
Move
:
self
.
baseImgView
?
.
center
=
CGPoint
(
x
:
(
self
.
baseImgView
?
.
center
.
x
??
0
)
!
+
x
,
y
:
(
self
.
baseImgView
?
.
center
.
y
??
0
)
!
+
y
)
break
case
.
Stay
:
self
.
clipperView
?
.
center
=
CGPoint
(
x
:
(
self
.
clipperView
?
.
center
.
x
??
0
)
!
+
x
,
y
:
(
self
.
clipperView
?
.
center
.
y
??
0
)
!
+
y
)
break
}
panTouch
=
touchCurrent
break
case
2
?:
switch
type
{
case
.
Move
:
self
.
scaleView
(
self
.
baseImgView
!
,
touches
:
(
allTouches
!
as
NSSet
)
.
allObjects
)
break
case
.
Stay
:
self
.
scaleView
(
self
.
clipperView
!
,
touches
:
(
allTouches
!
as
NSSet
)
.
allObjects
)
break
}
break
default
:
break
}
correctFillLayer
()
}
override
func
touchesEnded
(
_
touches
:
Set
<
UITouch
>
,
with
event
:
UIEvent
?)
{
switch
type
{
case
.
Move
:
correctBackImgView
()
break
case
.
Stay
:
correctClipperView
()
break
}
}
//MARK Correct
private
func
correctBackImgView
(){
var
x
=
self
.
baseImgView
?
.
frame
.
origin
.
x
??
0
var
y
=
self
.
baseImgView
?
.
frame
.
origin
.
y
??
0
var
height
=
self
.
baseImgView
?
.
frame
.
size
.
height
??
0
var
width
=
self
.
baseImgView
?
.
frame
.
size
.
width
??
0
if
width
<
(
self
.
clipperView
?
.
frame
.
size
.
width
??
0
)
!
{
width
=
(
self
.
clipperView
?
.
frame
.
size
.
width
??
0
)
!
height
=
width
/
(
self
.
baseImgView
?
.
frame
.
size
.
width
??
0
)
!
*
height
}
if
height
<
(
self
.
clipperView
?
.
frame
.
size
.
height
??
0
)
!
{
height
=
(
self
.
clipperView
?
.
frame
.
size
.
height
??
0
)
!
width
=
height
/
(
self
.
baseImgView
?
.
frame
.
size
.
height
??
0
)
!
*
width
}
if
x
>
(
self
.
clipperView
?
.
frame
.
origin
.
x
??
0
)
!
{
x
=
(
self
.
clipperView
?
.
frame
.
origin
.
x
??
0
)
!
}
else
if
x
<
((
self
.
clipperView
?
.
frame
.
origin
.
x
??
0
)
!
+
(
self
.
clipperView
?
.
frame
.
size
.
width
??
0
)
!
-
width
){
x
=
(
self
.
clipperView
?
.
frame
.
origin
.
x
??
0
)
!
+
(
self
.
clipperView
?
.
frame
.
size
.
width
??
0
)
!
-
width
}
if
y
>
(
self
.
clipperView
?
.
frame
.
origin
.
y
??
0
)
!
{
y
=
(
self
.
clipperView
?
.
frame
.
origin
.
y
??
0
)
!
}
else
if
y
<
(
self
.
clipperView
?
.
frame
.
origin
.
y
??
0
)
!
+
(
self
.
clipperView
?
.
frame
.
size
.
height
??
0
)
!
-
height
{
y
=
(
self
.
clipperView
?
.
frame
.
origin
.
y
??
0
)
!
+
(
self
.
clipperView
?
.
frame
.
size
.
height
??
0
)
!
-
height
}
self
.
baseImgView
?
.
frame
=
CGRect
(
x
:
x
,
y
:
y
,
width
:
width
,
height
:
height
)
}
private
func
correctClipperView
(){
var
width
=
self
.
clipperView
?
.
frame
.
size
.
width
??
0
var
height
:
CGFloat
=
0.0
if
width
<
minWidth
{
width
=
minWidth
}
if
width
>
UIScreen
.
main
.
bounds
.
size
.
width
{
width
=
UIScreen
.
main
.
bounds
.
size
.
width
}
height
=
width
/
(
self
.
resultImgSize
?
.
width
??
0
)
!
*
(
self
.
resultImgSize
?
.
height
??
0
)
!
var
x
=
self
.
clipperView
?
.
frame
.
origin
.
x
??
0
var
y
=
self
.
clipperView
?
.
frame
.
origin
.
y
??
0
if
x
<
(
self
.
baseImgView
?
.
frame
.
origin
.
x
??
0
)
!
{
x
=
(
self
.
baseImgView
?
.
frame
.
origin
.
x
??
0
)
!
}
if
x
>
UIScreen
.
main
.
bounds
.
size
.
width
-
width
{
x
=
UIScreen
.
main
.
bounds
.
size
.
width
-
width
}
if
y
<
(
self
.
baseImgView
?
.
frame
.
origin
.
y
??
0
)
!
{
y
=
(
self
.
baseImgView
?
.
frame
.
origin
.
y
??
0
)
!
}
let
tempy
=
(
self
.
baseImgView
?
.
frame
.
origin
.
y
??
0
)
!
+
(
self
.
baseImgView
?
.
frame
.
size
.
height
??
0
)
!
-
(
self
.
clipperView
?
.
frame
.
size
.
height
??
0
)
!
if
y
>
tempy
{
y
=
(
self
.
baseImgView
?
.
frame
.
origin
.
y
??
0
)
!
+
(
self
.
baseImgView
?
.
frame
.
size
.
height
??
0
)
!
-
(
self
.
clipperView
?
.
frame
.
size
.
height
??
0
)
!
}
self
.
clipperView
?
.
frame
=
CGRect
(
x
:
x
,
y
:
y
,
width
:
width
,
height
:
height
)
correctFillLayer
()
}
private
func
correctFillLayer
()
{
let
path
=
UIBezierPath
.
init
(
roundedRect
:
self
.
bounds
,
cornerRadius
:
0
)
let
circlePath
=
UIBezierPath
.
init
(
roundedRect
:
(
clipperView
?
.
frame
)
!
,
cornerRadius
:
0
)
path
.
append
(
circlePath
)
path
.
usesEvenOddFillRule
=
true
self
.
fillLayer
?
.
path
=
path
.
cgPath
}
//MARK Correct
private
func
scaleView
(
_
view
:
UIView
,
touches
:
Array
<
Any
>
){
let
touch1
=
(
touches
[
0
]
as
AnyObject
)
.
location
(
in
:
self
)
let
touch2
=
(
touches
[
1
]
as
AnyObject
)
.
location
(
in
:
self
)
let
distance
=
self
.
distanceBetweenTwoPoints
(
touch1
,
toPoint
:
touch2
)
if
scaleDistance
>
0
{
var
imgFrame
=
view
.
frame
if
distance
>
scaleDistance
+
2
{
imgFrame
.
size
.
width
+=
10
scaleDistance
=
distance
}
if
distance
<
scaleDistance
-
2
{
imgFrame
.
size
.
width
-=
10
scaleDistance
=
distance
}
if
type
==
.
Stay
{
//图片不动
imgFrame
.
size
.
height
=
view
.
frame
.
size
.
height
*
imgFrame
.
size
.
width
/
view
.
frame
.
size
.
width
let
mainWidth
=
UIScreen
.
main
.
bounds
.
size
.
width
let
imgWidth
=
imgFrame
.
size
.
width
>
mainWidth
?
mainWidth
:
imgFrame
.
size
.
width
let
imgHeight
=
imgWidth
*
(
resultImgSize
?
.
height
??
0
)
/
(
resultImgSize
?
.
width
==
0
?
1
:
(
resultImgSize
?
.
width
??
1
)
!
)
let
addwidth
=
imgWidth
-
view
.
frame
.
size
.
width
let
addheight
=
imgHeight
-
view
.
frame
.
size
.
height
if
imgHeight
!=
0
&&
imgWidth
!=
0
{
view
.
frame
=
CGRect
(
x
:
imgFrame
.
origin
.
x
-
addwidth
/
2.0
,
y
:
imgFrame
.
origin
.
y
-
addheight
/
2.0
,
width
:
imgWidth
,
height
:
imgHeight
)
}
}
else
{
//图片移动
imgFrame
.
size
.
height
=
view
.
frame
.
size
.
height
*
imgFrame
.
size
.
width
/
view
.
frame
.
size
.
width
let
addwidth
=
imgFrame
.
size
.
width
-
view
.
frame
.
size
.
width
let
addheight
=
imgFrame
.
size
.
height
-
view
.
frame
.
size
.
height
let
cripWidth
=
imgFrame
.
size
.
width
-
(
clipperView
?
.
frame
.
width
??
0
)
let
cripHeight
=
imgFrame
.
size
.
height
-
(
clipperView
?
.
frame
.
height
??
0
)
if
imgFrame
.
size
.
width
!=
0
&&
imgFrame
.
size
.
height
!=
0
&&
cripWidth
>
-
5
&&
cripHeight
>
-
5
{
view
.
frame
=
CGRect
(
x
:
imgFrame
.
origin
.
x
-
addwidth
/
2.0
,
y
:
imgFrame
.
origin
.
y
-
addheight
/
2.0
,
width
:
imgFrame
.
width
,
height
:
imgFrame
.
height
)
}
}
}
else
{
scaleDistance
=
distance
}
}
private
func
distanceBetweenTwoPoints
(
_
fromPoint
:
CGPoint
,
toPoint
:
CGPoint
)
->
CGFloat
{
let
x
=
toPoint
.
x
-
fromPoint
.
x
let
y
=
toPoint
.
y
-
fromPoint
.
y
return
CGFloat
(
sqrtf
(
Float
(
x
*
x
+
y
*
y
)))
}
required
init
?(
coder
aDecoder
:
NSCoder
)
{
fatalError
(
"init(coder:) has not been implemented"
)
}
}
extension
UIImage
{
func
scaledToSize
(
newSize
:
CGSize
,
withScale
:
Bool
)
->
UIImage
{
var
scale
:
CGFloat
=
1
if
withScale
{
scale
=
UIScreen
.
main
.
scale
}
let
mynewSize
=
CGSize
(
width
:
newSize
.
width
*
scale
,
height
:
newSize
.
height
*
scale
)
UIGraphicsBeginImageContextWithOptions
(
mynewSize
,
false
,
0
)
self
.
draw
(
in
:
CGRect
(
origin
:
CGPoint
.
zero
,
size
:
mynewSize
))
let
newImage
=
UIGraphicsGetImageFromCurrentImageContext
()
UIGraphicsEndImageContext
()
return
newImage
??
UIImage
()
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/WorkExperience/V/YHResultBottomView.swift
0 → 100644
View file @
b22fcea8
//
// YHResultBottomView.swift
// galaxy
//
// Created by EDY on 2024/3/5.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHResultBottomView
:
UIView
{
typealias
Block
=
()
->
()
var
nextblock
:
Block
?
var
nextButton
:
UIButton
!
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
backgroundColor
=
.
white
setUpView
()
}
required
init
?(
coder
:
NSCoder
)
{
fatalError
(
"init(coder:) has not been implemented"
)
}
func
setUpView
()
{
nextButton
=
{
let
button
=
UIButton
(
type
:
.
custom
)
button
.
titleLabel
?
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
15
)
button
.
backgroundColor
=
UIColor
(
hex
:
0x2274ee
)
button
.
contentHorizontalAlignment
=
.
center
button
.
setTitle
(
"开始识别"
,
for
:
.
normal
)
button
.
setTitleColor
(
UIColor
(
hex
:
0xffffff
),
for
:
.
normal
)
button
.
layer
.
cornerRadius
=
kCornerRadius6
button
.
clipsToBounds
=
true
button
.
addTarget
(
self
,
action
:
#selector(
goNext
)
,
for
:
.
touchUpInside
)
return
button
}()
addSubview
(
nextButton
)
nextButton
.
snp
.
makeConstraints
{
make
in
make
.
right
.
equalTo
(
-
16
)
make
.
top
.
equalTo
(
10
)
make
.
height
.
equalTo
(
44
)
make
.
left
.
equalTo
(
16
)
}
// nextButton.layoutIfNeeded()
// nextButton.backgroundGradient()
// nextButton.addYinHeGradualLayer()
}
@objc
func
goNext
()
{
if
let
block
=
nextblock
{
block
()
}
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/WorkExperience/V/YHWorkResponsibilitiesTableViewCell.swift
View file @
b22fcea8
...
@@ -187,7 +187,6 @@ extension YHWorkResponsibilitiesTableViewCell: UITextViewDelegate {
...
@@ -187,7 +187,6 @@ extension YHWorkResponsibilitiesTableViewCell: UITextViewDelegate {
func
textView
(
_
textView
:
UITextView
,
shouldChangeTextIn
range
:
NSRange
,
replacementText
text
:
String
)
->
Bool
{
func
textView
(
_
textView
:
UITextView
,
shouldChangeTextIn
range
:
NSRange
,
replacementText
text
:
String
)
->
Bool
{
let
newLength
=
(
textView
.
text
as
NSString
)
.
length
+
text
.
count
-
range
.
length
let
newLength
=
(
textView
.
text
as
NSString
)
.
length
+
text
.
count
-
range
.
length
return
newLength
<=
2000
return
newLength
<=
2000
}
}
}
}
galaxy/galaxy/Res/Assets.xcassets/ServiceCenter/工作经验/image_clipper_back.imageset/Contents.json
0 → 100644
View file @
b22fcea8
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"image_clipper_back@2x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"filename"
:
"image_clipper_back@3x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
galaxy/galaxy/Res/Assets.xcassets/ServiceCenter/工作经验/image_clipper_back.imageset/image_clipper_back@2x.png
0 → 100644
View file @
b22fcea8
1.04 KB
galaxy/galaxy/Res/Assets.xcassets/ServiceCenter/工作经验/image_clipper_back.imageset/image_clipper_back@3x.png
0 → 100644
View file @
b22fcea8
1.65 KB
galaxy/galaxy/Res/Assets.xcassets/ServiceCenter/工作经验/image_clipper_cannal.imageset/Contents.json
0 → 100644
View file @
b22fcea8
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"image_clipper_cannal@2x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"filename"
:
"image_clipper_cannal@3x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
galaxy/galaxy/Res/Assets.xcassets/ServiceCenter/工作经验/image_clipper_cannal.imageset/image_clipper_cannal@2x.png
0 → 100644
View file @
b22fcea8
566 Bytes
galaxy/galaxy/Res/Assets.xcassets/ServiceCenter/工作经验/image_clipper_cannal.imageset/image_clipper_cannal@3x.png
0 → 100644
View file @
b22fcea8
899 Bytes
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment