Commit e7d9e1173942047c0f2d750ef50c7fef3604aa1e
1 parent
dedcbc4f
修改部分UIbug
Showing
6 changed files
with
78 additions
and
77 deletions
metaCode/Classes/Main/HomePage/Controller/GoodsManager/CNLiveCreateShopClassifyViewController.swift
| @@ -31,7 +31,7 @@ class CNLiveCreateShopClassifyViewController:CNLiveBaseViewController, UITableVi | @@ -31,7 +31,7 @@ class CNLiveCreateShopClassifyViewController:CNLiveBaseViewController, UITableVi | ||
| 31 | let kCNLiveShopClassilyIconTableViewCellID = "kCNLiveShopClassilyIconTableViewCellID" | 31 | let kCNLiveShopClassilyIconTableViewCellID = "kCNLiveShopClassilyIconTableViewCellID" |
| 32 | 32 | ||
| 33 | /// 编辑状态 | 33 | /// 编辑状态 |
| 34 | - var isEdite:Bool? | 34 | + var isEdite:Bool = false |
| 35 | /// 编辑的数据 | 35 | /// 编辑的数据 |
| 36 | var shopClassifyModel:CNLiveShopClassifyModel? | 36 | var shopClassifyModel:CNLiveShopClassifyModel? |
| 37 | /// 表 | 37 | /// 表 |
| @@ -150,7 +150,7 @@ class CNLiveCreateShopClassifyViewController:CNLiveBaseViewController, UITableVi | @@ -150,7 +150,7 @@ class CNLiveCreateShopClassifyViewController:CNLiveBaseViewController, UITableVi | ||
| 150 | return cell | 150 | return cell |
| 151 | } | 151 | } |
| 152 | self.titleField = cell.textFiled | 152 | self.titleField = cell.textFiled |
| 153 | - if self.isEdite!{ | 153 | + if self.isEdite == true{ |
| 154 | cell.textFiled.text = self.shopClassifyModel?.title | 154 | cell.textFiled.text = self.shopClassifyModel?.title |
| 155 | } | 155 | } |
| 156 | return cell | 156 | return cell |
| @@ -164,7 +164,7 @@ class CNLiveCreateShopClassifyViewController:CNLiveBaseViewController, UITableVi | @@ -164,7 +164,7 @@ class CNLiveCreateShopClassifyViewController:CNLiveBaseViewController, UITableVi | ||
| 164 | cell.uploadImageSuceessBlock = {imageUrl in | 164 | cell.uploadImageSuceessBlock = {imageUrl in |
| 165 | self.shopClassifyModel?.simg = imageUrl | 165 | self.shopClassifyModel?.simg = imageUrl |
| 166 | } | 166 | } |
| 167 | - if self.isEdite!{ | 167 | + if self.isEdite{ |
| 168 | if self.shopClassifyModel?.simg?.count ?? 0 > 0{ | 168 | if self.shopClassifyModel?.simg?.count ?? 0 > 0{ |
| 169 | cell.selectUploadImageView?.networkImageArr = [self.shopClassifyModel?.simg ?? ""] | 169 | cell.selectUploadImageView?.networkImageArr = [self.shopClassifyModel?.simg ?? ""] |
| 170 | } | 170 | } |
metaCode/Classes/Main/HomePage/Controller/GoodsManager/CNLiveGoodsCategoryController.swift
| @@ -25,9 +25,9 @@ class CNLiveGoodsCategoryController: CNLiveBaseViewController, UITableViewDataSo | @@ -25,9 +25,9 @@ class CNLiveGoodsCategoryController: CNLiveBaseViewController, UITableViewDataSo | ||
| 25 | 25 | ||
| 26 | // MARK: - 属性 | 26 | // MARK: - 属性 |
| 27 | //开始输入前的文本 | 27 | //开始输入前的文本 |
| 28 | - var firCategoryId:String? | ||
| 29 | - var secCategoryId:String? | ||
| 30 | - var thiCategoryId:String? | 28 | + var firCategoryId:Int = 0 |
| 29 | + var secCategoryId:Int = 0 | ||
| 30 | + var thiCategoryId:Int = 0 | ||
| 31 | var firCategoryName:String? | 31 | var firCategoryName:String? |
| 32 | var secCategoryName:String? | 32 | var secCategoryName:String? |
| 33 | var thiCategoryName:String? | 33 | var thiCategoryName:String? |
| @@ -116,7 +116,7 @@ class CNLiveGoodsCategoryController: CNLiveBaseViewController, UITableViewDataSo | @@ -116,7 +116,7 @@ class CNLiveGoodsCategoryController: CNLiveBaseViewController, UITableViewDataSo | ||
| 116 | }else{ | 116 | }else{ |
| 117 | return | 117 | return |
| 118 | } | 118 | } |
| 119 | - if (_temp_selectFirCategoryModel?.id!.count)! > 0{ | 119 | + if _temp_selectFirCategoryModel?.id ?? 0 > 0{ |
| 120 | self.firCategoryBtn?.setTitle(_temp_selectFirCategoryModel?.title, for: .normal) | 120 | self.firCategoryBtn?.setTitle(_temp_selectFirCategoryModel?.title, for: .normal) |
| 121 | }else{ | 121 | }else{ |
| 122 | self.firCategoryBtn?.setTitle("请选择", for: .normal) | 122 | self.firCategoryBtn?.setTitle("请选择", for: .normal) |
| @@ -135,7 +135,7 @@ class CNLiveGoodsCategoryController: CNLiveBaseViewController, UITableViewDataSo | @@ -135,7 +135,7 @@ class CNLiveGoodsCategoryController: CNLiveBaseViewController, UITableViewDataSo | ||
| 135 | }else{ | 135 | }else{ |
| 136 | return | 136 | return |
| 137 | } | 137 | } |
| 138 | - if (_temp_selectSecCategoryModel?.id?.count)! > 0{ | 138 | + if _temp_selectSecCategoryModel?.id ?? 0 > 0{ |
| 139 | self.secCategoryBtn?.setTitle(_temp_selectSecCategoryModel?.title, for: .normal) | 139 | self.secCategoryBtn?.setTitle(_temp_selectSecCategoryModel?.title, for: .normal) |
| 140 | self.secCategoryBtn?.setTitleColor(HexColor("#333333"), for: .normal) | 140 | self.secCategoryBtn?.setTitleColor(HexColor("#333333"), for: .normal) |
| 141 | }else{ | 141 | }else{ |
| @@ -160,7 +160,7 @@ class CNLiveGoodsCategoryController: CNLiveBaseViewController, UITableViewDataSo | @@ -160,7 +160,7 @@ class CNLiveGoodsCategoryController: CNLiveBaseViewController, UITableViewDataSo | ||
| 160 | }else{ | 160 | }else{ |
| 161 | return | 161 | return |
| 162 | } | 162 | } |
| 163 | - if _temp_selectThiCategoryModel!.id!.count > 0{ | 163 | + if _temp_selectThiCategoryModel!.id > 0{ |
| 164 | self.thiCategoryBtn?.setTitle(_temp_selectThiCategoryModel?.title, for: .normal) | 164 | self.thiCategoryBtn?.setTitle(_temp_selectThiCategoryModel?.title, for: .normal) |
| 165 | self.thiCategoryBtn?.setTitleColor(HexColor("#333333"), for: .normal) | 165 | self.thiCategoryBtn?.setTitleColor(HexColor("#333333"), for: .normal) |
| 166 | }else{ | 166 | }else{ |
| @@ -180,18 +180,18 @@ class CNLiveGoodsCategoryController: CNLiveBaseViewController, UITableViewDataSo | @@ -180,18 +180,18 @@ class CNLiveGoodsCategoryController: CNLiveBaseViewController, UITableViewDataSo | ||
| 180 | self.view.backgroundColor = .clear | 180 | self.view.backgroundColor = .clear |
| 181 | self.topNavView.removeFromSuperview() | 181 | self.topNavView.removeFromSuperview() |
| 182 | self.initUI() | 182 | self.initUI() |
| 183 | - if self.firCategoryId == "0" || self.firCategoryId?.count == 0{ | ||
| 184 | - self.secCategoryId = "0" | ||
| 185 | - self.thiCategoryId = "0" | ||
| 186 | - }else if self.secCategoryId == "0" || self.secCategoryId?.count == 0{ | ||
| 187 | - self.thiCategoryId = "0" | 183 | + if self.firCategoryId == 0{ |
| 184 | + self.secCategoryId = 0 | ||
| 185 | + self.thiCategoryId = 0 | ||
| 186 | + }else if self.secCategoryId == 0 || self.secCategoryId == 0{ | ||
| 187 | + self.thiCategoryId = 0 | ||
| 188 | } | 188 | } |
| 189 | if self.categoryType == .goods{ | 189 | if self.categoryType == .goods{ |
| 190 | self.postDataWithPid(pid: "0", level: 1) { | 190 | self.postDataWithPid(pid: "0", level: 1) { |
| 191 | - if self.secCategoryId?.count ?? 0 > 0 && self.secCategoryId != "0"{ | ||
| 192 | - self.postDataWithPid(pid: self.firCategoryId ?? "", level: 2) { | ||
| 193 | - if self.thiCategoryId?.count ?? 0 > 0 && self.thiCategoryId != "0"{ | ||
| 194 | - self.postDataWithPid(pid: self.secCategoryId ?? "", level: 3) { | 191 | + if self.secCategoryId > 0{ |
| 192 | + self.postDataWithPid(pid:String(format: "%d", self.firCategoryId), level: 2) { | ||
| 193 | + if self.thiCategoryId > 0{ | ||
| 194 | + self.postDataWithPid(pid:String(format: "%d",self.secCategoryId), level: 3) { | ||
| 195 | } | 195 | } |
| 196 | } | 196 | } |
| 197 | } | 197 | } |
| @@ -353,14 +353,14 @@ class CNLiveGoodsCategoryController: CNLiveBaseViewController, UITableViewDataSo | @@ -353,14 +353,14 @@ class CNLiveGoodsCategoryController: CNLiveBaseViewController, UITableViewDataSo | ||
| 353 | if self.categoryType == .goods{ | 353 | if self.categoryType == .goods{ |
| 354 | if self.displayLevel == 1{ | 354 | if self.displayLevel == 1{ |
| 355 | let model = self.firCategoryDataArr[indexPath.row] as! CNLiveShopGoodsManageDetailsGoodsCategoryModel | 355 | let model = self.firCategoryDataArr[indexPath.row] as! CNLiveShopGoodsManageDetailsGoodsCategoryModel |
| 356 | - self.postDataWithPid(pid: model.id!, level: 2) { | 356 | + self.postDataWithPid(pid: String(format: "%d", model.id), level: 2) { |
| 357 | self.temp_selectFirCategoryModel = model | 357 | self.temp_selectFirCategoryModel = model |
| 358 | self.temp_selectSecCategoryModel = nil | 358 | self.temp_selectSecCategoryModel = nil |
| 359 | self.temp_selectThiCategoryModel = nil | 359 | self.temp_selectThiCategoryModel = nil |
| 360 | } | 360 | } |
| 361 | }else if (self.displayLevel == 2) { | 361 | }else if (self.displayLevel == 2) { |
| 362 | let model = self.secCategoryDataArr[indexPath.row] as! CNLiveShopGoodsManageDetailsGoodsCategoryModel | 362 | let model = self.secCategoryDataArr[indexPath.row] as! CNLiveShopGoodsManageDetailsGoodsCategoryModel |
| 363 | - self.postDataWithPid(pid: model.id!, level: 3) { | 363 | + self.postDataWithPid(pid: String(format: "%d", model.id), level: 3) { |
| 364 | self.temp_selectSecCategoryModel = model | 364 | self.temp_selectSecCategoryModel = model |
| 365 | self.temp_selectThiCategoryModel = nil | 365 | self.temp_selectThiCategoryModel = nil |
| 366 | } | 366 | } |
| @@ -373,7 +373,7 @@ class CNLiveGoodsCategoryController: CNLiveBaseViewController, UITableViewDataSo | @@ -373,7 +373,7 @@ class CNLiveGoodsCategoryController: CNLiveBaseViewController, UITableViewDataSo | ||
| 373 | if (self.displayLevel == 1) { | 373 | if (self.displayLevel == 1) { |
| 374 | let model = self.firCategoryDataArr[indexPath.row] as! CNLiveShopClassifyModel | 374 | let model = self.firCategoryDataArr[indexPath.row] as! CNLiveShopClassifyModel |
| 375 | let tempFirMdl = CNLiveShopGoodsManageDetailsGoodsCategoryModel() | 375 | let tempFirMdl = CNLiveShopGoodsManageDetailsGoodsCategoryModel() |
| 376 | - tempFirMdl.id = model.id | 376 | + tempFirMdl.id = Int(model.id ?? "0")! |
| 377 | tempFirMdl.title = model.title | 377 | tempFirMdl.title = model.title |
| 378 | self.temp_selectFirCategoryModel = tempFirMdl | 378 | self.temp_selectFirCategoryModel = tempFirMdl |
| 379 | self.temp_selectSecCategoryModel = nil | 379 | self.temp_selectSecCategoryModel = nil |
| @@ -387,7 +387,7 @@ class CNLiveGoodsCategoryController: CNLiveBaseViewController, UITableViewDataSo | @@ -387,7 +387,7 @@ class CNLiveGoodsCategoryController: CNLiveBaseViewController, UITableViewDataSo | ||
| 387 | }else if (self.displayLevel == 2){ | 387 | }else if (self.displayLevel == 2){ |
| 388 | let model = self.secCategoryDataArr[indexPath.row] as! CNLiveShopClassifyModel | 388 | let model = self.secCategoryDataArr[indexPath.row] as! CNLiveShopClassifyModel |
| 389 | let tempFirMdl = CNLiveShopGoodsManageDetailsGoodsCategoryModel() | 389 | let tempFirMdl = CNLiveShopGoodsManageDetailsGoodsCategoryModel() |
| 390 | - tempFirMdl.id = model.id | 390 | + tempFirMdl.id = Int(model.id ?? "0")! |
| 391 | tempFirMdl.title = model.title | 391 | tempFirMdl.title = model.title |
| 392 | self.temp_selectSecCategoryModel = tempFirMdl | 392 | self.temp_selectSecCategoryModel = tempFirMdl |
| 393 | self.tableView.reloadData() | 393 | self.tableView.reloadData() |
| @@ -420,11 +420,11 @@ class CNLiveGoodsCategoryController: CNLiveBaseViewController, UITableViewDataSo | @@ -420,11 +420,11 @@ class CNLiveGoodsCategoryController: CNLiveBaseViewController, UITableViewDataSo | ||
| 420 | } | 420 | } |
| 421 | } | 421 | } |
| 422 | 422 | ||
| 423 | - self.firCategoryId = self.temp_selectFirCategoryModel?.id | 423 | + self.firCategoryId = self.temp_selectFirCategoryModel?.id ?? 0 |
| 424 | self.firCategoryName = self.temp_selectFirCategoryModel?.title | 424 | self.firCategoryName = self.temp_selectFirCategoryModel?.title |
| 425 | - self.secCategoryId = self.temp_selectSecCategoryModel?.id | 425 | + self.secCategoryId = self.temp_selectSecCategoryModel?.id ?? 0 |
| 426 | self.secCategoryName = self.temp_selectSecCategoryModel?.title | 426 | self.secCategoryName = self.temp_selectSecCategoryModel?.title |
| 427 | - self.thiCategoryId = self.temp_selectThiCategoryModel?.id | 427 | + self.thiCategoryId = self.temp_selectThiCategoryModel?.id ?? 0 |
| 428 | self.thiCategoryName = self.temp_selectThiCategoryModel?.title | 428 | self.thiCategoryName = self.temp_selectThiCategoryModel?.title |
| 429 | self.finishBlock!() | 429 | self.finishBlock!() |
| 430 | self.hide() | 430 | self.hide() |
| @@ -509,7 +509,7 @@ class CNLiveGoodsCategoryController: CNLiveBaseViewController, UITableViewDataSo | @@ -509,7 +509,7 @@ class CNLiveGoodsCategoryController: CNLiveBaseViewController, UITableViewDataSo | ||
| 509 | self.temp_selectThiCategoryModel = nil | 509 | self.temp_selectThiCategoryModel = nil |
| 510 | self.secCategoryDataArr.removeAllObjects() | 510 | self.secCategoryDataArr.removeAllObjects() |
| 511 | self.thiCategoryDataArr.removeAllObjects() | 511 | self.thiCategoryDataArr.removeAllObjects() |
| 512 | - if self.firCategoryId?.count ?? 0 > 0 && self.firCategoryId != "0"{ | 512 | + if self.firCategoryId > 0{ |
| 513 | 513 | ||
| 514 | let tempDataArr = Array(self.firCategoryDataArr) | 514 | let tempDataArr = Array(self.firCategoryDataArr) |
| 515 | for (_,mdl) in tempDataArr.enumerated() { | 515 | for (_,mdl) in tempDataArr.enumerated() { |
| @@ -525,7 +525,7 @@ class CNLiveGoodsCategoryController: CNLiveBaseViewController, UITableViewDataSo | @@ -525,7 +525,7 @@ class CNLiveGoodsCategoryController: CNLiveBaseViewController, UITableViewDataSo | ||
| 525 | self.temp_selectSecCategoryModel = nil | 525 | self.temp_selectSecCategoryModel = nil |
| 526 | self.temp_selectThiCategoryModel = nil | 526 | self.temp_selectThiCategoryModel = nil |
| 527 | self.thiCategoryDataArr.removeAllObjects() | 527 | self.thiCategoryDataArr.removeAllObjects() |
| 528 | - if self.secCategoryId?.count ?? 0 > 0 && self.secCategoryId != "0"{ | 528 | + if self.secCategoryId > 0{ |
| 529 | let tempDataArr = Array(self.thiCategoryDataArr) | 529 | let tempDataArr = Array(self.thiCategoryDataArr) |
| 530 | for (_,mdl) in tempDataArr.enumerated() { | 530 | for (_,mdl) in tempDataArr.enumerated() { |
| 531 | let model = mdl as! CNLiveShopGoodsManageDetailsGoodsCategoryModel | 531 | let model = mdl as! CNLiveShopGoodsManageDetailsGoodsCategoryModel |
| @@ -540,7 +540,7 @@ class CNLiveGoodsCategoryController: CNLiveBaseViewController, UITableViewDataSo | @@ -540,7 +540,7 @@ class CNLiveGoodsCategoryController: CNLiveBaseViewController, UITableViewDataSo | ||
| 540 | }else if (level == 3) { | 540 | }else if (level == 3) { |
| 541 | self.thiCategoryDataArr = NSMutableArray(array: dataArr) | 541 | self.thiCategoryDataArr = NSMutableArray(array: dataArr) |
| 542 | self.temp_selectThiCategoryModel = nil | 542 | self.temp_selectThiCategoryModel = nil |
| 543 | - if self.thiCategoryId?.count ?? 0 > 0 && self.thiCategoryId != "0"{ | 543 | + if self.thiCategoryId > 0{ |
| 544 | let tempDataArr = Array(self.thiCategoryDataArr) | 544 | let tempDataArr = Array(self.thiCategoryDataArr) |
| 545 | for (_,mdl) in tempDataArr.enumerated() { | 545 | for (_,mdl) in tempDataArr.enumerated() { |
| 546 | let model = mdl as! CNLiveShopGoodsManageDetailsGoodsCategoryModel | 546 | let model = mdl as! CNLiveShopGoodsManageDetailsGoodsCategoryModel |
metaCode/Classes/Main/HomePage/Controller/GoodsManager/CNLiveShopNewProductController.swift
| @@ -280,6 +280,7 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | @@ -280,6 +280,7 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | ||
| 280 | self.addChild(vc) | 280 | self.addChild(vc) |
| 281 | vc.view.frame = CGRect(x: 0, y: 0, width: self.view.width, height: self.view.height) | 281 | vc.view.frame = CGRect(x: 0, y: 0, width: self.view.width, height: self.view.height) |
| 282 | vc.didMove(toParent: self) | 282 | vc.didMove(toParent: self) |
| 283 | + self.view.addSubview(vc.view) | ||
| 283 | self.selectCategoryVC = vc | 284 | self.selectCategoryVC = vc |
| 284 | } | 285 | } |
| 285 | self.selectCategoryVC?.display() | 286 | self.selectCategoryVC?.display() |
| @@ -369,13 +370,13 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | @@ -369,13 +370,13 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | ||
| 369 | showMessage(message: "请选择商品详情图") | 370 | showMessage(message: "请选择商品详情图") |
| 370 | return | 371 | return |
| 371 | } | 372 | } |
| 372 | - else if (self.selectShopClassifyVC.firCategoryId!.count == 0) { | 373 | + else if (self.selectShopClassifyVC.firCategoryId == 0) { |
| 373 | showMessage(message: "请选择店铺分类") | 374 | showMessage(message: "请选择店铺分类") |
| 374 | return | 375 | return |
| 375 | } | 376 | } |
| 376 | 377 | ||
| 377 | let goodsDetailsModel = CNLiveShopGoodsDetailsModel() | 378 | let goodsDetailsModel = CNLiveShopGoodsDetailsModel() |
| 378 | - var bannerImage = NSMutableArray() | 379 | + let bannerImage = NSMutableArray() |
| 379 | for imageUrl in bannersSelectImageUrls { | 380 | for imageUrl in bannersSelectImageUrls { |
| 380 | let model = CNLiveShopGoodsDetailsModel() | 381 | let model = CNLiveShopGoodsDetailsModel() |
| 381 | model.simg = imageUrl | 382 | model.simg = imageUrl |
| @@ -396,19 +397,19 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | @@ -396,19 +397,19 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | ||
| 396 | goodsDetailsModel.prices = singleView8.contentTextField.text | 397 | goodsDetailsModel.prices = singleView8.contentTextField.text |
| 397 | goodsDetailsModel.category_id = self.selectShopClassifyVC.firCategoryId | 398 | goodsDetailsModel.category_id = self.selectShopClassifyVC.firCategoryId |
| 398 | goodsDetailsModel.category_id2 = self.selectShopClassifyVC.secCategoryId | 399 | goodsDetailsModel.category_id2 = self.selectShopClassifyVC.secCategoryId |
| 399 | - var contentDetailsImage = NSMutableArray() | 400 | + let contentDetailsImage = NSMutableArray() |
| 400 | for imageUrl in contentDetailsSelectImageUrls{ | 401 | for imageUrl in contentDetailsSelectImageUrls{ |
| 401 | let model = CNLiveGoodsDetailsContentModel() | 402 | let model = CNLiveGoodsDetailsContentModel() |
| 402 | model.simg = imageUrl | 403 | model.simg = imageUrl |
| 403 | contentDetailsImage.add(model) | 404 | contentDetailsImage.add(model) |
| 404 | } | 405 | } |
| 405 | goodsDetailsModel.detail_img = Array(contentDetailsImage) as! [CNLiveGoodsDetailsContentModel] | 406 | goodsDetailsModel.detail_img = Array(contentDetailsImage) as! [CNLiveGoodsDetailsContentModel] |
| 406 | - var kvArray = NSMutableArray() | 407 | + let kvArray = NSMutableArray() |
| 407 | kvArray.add(["k":"品名","v":singleView18.contentTextField.text]) | 408 | kvArray.add(["k":"品名","v":singleView18.contentTextField.text]) |
| 408 | kvArray.add(["k":"规格","v":singleView19.contentTextField.text]) | 409 | kvArray.add(["k":"规格","v":singleView19.contentTextField.text]) |
| 409 | kvArray.add(["k":"寄送区域","v":singleView20.contentTextField.text]) | 410 | kvArray.add(["k":"寄送区域","v":singleView20.contentTextField.text]) |
| 410 | kvArray.add(["k":"发货时效","v":singleView21.contentTextField.text]) | 411 | kvArray.add(["k":"发货时效","v":singleView21.contentTextField.text]) |
| 411 | - var tempArray = NSMutableArray(array: self.bgScrollView.subviews) | 412 | + let tempArray = NSMutableArray(array: self.bgScrollView.subviews) |
| 412 | 413 | ||
| 413 | let subArr = tempArray.subarray(with: NSRange(location: 0, length: tempArray.index(of: singleView19))) | 414 | let subArr = tempArray.subarray(with: NSRange(location: 0, length: tempArray.index(of: singleView19))) |
| 414 | tempArray.removeObjects(in: subArr) | 415 | tempArray.removeObjects(in: subArr) |
| @@ -464,7 +465,7 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | @@ -464,7 +465,7 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | ||
| 464 | let singleView21 = self.bgScrollView.viewWithTag(21) as! CNLiveShopAddGoodsSingleView | 465 | let singleView21 = self.bgScrollView.viewWithTag(21) as! CNLiveShopAddGoodsSingleView |
| 465 | let bannersSelectImageUrls = singleView4.uploadImageView.getCurrentSelectImageUrls() | 466 | let bannersSelectImageUrls = singleView4.uploadImageView.getCurrentSelectImageUrls() |
| 466 | 467 | ||
| 467 | - var bannerImage = NSMutableArray() | 468 | + let bannerImage = NSMutableArray() |
| 468 | for imageUrl in bannersSelectImageUrls{ | 469 | for imageUrl in bannersSelectImageUrls{ |
| 469 | bannerImage.add(["img":imageUrl,"ord":"99"]) | 470 | bannerImage.add(["img":imageUrl,"ord":"99"]) |
| 470 | } | 471 | } |
| @@ -480,7 +481,7 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | @@ -480,7 +481,7 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | ||
| 480 | 481 | ||
| 481 | let bannerSelectVideoUrl = singleView4.uploadImageView.getCurrentSelectVideoUrl() | 482 | let bannerSelectVideoUrl = singleView4.uploadImageView.getCurrentSelectVideoUrl() |
| 482 | let contentDetailsSelectImageUrls = singleView13.uploadImageView.getCurrentSelectImageUrls() | 483 | let contentDetailsSelectImageUrls = singleView13.uploadImageView.getCurrentSelectImageUrls() |
| 483 | - var contentDetailsImage = NSMutableArray() | 484 | + let contentDetailsImage = NSMutableArray() |
| 484 | for imageUrl in contentDetailsSelectImageUrls{ | 485 | for imageUrl in contentDetailsSelectImageUrls{ |
| 485 | contentDetailsImage.add(["img":imageUrl,"ord":"99"]) | 486 | contentDetailsImage.add(["img":imageUrl,"ord":"99"]) |
| 486 | } | 487 | } |
| @@ -493,10 +494,10 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | @@ -493,10 +494,10 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | ||
| 493 | contentDetailsImageStr = contentDetailsImageStr.replacingOccurrences(of: "\\", with: "") | 494 | contentDetailsImageStr = contentDetailsImageStr.replacingOccurrences(of: "\\", with: "") |
| 494 | contentDetailsImageStr = contentDetailsImageStr.replacingOccurrences(of: " ", with: "") | 495 | contentDetailsImageStr = contentDetailsImageStr.replacingOccurrences(of: " ", with: "") |
| 495 | } catch _ {} | 496 | } catch _ {} |
| 496 | - if self.type == .add && self.selectCategoryVC?.thiCategoryId?.count == 0{ | 497 | + if self.type == .add && self.selectCategoryVC?.thiCategoryId == 0{ |
| 497 | showMessage(message: "请选择商品分类") | 498 | showMessage(message: "请选择商品分类") |
| 498 | return | 499 | return |
| 499 | - }else if self.selectShopClassifyVC.firCategoryId == nil || self.selectShopClassifyVC.firCategoryId?.count == 0 || self.selectShopClassifyVC.firCategoryId == "0"{ | 500 | + }else if self.selectShopClassifyVC.firCategoryId == 0{ |
| 500 | showMessage(message: "请选择店铺分类") | 501 | showMessage(message: "请选择店铺分类") |
| 501 | return | 502 | return |
| 502 | }else if bannersSelectImageUrls.count == 0 && bannerSelectVideoUrl.count == 0{ | 503 | }else if bannersSelectImageUrls.count == 0 && bannerSelectVideoUrl.count == 0{ |
| @@ -542,7 +543,7 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | @@ -542,7 +543,7 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | ||
| 542 | showMessage(message: "请输入发货时效") | 543 | showMessage(message: "请输入发货时效") |
| 543 | return | 544 | return |
| 544 | } | 545 | } |
| 545 | - var kvArray = NSMutableArray() | 546 | + let kvArray = NSMutableArray() |
| 546 | kvArray.add(["k":"品名","v":singleView18.contentTextField.text]) | 547 | kvArray.add(["k":"品名","v":singleView18.contentTextField.text]) |
| 547 | kvArray.add(["k":"规格","v":singleView19.contentTextField.text]) | 548 | kvArray.add(["k":"规格","v":singleView19.contentTextField.text]) |
| 548 | kvArray.add(["k":"寄送区域","v":singleView20.contentTextView.text]) | 549 | kvArray.add(["k":"寄送区域","v":singleView20.contentTextView.text]) |
| @@ -563,7 +564,7 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | @@ -563,7 +564,7 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | ||
| 563 | if i == 11 || i == 16{ | 564 | if i == 11 || i == 16{ |
| 564 | continue | 565 | continue |
| 565 | } | 566 | } |
| 566 | - var singleView = self.bgScrollView.viewWithTag(i) as! CNLiveShopAddGoodsSingleView | 567 | + let singleView = self.bgScrollView.viewWithTag(i) as! CNLiveShopAddGoodsSingleView |
| 567 | let content = (singleView.contentTextField.text?.isEmpty == true ? singleView.contentTextField.text : singleView.contentTextView.text) ?? "" | 568 | let content = (singleView.contentTextField.text?.isEmpty == true ? singleView.contentTextField.text : singleView.contentTextView.text) ?? "" |
| 568 | if self.stringContainsEmoji(string: content){ | 569 | if self.stringContainsEmoji(string: content){ |
| 569 | showMessage(message: "参数不能添加表情") | 570 | showMessage(message: "参数不能添加表情") |
| @@ -582,15 +583,15 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | @@ -582,15 +583,15 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | ||
| 582 | return | 583 | return |
| 583 | } | 584 | } |
| 584 | } | 585 | } |
| 585 | - var category_id = "" | ||
| 586 | - if self.selectShopClassifyVC.secCategoryId?.isEmpty == false { | ||
| 587 | - category_id = self.selectShopClassifyVC.secCategoryId! | 586 | + var category_id = 0 |
| 587 | + if self.selectShopClassifyVC.secCategoryId != 0 { | ||
| 588 | + category_id = self.selectShopClassifyVC.secCategoryId | ||
| 588 | }else{ | 589 | }else{ |
| 589 | - category_id = self.selectShopClassifyVC.firCategoryId! | 590 | + category_id = self.selectShopClassifyVC.firCategoryId |
| 590 | } | 591 | } |
| 591 | showLoading(message: "") | 592 | showLoading(message: "") |
| 592 | if self.type == .add{ | 593 | if self.type == .add{ |
| 593 | - CNLiveShopGoodListViewModel.postGoodsAddWithUid(uid: DSUserInfoManager.shared.dsUserInfo.uid!, groupid3: self.selectCategoryVC?.thiCategoryId ?? "", bannerImg: bannerImageStr, simg: bannersSelectImageUrls.first!, video: bannerSelectVideoUrl, title: singleView5.contentTextField.text ?? "", ads: singleView6.contentTextView.text, price: singleView7.contentTextField.text ?? "", prices: singleView8.contentTextField.text ?? "", kg: singleView9.contentTextField.text ?? "", unit: singleView16.contentTextField.text ?? "", state: singleView11.contentSwitch.isOn ? "2" : "1", storage:self.dicArrayToJson(kvArray as! [Dictionary<String, Any>]), infoImg: contentDetailsImageStr, yunfei: singleView14.contentTextField.text ?? "", min_count: singleView10.countTF.text ?? "", isRefund: "0", category_id: category_id) { result, status in | 594 | + CNLiveShopGoodListViewModel.postGoodsAddWithUid(uid: DSUserInfoManager.shared.dsUserInfo.uid!, groupid3: self.selectCategoryVC?.thiCategoryId != 0 ? String(format: "%d", self.selectCategoryVC?.thiCategoryId ?? 0) : "", bannerImg: bannerImageStr, simg: bannersSelectImageUrls.first!, video: bannerSelectVideoUrl, title: singleView5.contentTextField.text ?? "", ads: singleView6.contentTextView.text, price: singleView7.contentTextField.text ?? "", prices: singleView8.contentTextField.text ?? "", kg: singleView9.contentTextField.text ?? "", unit: singleView16.contentTextField.text ?? "", state: singleView11.contentSwitch.isOn ? "2" : "1", storage:self.dicArrayToJson(kvArray as! [Dictionary<String, Any>]), infoImg: contentDetailsImageStr, yunfei: singleView14.contentTextField.text ?? "", min_count: singleView10.countTF.text ?? "", isRefund: "0", category_id: String(format: "%d", category_id)) { result, status in |
| 594 | hiddenLoading() | 595 | hiddenLoading() |
| 595 | if status == .failed{ | 596 | if status == .failed{ |
| 596 | showMessage(message: "发布失败") | 597 | showMessage(message: "发布失败") |
| @@ -600,7 +601,7 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | @@ -600,7 +601,7 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | ||
| 600 | showMessage(message: "发布成功") | 601 | showMessage(message: "发布成功") |
| 601 | NotificationCenter.default.post(name: NSNotification.Name.ShopGoodsManage.kDSGoodsManageAddNotification, object: nil) | 602 | NotificationCenter.default.post(name: NSNotification.Name.ShopGoodsManage.kDSGoodsManageAddNotification, object: nil) |
| 602 | for i in 0..<self.dataModel.list.count{ | 603 | for i in 0..<self.dataModel.list.count{ |
| 603 | - var singleView = self.view.viewWithTag(i+1) as! CNLiveShopAddGoodsSingleView | 604 | + let singleView = self.view.viewWithTag(i+1) as! CNLiveShopAddGoodsSingleView |
| 604 | if singleView.addEditGoodsListModel?.style == "3"{ | 605 | if singleView.addEditGoodsListModel?.style == "3"{ |
| 605 | singleView.uploadImageView.deleteReplaceImageUrlAfterSuccessUploadThings() | 606 | singleView.uploadImageView.deleteReplaceImageUrlAfterSuccessUploadThings() |
| 606 | } | 607 | } |
| @@ -609,7 +610,7 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | @@ -609,7 +610,7 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | ||
| 609 | } | 610 | } |
| 610 | } | 611 | } |
| 611 | }else{ | 612 | }else{ |
| 612 | - CNLiveShopGoodListViewModel.postGoodsAddWithUid(uid: DSUserInfoManager.shared.dsUserInfo.uid!, groupid3: self.selectCategoryVC?.thiCategoryId ?? "", bannerImg: bannerImageStr, simg: bannersSelectImageUrls.first!, video: bannerSelectVideoUrl, title: singleView5.contentTextField.text ?? "", ads: singleView6.contentTextView.text ?? "", price: singleView7.contentTextField.text ?? "", prices: singleView8.contentTextField.text ?? "", kg: singleView9.contentTextField.text ?? "", unit: singleView16.contentTextField.text ?? "", state: singleView11.contentSwitch.isOn ? "2" : "1", storage: self.dicArrayToJson(kvArray as! [Dictionary<String, Any>]), infoImg: contentDetailsImageStr, yunfei: singleView14.contentTextField.text ?? "", min_count: singleView10.countTF.text ?? "", isRefund: "0", category_id: category_id) { result, status in | 613 | + CNLiveShopGoodListViewModel.postGoodsAddWithUid(uid: DSUserInfoManager.shared.dsUserInfo.uid!, groupid3:self.selectCategoryVC?.thiCategoryId != 0 ? String(format: "%d", self.selectCategoryVC?.thiCategoryId ?? 0) : "" , bannerImg: bannerImageStr, simg: bannersSelectImageUrls.first!, video: bannerSelectVideoUrl, title: singleView5.contentTextField.text ?? "", ads: singleView6.contentTextView.text ?? "", price: singleView7.contentTextField.text ?? "", prices: singleView8.contentTextField.text ?? "", kg: singleView9.contentTextField.text ?? "", unit: singleView16.contentTextField.text ?? "", state: singleView11.contentSwitch.isOn ? "2" : "1", storage: self.dicArrayToJson(kvArray as! [Dictionary<String, Any>]), infoImg: contentDetailsImageStr, yunfei: singleView14.contentTextField.text ?? "", min_count: singleView10.countTF.text ?? "", isRefund: "0", category_id: String(format: "%d", category_id)) { result, status in |
| 613 | hiddenLoading() | 614 | hiddenLoading() |
| 614 | if status == .failed{ | 615 | if status == .failed{ |
| 615 | showMessage(message: "修改失败") | 616 | showMessage(message: "修改失败") |
| @@ -619,7 +620,7 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | @@ -619,7 +620,7 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | ||
| 619 | showMessage(message: "修改成功") | 620 | showMessage(message: "修改成功") |
| 620 | NotificationCenter.default.post(name: NSNotification.Name.ShopGoodsManage.kDSGoodsManageEditNotification, object: nil, userInfo: (result as! Dictionary)) | 621 | NotificationCenter.default.post(name: NSNotification.Name.ShopGoodsManage.kDSGoodsManageEditNotification, object: nil, userInfo: (result as! Dictionary)) |
| 621 | for i in 0..<self.dataModel.list.count{ | 622 | for i in 0..<self.dataModel.list.count{ |
| 622 | - var singleView = self.view.viewWithTag(i+1) as! CNLiveShopAddGoodsSingleView | 623 | + let singleView = self.view.viewWithTag(i+1) as! CNLiveShopAddGoodsSingleView |
| 623 | if singleView.addEditGoodsListModel?.style == "3"{ | 624 | if singleView.addEditGoodsListModel?.style == "3"{ |
| 624 | singleView.uploadImageView.deleteReplaceImageUrlAfterSuccessUploadThings() | 625 | singleView.uploadImageView.deleteReplaceImageUrlAfterSuccessUploadThings() |
| 625 | } | 626 | } |
| @@ -681,43 +682,43 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | @@ -681,43 +682,43 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | ||
| 681 | let model = result as! CNLiveShopGoodsDetailsModel | 682 | let model = result as! CNLiveShopGoodsDetailsModel |
| 682 | self.shopGoodsDetailsModel = model | 683 | self.shopGoodsDetailsModel = model |
| 683 | //商品分类 | 684 | //商品分类 |
| 684 | - var singleView1 = self.bgScrollView.viewWithTag(1) as! CNLiveShopAddGoodsSingleView | 685 | + let singleView1 = self.bgScrollView.viewWithTag(1) as! CNLiveShopAddGoodsSingleView |
| 685 | //店铺分类 | 686 | //店铺分类 |
| 686 | - var singleView2 = self.bgScrollView.viewWithTag(2) as! CNLiveShopAddGoodsSingleView | 687 | + let singleView2 = self.bgScrollView.viewWithTag(2) as! CNLiveShopAddGoodsSingleView |
| 687 | //商品轮播 | 688 | //商品轮播 |
| 688 | - var singleView4 = self.bgScrollView.viewWithTag(4) as! CNLiveShopAddGoodsSingleView | 689 | + let singleView4 = self.bgScrollView.viewWithTag(4) as! CNLiveShopAddGoodsSingleView |
| 689 | //商品名称 | 690 | //商品名称 |
| 690 | - var singleView5 = self.bgScrollView.viewWithTag(5) as! CNLiveShopAddGoodsSingleView | 691 | + let singleView5 = self.bgScrollView.viewWithTag(5) as! CNLiveShopAddGoodsSingleView |
| 691 | //商品副标题 | 692 | //商品副标题 |
| 692 | - var singleView6 = self.bgScrollView.viewWithTag(6) as! CNLiveShopAddGoodsSingleView | 693 | + let singleView6 = self.bgScrollView.viewWithTag(6) as! CNLiveShopAddGoodsSingleView |
| 693 | //本店售价 | 694 | //本店售价 |
| 694 | - var singleView7 = self.bgScrollView.viewWithTag(7) as! CNLiveShopAddGoodsSingleView | 695 | + let singleView7 = self.bgScrollView.viewWithTag(7) as! CNLiveShopAddGoodsSingleView |
| 695 | //市场售价 | 696 | //市场售价 |
| 696 | - var singleView8 = self.bgScrollView.viewWithTag(8) as! CNLiveShopAddGoodsSingleView | 697 | + let singleView8 = self.bgScrollView.viewWithTag(8) as! CNLiveShopAddGoodsSingleView |
| 697 | //商品重量 | 698 | //商品重量 |
| 698 | - var singleView9 = self.bgScrollView.viewWithTag(9) as! CNLiveShopAddGoodsSingleView | 699 | + let singleView9 = self.bgScrollView.viewWithTag(9) as! CNLiveShopAddGoodsSingleView |
| 699 | //最低起售 | 700 | //最低起售 |
| 700 | - var singleView10 = self.bgScrollView.viewWithTag(10) as! CNLiveShopAddGoodsSingleView | 701 | + let singleView10 = self.bgScrollView.viewWithTag(10) as! CNLiveShopAddGoodsSingleView |
| 701 | //上架 | 702 | //上架 |
| 702 | - var singleView11 = self.bgScrollView.viewWithTag(11) as! CNLiveShopAddGoodsSingleView | 703 | + let singleView11 = self.bgScrollView.viewWithTag(11) as! CNLiveShopAddGoodsSingleView |
| 703 | //商品详情图 | 704 | //商品详情图 |
| 704 | - var singleView13 = self.bgScrollView.viewWithTag(13) as! CNLiveShopAddGoodsSingleView | 705 | + let singleView13 = self.bgScrollView.viewWithTag(13) as! CNLiveShopAddGoodsSingleView |
| 705 | //商品运费 | 706 | //商品运费 |
| 706 | - var singleView14 = self.bgScrollView.viewWithTag(14) as! CNLiveShopAddGoodsSingleView | 707 | + let singleView14 = self.bgScrollView.viewWithTag(14) as! CNLiveShopAddGoodsSingleView |
| 707 | //是否支持退货 | 708 | //是否支持退货 |
| 708 | - var singleView15 = self.bgScrollView.viewWithTag(15) as! CNLiveShopAddGoodsSingleView | 709 | + let singleView15 = self.bgScrollView.viewWithTag(15) as! CNLiveShopAddGoodsSingleView |
| 709 | //商品单位 | 710 | //商品单位 |
| 710 | - var singleView16 = self.bgScrollView.viewWithTag(16) as! CNLiveShopAddGoodsSingleView | 711 | + let singleView16 = self.bgScrollView.viewWithTag(16) as! CNLiveShopAddGoodsSingleView |
| 711 | //品名 | 712 | //品名 |
| 712 | - var singleView18 = self.bgScrollView.viewWithTag(18) as! CNLiveShopAddGoodsSingleView | 713 | + let singleView18 = self.bgScrollView.viewWithTag(18) as! CNLiveShopAddGoodsSingleView |
| 713 | //规格 | 714 | //规格 |
| 714 | - var singleView19 = self.bgScrollView.viewWithTag(19) as! CNLiveShopAddGoodsSingleView | 715 | + let singleView19 = self.bgScrollView.viewWithTag(19) as! CNLiveShopAddGoodsSingleView |
| 715 | //寄送区域 | 716 | //寄送区域 |
| 716 | - var singleView20 = self.bgScrollView.viewWithTag(20) as! CNLiveShopAddGoodsSingleView | 717 | + let singleView20 = self.bgScrollView.viewWithTag(20) as! CNLiveShopAddGoodsSingleView |
| 717 | //发货时效 | 718 | //发货时效 |
| 718 | - var singleView21 = self.bgScrollView.viewWithTag(21) as! CNLiveShopAddGoodsSingleView | 719 | + let singleView21 = self.bgScrollView.viewWithTag(21) as! CNLiveShopAddGoodsSingleView |
| 719 | 720 | ||
| 720 | - var tempArray = NSMutableArray(array: self.shopGoodsDetailsModel.storageArray) | 721 | + let tempArray = NSMutableArray(array: self.shopGoodsDetailsModel.storageArray) |
| 721 | for dic in self.shopGoodsDetailsModel.storageArray{ | 722 | for dic in self.shopGoodsDetailsModel.storageArray{ |
| 722 | let dict = dic as NSDictionary | 723 | let dict = dic as NSDictionary |
| 723 | if dict.object(forKey: "k") as! String == "品名"{ | 724 | if dict.object(forKey: "k") as! String == "品名"{ |
| @@ -747,7 +748,7 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | @@ -747,7 +748,7 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | ||
| 747 | singleView2.contentTextField.text = self.shopGoodsDetailsModel.cate_name | 748 | singleView2.contentTextField.text = self.shopGoodsDetailsModel.cate_name |
| 748 | singleView2.layoutSubviews() | 749 | singleView2.layoutSubviews() |
| 749 | 750 | ||
| 750 | - var bannerImageUrls = NSMutableArray() | 751 | + let bannerImageUrls = NSMutableArray() |
| 751 | for model in self.shopGoodsDetailsModel.image{ | 752 | for model in self.shopGoodsDetailsModel.image{ |
| 752 | bannerImageUrls.add(model.simg ?? "") | 753 | bannerImageUrls.add(model.simg ?? "") |
| 753 | } | 754 | } |
| @@ -765,9 +766,9 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | @@ -765,9 +766,9 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | ||
| 765 | singleView11.contentSwitch.isOn = self.shopGoodsDetailsModel.state == 2 ? true : false | 766 | singleView11.contentSwitch.isOn = self.shopGoodsDetailsModel.state == 2 ? true : false |
| 766 | singleView10.subtractBtn.setImage(UIImage(named: Int(self.shopGoodsDetailsModel.min_buy_num ?? "0")! > 1 ? "DS_main_unadd_count" : "DS_main_unadd_count_n"), for: .normal) | 767 | singleView10.subtractBtn.setImage(UIImage(named: Int(self.shopGoodsDetailsModel.min_buy_num ?? "0")! > 1 ? "DS_main_unadd_count" : "DS_main_unadd_count_n"), for: .normal) |
| 767 | 768 | ||
| 768 | - var contentDetailsImageUrls = NSMutableArray() | 769 | + let contentDetailsImageUrls = NSMutableArray() |
| 769 | for model in self.shopGoodsDetailsModel.detail_img{ | 770 | for model in self.shopGoodsDetailsModel.detail_img{ |
| 770 | - contentDetailsImageUrls.add(model.simg) | 771 | + contentDetailsImageUrls.add(model.simg as Any) |
| 771 | } | 772 | } |
| 772 | singleView13.uploadImageView.networkImageArr = contentDetailsImageUrls as! Array<String> | 773 | singleView13.uploadImageView.networkImageArr = contentDetailsImageUrls as! Array<String> |
| 773 | if let array = contentDetailsImageUrls as? [String] { | 774 | if let array = contentDetailsImageUrls as? [String] { |
| @@ -779,7 +780,7 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | @@ -779,7 +780,7 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | ||
| 779 | singleView4.uploadImageView.deleteImage = UIImage.imageWithColor(color: .clear, size: singleView4.uploadImageView.size) | 780 | singleView4.uploadImageView.deleteImage = UIImage.imageWithColor(color: .clear, size: singleView4.uploadImageView.size) |
| 780 | singleView13.uploadImageView.deleteImage = UIImage.imageWithColor(color: .clear, size: singleView13.uploadImageView.size) | 781 | singleView13.uploadImageView.deleteImage = UIImage.imageWithColor(color: .clear, size: singleView13.uploadImageView.size) |
| 781 | if tempArray.count > 0{ | 782 | if tempArray.count > 0{ |
| 782 | - var array = NSMutableArray(array: self.dataModel.list) | 783 | + let array = NSMutableArray(array: self.dataModel.list) |
| 783 | for i in 0..<tempArray.count{ | 784 | for i in 0..<tempArray.count{ |
| 784 | let dict = tempArray.object(at: i) as! NSDictionary | 785 | let dict = tempArray.object(at: i) as! NSDictionary |
| 785 | let paramDict = ["style":1,"isHaveTo":false,"title":dict.object(forKey: "k"),"contentTextFieldkeyboardType":1,"isDisplayLine":true,"contentType":1,"isDelect":true,"content":dict.object(forKey: "v")] | 786 | let paramDict = ["style":1,"isHaveTo":false,"title":dict.object(forKey: "k"),"contentTextFieldkeyboardType":1,"isDisplayLine":true,"contentType":1,"isDelect":true,"content":dict.object(forKey: "v")] |
metaCode/Classes/Main/HomePage/View/GoodsManager/CNLiveShopAddGoodsSingleView.swift
| @@ -354,7 +354,7 @@ class CNLiveShopAddGoodsSingleView: UIView, UITextFieldDelegate, UITextViewDeleg | @@ -354,7 +354,7 @@ class CNLiveShopAddGoodsSingleView: UIView, UITextFieldDelegate, UITextViewDeleg | ||
| 354 | 354 | ||
| 355 | @objc func textDidChange(sender:UITextField) { | 355 | @objc func textDidChange(sender:UITextField) { |
| 356 | if (sender == self.countTF) { | 356 | if (sender == self.countTF) { |
| 357 | - if (self.countTF.text?.count ?? 0 > 0 && (self.countTF.text?.isPurnInt() == false)) { | 357 | + if (self.countTF.text?.count ?? 0 > 0 && (self.countTF.text?.isPurnInt() == true)) { |
| 358 | let count:Int = (self.countTF.text! as NSString).integerValue | 358 | let count:Int = (self.countTF.text! as NSString).integerValue |
| 359 | if (count <= 1) { | 359 | if (count <= 1) { |
| 360 | self.subtractBtn.setImage(UIImage(named: "DS_main_unadd_count_n"), for: .normal) | 360 | self.subtractBtn.setImage(UIImage(named: "DS_main_unadd_count_n"), for: .normal) |
metaCode/Classes/Main/Model/GoodsDetail/CNLiveShopGoodsDetailsModel.swift
| @@ -114,11 +114,11 @@ class CNLiveShopGoodsDetailsModel:BaseModel{ | @@ -114,11 +114,11 @@ class CNLiveShopGoodsDetailsModel:BaseModel{ | ||
| 114 | /** | 114 | /** |
| 115 | 店铺商品分类id,一级分类id | 115 | 店铺商品分类id,一级分类id |
| 116 | */ | 116 | */ |
| 117 | - var category_id:String? | 117 | + var category_id:Int = 0 |
| 118 | /** | 118 | /** |
| 119 | 店铺商品分类id,二级分类id | 119 | 店铺商品分类id,二级分类id |
| 120 | */ | 120 | */ |
| 121 | - var category_id2:String? | 121 | + var category_id2:Int = 0 |
| 122 | /** | 122 | /** |
| 123 | 店铺商品分类名 | 123 | 店铺商品分类名 |
| 124 | */ | 124 | */ |
| @@ -126,15 +126,15 @@ class CNLiveShopGoodsDetailsModel:BaseModel{ | @@ -126,15 +126,15 @@ class CNLiveShopGoodsDetailsModel:BaseModel{ | ||
| 126 | /** | 126 | /** |
| 127 | 平台分类id 1级 | 127 | 平台分类id 1级 |
| 128 | */ | 128 | */ |
| 129 | - var groupid:String? | 129 | + var groupid:Int = 0 |
| 130 | /** | 130 | /** |
| 131 | 平台分类id 2级 | 131 | 平台分类id 2级 |
| 132 | */ | 132 | */ |
| 133 | - var groupid2:String? | 133 | + var groupid2:Int = 0 |
| 134 | /** | 134 | /** |
| 135 | 平台分类id 3级 | 135 | 平台分类id 3级 |
| 136 | */ | 136 | */ |
| 137 | - var groupid3:String? | 137 | + var groupid3:Int = 0 |
| 138 | /** | 138 | /** |
| 139 | 1/2/3级分类名称合并 | 139 | 1/2/3级分类名称合并 |
| 140 | */ | 140 | */ |
metaCode/Classes/Main/Model/GoodsManager/CNLiveShopGoodsManageDetailsGoodsCategoryModel.swift
| @@ -9,7 +9,7 @@ import Foundation | @@ -9,7 +9,7 @@ import Foundation | ||
| 9 | 9 | ||
| 10 | class CNLiveShopGoodsManageDetailsGoodsCategoryModel:BaseModel{ | 10 | class CNLiveShopGoodsManageDetailsGoodsCategoryModel:BaseModel{ |
| 11 | /// 分类id | 11 | /// 分类id |
| 12 | - var id: String? | 12 | + var id: Int = 0 |
| 13 | /// 分类名称 | 13 | /// 分类名称 |
| 14 | var title: String? | 14 | var title: String? |
| 15 | } | 15 | } |