Commit e665c46f authored by 刘俊宏's avatar 刘俊宏

新增完善

parent 0bb33a17
......@@ -9,7 +9,7 @@
import UIKit
import ViewAnimator
class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollectionViewDataSource ,UICollectionViewDelegateFlowLayout,HeaderSelectViewDelegate,SelectContentViewDelegate,UISearchBarDelegate, SearchBarViewDelegate, GoodsCollectionViewCellDelegate{
class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollectionViewDataSource ,UICollectionViewDelegateFlowLayout,HeaderSelectViewDelegate,SelectContentViewDelegate,UISearchBarDelegate, SearchBarViewDelegate, GoodsCollectionViewCellDelegate,ProductDetailViewControllerDelegate{
var collection : UICollectionView? = nil
var layout = UICollectionViewFlowLayout()
......@@ -257,8 +257,14 @@ class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollect
}
let vc = ProductDetailViewController()
vc.delegate = self
self.navigationController?.pushViewController(vc, animated: true)
}
//MARK:--新增回调刷新
func reloadDataByProductDetailViewController() {
self.collection?.mj_header?.beginRefreshing()
}
//MARK:--下拉视图模块
func showAction(sender: Int) {
......
......@@ -12,7 +12,13 @@ import Photos
import IQKeyboardManagerSwift
import Dollar
protocol ProductDetailViewControllerDelegate {
func reloadDataByProductDetailViewController()
}
class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,TitleAndBtnCellDelegate,GLAlertSelectViewDelegate,GoodsClassViewControllerDelegate,PinPaiListViewControllerDelegate,AddImgCellDelegate,AddGuiGeCellDelegate,CreatNewSpecsViewControllerDelegate,ShangPinGguiGeCellDelegate,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout,TitleAndSwitchCellDelegate,TitleAndTFCellDelegate,YuShouWeiKuanFaHuoCellDelegate,UITextFieldDelegate,ShowTimeSelectViewDelegate{
var delegate :ProductDetailViewControllerDelegate?
func GLASClose(view: GLAlertSelectView, selectnum: Int, selectArr: Array<Int>) {
if view.titleLbl.text == "请选择商品类型" {
print(itemTypeArr,selectArr)
......@@ -78,80 +84,80 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
//MARK:--保存按钮
@IBAction func submitAction(_ sender: Any) {
print("保存按钮submitAction")
print(itemTypeArr)//商品类型
// print(itemTypeArr)//商品类型
// print(guiGeArr)//商品规格
// if itemName.count == 0 {
// HUD.flash(.label("请输入商品名称"), delay: 1.2)
// return
// }
// if itemTypeArr == [] || itemTypeArr == [99,99,99,99] {
// HUD.flash(.label("请选择商品类型"), delay: 1.2)
// return
// }
// //待补充
// if itemName.count == 0 {
// HUD.flash(.label("请输入商品名称"), delay: 1.2)
// return
// }
//
// if itemTypeArr == [99,99,99,99] {
// HUD.flash(.label("请选择商品类型"), delay: 1.2)
// return
// }
// if selectGoodsClassModel == nil {
// HUD.flash(.label("请选择商品分类"), delay: 1.2)
// return
// }
// if selectPinPaiData == nil {
// HUD.flash(.label("请选择品牌"), delay: 1.2)
// return
// }
// if qiMaiShuLiang.count == 0 {
// HUD.flash(.label("请输入起卖数量"), delay: 1.2)
// return
// }
//
// if singleImgArr.count == 0 {
// HUD.flash(.label("请选择商品封面图"), delay: 1.2)
// return
// }
//
// if maxFiveImgsArr.count == 0 {
// HUD.flash(.label("请选择商品主图"), delay: 1.2)
// return
// }
//
// if guiGeArr.count == 0 {
// HUD.flash(.label("请填写商品规格"), delay: 1.2)
// return
// }
// if isYuShouShangPin! {
// if faHuoTime.count == 0 {
// HUD.flash(.label("请输入尾款发货时间"), delay: 1.2)
// return
// }
// }
// if keyWord.count == 0 {
// HUD.flash(.label("请输入关键字"), delay: 1.2)
// return
// }
// if wuLiuPrice.count == 0 {
// HUD.flash(.label("请输入物流费用"), delay: 1.2)
// return
// }
// if countrySelect == nil {
// HUD.flash(.label("请选择国家"), delay: 1.2)
// return
// }
// if shangPinStatus == nil {
// HUD.flash(.label("请选择商品状态"), delay: 1.2)
// return
// }
//
// if yunShuType == nil {
// HUD.flash(.label("请选择运输方式"), delay: 1.2)
// return
// }
if itemName.count == 0 {
HUD.flash(.label("请输入商品名称"), delay: 1.2)
return
}
if itemTypeArr == [] || itemTypeArr == [99,99,99,99] {
HUD.flash(.label("请选择商品类型"), delay: 1.2)
return
}
//待补充
if itemName.count == 0 {
HUD.flash(.label("请输入商品名称"), delay: 1.2)
return
}
if itemTypeArr == [99,99,99,99] {
HUD.flash(.label("请选择商品类型"), delay: 1.2)
return
}
if selectGoodsClassModel == nil {
HUD.flash(.label("请选择商品分类"), delay: 1.2)
return
}
if selectPinPaiData == nil {
HUD.flash(.label("请选择品牌"), delay: 1.2)
return
}
if qiMaiShuLiang.count == 0 {
HUD.flash(.label("请输入起卖数量"), delay: 1.2)
return
}
if singleImgArr.count == 0 {
HUD.flash(.label("请选择商品封面图"), delay: 1.2)
return
}
if maxFiveImgsArr.count == 0 {
HUD.flash(.label("请选择商品主图"), delay: 1.2)
return
}
if guiGeArr.count == 0 {
HUD.flash(.label("请填写商品规格"), delay: 1.2)
return
}
if isYuShouShangPin! {
if faHuoTime.count == 0 {
HUD.flash(.label("请输入尾款发货时间"), delay: 1.2)
return
}
}
if keyWord.count == 0 {
HUD.flash(.label("请输入关键字"), delay: 1.2)
return
}
if wuLiuPrice.count == 0 {
HUD.flash(.label("请输入物流费用"), delay: 1.2)
return
}
if countrySelect == nil {
HUD.flash(.label("请选择国家"), delay: 1.2)
return
}
if shangPinStatus == nil {
HUD.flash(.label("请选择商品状态"), delay: 1.2)
return
}
if yunShuType == nil {
HUD.flash(.label("请选择运输方式"), delay: 1.2)
return
}
//MARK:---新增商品接口
let UserToken = UserDefaults.standard.value(forKey: "user_token")
......@@ -251,11 +257,12 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
"sku_info":sku_info as Any]
print(dic)
//MARK:--新增商品接口
// goodsAdd(dic, success: { (data) in
//
// }) { (error) in
//
// }
goodsAdd(dic, success: { (data) in
HUD.flash(.labeledSubSuccess(subtitle: "提交成功"), delay: 1.2)
self.navigationController?.popViewController(animated: true)
}) { (error) in
}
}
@IBOutlet weak var submitBtn: LGButton!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment