Selaa lähdekoodia

分类页面调试完

南鑫林 6 vuotta sitten
vanhempi
commit
5d7fceb4bb
20 muutettua tiedostoa jossa 177 lisäystä ja 32 poistoa
  1. 3 3
      RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj
  2. 11 1
      RainbowPlanet/RainbowPlanet/Modules/CommonModules/SearchModule/SearchResult/View/SearchResultNavigationbarView.swift
  3. 16 1
      RainbowPlanet/RainbowPlanet/Modules/CommonModules/SearchModule/SearchResult/View/SearchResultView.swift
  4. 38 0
      RainbowPlanet/RainbowPlanet/Modules/CommonModules/SearchModule/SearchResult/ViewController/SearchResultViewController.swift
  5. 1 1
      RainbowPlanet/RainbowPlanet/Modules/RegisterLoginModule/RegisterLogin/View/RegisterLoginView.swift
  6. 11 1
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Category/View/CategorySearchView.swift
  7. 5 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Category/View/CategoryTableViewCell.swift
  8. 14 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Category/View/CategoryView.swift
  9. 41 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Category/ViewController/CategoryViewController.swift
  10. 0 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/ProductDetailHeader/ProductDetailFSPagerViewCell.swift
  11. 0 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/ProductDetailHeader/ProductDetailSectionHeader.swift
  12. 0 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/ProductDetailHeader/ProductDetailTableViewHeaderView.swift
  13. 1 1
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/ProductDetailView.swift
  14. 0 2
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/ViewController/ProductDetailViewController.swift
  15. 12 14
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/TableViewCell/ProductHBigTableViewCell.swift
  16. 12 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/TableViewCell/ProductHSmallTableViewCell.swift
  17. 5 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallFloor/FloorCell/ShoppingMallSlidingLeftRight/ShoppingMallSlidingLeftRightBgCollectionViewCell.swift
  18. 5 5
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/ViewController/ShoppingMallViewController.swift
  19. 0 1
      RainbowPlanet/RainbowPlanet/Service/Model/ProductModel/ProductDetailModel.swift
  20. 2 2
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceProduct/SwiftMoyaNetWorkServiceProduct.swift

+ 3 - 3
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -897,9 +897,10 @@
 		A70B2C192286B4ED00B2449F /* View */ = {
 			isa = PBXGroup;
 			children = (
-				A70B843322911AF600882BC5 /* ProductDetailView.swift */,
+				A70B2C3B228819E900B2449F /* ProductDetailHeader */,
 				A70B2C702289016600B2449F /* ProductDetailSkuView */,
 				A70B2C39228819CA00B2449F /* Cell */,
+				A70B843322911AF600882BC5 /* ProductDetailView.swift */,
 			);
 			path = View;
 			sourceTree = "<group>";
@@ -1070,7 +1071,6 @@
 				A70B2C722289019200B2449F /* ProductDetailSkuView.swift */,
 				A70B2C74228920BA00B2449F /* ProductDetailSkuSectionHeaerCollectionReusableView.swift */,
 				A70B2C34228815F700B2449F /* ProductDetailProductSkuLabelCollectionViewCell.swift */,
-				A70B2C3B228819E900B2449F /* ProductDetailHeader */,
 			);
 			path = ProductDetailSkuView;
 			sourceTree = "<group>";
@@ -2025,9 +2025,9 @@
 		A77F2CA32232010F001BD3F6 /* ShoppingMallModule */ = {
 			isa = PBXGroup;
 			children = (
+				A77F2CA42232010F001BD3F6 /* ShoppingMall */,
 				A7FF1550228AC22700A85748 /* ProductAllComment */,
 				A70B2C122286B14C00B2449F /* ProductView */,
-				A77F2CA42232010F001BD3F6 /* ShoppingMall */,
 				A70B2C112286B10000B2449F /* ProductDetail */,
 				A70B2C5622886AAA00B2449F /* Shop */,
 				A7A98E03227EB7FD005306E9 /* Category */,

+ 11 - 1
RainbowPlanet/RainbowPlanet/Modules/CommonModules/SearchModule/SearchResult/View/SearchResultNavigationbarView.swift

@@ -134,11 +134,21 @@ class SearchResultNavigationbarView: BaseView {
                 shoppingCarBlock()
             }
         }).disposed(by: disposeBag)
