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
3292c9de
Commit
3292c9de
authored
May 26, 2020
by
刘俊宏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单添加通知和代理,用于订单操作后,对订单列表进行自动刷新
parent
b849eb9c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
3 deletions
+40
-3
GeliBusinessPlatform.xcworkspace/xcuserdata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
...ata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform/ViewController/订单列表/OrderListVC.swift
GeliBusinessPlatform/ViewController/订单列表/OrderListVC.swift
+9
-2
GeliBusinessPlatform/ViewController/订单列表/OrderListViewController.swift
...latform/ViewController/订单列表/OrderListViewController.swift
+8
-0
GeliBusinessPlatform/ViewController/订单详情/OrderDViewController.swift
...ssPlatform/ViewController/订单详情/OrderDViewController.swift
+23
-1
No files found.
GeliBusinessPlatform.xcworkspace/xcuserdata/liujunhong.xcuserdatad/UserInterfaceState.xcuserstate
View file @
3292c9de
No preview for this file type
GeliBusinessPlatform/ViewController/订单列表/OrderListVC.swift
View file @
3292c9de
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
import
UIKit
import
UIKit
import
ViewAnimator
//cell动效
import
ViewAnimator
//cell动效
class
OrderListVC
:
BaseViewController
,
UITableViewDelegate
,
UITableViewDataSource
,
DaiQueRenCellDelegate
,
GeliAlertViewDelegate
{
class
OrderListVC
:
BaseViewController
,
UITableViewDelegate
,
UITableViewDataSource
,
DaiQueRenCellDelegate
,
GeliAlertViewDelegate
,
OrderDViewControllerDelegate
{
//MARK:--基础数据
//MARK:--基础数据
var
keyword
:
String
=
""
var
keyword
:
String
=
""
var
startTime
:
Int
=
0
var
startTime
:
Int
=
0
...
@@ -236,6 +236,7 @@ class OrderListVC: BaseViewController, UITableViewDelegate, UITableViewDataSourc
...
@@ -236,6 +236,7 @@ class OrderListVC: BaseViewController, UITableViewDelegate, UITableViewDataSourc
}
else
{
}
else
{
//跳转订单详情
//跳转订单详情
let
vc
=
OrderDViewController
()
let
vc
=
OrderDViewController
()
vc
.
delegate
=
self
vc
.
orderId
=
rowModel
.
order_id
!
vc
.
orderId
=
rowModel
.
order_id
!
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
}
...
@@ -247,6 +248,7 @@ class OrderListVC: BaseViewController, UITableViewDelegate, UITableViewDataSourc
...
@@ -247,6 +248,7 @@ class OrderListVC: BaseViewController, UITableViewDelegate, UITableViewDataSourc
orderConfirm
([
"user_token"
:
UserToken
as
Any
,
"order_id"
:
sender
.
tag
as
Any
],
success
:
{
(
data
)
in
orderConfirm
([
"user_token"
:
UserToken
as
Any
,
"order_id"
:
sender
.
tag
as
Any
],
success
:
{
(
data
)
in
HUD
.
flash
(
.
labeledSubSuccess
(
subtitle
:
"确认成功"
),
delay
:
1.2
)
HUD
.
flash
(
.
labeledSubSuccess
(
subtitle
:
"确认成功"
),
delay
:
1.2
)
NotificationCenter
.
default
.
post
(
name
:
NSNotification
.
Name
(
rawValue
:
"orderChange"
),
object
:
nil
)
self
.
tableV
.
mj_header
?
.
beginRefreshing
()
self
.
tableV
.
mj_header
?
.
beginRefreshing
()
})
{
(
error
)
in
})
{
(
error
)
in
...
@@ -256,6 +258,8 @@ class OrderListVC: BaseViewController, UITableViewDelegate, UITableViewDataSourc
...
@@ -256,6 +258,8 @@ class OrderListVC: BaseViewController, UITableViewDelegate, UITableViewDataSourc
orderCancel
([
"user_token"
:
UserToken
as
Any
,
"order_id"
:
sender
.
tag
as
Any
],
success
:
{
(
data
)
in
orderCancel
([
"user_token"
:
UserToken
as
Any
,
"order_id"
:
sender
.
tag
as
Any
],
success
:
{
(
data
)
in
HUD
.
flash
(
.
labeledSubSuccess
(
subtitle
:
"取消成功"
),
delay
:
1.2
)
HUD
.
flash
(
.
labeledSubSuccess
(
subtitle
:
"取消成功"
),
delay
:
1.2
)
NotificationCenter
.
default
.
post
(
name
:
NSNotification
.
Name
(
rawValue
:
"orderChange"
),
object
:
nil
)
self
.
tableV
.
mj_header
?
.
beginRefreshing
()
self
.
tableV
.
mj_header
?
.
beginRefreshing
()
})
{
(
error
)
in
})
{
(
error
)
in
...
@@ -269,10 +273,13 @@ class OrderListVC: BaseViewController, UITableViewDelegate, UITableViewDataSourc
...
@@ -269,10 +273,13 @@ class OrderListVC: BaseViewController, UITableViewDelegate, UITableViewDataSourc
print
(
indexPath
)
print
(
indexPath
)
let
rowModel
=
self
.
dataArr
[
indexPath
.
row
]
let
rowModel
=
self
.
dataArr
[
indexPath
.
row
]
let
vc
=
OrderDViewController
()
let
vc
=
OrderDViewController
()
vc
.
delegate
=
self
vc
.
orderId
=
rowModel
.
order_id
!
vc
.
orderId
=
rowModel
.
order_id
!
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
}
func
refishingOrderDchange
()
{
self
.
tableV
.
mj_header
?
.
beginRefreshing
()
}
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
return
224
return
224
}
}
...
...
GeliBusinessPlatform/ViewController/订单列表/OrderListViewController.swift
View file @
3292c9de
...
@@ -65,6 +65,14 @@ class OrderListViewController: BaseViewController ,UISearchBarDelegate, SearchBa
...
@@ -65,6 +65,14 @@ class OrderListViewController: BaseViewController ,UISearchBarDelegate, SearchBa
contentView
.
constrainToEdges
(
pagingViewController
.
view
)
contentView
.
constrainToEdges
(
pagingViewController
.
view
)
pagingViewController
.
didMove
(
toParent
:
self
)
pagingViewController
.
didMove
(
toParent
:
self
)
//MARK:--添加个刷新通知
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
refreshingByOrderHavChange
)
,
name
:
NSNotification
.
Name
(
rawValue
:
"orderChange"
),
object
:
nil
)
}
@objc
func
refreshingByOrderHavChange
(){
viewControllers
.
forEach
{
(
vc
)
in
vc
.
isUpData
=
false
}
}
}
//MARK:--搜索按钮代理
//MARK:--搜索按钮代理
var
keyword
=
""
var
keyword
=
""
...
...
GeliBusinessPlatform/ViewController/订单详情/OrderDViewController.swift
View file @
3292c9de
...
@@ -7,7 +7,9 @@
...
@@ -7,7 +7,9 @@
//
//
import
UIKit
import
UIKit
protocol
OrderDViewControllerDelegate
{
func
refishingOrderDchange
()
}
class
OrderDViewController
:
BaseViewController
,
UITableViewDelegate
,
UITableViewDataSource
,
TitleAndBtnCellDelegate
,
GuanLianKehuVCDelegate
,
OrderDViewFooterViewDelegate
,
TitleAndTFCellDelegate
,
GeliAlertViewDelegate
,
GLAlertSelectViewDelegate
,
XiuGaiYuShouJiaViewControllerDelegate
,
ChangeGoodsPriceVCDelegate
,
GeliAlertTextFiledDelegate
,
GeliAlertTextViewDelegate
{
class
OrderDViewController
:
BaseViewController
,
UITableViewDelegate
,
UITableViewDataSource
,
TitleAndBtnCellDelegate
,
GuanLianKehuVCDelegate
,
OrderDViewFooterViewDelegate
,
TitleAndTFCellDelegate
,
GeliAlertViewDelegate
,
GLAlertSelectViewDelegate
,
XiuGaiYuShouJiaViewControllerDelegate
,
ChangeGoodsPriceVCDelegate
,
GeliAlertTextFiledDelegate
,
GeliAlertTextViewDelegate
{
func
GLASClose
(
view
:
GLAlertSelectView
,
selectnum
:
Int
,
selectArr
:
Array
<
Int
>
)
{
func
GLASClose
(
view
:
GLAlertSelectView
,
selectnum
:
Int
,
selectArr
:
Array
<
Int
>
)
{
if
selectnum
!=
10086
{
if
selectnum
!=
10086
{
...
@@ -24,6 +26,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
...
@@ -24,6 +26,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
view
.
removeFromSuperview
()
view
.
removeFromSuperview
()
glSelectView
=
nil
glSelectView
=
nil
}
}
var
delegate
:
OrderDViewControllerDelegate
?
//MARK:--普通的是否可编辑
//MARK:--普通的是否可编辑
var
isCaneditLatsData
:
Bool
=
true
var
isCaneditLatsData
:
Bool
=
true
...
@@ -1082,6 +1085,9 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
...
@@ -1082,6 +1085,9 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
HUD
.
flash
(
.
progress
)
HUD
.
flash
(
.
progress
)
orderConfirm
([
"user_token"
:
UserToken
as
Any
,
"order_id"
:
self
.
dataMdoel
?
.
order_res
?
.
order_id
as
Any
],
success
:
{
(
data
)
in
orderConfirm
([
"user_token"
:
UserToken
as
Any
,
"order_id"
:
self
.
dataMdoel
?
.
order_res
?
.
order_id
as
Any
],
success
:
{
(
data
)
in
HUD
.
flash
(
.
labeledSubSuccess
(
subtitle
:
"确认成功"
),
delay
:
1.2
)
HUD
.
flash
(
.
labeledSubSuccess
(
subtitle
:
"确认成功"
),
delay
:
1.2
)
NotificationCenter
.
default
.
post
(
name
:
NSNotification
.
Name
(
rawValue
:
"orderChange"
),
object
:
nil
)
self
.
delegate
?
.
refishingOrderDchange
()
self
.
loadData
()
self
.
loadData
()
})
{
(
error
)
in
})
{
(
error
)
in
...
@@ -1090,6 +1096,9 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
...
@@ -1090,6 +1096,9 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
HUD
.
flash
(
.
progress
)
HUD
.
flash
(
.
progress
)
orderCancel
([
"user_token"
:
UserToken
as
Any
,
"order_id"
:
self
.
dataMdoel
?
.
order_res
?
.
order_id
as
Any
],
success
:
{
(
data
)
in
orderCancel
([
"user_token"
:
UserToken
as
Any
,
"order_id"
:
self
.
dataMdoel
?
.
order_res
?
.
order_id
as
Any
],
success
:
{
(
data
)
in
HUD
.
flash
(
.
labeledSubSuccess
(
subtitle
:
"取消成功"
),
delay
:
1.2
)
HUD
.
flash
(
.
labeledSubSuccess
(
subtitle
:
"取消成功"
),
delay
:
1.2
)
NotificationCenter
.
default
.
post
(
name
:
NSNotification
.
Name
(
rawValue
:
"orderChange"
),
object
:
nil
)
self
.
delegate
?
.
refishingOrderDchange
()
self
.
loadData
()
self
.
loadData
()
})
{
(
error
)
in
})
{
(
error
)
in
...
@@ -1100,6 +1109,9 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
...
@@ -1100,6 +1109,9 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
if
isYuShou
{
if
isYuShou
{
sendOutAd
([
"user_token"
:
UserToken
as
Any
,
"order_id"
:
self
.
dataMdoel
?
.
order_res
?
.
order_id
as
Any
],
success
:
{
(
data
)
in
sendOutAd
([
"user_token"
:
UserToken
as
Any
,
"order_id"
:
self
.
dataMdoel
?
.
order_res
?
.
order_id
as
Any
],
success
:
{
(
data
)
in
HUD
.
flash
(
.
labeledSubSuccess
(
subtitle
:
"提交成功"
),
delay
:
1.2
)
HUD
.
flash
(
.
labeledSubSuccess
(
subtitle
:
"提交成功"
),
delay
:
1.2
)
NotificationCenter
.
default
.
post
(
name
:
NSNotification
.
Name
(
rawValue
:
"orderChange"
),
object
:
nil
)
self
.
delegate
?
.
refishingOrderDchange
()
self
.
loadData
()
self
.
loadData
()
})
{
(
error
)
in
})
{
(
error
)
in
...
@@ -1107,6 +1119,9 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
...
@@ -1107,6 +1119,9 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
}
else
{
}
else
{
sendOut
([
"user_token"
:
UserToken
as
Any
,
"order_id"
:
self
.
dataMdoel
?
.
order_res
?
.
order_id
as
Any
],
success
:
{
(
data
)
in
sendOut
([
"user_token"
:
UserToken
as
Any
,
"order_id"
:
self
.
dataMdoel
?
.
order_res
?
.
order_id
as
Any
],
success
:
{
(
data
)
in
HUD
.
flash
(
.
labeledSubSuccess
(
subtitle
:
"提交成功"
),
delay
:
1.2
)
HUD
.
flash
(
.
labeledSubSuccess
(
subtitle
:
"提交成功"
),
delay
:
1.2
)
NotificationCenter
.
default
.
post
(
name
:
NSNotification
.
Name
(
rawValue
:
"orderChange"
),
object
:
nil
)
self
.
delegate
?
.
refishingOrderDchange
()
self
.
loadData
()
self
.
loadData
()
})
{
(
error
)
in
})
{
(
error
)
in
...
@@ -1116,6 +1131,9 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
...
@@ -1116,6 +1131,9 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
HUD
.
flash
(
.
progress
)
HUD
.
flash
(
.
progress
)
orderRefund
([
"user_token"
:
UserToken
as
Any
,
"order_id"
:
self
.
dataMdoel
?
.
order_res
?
.
order_id
as
Any
],
success
:
{
(
data
)
in
orderRefund
([
"user_token"
:
UserToken
as
Any
,
"order_id"
:
self
.
dataMdoel
?
.
order_res
?
.
order_id
as
Any
],
success
:
{
(
data
)
in
HUD
.
flash
(
.
labeledSubSuccess
(
subtitle
:
"提交成功"
),
delay
:
1.2
)
HUD
.
flash
(
.
labeledSubSuccess
(
subtitle
:
"提交成功"
),
delay
:
1.2
)
NotificationCenter
.
default
.
post
(
name
:
NSNotification
.
Name
(
rawValue
:
"orderChange"
),
object
:
nil
)
self
.
delegate
?
.
refishingOrderDchange
()
self
.
loadData
()
self
.
loadData
()
})
{
(
error
)
in
})
{
(
error
)
in
...
@@ -1125,6 +1143,8 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
...
@@ -1125,6 +1143,8 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
if
isYuShou
{
if
isYuShou
{
orderReturnedGoodsAd
([
"user_token"
:
UserToken
as
Any
,
"order_id"
:
self
.
dataMdoel
?
.
order_res
?
.
order_id
as
Any
],
success
:
{
(
data
)
in
orderReturnedGoodsAd
([
"user_token"
:
UserToken
as
Any
,
"order_id"
:
self
.
dataMdoel
?
.
order_res
?
.
order_id
as
Any
],
success
:
{
(
data
)
in
HUD
.
flash
(
.
labeledSubSuccess
(
subtitle
:
"提交成功"
),
delay
:
1.2
)
HUD
.
flash
(
.
labeledSubSuccess
(
subtitle
:
"提交成功"
),
delay
:
1.2
)
NotificationCenter
.
default
.
post
(
name
:
NSNotification
.
Name
(
rawValue
:
"orderChange"
),
object
:
nil
)
self
.
delegate
?
.
refishingOrderDchange
()
self
.
loadData
()
self
.
loadData
()
})
{
(
error
)
in
})
{
(
error
)
in
...
@@ -1132,6 +1152,8 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
...
@@ -1132,6 +1152,8 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
}
else
{
}
else
{
orderReturnedGoods
([
"user_token"
:
UserToken
as
Any
,
"order_id"
:
self
.
dataMdoel
?
.
order_res
?
.
order_id
as
Any
],
success
:
{
(
data
)
in
orderReturnedGoods
([
"user_token"
:
UserToken
as
Any
,
"order_id"
:
self
.
dataMdoel
?
.
order_res
?
.
order_id
as
Any
],
success
:
{
(
data
)
in
HUD
.
flash
(
.
labeledSubSuccess
(
subtitle
:
"提交成功"
),
delay
:
1.2
)
HUD
.
flash
(
.
labeledSubSuccess
(
subtitle
:
"提交成功"
),
delay
:
1.2
)
NotificationCenter
.
default
.
post
(
name
:
NSNotification
.
Name
(
rawValue
:
"orderChange"
),
object
:
nil
)
self
.
delegate
?
.
refishingOrderDchange
()
self
.
loadData
()
self
.
loadData
()
})
{
(
error
)
in
})
{
(
error
)
in
...
...
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