Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
I
IFS
Project
Project
Details
Activity
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
张杰
IFS
Commits
f114718f
Commit
f114718f
authored
6 years ago
by
jie zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
a36b1ffd
重庆IFS
重庆ifs20190308
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
3 deletions
+34
-3
Appdelegate+Extension.swift
IFS/IFS/Appdelegate+Extension.swift
+1
-0
Notification.swift
IFS/IFS/Expand/Const/Notification.swift
+3
-0
HomeContentViewController.swift
IFS/IFS/Main/Home/Controller/HomeContentViewController.swift
+24
-3
HomeViewController.swift
IFS/IFS/Main/Home/Controller/HomeViewController.swift
+6
-0
No files found.
IFS/IFS/Appdelegate+Extension.swift
View file @
f114718f
...
...
@@ -49,6 +49,7 @@ extension AppDelegate:JPUSHRegisterDelegate{
func
application
(
_
application
:
UIApplication
,
didReceiveRemoteNotification
userInfo
:
[
AnyHashable
:
Any
],
fetchCompletionHandler
completionHandler
:
@escaping
(
UIBackgroundFetchResult
)
->
Void
)
{
JPUSHService
.
handleRemoteNotification
(
userInfo
)
completionHandler
(
UIBackgroundFetchResult
.
newData
)
//处理消息的跳转
SBSkipTool
.
share
.
skipViewController
(
parameters
:
userInfo
)
}
}
...
...
This diff is collapsed.
Click to expand it.
IFS/IFS/Expand/Const/Notification.swift
View file @
f114718f
...
...
@@ -23,3 +23,6 @@ public let UPDATE_RECEIVE_ORDER_LIST: String = "UPDATE_RECEIVE_ORDER_LIST"
/// 更新代办消息
public
let
UPDATE_TODO_LIST
:
String
=
"UPDATE_TODO_LIST"
/// 首页页面跳转通知
public
let
SELECT_HOME_PAGE
:
String
=
"SELECT_HOME_PAGE"
This diff is collapsed.
Click to expand it.
IFS/IFS/Main/Home/Controller/HomeContentViewController.swift
View file @
f114718f
...
...
@@ -7,9 +7,11 @@
//
import
UIKit
import
RxSwift
class
HomeContentViewController
:
BaseViewController
{
/// RxSwift自动释放
let
disposeBag
=
DisposeBag
()
/// 首页未开始、已领单
@IBOutlet
weak
var
contentSegmented
:
UISegmentedControl
!
/// 内容ScrollView
...
...
@@ -25,6 +27,20 @@ class HomeContentViewController: BaseViewController {
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
addChildContentVc
()
//接收通知处理页面跳转逻辑
NotificationCenter
.
default
.
rx
.
notification
(
Notification
.
Name
(
rawValue
:
SELECT_HOME_PAGE
))
.
subscribe
(
onNext
:
{[
weak
self
]
(
notice
)
in
// print(notice)
guard
notice
.
object
!=
nil
else
{
print
(
"没有指定页面下标"
)
return
}
let
index
=
notice
.
object
as!
Int
self
?
.
contentSegmented
.
selectedSegmentIndex
=
index
self
?
.
updateScroll
(
with
:
index
)
})
.
disposed
(
by
:
disposeBag
)
}
// MARK: - 添加子控制器到主控制器
...
...
@@ -48,7 +64,7 @@ class HomeContentViewController: BaseViewController {
// MARK: - 滚动结束取出下标对应控制器
fileprivate
func
selectedCurrentVc
(
_
index
:
Int
,
_
scrollView
:
UIScrollView
)
{
let
tableViewVc
=
childViewControllers
[
index
]
currentVc
=
tableViewVc
as
!
BaseTableViewPullController
currentVc
=
tableViewVc
as
?
BaseTableViewPullController
tableViewVc
.
view
.
setx
(
x
:
scrollView
.
contentOffset
.
x
)
tableViewVc
.
view
.
seth
(
h
:
contentScrollView
.
height
)
tableViewVc
.
view
.
setw
(
w
:
contentScrollView
.
width
)
...
...
@@ -57,7 +73,12 @@ class HomeContentViewController: BaseViewController {
// MARK: - UISegmentedControl切换事件
@IBAction
func
segmentedControlClickAction
(
_
sender
:
UISegmentedControl
)
{
let
offset
=
sender
.
selectedSegmentIndex
*
Int
(
contentScrollView
.
width
)
updateScroll
(
with
:
sender
.
selectedSegmentIndex
)
}
func
updateScroll
(
with
segIndex
:
Int
)
{
// 0代表未开始,1代表已领单
let
offset
=
segIndex
*
Int
(
self
.
contentScrollView
.
width
)
contentScrollView
.
setContentOffset
(
CGPoint
(
x
:
offset
,
y
:
0
),
animated
:
true
)
}
}
...
...
This diff is collapsed.
Click to expand it.
IFS/IFS/Main/Home/Controller/HomeViewController.swift
View file @
f114718f
...
...
@@ -26,6 +26,12 @@ class HomeViewController: BaseViewController {
addChildContentVc
()
updateVersion
()
updateJPushAlias
()
DispatchQueue
.
main
.
asyncAfter
(
deadline
:
DispatchTime
.
now
()
+
DispatchTimeInterval
.
seconds
(
3
))
{
//object 传递的是首页页面的标识,未开始/已领单
NotificationCenter
.
default
.
post
(
name
:
NSNotification
.
Name
(
rawValue
:
"SELECT_HOME_PAGE"
),
object
:
1
)
}
}
/*iResCode, NSString *iAlias, NSInteger seq*/
func
updateJPushAlias
(){
...
...
This diff is collapsed.
Click to expand it.
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