Commit 0afe6076 authored by 刘俊宏's avatar 刘俊宏

订单详情待完善

parent a55b3ec7
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
import UIKit import UIKit
import SwiftDate //日期处理库 import SwiftDate //日期处理库
import SwiftyJSON
//版本号 //版本号
let systemVersion = (UIDevice.current.systemVersion as String) let systemVersion = (UIDevice.current.systemVersion as String)
...@@ -230,4 +231,18 @@ func dayByDouble (sender : Double ) -> String { ...@@ -230,4 +231,18 @@ func dayByDouble (sender : Double ) -> String {
dformatter.dateFormat = "yyyy.MM.dd" dformatter.dateFormat = "yyyy.MM.dd"
return dformatter.string(from: data) return dformatter.string(from: data)
} }
//MARK:--数组转字符串
func dataChangeString(sender:Array<Any>) -> String{
var str = ""
do {
let json = JSON(sender)
let data = try! JSONEncoder().encode(json)
str = String(data: data, encoding: .utf8)!
}catch {
str = ""
}
return str
}
...@@ -67,6 +67,8 @@ class OrderDetailResModel: Mappable { ...@@ -67,6 +67,8 @@ class OrderDetailResModel: Mappable {
var order_type : Int?//订单类型 1普通2期货3团购4预售 var order_type : Int?//订单类型 1普通2期货3团购4预售
var order_status : Int?//订单状态 var order_status : Int?//订单状态
var order_status_d : Int?//订单详细状态 var order_status_d : Int?//订单详细状态
var shipping_type : Int?//配送方式:1派送,2自提
var sale_res : OrderDetailSaleResModel?//订单预售详情(不是预售订单为空数组,无key=>value)
required init?( map: Map) { required init?( map: Map) {
...@@ -101,6 +103,8 @@ class OrderDetailResModel: Mappable { ...@@ -101,6 +103,8 @@ class OrderDetailResModel: Mappable {
order_status_d <- map["order_status_d"] order_status_d <- map["order_status_d"]
logistics_price <- map["logistics_price"] logistics_price <- map["logistics_price"]
other_price <- map["other_price"] other_price <- map["other_price"]
shipping_type <- map["shipping_type"]
sale_res <- map["sale_res"]
} }
} }
...@@ -109,8 +113,7 @@ func orderStatusStrByInt(statusNumber:Int) -> String? { ...@@ -109,8 +113,7 @@ func orderStatusStrByInt(statusNumber:Int) -> String? {
switch statusNumber { switch statusNumber {
case 0: case 0:
str = "未确定" str = "未确定"
break
break
//待付款 //待付款
case 1: case 1:
str = "待付款" str = "待付款"
...@@ -140,7 +143,48 @@ func orderStatusStrByInt(statusNumber:Int) -> String? { ...@@ -140,7 +143,48 @@ func orderStatusStrByInt(statusNumber:Int) -> String? {
} }
return str return str
} }
class OrderDetailSaleResModel: Mappable {
var id:Int?
var order_id : Int?
var need_check : Int?
var dj_time_start : Double? //定金开始支付时间
var dj_time_end : Double? //定金截止支付时间
var dj_pay_time : Double?
var wk_time_start : Double?
var wk_time_end : Double? //尾款开始支付时间
var wk_pay_time : Double? //尾款截止支付时间
var set_time : Int?
var dj_amount : String? //定金金额
var dj_pay_type : Int?
var dj_pay_status : Int? //定金支付状态:0未付款; 1已付款 2退款
var wk_amount : String? //尾款金额
var wk_pay_type : Int?
var wk_pay_status : Int? //尾款支付状态:0未付款; 1已付款 2退款
required init?( map: Map) {
}
func mapping(map: Map) {
id <- map["id"]
order_id <- map["order_id"]
need_check <- map["need_check"]
dj_time_start <- map["dj_time_start"]
dj_time_end <- map["dj_time_end"]
dj_pay_time <- map["dj_pay_time"]
wk_time_start <- map["wk_time_start"]
wk_time_end <- map["wk_time_end"]
wk_pay_time <- map["wk_pay_time"]
set_time <- map["set_time"]
dj_amount <- map["dj_amount"]
dj_pay_type <- map["dj_pay_type"]
dj_pay_status <- map["dj_pay_status"]
wk_amount <- map["wk_amount"]
wk_pay_type <- map["wk_pay_type"]
wk_pay_status <- map["wk_pay_status"]
}
}
class OrderDetailGoodsModel: Mappable { class OrderDetailGoodsModel: Mappable {
var og_id:Int? //订单商品号 var og_id:Int? //订单商品号
......
...@@ -9,7 +9,12 @@ ...@@ -9,7 +9,12 @@
import UIKit import UIKit
class ChangePriceNormalCell: UITableViewCell { class ChangePriceNormalCell: UITableViewCell {
@IBOutlet weak var priceTf: UITextField!
@IBOutlet weak var goodsImgVire: UIImageView!
@IBOutlet weak var goodsNameLbl: UILabel!
@IBOutlet weak var attrrLbl: UILabel!
@IBOutlet weak var detailLbl: UILabel!
override func awakeFromNib() { override func awakeFromNib() {
super.awakeFromNib() super.awakeFromNib()
self.selectionStyle = .none self.selectionStyle = .none
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/> <device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<capability name="Named colors" minToolsVersion="9.0"/> <capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
...@@ -123,6 +123,13 @@ ...@@ -123,6 +123,13 @@
</constraints> </constraints>
</tableViewCellContentView> </tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/> <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<connections>
<outlet property="attrrLbl" destination="M0a-4J-sX5" id="lmf-mw-WuZ"/>
<outlet property="detailLbl" destination="O9n-cz-Xp6" id="2yG-Gh-aIr"/>
<outlet property="goodsImgVire" destination="FVu-j5-tnp" id="BWQ-5E-7Z3"/>
<outlet property="goodsNameLbl" destination="DBa-5v-4sS" id="rVw-o4-1uV"/>
<outlet property="priceTf" destination="82B-G7-MGb" id="VgF-Z2-XBG"/>
</connections>
<point key="canvasLocation" x="131.15942028985509" y="122.54464285714285"/> <point key="canvasLocation" x="131.15942028985509" y="122.54464285714285"/>
</tableViewCell> </tableViewCell>
</objects> </objects>
......
...@@ -18,12 +18,22 @@ class GuanLianKehuVC: BaseViewController , UITableViewDelegate, UITableViewDataS ...@@ -18,12 +18,22 @@ class GuanLianKehuVC: BaseViewController , UITableViewDelegate, UITableViewDataS
var selectIdx:Int? = nil//暂代关联客户数据 var selectIdx:Int? = nil//暂代关联客户数据
var order_id:Int? = 0
@IBAction func submitAction(_ sender: LGButton) { @IBAction func submitAction(_ sender: LGButton) {
print("确定") print("确定")
if selectIdx != nil{ if selectIdx != nil{
HUD.flash(.progress)
self.delegate?.GuanLianKehuSelect(keHuData: self.dataArr[selectIdx!]) let model = self.dataArr[self.selectIdx!]
self.navigationController?.popViewController(animated: true) let UserToken = UserDefaults.standard.value(forKey: "user_token")
bindCus(["cus_id":model.cus_id as Any,"user_token":UserToken as Any,"order_id":order_id as Any], success: { (data) in
self.delegate?.GuanLianKehuSelect(keHuData: self.dataArr[self.selectIdx!])
self.navigationController?.popViewController(animated: true)
}) { (error) in
}
}else{ }else{
HUD.flash(.label("请选择关联客户"), delay: 1.2) HUD.flash(.label("请选择关联客户"), delay: 1.2)
} }
......
...@@ -8,50 +8,81 @@ ...@@ -8,50 +8,81 @@
import UIKit import UIKit
import ViewAnimator import ViewAnimator
import LGButton
class ChangeGoodsPriceVC: BaseViewController , UITableViewDelegate, UITableViewDataSource { class ChangeGoodsPriceVC: BaseViewController , UITableViewDelegate, UITableViewDataSource,UITextFieldDelegate {
var orderID:Int? = 0
var dataArr : Array<OrderDetailGoodsModel>? = []
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
navbar.title = "修改价格" navbar.title = "修改价格"
self.view.addSubview(navbar) self.view.addSubview(navbar)
setTabv() setTabv()
} }
var tableV :UITableView! @IBOutlet weak var sureBtn: LGButton!
//MARK:--确认修改价格
@IBAction func sureAction(_ sender: LGButton) {
let UserToken = UserDefaults.standard.value(forKey: "user_token")
let order_goods = dataChangeString(sender: [""])
private let animations = [AnimationType.from(direction: .bottom, offset: 150*glscale)] editOrderGoodsPrice(["user_token":UserToken as Any,"order_id":orderID as Any,"order_goods":order_goods], success: { (data) in
func setTabv() {
tableV = UITableView() }) { (error) in
view.addSubview(tableV);
tableV.snp.makeConstraints { (make) in
make.left.right.bottom.equalToSuperview() }
make.top.equalTo(navbar.snp_bottom)
}
tableV.backgroundColor = UIColor.init(named: "白色背景色")
tableV.delegate = self
tableV.dataSource = self
tableV.separatorStyle = .none
tableV?.register(UINib(nibName: "ChangePriceNormalCell", bundle: nil), forCellReuseIdentifier: "ChangePriceNormalCell")
} }
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 3
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "ChangePriceNormalCell") as! ChangePriceNormalCell
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
print(indexPath)
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 120*glscale
}
var tableV :UITableView!
private let animations = [AnimationType.from(direction: .bottom, offset: 150*glscale)]
func setTabv() {
tableV = UITableView()
view.addSubview(tableV);
tableV.snp.makeConstraints { (make) in
make.left.right.equalToSuperview()
make.top.equalTo(navbar.snp_bottom)
make.bottom.equalTo(sureBtn.snp_top)
}
tableV.backgroundColor = UIColor.init(named: "白色背景色")
tableV.delegate = self
tableV.dataSource = self
tableV.separatorStyle = .none
tableV?.register(UINib(nibName: "ChangePriceNormalCell", bundle: nil), forCellReuseIdentifier: "ChangePriceNormalCell")
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 20
// return dataArr!.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "ChangePriceNormalCell") as! ChangePriceNormalCell
let rowModel = dataArr![indexPath.row]
//图片暂不处理
// cell.imageView?.kf.setImage(with: <#T##Resource?#>)
// cell.goodsNameLbl.text = rowModel.goods_name
// cell.attrrLbl.text = rowModel.goods_attr
// cell.priceTf.text = rowModel.goods_price
// cell.detailLbl.isHidden = true
cell.priceTf.delegate = self
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
print(indexPath)
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 120*glscale
}
} }
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13142" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12042"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ChangeGoodsPriceVC" customModuleProvider="target"> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ChangeGoodsPriceVC" customModule="GeliBusinessPlatform" customModuleProvider="target">
<connections> <connections>
<outlet property="sureBtn" destination="u6y-CU-3oP" id="jeI-hQ-epr"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections> </connections>
</placeholder> </placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT"> <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/> <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="u6y-CU-3oP" customClass="LGButton" customModule="LGButton">
<rect key="frame" x="0.0" y="813" width="414" height="83"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="gradientStartColor">
<color key="value" name="按钮渐变色上"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="gradientEndColor">
<color key="value" name="按钮渐变色下,字体颜色"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="sureAction:" destination="-1" eventType="touchUpInside" id="dQU-Ds-dPq"/>
</connections>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Jwf-MV-g9X">
<rect key="frame" x="0.0" y="813" width="414" height="49"/>
<constraints>
<constraint firstAttribute="height" constant="49" id="QaX-zk-pCO"/>
</constraints>
<attributedString key="attributedText">
<fragment content="确定">
<attributes>
<color key="NSColor" name="白色背景色"/>
<font key="NSFont" size="17" name="PingFangSC-Medium"/>
<paragraphStyle key="NSParagraphStyle" alignment="center" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
</attributes>
</fragment>
</attributedString>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="u6y-CU-3oP" firstAttribute="top" secondItem="Jwf-MV-g9X" secondAttribute="top" id="5Yi-pA-FXO"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="Jwf-MV-g9X" secondAttribute="bottom" id="UCr-zS-np2"/>
<constraint firstItem="u6y-CU-3oP" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="X8V-91-hcU"/>
<constraint firstAttribute="bottom" secondItem="u6y-CU-3oP" secondAttribute="bottom" id="dKk-I3-KQD"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="u6y-CU-3oP" secondAttribute="trailing" id="fJG-aG-A6R"/>
<constraint firstItem="Jwf-MV-g9X" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="s0Y-gq-QBf"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="Jwf-MV-g9X" secondAttribute="trailing" id="s4G-5u-agd"/>
</constraints>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/> <viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<point key="canvasLocation" x="132" y="119"/>
</view> </view>
</objects> </objects>
<resources>
<namedColor name="按钮渐变色上">
<color red="0.3880000114440918" green="0.62400001287460327" blue="0.90200001001358032" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="按钮渐变色下,字体颜色">
<color red="0.27843137254901962" green="0.5607843137254902" blue="0.8901960784313725" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="白色背景色">
<color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document> </document>
...@@ -10,6 +10,8 @@ import UIKit ...@@ -10,6 +10,8 @@ import UIKit
import LGButton import LGButton
class XiuGaiYuShouJiaViewController: BaseViewController { class XiuGaiYuShouJiaViewController: BaseViewController {
var dataModel : OrderDetailDataModel?
var orderID:Int? = 0
@IBOutlet weak var firstView: UIView! @IBOutlet weak var firstView: UIView!
@IBOutlet weak var weiKuanTF: UITextField! @IBOutlet weak var weiKuanTF: UITextField!
...@@ -33,12 +35,20 @@ class XiuGaiYuShouJiaViewController: BaseViewController { ...@@ -33,12 +35,20 @@ class XiuGaiYuShouJiaViewController: BaseViewController {
make.left.right.equalTo(0) make.left.right.equalTo(0)
make.height.equalTo(120*glscale) make.height.equalTo(120*glscale)
} }
// Do any additional setup after loading the view. if (dataModel?.order_goods!.count)! > 0 {
let rowModel = dataModel?.order_goods![0]
titleLbl.text = rowModel!.goods_name
detailLbl.text = rowModel?.goods_attr
countLbl.isHidden = true
dingJinTF.text = dataModel?.order_res?.sale_res?.dj_amount
weiKuanTF.text = dataModel?.order_res?.sale_res?.wk_amount
}
} }
@IBAction func submitACTION(_ sender: Any) { @IBAction func submitACTION(_ sender: Any) {
print("预售返回上一级且提交了数据")
} }
/* /*
// MARK: - Navigation // MARK: - Navigation
......
...@@ -8,12 +8,13 @@ ...@@ -8,12 +8,13 @@
import UIKit import UIKit
class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,TitleAndBtnCellDelegate,GuanLianKehuVCDelegate,OrderDViewFooterViewDelegate,TitleAndTFCellDelegate,CommendCellDelegate{ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,TitleAndBtnCellDelegate,GuanLianKehuVCDelegate,OrderDViewFooterViewDelegate,TitleAndTFCellDelegate,CommendCellDelegate,GeliAlertViewDelegate{
var orderId:Int? //订单编号 var orderId:Int? //订单编号
var isYuShou:Bool = false //是否预售 var isYuShou:Bool = false //是否预售
var dataArr:Array<Any> = ["a","b"] //订单产品数据
var btmBtnsTitleArr:Array<Any> = ["修改价格","打印","确认订单"]//底栏按钮数据 var dataArr:NSArray = ["a","b"] //订单产品数据
var btmBtnsTitleArr:Array<String> = []//底栏按钮数据
let yuShouTitleArr = ["定金:","尾款:","商品合计:","物流费用:","其它费用:"] let yuShouTitleArr = ["定金:","尾款:","商品合计:","物流费用:","其它费用:"]
let nonYuShouTitleArr = ["商品合计:","物流费用:","其它费用:"] let nonYuShouTitleArr = ["商品合计:","物流费用:","其它费用:"]
...@@ -23,6 +24,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -23,6 +24,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
@IBOutlet weak var btmViewH: NSLayoutConstraint! @IBOutlet weak var btmViewH: NSLayoutConstraint!
@IBOutlet weak var bottomView: UIView! @IBOutlet weak var bottomView: UIView!
@IBOutlet weak var listView: UITableView! @IBOutlet weak var listView: UITableView!
@IBOutlet weak var bottomBgView: UIView!
var cell4Height = 18.5 var cell4Height = 18.5
var cell5Height = 18.5 var cell5Height = 18.5
...@@ -44,8 +46,36 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -44,8 +46,36 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
self.isYuShou = false self.isYuShou = false
} }
self.btmBtnsTitleArr.removeAll()
self.bottomView.subviews.forEach { (view) in
view.removeFromSuperview()
}
//MARK:--底部视图,根据数据显示
self.btmBtnsTitleArr = self.getOrderBottomBtnTitleStrByStatus(status: (self.dataMdoel?.order_res?.order_status)!)
if self.btmBtnsTitleArr.count == 0 {
self.btmViewH.constant = 0
self.bottomView.isHidden = true
self.bottomBgView.isHidden = true
}else{
self.bottomView.isHidden = false
self.bottomBgView.isHidden = false
for i in 0 ..< self.btmBtnsTitleArr.count{
let title = self.btmBtnsTitleArr[i]
let width = fullScreenWidth / CGFloat(self.btmBtnsTitleArr.count)
let btn = UIButton(frame: CGRect(x: CGFloat(i) * width, y: 0, width: width, height: self.bottomView.bounds.size.height))
btn.setTitleColor(UIColor(named: "蓝色字体颜色"), for: .normal)
btn.titleLabel?.font = UIFont.boldSystemFont(ofSize: 13)
btn.setTitle(title, for: .normal)
btn.addTarget(self, action: #selector(self.bottomBtnClick(sender:)), for: .touchUpInside)
self.bottomView.addSubview(btn)
}
}
self.listView.reloadData() self.listView.reloadData()
}) { (error) in }) { (error) in
} }
...@@ -55,7 +85,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -55,7 +85,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
navbar.title = "订单详情" navbar.title = "订单详情"
self.view.addSubview(navbar) self.view.addSubview(navbar)
loadData() loadData()
SetTopFrameView(view: listView, btmView: bottomView) SetTopFrameView(view: listView, btmView: bottomView)
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
...@@ -65,25 +95,98 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -65,25 +95,98 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
listView.register(UINib(nibName: "XuanZeShangPinCell", bundle: nil), forCellReuseIdentifier: "XuanZeShangPinCell") listView.register(UINib(nibName: "XuanZeShangPinCell", bundle: nil), forCellReuseIdentifier: "XuanZeShangPinCell")
listView.register(UINib(nibName: "CommendCell", bundle: nil), forCellReuseIdentifier: "CommendCell") listView.register(UINib(nibName: "CommendCell", bundle: nil), forCellReuseIdentifier: "CommendCell")
if btmBtnsTitleArr.count == 0 {
btmViewH.constant = 0
}else{
for i in 0 ..< btmBtnsTitleArr.count{
let title = btmBtnsTitleArr[i] as! String
let width = fullScreenWidth / CGFloat(btmBtnsTitleArr.count)
let btn = UIButton(frame: CGRect(x: CGFloat(i) * width, y: 0, width: width, height: bottomView.bounds.size.height))
btn.setTitleColor(UIColor(named: "蓝色字体颜色"), for: .normal)
btn.titleLabel?.font = UIFont.boldSystemFont(ofSize: 13)
btn.setTitle(title, for: .normal)
btn.addTarget(self, action: #selector(bottomBtnClick(sender:)), for: .touchUpInside)
bottomView.addSubview(btn)
}
}
} }
//MARK: - 底部自定义方法 //MARK: - 底部自定义方法
@objc func bottomBtnClick(sender:UIButton){ @objc func bottomBtnClick(sender:UIButton){
print(sender.titleLabel?.text)
let UserToken = UserDefaults.standard.value(forKey: "user_token")
switch sender.titleLabel?.text {
case "修改价格":
if isYuShou {
let vc = XiuGaiYuShouJiaViewController()
vc.dataModel = self.dataMdoel
vc.orderID = self.orderId
self.navigationController?.pushViewController(vc, animated: true)
}else{
let vc = ChangeGoodsPriceVC()
vc.dataArr = self.dataMdoel?.order_goods
vc.orderID = self.orderId
self.navigationController?.pushViewController(vc, animated: true)
}
break
case "打印":
//暂无
print("暂无")
break
case "确认订单":
isSrueOrder = true
let alertView = GeliAlertView(frame: self.view.window!.bounds)
alertView.delegate = self;
alertView.tishiLbl.text = ""
alertView.titileLbl.text = "是否确认订单?"
alertView.rightBtn.setAttributedTitle(NSAttributedString(string: "确认"), for: .normal)
self.view.window?.addSubview(alertView)
break
case "取消订单":
isSrueOrder = false
let alertView = GeliAlertView(frame: self.view.window!.bounds)
alertView.delegate = self;
alertView.tishiLbl.text = ""
alertView.titileLbl.text = "是否确认取消订单?"
alertView.rightBtn.setAttributedTitle(NSAttributedString(string: "确认"), for: .normal)
self.view.window?.addSubview(alertView)
break
case "直接发货":
HUD.flash(.progress)
if isYuShou {
sendOutAd(["user_token":UserToken as Any,"order_id" : self.dataMdoel?.order_res?.order_id as Any], success: { (data) in
HUD.flash(.labeledSubSuccess(subtitle: "提交成功"),delay: 1.2)
self.loadData()
}) { (error) in
}
}else{
sendOut(["user_token":UserToken as Any,"order_id" : self.dataMdoel?.order_res?.order_id as Any], success: { (data) in
HUD.flash(.labeledSubSuccess(subtitle: "提交成功"),delay: 1.2)
self.loadData()
}) { (error) in
}
}
break
case "退款":
HUD.flash(.progress)
orderRefund(["user_token":UserToken as Any,"order_id" : self.dataMdoel?.order_res?.order_id as Any], success: { (data) in
HUD.flash(.labeledSubSuccess(subtitle: "提交成功"),delay: 1.2)
self.loadData()
}) { (error) in
}
break
case "退货":
HUD.flash(.progress)
if isYuShou {
orderReturnedGoodsAd(["user_token":UserToken as Any,"order_id" : self.dataMdoel?.order_res?.order_id as Any], success: { (data) in
HUD.flash(.labeledSubSuccess(subtitle: "提交成功"),delay: 1.2)
self.loadData()
}) { (error) in
}
}else{
orderReturnedGoods(["user_token":UserToken as Any,"order_id" : self.dataMdoel?.order_res?.order_id as Any], success: { (data) in
HUD.flash(.labeledSubSuccess(subtitle: "提交成功"),delay: 1.2)
self.loadData()
}) { (error) in
}
}
break
default:
break
}
} }
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
...@@ -94,7 +197,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -94,7 +197,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
if (self.dataMdoel?.order_goods?.count)! > 2 { if (self.dataMdoel?.order_goods?.count)! > 2 {
let view = OrderDViewFooterView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 33.5)) let view = OrderDViewFooterView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 33.5))
view.delegate = self view.delegate = self
view.nameLbl.text = "查看全部(共\(self.dataMdoel?.order_goods?.count)个商品)" view.nameLbl.text = "查看全部(共" + StringByInt(number: (self.dataMdoel?.order_goods!.count)!) + "个商品)"
return view return view
} }
} }
...@@ -118,7 +221,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -118,7 +221,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
if self.dataMdoel?.order_res?.cus_id != 0 { if self.dataMdoel?.order_res?.cus_id != 0 {
cell.contentLbl.text = self.dataMdoel?.order_res?.cus_name cell.contentLbl.text = self.dataMdoel?.order_res?.cus_name
}else{ }else{
//如果不刷新请求,那么就更新本地,建议还是刷新 //如果不刷新请求,那么就更新本地,建议还是刷新,暂不刷
cell.contentLbl.text = "请选择关联客户" cell.contentLbl.text = "请选择关联客户"
} }
...@@ -151,11 +254,36 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -151,11 +254,36 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
cell.nameLbl.text = yuShouTitleArr[indexPath.row] cell.nameLbl.text = yuShouTitleArr[indexPath.row]
cell.textTF.text = yuShouTitleArr[indexPath.row] cell.textTF.text = yuShouTitleArr[indexPath.row]
cell.delegate = self cell.delegate = self
//MARK:--预售商品,定金,尾款,合计,物流费用,其他费用 cell
switch indexPath.row {
case 0:
print("预售定金")
print(self.dataMdoel?.order_res?.sale_res?.dj_amount)
cell.textTF.text = "¥" + (self.dataMdoel?.order_res?.sale_res?.dj_amount)!
break
case 1:
cell.textTF.text = "¥" + (self.dataMdoel?.order_res?.sale_res?.wk_amount)!
break
case 2:
cell.textTF.text = "¥" + (self.dataMdoel?.order_res?.goods_amount)!
break
case 3:
cell.textTF.text = "¥" + (self.dataMdoel?.order_res?.logistics_price)!
break
case 4:
cell.textTF.text = "¥" + (self.dataMdoel?.order_res?.other_price)!
break
default:
break
}
if indexPath.row == yuShouTitleArr.count - 1 { if indexPath.row == yuShouTitleArr.count - 1 {
cell.line.isHidden = true cell.line.isHidden = true
} }
}else{ }else{
//MARK:--商品合计,物流费用,其他费用 cell //MARK:--普通商品合计,物流费用,其他费用 cell
cell.nameLbl.text = nonYuShouTitleArr[indexPath.row] cell.nameLbl.text = nonYuShouTitleArr[indexPath.row]
switch indexPath.row { switch indexPath.row {
case 0: case 0:
...@@ -178,77 +306,57 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -178,77 +306,57 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
} }
return cell return cell
case 3: case 3:
if isYuShou { //MARK:--收货人信息cell
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell
cell.textTF.isUserInteractionEnabled = false cell.textTF.isUserInteractionEnabled = false
cell.nameLbl.text = YuShouPart3Arr[indexPath.row] cell.nameLbl.text = nonYuShouPart3Arr[indexPath.row]
cell.textTF.text = YuShouPart3Arr[indexPath.row]
return cell if self.dataMdoel?.receiving == nil {
cell.textTF.text = "-"
}else{ }else{
if indexPath.row == 4 || indexPath.row == 5 || indexPath.row == 9 {
let cell = tableView.dequeueReusableCell(withIdentifier: "CommendCell") as! CommendCell
cell.tag = indexPath.row
cell.delegate = self
cell.titleLbl.text = YuShouPart3Arr[indexPath.row]
switch indexPath.row {
case 4:cell.placeLbl.text = "请输入物流单号"
break
case 5:cell.placeLbl.text = "请输入物流公司"
break
case 9:cell.placeLbl.text = "请输入留言信息"
break
default:
break
}
return cell
}
if indexPath.row == 6 || indexPath.row == 7 {
cell.nameLbl.text = YuShouPart3Arr[indexPath.row]
switch indexPath.row {
case 6:
cell.contentLbl.text = "未支付"
break
case 7:
cell.contentLbl.text = "未付款"
break
default:
break
}
return cell
}
//MARK:--收货人信息cell
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell
cell.textTF.isUserInteractionEnabled = false
cell.nameLbl.text = nonYuShouPart3Arr[indexPath.row]
switch indexPath.row { switch indexPath.row {
case 0: case 0:
cell.textTF.text = (self.dataMdoel?.receiving?.consignee)! cell.textTF.text = (self.dataMdoel?.receiving?.consignee)!
break break
case 1: case 1:
cell.textTF.text = (self.dataMdoel?.receiving?.mobile)! cell.textTF.text = (self.dataMdoel?.receiving?.mobile)!
break break
case 2: case 2:
cell.textTF.text = (self.dataMdoel?.receiving?.addr_str)! cell.textTF.text = (self.dataMdoel?.receiving?.addr_str)!
break break
default: default:
break break
}
}
return cell
} }
return cell
case 4: case 4:
//MARK:--订单信息cell
if indexPath.row == 4 || indexPath.row == 5 || indexPath.row == 9 { if indexPath.row == 4 || indexPath.row == 5 || indexPath.row == 9 {
let cell = tableView.dequeueReusableCell(withIdentifier: "CommendCell") as! CommendCell let cell = tableView.dequeueReusableCell(withIdentifier: "CommendCell") as! CommendCell
cell.delegate = self cell.delegate = self
cell.tag = indexPath.row cell.tag = indexPath.row
cell.titleLbl.text = YuShouPart3Arr[indexPath.row] cell.titleLbl.text = YuShouPart3Arr[indexPath.row]
switch indexPath.row { switch indexPath.row {
case 4:cell.placeLbl.text = "请输入物流单号" case 4:
cell.placeLbl.text = self.dataMdoel?.order_res?.lwb_no
if self.dataMdoel?.order_res?.lwb_no == nil {
cell.placeLbl.text = "-"
}else if cell.placeLbl.text?.count == 0 {
cell.placeLbl.text = "请输入物流单号"
}
break break
case 5:cell.placeLbl.text = "请输入物流公司" case 5:
cell.placeLbl.text = self.dataMdoel?.order_res?.lc_name
if cell.placeLbl.text?.count == 0 {
cell.placeLbl.text = "请输入物流公司"
}
break break
case 9:cell.placeLbl.text = "请输入留言信息" case 9:
cell.placeLbl.text = self.dataMdoel?.order_res?.order_postscript
if cell.placeLbl.text?.count == 0 {
cell.placeLbl.text = "请输入留言信息"
}
break break
default: default:
break break
...@@ -259,10 +367,10 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -259,10 +367,10 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
cell.nameLbl.text = YuShouPart3Arr[indexPath.row] cell.nameLbl.text = YuShouPart3Arr[indexPath.row]
switch indexPath.row { switch indexPath.row {
case 6: case 6:
cell.contentLbl.text = "未支付" cell.contentLbl.text = self.dataMdoel?.order_res?.pay_type_cn
break break
case 7: case 7:
cell.contentLbl.text = "未付款" cell.contentLbl.text = self.dataMdoel?.order_res?.pay_status_cn
break break
default: default:
break break
...@@ -272,7 +380,33 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -272,7 +380,33 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell
cell.textTF.isUserInteractionEnabled = false cell.textTF.isUserInteractionEnabled = false
cell.nameLbl.text = YuShouPart3Arr[indexPath.row] cell.nameLbl.text = YuShouPart3Arr[indexPath.row]
cell.textTF.text = YuShouPart3Arr[indexPath.row] switch indexPath.row {
case 0:
cell.textTF.text = self.dataMdoel?.order_res?.order_sn
break
case 1:
cell.textTF.text = TimeByDouble(sender: (self.dataMdoel?.order_res?.add_time!)!)
break
case 2:
cell.textTF.text = self.dataMdoel?.order_res?.from_cn
break
case 3:
if self.dataMdoel?.order_res?.shipping_type == 1 {
cell.textTF.text = "派送"
}else{
cell.textTF.text = "自提"
}
break
case 8:
cell.textTF.text = self.dataMdoel?.order_res?.postscript
break
default:
break
}
if cell.textTF.text?.count == 0 {
cell.textTF.text = "-"
}
return cell return cell
default: default:
break break
...@@ -282,25 +416,28 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -282,25 +416,28 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
func CommendCellSendStr(content: String,cell:CommendCell) { func CommendCellSendStr(content: String,cell:CommendCell) {
print("CommendCellSendStr") print("CommendCellSendStr")
} }
//MARK:--查看全部商品
func OrderDViewFooterViewBtnClick() { func OrderDViewFooterViewBtnClick() {
print("查看全部商品") print("查看全部商品")
let vc = ShowAlGoodsViewController() let vc = ShowAlGoodsViewController()
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
} }
//MARK:--选择的关联客户返回数据
var selectKeHuData:CusListAllDataModel? = nil var selectKeHuData:CusListAllDataModel? = nil
func GuanLianKehuSelect(keHuData: CusListAllDataModel) { func GuanLianKehuSelect(keHuData: CusListAllDataModel) {
print("选择的关联客户",keHuData) print("选择的关联客户",keHuData)
self.selectKeHuData = keHuData self.selectKeHuData = keHuData
self.dataMdoel?.order_res?.cus_id = self.selectKeHuData?.cus_id self.dataMdoel?.order_res?.cus_id = self.selectKeHuData?.cus_id
self.dataMdoel?.order_res?.cus_name = self.selectKeHuData?.cus_name self.dataMdoel?.order_res?.cus_name = self.selectKeHuData?.cus_name
} //暂时不刷新数据,只刷新视图
listView.reloadData()
}
func btnClick(content: String, cell: TitleAndBtnCell) { func btnClick(content: String, cell: TitleAndBtnCell) {
switch cell.nameLbl.text { switch cell.nameLbl.text {
case "关联客户": case "关联客户":
let vc = GuanLianKehuVC() let vc = GuanLianKehuVC()
vc.delegate = self vc.delegate = self
vc.order_id = self.orderId
if self.dataMdoel?.order_res?.cus_id != 0 { if self.dataMdoel?.order_res?.cus_id != 0 {
vc.cus_id = self.dataMdoel?.order_res?.cus_id vc.cus_id = self.dataMdoel?.order_res?.cus_id
} }
...@@ -322,11 +459,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -322,11 +459,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
if self.dataMdoel == nil { if self.dataMdoel == nil {
return 0 return 0
} }
if isYuShou { return 5
return 4
}else{
return 5
}
} }
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
...@@ -357,44 +490,18 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -357,44 +490,18 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
return 3 return 3
} }
case 3: case 3:
if isYuShou{ if self.dataMdoel?.order_res?.shipping_type == 1{
return 10
}else{
return 3 return 3
} }
return 0
case 4: case 4:
return 10 return 10
default: default:
return 10 return 0
} }
} }
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView()
switch section {
case 1:
let view = TitleAndLblView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 49))
view.nameLbl.text = "订单状态"
//订单状态
view.contentLbl.text = orderStatusStrByInt(statusNumber: (self.dataMdoel?.order_res?.order_status)!)
return view
case 3:
let view = HeaderOnlyTitleView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 39))
if isYuShou {
view.nameLbl.text = "订单信息"
}else{
view.nameLbl.text = "收货信息"
}
return view
case 4:
let view = HeaderOnlyTitleView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 39))
view.nameLbl.text = "订单信息"
return view
default:
break
}
return view
}
//MARK: - footer delegate //MARK: - footer delegate
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
switch section { switch section {
...@@ -410,6 +517,10 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -410,6 +517,10 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
} }
case 2: case 2:
return 59 return 59
case 3:
if self.dataMdoel?.order_res?.shipping_type != 1 {
return 0.01
}
default: default:
break break
} }
...@@ -449,6 +560,28 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -449,6 +560,28 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
} }
//MARK: - header delegate //MARK: - header delegate
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView()
switch section {
case 1:
let view = TitleAndLblView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 49))
view.nameLbl.text = "订单状态"
//订单状态
view.contentLbl.text = orderStatusStrByInt(statusNumber: (self.dataMdoel?.order_res?.order_status)!)
return view
case 3:
let view = HeaderOnlyTitleView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 39))
view.nameLbl.text = "收货信息"
return view
case 4:
let view = HeaderOnlyTitleView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 39))
view.nameLbl.text = "订单信息"
return view
default:
break
}
return view
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
switch section { switch section {
case 1: case 1:
...@@ -456,7 +589,11 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -456,7 +589,11 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
case 2: case 2:
return 1 return 1
case 3: case 3:
return 39 if self.dataMdoel?.order_res?.shipping_type == 1{
return 39
}else{
return 0.01
}
case 4: case 4:
return 39 return 39
default: default:
...@@ -482,4 +619,68 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -482,4 +619,68 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
listView.beginUpdates() listView.beginUpdates()
listView.endUpdates() listView.endUpdates()
} }
//MARK:--根据数据获取底部按钮操作
func getOrderBottomBtnTitleStrByStatus(status:Int) -> Array<String> {
var titleArr: Array<String> = []
switch status {
case 0,1:
// str = "未确定" "待付款"
titleArr = ["修改价格","打印","确认订单","取消订单"]
break
case 6:
// str = "待发货"
titleArr = ["直接发货","打印","退款"]
break
case 7:
// str = "待收货"
titleArr = ["退货","打印","退款"]
break
//订单完成
case 5:
// str = "订单完成"
titleArr = ["打印","退款"]
break
//订单关闭
case 8,2:
// str = "订单关闭"str = "已取消" //用户取消(预售
titleArr = []
break
default:
break
}
return titleArr
}
//MARK:--确认和取消订单
var isSrueOrder = false
//MARK:--弹窗代理 --还有其他弹窗,根据tag分类
func sureAction(sender: UIButton) {
if isSrueOrder {
HUD.flash(.progress)
let UserToken = UserDefaults.standard.value(forKey: "user_token")
orderConfirm(["user_token":UserToken as Any,"order_id" : self.dataMdoel?.order_res?.order_id as Any], success: { (data) in
HUD.flash(.labeledSubSuccess(subtitle: "确认成功"),delay: 1.2)
self.loadData()
}) { (error) in
}
}else{
HUD.flash(.progress)
let UserToken = UserDefaults.standard.value(forKey: "user_token")
orderCancel(["user_token":UserToken as Any,"order_id" : self.dataMdoel?.order_res?.order_id as Any], success: { (data) in
HUD.flash(.labeledSubSuccess(subtitle: "取消成功"),delay: 1.2)
self.loadData()
}) { (error) in
}
}
}
} }
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/> <device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<capability name="Named colors" minToolsVersion="9.0"/> <capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="OrderDViewController" customModule="GeliBusinessPlatform" customModuleProvider="target"> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="OrderDViewController" customModule="GeliBusinessPlatform" customModuleProvider="target">
<connections> <connections>
<outlet property="bottomBgView" destination="n9R-tn-hVY" id="eSi-Ty-uFr"/>
<outlet property="bottomView" destination="uzE-Ha-UZM" id="KNM-2q-cr7"/> <outlet property="bottomView" destination="uzE-Ha-UZM" id="KNM-2q-cr7"/>
<outlet property="btmViewH" destination="Scu-he-Peb" id="6AX-79-BBC"/> <outlet property="btmViewH" destination="Scu-he-Peb" id="6AX-79-BBC"/>
<outlet property="listView" destination="Ynh-hV-MLH" id="c3b-QY-jsW"/> <outlet property="listView" destination="Ynh-hV-MLH" id="c3b-QY-jsW"/>
......
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