Commit 6ec6ee83 authored by lujunye's avatar lujunye

优化界面

parent cd36d28b
...@@ -96,6 +96,11 @@ class S_P_K_C_Detail_Vc: BaseViewController,UICollectionViewDelegate,UICollectio ...@@ -96,6 +96,11 @@ class S_P_K_C_Detail_Vc: BaseViewController,UICollectionViewDelegate,UICollectio
} }
//MARK: - TABLEVIEWDELEGATE //MARK: - TABLEVIEWDELEGATE
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if indexPath.row == 9 {
print("查看图片")
}
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 10 return 10
} }
......
...@@ -1493,6 +1493,8 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -1493,6 +1493,8 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
//刷新cell //刷新cell
collectionView.reloadData() collectionView.reloadData()
listTbv.reloadRows(at: [IndexPath(row: 0, section: 2)], with:.none) listTbv.reloadRows(at: [IndexPath(row: 0, section: 2)], with:.none)
let item = collectionView.cellForItem(at: indexPath)
collectionView.scrollRectToVisible(item!.frame, animated: true)
} }
//MARK: - switchClick //MARK: - switchClick
func switchClick(content: UISwitch, cell: TitleAndSwitchCell) { func switchClick(content: UISwitch, cell: TitleAndSwitchCell) {
...@@ -1607,7 +1609,11 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -1607,7 +1609,11 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
} }
collectionView.showsHorizontalScrollIndicator = false collectionView.showsHorizontalScrollIndicator = false
collectionView.isPagingEnabled = true collectionView.isPagingEnabled = true
layout.itemSize = CGSize(width: fullScreenWidth*0.5, height: 41) if guiGeArr.count < 5 {
layout.itemSize = CGSize(width: Int(fullScreenWidth)/guiGeArr.count, height: 41)
}else{
layout.itemSize = CGSize(width: fullScreenWidth/4.5, height: 41)
}
layout.scrollDirection = .horizontal layout.scrollDirection = .horizontal
collectionView.collectionViewLayout = layout collectionView.collectionViewLayout = layout
collectionView.register(UINib(nibName: "ItemCell", bundle: nil), forCellWithReuseIdentifier: "ItemCell") collectionView.register(UINib(nibName: "ItemCell", bundle: nil), forCellWithReuseIdentifier: "ItemCell")
...@@ -1615,27 +1621,6 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -1615,27 +1621,6 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
collectionView.layoutIfNeeded() collectionView.layoutIfNeeded()
collectionView.scrollToItem(at: selectIdx!, at: .top, animated: false) collectionView.scrollToItem(at: selectIdx!, at: .top, animated: false)
} }
if guiGeArr.count > 2{
let leftImg = UIImageView()
view.addSubview(leftImg)
leftImg.image = UIImage(named: "wangyue")
leftImg.snp.makeConstraints { (make) in
make.centerY.equalTo(collectionView.snp_centerY)
make.left.equalTo(10)
make.width.equalTo(5)
make.height.equalTo(15)
}
let rightImg = UIImageView()
view.addSubview(rightImg)
rightImg.image = UIImage(named: "xiageyue")
rightImg.snp.makeConstraints { (make) in
make.centerY.equalTo(collectionView.snp_centerY)
make.right.equalTo(-10)
make.width.equalTo(5)
make.height.equalTo(15)
}
}
} }
} }
return view return view
......
...@@ -1027,6 +1027,8 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -1027,6 +1027,8 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
//刷新cell //刷新cell
collectionView.reloadData() collectionView.reloadData()
listTbv.reloadRows(at: [IndexPath(row: 0, section: 2)], with:.none) listTbv.reloadRows(at: [IndexPath(row: 0, section: 2)], with:.none)
let item = collectionView.cellForItem(at: indexPath)
collectionView.scrollRectToVisible(item!.frame, animated: true)
} }
//MARK: - switchClick //MARK: - switchClick
func switchClick(content: UISwitch, cell: TitleAndSwitchCell) { func switchClick(content: UISwitch, cell: TitleAndSwitchCell) {
...@@ -1161,27 +1163,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -1161,27 +1163,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
collectionView.layoutIfNeeded() collectionView.layoutIfNeeded()
collectionView.scrollToItem(at: selectIdx!, at: .top, animated: false) collectionView.scrollToItem(at: selectIdx!, at: .top, animated: false)
} }
if guiGeArr.count > 2{
let leftImg = UIImageView()
view.addSubview(leftImg)
leftImg.image = UIImage(named: "wangyue")
leftImg.snp.makeConstraints { (make) in
make.centerY.equalTo(collectionView.snp_centerY)
make.left.equalTo(10)
make.width.equalTo(5)
make.height.equalTo(15)
}
let rightImg = UIImageView()
view.addSubview(rightImg)
rightImg.image = UIImage(named: "xiageyue")
rightImg.snp.makeConstraints { (make) in
make.centerY.equalTo(collectionView.snp_centerY)
make.right.equalTo(-10)
make.width.equalTo(5)
make.height.equalTo(15)
}
}
} }
} }
return view return view
......
...@@ -107,7 +107,6 @@ class Print_Gprinter_View: UIView,UITableViewDelegate,UITableViewDataSource, GPr ...@@ -107,7 +107,6 @@ class Print_Gprinter_View: UIView,UITableViewDelegate,UITableViewDataSource, GPr
} }
//连接打印机 //连接打印机
delegate?.Print_Gprinter_View_Print(data: print_data) delegate?.Print_Gprinter_View_Print(data: print_data)
} }
@IBAction func close_action(_ sender: UIButton) { @IBAction func close_action(_ sender: UIButton) {
self.removeFromSuperview() self.removeFromSuperview()
......
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