Commit 371cf85785ae615671aed04dd37013f2484ed4be
1 parent
7f88fdd5
新增商品-保存
Showing
3 changed files
with
11 additions
and
12 deletions
metaCode/Classes/Main/HomePage/Controller/GoodsManager/CNLiveGoodsCategoryController.swift
metaCode/Classes/Main/HomePage/Controller/GoodsManager/CNLiveShopNewProductController.swift
| ... | ... | @@ -377,7 +377,7 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ |
| 377 | 377 | let goodsDetailsModel = CNLiveShopGoodsDetailsModel() |
| 378 | 378 | let bannerImage = NSMutableArray() |
| 379 | 379 | for imageUrl in bannersSelectImageUrls { |
| 380 | - let model = CNLiveShopGoodsDetailsModel() | |
| 380 | + let model = CNLiveGoodsDetailsImageModel() | |
| 381 | 381 | model.simg = imageUrl |
| 382 | 382 | bannerImage.add(model) |
| 383 | 383 | } |
| ... | ... | @@ -542,19 +542,19 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ |
| 542 | 542 | showMessage(message: "请输入发货时效") |
| 543 | 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 | 551 | tempArray.subarray(with: NSRange(location: 0, length: tempArray.index(of: singleView21))) |
| 552 | 552 | if tempArray.count > 2{ |
| 553 | 553 | for singleView in tempArray { |
| 554 | 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 | 572 | } |
| 573 | 573 | |
| 574 | 574 | for sub in kvArray{ |
| 575 | - let subDict = sub as! NSDictionary | |
| 575 | + let subDict = sub as NSDictionary | |
| 576 | 576 | if self.stringContainsEmoji(string: subDict.object(forKey: "k") as! String){ |
| 577 | 577 | showMessage(message: "规格参数不能添加表情") |
| 578 | 578 | return | ... | ... |
metaCode/Classes/Main/HomePage/ViewModel/GoodsManager/CNLiveShopGoodListViewModel.swift
| ... | ... | @@ -252,7 +252,7 @@ class CNLiveShopGoodListViewModel:NSObject{ |
| 252 | 252 | let respArr = resp["list"] as! NSArray |
| 253 | 253 | for dic in respArr{ |
| 254 | 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 | 256 | dataArr.append(cateListModel) |
| 257 | 257 | } |
| 258 | 258 | resultBlock(dataArr,.success) | ... | ... |