-        shoppingCarButton.pp.addBadge(number: 5)
 //        shoppingCarButton.pp.setBadge(height: 14)
 //        shoppingCarButton.pp.badgeView.font = kRegularFont10
         shoppingCarButton.pp.badgeView.backgroundColor = kfe352bColor
         shoppingCarButton.pp.moveBadge(x: -2, y: 2)
         return shoppingCarButton
     }()
+    
+    var productCartCountModel : ProductCartCountModel? {
+        didSet {
+            
+            if productCartCountModel?.count == 0 {
+                shoppingCarButton.pp.hiddenBadge()
+            }else {
+                shoppingCarButton.pp.addBadge(number: productCartCountModel?.count ?? 0)
+            }
+        }
+    }
 }

+ 16 - 1
RainbowPlanet/RainbowPlanet/Modules/CommonModules/SearchModule/SearchResult/View/SearchResultView.swift

@@ -51,6 +51,12 @@ class SearchResultView: BaseView {
         tableView.masksToBounds = true
         return tableView
     }()
+    
+    typealias DidSelectRow = (_ indexPath: IndexPath) -> Void
+    var didSelectRow : DidSelectRow?
+    
+    typealias AddCartClosure = (ProductSearchModel,IndexPath) -> Void
+    var addCartClosure : AddCartClosure?
 }
 
 extension SearchResultView :UITableViewDataSource,UITableViewDelegate  {
@@ -67,11 +73,20 @@ extension SearchResultView :UITableViewDataSource,UITableViewDelegate  {
     func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
         let cell = ProductHBigTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
         cell.productSearchModel = productSearchModelArray![indexPath.row]
+        cell.plusClosure = {
+            [weak self] (productSearchModel,indexPath) in
+            
+            if let addCartClosure = self?.addCartClosure {
+                addCartClosure(productSearchModel!,indexPath!)
+            }
+        }
         return cell
     }
     
     func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
-        
+        if let didSelectRow = self.didSelectRow {
+            didSelectRow(indexPath)
+        }
     }
     
 }

+ 38 - 0
RainbowPlanet/RainbowPlanet/Modules/CommonModules/SearchModule/SearchResult/ViewController/SearchResultViewController.swift

@@ -43,6 +43,7 @@ class SearchResultViewController: BaseViewController {
         searchResultView.tableView.addHeaderWithHeader(withBeginRefresh: true, animation: false) {
             [weak self] (page) in
             self?.productSearchApi(page: page)
+            self?.productGetCartCountApi()
         }
         searchResultView.tableView.addFooterWithWithHeader(withAutomaticallyRefresh: true) {
             [weak self] (page) in
@@ -58,8 +59,22 @@ class SearchResultViewController: BaseViewController {
             self?.productSearchApi(page: 1)
         }
         navigationBarView.shoppingCarBlock = {
+            [weak self] in
+            self?.tabBarController?.selectedIndex = 1
+        }
+        
+        searchResultView.didSelectRow = {
+            [weak self] indexPath in
+            let vc = ProductDetailViewController()
+            let productSearch = self?.productSearchModelArray[indexPath.row]
+            vc.productSearchModel = productSearch
+            self?.navigationController?.pushViewController(vc, animated: true)
             
         }
+        searchResultView.addCartClosure = {
+            [weak self]  (productSearchModel,indexPath) in
+            self?.addCart(productSearchModel: productSearchModel, indexPath: indexPath)
+        }
     }
     
     private lazy var navigationBarView: SearchResultNavigationbarView = {
@@ -90,4 +105,27 @@ class SearchResultViewController: BaseViewController {
             }
         }
     }
