Commit 5251ce27 authored by lujunye's avatar lujunye

编辑完成后回调刷新方法

parent 2160b655
...@@ -21,6 +21,7 @@ class AddImgCell: UITableViewCell { ...@@ -21,6 +21,7 @@ class AddImgCell: UITableViewCell {
willSet{ willSet{
isEdit = newValue isEdit = newValue
addBtn.isHidden = !isEdit! addBtn.isHidden = !isEdit!
} }
} }
@IBAction func btnClick(_ sender: Any) { @IBAction func btnClick(_ sender: Any) {
...@@ -98,6 +99,7 @@ class AddImgCell: UITableViewCell { ...@@ -98,6 +99,7 @@ class AddImgCell: UITableViewCell {
make.left.equalTo(105*i) make.left.equalTo(105*i)
} }
if isAllEditing { if isAllEditing {
let changeBtn = UIButton() let changeBtn = UIButton()
changeBtn.tag = i changeBtn.tag = i
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="AddImgCell" customModule="GeliBusinessPlatform" customModuleProvider="target"> <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="AddImgCell" customModule="TestClass" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="375" height="148.5"/> <rect key="frame" x="0.0" y="0.0" width="375" height="148.5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM"> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
......
...@@ -9,7 +9,9 @@ ...@@ -9,7 +9,9 @@
import UIKit import UIKit
import ViewAnimator import ViewAnimator
class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollectionViewDataSource ,UICollectionViewDelegateFlowLayout,HeaderSelectViewDelegate,SelectContentViewDelegate,UISearchBarDelegate, SearchBarViewDelegate, GoodsCollectionViewCellDelegate,ProductDetailViewControllerDelegate, GeliAlertViewDelegate{ class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollectionViewDataSource ,UICollectionViewDelegateFlowLayout,HeaderSelectViewDelegate,SelectContentViewDelegate,UISearchBarDelegate, SearchBarViewDelegate, GoodsCollectionViewCellDelegate,ProductDetailViewControllerDelegate, GeliAlertViewDelegate,EPViewControllerDelegate{
var collection : UICollectionView? = nil var collection : UICollectionView? = nil
var layout = UICollectionViewFlowLayout() var layout = UICollectionViewFlowLayout()
...@@ -262,6 +264,9 @@ class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollect ...@@ -262,6 +264,9 @@ class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollect
} }
//MARK:--新增回调刷新 //MARK:--新增回调刷新
func EPViewControllerFinishEdit() {
self.collection?.mj_header?.beginRefreshing()
}
func reloadDataByProductDetailViewController() { func reloadDataByProductDetailViewController() {
self.collection?.mj_header?.beginRefreshing() self.collection?.mj_header?.beginRefreshing()
...@@ -418,6 +423,7 @@ class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollect ...@@ -418,6 +423,7 @@ class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollect
print("选中===\(indexPath)") print("选中===\(indexPath)")
let item = collection?.cellForItem(at: indexPath) as! GoodsCollectionViewCell let item = collection?.cellForItem(at: indexPath) as! GoodsCollectionViewCell
let vc = EPViewController() let vc = EPViewController()
vc.delegate = self
vc.titleStrArr = [item.leftBtn.titleLabel!.text!,item.rightBtn.titleLabel!.text!] vc.titleStrArr = [item.leftBtn.titleLabel!.text!,item.rightBtn.titleLabel!.text!]
let data = items[indexPath.row] let data = items[indexPath.row]
vc.goods_id = data.goods_id vc.goods_id = data.goods_id
...@@ -430,6 +436,7 @@ class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollect ...@@ -430,6 +436,7 @@ class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollect
let item = collection?.cellForItem(at: idx) as! GoodsCollectionViewCell let item = collection?.cellForItem(at: idx) as! GoodsCollectionViewCell
let vc = EPViewController() let vc = EPViewController()
vc.delegate = self
vc.titleStrArr = [item.leftBtn.titleLabel!.text!,item.rightBtn.titleLabel!.text!] vc.titleStrArr = [item.leftBtn.titleLabel!.text!,item.rightBtn.titleLabel!.text!]
let data = items[index] let data = items[index]
vc.goods_id = data.goods_id vc.goods_id = data.goods_id
......
...@@ -12,11 +12,13 @@ import Photos ...@@ -12,11 +12,13 @@ import Photos
import IQKeyboardManagerSwift import IQKeyboardManagerSwift
import Dollar import Dollar
protocol EPViewControllerDelegate {
func EPViewControllerFinishEdit()
}
class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,TitleAndBtnCellDelegate,GLAlertSelectViewDelegate,GoodsClassViewControllerDelegate,PinPaiListViewControllerDelegate,AddImgCellDelegate,AddGuiGeCellDelegate,CreatNewSpecsViewControllerDelegate,ShangPinGguiGeCellDelegate,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout,TitleAndSwitchCellDelegate,TitleAndTFCellDelegate,YuShouWeiKuanFaHuoCellDelegate,UITextFieldDelegate,ShowTimeSelectViewDelegate, LMNoteViewControllerDelegate,GeliAlertViewDelegate{ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,TitleAndBtnCellDelegate,GLAlertSelectViewDelegate,GoodsClassViewControllerDelegate,PinPaiListViewControllerDelegate,AddImgCellDelegate,AddGuiGeCellDelegate,CreatNewSpecsViewControllerDelegate,ShangPinGguiGeCellDelegate,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout,TitleAndSwitchCellDelegate,TitleAndTFCellDelegate,YuShouWeiKuanFaHuoCellDelegate,UITextFieldDelegate,ShowTimeSelectViewDelegate, LMNoteViewControllerDelegate,GeliAlertViewDelegate{
var delegate:EPViewControllerDelegate?
@IBOutlet weak var btmBtnViewH: NSLayoutConstraint! @IBOutlet weak var btmBtnViewH: NSLayoutConstraint!
...@@ -216,6 +218,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -216,6 +218,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
self.editBtn!.setTitle("编辑", for: .normal) self.editBtn!.setTitle("编辑", for: .normal)
self.isAllEditing = false self.isAllEditing = false
self.listTbv.reloadData() self.listTbv.reloadData()
self.delegate?.EPViewControllerFinishEdit()
}) { (error) in }) { (error) in
} }
...@@ -691,7 +694,11 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -691,7 +694,11 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
let cell = tableView.dequeueReusableCell(withIdentifier: "AddImg") as! AddImgCell let cell = tableView.dequeueReusableCell(withIdentifier: "AddImg") as! AddImgCell
cell.addBtn.isUserInteractionEnabled = isAllEditing cell.addBtn.isUserInteractionEnabled = isAllEditing
cell.isAllEditing = isAllEditing cell.isAllEditing = isAllEditing
cell.addBtn.isHidden = !isAllEditing if isAllEditing {
cell.addBtn.isHidden = false
}else{
cell.addBtn.isHidden = true
}
cell.nameLbl.text = sptpArr[indexPath.row] cell.nameLbl.text = sptpArr[indexPath.row]
if indexPath.row == 0 { if indexPath.row == 0 {
cell.isSingle = true cell.isSingle = true
......
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