Commit d0ff7a89 authored by lujunye's avatar lujunye

接入支付运费接口,接入取消运单接口,

parent c14609fa
......@@ -187,6 +187,8 @@
E07B1E6F245929060055BA3C /* GYSGLViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E07B1E6D245929060055BA3C /* GYSGLViewController.swift */; };
E07B1E70245929060055BA3C /* GYSGLViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E07B1E6E245929060055BA3C /* GYSGLViewController.xib */; };
E07C20CC24B301CD006CAB9D /* AuthenticationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E07C20CB24B301CD006CAB9D /* AuthenticationServices.framework */; };
E0833B8524D8F6A00014F3E9 /* PaymentView.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0833B8424D8F6A00014F3E9 /* PaymentView.xib */; };
E0833B8724D8F96D0014F3E9 /* PaymentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0833B8624D8F96D0014F3E9 /* PaymentView.swift */; };
E088CC8D24470BF0000DAA8A /* CodeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E088CC8C24470BF0000DAA8A /* CodeView.swift */; };
E088CC932447124D000DAA8A /* BindViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E088CC912447124D000DAA8A /* BindViewController.swift */; };
E088CC942447124D000DAA8A /* BindViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E088CC922447124D000DAA8A /* BindViewController.xib */; };
......@@ -800,6 +802,8 @@
E07B1E6D245929060055BA3C /* GYSGLViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GYSGLViewController.swift; sourceTree = "<group>"; };
E07B1E6E245929060055BA3C /* GYSGLViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GYSGLViewController.xib; sourceTree = "<group>"; };
E07C20CB24B301CD006CAB9D /* AuthenticationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AuthenticationServices.framework; path = System/Library/Frameworks/AuthenticationServices.framework; sourceTree = SDKROOT; };
E0833B8424D8F6A00014F3E9 /* PaymentView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PaymentView.xib; sourceTree = "<group>"; };
E0833B8624D8F96D0014F3E9 /* PaymentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaymentView.swift; sourceTree = "<group>"; };
E088CC8C24470BF0000DAA8A /* CodeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodeView.swift; sourceTree = "<group>"; };
E088CC912447124D000DAA8A /* BindViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BindViewController.swift; sourceTree = "<group>"; };
E088CC922447124D000DAA8A /* BindViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = BindViewController.xib; sourceTree = "<group>"; };
......@@ -1910,6 +1914,8 @@
F95D9B4E24484F140080D6E3 /* AlertView */,
E09B03C42445BF4600211A51 /* NavBarView */,
E0329EA324D808B1000D547E /* PayPassView.swift */,
E0833B8624D8F96D0014F3E9 /* PaymentView.swift */,
E0833B8424D8F6A00014F3E9 /* PaymentView.xib */,
);
path = View;
sourceTree = "<group>";
......@@ -3316,6 +3322,7 @@
E0DDCB14244ADF2C00DF54C7 /* ChangePriceNormalCell.xib in Resources */,
E01EA1A5245A60E000F019D5 /* XiaDanChengGongViewController.xib in Resources */,
E042F74124528CD500CDFA12 /* TitleAndOnlyBtnCell.xib in Resources */,
E0833B8524D8F6A00014F3E9 /* PaymentView.xib in Resources */,
E0D46C5724503EC50087B564 /* TitleAndSelectCell.xib in Resources */,
E00ACBEC2490D6C800128052 /* YDLBVc.xib in Resources */,
F90F881F24C8233D0050EF02 /* CityListViewController.xib in Resources */,
......@@ -3568,6 +3575,7 @@
E00ACBEB2490D6C800128052 /* YDLBVc.swift in Sources */,
F9A0E1DD246D198B00D7F26F /* CusListAllModel.swift in Sources */,
E0E4456924B00F7B00EF788E /* LogisticsModel.swift in Sources */,
E0833B8724D8F96D0014F3E9 /* PaymentView.swift in Sources */,
F9956B2524640D34001A617D /* GoodsClassModel.swift in Sources */,
F961D26B24500FF6007FBE70 /* HeaderSelectView.swift in Sources */,
F9697244248F70C00010D39B /* VendorInterface.swift in Sources */,
......
......@@ -202,6 +202,8 @@
<string>Logistics/estimatedCost</string>
<key>运单详情</key>
<string>Logistics/logisticsOrderDetails</string>
<key>支付运费</key>
<string>Logistics/payDelivery</string>
<key>拒绝退款</key>
<string>Order/orderRefundRefuse</string>
<key>确认用户退款到账</key>
......@@ -228,5 +230,7 @@
<string>Lalamove/cityList</string>
<key>运单跟踪</key>
<string>Logistics/LogisticsTracking</string>
<key>取消运单</key>
<string>Logistics/cancelLogisticsOrder</string>
</dict>
</plist>
......@@ -80,8 +80,34 @@ func logisticsOrderDetails(_ params:[String:Any],success:@escaping (_ res:Any)->
failture(error)
}
}
//MARK:-- 取消运单
/*
user_token 验证token
wb_no 运单号
*/
func cancelLogisticsOrder(_ 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)
}
}
//MARK:-- 支付运费
/*
user_token 验证token
wb_no 运单号
*/
func payDelivery(_ 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)
}
}
//MARK:-- 下运单收发地址信息
/*
user_token 验证token
......
......@@ -8,7 +8,7 @@
import Foundation
import ObjectMapper
//发送验证码,验证短信验证码,修改登录密码,绑定、更换绑定格利支付账号,简单通用操作接口,普通订单发货,预售订单发货,订单绑定/更换绑定客户,确认订单,订单取消,修改订单商品价格,订单退款,普通订单退货,预售订单退货,修改订单支付方式(状态),商家仓库添加,商家仓库修改,商家仓库删除,提交下单,商品入库审核,商品入库,商品入库申请,商品出库,商品申请出库,商品审核出库,出库入库审核不通过,编辑地址,删除地址,新增采购单,审核采购单,撤销入库,采购单修改支付状态,供应商编辑,新增供应商,编辑客户,新增客户,应收账款收款,设为未收,取消采购单,修改采购订单,新增品牌,拒绝退款,确认用户退款到账,拒绝接单,审核同意退货退款,取消订单审核,确认收到退货,审核同意退货或退款,订单确认收货,
//发送验证码,验证短信验证码,修改登录密码,绑定、更换绑定格利支付账号,简单通用操作接口,普通订单发货,预售订单发货,订单绑定/更换绑定客户,确认订单,订单取消,修改订单商品价格,订单退款,普通订单退货,预售订单退货,修改订单支付方式(状态),商家仓库添加,商家仓库修改,商家仓库删除,提交下单,商品入库审核,商品入库,商品入库申请,商品出库,商品申请出库,商品审核出库,出库入库审核不通过,编辑地址,删除地址,新增采购单,审核采购单,撤销入库,采购单修改支付状态,供应商编辑,新增供应商,编辑客户,新增客户,应收账款收款,设为未收,取消采购单,修改采购订单,新增品牌,拒绝退款,确认用户退款到账,拒绝接单,审核同意退货退款,取消订单审核,确认收到退货,审核同意退货或退款,订单确认收货,取消运单,支付运费,
class UpDataModel: Mappable {
......
<?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_5" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
......
//
// PaymentView.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/8/4.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
protocol PaymentViewDelegate {
func PaymentViewClose()
func PaymentViewPassInputFinish(fullpass:String)
}
class PaymentView: UIView, PasswordViewDelegate {
var price:Float?{
didSet{
let str = "¥ \(price!)"
let attributeString = NSMutableAttributedString(string:str)
attributeString.addAttribute(NSAttributedString.Key.font, value: UIFont(name: "PingFangSC-Medium", size: 18)!,range: NSMakeRange(0,1))
attributeString.addAttribute(NSAttributedString.Key.font, value: UIFont(name: "PingFangSC-Medium", size: 30)!,range: NSMakeRange(1,str.count-1))
priceLbl.attributedText = attributeString
}
}
@IBOutlet weak var bgView: UIView!
@IBOutlet weak var passBG: UIView!
var delegate:PaymentViewDelegate?
@IBAction func closeAction(_ sender: UIButton) {
delegate?.PaymentViewClose()
}
@IBOutlet weak var priceLbl: UILabel!
var contentView:UIView!
func passwordView(textFinished: String) {
print("输入完成: \(textFinished)")
delegate?.PaymentViewPassInputFinish(fullpass: textFinished)
}
func passwordView(textChanged: String, length: Int) {
print("文本改变: \(textChanged), length: \(length)")
}
func setUI(){
let passwordView = PayPassView(frame:passBG.bounds)
passwordView.backgroundColor = UIColor.white
passwordView.delegate = self
passwordView.maxLength = 6
passBG.addSubview(passwordView)
}
//初始化时将xib中的view添加进来
override init(frame: CGRect) {
super.init(frame: frame)
contentView = loadViewFromNib()
addSubview(contentView)
contentView.snp.makeConstraints { (make) in
make.left.top.right.bottom.equalToSuperview()
}
setUI()
}
// /初始化时将xib中的view添加进来
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
contentView = loadViewFromNib()
addSubview(contentView)
contentView.snp.makeConstraints { (make) in
make.left.top.right.bottom.equalToSuperview()
}
setUI()
}
//加载xib
func loadViewFromNib() -> UIView {
let className = type(of: self)
let bundle = Bundle(for: className)
let name = NSStringFromClass(className).components(separatedBy: ".").last
let nib = UINib(nibName: name!, bundle: bundle)
let view = nib.instantiate(withOwner: self, options: nil).first as! UIView
return view
}
}
This diff is collapsed.
......@@ -8,25 +8,64 @@
import UIKit
class YunDanXiangQingViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource{
class YunDanXiangQingViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,PaymentViewDelegate, GeliAlertViewDelegate{
func sureGeliAlertViewAction(sender: UIButton) {
print("取消订单")
HUD.flash(.progress)
cancelLogisticsOrder(["wb_no":dataModel?.wb_no,"user_token":UserToken], success: { (data) in
//通知刷新
HUD.hide()
self.navigationController?.popViewController(animated: true)
NotificationCenter.default.post(name: NSNotification.Name(rawValue: "logistDetail"), object: nil, userInfo: nil)
}) { (err) in
}
}
func PaymentViewClose() {
paymentView?.removeFromSuperview()
paymentView = nil
}
func PaymentViewPassInputFinish(fullpass: String) {
HUD.flash(.progress)
payDelivery(["wb_no":dataModel?.wb_no,"user_token":UserToken,"pwd":fullpass], success: { (data) in
//通知刷新
HUD.hide()
self.navigationController?.popViewController(animated: true)
NotificationCenter.default.post(name: NSNotification.Name(rawValue: "logistDetail"), object: nil, userInfo: nil)
}) { (err) in
}
paymentView?.removeFromSuperview()
paymentView = nil
}
var orderID:Int?
var dataModel:logisticsOrderDetailsDataModel?
let UserToken = UserDefaults.standard.value(forKey: "user_token")
@IBOutlet weak var listView: UITableView!
@IBOutlet weak var btmView: UIView!
let btnTitleArr = ["支付运费","2","3"]
var btnTitleArr:Array<String> = []
override func viewDidLoad() {
super.viewDidLoad()
navbar.title = "运单详情"
self.view.addSubview(navbar)
listView.separatorStyle = .none
SetTopFrameView(view: listView, btmView: btmView)
// listView.register(UINib(nibName: "TitleAndTFCell", bundle: nil), forCellReuseIdentifier: "TitleAndTFCell")
// listView.register(UINib(nibName: "TitleAndTFCell", bundle: nil), forCellReuseIdentifier: "TitleAndTFCell")
listView.register(UINib(nibName: "XiaDanCGDiZhiCell", bundle: nil), forCellReuseIdentifier: "XiaDanCGDiZhiCell")
listView.register(UINib(nibName: "JiBenXinXiCell", bundle: nil), forCellReuseIdentifier: "JiBenXinXiCell")
listView.register(UINib(nibName: "TitleAndLblCell", bundle: nil), forCellReuseIdentifier: "TitleAndLblCell")
loadData()
}
@IBOutlet weak var bottomH: NSLayoutConstraint!
func setBtns(){
for i in 0 ..< btnTitleArr.count {
let btn = UIButton()
let idx = btnTitleArr.count-i-1
......@@ -38,7 +77,7 @@ class YunDanXiangQingViewController: BaseViewController,UITableViewDelegate,UITa
btn.layer.masksToBounds = true
btn.layer.borderColor = UIColor(named: "蓝色字体颜色")?.cgColor
btn.layer.borderWidth = 1
if btn.tag == 0 {
if btn.titleLabel!.text == "支付运费" {
btn.backgroundColor = UIColor(named: "蓝色字体颜色")
btn.setTitleColor(UIColor.white, for: .normal)
}
......@@ -53,11 +92,9 @@ class YunDanXiangQingViewController: BaseViewController,UITableViewDelegate,UITa
}
}
loadData()
}
func loadData(){
let UserToken = UserDefaults.standard.value(forKey: "user_token")
HUD.flash(.progress)
listView.isHidden = true
......@@ -67,19 +104,63 @@ class YunDanXiangQingViewController: BaseViewController,UITableViewDelegate,UITa
let model = data as! logisticsOrderDetailsModel
self.dataModel = model.data
if model.data?.delivery_status != 5 {
self.btnTitleArr.append("物流跟踪")
}
if model.data?.delivery_status == 1 {
self.btnTitleArr.append("取消运单")
}
if ((model.data?.freight)! > 0) && model.data?.pay_status == 1 {
self.btnTitleArr.append("支付运费")
}
if self.btnTitleArr.count > 0 {
self.setBtns()
}else{
self.bottomH.constant = 0
}
self.listView.isHidden = false
self.listView.reloadData()
}) { (error) in
}
}
@objc func closeAction(sender:UIButton){
sender.removeFromSuperview()
}
var paymentView:PaymentView?
@objc func btnClick(sender:UIButton){
print(sender.tag)
if sender.titleLabel!.text == "支付运费" {
switch sender.titleLabel?.text {
case "支付运费":
if paymentView == nil{
paymentView = PaymentView(frame: view.bounds)
paymentView?.delegate = self
paymentView?.price = dataModel?.freight
view.addSubview(paymentView!)
}
break
case "物流跟踪":
let vc = WuLiuGenZongViewController()
vc.orderId = dataModel?.id
self.navigationController?.pushViewController(vc, animated: true)
break
case "取消运单":
let alertView = GeliAlertView(frame: self.view.window!.bounds)
alertView.delegate = self;
alertView.tishiLbl.text = ""
alertView.titileLbl.text = "是否取消运单?"
alertView.rightBtn.setAttributedTitle(NSAttributedString(string: "确定"), for: .normal)
// alertView.rightBtn.tag = model.po_id!
self.view.window?.addSubview(alertView)
break
default:
break
}
let vc = WuLiuGenZongViewController()
self.navigationController?.pushViewController(vc, animated: true)
}
//MARK: - CELL DELEGATE
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
......@@ -96,21 +177,21 @@ class YunDanXiangQingViewController: BaseViewController,UITableViewDelegate,UITa
case 0:return UIView()
case 2:
let view = UIView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 36))
view.backgroundColor = UIColor.white
let lbl = UILabel()
lbl.text = "货物信息"
lbl.textColor = UIColor(named: "标题字颜色")
lbl.font = UIFont.boldSystemFont(ofSize: 15)
view.addSubview(lbl)
lbl.snp.makeConstraints { (make) in
make.top.left.right.equalTo(15)
make.height.equalTo(21)
}
return view
view.backgroundColor = UIColor.white
let lbl = UILabel()
lbl.text = "货物信息"
lbl.textColor = UIColor(named: "标题字颜色")
lbl.font = UIFont.boldSystemFont(ofSize: 15)
view.addSubview(lbl)
lbl.snp.makeConstraints { (make) in
make.top.left.right.equalTo(15)
make.height.equalTo(21)
}
return view
default:
let view = UIView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 10))
view.backgroundColor = UIColor.white
return view
return view
}
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
......@@ -198,17 +279,17 @@ class YunDanXiangQingViewController: BaseViewController,UITableViewDelegate,UITa
}
}
if indexPath.section == 1 {
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndLblCell") as! TitleAndLblCell
cell.nameLbl.text = p2Arr[indexPath.row]
var arrStr:[String] = []
arrStr.append((dataModel?.sale_plat)!)
arrStr.append((dataModel?.order_sn)!)
arrStr.append(String(format: "%.2f", (dataModel?.freight_pre)!))
arrStr.append((dataModel?.fc_flag_cn)!)
cell.contentLbl.text = arrStr[indexPath.row]
cell.imgRight.constant = 0
cell.btmLine.isHidden = true
return cell
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndLblCell") as! TitleAndLblCell
cell.nameLbl.text = p2Arr[indexPath.row]
var arrStr:[String] = []
arrStr.append((dataModel?.sale_plat)!)
arrStr.append((dataModel?.order_sn)!)
arrStr.append(String(format: "%.2f", (dataModel?.freight)!))
arrStr.append((dataModel?.fc_flag_cn)!)
cell.contentLbl.text = arrStr[indexPath.row]
cell.imgRight.constant = 0
cell.btmLine.isHidden = true
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndLblCell") as! TitleAndLblCell
cell.nameLbl.text = p3Arr[indexPath.row]
......
......@@ -11,6 +11,7 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="YunDanXiangQingViewController" customModule="TestClass" customModuleProvider="target">
<connections>
<outlet property="bottomH" destination="fH8-qM-kId" id="VKf-P2-VQV"/>
<outlet property="btmView" destination="aKi-sa-aRb" id="QKe-z7-dzE"/>
<outlet property="listView" destination="QVe-VE-lfz" id="slI-bE-Qhf"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
......@@ -67,7 +68,7 @@
<constraint firstItem="QpR-nl-408" firstAttribute="top" secondItem="QVe-VE-lfz" secondAttribute="bottom" id="OGt-a2-sui"/>
<constraint firstItem="QVe-VE-lfz" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="Qsa-mM-qMA"/>
<constraint firstAttribute="bottom" secondItem="aKi-sa-aRb" secondAttribute="bottom" id="RHQ-yY-CKq"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="QpR-nl-408" secondAttribute="bottom" constant="49" id="fH8-qM-kId"/>
<constraint firstAttribute="bottom" secondItem="QpR-nl-408" secondAttribute="bottom" constant="83" id="fH8-qM-kId"/>
</constraints>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<point key="canvasLocation" x="131.8840579710145" y="121.875"/>
......
......@@ -118,9 +118,18 @@ class YDLBVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,UISea
// calendarV.removeFromSuperview()
//
// }
deinit {
NotificationCenter.default.removeObserver(self)
}
@objc func refreshList(){
listView.mj_header?.beginRefreshing()
}
override func viewDidLoad() {
super.viewDidLoad()
NotificationCenter.default.addObserver(self, selector: #selector(refreshList), name: NSNotification.Name(rawValue: "logistDetail"), object: nil)
// let tap = UITapGestureRecognizer(target: self, action: #selector(closeTimeSelect))
// contentView.addGestureRecognizer(tap)
timeBgH.constant = 0
......
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