Commit 81bb2a0a authored by lujunye's avatar lujunye

完善地址选择

parent 804f9118
......@@ -46,7 +46,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDeleg
let vc = LoginViewController()
vc.delegate = self
let contentView = vc
//
// let vc = DaiKeXiaDanGouWuViewController()
// let contentView = vc
......@@ -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 = 1
// tabBarController.selectedIndex = 2
let contentView = tabBarController
......
......@@ -10,7 +10,7 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="DKXDAdrCell" customModule="GeliBusinessPlatform" customModuleProvider="target">
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="DKXDAdrCell" customModule="TestClass" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="375" height="70"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
......
......@@ -31,7 +31,7 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
var dj_payWay = 0//定金支付方式
var orderType:Int? //订单类型
var adrData:String?//地址数据
var adrData:GetAddrsInfoDataModel?//地址数据
var glSelectView:GLAlertSelectView? = nil
var footerView:DaiKeXiaDanFooterView?
......@@ -138,7 +138,8 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
if indexPath.row == 3 {
let cell = tableView.dequeueReusableCell(withIdentifier: "DKXDAdrCell") as! DKXDAdrCell
cell.nameLbl.text = p3Arr[indexPath.row]
cell.contentLbl.text = adrData
cell.contentLbl.text = "\(adrData?.consignee) \(adrData?.mobile)"
cell.adrLbl.text = adrData?.addr_cn
cell.tag = indexPath.row
return cell
}
......@@ -229,6 +230,7 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
if indexPath.row == 3 || indexPath.row > 4{
if indexPath.row == 3 {
let vc = DZGLViewController()
vc.cus_id = cusModel?.cus_id
vc.isSelectMotion = true
vc.delegate = self
self.navigationController?.pushViewController(vc, animated: true)
......@@ -401,7 +403,7 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
}
//MARK: - 选择地址
func DZGLViewControllerSelect(data: String) {
func DZGLViewControllerSelect(data: GetAddrsInfoDataModel) {
adrData = data
listView.reloadData()
}
......
......@@ -10,17 +10,19 @@ import UIKit
import SwipeCellKit
import LGButton
protocol DZGLViewControllerDelegate {
func DZGLViewControllerSelect(data:String)
func DZGLViewControllerSelect(data:GetAddrsInfoDataModel)
}
class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,SwipeTableViewCellDelegate{
var delegate:DZGLViewControllerDelegate?
var cus_id:Int?
var isSelectMotion = false
var selectIdx:IndexPath?
var adrInfo:GetAddrsInfoModel?
@IBOutlet weak var btmLbl: UILabel!
@IBOutlet weak var listView: UITableView!
@IBOutlet weak var btmBtn: LGButton!
@IBAction func btmClick(_ sender: Any) {
delegate?.DZGLViewControllerSelect(data: "abc")
delegate?.DZGLViewControllerSelect(data: (adrInfo?.data![selectIdx!.row])!)
self.navigationController?.popViewController(animated: true)
}
@IBOutlet weak var btmLblHeight: NSLayoutConstraint!
......@@ -29,6 +31,15 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData
navbar.title = "地址管理"
navbar.rightTitle = "新增"
self.view.addSubview(navbar)
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()
}) { (error) in
}
listView.separatorStyle = .none
SetTopFrameView(view: listView, btmView: btmLbl)
listView.register(UINib(nibName: "DiZhiGuanLiCell", bundle: nil), forCellReuseIdentifier: "DiZhiGuanLiCell")
......@@ -51,7 +62,10 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData
self.navigationController?.pushViewController(vc, animated: true)
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 3
if adrInfo != nil {
return (adrInfo?.data!.count)!
}
return 1
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 79
......@@ -59,6 +73,10 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "DiZhiGuanLiCell") as! DiZhiGuanLiCell
cell.delegate = self
let model = adrInfo?.data![indexPath.row]
cell.nameLbl.text = model?.consignee
cell.phoneLbl.text = model?.mobile
cell.adrLbl.text = model?.addr_cn
if isSelectMotion == false {
cell.btnH.constant = 0
cell.xValue.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