Commit 371cf85785ae615671aed04dd37013f2484ed4be

Authored by 张旭
1 parent 7f88fdd5

新增商品-保存

metaCode/Classes/Main/HomePage/Controller/GoodsManager/CNLiveGoodsCategoryController.swift
@@ -483,7 +483,6 @@ class CNLiveGoodsCategoryController: CNLiveBaseViewController, UITableViewDataSo @@ -483,7 +483,6 @@ class CNLiveGoodsCategoryController: CNLiveBaseViewController, UITableViewDataSo
483 self.navigationController?.pushViewController(vc, animated: false) 483 self.navigationController?.pushViewController(vc, animated: false)
484 } 484 }
485 485
486 -  
487 // MARK: - 数据请求 486 // MARK: - 数据请求
488 /** 487 /**
489 商品分类数据请求 488 商品分类数据请求
metaCode/Classes/Main/HomePage/Controller/GoodsManager/CNLiveShopNewProductController.swift
@@ -377,7 +377,7 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ @@ -377,7 +377,7 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{
377 let goodsDetailsModel = CNLiveShopGoodsDetailsModel() 377 let goodsDetailsModel = CNLiveShopGoodsDetailsModel()
378 let bannerImage = NSMutableArray() 378 let bannerImage = NSMutableArray()
379 for imageUrl in bannersSelectImageUrls { 379 for imageUrl in bannersSelectImageUrls {
380 - let model = CNLiveShopGoodsDetailsModel() 380 + let model = CNLiveGoodsDetailsImageModel()
381 model.simg = imageUrl 381 model.simg = imageUrl
382 bannerImage.add(model) 382 bannerImage.add(model)
383 } 383 }
@@ -542,19 +542,19 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ @@ -542,19 +542,19 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{
542 showMessage(message: "请输入发货时效") 542 showMessage(message: "请输入发货时效")
543 return 543 return
544 } 544 }
545 - let kvArray = NSMutableArray()  
546 - kvArray.add(["k":"品名","v":singleView18.contentTextField.text])  
547 - kvArray.add(["k":"规格","v":singleView19.contentTextField.text])  
548 - kvArray.add(["k":"寄送区域","v":singleView20.contentTextView.text])  
549 - kvArray.add(["k":"发货时效","v":singleView21.contentTextField.text])  
550 - var tempArray = NSMutableArray(array: self.bgScrollView.subviews) 545 + var kvArray = Array<Dictionary<String, String>>()// NSMutableArray()
  546 + kvArray.append(["k":"品名","v":singleView18.contentTextField.text!])
  547 + kvArray.append(["k":"规格","v":singleView19.contentTextField.text!])
  548 + kvArray.append(["k":"寄送区域","v":singleView20.contentTextView.text!])
  549 + kvArray.append(["k":"发货时效","v":singleView21.contentTextField.text!])
  550 + let tempArray = NSMutableArray(array: self.bgScrollView.subviews)
551 tempArray.subarray(with: NSRange(location: 0, length: tempArray.index(of: singleView21))) 551 tempArray.subarray(with: NSRange(location: 0, length: tempArray.index(of: singleView21)))
552 if tempArray.count > 2{ 552 if tempArray.count > 2{
553 for singleView in tempArray { 553 for singleView in tempArray {
554 if (singleView as AnyObject).isKind(of: CNLiveShopAddGoodsSingleView.self){ 554 if (singleView as AnyObject).isKind(of: CNLiveShopAddGoodsSingleView.self){
555 555
556 - if (singleView as! CNLiveShopAddGoodsSingleView).contentTextField.text?.count ?? 0 > 0 && !kvArray.contains(["k":(singleView as! CNLiveShopAddGoodsSingleView).addEditGoodsListModel?.title,"v":(singleView as! CNLiveShopAddGoodsSingleView).contentTextField.text]){  
557 - kvArray.add(["k":(singleView as! CNLiveShopAddGoodsSingleView).addEditGoodsListModel?.title,"v":(singleView as! CNLiveShopAddGoodsSingleView).contentTextField.text]) 556 + if (singleView as! CNLiveShopAddGoodsSingleView).contentTextField.text?.count ?? 0 > 0 && !kvArray.contains(["k":(singleView as! CNLiveShopAddGoodsSingleView).addEditGoodsListModel?.title ?? "","v":(singleView as! CNLiveShopAddGoodsSingleView).contentTextField.text!]){
  557 + kvArray.append(["k":(singleView as! CNLiveShopAddGoodsSingleView).addEditGoodsListModel?.title ?? "","v":(singleView as! CNLiveShopAddGoodsSingleView).contentTextField.text!])
558 } 558 }
559 } 559 }
560 } 560 }
@@ -572,7 +572,7 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ @@ -572,7 +572,7 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{
572 } 572 }
573 573
574 for sub in kvArray{ 574 for sub in kvArray{
575 - let subDict = sub as! NSDictionary 575 + let subDict = sub as NSDictionary
576 if self.stringContainsEmoji(string: subDict.object(forKey: "k") as! String){ 576 if self.stringContainsEmoji(string: subDict.object(forKey: "k") as! String){
577 showMessage(message: "规格参数不能添加表情") 577 showMessage(message: "规格参数不能添加表情")
578 return 578 return
metaCode/Classes/Main/HomePage/ViewModel/GoodsManager/CNLiveShopGoodListViewModel.swift
@@ -252,7 +252,7 @@ class CNLiveShopGoodListViewModel:NSObject{ @@ -252,7 +252,7 @@ class CNLiveShopGoodListViewModel:NSObject{
252 let respArr = resp["list"] as! NSArray 252 let respArr = resp["list"] as! NSArray
253 for dic in respArr{ 253 for dic in respArr{
254 let dataDic = dic as! NSDictionary 254 let dataDic = dic as! NSDictionary
255 - let cateListModel = newDictionaryToModel(dataDic as! [String : Any], CNLiveShopGoodsManageDetailsGoodsCategoryModel.self) 255 + let cateListModel = newDictionaryToModel(dataDic as! [String : Any], CNLiveShopClassifyModel.self)
256 dataArr.append(cateListModel) 256 dataArr.append(cateListModel)
257 } 257 }
258 resultBlock(dataArr,.success) 258 resultBlock(dataArr,.success)