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
4006bfa8
Commit
4006bfa8
authored
Apr 25, 2020
by
刘俊宏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善登录和退出登录逻辑
parent
13f15bec
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
286 additions
and
33 deletions
+286
-33
GeliBusinessPlatform.xcodeproj/project.pbxproj
GeliBusinessPlatform.xcodeproj/project.pbxproj
+12
-0
GeliBusinessPlatform.xcworkspace/xcuserdata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
...ata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform.xcworkspace/xcuserdata/liujunhong.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
...ujunhong.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
+12
-0
GeliBusinessPlatform/Assets.xcassets/tabbar_icon/Contents.json
...usinessPlatform/Assets.xcassets/tabbar_icon/Contents.json
+6
-0
GeliBusinessPlatform/Assets.xcassets/tabbar_icon/Transparent.imageset/Contents.json
...s.xcassets/tabbar_icon/Transparent.imageset/Contents.json
+21
-0
GeliBusinessPlatform/Assets.xcassets/tabbar_icon/Transparent.imageset/Transparent@2x.png
...ssets/tabbar_icon/Transparent.imageset/Transparent@2x.png
+0
-0
GeliBusinessPlatform/Assets.xcassets/tabbar_icon/background_dark.imageset/Contents.json
...assets/tabbar_icon/background_dark.imageset/Contents.json
+21
-0
GeliBusinessPlatform/Assets.xcassets/tabbar_icon/background_dark.imageset/background_dark@2x.png
...bbar_icon/background_dark.imageset/background_dark@2x.png
+0
-0
GeliBusinessPlatform/Define/NetworkRequest.swift
GeliBusinessPlatform/Define/NetworkRequest.swift
+4
-4
GeliBusinessPlatform/Other/HUD/PKHUD/PKHUDTextView.swift
GeliBusinessPlatform/Other/HUD/PKHUD/PKHUDTextView.swift
+1
-1
GeliBusinessPlatform/Other/HUD/PKHUD/PKHUDWideBaseView.swift
GeliBusinessPlatform/Other/HUD/PKHUD/PKHUDWideBaseView.swift
+1
-1
GeliBusinessPlatform/Other/TabBarVc/TabBarContentClassView.swift
...inessPlatform/Other/TabBarVc/TabBarContentClassView.swift
+82
-0
GeliBusinessPlatform/SceneDelegate.swift
GeliBusinessPlatform/SceneDelegate.swift
+97
-21
GeliBusinessPlatform/ViewController/商品管理/GoodsManageListVC.swift
...inessPlatform/ViewController/商品管理/GoodsManageListVC.swift
+7
-1
GeliBusinessPlatform/ViewController/登录/LoginViewController.swift
...inessPlatform/ViewController/登录/LoginViewController.swift
+22
-5
No files found.
GeliBusinessPlatform.xcodeproj/project.pbxproj
View file @
4006bfa8
...
@@ -151,6 +151,7 @@
...
@@ -151,6 +151,7 @@
F933F6CD2452C68B00189561
/* PKHUDProgressView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F933F6BC2452C68B00189561
/* PKHUDProgressView.swift */
;
};
F933F6CD2452C68B00189561
/* PKHUDProgressView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F933F6BC2452C68B00189561
/* PKHUDProgressView.swift */
;
};
F933F6CE2452C68B00189561
/* PKHUDSquareBaseView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F933F6BD2452C68B00189561
/* PKHUDSquareBaseView.swift */
;
};
F933F6CE2452C68B00189561
/* PKHUDSquareBaseView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F933F6BD2452C68B00189561
/* PKHUDSquareBaseView.swift */
;
};
F933F6CF2452C68B00189561
/* PKHUDErrorView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F933F6BE2452C68B00189561
/* PKHUDErrorView.swift */
;
};
F933F6CF2452C68B00189561
/* PKHUDErrorView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F933F6BE2452C68B00189561
/* PKHUDErrorView.swift */
;
};
F933F6D22452DAE100189561
/* TabBarContentClassView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F933F6D12452DAE000189561
/* TabBarContentClassView.swift */
;
};
F950FDA32451438A00C40530
/* AdminInfoModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F950FDA22451438A00C40530
/* AdminInfoModel.swift */
;
};
F950FDA32451438A00C40530
/* AdminInfoModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F950FDA22451438A00C40530
/* AdminInfoModel.swift */
;
};
F950FDA52451453A00C40530
/* ShopInfoModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F950FDA42451453A00C40530
/* ShopInfoModel.swift */
;
};
F950FDA52451453A00C40530
/* ShopInfoModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F950FDA42451453A00C40530
/* ShopInfoModel.swift */
;
};
F950FDA72451494500C40530
/* GeliPayInfoModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F950FDA62451494500C40530
/* GeliPayInfoModel.swift */
;
};
F950FDA72451494500C40530
/* GeliPayInfoModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F950FDA62451494500C40530
/* GeliPayInfoModel.swift */
;
};
...
@@ -374,6 +375,7 @@
...
@@ -374,6 +375,7 @@
F933F6BD2452C68B00189561
/* PKHUDSquareBaseView.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
PKHUDSquareBaseView.swift
;
sourceTree
=
"<group>"
;
};
F933F6BD2452C68B00189561
/* PKHUDSquareBaseView.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
PKHUDSquareBaseView.swift
;
sourceTree
=
"<group>"
;
};
F933F6BE2452C68B00189561
/* PKHUDErrorView.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
PKHUDErrorView.swift
;
sourceTree
=
"<group>"
;
};
F933F6BE2452C68B00189561
/* PKHUDErrorView.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
PKHUDErrorView.swift
;
sourceTree
=
"<group>"
;
};
F933F6BF2452C68B00189561
/* PKHUD.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
PKHUD.h
;
sourceTree
=
"<group>"
;
};
F933F6BF2452C68B00189561
/* PKHUD.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
PKHUD.h
;
sourceTree
=
"<group>"
;
};
F933F6D12452DAE000189561
/* TabBarContentClassView.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
TabBarContentClassView.swift
;
sourceTree
=
"<group>"
;
};
F950FDA22451438A00C40530
/* AdminInfoModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
AdminInfoModel.swift
;
sourceTree
=
"<group>"
;
};
F950FDA22451438A00C40530
/* AdminInfoModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
AdminInfoModel.swift
;
sourceTree
=
"<group>"
;
};
F950FDA42451453A00C40530
/* ShopInfoModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ShopInfoModel.swift
;
sourceTree
=
"<group>"
;
};
F950FDA42451453A00C40530
/* ShopInfoModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ShopInfoModel.swift
;
sourceTree
=
"<group>"
;
};
F950FDA62451494500C40530
/* GeliPayInfoModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
GeliPayInfoModel.swift
;
sourceTree
=
"<group>"
;
};
F950FDA62451494500C40530
/* GeliPayInfoModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
GeliPayInfoModel.swift
;
sourceTree
=
"<group>"
;
};
...
@@ -655,6 +657,7 @@
...
@@ -655,6 +657,7 @@
E088CC882446FFA1000DAA8A
/* Other */
=
{
E088CC882446FFA1000DAA8A
/* Other */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
F933F6D02452DAC300189561
/* TabBarVc */
,
F933F6AD2452C65C00189561
/* HUD */
,
F933F6AD2452C65C00189561
/* HUD */
,
F950FDB524518B3300C40530
/* 日历 */
,
F950FDB524518B3300C40530
/* 日历 */
,
E0D197A72448430E002B080C
/* 蓝牙 */
,
E0D197A72448430E002B080C
/* 蓝牙 */
,
...
@@ -1001,6 +1004,14 @@
...
@@ -1001,6 +1004,14 @@
path
=
PKHUD
;
path
=
PKHUD
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
};
};
F933F6D02452DAC300189561
/* TabBarVc */
=
{
isa
=
PBXGroup
;
children
=
(
F933F6D12452DAE000189561
/* TabBarContentClassView.swift */
,
);
path
=
TabBarVc
;
sourceTree
=
"<group>"
;
};
F950FDAF245171E000C40530
/* TimeSelectView */
=
{
F950FDAF245171E000C40530
/* TimeSelectView */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
...
@@ -1367,6 +1378,7 @@
...
@@ -1367,6 +1378,7 @@
files
=
(
files
=
(
F950FDE624518B9500C40530
/* FSCalendarAppearance.m in Sources */
,
F950FDE624518B9500C40530
/* FSCalendarAppearance.m in Sources */
,
F9023F6D2449A9B100DD5A63
/* TitleAndTFCell.swift in Sources */
,
F9023F6D2449A9B100DD5A63
/* TitleAndTFCell.swift in Sources */
,
F933F6D22452DAE100189561
/* TabBarContentClassView.swift in Sources */
,
F933F6C82452C68B00189561
/* PKHUDTextView.swift in Sources */
,
F933F6C82452C68B00189561
/* PKHUDTextView.swift in Sources */
,
E0B6036E244D376900A56B38
/* KuWeiCell.swift in Sources */
,
E0B6036E244D376900A56B38
/* KuWeiCell.swift in Sources */
,
E0D197BA2448431C002B080C
/* BabyDefine.m in Sources */
,
E0D197BA2448431C002B080C
/* BabyDefine.m in Sources */
,
...
...
GeliBusinessPlatform.xcworkspace/xcuserdata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
View file @
4006bfa8
No preview for this file type
GeliBusinessPlatform.xcworkspace/xcuserdata/liujunhong.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
View file @
4006bfa8
...
@@ -13,5 +13,17 @@
...
@@ -13,5 +13,17 @@
continueAfterRunningActions =
"No"
>
continueAfterRunningActions =
"No"
>
</BreakpointContent>
</BreakpointContent>
</BreakpointProxy>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID =
"Xcode.Breakpoint.ExceptionBreakpoint"
>
<BreakpointContent
uuid =
"DA0714E8-DD5C-48E8-93AF-CB4E86B966F9"
shouldBeEnabled =
"Yes"
ignoreCount =
"0"
continueAfterRunningActions =
"No"
breakpointStackSelectionBehavior =
"1"
scope =
"1"
stopOnStyle =
"0"
>
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Breakpoints>
</Bucket>
</Bucket>
GeliBusinessPlatform/Assets.xcassets/tabbar_icon/Contents.json
0 → 100644
View file @
4006bfa8
{
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
GeliBusinessPlatform/Assets.xcassets/tabbar_icon/Transparent.imageset/Contents.json
0 → 100644
View file @
4006bfa8
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"Transparent@2x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
GeliBusinessPlatform/Assets.xcassets/tabbar_icon/Transparent.imageset/Transparent@2x.png
0 → 100644
View file @
4006bfa8
1.14 KB
GeliBusinessPlatform/Assets.xcassets/tabbar_icon/background_dark.imageset/Contents.json
0 → 100644
View file @
4006bfa8
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"background_dark@2x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
GeliBusinessPlatform/Assets.xcassets/tabbar_icon/background_dark.imageset/background_dark@2x.png
0 → 100644
View file @
4006bfa8
3.69 KB
GeliBusinessPlatform/Define/NetworkRequest.swift
View file @
4006bfa8
...
@@ -120,18 +120,18 @@ extension NetworkRequest {
...
@@ -120,18 +120,18 @@ extension NetworkRequest {
success
(
Mapper
<
T
>
()
.
map
(
JSONObject
:
value
))
success
(
Mapper
<
T
>
()
.
map
(
JSONObject
:
value
))
}
else
if
json
[
"code"
]
.
intValue
==
3
{
}
else
if
json
[
"code"
]
.
intValue
==
3
{
//业务逻辑运行异常,一般作用于验证失败、参数异常(缺失)等异常情况返回
//业务逻辑运行异常,一般作用于验证失败、参数异常(缺失)等异常情况返回
HUD
.
flash
(
.
label
(
json
[
"message"
]
.
stringValue
),
delay
:
2.0
)
HUD
.
flash
(
.
label
(
json
[
"message"
]
.
stringValue
),
delay
:
1.5
)
failture
(
DogError
.
DataInvalidError
)
failture
(
DogError
.
DataInvalidError
)
}
else
if
json
[
"code"
]
.
intValue
==
10
{
}
else
if
json
[
"code"
]
.
intValue
==
10
{
NotificationCenter
.
default
.
post
(
name
:
Notification
.
Name
(
rawValue
:
"logout"
),
object
:
nil
)
NotificationCenter
.
default
.
post
(
name
:
Notification
.
Name
(
rawValue
:
"logout"
),
object
:
nil
)
HUD
.
flash
(
.
label
(
json
[
"message"
]
.
stringValue
),
delay
:
2.0
)
HUD
.
flash
(
.
label
(
json
[
"message"
]
.
stringValue
),
delay
:
1.5
)
failture
(
DogError
.
DataInvalidError
)
failture
(
DogError
.
DataInvalidError
)
}
else
if
json
[
"code"
]
.
intValue
==
11
{
}
else
if
json
[
"code"
]
.
intValue
==
11
{
HUD
.
flash
(
.
label
(
json
[
"message"
]
.
stringValue
),
delay
:
2.0
)
HUD
.
flash
(
.
label
(
json
[
"message"
]
.
stringValue
),
delay
:
1.5
)
failture
(
DogError
.
DataInvalidError
)
failture
(
DogError
.
DataInvalidError
)
}
else
{
}
else
{
HUD
.
flash
(
.
label
(
json
[
"message"
]
.
stringValue
),
delay
:
2.0
)
HUD
.
flash
(
.
label
(
json
[
"message"
]
.
stringValue
),
delay
:
1.5
)
failture
(
DogError
.
DataInvalidError
)
failture
(
DogError
.
DataInvalidError
)
}
}
case
.
failure
(
let
error
):
case
.
failure
(
let
error
):
...
...
GeliBusinessPlatform/Other/HUD/PKHUD/PKHUDTextView.swift
View file @
4006bfa8
...
@@ -37,7 +37,7 @@ open class PKHUDTextView: PKHUDWideBaseView {
...
@@ -37,7 +37,7 @@ open class PKHUDTextView: PKHUDWideBaseView {
public
let
titleLabel
:
UILabel
=
{
public
let
titleLabel
:
UILabel
=
{
let
label
=
UILabel
()
let
label
=
UILabel
()
label
.
textAlignment
=
.
center
label
.
textAlignment
=
.
center
label
.
font
=
UIFont
.
systemFont
(
ofSize
:
1
5
.0
)
label
.
font
=
UIFont
.
systemFont
(
ofSize
:
1
3
.0
)
label
.
textColor
=
UIColor
.
white
label
.
textColor
=
UIColor
.
white
label
.
adjustsFontSizeToFitWidth
=
true
label
.
adjustsFontSizeToFitWidth
=
true
label
.
numberOfLines
=
0
label
.
numberOfLines
=
0
...
...
GeliBusinessPlatform/Other/HUD/PKHUD/PKHUDWideBaseView.swift
View file @
4006bfa8
...
@@ -12,7 +12,7 @@ import UIKit
...
@@ -12,7 +12,7 @@ import UIKit
/// PKHUDWideBaseView provides a wide base view, which you can subclass and add additional views to.
/// PKHUDWideBaseView provides a wide base view, which you can subclass and add additional views to.
open
class
PKHUDWideBaseView
:
UIView
{
open
class
PKHUDWideBaseView
:
UIView
{
static
let
defaultWideBaseViewFrame
=
CGRect
(
origin
:
CGPoint
.
zero
,
size
:
CGSize
(
width
:
1
60
,
height
:
6
0
))
static
let
defaultWideBaseViewFrame
=
CGRect
(
origin
:
CGPoint
.
zero
,
size
:
CGSize
(
width
:
1
50
,
height
:
5
0
))
public
init
()
{
public
init
()
{
super
.
init
(
frame
:
PKHUDWideBaseView
.
defaultWideBaseViewFrame
)
super
.
init
(
frame
:
PKHUDWideBaseView
.
defaultWideBaseViewFrame
)
...
...
GeliBusinessPlatform/Other/TabBarVc/TabBarContentClassView.swift
0 → 100644
View file @
4006bfa8
//
// TabBarContentClassView.swift
// GeliBusinessPlatform
//
// Created by 刘俊宏 on 2020/4/15.
// Copyright © 2020 junye lu. All rights reserved.
//
import
UIKit
import
ESTabBarController_swift
//MARK:--tab
class
ExampleBouncesContentView
:
ExampleBasicContentView
{
public
var
duration
=
0.3
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
}
public
required
init
?(
coder
aDecoder
:
NSCoder
)
{
fatalError
(
"init(coder:) has not been implemented"
)
}
override
func
selectAnimation
(
animated
:
Bool
,
completion
:
(()
->
())?)
{
self
.
bounceAnimation
()
completion
?()
}
override
func
reselectAnimation
(
animated
:
Bool
,
completion
:
(()
->
())?)
{
self
.
bounceAnimation
()
completion
?()
}
func
bounceAnimation
()
{
let
impliesAnimation
=
CAKeyframeAnimation
(
keyPath
:
"transform.scale"
)
impliesAnimation
.
values
=
[
1.0
,
1.4
,
0.9
,
1.15
,
0.95
,
1.02
,
1.0
]
impliesAnimation
.
duration
=
duration
*
2
impliesAnimation
.
calculationMode
=
CAAnimationCalculationMode
.
cubic
imageView
.
layer
.
add
(
impliesAnimation
,
forKey
:
nil
)
}
override
func
badgeChangedAnimation
(
animated
:
Bool
,
completion
:
(()
->
())?)
{
super
.
badgeChangedAnimation
(
animated
:
animated
,
completion
:
nil
)
notificationAnimation
()
}
func
notificationAnimation
()
{
let
impliesAnimation
=
CAKeyframeAnimation
(
keyPath
:
"transform.scale"
)
impliesAnimation
.
values
=
[
1.0
,
1.4
,
0.9
,
1.15
,
0.95
,
1.02
,
1.0
]
impliesAnimation
.
duration
=
duration
*
2
impliesAnimation
.
calculationMode
=
CAAnimationCalculationMode
.
cubic
self
.
badgeView
.
layer
.
add
(
impliesAnimation
,
forKey
:
nil
)
}
}
class
ExampleBasicContentView
:
ESTabBarItemContentView
{
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
textColor
=
UIColor
.
init
(
named
:
"灰色字体颜色"
)
!
highlightTextColor
=
UIColor
.
init
(
named
:
"蓝色字体颜色"
)
!
}
public
required
init
?(
coder
aDecoder
:
NSCoder
)
{
fatalError
(
"init(coder:) has not been implemented"
)
}
}
//MARK:--颜色转换为图片
func
imageWithColor
(
_
color
:
UIColor
)
->
UIImage
{
let
rect
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
375
,
height
:
50
)
UIGraphicsBeginImageContext
(
rect
.
size
)
let
context
=
UIGraphicsGetCurrentContext
()
context
?
.
setFillColor
(
color
.
cgColor
)
context
?
.
fill
(
rect
)
let
image
=
UIGraphicsGetImageFromCurrentImageContext
()
UIGraphicsEndImageContext
()
return
image
!
}
GeliBusinessPlatform/SceneDelegate.swift
View file @
4006bfa8
...
@@ -8,28 +8,104 @@
...
@@ -8,28 +8,104 @@
import
UIKit
import
UIKit
import
SwiftUI
import
SwiftUI
import
ESTabBarController_swift
class
SceneDelegate
:
UIResponder
,
UIWindowSceneDelegate
{
class
SceneDelegate
:
UIResponder
,
UIWindowSceneDelegate
,
UITabBarControllerDelegate
,
loginDelegate
{
var
window
:
UIWindow
?
var
window
:
UIWindow
?
var
sceneC
:
UIScene
?
func
scene
(
_
scene
:
UIScene
,
willConnectTo
session
:
UISceneSession
,
options
connectionOptions
:
UIScene
.
ConnectionOptions
)
{
func
scene
(
_
scene
:
UIScene
,
willConnectTo
session
:
UISceneSession
,
options
connectionOptions
:
UIScene
.
ConnectionOptions
)
{
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
// Create the SwiftUI view that provides the window contents.
sceneC
=
scene
let
contentView
=
JiPaiFangShiViewController
()
if
UserToken
==
nil
{
addLoginVc
(
isAgain
:
false
)
}
else
{
addTabBarVcs
(
isAgain
:
false
)
}
// Use a UIHostingController as window root view controller.
}
if
let
windowScene
=
scene
as?
UIWindowScene
{
//MARK:--成功登录并反馈
func
successLogin
()
{
addTabBarVcs
(
isAgain
:
true
)
}
//MARK:--退出登录并反馈
@objc
func
popLogout
()
{
addLoginVc
(
isAgain
:
true
)
}
//MARK:--loginVC
func
addLoginVc
(
isAgain
:
Bool
){
let
vc
=
LoginViewController
()
vc
.
delegate
=
self
let
contentView
=
vc
if
let
windowScene
=
sceneC
as?
UIWindowScene
{
if
isAgain
{
let
transtition
=
CATransition
()
transtition
.
duration
=
0.5
transtition
.
timingFunction
=
CAMediaTimingFunction
(
name
:
CAMediaTimingFunctionName
.
easeOut
)
UIApplication
.
shared
.
keyWindow
?
.
layer
.
add
(
transtition
,
forKey
:
"animation"
)
let
rootV
=
NavViewController
(
rootViewController
:
contentView
)
UIApplication
.
shared
.
keyWindow
?
.
rootViewController
=
rootV
}
else
{
let
window
=
UIWindow
(
windowScene
:
windowScene
)
let
window
=
UIWindow
(
windowScene
:
windowScene
)
let
rootV
=
NavViewController
(
rootViewController
:
contentView
)
let
rootV
=
NavViewController
(
rootViewController
:
contentView
)
window
.
rootViewController
=
rootV
;
window
.
rootViewController
=
rootV
;
self
.
window
=
window
self
.
window
=
window
window
.
makeKeyAndVisible
()
window
.
makeKeyAndVisible
()
}
}
}
}
//MARK:--tabbarVCs
func
addTabBarVcs
(
isAgain
:
Bool
)
{
let
tabBarController
=
ESTabBarController
()
tabBarController
.
delegate
=
self
tabBarController
.
tabBar
.
backgroundColor
=
UIColor
.
white
tabBarController
.
tabBar
.
shadowImage
=
UIImage
(
named
:
"transparent"
)
let
img
=
imageWithColor
(
UIColor
.
white
)
tabBarController
.
tabBar
.
backgroundImage
=
img
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
popLogout
)
,
name
:
NSNotification
.
Name
(
rawValue
:
"logout"
),
object
:
nil
)
let
v1
=
GoodsManageListVC
()
let
v2
=
GoodsManageListVC
()
let
v3
=
GoodsManageListVC
()
let
v4
=
LoginViewController
()
let
v5
=
DemoViewController
()
v1
.
tabBarItem
=
ESTabBarItem
.
init
(
ExampleBouncesContentView
(),
title
:
"订单管理"
,
image
:
UIImage
(
named
:
"daixuan"
),
selectedImage
:
UIImage
(
named
:
"kuwei"
))
v2
.
tabBarItem
=
ESTabBarItem
.
init
(
ExampleBouncesContentView
(),
title
:
"商品管理"
,
image
:
UIImage
(
named
:
"daixuan"
),
selectedImage
:
UIImage
(
named
:
"kuwei"
))
v3
.
tabBarItem
=
ESTabBarItem
.
init
(
ExampleBouncesContentView
(),
title
:
"工作中心"
,
image
:
UIImage
(
named
:
"daixuan"
),
selectedImage
:
UIImage
(
named
:
"kuwei"
))
v4
.
tabBarItem
=
ESTabBarItem
.
init
(
ExampleBouncesContentView
(),
title
:
"仓库管理"
,
image
:
UIImage
(
named
:
"daixuan"
),
selectedImage
:
UIImage
(
named
:
"kuwei"
))
v5
.
tabBarItem
=
ESTabBarItem
.
init
(
ExampleBouncesContentView
(),
title
:
"个人中心"
,
image
:
UIImage
(
named
:
"daixuan"
),
selectedImage
:
UIImage
(
named
:
"kuwei"
))
tabBarController
.
viewControllers
=
[
v1
,
v2
,
v3
,
v4
,
v5
]
let
contentView
=
tabBarController
if
let
windowScene
=
sceneC
as?
UIWindowScene
{
if
isAgain
{
let
transtition
=
CATransition
()
transtition
.
duration
=
0.5
transtition
.
timingFunction
=
CAMediaTimingFunction
(
name
:
CAMediaTimingFunctionName
.
easeOut
)
UIApplication
.
shared
.
keyWindow
?
.
layer
.
add
(
transtition
,
forKey
:
"animation"
)
let
rootV
=
NavViewController
(
rootViewController
:
contentView
)
UIApplication
.
shared
.
keyWindow
?
.
rootViewController
=
rootV
}
else
{
let
window
=
UIWindow
(
windowScene
:
windowScene
)
let
rootV
=
NavViewController
(
rootViewController
:
contentView
)
window
.
rootViewController
=
rootV
;
self
.
window
=
window
window
.
makeKeyAndVisible
()
}
}
if
let
tabBarItem
=
v2
.
tabBarItem
as?
ESTabBarItem
{
DispatchQueue
.
main
.
asyncAfter
(
deadline
:
.
now
()
+
2
)
{
tabBarItem
.
badgeValue
=
"1"
}
}
}
}
func
sceneDidDisconnect
(
_
scene
:
UIScene
)
{
func
sceneDidDisconnect
(
_
scene
:
UIScene
)
{
...
...
GeliBusinessPlatform/ViewController/商品管理/GoodsManageListVC.swift
View file @
4006bfa8
...
@@ -85,7 +85,13 @@ class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollect
...
@@ -85,7 +85,13 @@ class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollect
//MARK:--新增触发
//MARK:--新增触发
@IBAction
func
addNewGoodsAction
(
_
sender
:
UIButton
)
{
@IBAction
func
addNewGoodsAction
(
_
sender
:
UIButton
)
{
print
(
"新增触发-"
)
print
(
"新增触发-"
)
// let vc = DemoViewController()
// self.navigationController?.pushViewController(vc, animated: true)
//模拟退出登录
NotificationCenter
.
default
.
post
(
name
:
Notification
.
Name
(
rawValue
:
"logout"
),
object
:
nil
)
// UserDefaults.standard.set(dataM.data?.user_token, forKey: "user_token")
UserDefaults
.
standard
.
removeObject
(
forKey
:
"user_token"
)
UserDefaults
.
standard
.
synchronize
()
}
}
//MARK:--下拉视图各种代理
//MARK:--下拉视图各种代理
func
showAction
(
sender
:
Int
)
{
func
showAction
(
sender
:
Int
)
{
...
...
GeliBusinessPlatform/ViewController/登录/LoginViewController.swift
View file @
4006bfa8
...
@@ -11,9 +11,12 @@ import Alamofire
...
@@ -11,9 +11,12 @@ import Alamofire
import
CryptoSwift
import
CryptoSwift
import
LGButton
import
LGButton
protocol
loginDelegate
{
func
successLogin
()
}
class
LoginViewController
:
BaseViewController
,
CodeViewDelegate
,
GeliAlertViewDelegate
{
class
LoginViewController
:
BaseViewController
,
CodeViewDelegate
,
GeliAlertViewDelegate
{
var
delegate
:
loginDelegate
?
//MARK: - 输入账号、密码、验证码
//MARK: - 输入账号、密码、验证码
@IBOutlet
weak
var
loginBtn
:
LGButton
!
@IBOutlet
weak
var
loginBtn
:
LGButton
!
@IBOutlet
weak
var
codeView
:
UIView
!
@IBOutlet
weak
var
codeView
:
UIView
!
...
@@ -75,21 +78,35 @@ class LoginViewController: BaseViewController, CodeViewDelegate,GeliAlertViewDel
...
@@ -75,21 +78,35 @@ class LoginViewController: BaseViewController, CodeViewDelegate,GeliAlertViewDel
print
(
"
\(
codeNum
)
==
\(
codeTF
.
text
)
"
)
print
(
"
\(
codeNum
)
==
\(
codeTF
.
text
)
"
)
// zxpf
// zxpf
// 123456
// 123456
if
phoneTF
.
text
?
.
count
==
0
{
HUD
.
flash
(
.
label
(
"请填写用户名"
),
delay
:
1.2
)
return
}
if
passTF
.
text
?
.
count
==
0
{
HUD
.
flash
(
.
label
(
"请填写密码"
),
delay
:
1.2
)
return
}
if
codeTF
.
text
?
.
count
==
0
{
HUD
.
flash
(
.
label
(
"请填写验证码"
),
delay
:
1.2
)
return
}
if
codeNum
==
codeTF
.
text
{
if
codeNum
==
codeTF
.
text
{
//登录中状态
//登录中状态
loginBtn
.
isLoading
=
true
loginBtn
.
isLoading
=
true
login
([
"user_name"
:
phoneTF
.
text
as
Any
,
"pwd"
:
passTF
.
text
as
Any
],
success
:
{
(
data
)
in
login
([
"user_name"
:
phoneTF
.
text
as
Any
,
"pwd"
:
passTF
.
text
as
Any
],
success
:
{
(
data
)
in
let
dataM
=
data
as!
LoginModel
let
dataM
=
data
as!
LoginModel
UserDefaults
.
standard
.
setValue
(
dataM
.
data
?
.
user_token
,
forKey
:
"user_token"
)
UserDefaults
.
standard
.
set
(
dataM
.
data
?
.
user_token
,
forKey
:
"user_token"
)
UserDefaults
.
standard
.
synchronize
()
self
.
loginBtn
.
isLoading
=
false
self
.
loginBtn
.
isLoading
=
false
self
.
delegate
?
.
successLogin
()
})
{
(
error
)
in
})
{
(
error
)
in
self
.
loginBtn
.
isLoading
=
false
self
.
loginBtn
.
isLoading
=
false
}
}
}
else
{
}
else
{
HUD
.
flash
(
.
label
(
"请填写正确的验证码"
),
delay
:
2.0
)
HUD
.
flash
(
.
label
(
"请填写正确的验证码"
),
delay
:
1.2
)
}
}
}
}
}
}
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