Commit ef758e3c authored by lujunye's avatar lujunye

根据后台要求修改逻辑

parent cf026f3f
...@@ -553,6 +553,8 @@ class getHllOrderDetailsSalePlatDataModel: Mappable { ...@@ -553,6 +553,8 @@ class getHllOrderDetailsSalePlatDataModel: Mappable {
var order_sn : String? var order_sn : String?
var hll_pay_status_two : Int? var hll_pay_status_two : Int?
var wb_no : String? var wb_no : String?
var bill_price_arr:Float?
var pay_status:Int?
required init?( map: Map) { required init?( map: Map) {
...@@ -562,6 +564,8 @@ class getHllOrderDetailsSalePlatDataModel: Mappable { ...@@ -562,6 +564,8 @@ class getHllOrderDetailsSalePlatDataModel: Mappable {
order_sn <- map["order_sn"] order_sn <- map["order_sn"]
hll_pay_status_two <- map["hll_pay_status_two"] hll_pay_status_two <- map["hll_pay_status_two"]
wb_no <- map["wb_no"] wb_no <- map["wb_no"]
bill_price_arr <- map["bill_price_arr"]
pay_status <- map["pay_status"]
} }
} }
......
...@@ -387,8 +387,10 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo ...@@ -387,8 +387,10 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
print("sureSelectAddressAction") print("sureSelectAddressAction")
if titleLbl?.text == "" { if titleLbl?.text == "" {
HUD.flash(.label("未能识别当前位置,请重新定位"), delay: 1.2)
return return
} }
var dict:Dictionary<String,Any> = Dictionary() var dict:Dictionary<String,Any> = Dictionary()
dict["menPai"] = "\(city)\(districet)\(ad)\(addressDetailTF.text!)" dict["menPai"] = "\(city)\(districet)\(ad)\(addressDetailTF.text!)"
dict["shouHuoRen"] = nameTF.text dict["shouHuoRen"] = nameTF.text
......
...@@ -11,7 +11,6 @@ import LGButton ...@@ -11,7 +11,6 @@ import LGButton
class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITableViewDataSource,BtmBtnCellDelegate,PaymentViewDelegate{ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITableViewDataSource,BtmBtnCellDelegate,PaymentViewDelegate{
@IBOutlet weak var bottomLheight: NSLayoutConstraint! @IBOutlet weak var bottomLheight: NSLayoutConstraint!
@IBOutlet weak var bottomLbl: UILabel! @IBOutlet weak var bottomLbl: UILabel!
@IBOutlet weak var bottomBtn: LGButton! @IBOutlet weak var bottomBtn: LGButton!
...@@ -73,7 +72,6 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -73,7 +72,6 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
self.dataModel = model.data! self.dataModel = model.data!
if !self.isYDBc { if !self.isYDBc {
switch self.dataModel?.order_detail_item?.order_item?.order_status { switch self.dataModel?.order_detail_item?.order_item?.order_status {
case 0: case 0:
...@@ -89,14 +87,18 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -89,14 +87,18 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
self.bottomBtn.isHidden = false self.bottomBtn.isHidden = false
self.bottomLbl.text = "取消订单" self.bottomLbl.text = "取消订单"
case 13,2: case 13,2:
//MARK: - 立即支付状态
print("已完成") print("已完成")
if self.dataModel?.delivery?.hll_pay_status_two == 1 { if self.dataModel?.delivery?.pay_status == 1 {
self.bottomLheight.constant = 49 self.bottomLheight.constant = 49
self.bottomLbl.isHidden = false self.bottomLbl.isHidden = false
self.bottomBtn.isHidden = false self.bottomBtn.isHidden = false
if self.dataModel?.order_detail_item?.order_item?.order_status == 13 {
self.bottomLbl.text = "确认账单"
}else{
self.bottomLbl.text = "立即支付" + String(format: "%.2f", ((self.dataModel?.order_detail_item?.order_item?.price_fen)!/100.0)) + "元" self.bottomLbl.text = "立即支付" + String(format: "%.2f", ((self.dataModel?.order_detail_item?.order_item?.price_fen)!/100.0)) + "元"
} }
}
default: default:
break break
} }
...@@ -125,12 +127,9 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -125,12 +127,9 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
let vc = HuolalaCancelViewController() let vc = HuolalaCancelViewController()
vc.lwbno = lwb_no vc.lwbno = lwb_no
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
}else if (bottomLbl.text?.contains("立即支付"))!{ }else if (bottomLbl.text?.contains("确认账单"))!{
if dataModel?.delivery?.hll_pay_status_two == 1 && dataModel?.order_detail_item?.order_item?.order_status == 13{
if !ispayHllOrder { if !ispayHllOrder {
let UserToken = UserDefaults.standard.value(forKey: "user_token") let UserToken = UserDefaults.standard.value(forKey: "user_token")
payHllOrder(["user_token":UserToken as Any,"lwb_no":lwb_no as Any,"nonce_str":String.randomStr(len:30) as Any], success: { (data) in payHllOrder(["user_token":UserToken as Any,"lwb_no":lwb_no as Any,"nonce_str":String.randomStr(len:30) as Any], success: { (data) in
self.ispayHllOrder = true self.ispayHllOrder = true
self.setPaymentUI(data:self.orderPriceArrName) self.setPaymentUI(data:self.orderPriceArrName)
...@@ -140,10 +139,19 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -140,10 +139,19 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
}else{ }else{
self.setPaymentUI(data:self.orderPriceArrName) self.setPaymentUI(data:self.orderPriceArrName)
} }
}else if (bottomLbl.text?.contains("立即支付"))!{
}else{ //MARK: - 支付
if dataModel?.delivery?.pay_status == 1{
if !ispayHllOrder {
setPaymentUI(data:orderPriceArrName) setPaymentUI(data:orderPriceArrName)
} }
}else{
self.setPaymentUI(data:self.orderPriceArrName)
}
} }
...@@ -212,7 +220,6 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab ...@@ -212,7 +220,6 @@ class WaybillDetailViewController: BaseViewController ,UITableViewDelegate,UITab
orderPriceArrStr.append("¥" + String(format: "%.2f", (rowModel.price_fen!/100.0))) orderPriceArrStr.append("¥" + String(format: "%.2f", (rowModel.price_fen!/100.0)))
case 2: case 2:
let distance = CGFloat((dataModel?.order_detail_item?.exceed_distance)!) / 1000.0 let distance = CGFloat((dataModel?.order_detail_item?.exceed_distance)!) / 1000.0
print("d == ",distance)
orderPriceArrName.append("超里程价" + "(" + String(format: "%.2f", distance) + "公里" + ")") orderPriceArrName.append("超里程价" + "(" + String(format: "%.2f", distance) + "公里" + ")")
orderPriceArrStr.append("¥" + String(format: "%.2f", (rowModel.price_fen!/100.0))) orderPriceArrStr.append("¥" + String(format: "%.2f", (rowModel.price_fen!/100.0)))
case 4: case 4:
......
<?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" 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.2" 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"/>
......
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