Commit 6ea18577 authored by 刘俊宏's avatar 刘俊宏

修改商品编辑跳转和提交信息

parent b7a206bd
...@@ -95,7 +95,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDeleg ...@@ -95,7 +95,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDeleg
tabBarController.viewControllers = [v1, v2, v3, v4, v5] tabBarController.viewControllers = [v1, v2, v3, v4, v5]
// tabBarController.selectedIndex = 2 tabBarController.selectedIndex = 1
......
...@@ -14,7 +14,7 @@ import Dollar ...@@ -14,7 +14,7 @@ import Dollar
class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,TitleAndBtnCellDelegate,GLAlertSelectViewDelegate,GoodsClassViewControllerDelegate,PinPaiListViewControllerDelegate,AddImgCellDelegate,AddGuiGeCellDelegate,CreatNewSpecsViewControllerDelegate,ShangPinGguiGeCellDelegate,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout,TitleAndSwitchCellDelegate,TitleAndTFCellDelegate,YuShouWeiKuanFaHuoCellDelegate,UITextFieldDelegate,ShowTimeSelectViewDelegate, LMNoteViewControllerDelegate { class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,TitleAndBtnCellDelegate,GLAlertSelectViewDelegate,GoodsClassViewControllerDelegate,PinPaiListViewControllerDelegate,AddImgCellDelegate,AddGuiGeCellDelegate,CreatNewSpecsViewControllerDelegate,ShangPinGguiGeCellDelegate,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout,TitleAndSwitchCellDelegate,TitleAndTFCellDelegate,YuShouWeiKuanFaHuoCellDelegate,UITextFieldDelegate,ShowTimeSelectViewDelegate, LMNoteViewControllerDelegate {
@IBOutlet weak var btmBtnViewH: NSLayoutConstraint! @IBOutlet weak var btmBtnViewH: NSLayoutConstraint!
...@@ -273,7 +273,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -273,7 +273,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
"coun_id":"1", //国家id 1(中国) "coun_id":"1", //国家id 1(中国)
"gs_id":gs_id as Any, //商品状态 "gs_id":gs_id as Any, //商品状态
"transportation":transportation as Any, //运输方式,1冷链,2常温,3热链 "transportation":transportation as Any, //运输方式,1冷链,2常温,3热链
"goods_desc":"", //商品详情 html p标签 "goods_desc":goodsDesc, //商品详情 html p标签
"specifications":specifications as Any, //默认规格,选sku中最低价格(需判定阶梯价)的 规格值 "specifications":specifications as Any, //默认规格,选sku中最低价格(需判定阶梯价)的 规格值
"shop_price":shop_price as Any, //默认售价,选sku中最低价格(需判定阶梯价)的价格 "shop_price":shop_price as Any, //默认售价,选sku中最低价格(需判定阶梯价)的价格
"goods_unit":goods_unit as Any, //默认商品单位,选sku中最低价格(需判定阶梯价)的单位 "goods_unit":goods_unit as Any, //默认商品单位,选sku中最低价格(需判定阶梯价)的单位
...@@ -294,17 +294,17 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -294,17 +294,17 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
break break
case "入库": case "入库":
let vc = RuKuViewController() let vc = RuKuViewController()
vc.barTitle = "入库" vc.barTitle = "入库"
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
break break
case "出库": case "出库":
let vc = ChuKuViewController() let vc = ChuKuViewController()
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
break break
case "上架": case "上架":
//提示是否上架 //提示是否上架
let UserToken = UserDefaults.standard.value(forKey: "user_token") let UserToken = UserDefaults.standard.value(forKey: "user_token")
editField(["user_token":UserToken as Any,"function_id":"15","prval":goods_id as Any,"value":1,], success: { (data) in editField(["user_token":UserToken as Any,"function_id":"15","prval":goods_id as Any,"value":1,], success: { (data) in
let dataM = data as! UpDataModel let dataM = data as! UpDataModel
if dataM.code == 1 { if dataM.code == 1 {
...@@ -317,14 +317,14 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -317,14 +317,14 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
break break
case "下架": case "下架":
//提示是否下架 //提示是否下架
let UserToken = UserDefaults.standard.value(forKey: "user_token") let UserToken = UserDefaults.standard.value(forKey: "user_token")
editField(["user_token":UserToken as Any,"function_id":"15","prval":goods_id as Any,"value":0,], success: { (data) in editField(["user_token":UserToken as Any,"function_id":"15","prval":goods_id as Any,"value":0,], success: { (data) in
let dataM = data as! UpDataModel let dataM = data as! UpDataModel
if dataM.code == 1 { if dataM.code == 1 {
HUD.flash(.label("提交成功"), delay: 1.2) HUD.flash(.label("提交成功"), delay: 1.2)
self.loadData() self.loadData()
} }
}) { (erro) in }) { (erro) in
...@@ -338,7 +338,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -338,7 +338,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
if dataM.code == 1 { if dataM.code == 1 {
HUD.flash(.label("删除成功"), delay: 1.2) HUD.flash(.label("删除成功"), delay: 1.2)
self.navigationController?.popViewController(animated: true) self.navigationController?.popViewController(animated: true)
} }
}) { (erro) in }) { (erro) in
} }
...@@ -348,186 +348,186 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -348,186 +348,186 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
} }
} }
func loadData () { func loadData () {
//MARK:--新增商品和编辑商品所需要的基本信息(无)就页面不正常显示 //MARK:--新增商品和编辑商品所需要的基本信息(无)就页面不正常显示
let UserToken = UserDefaults.standard.value(forKey: "user_token") let UserToken = UserDefaults.standard.value(forKey: "user_token")
goodsDetail(["user_token":UserToken,"goods_id":goods_id], success: { (data) in goodsDetail(["user_token":UserToken,"goods_id":goods_id], success: { (data) in
//MARK: - 获取详情 //MARK: - 获取详情
let model = data as! GoodsDetailModel let model = data as! GoodsDetailModel
self.goodsDetailModel = model self.goodsDetailModel = model
//商品名 //商品名
self.itemName = (model.data?.goods_res!.goods_name)! self.itemName = (model.data?.goods_res!.goods_name)!
//默认单位 //默认单位
self.goods_unit = (model.data?.goods_res!.goods_unit)! self.goods_unit = (model.data?.goods_res!.goods_unit)!
//商品类型 //商品类型
if model.data?.goods_res!.is_adsale == 0{ if model.data?.goods_res!.is_adsale == 0{
self.itemTypeArr = [99,99,99,99] self.itemTypeArr = [99,99,99,99]
}else{ }else{
self.itemTypeArr = [0,99,99,99] self.itemTypeArr = [0,99,99,99]
} }
if (model.data?.goods_res!.goods_type)! == 1 || (model.data?.goods_res!.goods_type)! == 2 { if (model.data?.goods_res!.goods_type)! == 1 || (model.data?.goods_res!.goods_type)! == 2 {
self.itemTypeArr?.insert(1, at: 1) self.itemTypeArr?.insert(1, at: 1)
self.itemTypeArr?.remove(at: 2) self.itemTypeArr?.remove(at: 2)
}else{ }else{
self.itemTypeArr?.insert((model.data?.goods_res!.goods_type)!, at: (model.data?.goods_res!.goods_type)!-1) self.itemTypeArr?.insert((model.data?.goods_res!.goods_type)!, at: (model.data?.goods_res!.goods_type)!-1)
self.itemTypeArr?.remove(at: (model.data?.goods_res!.goods_type)!) self.itemTypeArr?.remove(at: (model.data?.goods_res!.goods_type)!)
} }
let contentArr = ["预售","普通","期货","团购"] let contentArr = ["预售","普通","期货","团购"]
let titles = NSMutableArray() let titles = NSMutableArray()
titles.removeAllObjects() titles.removeAllObjects()
for num in self.itemTypeArr! { for num in self.itemTypeArr! {
if num != 99{ if num != 99{
titles.add(contentArr[num]) titles.add(contentArr[num])
} }
} }
if titles.componentsJoined(by: ",").contains("预售") { if titles.componentsJoined(by: ",").contains("预售") {
self.isYuShouShangPin = true self.isYuShouShangPin = true
}else{ }else{
self.isYuShouShangPin = false self.isYuShouShangPin = false
} }
self.tishixxArr.insert(titles.componentsJoined(by: ","), at: 1) self.tishixxArr.insert(titles.componentsJoined(by: ","), at: 1)
self.tishixxArr.remove(at: 2) self.tishixxArr.remove(at: 2)
//商品分类 //商品分类
self.selectGoodsClassModel.cat_id = model.data?.goods_res?.cat_id self.selectGoodsClassModel.cat_id = model.data?.goods_res?.cat_id
self.tishixxArr.insert((model.data?.goods_res!.cat_name)!, at: 2) self.tishixxArr.insert((model.data?.goods_res!.cat_name)!, at: 2)
self.tishixxArr.remove(at: 3) self.tishixxArr.remove(at: 3)
//品牌名 //品牌名
self.pinPai_id = (model.data?.goods_res!.brand_id)! self.pinPai_id = (model.data?.goods_res!.brand_id)!
self.pinPai = (model.data?.goods_res!.brand_name)! self.pinPai = (model.data?.goods_res!.brand_name)!
self.tishixxArr.insert(self.pinPai, at: 3) self.tishixxArr.insert(self.pinPai, at: 3)
self.tishixxArr.remove(at: 4) self.tishixxArr.remove(at: 4)
//起卖数量 //起卖数量
self.qiMaiShuLiang = "\(model.data!.goods_res!.origin_number!)" self.qiMaiShuLiang = "\(model.data!.goods_res!.origin_number!)"
//是否清真 //是否清真
self.shiFouQZ = true self.shiFouQZ = true
if model.data?.goods_res!.is_qz == 0 { if model.data?.goods_res!.is_qz == 0 {
self.shiFouQZ = false self.shiFouQZ = false
} }
//默认规格 //默认规格
self.specifications = (model.data?.goods_res!.specifications)! self.specifications = (model.data?.goods_res!.specifications)!
//是否询价 //是否询价
self.shiFouXJ = true self.shiFouXJ = true
if model.data?.goods_res!.is_inquiry == 0 { if model.data?.goods_res!.is_inquiry == 0 {
self.shiFouXJ = false self.shiFouXJ = false
} }
//是否有封面图 //是否有封面图
self.singleImgArr = [ (model.data?.goods_res!.original_img)!]//单张图 self.singleImgArr = [ (model.data?.goods_res!.original_img)!]//单张图
self.original_img = (model.data?.goods_res!.original_img)! self.original_img = (model.data?.goods_res!.original_img)!
//商品规格 //商品规格
if (model.data?.sku_res?.count)! > 0{ if (model.data?.sku_res?.count)! > 0{
self.guiGeArr.removeAll() self.guiGeArr.removeAll()
for item in model.data!.sku_res! { for item in model.data!.sku_res! {
let dataSource = item let dataSource = item
let data = GuiGeModel() let data = GuiGeModel()
data.price = dataSource.price!//价格 data.price = dataSource.price!//价格
data.danWei = dataSource.unit!//单位 data.danWei = dataSource.unit!//单位
data.sku_id = dataSource.sku_id!//sku_id data.sku_id = dataSource.sku_id!//sku_id
let arr = dataSource.spec_str?.components(separatedBy: ":") let arr = dataSource.spec_str?.components(separatedBy: ":")
data.guiGe = (arr?.last)!//规格 data.guiGe = (arr?.last)!//规格
let dict = getDictionaryFromJSONString(jsonString: dataSource.pack_attr!) let dict = getDictionaryFromJSONString(jsonString: dataSource.pack_attr!)
data.weight = dict["wg"] as! String//重量 data.weight = dict["wg"] as! String//重量
data.wenDu = dataSource.refrigerate!//温藏 data.wenDu = dataSource.refrigerate!//温藏
//预售设置 //预售设置
data.isOpenYSSetting = false data.isOpenYSSetting = false
if dataSource.is_open_adsale! == 1 { if dataSource.is_open_adsale! == 1 {
data.isOpenYSSetting = true data.isOpenYSSetting = true
}
//普通阶梯价是否打开
data.isJieTiOpen = false
if dataSource.is_tiered == 1 {
data.isJieTiOpen = true
data.selectYuShou = false
}
//预售阶梯价是否打开
data.isYsJieTiOpen = false
if dataSource.is_adsale_tiered == 1 {
data.selectYuShou = true
data.isYsJieTiOpen = true
}
//预售价格
data.yuShouPrice = dataSource.adsale_pri!
//预售库存
if dataSource.adsale_inventory != nil {
data.ysKuCun = dataSource.adsale_inventory!
}
//百分比
if dataSource.pct != nil {
data.DJBiLi = dataSource.pct!
}
//阶梯价
if dataSource.tiered_pri!.count > 0 {
data.jieTiArr = self.getResponseArr(str: dataSource.tiered_pri!)
}
//预售阶梯价
if dataSource.adsale_tiered_pri!.count > 0 {
data.specalArr = self.getResponseArr(str:dataSource.adsale_tiered_pri!)
}
self.guiGeArr.append(data)
}
} }
//是否审核 //普通阶梯价是否打开
self.shiFouSH = false data.isJieTiOpen = false
if model.data?.goods_res?.need_check == 1 { if dataSource.is_tiered == 1 {
self.shiFouSH = true data.isJieTiOpen = true
data.selectYuShou = false
} }
//预设预付定金时间段 //预售阶梯价是否打开
// print("abcl === ",model.data?.goods_res!.dj_time_start!) data.isYsJieTiOpen = false
if model.data?.goods_res!.dj_time_start != 0 { if dataSource.is_adsale_tiered == 1 {
let begin = dayByDouble(sender: (model.data?.goods_res!.dj_time_start)!) + "-" + dayByDouble(sender: (model.data?.goods_res!.dj_time_end)!) data.selectYuShou = true
self.dj_time_start = (model.data?.goods_res!.dj_time_start) data.isYsJieTiOpen = true
self.dj_time_end = (model.data?.goods_res!.dj_time_end)
self.ysszHolder.insert(begin, at: 1)
self.ysszHolder.remove(at: 2)
} }
//预设预付尾款时间段 //预售价格
if model.data?.goods_res!.wk_time_start != 0 { data.yuShouPrice = dataSource.adsale_pri!
let end = dayByDouble(sender: (model.data?.goods_res!.wk_time_start)!) + "-" + dayByDouble(sender: (model.data?.goods_res!.wk_time_end)!) //预售库存
self.wk_time_start = (model.data?.goods_res!.wk_time_start) if dataSource.adsale_inventory != nil {
self.wk_time_end = (model.data?.goods_res!.wk_time_end) data.ysKuCun = dataSource.adsale_inventory!
self.ysszHolder.insert(end, at: 2)
self.ysszHolder.remove(at: 3)
} }
//发货时间 //百分比
if model.data?.goods_res?.set_time != nil { if dataSource.pct != nil {
self.faHuoTime = "\(model.data!.goods_res!.set_time!)" data.DJBiLi = dataSource.pct!
} }
//商品主图 //阶梯价
for item in model.data!.banner_res! { if dataSource.tiered_pri!.count > 0 {
self.maxFiveImgsArr.append(item.img_original!) data.jieTiArr = self.getResponseArr(str: dataSource.tiered_pri!)
} }
//商品附图 //预售阶梯价
let imgArr = model.data?.banner_res! if dataSource.adsale_tiered_pri!.count > 0 {
if imgArr!.count > 0 { data.specalArr = self.getResponseArr(str:dataSource.adsale_tiered_pri!)
for i in 0 ..< imgArr!.count {
let imgData = imgArr![i]
self.goods_banner?.insert(imgData.img_original!, at: i)
self.goods_banner?.remove(at: i+1)
}
} }
//关键字 self.guiGeArr.append(data)
self.keyWord = (model.data?.goods_res!.keywords)!
//物流费用
self.wuLiuPrice = (model.data?.goods_res!.logistics)!
//国家
self.countrySelect = (model.data?.goods_res!.coun_id)!-1
self.tishixxArr1.insert(self.countryArr[self.countrySelect!], at: 2)
self.tishixxArr1.remove(at: 3)
//商品状态
self.shangPinStatus = (model.data?.goods_res?.gs_id)!-1
self.tishixxArr1.insert((model.data?.goods_res!.gs_name)!, at: 3)
self.tishixxArr1.remove(at: 4)
//运输方式
self.yunShuType = (model.data?.goods_res!.transportation)! - 1
self.tishixxArr1.insert(self.yunShuTypeArr[self.yunShuType!], at: 4)
self.tishixxArr1.remove(at: 5)
//商品详情
self.goodsDesc = model.data?.goods_res?.goods_desc as! String
self.listTbv.reloadData()
}) { (error) in
} }
}
//是否审核
self.shiFouSH = false
if model.data?.goods_res?.need_check == 1 {
self.shiFouSH = true
}
//预设预付定金时间段
// print("abcl === ",model.data?.goods_res!.dj_time_start!)
if model.data?.goods_res!.dj_time_start != 0 {
let begin = dayByDouble(sender: (model.data?.goods_res!.dj_time_start)!) + "-" + dayByDouble(sender: (model.data?.goods_res!.dj_time_end)!)
self.dj_time_start = (model.data?.goods_res!.dj_time_start)
self.dj_time_end = (model.data?.goods_res!.dj_time_end)
self.ysszHolder.insert(begin, at: 1)
self.ysszHolder.remove(at: 2)
}
//预设预付尾款时间段
if model.data?.goods_res!.wk_time_start != 0 {
let end = dayByDouble(sender: (model.data?.goods_res!.wk_time_start)!) + "-" + dayByDouble(sender: (model.data?.goods_res!.wk_time_end)!)
self.wk_time_start = (model.data?.goods_res!.wk_time_start)
self.wk_time_end = (model.data?.goods_res!.wk_time_end)
self.ysszHolder.insert(end, at: 2)
self.ysszHolder.remove(at: 3)
}
//发货时间
if model.data?.goods_res?.set_time != nil {
self.faHuoTime = "\(model.data!.goods_res!.set_time!)"
}
//商品主图
for item in model.data!.banner_res! {
self.maxFiveImgsArr.append(item.img_original!)
}
//商品附图
let imgArr = model.data?.banner_res!
if imgArr!.count > 0 {
for i in 0 ..< imgArr!.count {
let imgData = imgArr![i]
self.goods_banner?.insert(imgData.img_original!, at: i)
self.goods_banner?.remove(at: i+1)
}
}
//关键字
self.keyWord = (model.data?.goods_res!.keywords)!
//物流费用
self.wuLiuPrice = (model.data?.goods_res!.logistics)!
//国家
self.countrySelect = (model.data?.goods_res!.coun_id)!-1
self.tishixxArr1.insert(self.countryArr[self.countrySelect!], at: 2)
self.tishixxArr1.remove(at: 3)
//商品状态
self.shangPinStatus = (model.data?.goods_res?.gs_id)!-1
self.tishixxArr1.insert((model.data?.goods_res!.gs_name)!, at: 3)
self.tishixxArr1.remove(at: 4)
//运输方式
self.yunShuType = (model.data?.goods_res!.transportation)! - 1
self.tishixxArr1.insert(self.yunShuTypeArr[self.yunShuType!], at: 4)
self.tishixxArr1.remove(at: 5)
//商品详情
self.goodsDesc = model.data?.goods_res?.goods_desc as! String
self.listTbv.reloadData()
}) { (error) in
}
} }
override func viewDidLoad() { override func viewDidLoad() {
...@@ -553,7 +553,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -553,7 +553,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
navbar.title = "商品详情" navbar.title = "商品详情"
self.view.addSubview(navbar) self.view.addSubview(navbar)
SetTopFrameView(view: listTbv, btmView: btmBtnBGView) SetTopFrameView(view: listTbv, btmView: btmBtnBGView)
loadData() loadData()
self.listTbv.separatorStyle = .none self.listTbv.separatorStyle = .none
...@@ -682,9 +682,11 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -682,9 +682,11 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
return cell return cell
} }
let cell = tableView.dequeueReusableCell(withIdentifier: "AddGuiGe") as! AddGuiGeCell let cell = tableView.dequeueReusableCell(withIdentifier: "AddGuiGe") as! AddGuiGeCell
cell.delegate = self
cell.tag = indexPath.section
cell.imgBtn.isUserInteractionEnabled = isAllEditing cell.imgBtn.isUserInteractionEnabled = isAllEditing
cell.imgBtn.setImage(UIImage(named: "xinzeng"), for: .normal) cell.imgBtn.setImage(UIImage(named: "xinzeng"), for: .normal)
cell.imgBtn.addTarget(self, action: #selector(addGuiGe(sender:)), for: .touchUpInside)
return cell return cell
case 3: case 3:
if indexPath.row == 0 { if indexPath.row == 0 {
...@@ -742,20 +744,20 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -742,20 +744,20 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
} }
default: default:
let cell = tableView.dequeueReusableCell(withIdentifier: "AddGuiGe") as! AddGuiGeCell let cell = tableView.dequeueReusableCell(withIdentifier: "AddGuiGe") as! AddGuiGeCell
cell.imgBtn.isUserInteractionEnabled = isAllEditing cell.imgBtn.isUserInteractionEnabled = isAllEditing
cell.imgBtn.tag = indexPath.row cell.tag = indexPath.section
if goodsDesc.count > 0 { if goodsDesc.count > 0 {
cell.webView.isHidden = false cell.webView.isHidden = false
let headerString : String = "<header><meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no'><style>img{max-width:100%}</style></header>" let headerString : String = "<header><meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no'><style>img{max-width:100%}</style></header>"
let goodsDescHmtl = "<html>" + goodsDesc + "</html>" let goodsDescHmtl = "<html>" + goodsDesc + "</html>"
cell.webView.loadHTMLString(goodsDescHmtl + headerString, baseURL: nil) cell.webView.loadHTMLString(goodsDescHmtl + headerString, baseURL: nil)
} }
cell.imgBtn.setImage(UIImage(named: "tjxq"), for: .normal) cell.imgBtn.setImage(UIImage(named: "tjxq"), for: .normal)
cell.btmH.constant = 25 cell.btmH.constant = 25
cell.imgBtn.addTarget(self, action: #selector(AddGuiGeCellClick(cell:)), for: .touchUpInside) cell.delegate = self
return cell return cell
} }
} }
...@@ -767,18 +769,30 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -767,18 +769,30 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
@objc func editHtml(){ @objc func editHtml(){
print("编辑软文") print("编辑软文")
let vc = LMNoteViewController() let vc = LMNoteViewController()
vc.htmlStr = goodsDesc; vc.htmlStr = goodsDesc;
vc.delegatedata = self vc.delegatedata = self
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
} }
func AddGuiGeCellClick(cell: AddGuiGeCell) { func AddGuiGeCellClick(cell: AddGuiGeCell) {
print("akkd == ",cell.tag)
let vc = LMNoteViewController() if cell.tag == 5 {
vc.htmlStr = goodsDesc; let vc = LMNoteViewController()
vc.delegatedata = self vc.htmlStr = goodsDesc;
self.navigationController?.pushViewController(vc, animated: true) vc.delegatedata = self
self.navigationController?.pushViewController(vc, animated: true)
}else{
print("新增规格")
let vc = CreatNewSpecsViewController()
vc.barTitle = "新增规格"
vc.delegate = self
vc.danWeiArr = generalInfoModel?.data!.unit
vc.isYuShouSetting = isYuShouShangPin!
vc.datasArr = guiGeArr
vc.selectIdx = selectIdx
self.navigationController?.pushViewController(vc, animated: true)
}
} }
//MARK: -- 点击按钮事件,跳转或者展示选择界面 //MARK: -- 点击按钮事件,跳转或者展示选择界面
func btnClick(content: String, cell: TitleAndBtnCell) { func btnClick(content: String, cell: TitleAndBtnCell) {
...@@ -1190,7 +1204,6 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -1190,7 +1204,6 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
//MARK: - 新增规格 //MARK: - 新增规格
@objc func addGuiGe(sender:UIView){ @objc func addGuiGe(sender:UIView){
print("新增规格") print("新增规格")
let vc = CreatNewSpecsViewController() let vc = CreatNewSpecsViewController()
vc.barTitle = "新增规格" vc.barTitle = "新增规格"
...@@ -1200,6 +1213,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -1200,6 +1213,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
vc.datasArr = guiGeArr vc.datasArr = guiGeArr
vc.selectIdx = selectIdx vc.selectIdx = selectIdx
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
} }
//MARK: - 新增、编辑规格数据返回 //MARK: - 新增、编辑规格数据返回
...@@ -1663,7 +1677,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -1663,7 +1677,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
var goodsDesc = "" var goodsDesc = ""
func getHTMLByVc(_ model: String!) { func getHTMLByVc(_ model: String!) {
goodsDesc = model goodsDesc = model
listTbv.reloadData() listTbv.reloadData()
} }
......
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