Commit d39d5f5f authored by lujunye's avatar lujunye

上下架

parent 972ba595
...@@ -116,8 +116,8 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -116,8 +116,8 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
self.btmBtnBGView.subviews.forEach { (view) in self.btmBtnBGView.subviews.forEach { (view) in
view.removeFromSuperview() view.removeFromSuperview()
} }
for i in 0 ..< self.editActionArr.count { for i in 0 ..< self.editActionArr.count {
let btn = UIButton(frame: CGRect(x: 0 , y: 1, width:fullScreenWidth, height: 49)) let btn = UIButton(frame: CGRect(x: 0 , y: 1, width:fullScreenWidth, height: 49))
self.btmBtnBGView.addSubview(btn) self.btmBtnBGView.addSubview(btn)
...@@ -230,8 +230,8 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -230,8 +230,8 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
goodsEdit(dic, success: { (data) in goodsEdit(dic, success: { (data) in
HUD.flash(.labeledSubSuccess(subtitle: "提交修改成功"), delay: 1.2) HUD.flash(.labeledSubSuccess(subtitle: "提交修改成功"), delay: 1.2)
self.btmBtnBGView.subviews.forEach { (view) in self.btmBtnBGView.subviews.forEach { (view) in
view.removeFromSuperview() view.removeFromSuperview()
} }
self.setBtmBtnUi() self.setBtmBtnUi()
self.isAllEditing = false self.isAllEditing = false
...@@ -247,7 +247,11 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -247,7 +247,11 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
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()
self.delegate?.EPViewControllerFinishEdit() self.delegate?.EPViewControllerFinishEdit()
} }
}) { (erro) in }) { (erro) in
...@@ -448,12 +452,34 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -448,12 +452,34 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
self.itemTypeArr?.remove(at: (model.data?.goods_res!.goods_type)!) self.itemTypeArr?.remove(at: (model.data?.goods_res!.goods_type)!)
} }
self.btmBtnBGView.subviews.forEach { (view) in
view.removeFromSuperview()
}
if model.data?.goods_res?.is_show == 0 {
if (self.titleStrArr?.contains("下架"))!{
self.titleStrArr?.insert("上架", at: 3)
self.titleStrArr?.remove(at: 1)
}
}else{
if (self.titleStrArr?.contains("上架"))!{
self.titleStrArr?.insert("下架", at: 1)
self.titleStrArr?.remove(at: 3)
}
}
self.setBtmBtnUi()
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]) if num > 1 {
titles.add(contentArr[num-1])
}else{
titles.add(contentArr[num])
}
} }
} }
if titles.componentsJoined(by: ",").contains("预售") { if titles.componentsJoined(by: ",").contains("预售") {
...@@ -570,6 +596,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -570,6 +596,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
self.faHuoTime = "\(model.data!.goods_res!.set_time!)" self.faHuoTime = "\(model.data!.goods_res!.set_time!)"
} }
//商品主图 //商品主图
self.maxFiveImgsArr.removeAll()
for item in model.data!.banner_res! { for item in model.data!.banner_res! {
self.maxFiveImgsArr.append(item.img_original!) self.maxFiveImgsArr.append(item.img_original!)
} }
...@@ -608,8 +635,10 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -608,8 +635,10 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
} }
func setBtmBtnUi(){ func setBtmBtnUi(){
titleStrArr?.insert("编辑", at: 0) if titleStrArr!.count == 2 {
titleStrArr?.append("删除") titleStrArr?.insert("编辑", at: 0)
titleStrArr?.append("删除")
}
let w = fullScreenWidth / 4 let w = fullScreenWidth / 4
// if titleStrArr!.count == 4 { // if titleStrArr!.count == 4 {
for i in 0 ..< titleStrArr!.count { for i in 0 ..< titleStrArr!.count {
......
...@@ -16,13 +16,13 @@ class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewD ...@@ -16,13 +16,13 @@ class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewD
super.viewDidLoad() super.viewDidLoad()
setTabv() setTabv()
let cover = UIView() // let cover = UIView()
self.view.addSubview(cover) // self.view.addSubview(cover)
cover.backgroundColor = UIColor.black // cover.backgroundColor = UIColor.black
cover.alpha = 0.3 // cover.alpha = 0.3
cover.snp.makeConstraints { (make) in // cover.snp.makeConstraints { (make) in
make.top.right.bottom.left.equalTo(0) // make.top.right.bottom.left.equalTo(0)
} // }
} }
//MARK:--二维码方法 //MARK:--二维码方法
......
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