|
@@ -72,17 +72,25 @@ class ShoppingCartView: BaseView {
|
|
|
func updateAccountViewCondition() {
|
|
|
if cartListModelArr?.isEmpty ?? true {
|
|
|
accountView.isHidden = true
|
|
|
- accountView.snp_updateConstraints { (make) in
|
|
|
- accountView.snp_updateConstraints { (make) in
|
|
|
- make.height.equalTo(0)
|
|
|
- }
|
|
|
+
|
|
|
+ accountView.snp.remakeConstraints { (make) in
|
|
|
+ make.left.right.bottom.equalToSuperview()
|
|
|
+ make.height.equalTo(0)
|
|
|
+ }
|
|
|
+ tableView.snp.remakeConstraints { (make) in
|
|
|
+ make.edges.equalToSuperview()
|
|
|
+// make.bottom.equalTo(accountView.snp_top).offset(0)
|
|
|
}
|
|
|
} else {
|
|
|
accountView.isHidden = false
|
|
|
- accountView.snp_updateConstraints { (make) in
|
|
|
- accountView.snp_updateConstraints { (make) in
|
|
|
- make.height.equalTo(48)
|
|
|
- }
|
|
|
+
|
|
|
+ accountView.snp.remakeConstraints { (make) in
|
|
|
+ make.left.right.bottom.equalToSuperview()
|
|
|
+ make.height.equalTo(48)
|
|
|
+ }
|
|
|
+ tableView.snp.remakeConstraints { (make) in
|
|
|
+ make.top.left.right.equalToSuperview()
|
|
|
+ make.bottom.equalTo(accountView.snp_top).offset(0)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -145,11 +153,12 @@ extension ShoppingCartView : UITableViewDelegate, UITableViewDataSource {
|
|
|
case 0:
|
|
|
// 购物车列表为空
|
|
|
let cell = ShoppingCartListNoneItemCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ cell.frame = tableView.bounds
|
|
|
return cell
|
|
|
case 1:
|
|
|
// 超值热卖
|
|
|
let hotSaleCell = ShoppingCartHotSaleTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
- hotSaleCell.frame = tableView.bounds
|
|
|
+// hotSaleCell.frame = tableView.bounds
|
|
|
hotSaleCell.hotSaleModelArr = hotSaleModelArr
|
|
|
hotSaleCell.layoutIfNeeded()
|
|
|
hotSaleCell.reloadData()
|
|
@@ -168,6 +177,7 @@ extension ShoppingCartView : UITableViewDelegate, UITableViewDataSource {
|
|
|
if indexPath.section < cartListModelArr!.count {
|
|
|
// 购物车列表Item
|
|
|
let cell = ShoppingCartListTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ cell.frame = tableView.bounds
|
|
|
cell.productMdl = cartListModelArr![indexPath.section].productList![indexPath.row]
|
|
|
|
|
|
cell.productSelBlock = { [weak self]
|
|
@@ -194,7 +204,7 @@ extension ShoppingCartView : UITableViewDelegate, UITableViewDataSource {
|
|
|
} else {
|
|
|
// 超值热卖
|
|
|
let hotSaleCell = ShoppingCartHotSaleTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
- hotSaleCell.frame = tableView.bounds
|
|
|
+// hotSaleCell.frame = tableView.bounds
|
|
|
hotSaleCell.hotSaleModelArr = hotSaleModelArr
|
|
|
hotSaleCell.layoutIfNeeded()
|
|
|
hotSaleCell.reloadData()
|