Commit 8276368d authored by 刘俊宏's avatar 刘俊宏

新增新的上下架接口,修正订单列表UI

parent 14dae756
...@@ -218,5 +218,7 @@ ...@@ -218,5 +218,7 @@
<string>Order/refundOrSalesReturn</string> <string>Order/refundOrSalesReturn</string>
<key>订单确认收货</key> <key>订单确认收货</key>
<string>Order/confirmReceiving</string> <string>Order/confirmReceiving</string>
<key>商品上下/架</key>
<string>Goods/onOff</string>
</dict> </dict>
</plist> </plist>
...@@ -181,3 +181,13 @@ func messageList(_ params:[String:Any],success:@escaping (_ res:Any)->(),failtur ...@@ -181,3 +181,13 @@ func messageList(_ params:[String:Any],success:@escaping (_ res:Any)->(),failtur
failture(error) failture(error)
} }
} }
//MARK:--简单通用操作接口
//params-key(user_token,goods_id ,is_show(1上架,0下架))
func onOff(_ params:[String:Any],success:@escaping (_ res:Any)->(),failture:@escaping(_ error:Error)->()) {
NetworkRequest.sharedInstance.postRequest("商品上下/架", params, { (rep:DataResponse<UpDataModel>) in
}, success: { (data) in
success(data)
}) { (error) in
failture(error)
}
}
...@@ -465,7 +465,7 @@ class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollect ...@@ -465,7 +465,7 @@ class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollect
func sureGeliAlertViewAction(sender: UIButton) { func sureGeliAlertViewAction(sender: UIButton) {
if sender.tag == 1001{ if sender.tag == 1001{
editField(["user_token":UserToken as Any,"function_id":"15","prval":changeGoodsResModel!.goods_id as Any,"value":0,], success: { (data) in onOff(["user_token":UserToken as Any,"goods_id":changeGoodsResModel!.goods_id as Any,"is_show":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)
...@@ -478,7 +478,7 @@ class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollect ...@@ -478,7 +478,7 @@ class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollect
}else if sender.tag == 1002 { }else if sender.tag == 1002 {
editField(["user_token":UserToken as Any,"function_id":"15","prval":changeGoodsResModel!.goods_id as Any,"value":1,], success: { (data) in onOff(["user_token":UserToken as Any,"goods_id":changeGoodsResModel!.goods_id as Any,"is_show":1], 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)
......
...@@ -247,7 +247,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -247,7 +247,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
}else if sender.tag == 1003 { }else if sender.tag == 1003 {
editField(["user_token":UserToken as Any,"function_id":"15","prval":goods_id as Any,"value":1,], success: { (data) in onOff(["user_token":UserToken as Any,"goods_id":goods_id as Any,"is_show":1], 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)
...@@ -263,7 +263,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -263,7 +263,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
} }
}else if sender.tag == 1004 { }else if sender.tag == 1004 {
editField(["user_token":UserToken as Any,"function_id":"15","prval":goods_id as Any,"value":0,], success: { (data) in onOff(["user_token":UserToken as Any,"goods_id":goods_id as Any,"is_show":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)
......
...@@ -185,16 +185,8 @@ class OrderListVC: BaseViewController, UITableViewDelegate, UITableViewDataSourc ...@@ -185,16 +185,8 @@ class OrderListVC: BaseViewController, UITableViewDelegate, UITableViewDataSourc
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "CGDListCell") as! CGDListCell let cell = tableView.dequeueReusableCell(withIdentifier: "CGDListCell") as! CGDListCell
let rowModel = self.dataArr[indexPath.row] let rowModel = self.dataArr[indexPath.row]
// cell.leftIcon.isHidden = true
// cell.nameLblLeft.constant = -15
if rowModel.cus_name != nil {
cell.nameLbl.text = rowModel.cus_name!
}else{
if rowModel.user_name != nil {
cell.nameLbl.text = rowModel.user_name!
}
}
cell.orderNumerLbl.text = rowModel.order_sn! cell.orderNumerLbl.text = rowModel.order_sn!
if rowModel.order_status != nil && rowModel.order_status_d != nil && rowModel.goods_before_pay != nil { if rowModel.order_status != nil && rowModel.order_status_d != nil && rowModel.goods_before_pay != nil {
...@@ -207,25 +199,38 @@ class OrderListVC: BaseViewController, UITableViewDelegate, UITableViewDataSourc ...@@ -207,25 +199,38 @@ class OrderListVC: BaseViewController, UITableViewDelegate, UITableViewDataSourc
cell.formLbl.isHidden = true cell.formLbl.isHidden = true
cell.yuShouStatus.isHidden = true cell.yuShouStatus.isHidden = true
cell.orderNumberRight.constant = 15 cell.beforeOrderLbl.isHidden = true
if rowModel.order_type == 1 {
cell.yuShouStatus.isHidden = true if rowModel.order_type == 4 {
}else{
cell.yuShouStatus.isHidden = false cell.yuShouStatus.isHidden = false
cell.orderNumberRight.constant = 56 }else{
cell.yuShouStatus.isHidden = true
} }
if rowModel.from == 3 { if rowModel.from == 3 {
cell.formLbl.isHidden = false cell.formLbl.isHidden = false
cell.orderNumberRight.constant = 78 if cell.yuShouStatus.isHidden {
cell.yuShouStatus.isHidden = true cell.formNSlayout.constant = 8
}else{
cell.formNSlayout.constant = 8 + 18 + 8
}
}else{ }else{
cell.formLbl.isHidden = true cell.formLbl.isHidden = true
} }
if rowModel.order_type == 4 { if rowModel.goods_before_pay == 1 {
cell.formLbl.isHidden = true cell.beforeOrderLbl.isHidden = false
cell.orderNumberRight.constant = 56 if cell.yuShouStatus.isHidden && cell.formLbl.isHidden {
cell.yuShouStatus.isHidden = false cell.beforeNSLayout.constant = 8
}else if cell.yuShouStatus.isHidden && !cell.formLbl.isHidden {
cell.beforeNSLayout.constant = 8 + 18 + 8
}else if !cell.yuShouStatus.isHidden && cell.formLbl.isHidden {
cell.beforeNSLayout.constant = 8 + 18 + 8
}else{
cell.beforeNSLayout.constant = 8 + 18 + 8 + 18 + 8
}
}else{
cell.beforeOrderLbl.isHidden = true
} }
var btnStr:Array<String> = [] var btnStr:Array<String> = []
switch rowModel.order_status { switch rowModel.order_status {
...@@ -247,12 +252,12 @@ class OrderListVC: BaseViewController, UITableViewDelegate, UITableViewDataSourc ...@@ -247,12 +252,12 @@ class OrderListVC: BaseViewController, UITableViewDelegate, UITableViewDataSourc
case 6://待发货 case 6://待发货
if rowModel.from == 3 || rowModel.from == 5 {//销售下单 if rowModel.from == 3 || rowModel.from == 5 {//销售下单
btnStr = ["发货","取消订单并退款"] btnStr = ["发货","取消订单并退款"]
if rowModel.pay_status == 0{ if rowModel.pay_status != 2{
btnStr = ["发货","取消订单","确认收款"] btnStr = ["发货","取消订单","确认收款"]
} }
}else{ }else{
btnStr = ["发货","退款"] btnStr = ["发货","退款"]
if rowModel.pay_status == 0{ if rowModel.pay_status != 2{
btnStr = ["发货","取消订单"] btnStr = ["发货","取消订单"]
} }
} }
...@@ -267,12 +272,12 @@ class OrderListVC: BaseViewController, UITableViewDelegate, UITableViewDataSourc ...@@ -267,12 +272,12 @@ class OrderListVC: BaseViewController, UITableViewDelegate, UITableViewDataSourc
case 7://待收货 case 7://待收货
if rowModel.from == 3 || rowModel.from == 5 {//销售下单 if rowModel.from == 3 || rowModel.from == 5 {//销售下单
btnStr = ["确认收货","退款退货","退款"] btnStr = ["确认收货","退款退货","退款"]
if rowModel.pay_status == 0{//未收款 if rowModel.pay_status != 2{//未收款
btnStr = ["确认收货","确认收款","取消订单"] btnStr = ["确认收货","确认收款","取消订单"]
} }
}else{ }else{
btnStr = ["退款"] btnStr = ["退款"]
if rowModel.pay_status == 0 { if rowModel.pay_status != 2 {
btnStr = ["取消订单"] btnStr = ["取消订单"]
} }
if rowModel.goods_before_pay == 1 && orderStatus == 1{ if rowModel.goods_before_pay == 1 && orderStatus == 1{
...@@ -294,7 +299,7 @@ class OrderListVC: BaseViewController, UITableViewDelegate, UITableViewDataSourc ...@@ -294,7 +299,7 @@ class OrderListVC: BaseViewController, UITableViewDelegate, UITableViewDataSourc
break break
case 10://已收货 case 10://已收货
btnStr = ["退款退货"] btnStr = ["退款退货"]
if rowModel.pay_status == 0 { if rowModel.pay_status != 2 {
btnStr = ["取消订单"] btnStr = ["取消订单"]
} }
if rowModel.from == 3 || rowModel.from == 5 { if rowModel.from == 3 || rowModel.from == 5 {
...@@ -687,9 +692,9 @@ class OrderListVC: BaseViewController, UITableViewDelegate, UITableViewDataSourc ...@@ -687,9 +692,9 @@ class OrderListVC: BaseViewController, UITableViewDelegate, UITableViewDataSourc
let rowModel = self.dataArr[indexPath.row] let rowModel = self.dataArr[indexPath.row]
if rowModel.order_goods!.count > 4 { if rowModel.order_goods!.count > 4 {
return CGFloat(200 + (49 * 4)) return CGFloat(185 + (49 * 4))
} }
return CGFloat(200 + (49 * rowModel.order_goods!.count)) return CGFloat(185 + (49 * rowModel.order_goods!.count))
} }
} }
...@@ -1199,7 +1199,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -1199,7 +1199,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
case 1: case 1:
// str = "已确定" "待付款" // str = "已确定" "待付款"
titleArr = ["修改价格","付款码","取消订单"] titleArr = ["修改价格","付款码","取消订单"]
if self.dataMdoel!.order_res?.shipping_status == 1 && self.dataMdoel!.order_res?.pay_status == 0 { if self.dataMdoel!.order_res?.shipping_status == 1 && self.dataMdoel!.order_res?.pay_status != 2 {
titleArr = ["修改价格","付款码","退货"] titleArr = ["修改价格","付款码","退货"]
} }
// if self.dataMdoel?.order_res. // if self.dataMdoel?.order_res.
...@@ -1211,12 +1211,12 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -1211,12 +1211,12 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
// str = "待发货" // str = "待发货"
if self.dataMdoel?.order_res?.from == 3 || self.dataMdoel?.order_res?.from == 5 { if self.dataMdoel?.order_res?.from == 3 || self.dataMdoel?.order_res?.from == 5 {
titleArr = ["取消订单并退款","发货"] titleArr = ["取消订单并退款","发货"]
if self.dataMdoel!.order_res?.pay_status == 0{ if self.dataMdoel!.order_res?.pay_status != 2{
titleArr = ["确认收款","取消订单","发货"] titleArr = ["确认收款","取消订单","发货"]
} }
}else{ }else{
titleArr = ["退款","发货"] titleArr = ["退款","发货"]
if self.dataMdoel!.order_res?.pay_status == 0{ if self.dataMdoel!.order_res?.pay_status != 2{
titleArr = ["取消订单","发货"] titleArr = ["取消订单","发货"]
} }
if self.dataMdoel!.order_res?.goods_before_pay == 1 && lmIdx == 1{ if self.dataMdoel!.order_res?.goods_before_pay == 1 && lmIdx == 1{
...@@ -1231,12 +1231,12 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -1231,12 +1231,12 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
// str = "待收货" // str = "待收货"
if self.dataMdoel?.order_res?.from == 3 || self.dataMdoel?.order_res?.from == 5 { if self.dataMdoel?.order_res?.from == 3 || self.dataMdoel?.order_res?.from == 5 {
titleArr = ["退款","退款退货","确认收货"] titleArr = ["退款","退款退货","确认收货"]
if self.dataMdoel?.order_res?.pay_status == 0{//未收款 if self.dataMdoel?.order_res?.pay_status != 2{//未收款
titleArr = ["取消订单","确认收款","确认收货"] titleArr = ["取消订单","确认收款","确认收货"]
} }
}else{ }else{
titleArr = ["退款"] titleArr = ["退款"]
if self.dataMdoel?.order_res?.pay_status == 0 { if self.dataMdoel?.order_res?.pay_status != 2 {
titleArr = ["取消订单"] titleArr = ["取消订单"]
} }
if self.dataMdoel?.order_res?.goods_before_pay == 1 && lmIdx == 1{ if self.dataMdoel?.order_res?.goods_before_pay == 1 && lmIdx == 1{
...@@ -1290,7 +1290,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -1290,7 +1290,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
// str = "订单关闭"str = "已取消" //用户取消(预售 // str = "订单关闭"str = "已取消" //用户取消(预售
titleArr = ["退款退货"] titleArr = ["退款退货"]
if self.dataMdoel!.order_res?.pay_status == 0 { if self.dataMdoel!.order_res?.pay_status != 2 {
titleArr = ["取消订单"] titleArr = ["取消订单"]
} }
if self.dataMdoel!.order_res?.from == 3 || self.dataMdoel!.order_res?.from == 5 { if self.dataMdoel!.order_res?.from == 3 || self.dataMdoel!.order_res?.from == 5 {
...@@ -1303,7 +1303,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -1303,7 +1303,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
// if self.dataMdoel!.order_res?.goods_before_pay == 1 && lmIdx == 1{ // if self.dataMdoel!.order_res?.goods_before_pay == 1 && lmIdx == 1{
// titleArr = ["付款码"] // titleArr = ["付款码"]
// } // }
// if self.dataMdoel!.order_res?.pay_status == 0 { // if self.dataMdoel!.order_res?.pay_status != 2 {
// if self.dataMdoel?.order_res?.from == 3 || self.dataMdoel?.order_res?.from == 5 { // if self.dataMdoel?.order_res?.from == 3 || self.dataMdoel?.order_res?.from == 5 {
// titleArr = ["确认收款"] // titleArr = ["确认收款"]
// } // }
......
...@@ -11,15 +11,13 @@ protocol CGDListCellDelegate { ...@@ -11,15 +11,13 @@ protocol CGDListCellDelegate {
func allBtnSubmit(sender: UIButton) func allBtnSubmit(sender: UIButton)
} }
class CGDListCell: UITableViewCell { class CGDListCell: UITableViewCell {
//先货后款图标
@IBOutlet weak var beforeOrderLbl: UILabel!
//销售下单图标 //销售下单图标
@IBOutlet weak var formLbl: UILabel! @IBOutlet weak var formLbl: UILabel!
///预售图标 ///预售图标
@IBOutlet weak var yuShouStatus: UILabel! @IBOutlet weak var yuShouStatus: UILabel!
///标题左间距 ///列表底图
@IBOutlet weak var nameLblLeft: NSLayoutConstraint!
///图标
@IBOutlet weak var leftIcon: UIImageView!
///列表底图
@IBOutlet weak var listBgView: UIView! @IBOutlet weak var listBgView: UIView!
///按钮底图 ///按钮底图
@IBOutlet weak var btnBgView: UIView! @IBOutlet weak var btnBgView: UIView!
...@@ -29,13 +27,14 @@ class CGDListCell: UITableViewCell { ...@@ -29,13 +27,14 @@ class CGDListCell: UITableViewCell {
@IBOutlet weak var priceLbl: UILabel! @IBOutlet weak var priceLbl: UILabel!
///状态 ///状态
@IBOutlet weak var statusLbl: UILabel! @IBOutlet weak var statusLbl: UILabel!
///标题
@IBOutlet weak var nameLbl: UILabel!
///时间 ///时间
@IBOutlet weak var timeLbl: UILabel! @IBOutlet weak var timeLbl: UILabel!
@IBOutlet weak var orderNumerLbl: UILabel! @IBOutlet weak var orderNumerLbl: UILabel!
@IBOutlet weak var orderNumberRight: NSLayoutConstraint! @IBOutlet weak var formNSlayout: NSLayoutConstraint!
@IBOutlet weak var beforeNSLayout: NSLayoutConstraint!
var delegate:CGDListCellDelegate? var delegate:CGDListCellDelegate?
//订单列表数据 //订单列表数据
......
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