+    
+    /// 获取购物车数量
+    func productGetCartCountApi() {
+        SwiftMoyaNetWorkServiceProduct.shared().productGetCartCountApi {
+            [weak self] (productCartCountModel) -> (Void) in
+            self?.navigationBarView.productCartCountModel = productCartCountModel as? ProductCartCountModel
+        }
+    }
+    
+    /// 添加购物车
+    ///
+    /// - Returns:
+    func addCart(productSearchModel:ProductSearchModel,indexPath:IndexPath) {
+        
+        
+        productSearchModel.isSelect = 1
+        SwiftMoyaNetWorkServiceProduct.shared().productCartListAddApi(productSearchModel: productSearchModel, completion: {
+            [weak self] (cartAmountModel) -> (Void) in
+            self?.searchResultView.tableView.reloadRows(at: [indexPath], with: UITableView.RowAnimation.none)
+            SwiftProgressHUD.shared().showText("已加入购物车")
+            self?.productGetCartCountApi()
+        })
+    }
 }

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/RegisterLoginModule/RegisterLogin/View/RegisterLoginView.swift

@@ -44,7 +44,7 @@ class RegisterLoginView: BaseView {
 
     private lazy var iconImageView: UIImageView = {
         let iconImageView = UIImageView()
-        iconImageView.image = kImage(name: "pic_preload")
+        iconImageView.image = kImage(name: "logo")
         return iconImageView
     }()
 

+ 11 - 1
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Category/View/CategorySearchView.swift

@@ -18,6 +18,17 @@ class CategorySearchView: BaseView {
     typealias SearchResultBlock = (_ keyWord:String) -> Void
     var searchResultBlock : SearchResultBlock?
     
+    var productCartCountModel : ProductCartCountModel? {
+        didSet {
+            
+            if productCartCountModel?.count == 0 {
+               shoppingCarButton.pp.hiddenBadge()
+            }else {
+                shoppingCarButton.pp.addBadge(number: productCartCountModel?.count ?? 0)
+            }
+        }
+    }
+    
     override func setupViews() {
         addSubview(shoppingCarButton)
         addSubview(searchbgView)
@@ -87,7 +98,6 @@ class CategorySearchView: BaseView {
                 shoppingCarBlock()
             }
         }).disposed(by: disposeBag)
-        shoppingCarButton.pp.addBadge(number: 5)
         //        shoppingCarButton.pp.setBadge(height: 14)
         //        shoppingCarButton.pp.badgeView.font = kRegularFont10
         shoppingCarButton.pp.badgeView.backgroundColor = kfe352bColor

+ 5 - 0
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Category/View/CategoryTableViewCell.swift

@@ -39,6 +39,11 @@ class CategoryTableViewCell: UITableViewCell {
         isHighlighted = selected
         titleLable.isHighlighted = selected
         h_Label.isHidden = !selected
+        if selected {
+            backgroundColor = UIColor.white
+        }else {
+            backgroundColor = UIColor.clear
+        }
     }
     
     //MRAK: - 设置View

+ 14 - 0
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Category/View/CategoryView.swift

@@ -44,9 +44,16 @@ class CategoryView: BaseView {
     typealias RightDidSelectRow = (_ indexPath: IndexPath) -> Void
     var rightDidSelectRow : RightDidSelectRow?
     
+    typealias AddCartClosure = (ProductSearchModel,IndexPath) -> Void
+    var addCartClosure : AddCartClosure?
+    
     override func setupViews() {
         addSubview(leftTableView)
         addSubview(rightTableView)
+        let emptyView =  EmptyView.shared.diyCustomEmptyViewStyle2(iconStr: "page04", titleStr: "当前暂无数据")
+        emptyView.contentViewY = kScaleValue(value: 182)
+        rightTableView.ly_emptyView = emptyView
+        rightTableView.ly_startLoading()
     }
     
     override func setupLayouts() {
@@ -117,6 +124,13 @@ extension CategoryView : UITableViewDataSource, UITableViewDelegate {
             } else {
                 let cell = ProductHSmallTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
                 cell.productSearchModel = productSearchModelArray![indexPath.row]
+                cell.plusClosure = {
+                    [weak self] (productSearchModel,indexPath) in
+                    
+                    if let addCartClosure = self?.addCartClosure {
+                        addCartClosure(productSearchModel!,indexPath!)
+                    }
+                }
                 return cell
             }
     }

+ 41 - 0
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Category/ViewController/CategoryViewController.swift

@@ -41,6 +41,9 @@ class CategoryViewController: BaseViewController {
     }
     
     override func setupData() {
+        
+        productGetCartCountApi()
+
         categorySearchView.searchbgView.rx.tap.subscribe(onNext: {
             [weak self] in
             let vc = SearchViewController()
@@ -49,6 +52,10 @@ class CategoryViewController: BaseViewController {
                 
             })
         }).disposed(by: disposeBag)
+        categorySearchView.shoppingCarBlock = {
+            [weak self] in
+            self?.tabBarController?.selectedIndex = 1
+        }
         
         categoryView.leftTableView.addHeaderWithHeader(withBeginRefresh: true, animation: false) {
             [weak self] (page) in
@@ -72,9 +79,20 @@ class CategoryViewController: BaseViewController {
             self?.productSearchApi(page: page)
         }
         
+        
         categoryView.rightDidSelectRow = {
              [weak self] indexPath in
+            let vc = ProductDetailViewController()
+            let productSearch = self?.productSearchModelArray[indexPath.row]
+            vc.productSearchModel = productSearch
+            self?.navigationController?.pushViewController(vc, animated: true)
+            
+        }
+        categoryView.addCartClosure = {
+            [weak self]  (productSearchModel,indexPath) in
+            self?.addCart(productSearchModel: productSearchModel, indexPath: indexPath)
         }
+        
     }
 
     private lazy var categorySearchView: CategorySearchView = {
@@ -129,4 +147,27 @@ class CategoryViewController: BaseViewController {
             }
         }
     }
+    
+    /// 获取购物车数量
+    func productGetCartCountApi() {
+        SwiftMoyaNetWorkServiceProduct.shared().productGetCartCountApi {
+            [weak self] (productCartCountModel) -> (Void) in
+            self?.categorySearchView.productCartCountModel = productCartCountModel as? ProductCartCountModel
+        }
+    }
+    
+    /// 添加购物车
+    ///
+    /// - Returns:
+    func addCart(productSearchModel:ProductSearchModel,indexPath:IndexPath) {
+        
+        
+        productSearchModel.isSelect = 1
+        SwiftMoyaNetWorkServiceProduct.shared().productCartListAddApi(productSearchModel: productSearchModel, completion: {
+            [weak self] (cartAmountModel) -> (Void) in
+            self?.categoryView.rightTableView.reloadRows(at: [indexPath], with: UITableView.RowAnimation.none)
+            SwiftProgressHUD.shared().showText("已加入购物车", view: (self?.categoryView.rightTableView)!, textAlignment: .center)
+            self?.productGetCartCountApi()
+        })
+    }
 }

RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/ProductDetailSkuView/ProductDetailHeader/ProductDetailFSPagerViewCell.swift → RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/ProductDetailHeader/ProductDetailFSPagerViewCell.swift


RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/ProductDetailSkuView/ProductDetailHeader/ProductDetailSectionHeader.swift → RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/ProductDetailHeader/ProductDetailSectionHeader.swift


RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/ProductDetailSkuView/ProductDetailHeader/ProductDetailTableViewHeaderView.swift → RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/ProductDetailHeader/ProductDetailTableViewHeaderView.swift


+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/ProductDetailView.swift

@@ -241,8 +241,8 @@ class ProductDetailView: BaseView {
             }else {
                 cartImageView.pp.addBadge(number: productCartCount)
             }
-            self.tableView.reloadData()
             self.view.hide()
+            self.tableView.reloadData()
         }
     }
     var productCartCountModel : ProductCartCountModel? {

+ 0 - 2
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/ViewController/ProductDetailViewController.swift

@@ -160,8 +160,6 @@ class ProductDetailViewController: BaseViewController {
                 self?.productDetailView.productSearchListModel = productSearchListModel
             }
         }
-        
-       
     }
     
     

+ 12 - 14
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/TableViewCell/ProductHBigTableViewCell.swift

@@ -7,20 +7,14 @@
 //
 
 import UIKit
