|
@@ -27,7 +27,9 @@ class ShopViewController: BaseViewController {
|
|
|
navigationBar.barBackgroundColor = kFFA42FColor
|
|
|
navigationBar.titleLabelColor = UIColor.white
|
|
|
navigationBar.wr_setLeftButton(image: kImage(name: "navbar_back_white")!)
|
|
|
- navigationBar.wr_setRightButton(image: kImage(name: "navbar_shopping_white")!)
|
|
|
+ navigationBar.wr_setRightButton(image: kImage(name:
|
|
|
+ "navbar_shopping_white")!)
|
|
|
+ statusBarStyle = .lightContent
|
|
|
navigationBar.onClickRightButton = {
|
|
|
[weak self] in
|
|
|
let vc = ShoppingCartViewController()
|
|
@@ -46,9 +48,8 @@ class ShopViewController: BaseViewController {
|
|
|
|
|
|
override func setupData() {
|
|
|
|
|
|
- productGetCartCountApi()
|
|
|
-
|
|
|
shopView.tableView.addHeaderWithHeader(withBeginRefresh: true, animation: false) { [weak self] (page) in
|
|
|
+ self?.productGetCartCountApi()
|
|
|
self?.shopViewApi()
|
|
|
self?.productListApi(page: page)
|
|
|
}
|
|
@@ -74,7 +75,10 @@ class ShopViewController: BaseViewController {
|
|
|
vc.shopId = productSearch?.shopId
|
|
|
self?.navigationController?.pushViewController(vc, animated: true)
|
|
|
}
|
|
|
-
|
|
|
+ shopView.plusCloSure = {
|
|
|
+ [weak self] in
|
|
|
+ self?.productGetCartCountApi()
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private lazy var shopView: ShopView = {
|
|
@@ -117,6 +121,8 @@ class ShopViewController: BaseViewController {
|
|
|
[weak self] (productCartCountModel) -> (Void) in
|
|
|
let productCartCountModel = productCartCountModel as! ProductCartCountModel
|
|
|
if productCartCountModel.count != 0 {
|
|
|
+ self?.navigationBar.rightButton.pp.badgeView.isUserInteractionEnabled = false
|
|
|
+ self?.navigationBar.rightButton.pp.badgeView.offset = CGPoint(x: -13, y: 13)
|
|
|
self?.navigationBar.rightButton.pp.addBadge(number: productCartCountModel.count ?? 0)
|
|
|
}else {
|
|
|
self?.navigationBar.rightButton.pp.badgeView.isHidden = true
|