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
bfecfec8
Commit
bfecfec8
authored
May 20, 2024
by
David黄金龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加 注销功能
parent
2efcfcd0
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
563 additions
and
13 deletions
+563
-13
project.pbxproj
galaxy/galaxy.xcodeproj/project.pbxproj
+11
-3
YHCommonAlertView2.swift
...ervice(服务中心)/MySignature(我的签字)/V/YHCommonAlertView2.swift
+222
-0
YHCommonAlertView3.swift
...ervice(服务中心)/MySignature(我的签字)/V/YHCommonAlertView3.swift
+230
-0
YHCodeSueecssViewController.swift
...ses/Modules/Login(登录)/C/YHCodeSueecssViewController.swift
+11
-4
YHLoginViewModel.swift
...alaxy/Classes/Modules/Login(登录)/VM/YHLoginViewModel.swift
+25
-1
YHMySettingViewController.swift
...lasses/Modules/Mine(我的)/C/YHMySettingViewController.swift
+56
-2
YHAllApiName.swift
galaxy/galaxy/Classes/Tools/NetWork/YHAllApiName.swift
+2
-0
YHNetRequest.swift
galaxy/galaxy/Classes/Tools/NetWork/YHNetRequest.swift
+6
-3
No files found.
galaxy/galaxy.xcodeproj/project.pbxproj
View file @
bfecfec8
...
...
@@ -404,6 +404,8 @@
A5C382CC2B5EA11800C5E65C
/* YHContractCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
A5C382CB2B5EA11800C5E65C
/* YHContractCell.swift */
;
};
A5C382CF2B5F9A9100C5E65C
/* YHServiceCenterMainViewModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
A5C382CE2B5F9A9100C5E65C
/* YHServiceCenterMainViewModel.swift */
;
};
A5C382D12B5FAAB300C5E65C
/* YHContactItemModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
A5C382D02B5FAAB300C5E65C
/* YHContactItemModel.swift */
;
};
A5C468572BFB1DAB0015E726
/* YHCommonAlertView2.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
A5C468562BFB1DAB0015E726
/* YHCommonAlertView2.swift */
;
};
A5C468592BFB37380015E726
/* YHCommonAlertView3.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
A5C468582BFB37380015E726
/* YHCommonAlertView3.swift */
;
};
A5C5B2EE2B4F9B8800A7C5D1
/* Localizable.xcstrings in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
A5C5B2ED2B4F9B8800A7C5D1
/* Localizable.xcstrings */
;
};
A5D001212BAA9D99001F003C
/* YHChoiceButtonHoldView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
A5D001202BAA9D99001F003C
/* YHChoiceButtonHoldView.swift */
;
};
A5D0012A2BABC84A001F003C
/* YHFileListHeaerView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
A5D001272BABC84A001F003C
/* YHFileListHeaerView.swift */
;
};
...
...
@@ -866,6 +868,8 @@
A5C382CB2B5EA11800C5E65C
/* YHContractCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHContractCell.swift
;
sourceTree
=
"<group>"
;
};
A5C382CE2B5F9A9100C5E65C
/* YHServiceCenterMainViewModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHServiceCenterMainViewModel.swift
;
sourceTree
=
"<group>"
;
};
A5C382D02B5FAAB300C5E65C
/* YHContactItemModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHContactItemModel.swift
;
sourceTree
=
"<group>"
;
};
A5C468562BFB1DAB0015E726
/* YHCommonAlertView2.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCommonAlertView2.swift
;
sourceTree
=
"<group>"
;
};
A5C468582BFB37380015E726
/* YHCommonAlertView3.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCommonAlertView3.swift
;
sourceTree
=
"<group>"
;
};
A5C5B2ED2B4F9B8800A7C5D1
/* Localizable.xcstrings */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
text.json.xcstrings
;
path
=
Localizable.xcstrings
;
sourceTree
=
"<group>"
;
};
A5D001202BAA9D99001F003C
/* YHChoiceButtonHoldView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHChoiceButtonHoldView.swift
;
sourceTree
=
"<group>"
;
};
A5D001272BABC84A001F003C
/* YHFileListHeaerView.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHFileListHeaerView.swift
;
sourceTree
=
"<group>"
;
};
...
...
@@ -1394,6 +1398,8 @@
0435FA802BA186D600024EAE
/* YHMyFileMethodTableViewCell.swift */
,
044CF8D32BB6BCF700008CE8
/* YHSignatureUploadTableViewCell.swift */
,
0435FA7E2BA178C100024EAE
/* YHCommonAlertView.swift */
,
A5C468562BFB1DAB0015E726
/* YHCommonAlertView2.swift */
,
A5C468582BFB37380015E726
/* YHCommonAlertView3.swift */
,
);
path
=
V
;
sourceTree
=
"<group>"
;
...
...
@@ -2768,6 +2774,7 @@
045EEE932B9F171A0022A143
/* YHPreviewInfoSingleLineTitleView.swift in Sources */
,
045EEF1D2B9F171A0022A143
/* YHAddressPickView.swift in Sources */
,
A58AC0A12BAC0B2900A30FA9
/* YHFileListItemView.swift in Sources */
,
A5C468572BFB1DAB0015E726
/* YHCommonAlertView2.swift in Sources */
,
045EEED12B9F171A0022A143
/* YHScorePersonInfoCell.swift in Sources */
,
044CF8D42BB6BCF700008CE8
/* YHSignatureUploadTableViewCell.swift in Sources */
,
A567E5B02BD7643D00D5D5A0
/* YHHomeWebBottomView.swift in Sources */
,
...
...
@@ -2900,6 +2907,7 @@
A5ACE9302B4564F7002C94D2
/* Algorithm.swift in Sources */
,
045EEED52B9F171A0022A143
/* YHEducationRequestViewModel.swift in Sources */
,
045EEEB62B9F171A0022A143
/* YHWorkExperienceItemView.swift in Sources */
,
A5C468592BFB37380015E726
/* YHCommonAlertView3.swift in Sources */
,
A58A8C942BA6C7C600632765
/* YHCertificateEntryModel.swift in Sources */
,
045EEEB82B9F171A0022A143
/* YHWorkExampleMessageView.swift in Sources */
,
04F4B76B2BAA7E1E00D13284
/* YHCertificateTemplateSheetView.swift in Sources */
,
...
...
@@ -3031,7 +3039,7 @@
CODE_SIGN_IDENTITY
=
"Apple Development"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone Developer"
;
CODE_SIGN_STYLE
=
Manual
;
CURRENT_PROJECT_VERSION
=
8
;
CURRENT_PROJECT_VERSION
=
9
;
DEVELOPMENT_TEAM
=
""
;
"DEVELOPMENT_TEAM[sdk=iphoneos*]"
=
RXHYW88XR7
;
ENABLE_USER_SCRIPT_SANDBOXING
=
NO
;
...
...
@@ -3237,7 +3245,7 @@
CODE_SIGN_IDENTITY
=
"Apple Development"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone Developer"
;
CODE_SIGN_STYLE
=
Manual
;
CURRENT_PROJECT_VERSION
=
8
;
CURRENT_PROJECT_VERSION
=
9
;
DEVELOPMENT_TEAM
=
""
;
"DEVELOPMENT_TEAM[sdk=iphoneos*]"
=
RXHYW88XR7
;
ENABLE_USER_SCRIPT_SANDBOXING
=
NO
;
...
...
@@ -3285,7 +3293,7 @@
CODE_SIGN_IDENTITY
=
"Apple Development"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone Developer"
;
CODE_SIGN_STYLE
=
Manual
;
CURRENT_PROJECT_VERSION
=
8
;
CURRENT_PROJECT_VERSION
=
9
;
DEVELOPMENT_TEAM
=
""
;
"DEVELOPMENT_TEAM[sdk=iphoneos*]"
=
RXHYW88XR7
;
ENABLE_USER_SCRIPT_SANDBOXING
=
NO
;
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/MySignature(我的签字)/V/YHCommonAlertView2.swift
0 → 100644
View file @
bfecfec8
//
// YHCommonAlertView2.swift
// galaxy
//
// Created by davidhuangA on 2024/5/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHCommonAlertView2
:
UIView
{
typealias
AgreeBlock
=
()
->
()
var
agreeBlock
:
AgreeBlock
?
var
cancelBlcok
:
AgreeBlock
?
var
centerView
:
UIView
!
var
titleLabel
:
UILabel
!
var
lineView
:
UIView
!
var
messageLabel
:
UILabel
!
var
agreeButton
:
UIButton
!
var
disAgressButton
:
UIButton
!
var
isFullGuestureEnabel
:
Bool
=
true
//view响应全局手势 默认响应
static
func
show
(
_
title
:
String
?
=
nil
,
_
message
:
String
?
=
nil
,
_
leftButtonString
:
String
?
=
nil
,
_
rightButtonString
:
String
?
=
nil
,
fullGuestureEnable
:
Bool
=
true
,
cancelCallBack
:
(()
->
Void
)?
=
nil
,
callBack
:
@escaping
(()
->
Void
))
{
let
view
=
YHCommonAlertView2
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
KScreenHeight
))
view
.
agreeBlock
=
callBack
view
.
cancelBlcok
=
cancelCallBack
view
.
setContent
(
title
,
message
,
leftButtonString
,
rightButtonString
)
view
.
isFullGuestureEnabel
=
fullGuestureEnable
let
window
=
UIApplication
.
shared
.
yhKeyWindow
()
window
?
.
addSubview
(
view
)
}
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
backgroundColor
=
UIColor
(
white
:
0.5
,
alpha
:
0.1
)
let
tap
=
UITapGestureRecognizer
(
target
:
self
,
action
:
#selector(
handleTap
)
)
tap
.
delegate
=
self
addGestureRecognizer
(
tap
)
setView
()
}
func
setContent
(
_
title
:
String
?
=
nil
,
_
message
:
String
?
=
nil
,
_
leftButtonString
:
String
?
=
nil
,
_
rightButtonString
:
String
?
=
nil
)
{
self
.
titleLabel
.
text
=
title
self
.
messageLabel
.
text
=
message
self
.
disAgressButton
.
setTitle
(
leftButtonString
,
for
:
.
normal
)
self
.
agreeButton
.
setTitle
(
rightButtonString
,
for
:
.
normal
)
if
title
?
.
count
==
0
||
title
==
nil
{
centerView
.
snp
.
remakeConstraints
{
make
in
make
.
center
.
equalToSuperview
()
make
.
width
.
equalTo
(
299
)
make
.
height
.
equalTo
(
164
)
}
messageLabel
.
snp
.
remakeConstraints
{
make
in
make
.
left
.
equalTo
(
22
)
make
.
right
.
equalTo
(
-
22
)
make
.
height
.
lessThanOrEqualTo
(
60
)
make
.
top
.
equalTo
(
37
)
}
lineView
.
isHidden
=
true
}
else
{
lineView
.
isHidden
=
false
centerView
.
snp
.
remakeConstraints
{
make
in
make
.
center
.
equalToSuperview
()
make
.
width
.
equalTo
(
299
)
make
.
height
.
equalTo
(
334
)
}
messageLabel
.
snp
.
remakeConstraints
{
make
in
make
.
left
.
equalTo
(
22
)
make
.
right
.
equalTo
(
-
22
)
make
.
height
.
equalTo
(
172
)
make
.
top
.
equalTo
(
lineView
.
snp
.
bottom
)
.
offset
(
21
)
}
}
}
required
init
?(
coder
:
NSCoder
)
{
fatalError
(
"init(coder:) has not been implemented"
)
}
func
setView
()
{
backgroundColor
=
UIColor
(
hex
:
0x0000
,
alpha
:
0.5
)
centerView
=
{
let
view
=
UIView
()
view
.
backgroundColor
=
.
white
view
.
layer
.
cornerRadius
=
kCornerRadius6
return
view
}()
addSubview
(
centerView
)
centerView
.
snp
.
makeConstraints
{
make
in
make
.
center
.
equalToSuperview
()
make
.
width
.
equalTo
(
299
)
make
.
height
.
equalTo
(
187
)
}
titleLabel
=
{
let
label
=
UILabel
()
label
.
textAlignment
=
.
center
label
.
textColor
=
UIColor
.
mainTextColor
label
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
17
)
label
.
numberOfLines
=
0
return
label
}()
centerView
.
addSubview
(
titleLabel
)
titleLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
22
)
make
.
right
.
equalTo
(
-
22
)
make
.
height
.
equalTo
(
20
)
make
.
top
.
equalTo
(
16
)
}
messageLabel
=
{
let
label
=
UILabel
()
label
.
textAlignment
=
.
left
label
.
textColor
=
UIColor
.
mainTextColor
label
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
16
)
label
.
numberOfLines
=
0
return
label
}()
centerView
.
addSubview
(
messageLabel
)
messageLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
22
)
make
.
right
.
equalTo
(
-
22
)
make
.
height
.
equalTo
(
42
)
make
.
top
.
equalTo
(
63
)
}
disAgressButton
=
{
let
button
=
UIButton
(
type
:
.
custom
)
button
.
backgroundColor
=
UIColor
(
hex
:
0xffffff
)
button
.
titleLabel
?
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
15
)
button
.
contentHorizontalAlignment
=
.
center
button
.
setTitle
(
"不同意"
,
for
:
.
normal
)
button
.
setTitleColor
(
UIColor
.
brandMainColor
,
for
:
.
normal
)
button
.
layer
.
cornerRadius
=
kCornerRadius3
button
.
layer
.
borderWidth
=
1
button
.
layer
.
borderColor
=
UIColor
.
brandMainColor
.
cgColor
button
.
addTarget
(
self
,
action
:
#selector(
disagree
)
,
for
:
.
touchUpInside
)
return
button
}()
centerView
.
addSubview
(
disAgressButton
)
disAgressButton
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
16
)
make
.
bottom
.
equalTo
(
-
21
)
make
.
width
.
equalTo
(
128
)
make
.
height
.
equalTo
(
45
)
}
agreeButton
=
{
let
button
=
UIButton
(
type
:
.
custom
)
button
.
backgroundColor
=
UIColor
.
brandMainColor
button
.
titleLabel
?
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
15
)
button
.
contentHorizontalAlignment
=
.
center
button
.
setTitle
(
"同意"
,
for
:
.
normal
)
button
.
setTitleColor
(
UIColor
(
hex
:
0xffffff
),
for
:
.
normal
)
button
.
layer
.
cornerRadius
=
kCornerRadius3
button
.
addTarget
(
self
,
action
:
#selector(
agree
)
,
for
:
.
touchUpInside
)
return
button
}()
centerView
.
addSubview
(
agreeButton
)
agreeButton
.
snp
.
makeConstraints
{
make
in
make
.
right
.
equalTo
(
-
16
)
make
.
bottom
.
equalTo
(
-
21
)
make
.
width
.
equalTo
(
128
)
make
.
height
.
equalTo
(
45
)
}
lineView
=
{
let
line
=
UIView
()
line
.
backgroundColor
=
UIColor
(
hex
:
0xF0F0F0
)
return
line
}()
centerView
.
addSubview
(
lineView
)
lineView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalTo
(
0
)
make
.
height
.
equalTo
(
1
)
make
.
top
.
equalTo
(
titleLabel
.
snp
.
bottom
)
.
offset
(
12
)
}
}
@objc
func
agree
()
{
if
let
block
=
self
.
agreeBlock
{
block
()
}
dismiss
()
}
@objc
private
func
handleTap
(
_
sender
:
AnyObject
?)
{
print
(
"处理点击手势"
)
if
isFullGuestureEnabel
{
dismiss
()
}
}
@objc
func
disagree
()
{
if
let
block
=
self
.
cancelBlcok
{
block
()
}
dismiss
()
}
func
dismiss
()
{
removeFromSuperview
()
}
}
extension
YHCommonAlertView2
:
UIGestureRecognizerDelegate
{
func
gestureRecognizer
(
_
gestureRecognizer
:
UIGestureRecognizer
,
shouldReceive
touch
:
UITouch
)
->
Bool
{
if
touch
.
view
==
self
{
return
true
}
return
false
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/MySignature(我的签字)/V/YHCommonAlertView3.swift
0 → 100644
View file @
bfecfec8
//
// YHCommonAlertView3.swift
// galaxy
//
// Created by davidhuangA on 2024/5/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHCommonAlertView3
:
UIView
{
typealias
AgreeBlock
=
()
->
()
var
agreeBlock
:
AgreeBlock
?
var
cancelBlcok
:
AgreeBlock
?
var
centerView
:
UIView
!
var
titleLabel
:
UILabel
!
var
lineView
:
UIView
!
var
messageLabel
:
UILabel
!
var
agreeButton
:
UIButton
!
var
disAgressButton
:
UIButton
!
var
isFullGuestureEnabel
:
Bool
=
true
//view响应全局手势 默认响应
static
func
show
(
_
title
:
String
?
=
nil
,
_
message
:
String
?
=
nil
,
_
leftButtonString
:
String
?
=
nil
,
_
rightButtonString
:
String
?
=
nil
,
fullGuestureEnable
:
Bool
=
true
,
cancelCallBack
:
(()
->
Void
)?
=
nil
,
callBack
:
@escaping
(()
->
Void
))
{
let
view
=
YHCommonAlertView3
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
KScreenHeight
))
view
.
agreeBlock
=
callBack
view
.
cancelBlcok
=
cancelCallBack
view
.
setContent
(
title
,
message
,
leftButtonString
,
rightButtonString
)
view
.
isFullGuestureEnabel
=
fullGuestureEnable
let
window
=
UIApplication
.
shared
.
yhKeyWindow
()
window
?
.
addSubview
(
view
)
}
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
backgroundColor
=
UIColor
(
white
:
0.5
,
alpha
:
0.1
)
let
tap
=
UITapGestureRecognizer
(
target
:
self
,
action
:
#selector(
handleTap
)
)
tap
.
delegate
=
self
addGestureRecognizer
(
tap
)
setView
()
}
func
setContent
(
_
title
:
String
?
=
nil
,
_
message
:
String
?
=
nil
,
_
leftButtonString
:
String
?
=
nil
,
_
rightButtonString
:
String
?
=
nil
)
{
self
.
titleLabel
.
text
=
title
self
.
messageLabel
.
text
=
message
self
.
disAgressButton
.
setTitle
(
leftButtonString
,
for
:
.
normal
)
self
.
agreeButton
.
setTitle
(
rightButtonString
,
for
:
.
normal
)
if
title
?
.
count
==
0
||
title
==
nil
{
centerView
.
snp
.
remakeConstraints
{
make
in
make
.
center
.
equalToSuperview
()
make
.
width
.
equalTo
(
299
)
make
.
height
.
equalTo
(
164
)
}
messageLabel
.
snp
.
remakeConstraints
{
make
in
make
.
left
.
equalTo
(
22
)
make
.
right
.
equalTo
(
-
22
)
make
.
height
.
lessThanOrEqualTo
(
60
)
make
.
top
.
equalTo
(
37
)
}
lineView
.
isHidden
=
true
}
else
{
lineView
.
isHidden
=
false
centerView
.
snp
.
remakeConstraints
{
make
in
make
.
center
.
equalToSuperview
()
make
.
width
.
equalTo
(
299
)
// make.height.equalTo(257 + 18)
}
messageLabel
.
snp
.
remakeConstraints
{
make
in
make
.
left
.
equalTo
(
22
)
make
.
right
.
equalTo
(
-
22
)
// make.height.equalTo(88 + 18)
make
.
top
.
equalTo
(
lineView
.
snp
.
bottom
)
.
offset
(
21
)
}
disAgressButton
.
isHidden
=
true
agreeButton
.
snp
.
remakeConstraints
{
make
in
make
.
right
.
equalTo
(
-
16
)
make
.
bottom
.
equalTo
(
-
17
)
make
.
left
.
equalTo
(
kMargin
)
make
.
height
.
equalTo
(
45
)
make
.
top
.
equalTo
(
messageLabel
.
snp
.
bottom
)
.
offset
(
28
)
}
}
}
required
init
?(
coder
:
NSCoder
)
{
fatalError
(
"init(coder:) has not been implemented"
)
}
func
setView
()
{
backgroundColor
=
UIColor
(
hex
:
0x0000
,
alpha
:
0.5
)
centerView
=
{
let
view
=
UIView
()
view
.
backgroundColor
=
.
white
view
.
layer
.
cornerRadius
=
kCornerRadius6
return
view
}()
addSubview
(
centerView
)
centerView
.
snp
.
makeConstraints
{
make
in
make
.
center
.
equalToSuperview
()
make
.
width
.
equalTo
(
299
)
make
.
height
.
equalTo
(
187
)
}
titleLabel
=
{
let
label
=
UILabel
()
label
.
textAlignment
=
.
center
label
.
textColor
=
UIColor
.
mainTextColor
label
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
17
)
label
.
numberOfLines
=
0
return
label
}()
centerView
.
addSubview
(
titleLabel
)
titleLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
22
)
make
.
right
.
equalTo
(
-
22
)
make
.
height
.
equalTo
(
20
)
make
.
top
.
equalTo
(
16
)
}
messageLabel
=
{
let
label
=
UILabel
()
label
.
textAlignment
=
.
left
label
.
textColor
=
UIColor
.
mainTextColor
label
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
16
)
label
.
numberOfLines
=
0
return
label
}()
centerView
.
addSubview
(
messageLabel
)
messageLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
22
)
make
.
right
.
equalTo
(
-
22
)
make
.
height
.
equalTo
(
42
)
make
.
top
.
equalTo
(
63
)
}
disAgressButton
=
{
let
button
=
UIButton
(
type
:
.
custom
)
button
.
backgroundColor
=
UIColor
(
hex
:
0xffffff
)
button
.
titleLabel
?
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
15
)
button
.
contentHorizontalAlignment
=
.
center
button
.
setTitle
(
"不同意"
,
for
:
.
normal
)
button
.
setTitleColor
(
UIColor
.
brandMainColor
,
for
:
.
normal
)
button
.
layer
.
cornerRadius
=
kCornerRadius3
button
.
layer
.
borderWidth
=
1
button
.
layer
.
borderColor
=
UIColor
.
brandMainColor
.
cgColor
button
.
addTarget
(
self
,
action
:
#selector(
disagree
)
,
for
:
.
touchUpInside
)
return
button
}()
centerView
.
addSubview
(
disAgressButton
)
disAgressButton
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
16
)
make
.
bottom
.
equalTo
(
-
21
)
make
.
width
.
equalTo
(
128
)
make
.
height
.
equalTo
(
45
)
}
agreeButton
=
{
let
button
=
UIButton
(
type
:
.
custom
)
button
.
backgroundColor
=
UIColor
.
brandMainColor
button
.
titleLabel
?
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
15
)
button
.
contentHorizontalAlignment
=
.
center
button
.
setTitle
(
"同意"
,
for
:
.
normal
)
button
.
setTitleColor
(
UIColor
(
hex
:
0xffffff
),
for
:
.
normal
)
button
.
layer
.
cornerRadius
=
kCornerRadius3
button
.
addTarget
(
self
,
action
:
#selector(
agree
)
,
for
:
.
touchUpInside
)
return
button
}()
centerView
.
addSubview
(
agreeButton
)
agreeButton
.
snp
.
makeConstraints
{
make
in
make
.
right
.
equalTo
(
-
16
)
make
.
bottom
.
equalTo
(
-
21
)
make
.
width
.
equalTo
(
128
)
make
.
height
.
equalTo
(
45
)
}
lineView
=
{
let
line
=
UIView
()
line
.
backgroundColor
=
UIColor
(
hex
:
0xF0F0F0
)
return
line
}()
centerView
.
addSubview
(
lineView
)
lineView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalTo
(
0
)
make
.
height
.
equalTo
(
1
)
make
.
top
.
equalTo
(
titleLabel
.
snp
.
bottom
)
.
offset
(
12
)
}
}
@objc
func
agree
()
{
if
let
block
=
self
.
agreeBlock
{
block
()
}
dismiss
()
}
@objc
private
func
handleTap
(
_
sender
:
AnyObject
?)
{
print
(
"处理点击手势"
)
if
isFullGuestureEnabel
{
dismiss
()
}
}
@objc
func
disagree
()
{
if
let
block
=
self
.
cancelBlcok
{
block
()
}
dismiss
()
}
func
dismiss
()
{
removeFromSuperview
()
}
}
extension
YHCommonAlertView3
:
UIGestureRecognizerDelegate
{
func
gestureRecognizer
(
_
gestureRecognizer
:
UIGestureRecognizer
,
shouldReceive
touch
:
UITouch
)
->
Bool
{
if
touch
.
view
==
self
{
return
true
}
return
false
}
}
galaxy/galaxy/Classes/Modules/Login(登录)/C/YHCodeSueecssViewController.swift
View file @
bfecfec8
...
...
@@ -9,7 +9,7 @@
import
UIKit
class
YHCodeSueecssViewController
:
YHBaseViewController
{
var
time
=
60
var
bgImageView
:
UIImageView
!
...
...
@@ -178,8 +178,15 @@ class YHCodeSueecssViewController: YHBaseViewController {
YHHUD
.
hide
()
guard
let
self
=
self
else
{
return
}
if
success
==
false
{
YHHUD
.
flash
(
message
:
error
?
.
errorMsg
??
""
)
self
.
smscodeView
.
textField
.
becomeFirstResponder
()
if
error
?
.
errorCode
==
YHErrorCode
.
unregisterError
.
rawValue
{
YHCommonAlertView3
.
show
(
"状态提示"
,
"您的账号已注销,暂时无法登录app
\n
\r\n
具体详情可邮件联系
\r\n
nick.gzm@galaxyoversea.com"
,
"取消"
,
"我知道了"
)
{
self
.
navigationController
?
.
popViewController
()
}
}
else
{
self
.
smscodeView
.
textField
.
becomeFirstResponder
()
YHHUD
.
flash
(
message
:
error
?
.
errorMsg
??
""
)
}
}
else
{
YHLoginManager
.
shared
.
loginSuccessActionBlock
?()
YHHUD
.
flash
(
message
:
"登录成功"
)
...
...
@@ -221,7 +228,7 @@ class YHCodeSueecssViewController: YHBaseViewController {
guard
let
self
=
self
else
{
return
}
if
success
==
true
{
// YHHUD.flash(message: "验证码已下发,请注意查收")
// YHHUD.flash(message: "验证码已下发,请注意查收")
self
.
startTime
()
}
else
{
YHHUD
.
flash
(
message
:
error
?
.
errorMsg
??
""
)
...
...
galaxy/galaxy/Classes/Modules/Login(登录)/VM/YHLoginViewModel.swift
View file @
bfecfec8
...
...
@@ -25,7 +25,7 @@ extension YHLoginViewModel {
"extend"
:
"register"
]
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
User
.
verifyCode
let
_
=
YHNetRequest
.
postRequest
(
url
:
strUrl
,
params
:
params
)
{[
weak
self
]
json
,
code
in
guard
let
self
=
self
else
{
return
}
guard
self
!=
nil
else
{
return
}
//1. json字符串 转 对象
if
json
.
code
==
200
{
...
...
@@ -108,4 +108,28 @@ extension YHLoginViewModel {
callBackBlock
(
false
,
error
)
}
}
//注销app
func
unrigisterApp
(
_
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
())
{
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
Auth
.
unregisterApi
let
_
=
YHNetRequest
.
postRequest
(
url
:
strUrl
)
{
[
weak
self
]
json
,
code
in
//1. json字符串 转 对象
guard
self
!=
nil
else
{
return
}
printLog
(
json
)
_
=
json
.
data
if
json
.
code
==
200
{
callBackBlock
(
true
,
nil
)
}
else
{
let
error
:
YHErrorModel
=
YHErrorModel
(
errorCode
:
Int32
(
json
.
code
),
errorMsg
:
json
.
msg
)
callBackBlock
(
false
,
error
)
}
}
failBlock
:
{
error
in
callBackBlock
(
false
,
error
)
}
}
}
galaxy/galaxy/Classes/Modules/Mine(我的)/C/YHMySettingViewController.swift
View file @
bfecfec8
...
...
@@ -35,6 +35,19 @@ class YHMySettingViewController: YHBaseViewController, ConstraintRelatableTarget
}()
lazy
var
registerBtn
:
UIButton
=
{
let
btn
=
UIButton
()
btn
.
setTitle
(
"注销账号"
.
local
,
for
:
.
normal
)
btn
.
titleLabel
?
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
13
)
btn
.
setTitleColor
(
UIColor
(
hexString
:
"#121A26"
,
transparency
:
0.3
),
for
:
.
normal
)
btn
.
backgroundColor
=
.
clear
btn
.
addTarget
(
self
,
action
:
#selector(
clickRegBtn
)
,
for
:
.
touchUpInside
)
return
btn
}()
lazy
var
versionLabel
:
UILabel
=
{
let
btn
=
UILabel
()
btn
.
text
=
"版本号:V0.1.8测试服"
...
...
@@ -87,6 +100,7 @@ class YHMySettingViewController: YHBaseViewController, ConstraintRelatableTarget
view
.
addSubview
(
tableView
)
view
.
addSubview
(
logoutBtn
)
view
.
addSubview
(
versionLabel
)
view
.
addSubview
(
registerBtn
)
tableView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalToSuperview
()
.
offset
(
k_Height_NavigationtBarAndStatuBar
)
...
...
@@ -105,10 +119,15 @@ class YHMySettingViewController: YHBaseViewController, ConstraintRelatableTarget
make
.
left
.
equalToSuperview
()
.
offset
(
20
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
20
)
make
.
height
.
equalTo
(
48.0
)
make
.
bottom
.
equalTo
Superview
()
.
offset
(
-
30
)
make
.
bottom
.
equalTo
(
registerBtn
.
snp
.
top
)
.
offset
(
-
14
)
}
registerBtn
.
snp
.
makeConstraints
{
make
in
make
.
centerX
.
equalToSuperview
()
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
54
)
make
.
height
.
equalTo
(
18
)
make
.
width
.
equalTo
(
52
)
}
#if DEBUG
let
version
=
"版本号:V"
+
UIDevice
.
appVersion
()
+
"_"
+
UIDevice
.
appBuild
()
+
"开发服"
...
...
@@ -150,6 +169,41 @@ class YHMySettingViewController: YHBaseViewController, ConstraintRelatableTarget
}
}
//点击注销按钮
@objc
func
clickRegBtn
()
{
YHCommonAlertView2
.
show
(
"风险提示"
,
"您正在进行账号注销操作,一旦完成注销,您将无法再登录
\"
银河港生活
\"
APP,并因此无法在APP中继续现有的服务流程。
\n
\n
真心希望您能留下来,继续享受银河港生活为您提供的精彩服务。"
,
"取消"
,
"坚持注销"
)
{
self
.
unRegisterAPPOp
()
}
}
private
func
unRegisterAPPOp
()
{
YHHUD
.
show
(
.
progress
(
message
:
"APP注销中..."
))
self
.
viewModel
.
unrigisterApp
()
{
[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
YHHUD
.
hide
()
if
success
{
DispatchQueue
.
main
.
async
{
YHHUD
.
flash
(
message
:
"注销成功"
)
YHLoginManager
.
shared
.
clearUserInfo
()
NotificationCenter
.
default
.
post
(
name
:
YhConstant
.
YhNotification
.
didLogoutSuccessNotifiction
,
object
:
nil
)
// 发送清空所有未读消息通知
NotificationCenter
.
default
.
post
(
name
:
YhConstant
.
YhNotification
.
didMarkAllMessagesReadedNotifiction
,
object
:
nil
)
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
}
return
}
var
msg
=
"注销失败,请重试"
if
let
error
=
error
,
!
error
.
errorMsg
.
isEmpty
{
msg
=
error
.
errorMsg
}
YHHUD
.
flash
(
message
:
msg
)
}
}
}
extension
YHMySettingViewController
:
UITableViewDelegate
,
UITableViewDataSource
{
...
...
galaxy/galaxy/Classes/Tools/NetWork/YHAllApiName.swift
View file @
bfecfec8
...
...
@@ -163,6 +163,8 @@ class YHAllApiName {
struct
Auth
{
static
let
login
=
"infoflow/auth/login"
static
let
logout
=
"infoflow/auth/logout"
//注销app
static
let
unregisterApi
=
"infoflow/auth/cancellation"
}
//获取验证
...
...
galaxy/galaxy/Classes/Tools/NetWork/YHNetRequest.swift
View file @
bfecfec8
...
...
@@ -27,6 +27,7 @@ public enum YHErrorCode : Int32 {
case
dictParseError
=
-
10001
case
tokenInvalidError
=
20001
// 登录token失效
case
forceUpdate
=
10025
// 强制更新版本
case
unregisterError
=
20007
//手机号已注销
public
func
description
()
->
String
{
switch
self
{
...
...
@@ -42,6 +43,8 @@ public enum YHErrorCode : Int32 {
return
"登录token失效"
case
.
forceUpdate
:
return
"强制更新版本"
case
.
unregisterError
:
return
"手机号已注销"
default
:
return
"未知"
}
...
...
@@ -102,8 +105,8 @@ class YHNetRequest: NSObject {
if
!
YHLoginManager
.
shared
.
deviceTokenModel
.
registerId
.
isEmpty
{
requestHeader
.
add
(
name
:
"device-id"
,
value
:
YHLoginManager
.
shared
.
deviceTokenModel
.
registerId
)
}
// requestHeader.add(name: "token", value: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MTI0NjA1NzQsImkiOjk4OTcwNDI5NjA3NzI0OSwidSI6IumTtuays-mbhuWboiIsInIiOiJzdXBlcl9hcHAifQ.jyBpXSii6nlRIITdOya3GQa5eb5G42Jh9nj39Cncwl8")
// requestHeader.add(name: "token", value: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MTI0NjA1NzQsImkiOjk4OTcwNDI5NjA3NzI0OSwidSI6IumTtuays-mbhuWboiIsInIiOiJzdXBlcl9hcHAifQ.jyBpXSii6nlRIITdOya3GQa5eb5G42Jh9nj39Cncwl8")
headers
=
requestHeader
}
...
...
@@ -264,7 +267,7 @@ class YHNetRequest: NSObject {
func
mimeType
(
for
path
:
String
)
->
String
?
{
let
url
=
URL
(
fileURLWithPath
:
path
)
let
pathExtension
=
url
.
pathExtension
if
let
uti
=
UTTypeCreatePreferredIdentifierForTag
(
kUTTagClassFilenameExtension
,
pathExtension
as
CFString
,
nil
)?
.
takeRetainedValue
()
{
if
let
mimeType
=
UTTypeCopyPreferredTagWithClass
(
uti
,
kUTTagClassMIMEType
)?
.
takeRetainedValue
()
{
return
mimeType
as
String
...
...
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