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

新增完善

parent 0bb33a17
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
import UIKit import UIKit
import ViewAnimator 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 collection : UICollectionView? = nil
var layout = UICollectionViewFlowLayout() var layout = UICollectionViewFlowLayout()
...@@ -257,8 +257,14 @@ class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollect ...@@ -257,8 +257,14 @@ class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollect
} }
let vc = ProductDetailViewController() let vc = ProductDetailViewController()
vc.delegate = self
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
}
//MARK:--新增回调刷新
func reloadDataByProductDetailViewController() {
self.collection?.mj_header?.beginRefreshing()
} }
//MARK:--下拉视图模块 //MARK:--下拉视图模块
func showAction(sender: Int) { func showAction(sender: Int) {
......
...@@ -12,7 +12,13 @@ import Photos ...@@ -12,7 +12,13 @@ import Photos
import IQKeyboardManagerSwift import IQKeyboardManagerSwift
import Dollar 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{ 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>) { func GLASClose(view: GLAlertSelectView, selectnum: Int, selectArr: Array<Int>) {
if view.titleLbl.text == "请选择商品类型" { if view.titleLbl.text == "请选择商品类型" {
print(itemTypeArr,selectArr) print(itemTypeArr,selectArr)
...@@ -78,80 +84,80 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -78,80 +84,80 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
//MARK:--保存按钮 //MARK:--保存按钮
@IBAction func submitAction(_ sender: Any) { @IBAction func submitAction(_ sender: Any) {
print("保存按钮submitAction") print("保存按钮submitAction")
print(itemTypeArr)//商品类型 // print(itemTypeArr)//商品类型
// print(guiGeArr)//商品规格 // print(guiGeArr)//商品规格
// if itemName.count == 0 { if itemName.count == 0 {
// HUD.flash(.label("请输入商品名称"), delay: 1.2) HUD.flash(.label("请输入商品名称"), delay: 1.2)
// return return
// } }
// if itemTypeArr == [] || itemTypeArr == [99,99,99,99] { if itemTypeArr == [] || itemTypeArr == [99,99,99,99] {
// HUD.flash(.label("请选择商品类型"), delay: 1.2) HUD.flash(.label("请选择商品类型"), delay: 1.2)
// return return
// } }
// //待补充 //待补充
// if itemName.count == 0 { if itemName.count == 0 {
// HUD.flash(.label("请输入商品名称"), delay: 1.2) HUD.flash(.label("请输入商品名称"), delay: 1.2)
// return return
// } }
//
// if itemTypeArr == [99,99,99,99] { if itemTypeArr == [99,99,99,99] {
// HUD.flash(.label("请选择商品类型"), delay: 1.2) HUD.flash(.label("请选择商品类型"), delay: 1.2)
// return return
// } }
// if selectGoodsClassModel == nil { if selectGoodsClassModel == nil {
// HUD.flash(.label("请选择商品分类"), delay: 1.2) HUD.flash(.label("请选择商品分类"), delay: 1.2)
// return return
// } }
// if selectPinPaiData == nil { if selectPinPaiData == nil {
// HUD.flash(.label("请选择品牌"), delay: 1.2) HUD.flash(.label("请选择品牌"), delay: 1.2)
// return return
// } }
// if qiMaiShuLiang.count == 0 { if qiMaiShuLiang.count == 0 {
// HUD.flash(.label("请输入起卖数量"), delay: 1.2) HUD.flash(.label("请输入起卖数量"), delay: 1.2)
// return return
// } }
//
// if singleImgArr.count == 0 { if singleImgArr.count == 0 {
// HUD.flash(.label("请选择商品封面图"), delay: 1.2) HUD.flash(.label("请选择商品封面图"), delay: 1.2)
// return return
// } }
//
// if maxFiveImgsArr.count == 0 { if maxFiveImgsArr.count == 0 {
// HUD.flash(.label("请选择商品主图"), delay: 1.2) HUD.flash(.label("请选择商品主图"), delay: 1.2)
// return return
// } }
//
// if guiGeArr.count == 0 { if guiGeArr.count == 0 {
// HUD.flash(.label("请填写商品规格"), delay: 1.2) HUD.flash(.label("请填写商品规格"), delay: 1.2)
// return return
// } }
// if isYuShouShangPin! { if isYuShouShangPin! {
// if faHuoTime.count == 0 { if faHuoTime.count == 0 {
// HUD.flash(.label("请输入尾款发货时间"), delay: 1.2) HUD.flash(.label("请输入尾款发货时间"), delay: 1.2)
// return return
// } }
// } }
// if keyWord.count == 0 { if keyWord.count == 0 {
// HUD.flash(.label("请输入关键字"), delay: 1.2) HUD.flash(.label("请输入关键字"), delay: 1.2)
// return return
// } }
// if wuLiuPrice.count == 0 { if wuLiuPrice.count == 0 {
// HUD.flash(.label("请输入物流费用"), delay: 1.2) HUD.flash(.label("请输入物流费用"), delay: 1.2)
// return return
// } }
// if countrySelect == nil { if countrySelect == nil {
// HUD.flash(.label("请选择国家"), delay: 1.2) HUD.flash(.label("请选择国家"), delay: 1.2)
// return return
// } }
// if shangPinStatus == nil { if shangPinStatus == nil {
// HUD.flash(.label("请选择商品状态"), delay: 1.2) HUD.flash(.label("请选择商品状态"), delay: 1.2)
// return return
// } }
//
// if yunShuType == nil { if yunShuType == nil {
// HUD.flash(.label("请选择运输方式"), delay: 1.2) HUD.flash(.label("请选择运输方式"), delay: 1.2)
// return return
// } }
//MARK:---新增商品接口 //MARK:---新增商品接口
let UserToken = UserDefaults.standard.value(forKey: "user_token") let UserToken = UserDefaults.standard.value(forKey: "user_token")
...@@ -251,11 +257,12 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -251,11 +257,12 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
"sku_info":sku_info as Any] "sku_info":sku_info as Any]
print(dic) print(dic)
//MARK:--新增商品接口 //MARK:--新增商品接口
// goodsAdd(dic, success: { (data) in goodsAdd(dic, success: { (data) in
// HUD.flash(.labeledSubSuccess(subtitle: "提交成功"), delay: 1.2)
// }) { (error) in self.navigationController?.popViewController(animated: true)
// }) { (error) in
// }
}
} }
@IBOutlet weak var submitBtn: LGButton! @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