+import RxSwift
 
 class ProductHBigTableViewCell: UITableViewCell {
     
-    override var frame: CGRect {
-        get {
-            return super.frame
-        }
-        set {
-            var frame = newValue
-            frame.origin.x += 14
-            frame.size.width -= 2 * 14
-            super.frame = frame
-        }
-    }
+    let disposeBag = DisposeBag()
+    
+    typealias PlusClosure = (_ productSearchModel: ProductSearchModel?,_ indexPath:IndexPath?) -> Void
+    var plusClosure : PlusClosure?
     
     class func cellWith(tableView:UITableView,indexPath:IndexPath) -> ProductHBigTableViewCell {
         let ID = "ProductHBigTableViewCell"
@@ -136,15 +130,18 @@ class ProductHBigTableViewCell: UITableViewCell {
     private lazy var markPriceLabel: UILabel = {
         let markPriceLabel = UILabel()
         markPriceLabel.font = kScaleRegularFont13
-        let attributeString = NSMutableAttributedString(string:"¥24.4")
-        attributeString.changeStrikethrough(atAllStyle: NSUnderlineStyle(rawValue: NSUnderlineStyle.single.rawValue), color: kbbbbbbColor)
-        markPriceLabel.attributedText = attributeString
         return markPriceLabel
     }()
     
     private lazy var plusButton: UIButton = {
         let plusButton = UIButton(type: UIButton.ButtonType.custom)
         plusButton.setImage(kImage(name: "shopping_mall_plus"), for: UIControl.State.normal)
+        plusButton.rx.tap.subscribe(onNext: {
+            [weak self] (data) in
+            if let plusClosure = self?.plusClosure {
+                plusClosure(self?.productSearchModel, self?.indexPath)
+            }
+        }).disposed(by: disposeBag)
         return plusButton
     }()
     
@@ -157,6 +154,7 @@ class ProductHBigTableViewCell: UITableViewCell {
             sellPriceLabel.text = "¥\(productSearchModel?.price ?? 0)"
             let attributeString = NSMutableAttributedString(string:"¥\(productSearchModel?.originPrice ?? 0)")
             attributeString.changeStrikethrough(atAllStyle: NSUnderlineStyle.single, color: kbbbbbbColor)
+            markPriceLabel.textColor = kbbbbbbColor
             markPriceLabel.attributedText = attributeString
 
         }

+ 12 - 0
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/TableViewCell/ProductHSmallTableViewCell.swift

@@ -7,8 +7,14 @@
 //
 
 import UIKit
+import RxSwift
 
 class ProductHSmallTableViewCell: UITableViewCell {
+    
+    let disposeBag = DisposeBag()
+    
+    typealias PlusClosure = (_ productSearchModel: ProductSearchModel?,_ indexPath:IndexPath?) -> Void
+    var plusClosure : PlusClosure?
 
     class func cellWith(tableView:UITableView,indexPath:IndexPath) -> ProductHSmallTableViewCell {
         let ID = "ProductHSmallTableViewCell"
@@ -136,6 +142,12 @@ class ProductHSmallTableViewCell: UITableViewCell {
     private lazy var plusButton: UIButton = {
         let plusButton = UIButton(type: UIButton.ButtonType.custom)
         plusButton.setImage(kImage(name: "shopping_mall_plus"), for: UIControl.State.normal)
+        plusButton.rx.tap.subscribe(onNext: {
+            [weak self] (data) in
+            if let plusClosure = self?.plusClosure {
+                plusClosure(self?.productSearchModel, self?.indexPath)
+            }
+        }).disposed(by: disposeBag)
         return plusButton
     }()
     

+ 5 - 0
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/ShoppingMallFloor/FloorCell/ShoppingMallSlidingLeftRight/ShoppingMallSlidingLeftRightBgCollectionViewCell.swift

@@ -115,6 +115,11 @@ extension ShoppingMallSlidingLeftRightBgCollectionViewCell: UICollectionViewDele
         
     }
     
+    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
+        let productModel = productModels?[indexPath.section]
+        NotificationCenter.default.post(name: NSNotification.Name(rawValue: "ProductDetailVC"), object: productModel)
+    }
+    
     func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
         return CGSize(width:120, height: 180)
     }

+ 5 - 5
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/ViewController/ShoppingMallViewController.swift

@@ -59,12 +59,12 @@ class ShoppingMallViewController: BaseViewController {
         //分类
         navigationBarView.categoryButton.rx.tap.subscribe(onNext: {
             [weak self] in
-//            let vc = CategoryViewController()
-//            vc.navigationBar.title = "团购分类"
-//            self?.navigationController?.pushViewController(vc, animated: true)
-            let vc = SpecialViewController()
-            vc.navigationBar.title = "专题页面"
+            let vc = CategoryViewController()
+            vc.navigationBar.title = "团购分类"
             self?.navigationController?.pushViewController(vc, animated: true)
+//            let vc = SpecialViewController()
+//            vc.navigationBar.title = "专题页面"
+//            self?.navigationController?.pushViewController(vc, animated: true)
         }).disposed(by: disposeBag)
         
         shoppingMallView.scrollView.addHeaderWithHeader(withBeginRefresh: true, animation: false) { (page) in

+ 0 - 1
RainbowPlanet/RainbowPlanet/Service/Model/ProductModel/ProductDetailModel.swift

@@ -117,7 +117,6 @@ class ProductDetailLabelModel : NSObject, Mappable{
     
 }
 
-
 /// 参数模型
 class ProductDetailParameterModel : NSObject, Mappable{
     

+ 2 - 2
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceProduct/SwiftMoyaNetWorkServiceProduct.swift

@@ -207,7 +207,7 @@ class SwiftMoyaNetWorkServiceProduct: NSObject {
         parameters.updateValue(productMdl.id ?? 0, forKey: "product_id")
         parameters.updateValue(productMdl.price ?? 0, forKey: "product_price")
         parameters.updateValue(productMdl.skuId ?? 0, forKey: "sku_id")
-        parameters.updateValue(productMdl.totalCount ?? 0, forKey: "amount")
+        parameters.updateValue(1, forKey: "amount")
         parameters.updateValue(productMdl.isSelect ?? 0, forKey: "is_select")
         parameters.updateValue(productMdl.name ?? "", forKey: "product_name")
         parameters.updateValue(productMdl.img  ?? "", forKey: "product_img")
@@ -245,7 +245,7 @@ class SwiftMoyaNetWorkServiceProduct: NSObject {
         parameters.updateValue(productSearchModel.id ?? "", forKey: "product_id")
         parameters.updateValue(productSearchModel.price ?? "", forKey: "product_price")
         parameters.updateValue(productSearchModel.skuId ?? "", forKey: "sku_id")
-        parameters.updateValue(productSearchModel.totalCount ?? "", forKey: "amount")
+        parameters.updateValue(1, forKey: "amount")
         parameters.updateValue(productSearchModel.isSelect ?? 1, forKey: "is_select")
         parameters.updateValue(productSearchModel.name ?? "", forKey: "product_name")
         parameters.updateValue(productSearchModel.img  ?? "", forKey: "product_img")