Commit f40eb3e8 authored by 刘俊宏's avatar 刘俊宏

完成销售下单流程

parent 81bb2a0a
......@@ -4,6 +4,22 @@
<FileRef
location = "group:GeliBusinessPlatform.xcodeproj">
</FileRef>
<Group
location = "group:GeliBusinessPlatform/Model/../.."
name = "Products">
<FileRef
location = "build:GeliBusinessPlatform.app"
assignedFileDataType = "com.apple.application-bundle">
</FileRef>
<FileRef
location = "build:GeliBusinessPlatformTests.xctest"
assignedFileDataType = "com.apple.xcode.cfbundle">
</FileRef>
<FileRef
location = "build:GeliBusinessPlatformUITests.xctest"
assignedFileDataType = "com.apple.xcode.cfbundle">
</FileRef>
</Group>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
......
......@@ -256,9 +256,20 @@ func getDictionaryFromJSONString(jsonString:String) ->NSDictionary{
return dict as! NSDictionary
}
return NSDictionary()
}
}
//MARK:--字符串转字典
func getDicFromJSONString(jsonString:String) ->Dictionary<String,Any>{
let jsonData:Data = jsonString.data(using: .utf8)!
let dict = try? JSONSerialization.jsonObject(with: jsonData, options: .mutableContainers)
if dict != nil {
return dict as! Dictionary
}
return Dictionary()
}
//MARK:--字典转字符串
func dictChangeString(sender:Dictionary<String, String>) -> String{
func dictChangeString(sender:Dictionary<String, Any>) -> String{
var str = ""
do {
let json = JSON(sender)
......
......@@ -26,6 +26,8 @@ class GetGoodsInfoModel: Mappable {
class GetGoodsInfoDataModel: Mappable {
var sku_id:Int?//sku_id
var goods_id:Int?//goods_id
var goods_img : String?//商品缩略图
var goods_name : String?//商品名
var origin_number : Int?//起订量
......@@ -45,6 +47,7 @@ class GetGoodsInfoDataModel: Mappable {
}
func mapping(map: Map) {
sku_id <- map["sku_id"]
goods_id <- map["goods_id"]
goods_img <- map["goods_img"]
goods_name <- map["goods_name"]
origin_number <- map["origin_number"]
......
......@@ -94,7 +94,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDeleg
// Create the SwiftUI view that provides the window contents.
tabBarController.viewControllers = [v1, v2, v3, v4, v5]
// tabBarController.selectedIndex = 2
tabBarController.selectedIndex = 2
let contentView = tabBarController
......
......@@ -42,6 +42,8 @@ class XuanZeShangPinCell: UITableViewCell {
@IBOutlet weak var selectBtn: UIButton!
@IBOutlet weak var btmView: UIView!
@IBOutlet weak var btmViewHeight: NSLayoutConstraint!
var cellModel: GetGoodsInfoDataModel? = nil
override func awakeFromNib() {
super.awakeFromNib()
self.selectionStyle = .none
......
<?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="16097" 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"/>
......@@ -231,7 +231,7 @@
<nil key="highlightedColor"/>
</label>
<imageView hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="yushou" translatesAutoresizingMaskIntoConstraints="NO" id="Rub-Pk-cR7">
<rect key="frame" x="37" y="15" width="68" height="36"/>
<rect key="frame" x="71" y="15" width="34" height="18"/>
</imageView>
</subviews>
<constraints>
......
......@@ -21,6 +21,7 @@ class DaiKeXiaDanGouWuCell: UITableViewCell {
@IBOutlet weak var priceLbl: UILabel!
@IBOutlet weak var detailLbl: UILabel!
@IBOutlet weak var titleLbl: UILabel!
@IBOutlet weak var diLbl: UILabel!
@IBAction func delAction(_ sender: Any) {
delegate?.DaiKeXiaDanGouWuCellDelAction(cell: self)
}
......
<?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="16097" 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"/>
......@@ -114,16 +114,27 @@
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="¥51153.00" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JyG-Tf-6Jd">
<rect key="frame" x="291.5" y="60" width="63.5" height="18.5"/>
<constraints>
<constraint firstAttribute="height" constant="18.5" id="11o-H0-KIf"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="HYf-UQ-mHg" secondAttribute="trailing" constant="17" id="1et-A0-Mm7"/>
<constraint firstItem="4lb-rz-I6F" firstAttribute="centerY" secondItem="AWX-Qu-0ML" secondAttribute="centerY" id="6mE-8H-dPD"/>
<constraint firstAttribute="trailingMargin" secondItem="Rio-TZ-iyo" secondAttribute="trailing" id="Bgy-0b-yb6"/>
<constraint firstItem="4lb-rz-I6F" firstAttribute="centerX" secondItem="AWX-Qu-0ML" secondAttribute="centerX" id="DtW-X9-NRk"/>
<constraint firstItem="Rio-TZ-iyo" firstAttribute="top" secondItem="JyG-Tf-6Jd" secondAttribute="bottom" constant="5" id="H2a-ha-CdE"/>
<constraint firstItem="Rio-TZ-iyo" firstAttribute="bottom" secondItem="X1B-vl-mvy" secondAttribute="bottom" id="JcG-ly-QUv"/>
<constraint firstItem="AWX-Qu-0ML" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="PkW-SQ-lMP"/>
<constraint firstItem="AWX-Qu-0ML" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="QkU-Fn-YVB"/>
<constraint firstItem="ftv-xQ-eXW" firstAttribute="trailing" secondItem="AWX-Qu-0ML" secondAttribute="trailing" constant="7.5" id="R1R-mm-RvM"/>
<constraint firstItem="JyG-Tf-6Jd" firstAttribute="trailing" secondItem="H2p-sc-9uM" secondAttribute="trailingMargin" id="SVb-FW-34b"/>
<constraint firstAttribute="trailingMargin" secondItem="LBB-wB-bMd" secondAttribute="trailing" constant="15" id="U69-j9-gAo"/>
<constraint firstItem="HYf-UQ-mHg" firstAttribute="top" secondItem="AWX-Qu-0ML" secondAttribute="top" id="UBt-NG-mg3"/>
<constraint firstAttribute="trailingMargin" secondItem="X1B-vl-mvy" secondAttribute="trailing" constant="15" id="ZfW-BJ-Tbo"/>
......@@ -149,6 +160,7 @@
<outlet property="delImg" destination="ftv-xQ-eXW" id="CON-aC-p5Y"/>
<outlet property="detailLbl" destination="LBB-wB-bMd" id="Z5L-Om-fG8"/>
<outlet property="detailLbl2" destination="X1B-vl-mvy" id="h0s-3d-jnl"/>
<outlet property="diLbl" destination="JyG-Tf-6Jd" id="loL-0t-j6w"/>
<outlet property="imgView" destination="AWX-Qu-0ML" id="BQH-fG-eL9"/>
<outlet property="priceLbl" destination="Rio-TZ-iyo" id="Ivg-2f-C6y"/>
<outlet property="titleLbl" destination="HYf-UQ-mHg" id="bMC-Ni-Yjv"/>
......
......@@ -146,6 +146,7 @@ class XuanZeShangPinViewController: BaseViewController,UITableViewDelegate,UITab
cell.idx = indexPath
let model = datas[indexPath.row]
cell.nameLbl.text = model.goods_name
cell.cellModel = model
cell.detailLbl.text = "\(model.spec_str!)/\(model.unit!)"
cell.detailLbl2.text = "存储:\(model.inventory!)"
cell.iconImg.sd_setImage(with: URL(string: SERVERCE_ImageHost + model.goods_img!))
......
......@@ -32,10 +32,12 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData
navbar.rightTitle = "新增"
self.view.addSubview(navbar)
HUD.flash(.progress)
let UserToken = UserDefaults.standard.value(forKey: "user_token")
getAddrsInfo(["user_token":UserToken,"cus_id":cus_id], success: { (data) in
self.adrInfo = data as! GetAddrsInfoModel
self.listView.reloadData()
HUD.hide()
}) { (error) in
}
......
......@@ -22,14 +22,25 @@ class GuanLianKehuVC: BaseViewController , UITableViewDelegate, UITableViewDataS
@IBAction func submitAction(_ sender: LGButton) {
print("确定")
if order_id == 0 {
//MARK:--代客下单流程的关联客服
self.delegate?.GuanLianKehuSelect(keHuData: self.dataArr[self.selectIdx!])
self.navigationController?.popViewController(animated: true)
return
}
if selectIdx != nil{
HUD.flash(.progress)
let model = self.dataArr[self.selectIdx!]
let UserToken = UserDefaults.standard.value(forKey: "user_token")
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)
let dataM = data as! UpDataModel
if dataM.code == 1 {
self.delegate?.GuanLianKehuSelect(keHuData: self.dataArr[self.selectIdx!])
self.navigationController?.popViewController(animated: true)
}
}) { (error) in
}
......
......@@ -32,6 +32,7 @@ class ChangeGoodsPriceVC: BaseViewController , UITableViewDelegate, UITableView
//MARK:--确认修改价格
@IBAction func sureAction(_ sender: LGButton) {
let UserToken = UserDefaults.standard.value(forKey: "user_token")
var order_goodsArr:Array<Any>? = []
......
......@@ -9,14 +9,17 @@
import UIKit
import LGButton
protocol XiuGaiYuShouJiaViewControllerDelegate {
func changeYuShouGoodsByData(sender:EditOGPAdDataModel)
func changeYuShouGoodsByData(sender:EditOGPAdDataModel?,djText:String,wkText:String)
}
class XiuGaiYuShouJiaViewController: BaseViewController {
var dataModel : OrderDetailDataModel?
var orderID:Int? = 0
var delegate : XiuGaiYuShouJiaViewControllerDelegate?
var inputData:Array<XuanZeShangPinCell> = []
var djTFstr:String = "";
var wkTFstr:String = "";
@IBOutlet weak var firstView: UIView!
@IBOutlet weak var weiKuanTF: UITextField!
@IBOutlet weak var dingJinTF: UITextField!
......@@ -39,34 +42,57 @@ class XiuGaiYuShouJiaViewController: BaseViewController {
make.left.right.equalTo(0)
make.height.equalTo(120*glscale)
}
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
if orderID != 0{
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
}
}else{
//MARK:--代客下单流程
if inputData.count > 0 {
let cell1 = inputData[0]
titleLbl.text = cell1.nameLbl.text
detailLbl.text = cell1.detailLbl.text
icomImg.sd_setImage(with: URL(string: cell1.imgUrlPath!))
countLbl.isHidden = true
dingJinTF.text = djTFstr
weiKuanTF.text = wkTFstr
}
}
}
@IBAction func submitACTION(_ sender: Any) {
print("预售返回上一级且提交了数据")
//MARK:--需要对输入是否为金额判断
let UserToken = UserDefaults.standard.value(forKey: "user_token")
let rowModel = dataModel?.order_goods![0]
if orderID != 0 {
//MARK:--需要对输入是否为金额判断
let UserToken = UserDefaults.standard.value(forKey: "user_token")
let rowModel = dataModel?.order_goods![0]
editOrderGoodsPriceAd(["user_token":UserToken as Any,"order_id":orderID as Any,"og_id":rowModel?.og_id as Any,"dj_amount":dingJinTF.text as Any,"wk_amount":weiKuanTF.text as Any], success: { (data) in
let dataM = data as! EditOGPAdModel
if dataM.code == 1 {
self.delegate?.changeYuShouGoodsByData(sender: dataM.data!)
self.navigationController?.popViewController(animated: true)
}
editOrderGoodsPriceAd(["user_token":UserToken as Any,"order_id":orderID as Any,"og_id":rowModel?.og_id as Any,"dj_amount":dingJinTF.text as Any,"wk_amount":weiKuanTF.text as Any], success: { (data) in
let dataM = data as! EditOGPAdModel
if dataM.code == 1 {
self.delegate?.changeYuShouGoodsByData(sender: dataM.data!, djText: self.dingJinTF.text!, wkText: self.weiKuanTF.text!)
self.navigationController?.popViewController(animated: true)
}
}) { (error) in
}) { (error) in
}
}else{
//MARK:--代客下单流程
self.delegate?.changeYuShouGoodsByData(sender:nil, djText: dingJinTF.text!, wkText: weiKuanTF.text!)
self.navigationController?.popViewController(animated: true)
}
}
......
......@@ -235,14 +235,14 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
}
//MARK:--修改价格(预售返回数据)
func changeYuShouGoodsByData(sender: EditOGPAdDataModel) {
func changeYuShouGoodsByData(sender: EditOGPAdDataModel?, djText: String, wkText: String) {
print("修改价格(预售返回数据)--只更新datamodel,不请求网络\(sender)")
self.dataMdoel?.order_res?.sale_res?.dj_amount = sender.dj_amount
self.dataMdoel?.order_res?.sale_res?.wk_amount = sender.wk_amount
// listView.reloadData()
self.dataMdoel?.order_res?.sale_res?.dj_amount = sender!.dj_amount
self.dataMdoel?.order_res?.sale_res?.wk_amount = sender!.wk_amount
// listView.reloadData()
loadData()
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
let view = UIView()
......
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