| | |
| | | @IBOutlet weak var contentTableHeiCons: NSLayoutConstraint! |
| | | @IBOutlet weak var label_BLN: UILabel! |
| | | @IBOutlet weak var label_status: UILabel! |
| | | @IBOutlet weak var view_btn: UIView! |
| | | |
| | | var adapterViewController:FFAdapterViewController! |
| | | |
| | |
| | | label_status.text = m.nextStatus.transStr |
| | | contentTableView.reloadData() |
| | | cargoTableview.reloadData() |
| | | view_btn.isHidden = m.status == .Complete |
| | | |
| | | |
| | | var startCoordinate:CLLocationCoordinate2D? |
| | | var endCoordinate:CLLocationCoordinate2D? |
| | | |
| | | if m.lat != 0 && m.lon != 0 { |
| | | startCoordinate = CLLocationCoordinate2D(latitude: m.lat, longitude: m.lon) |
| | | } |
| | | |
| | | if m.eLat != 0 && m.eLon != 0{ |
| | | endCoordinate = CLLocationCoordinate2D(latitude: m.eLat, longitude: m.eLon) |
| | | } |
| | | |
| | | let tuple = (startCoordinate,endCoordinate) |
| | | NotificationCenter.default.post(name: UpdateMap_Noti, object: tuple) |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | // footviewHeiCons.constant = UIDevice.jq_safeEdges.bottom + 44.0 |
| | | |
| | | Services.orderInfo(id: orderId, type:style).subscribe(onNext: { [weak self] data in |
| | | if let model = data.data{ |
| | | self?.model = model |
| | | } |
| | | }) { error in |
| | | |
| | | }.disposed(by: disposeBag) |
| | | getData() |
| | | } |
| | | |
| | | required init(orderId:String,style:HomePageVC.PageStyle) { |
| | |
| | | |
| | | override func setRx() { |
| | | |
| | | } |
| | | |
| | | private func getData(){ |
| | | Services.orderInfo(id: orderId, type:style).subscribe(onNext: { [weak self] data in |
| | | if let model = data.data{ |
| | | self?.model = model |
| | | } |
| | | }) { error in |
| | | |
| | | }.disposed(by: disposeBag) |
| | | } |
| | | |
| | | |
| | |
| | | //到达码头:提示上传 |
| | | //运输中:上传POD |
| | | //运回码头:提示上传 |
| | | print("---->") |
| | | guard let m = model else { return } |
| | | if m.nextStatus == .ArrivedPort{ |
| | | CommonAlertView.show(title: "Prompt!", content: "You need to upload gate out ticket", bt1: "Not upload yet", bt2: "To upload") { [weak self] in |
| | | AttachTypeView.show(orderId: m.orderId) { |
| | | self?.changeStatus(orderId: m.orderId) |
| | | } |
| | | } |
| | | } else if m.nextStatus == .Transiting{ |
| | | CommonAlertView.show(title: "Prompt!", content: "You need to upload POD", bt1: "Not upload yet", bt2: "To upload") { [weak self] in |
| | | AttachTypeView.show(orderId: m.orderId) { |
| | | self?.changeStatus(orderId: m.orderId) |
| | | } |
| | | } |
| | | }else if m.nextStatus == .BackYard{ |
| | | CommonAlertView.show(title: "Prompt!", content: "You need to upload gate in ticket", bt1: "Not upload yet", bt2: "To upload") { [weak self] in |
| | | AttachTypeView.show(orderId: m.orderId) { |
| | | self?.changeStatus(orderId: m.orderId) |
| | | } |
| | | } |
| | | }else{ |
| | | changeStatus(orderId: orderId) |
| | | } |
| | | } |
| | | |
| | | |
| | | private func changeStatus(orderId:String){ |
| | | Services.nextStatus(id: orderId).subscribe(onNext: { data in |
| | | if data.code == 200{ |
| | | self.getData() |
| | | //Update Home data status. |
| | | NotificationCenter.default.post(name: RefreshHomePage_Noti, object: true) |
| | | }else{ |
| | | alert(msg: data.msg) |
| | | } |
| | | }) { error in |
| | | alert(msg: error.localizedDescription) |
| | | }.disposed(by: disposeBag) |
| | | } |
| | | |
| | | required init?(coder: NSCoder) { |
| | | fatalError("init(coder:) has not been implemented") |