Commit a753c6b1 authored by lujunye's avatar lujunye

修复数据刷新bug

parent a03aa44b
...@@ -90,21 +90,6 @@ class GYS_FX_Product_ListVc: BaseViewController ,PagingViewControllerDelegate,UI ...@@ -90,21 +90,6 @@ class GYS_FX_Product_ListVc: BaseViewController ,PagingViewControllerDelegate,UI
} }
@objc func getNoti(noti:Notification){
let noti_str = String(describing: noti.userInfo!["intro"])
if noti_str.contains("铺货"){
let vc = viewControllers.first
vc?.isUpData = true
vc?.home_list_tbv.mj_header?.beginRefreshing()
}else{
let vc = viewControllers.last
vc?.isUpData = true
vc?.home_list_tbv.mj_header?.beginRefreshing()
}
}
@objc func getNoti2(noti:Notification){ @objc func getNoti2(noti:Notification){
let sum_goods = String(describing: noti.userInfo!["sum_goods"]!) let sum_goods = String(describing: noti.userInfo!["sum_goods"]!)
...@@ -303,6 +288,10 @@ class GYS_FX_Product_ListVc: BaseViewController ,PagingViewControllerDelegate,UI ...@@ -303,6 +288,10 @@ class GYS_FX_Product_ListVc: BaseViewController ,PagingViewControllerDelegate,UI
let vc = self.viewControllers[self.selectIndex] let vc = self.viewControllers[self.selectIndex]
vc.home_list_tbv.mj_header?.beginRefreshing() vc.home_list_tbv.mj_header?.beginRefreshing()
} }
var noti_str = ""
@objc func getNoti(noti:Notification){
noti_str = String(describing: noti.userInfo!["intro"])
}
...@@ -312,15 +301,28 @@ class GYS_FX_Product_ListVc: BaseViewController ,PagingViewControllerDelegate,UI ...@@ -312,15 +301,28 @@ class GYS_FX_Product_ListVc: BaseViewController ,PagingViewControllerDelegate,UI
startingViewController: UIViewController?, startingViewController: UIViewController?,
destinationViewController: UIViewController, destinationViewController: UIViewController,
transitionSuccessful: Bool){ transitionSuccessful: Bool){
if transitionSuccessful {
guard let item = pagingItem as? PagingIndexItem else { return} guard let item = pagingItem as? PagingIndexItem else { return}
if selectIndex != item.index { if selectIndex != item.index {
selectIndex = item.index selectIndex = item.index
if noti_str != "" {
if noti_str.contains("铺货"){
let vc = viewControllers.first
vc?.isUpData = true
}else{
let vc = viewControllers.last
vc?.isUpData = true
}
noti_str = ""
}else{
let vc = viewControllers[selectIndex] let vc = viewControllers[selectIndex]
if !vc.isUpData { if !vc.isUpData {
vc.home_list_tbv.mj_header?.beginRefreshing() vc.home_list_tbv.mj_header?.beginRefreshing()
} }
} }
}
}
} }
} }
......
...@@ -26,9 +26,8 @@ class GYS_FX_Product_VC: BaseViewController,UITableViewDelegate,UITableViewDataS ...@@ -26,9 +26,8 @@ class GYS_FX_Product_VC: BaseViewController,UITableViewDelegate,UITableViewDataS
"shop_id":shop_id as Any, "shop_id":shop_id as Any,
"action":action] "action":action]
spreadGoods(dic) { (data) in spreadGoods(dic) { (data) in
HUD.flash(.label(intro), delay: 2) HUD.flash(.label(intro), delay: 0.5)
self.home_list_tbv.mj_header?.beginRefreshing() self.home_list_tbv.mj_header?.beginRefreshing()
// NotificationCenter.default.post(name: NSNotification.Name(rawValue: "fx_action"), object:nil)
NotificationCenter.default.post(name: NSNotification.Name(rawValue: "fx_action"), object: nil, userInfo: ["intro":intro]) NotificationCenter.default.post(name: NSNotification.Name(rawValue: "fx_action"), object: nil, userInfo: ["intro":intro])
} failture: { (err) in } failture: { (err) in
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment