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

订单详情待完善

parent a55b3ec7
......@@ -16,6 +16,7 @@
import UIKit
import SwiftDate //日期处理库
import SwiftyJSON
//版本号
let systemVersion = (UIDevice.current.systemVersion as String)
......@@ -231,3 +232,17 @@ func dayByDouble (sender : Double ) -> String {
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 {
var order_type : Int?//订单类型 1普通2期货3团购4预售
var order_status : Int?//订单状态
var order_status_d : Int?//订单详细状态
var shipping_type : Int?//配送方式:1派送,2自提
var sale_res : OrderDetailSaleResModel?//订单预售详情(不是预售订单为空数组,无key=>value)
required init?( map: Map) {
......@@ -101,6 +103,8 @@ class OrderDetailResModel: Mappable {
order_status_d <- map["order_status_d"]
logistics_price <- map["logistics_price"]
other_price <- map["other_price"]
shipping_type <- map["shipping_type"]
sale_res <- map["sale_res"]
}
}
......@@ -109,7 +113,6 @@ func orderStatusStrByInt(statusNumber:Int) -> String? {
switch statusNumber {
case 0:
str = "未确定"
break
//待付款
case 1:
......@@ -140,7 +143,48 @@ func orderStatusStrByInt(statusNumber:Int) -> String? {
}
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 {
var og_id:Int? //订单商品号
......
......@@ -9,6 +9,11 @@
import UIKit
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() {
super.awakeFromNib()
......
<?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"/>
<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="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
......@@ -123,6 +123,13 @@
</constraints>
</tableViewCellContentView>
<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"/>
</tableViewCell>
</objects>
......
......@@ -18,12 +18,22 @@ class GuanLianKehuVC: BaseViewController , UITableViewDelegate, UITableViewDataS
var selectIdx:Int? = nil//暂代关联客户数据
var order_id:Int? = 0
@IBAction func submitAction(_ sender: LGButton) {
print("确定")
if selectIdx != nil{
HUD.flash(.progress)
let model = self.dataArr[self.selectIdx!]
let UserToken = UserDefaults.standard.value(forKey: "user_token")
self.delegate?.GuanLianKehuSelect(keHuData: self.dataArr[selectIdx!])
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{
HUD.flash(.label("请选择关联客户"), delay: 1.2)
}
......
......@@ -8,9 +8,11 @@
import UIKit
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() {
super.viewDidLoad()
......@@ -18,6 +20,24 @@ class ChangeGoodsPriceVC: BaseViewController , UITableViewDelegate, UITableView
self.view.addSubview(navbar)
setTabv()
}
@IBOutlet weak var sureBtn: LGButton!
//MARK:--确认修改价格
@IBAction func sureAction(_ sender: LGButton) {
let UserToken = UserDefaults.standard.value(forKey: "user_token")
let order_goods = dataChangeString(sender: [""])
editOrderGoodsPrice(["user_token":UserToken as Any,"order_id":orderID as Any,"order_goods":order_goods], success: { (data) in
}) { (error) in
}
}
var tableV :UITableView!
private let animations = [AnimationType.from(direction: .bottom, offset: 150*glscale)]
......@@ -25,8 +45,9 @@ class ChangeGoodsPriceVC: BaseViewController , UITableViewDelegate, UITableView
tableV = UITableView()
view.addSubview(tableV);
tableV.snp.makeConstraints { (make) in
make.left.right.bottom.equalToSuperview()
make.left.right.equalToSuperview()
make.top.equalTo(navbar.snp_bottom)
make.bottom.equalTo(sureBtn.snp_top)
}
tableV.backgroundColor = UIColor.init(named: "白色背景色")
tableV.delegate = self
......@@ -37,12 +58,22 @@ class ChangeGoodsPriceVC: BaseViewController , UITableViewDelegate, UITableView
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 3
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) {
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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">
<?xml version="1.0" encoding="UTF-8"?>
<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>
<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="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<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>
<outlet property="sureBtn" destination="u6y-CU-3oP" id="jeI-hQ-epr"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<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"/>
<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"/>
<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"/>
<point key="canvasLocation" x="132" y="119"/>
</view>
</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>
......@@ -10,6 +10,8 @@ import UIKit
import LGButton
class XiuGaiYuShouJiaViewController: BaseViewController {
var dataModel : OrderDetailDataModel?
var orderID:Int? = 0
@IBOutlet weak var firstView: UIView!
@IBOutlet weak var weiKuanTF: UITextField!
......@@ -33,12 +35,20 @@ class XiuGaiYuShouJiaViewController: BaseViewController {
make.left.right.equalTo(0)
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
......
<?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"/>
<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="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
......@@ -10,6 +10,7 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="OrderDViewController" customModule="GeliBusinessPlatform" customModuleProvider="target">
<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="btmViewH" destination="Scu-he-Peb" id="6AX-79-BBC"/>
<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