Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
GeliBusinessPlatform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ljy
GeliBusinessPlatform
Commits
d5d6a059
Commit
d5d6a059
authored
Jun 01, 2020
by
ljh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
手机登录完成
parent
428f8454
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
66 additions
and
4 deletions
+66
-4
GeliBusinessPlatform.xcworkspace/xcuserdata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
...ata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform/Interface/Interface_Z.plist
GeliBusinessPlatform/Interface/Interface_Z.plist
+2
-0
GeliBusinessPlatform/Model/Interface.swift
GeliBusinessPlatform/Model/Interface.swift
+10
-0
GeliBusinessPlatform/ViewController/登录/LoginViewController.swift
...inessPlatform/ViewController/登录/LoginViewController.swift
+52
-3
GeliBusinessPlatform/ViewController/登录/LoginViewController.xib
...usinessPlatform/ViewController/登录/LoginViewController.xib
+2
-1
No files found.
GeliBusinessPlatform.xcworkspace/xcuserdata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
View file @
d5d6a059
No preview for this file type
GeliBusinessPlatform/Interface/Interface_Z.plist
View file @
d5d6a059
...
@@ -124,5 +124,7 @@
...
@@ -124,5 +124,7 @@
<string>
Warehouse/IoGoodsDetail
</string>
<string>
Warehouse/IoGoodsDetail
</string>
<key>
商品出库审核详情(未审核状态)
</key>
<key>
商品出库审核详情(未审核状态)
</key>
<string>
Warehouse/OutGoodsDetail
</string>
<string>
Warehouse/OutGoodsDetail
</string>
<key>
手机号登录
</key>
<string>
Passport/mobileLogin
</string>
</dict>
</dict>
</plist>
</plist>
GeliBusinessPlatform/Model/Interface.swift
View file @
d5d6a059
...
@@ -160,3 +160,13 @@ func saveFile(image: UIImage,_ params:[String:Any],success:@escaping (_ res:Any)
...
@@ -160,3 +160,13 @@ func saveFile(image: UIImage,_ params:[String:Any],success:@escaping (_ res:Any)
failture
(
error
)
failture
(
error
)
}
}
}
}
//MARK:--手机号登
//params-key(mobile(手机号),auth_code(登录验证码(必须先发送验证码) ))
func
mobileLogin
(
_
params
:[
String
:
Any
],
success
:
@escaping
(
_
res
:
Any
)
->
(),
failture
:
@escaping
(
_
error
:
Error
)
->
())
{
NetworkRequest
.
sharedInstance
.
postRequest
(
"登录"
,
params
,
{
(
rep
:
DataResponse
<
LoginModel
>
)
in
},
success
:
{
(
data
)
in
success
(
data
)
})
{
(
error
)
in
failture
(
error
)
}
}
GeliBusinessPlatform/ViewController/登录/LoginViewController.swift
View file @
d5d6a059
...
@@ -114,8 +114,37 @@ class LoginViewController: BaseViewController, CodeViewDelegate,GeliAlertViewDel
...
@@ -114,8 +114,37 @@ class LoginViewController: BaseViewController, CodeViewDelegate,GeliAlertViewDel
}
}
//MARK: - 手机登录,获取验证码方法
//MARK: - 手机登录,获取验证码方法
@IBAction
func
getLoginCodeAction
(
_
sender
:
Any
)
{
@IBOutlet
weak
var
phoneCodeBtn
:
UIButton
!
@IBAction
func
getLoginCodeAction
(
_
sender
:
UIButton
)
{
print
(
"get phone login Code"
)
print
(
"get phone login Code"
)
if
phoneLogInputTF
.
text
?
.
count
==
0
{
HUD
.
flash
(
.
label
(
"请填写手机号码"
),
delay
:
1.2
)
return
}
sendSmsCaptcha
([
"phone"
:
phoneLogInputTF
.
text
as
Any
,
"type"
:
"3"
],
success
:
{
(
data
)
in
let
dataM
=
data
as!
UpDataModel
if
dataM
.
code
==
1
{
sender
.
isUserInteractionEnabled
=
false
sender
.
setTitle
(
"60s"
,
for
:
.
normal
);
Timer
.
scheduledTimer
(
timeInterval
:
1
,
target
:
self
,
selector
:
#selector(
self.timeCounting
)
,
userInfo
:
nil
,
repeats
:
true
);
}
})
{
(
error
)
in
}
}
var
timeCount
:
Int
=
60
@objc
func
timeCounting
(
sender
:
Timer
){
timeCount
-=
1
phoneCodeBtn
.
setTitle
(
"
\(
timeCount
)
"
+
"s"
,
for
:
.
normal
)
if
timeCount
==
0
{
phoneCodeBtn
.
setTitle
(
"获取验证码"
,
for
:
.
normal
)
phoneCodeBtn
.
isUserInteractionEnabled
=
true
timeCount
=
60
sender
.
invalidate
()
}
}
}
//MARK: -跳转忘记密码,登录
//MARK: -跳转忘记密码,登录
@IBAction
func
forgetPasswordAction
(
_
sender
:
Any
)
{
@IBAction
func
forgetPasswordAction
(
_
sender
:
Any
)
{
...
@@ -184,9 +213,29 @@ class LoginViewController: BaseViewController, CodeViewDelegate,GeliAlertViewDel
...
@@ -184,9 +213,29 @@ class LoginViewController: BaseViewController, CodeViewDelegate,GeliAlertViewDel
}
else
{
}
else
{
//MARK:- 手机验证码登录
//MARK:- 手机验证码登录
if
phoneLogInputTF
.
text
?
.
count
==
0
{
HUD
.
flash
(
.
label
(
"请填写手机号码"
),
delay
:
1.2
)
return
}
if
phoneLogCodeTF
.
text
?
.
count
==
0
{
HUD
.
flash
(
.
label
(
"请填写验证码"
),
delay
:
1.2
)
return
}
loginBtn
.
isLoading
=
true
mobileLogin
([
"mobile"
:
phoneLogInputTF
.
text
as
Any
,
"auth_code"
:
phoneLogCodeTF
.
text
as
Any
],
success
:
{
(
data
)
in
let
dataM
=
data
as!
LoginModel
UserDefaults
.
standard
.
set
(
dataM
.
data
?
.
user_token
,
forKey
:
"user_token"
)
UserDefaults
.
standard
.
synchronize
()
self
.
loginBtn
.
isLoading
=
false
self
.
delegate
?
.
successLogin
()
// JPUSHService.setAlias(self.phoneTF.text, completion: { (resCode, alias, num) in
//
// }, seq: 1433223)
})
{
(
error
)
in
self
.
loginBtn
.
isLoading
=
false
}
}
}
...
...
GeliBusinessPlatform/ViewController/登录/LoginViewController.xib
View file @
d5d6a059
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
<outlet
property=
"loginBtn"
destination=
"I08-S6-beg"
id=
"bDZ-w8-CrS"
/>
<outlet
property=
"loginBtn"
destination=
"I08-S6-beg"
id=
"bDZ-w8-CrS"
/>
<outlet
property=
"passLoginBg"
destination=
"iYx-nR-RL7"
id=
"EoY-gn-H5i"
/>
<outlet
property=
"passLoginBg"
destination=
"iYx-nR-RL7"
id=
"EoY-gn-H5i"
/>
<outlet
property=
"passTF"
destination=
"hBD-M4-Ne6"
id=
"Ej7-K3-hF0"
/>
<outlet
property=
"passTF"
destination=
"hBD-M4-Ne6"
id=
"Ej7-K3-hF0"
/>
<outlet
property=
"phoneCodeBtn"
destination=
"dAd-O1-Cr9"
id=
"mtO-nC-R40"
/>
<outlet
property=
"phoneLogCodeTF"
destination=
"AYx-AF-7cc"
id=
"Zyy-sv-lbI"
/>
<outlet
property=
"phoneLogCodeTF"
destination=
"AYx-AF-7cc"
id=
"Zyy-sv-lbI"
/>
<outlet
property=
"phoneLogInputTF"
destination=
"lQM-jb-VSM"
id=
"HZz-Gp-xzs"
/>
<outlet
property=
"phoneLogInputTF"
destination=
"lQM-jb-VSM"
id=
"HZz-Gp-xzs"
/>
<outlet
property=
"phoneLoginBG"
destination=
"Wdn-1F-VeB"
id=
"AkQ-Hp-pVQ"
/>
<outlet
property=
"phoneLoginBG"
destination=
"Wdn-1F-VeB"
id=
"AkQ-Hp-pVQ"
/>
...
@@ -206,7 +207,7 @@
...
@@ -206,7 +207,7 @@
<color
key=
"titleColor"
name=
"蓝色字体颜色"
/>
<color
key=
"titleColor"
name=
"蓝色字体颜色"
/>
</state>
</state>
<connections>
<connections>
<action
selector=
"getLoginCodeAction:"
destination=
"-1"
eventType=
"touchUpInside"
id=
"
QFf-Hw-aQZ
"
/>
<action
selector=
"getLoginCodeAction:"
destination=
"-1"
eventType=
"touchUpInside"
id=
"
KjG-WO-8ZL
"
/>
</connections>
</connections>
</button>
</button>
<textField
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"left"
contentVerticalAlignment=
"center"
placeholder=
"请输入您的手机号"
textAlignment=
"natural"
minimumFontSize=
"17"
clearButtonMode=
"whileEditing"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"lQM-jb-VSM"
>
<textField
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"left"
contentVerticalAlignment=
"center"
placeholder=
"请输入您的手机号"
textAlignment=
"natural"
minimumFontSize=
"17"
clearButtonMode=
"whileEditing"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"lQM-jb-VSM"
>
...
...
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