Commit 7e5d5f85 authored by 刘俊宏's avatar 刘俊宏

调整取消和详情

parent 1e21ed32
...@@ -9,8 +9,10 @@ ...@@ -9,8 +9,10 @@
import UIKit import UIKit
class OtherInfoTextViewTableViewCell: UITableViewCell,UITextViewDelegate { class OtherInfoTextViewTableViewCell: UITableViewCell,UITextViewDelegate {
@IBOutlet weak var nameLbl: UILabel!
@IBOutlet weak var selectBtn: UIButton!
@IBOutlet weak var textViewBgV: UIView!
@IBOutlet weak var iconImV: UIImageView!
@IBOutlet weak var textCountLbl: UILabel! @IBOutlet weak var textCountLbl: UILabel!
@IBOutlet weak var textView: UITextView! @IBOutlet weak var textView: UITextView!
override func awakeFromNib() { override func awakeFromNib() {
...@@ -18,10 +20,7 @@ class OtherInfoTextViewTableViewCell: UITableViewCell,UITextViewDelegate { ...@@ -18,10 +20,7 @@ class OtherInfoTextViewTableViewCell: UITableViewCell,UITextViewDelegate {
// Initialization code] // Initialization code]
textView.delegate = self textView.delegate = self
} }
@IBAction func selectAction(_ sender: UIButton) {
}
override func setSelected(_ selected: Bool, animated: Bool) { override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated) super.setSelected(selected, animated: animated)
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<rect key="frame" x="15" y="46" width="446" height="116"/> <rect key="frame" x="15" y="46" width="446" height="116"/>
<subviews> <subviews>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="e6f-gU-5ea"> <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="e6f-gU-5ea">
<rect key="frame" x="10" y="10" width="426" height="96"/> <rect key="frame" x="10" y="5" width="426" height="106"/>
<color key="backgroundColor" name="搜索框背景色"/> <color key="backgroundColor" name="搜索框背景色"/>
<color key="textColor" name="灰色字体颜色"/> <color key="textColor" name="灰色字体颜色"/>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="13"/> <fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="13"/>
...@@ -45,8 +45,8 @@ ...@@ -45,8 +45,8 @@
<constraints> <constraints>
<constraint firstAttribute="height" constant="116" id="Bj9-OB-Lus"/> <constraint firstAttribute="height" constant="116" id="Bj9-OB-Lus"/>
<constraint firstAttribute="trailing" secondItem="e6f-gU-5ea" secondAttribute="trailing" constant="10" id="QLe-fm-Yl4"/> <constraint firstAttribute="trailing" secondItem="e6f-gU-5ea" secondAttribute="trailing" constant="10" id="QLe-fm-Yl4"/>
<constraint firstAttribute="bottom" secondItem="e6f-gU-5ea" secondAttribute="bottom" constant="10" id="Zzi-hm-LO5"/> <constraint firstAttribute="bottom" secondItem="e6f-gU-5ea" secondAttribute="bottom" constant="5" id="Zzi-hm-LO5"/>
<constraint firstItem="e6f-gU-5ea" firstAttribute="top" secondItem="XeS-lF-UgT" secondAttribute="top" constant="10" id="a6T-AA-2Ql"/> <constraint firstItem="e6f-gU-5ea" firstAttribute="top" secondItem="XeS-lF-UgT" secondAttribute="top" constant="5" id="a6T-AA-2Ql"/>
<constraint firstItem="e6f-gU-5ea" firstAttribute="leading" secondItem="XeS-lF-UgT" secondAttribute="leading" constant="10" id="eG1-IJ-4XG"/> <constraint firstItem="e6f-gU-5ea" firstAttribute="leading" secondItem="XeS-lF-UgT" secondAttribute="leading" constant="10" id="eG1-IJ-4XG"/>
</constraints> </constraints>
<userDefinedRuntimeAttributes> <userDefinedRuntimeAttributes>
...@@ -55,31 +55,29 @@ ...@@ -55,31 +55,29 @@
</userDefinedRuntimeAttribute> </userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes> </userDefinedRuntimeAttributes>
</view> </view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="2eh-b7-Xdk"> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="daixuan" translatesAutoresizingMaskIntoConstraints="NO" id="KdD-A9-t9b">
<rect key="frame" x="442" y="12" width="19" height="22"/> <rect key="frame" x="442" y="13.5" width="19" height="19"/>
<state key="normal" image="daixuan"/> </imageView>
<connections>
<action selector="selectAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="qmf-VV-Chi"/>
</connections>
</button>
</subviews> </subviews>
<constraints> <constraints>
<constraint firstAttribute="right" secondItem="XeS-lF-UgT" secondAttribute="right" constant="15" id="0va-Uc-rRZ"/> <constraint firstAttribute="right" secondItem="XeS-lF-UgT" secondAttribute="right" constant="15" id="0va-Uc-rRZ"/>
<constraint firstItem="2eh-b7-Xdk" firstAttribute="centerY" secondItem="tSR-kG-qOO" secondAttribute="centerY" id="1Fa-zR-EuJ"/> <constraint firstItem="KdD-A9-t9b" firstAttribute="centerY" secondItem="tSR-kG-qOO" secondAttribute="centerY" id="JXU-xN-znS"/>
<constraint firstAttribute="trailing" secondItem="2eh-b7-Xdk" secondAttribute="trailing" constant="15" id="DcL-Zr-2fU"/>
<constraint firstItem="15H-Lc-ErQ" firstAttribute="leading" secondItem="tSR-kG-qOO" secondAttribute="trailing" constant="3" id="NsT-9x-EU8"/> <constraint firstItem="15H-Lc-ErQ" firstAttribute="leading" secondItem="tSR-kG-qOO" secondAttribute="trailing" constant="3" id="NsT-9x-EU8"/>
<constraint firstItem="XeS-lF-UgT" firstAttribute="left" secondItem="H2p-sc-9uM" secondAttribute="left" constant="15" id="Rka-4h-HqE"/> <constraint firstItem="XeS-lF-UgT" firstAttribute="left" secondItem="H2p-sc-9uM" secondAttribute="left" constant="15" id="Rka-4h-HqE"/>
<constraint firstItem="XeS-lF-UgT" firstAttribute="top" secondItem="tSR-kG-qOO" secondAttribute="bottom" constant="15" id="WTQ-gi-goP"/> <constraint firstItem="XeS-lF-UgT" firstAttribute="top" secondItem="tSR-kG-qOO" secondAttribute="bottom" constant="15" id="WTQ-gi-goP"/>
<constraint firstItem="15H-Lc-ErQ" firstAttribute="bottom" secondItem="tSR-kG-qOO" secondAttribute="bottom" id="dVb-kp-cmW"/> <constraint firstItem="15H-Lc-ErQ" firstAttribute="bottom" secondItem="tSR-kG-qOO" secondAttribute="bottom" id="dVb-kp-cmW"/>
<constraint firstItem="tSR-kG-qOO" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="g8O-hu-yUD"/> <constraint firstItem="tSR-kG-qOO" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="g8O-hu-yUD"/>
<constraint firstAttribute="trailing" secondItem="KdD-A9-t9b" secondAttribute="trailing" constant="15" id="v30-E7-BcI"/>
<constraint firstItem="tSR-kG-qOO" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="15" id="via-tI-BEP"/> <constraint firstItem="tSR-kG-qOO" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="15" id="via-tI-BEP"/>
</constraints> </constraints>
</tableViewCellContentView> </tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/> <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<connections> <connections>
<outlet property="selectBtn" destination="2eh-b7-Xdk" id="4tl-tS-YL2"/> <outlet property="iconImV" destination="KdD-A9-t9b" id="oOM-J8-tt5"/>
<outlet property="nameLbl" destination="tSR-kG-qOO" id="eHn-4u-qaa"/>
<outlet property="textCountLbl" destination="15H-Lc-ErQ" id="Di0-bt-vv1"/> <outlet property="textCountLbl" destination="15H-Lc-ErQ" id="Di0-bt-vv1"/>
<outlet property="textView" destination="e6f-gU-5ea" id="Ezp-VT-AAh"/> <outlet property="textView" destination="e6f-gU-5ea" id="Ezp-VT-AAh"/>
<outlet property="textViewBgV" destination="XeS-lF-UgT" id="eXg-wt-IUC"/>
</connections> </connections>
<point key="canvasLocation" x="-40.579710144927539" y="166.74107142857142"/> <point key="canvasLocation" x="-40.579710144927539" y="166.74107142857142"/>
</tableViewCell> </tableViewCell>
......
...@@ -23,3 +23,23 @@ class GoodsClassModel: NSObject { ...@@ -23,3 +23,23 @@ class GoodsClassModel: NSObject {
var modelS : Array<GoodsClassModel>? = [] var modelS : Array<GoodsClassModel>? = []
} }
//class ReasonClassModel: NSObject {
// var isExpand : Bool? = false
// var isSelect : Bool? = false
// var isCanExpand : Bool? = false
// var isCanSelect : Bool? = false
// var id : Int? //分类id
// var category : String? //分类名
// var sub_cat : Array<ReasonClassSubModel>? = []
//
//}
//class ReasonClassSubModel: NSObject {
// var isExpand : Bool? = false
// var isSelect : Bool? = false
// var isCanExpand : Bool? = false
// var isCanSelect : Bool? = true
// var sub_id : Int? //分类id
// var sub_name : String? //分类名
// var ep_model : Int?
//
//}
<?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="16097.2" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097" 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>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
......
...@@ -7,9 +7,16 @@ ...@@ -7,9 +7,16 @@
// //
import UIKit import UIKit
import LGButton
class HuolalaCancelViewController: BaseViewController ,UITableViewDelegate,UITableViewDataSource{ class HuolalaCancelViewController: BaseViewController ,UITableViewDelegate,UITableViewDataSource{
@IBOutlet weak var bottomLbl: UILabel!
var lwbno = "203920109087"
var isShowIndex = 0
var selectID = 81338860
var reason_id = 0
var reason = ""
@IBOutlet weak var listView: UITableView! @IBOutlet weak var listView: UITableView!
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
...@@ -22,51 +29,127 @@ class HuolalaCancelViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -22,51 +29,127 @@ class HuolalaCancelViewController: BaseViewController ,UITableViewDelegate,UITab
listView.register(UINib(nibName: "OtherInfoTextViewTableViewCell", bundle: nil), forCellReuseIdentifier: "OtherInfoTextViewTableViewCell") listView.register(UINib(nibName: "OtherInfoTextViewTableViewCell", bundle: nil), forCellReuseIdentifier: "OtherInfoTextViewTableViewCell")
loadData() loadData()
} }
@IBAction func cancelAction(_ sender: LGButton) {
if selectID == 81338860 {
HUD.flash(.label("请选择取消原因"))
return
}
orderCancelOrder()
}
//请求取消原因
var reasonArr:Array<orderCancelReasonDataModel> = []
func loadData(){ func loadData(){
let UserToken = UserDefaults.standard.value(forKey: "user_token") let UserToken = UserDefaults.standard.value(forKey: "user_token")
orderCancelReason(["user_token":UserToken as Any,"lwb_no":"206520102047" as Any], success: { (data) in orderCancelReason(["user_token":UserToken as Any,"lwb_no":lwbno as Any], success: { (data) in
let model = data as! orderCancelReasonModel
model.data?.forEach({ (dataModel) in
self.reasonArr.append(dataModel)
})
self.listView.reloadData()
}) { (error) in }) { (error) in
} }
} }
func numberOfSections(in tableView: UITableView) -> Int { func numberOfSections(in tableView: UITableView) -> Int {
return 2 return reasonArr.count
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
let sectionModel = reasonArr[section]
return sectionModel.sub_cat!.count
} }
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.section == 1 { let sectionModel = reasonArr[indexPath.section]
return 175 let rowModel = sectionModel.sub_cat![indexPath.row]
if rowModel.sub_name == "其他" || sectionModel.category == "其他"{
if reasonArr.count == 1 {
if selectID == rowModel.sub_id {
return 175
}else{
return 50
}
}
return 50
} }
return 50 return 50
} }
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if section == 1 {
return 1
}
return 10
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "FirstCell") as! FirstCell
if indexPath.section == 1 { let sectionModel = reasonArr[indexPath.section]
let rowModel = sectionModel.sub_cat![indexPath.row]
if rowModel.sub_name == "其他" || sectionModel.category == "其他"{
let cell = tableView.dequeueReusableCell(withIdentifier: "OtherInfoTextViewTableViewCell") as! OtherInfoTextViewTableViewCell let cell = tableView.dequeueReusableCell(withIdentifier: "OtherInfoTextViewTableViewCell") as! OtherInfoTextViewTableViewCell
if reasonArr.count == 1 {
if rowModel.sub_id == selectID {
cell.iconImV.image = UIImage.init(named: "yuxuan")
cell.nameLbl.textColor = UIColor.init(named: "蓝色字体颜色")
cell.textCountLbl.textColor = UIColor.init(named: "蓝色字体颜色")
cell.textViewBgV.isHidden = false
}else{
cell.iconImV.image = UIImage.init(named: "daixuan")
cell.nameLbl.textColor = UIColor.init(named: "标题字颜色")
cell.textCountLbl.textColor = UIColor.init(named: "标题字颜色")
cell.textViewBgV.isHidden = true
}
}else{
}
return cell return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: "FirstCell") as! FirstCell
cell.nameLbl.text = rowModel.sub_name
if reasonArr.count == 1 {
if rowModel.sub_id == selectID {
cell.imgView.image = UIImage.init(named: "yuxuan")
cell.nameLbl.textColor = UIColor.init(named: "蓝色字体颜色")
}else{
cell.imgView.image = UIImage.init(named: "daixuan")
cell.nameLbl.textColor = UIColor.init(named: "标题字颜色")
}
}else{
} }
return cell return cell
} }
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let sectionModel = reasonArr[indexPath.section]
let rowModel = sectionModel.sub_cat![indexPath.row]
if reasonArr.count == 1 {
selectID = rowModel.sub_id!
reason_id = selectID
reason = rowModel.sub_name!
listView.reloadData()
}else{
}
bottomLbl.text = "确定"
}
//MARK:--取消货拉拉运单 //MARK:--取消货拉拉运单
func orderCancelOrder (){ func orderCancelOrder (){
let UserToken = UserDefaults.standard.value(forKey: "user_token") let UserToken = UserDefaults.standard.value(forKey: "user_token")
orderLalamoveCancel(["user_token":UserToken as Any,"lwb_no":"206520102047" as Any,"reason_id":"206520102047" as Any,"reason":"206520102047" as Any], success: { (data) in orderLalamoveCancel(["user_token":UserToken as Any,"lwb_no":lwbno as Any,"reason_id":reason_id as Any,"reason":reason as Any], success: { (data) in
NotificationCenter.default.post(name: NSNotification.Name(rawValue: "HuolalaOrderChange"), object: nil)
HUD.flash(.labeledSubSuccess(subtitle: "取消成功"),delay: 1.2)
self.navigationController?.popViewController(animated: true)
}) { (error) in }) { (error) in
} }
...@@ -75,3 +158,4 @@ class HuolalaCancelViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -75,3 +158,4 @@ class HuolalaCancelViewController: BaseViewController ,UITableViewDelegate,UITab
} }
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="HuolalaCancelViewController" customModule="TestClass" customModuleProvider="target"> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="HuolalaCancelViewController" customModule="TestClass" customModuleProvider="target">
<connections> <connections>
<outlet property="bottomLbl" destination="8At-VK-RQm" id="ZfC-Km-eij"/>
<outlet property="listView" destination="nGb-3u-ukH" id="5v3-zF-MA1"/> <outlet property="listView" destination="nGb-3u-ukH" id="5v3-zF-MA1"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections> </connections>
...@@ -21,28 +22,69 @@ ...@@ -21,28 +22,69 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="nGb-3u-ukH"> <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="nGb-3u-ukH">
<rect key="frame" x="0.0" y="44" width="414" height="852"/> <rect key="frame" x="0.0" y="44" width="414" height="769"/>
<color key="backgroundColor" name="app底色"/> <color key="backgroundColor" name="app底色"/>
<connections> <connections>
<outlet property="dataSource" destination="-1" id="dJl-aN-2n9"/> <outlet property="dataSource" destination="-1" id="dJl-aN-2n9"/>
<outlet property="delegate" destination="-1" id="oAo-P4-EdR"/> <outlet property="delegate" destination="-1" id="oAo-P4-EdR"/>
</connections> </connections>
</tableView> </tableView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Jbe-zt-s7J" 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>
<userDefinedRuntimeAttribute type="boolean" keyPath="gradientHorizontal" value="YES"/>
</userDefinedRuntimeAttributes>
<connections>
<action selector="cancelAction:" destination="-1" eventType="touchUpInside" id="D6P-JB-d4o"/>
</connections>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="请选择取消原因" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8At-VK-RQm">
<rect key="frame" x="0.0" y="813" width="414" height="49"/>
<constraints>
<constraint firstAttribute="height" constant="49" id="dU0-UF-dtI"/>
</constraints>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="15"/>
<color key="textColor" name="白色背景色"/>
<nil key="highlightedColor"/>
</label>
</subviews> </subviews>
<color key="backgroundColor" name="app底色"/> <color key="backgroundColor" name="app底色"/>
<constraints> <constraints>
<constraint firstItem="nGb-3u-ukH" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="3C7-fq-4fH"/> <constraint firstItem="nGb-3u-ukH" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="3C7-fq-4fH"/>
<constraint firstAttribute="bottom" secondItem="nGb-3u-ukH" secondAttribute="bottom" id="Psj-Og-1pz"/> <constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="8At-VK-RQm" secondAttribute="bottom" id="6YZ-qF-S3m"/>
<constraint firstItem="Jbe-zt-s7J" firstAttribute="top" secondItem="8At-VK-RQm" secondAttribute="top" id="GKK-fn-9Gm"/>
<constraint firstItem="Jbe-zt-s7J" firstAttribute="top" secondItem="nGb-3u-ukH" secondAttribute="bottom" id="Lm8-Qi-suZ"/>
<constraint firstItem="Jbe-zt-s7J" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="MzH-BW-gaH"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="8At-VK-RQm" secondAttribute="trailing" id="Nxr-L3-dKd"/>
<constraint firstItem="8At-VK-RQm" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="Z0i-Sn-LN2"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="nGb-3u-ukH" secondAttribute="trailing" id="i2p-bL-aup"/> <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="nGb-3u-ukH" secondAttribute="trailing" id="i2p-bL-aup"/>
<constraint firstItem="nGb-3u-ukH" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="nXb-eO-eUi"/> <constraint firstItem="nGb-3u-ukH" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="nXb-eO-eUi"/>
<constraint firstAttribute="bottom" secondItem="Jbe-zt-s7J" secondAttribute="bottom" id="psC-Tj-z0b"/>
<constraint firstItem="Jbe-zt-s7J" firstAttribute="trailing" secondItem="fnl-2z-Ty3" secondAttribute="trailing" id="xwT-jN-cFy"/>
</constraints> </constraints>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/> <viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<point key="canvasLocation" x="-623" y="155"/> <point key="canvasLocation" x="-1270" y="63"/>
</view> </view>
</objects> </objects>
<resources> <resources>
<namedColor name="app底色"> <namedColor name="app底色">
<color red="0.94509803921568625" green="0.94509803921568625" blue="0.94509803921568625" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.94509803921568625" green="0.94509803921568625" blue="0.94509803921568625" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor> </namedColor>
<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> </resources>
</document> </document>
...@@ -9,8 +9,10 @@ ...@@ -9,8 +9,10 @@
import UIKit import UIKit
class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITableViewDataSource{ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITableViewDataSource,BtmBtnCellDelegate{
//测试数据 //测试数据
var isYDBc = false
var lwb_no = ""
var datas = [1,2,3] var datas = [1,2,3]
var dataModel:getHllOrderDetailsDataModel? = nil var dataModel:getHllOrderDetailsDataModel? = nil
@IBOutlet weak var listView: UITableView! @IBOutlet weak var listView: UITableView!
...@@ -31,13 +33,16 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -31,13 +33,16 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
// setPaymentUI(data:datas) // setPaymentUI(data:datas)
loadData() loadData()
if !isYDBc {
NotificationCenter.default.addObserver(self, selector: #selector(loadData), name: NSNotification.Name(rawValue: "HuolalaOrderChange"), object: nil)
}
} }
func loadData(){ @objc func loadData(){
HUD.flash(.progress) HUD.flash(.progress)
let UserToken = UserDefaults.standard.value(forKey: "user_token") let UserToken = UserDefaults.standard.value(forKey: "user_token")
getHllOrderDetails(["user_token":UserToken as Any,"lwb_no":"206520102047" as Any], success: { (data) in getHllOrderDetails(["user_token":UserToken as Any,"lwb_no":lwb_no as Any], success: { (data) in
HUD.hide() HUD.hide()
let model = data as! getHllOrderDetailsModel let model = data as! getHllOrderDetailsModel
self.dataModel = model.data! self.dataModel = model.data!
...@@ -46,6 +51,22 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -46,6 +51,22 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
HUD.hide() HUD.hide()
} }
} }
func selectBtmBtnCellBy(index: Int) {
switch index {
case 0:
let vc = XiaYunDanViewController()
self.navigationController?.pushViewController(vc, animated: true)
case 1:
let vc = WaybillDetailViewController()
vc.lwb_no = lwb_no
self.navigationController?.pushViewController(vc, animated: true)
case 2:
let vc = YDLBVc()
self.navigationController?.pushViewController(vc, animated: true)
default:
break
}
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if tableView.tag == 99 { if tableView.tag == 99 {
return datas.count return datas.count
...@@ -58,7 +79,10 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -58,7 +79,10 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
return 1 return 1
} }
if section == 3 { if section == 3 {
return 1 if (dataModel?.order_detail_item?.bill_price_arr?.count)! > 0 {
return 1
}
return 0
} }
if section == 5 || section == 6{ if section == 5 || section == 6{
...@@ -79,7 +103,9 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -79,7 +103,9 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
if dataModel == nil { if dataModel == nil {
return 0 return 0
} }
if !isYDBc {
return 7
}
return 8; return 8;
} }
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
...@@ -199,9 +225,11 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -199,9 +225,11 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
switch rowModel?.type { switch rowModel?.type {
case 1: case 1:
cell.nameLbl.text = "起步价" cell.nameLbl.text = "起步价" + "(" + (dataModel?.order_detail_item?.order_item?.vehicle_type_name)! + ")"
case 2: case 2:
cell.nameLbl.text = "超里程价" let distance = -(dataModel?.order_detail_item?.exceed_distance)!
cell.nameLbl.text = "超里程价" + "(" + String(format: "%.d", distance) + ")"
case 3: case 3:
cell.nameLbl.text = "拉拉券扣减" cell.nameLbl.text = "拉拉券扣减"
case 4: case 4:
...@@ -261,11 +289,15 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -261,11 +289,15 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
if dataModel?.delivery?.sale_plat != nil { if dataModel?.delivery?.sale_plat != nil {
cell.textTF.text = dataModel?.delivery?.sale_plat cell.textTF.text = dataModel?.delivery?.sale_plat
}else{
cell.textTF.text = "-"
} }
if indexPath.row == 1 { if indexPath.row == 1 {
cell.nameLbl.text = "关联订单号:" cell.nameLbl.text = "关联订单号:"
if dataModel?.delivery?.order_sn != nil { if dataModel?.delivery?.order_sn != nil {
cell.textTF.text = dataModel?.delivery?.order_sn cell.textTF.text = dataModel?.delivery?.order_sn
}else{
cell.textTF.text = "-"
} }
} }
...@@ -282,6 +314,9 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -282,6 +314,9 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
let cell1 = tableView.dequeueReusableCell(withIdentifier: "TitleAndLblCell") as! TitleAndLblCell let cell1 = tableView.dequeueReusableCell(withIdentifier: "TitleAndLblCell") as! TitleAndLblCell
cell1.nameLbl.text = "备注" cell1.nameLbl.text = "备注"
cell1.contentLbl.text = dataModel?.order_detail_item?.order_item?.remark cell1.contentLbl.text = dataModel?.order_detail_item?.order_item?.remark
if dataModel?.order_detail_item?.order_item?.remark?.count == 0 {
cell1.contentLbl.text = "-"
}
cell1.contentLbl.textColor = UIColor.init(named: "灰色字体颜色") cell1.contentLbl.textColor = UIColor.init(named: "灰色字体颜色")
cell1.btmLine.isHidden = true cell1.btmLine.isHidden = true
cell1.contentRight.constant = 0 cell1.contentRight.constant = 0
...@@ -292,7 +327,9 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -292,7 +327,9 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
} }
if indexPath.section == 7 { if indexPath.section == 7 {
let cell = tableView.dequeueReusableCell(withIdentifier: "BtmBtnCell") as! BtmBtnCell let cell = tableView.dequeueReusableCell(withIdentifier: "BtmBtnCell") as! BtmBtnCell
cell.delegate = self
return cell return cell
} }
let cell = tableView.dequeueReusableCell(withIdentifier: "WayBillAddressItemCell") as! WayBillAddressItemCell let cell = tableView.dequeueReusableCell(withIdentifier: "WayBillAddressItemCell") as! WayBillAddressItemCell
...@@ -342,9 +379,17 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -342,9 +379,17 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
if section == 4{ if section == 4{
return 35 return 35
} }
if section == 5 || section == 6 || section == 3{ if section == 3 {
if (dataModel?.order_detail_item?.bill_price_arr?.count)! > 0 {
return 10
}
return 0.01
}
if section == 5 || section == 6{
return 10 return 10
} }
return 0.01 return 0.01
} }
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
...@@ -382,7 +427,14 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -382,7 +427,14 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
if section == 4 { if section == 4 {
return 60 return 60
} }
if section == 5 || section == 6 || section == 3{ if section == 3 {
if (dataModel?.order_detail_item?.bill_price_arr?.count)! > 0 {
return 10
}
return 0.01
}
if section == 5 || section == 6{
return 10 return 10
} }
......
...@@ -496,7 +496,7 @@ class YDLBVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,UISea ...@@ -496,7 +496,7 @@ class YDLBVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,UISea
case "京东": case "京东":
lc_id = "1" lc_id = "1"
case "货拉拉": case "货拉拉":
lc_id = "3" lc_id = "11"
default: default:
lc_id = "" lc_id = ""
break break
...@@ -536,10 +536,18 @@ class YDLBVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,UISea ...@@ -536,10 +536,18 @@ class YDLBVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,UISea
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let vc = YunDanXiangQingViewController()
let rowModel = datas[indexPath.row] let rowModel = datas[indexPath.row]
vc.orderID = rowModel.id
self.navigationController?.pushViewController(vc, animated: true) if rowModel.lc_name == "货拉拉" {
let vc = WaybillDetailViewController()
vc.lwb_no = rowModel.lwb_no!
self.navigationController?.pushViewController(vc, animated: true)
}else{
let vc = YunDanXiangQingViewController()
vc.orderID = rowModel.id
self.navigationController?.pushViewController(vc, animated: true)
}
} }
var BeginDate: Date! = nil var BeginDate: Date! = nil
var EndDate: Date! = nil var EndDate: Date! = nil
......
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