Commit cf992f74 authored by lujunye's avatar lujunye

全选逻辑补充。

parent cb3079f7
...@@ -303,7 +303,6 @@ class GYS_FX_Product_ListVc: BaseViewController ,PagingViewControllerDelegate,UI ...@@ -303,7 +303,6 @@ class GYS_FX_Product_ListVc: BaseViewController ,PagingViewControllerDelegate,UI
transitionSuccessful: Bool){ transitionSuccessful: Bool){
if transitionSuccessful { 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 != "" {
...@@ -331,7 +330,6 @@ extension GYS_FX_Product_ListVc: PagingViewControllerDataSource { ...@@ -331,7 +330,6 @@ extension GYS_FX_Product_ListVc: PagingViewControllerDataSource {
func pagingViewController(_ pagingViewController: PagingViewController, didSelectItem pagingItem: PagingItem) { func pagingViewController(_ pagingViewController: PagingViewController, didSelectItem pagingItem: PagingItem) {
guard let item = pagingItem as? PagingIndexItem else { return} guard let item = pagingItem as? PagingIndexItem else { return}
print("abc == ",selectIndex,item.index)
if selectIndex != item.index { if selectIndex != item.index {
if noti_str != "" { if noti_str != "" {
if noti_str.contains("铺货"){ if noti_str.contains("铺货"){
...@@ -349,7 +347,6 @@ extension GYS_FX_Product_ListVc: PagingViewControllerDataSource { ...@@ -349,7 +347,6 @@ extension GYS_FX_Product_ListVc: PagingViewControllerDataSource {
} }
} }
} }
closeAction() closeAction()
} }
......
...@@ -80,7 +80,17 @@ class FX_Product_GuanLiVC: BaseViewController,UITableViewDelegate,UITableViewDat ...@@ -80,7 +80,17 @@ class FX_Product_GuanLiVC: BaseViewController,UITableViewDelegate,UITableViewDat
self.view.addSubview(vc) self.view.addSubview(vc)
} }
var datas:Array<supGoodsListResDataModel> = [] var datas:Array<supGoodsListResDataModel> = []{
didSet{
selectItem.removeAll()
if is_all_select {
datas.forEach { (model) in
selectItem.append(model.sku_id!)
}
}
home_list_tbv.reloadData()
}
}
var selectIndexArr = [0,0] var selectIndexArr = [0,0]
var showSelectvIndex = 0 var showSelectvIndex = 0
...@@ -199,10 +209,11 @@ class FX_Product_GuanLiVC: BaseViewController,UITableViewDelegate,UITableViewDat ...@@ -199,10 +209,11 @@ class FX_Product_GuanLiVC: BaseViewController,UITableViewDelegate,UITableViewDat
blackBtnView.addTarget(self, action: #selector(removeBlackBtnView), for: .touchUpInside) blackBtnView.addTarget(self, action: #selector(removeBlackBtnView), for: .touchUpInside)
return true return true
} }
var is_all_select = false
@IBAction func allSelect(_ sender: UIButton) { @IBAction func allSelect(_ sender: UIButton) {
sender.isSelected = !sender.isSelected sender.isSelected = !sender.isSelected
selectItem.removeAll() selectItem.removeAll()
is_all_select = sender.isSelected
if sender.isSelected { if sender.isSelected {
datas.forEach { (model) in datas.forEach { (model) in
selectItem.append(model.sku_id!) selectItem.append(model.sku_id!)
......
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