Commit f988f954 authored by lujunye's avatar lujunye

33

parent 5caefc91
...@@ -27,10 +27,10 @@ let systemVersion = (UIDevice.current.systemVersion as String) ...@@ -27,10 +27,10 @@ let systemVersion = (UIDevice.current.systemVersion as String)
//接口地址 //接口地址
//test //test
//let SERVERCE_ImageHost = "https://z.gelifood.com/" let SERVERCE_ImageHost = "https://z.gelifood.com/"
//let SERVERCE_HOST = "https://z.gelifood.com/admin/" let SERVERCE_HOST = "https://z.gelifood.com/admin/"
let SERVERCE_ImageHost = "https://zx.gelifood.com/" //let SERVERCE_ImageHost = "https://zx.gelifood.com/"
let SERVERCE_HOST = "https://zx.gelifood.com/admin/" //let SERVERCE_HOST = "https://zx.gelifood.com/admin/"
//online //online
//视图常量 //视图常量
......
...@@ -420,5 +420,13 @@ ...@@ -420,5 +420,13 @@
<string>Distribution/delDbtListInfo</string> <string>Distribution/delDbtListInfo</string>
<key>设置商品参与分销</key> <key>设置商品参与分销</key>
<string>Distribution/dbtSetDbtGoods</string> <string>Distribution/dbtSetDbtGoods</string>
<key>修改客户收货地址</key>
<string>Customer/saveShippingAddress</string>
<key>新增客户收货地址</key>
<string>Customer/newShippingAddress</string>
<key>删除客户地址</key>
<string>Customer/deleteCusAdd</string>
<key>特殊客户地址查询</key>
<string>Customer/getAddrsInfoCaddr</string>
</dict> </dict>
</plist> </plist>
...@@ -52,7 +52,7 @@ cus_name 客户名 ...@@ -52,7 +52,7 @@ cus_name 客户名
phone 联系电话 phone 联系电话
user_id 绑定用户的用户id user_id 绑定用户的用户id
discounts_rate 优惠率,使用时除100 discounts_rate 优惠率,使用时除100
address_id 新增地址时返回的address_id,多个就用英文逗号隔开的字符串。新增客户时新增了地址就必传
*/ */
func cusAdd(_ params:[String:Any],success:@escaping (_ res:Any)->(),failture:@escaping(_ error:Error)->()) { func cusAdd(_ params:[String:Any],success:@escaping (_ res:Any)->(),failture:@escaping(_ error:Error)->()) {
NetworkRequest.sharedInstance.postRequest("新增客户", params, { (rep:DataResponse<UpDataModel>) in NetworkRequest.sharedInstance.postRequest("新增客户", params, { (rep:DataResponse<UpDataModel>) in
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
import Foundation import Foundation
import ObjectMapper import ObjectMapper
//发送验证码,验证短信验证码,修改登录密码,绑定、更换绑定格利支付账号,简单通用操作接口,普通订单发货,预售订单发货,订单绑定/更换绑定客户,确认订单,订单取消,修改订单商品价格,订单退款,普通订单退货,预售订单退货,修改订单支付方式(状态),商家仓库添加,商家仓库修改,商家仓库删除,提交下单,商品入库申请,商品出库,商品申请出库,商品审核出库,出库入库审核不通过,编辑地址,删除地址,新增采购单,审核采购单,撤销入库,采购单修改支付状态,供应商编辑,新增供应商,编辑客户,新增客户,应收账款收款,设为未收,取消采购单,修改采购订单,新增品牌,拒绝退款,确认用户退款到账,拒绝接单,审核同意退货退款,取消订单审核,确认收到退货,审核同意退货或退款,订单确认收货,取消运单,支付运费,选定地址添加收发货历史,取消货拉拉订单,货拉拉二次支付,货拉拉格利支付,发票消息短信通知,修改电子发票链接地址,分销分账设置,供应商新增店铺,标记已人工结算,铺货与取消铺货,终止合作,分销商品管理,分销商新增供应商,审核操作(通过和不通过),删除客户,新增分销员,删除分销员,修改不二制油订单打印,店长审核通过、审核通过待补齐资料、不通过,保存店长审核信息(商家信息),拼拼货取消订单,供应商新增代理商(批量和单个新增代理商),终止与代理商合作,给代理商设置分销商品,商品上下架,供应商取消商品分销,上下架(设置分销商品给分销商),代理商终止与供应商合作,代理商的铺货或分销设置,取消分销,代理商设置分销商品上下架商品,代理商终止合作,分销商新增代理商,删除下游店长,新增店铺,上下架,上游商品上下架,上游取消分销,设置商品参与分销, //发送验证码,验证短信验证码,修改登录密码,绑定、更换绑定格利支付账号,简单通用操作接口,普通订单发货,预售订单发货,订单绑定/更换绑定客户,确认订单,订单取消,修改订单商品价格,订单退款,普通订单退货,预售订单退货,修改订单支付方式(状态),商家仓库添加,商家仓库修改,商家仓库删除,提交下单,商品入库申请,商品出库,商品申请出库,商品审核出库,出库入库审核不通过,编辑地址,删除地址,新增采购单,审核采购单,撤销入库,采购单修改支付状态,供应商编辑,新增供应商,编辑客户,新增客户,应收账款收款,设为未收,取消采购单,修改采购订单,新增品牌,拒绝退款,确认用户退款到账,拒绝接单,审核同意退货退款,取消订单审核,确认收到退货,审核同意退货或退款,订单确认收货,取消运单,支付运费,选定地址添加收发货历史,取消货拉拉订单,货拉拉二次支付,货拉拉格利支付,发票消息短信通知,修改电子发票链接地址,分销分账设置,供应商新增店铺,标记已人工结算,铺货与取消铺货,终止合作,分销商品管理,分销商新增供应商,审核操作(通过和不通过),删除客户,新增分销员,删除分销员,修改不二制油订单打印,店长审核通过、审核通过待补齐资料、不通过,保存店长审核信息(商家信息),拼拼货取消订单,供应商新增代理商(批量和单个新增代理商),终止与代理商合作,给代理商设置分销商品,商品上下架,供应商取消商品分销,上下架(设置分销商品给分销商),代理商终止与供应商合作,代理商的铺货或分销设置,取消分销,代理商设置分销商品上下架商品,代理商终止合作,分销商新增代理商,删除下游店长,新增店铺,上下架,上游商品上下架,上游取消分销,设置商品参与分销,修改客户收货地址,删除客户地址,
class UpDataModel: Mappable { class UpDataModel: Mappable {
......
...@@ -483,3 +483,75 @@ func dbtSetDbtGoods(_ params:[String:Any],success:@escaping (_ res:Any)->(),fail ...@@ -483,3 +483,75 @@ func dbtSetDbtGoods(_ params:[String:Any],success:@escaping (_ res:Any)->(),fail
failture(error) failture(error)
} }
} }
//MARK:-- 修改客户收货地址
/*
user_token 1 string 验证token 必填
cus_id 1 int 客户id 必填
consignee 1 string 收货人的名字 必填
province 1 int 省份 必填
city 1 int 城市 必填
district 1 int 地区 必填
street 0 int 街道 非必填
address 1 string 详细地址 必填
mobile 1 int 手机 必填
is_default 1 int 是否为默认收货地址:1默认 0非默认 必填
*/
func saveShippingAddress(_ 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 1 string 验证token 必填
caddr_id 1 int 客户地址id(getAddrsInfo接口有返回) 必填
*/
func deleteCusAdd(_ 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 1 string 验证token 必填
cus_id 0 int 客户id【注:只有在新增客户时先新增了地址才可以不传,新增客户时把返回的address_id英文逗号拼接返回。其他有客户的情况下必填】 非必填
consignee 1 string 收货人的名字 必填
province 1 int 省份 必填
city 1 int 城市 必填
district 1 int 地区 必填
street 0 int 街道 非必填
address 1 string 详细地址 必填
mobile 1 int 手机 必填
is_default 1 int 是否为默认收货地址:1默认 0非默认 必填
*/
func newShippingAddress(_ params:[String:Any],success:@escaping (_ res:Any)->(),failture:@escaping(_ error:Error)->()) {
NetworkRequest.sharedInstance.postRequest("新增客户收货地址", params, { (rep:DataResponse<newShippingAddress_model>) in
}, success: { (data) in
success(data)
}) { (error) in
failture(error)
}
}
//MARK:-- 特殊客户地址查询
/*
user_token 1 string 验证token 必填
caddr_id 1 string caddr_id就是接口【saveShippingAddress】返回的address_id,用英文逗号隔开 必填
*/
func getAddrsInfoCaddr(_ params:[String:Any],success:@escaping (_ res:Any)->(),failture:@escaping(_ error:Error)->()) {
NetworkRequest.sharedInstance.postRequest("特殊客户地址查询", params, { (rep:DataResponse<GetAddrsInfoModel>) in
}, success: { (data) in
success(data)
}) { (error) in
failture(error)
}
}
...@@ -8,7 +8,30 @@ ...@@ -8,7 +8,30 @@
import Foundation import Foundation
import ObjectMapper import ObjectMapper
//MARK: - 新增客户收货地址
class newShippingAddress_model: Mappable {
var code:Int?
var message : String?
var data :newShippingAddress_data_model?
required init?( map: Map) {
}
func mapping(map: Map) {
code <- map["code"]
message <- map["message"]
data <- map["data"]
}
}
class newShippingAddress_data_model: Mappable {
var address_id : String?
required init?( map: Map) {
}
func mapping(map: Map) {
address_id <- map["address_id"]
}
}
//MARK: - 代理商下拉框列表查询(查询合作着的代理商) //MARK: - 代理商下拉框列表查询(查询合作着的代理商)
class ageConList_model: Mappable { class ageConList_model: Mappable {
var code:Int? var code:Int?
......
...@@ -37,7 +37,7 @@ class HGImagePickerController: UIViewController { ...@@ -37,7 +37,7 @@ class HGImagePickerController: UIViewController {
let userCollections = PHCollectionList.fetchTopLevelUserCollections(with: nil) let userCollections = PHCollectionList.fetchTopLevelUserCollections(with: nil)
self.convertCollection(collection: userCollections self.convertCollection(collection: userCollections
as! PHFetchResult<PHAssetCollection>) as! PHFetchResult<PHAssetCollection>)
//相册按包含的照片数量排序(降序) //相册按包含的照片数量排序(降序)
self.items.sort { (item1, item2) -> Bool in self.items.sort { (item1, item2) -> Bool in
return item1.fetchResult.count > item2.fetchResult.count return item1.fetchResult.count > item2.fetchResult.count
...@@ -45,9 +45,7 @@ class HGImagePickerController: UIViewController { ...@@ -45,9 +45,7 @@ class HGImagePickerController: UIViewController {
//异步加载表格数据,需要在主线程中调用reloadData() 方法 //异步加载表格数据,需要在主线程中调用reloadData() 方法
DispatchQueue.main.async{ DispatchQueue.main.async{
self.tableView?.reloadData() self.tableView?.reloadData() //首次进来后直接进入第一个相册图片展示页面(相机胶卷)
//首次进来后直接进入第一个相册图片展示页面(相机胶卷)
if let imageCollectionVC = self.storyboard? if let imageCollectionVC = self.storyboard?
.instantiateViewController(withIdentifier: "hgImageCollectionVC") .instantiateViewController(withIdentifier: "hgImageCollectionVC")
as? HGImageCollectionViewController{ as? HGImageCollectionViewController{
......
...@@ -16,6 +16,14 @@ import IQKeyboardManagerSwift ...@@ -16,6 +16,14 @@ import IQKeyboardManagerSwift
class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,JiTuoWuXinXiViewDelegate,JiPaiFangShiViewControllerDelegate,ZengZhiServicesViewControllerDelegate,AdressSelectCellDelegate,DZGLViewControllerDelegate,XinZengDiZhiViewControllerDelegate,TitleAndTFBtnCellDelegate,WenDuCellDelegate,LogisticalSelectViewDelegate, UIPickerViewDataSource, UIPickerViewDelegate, GLAlertSelectViewDelegate,CLLocationManagerDelegate, CityListViewControllerDelegate,ToAndFormSelectViewControllerDelegate,WayBillAddressCanDelItemCellDelegate,HLLTopCellDelegate,OtherDemandViewControllerDelegate,OnlyViewCellDelegate, XiaDanUserInfoViewControllerDelegate, P_P_H_Time_Select_View_Delegate,P_P_H_Adr_VC_Delegate, Suc_LOG_Cell_Delegate,PaymentViewDelegate{ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,JiTuoWuXinXiViewDelegate,JiPaiFangShiViewControllerDelegate,ZengZhiServicesViewControllerDelegate,AdressSelectCellDelegate,DZGLViewControllerDelegate,XinZengDiZhiViewControllerDelegate,TitleAndTFBtnCellDelegate,WenDuCellDelegate,LogisticalSelectViewDelegate, UIPickerViewDataSource, UIPickerViewDelegate, GLAlertSelectViewDelegate,CLLocationManagerDelegate, CityListViewControllerDelegate,ToAndFormSelectViewControllerDelegate,WayBillAddressCanDelItemCellDelegate,HLLTopCellDelegate,OtherDemandViewControllerDelegate,OnlyViewCellDelegate, XiaDanUserInfoViewControllerDelegate, P_P_H_Time_Select_View_Delegate,P_P_H_Adr_VC_Delegate, Suc_LOG_Cell_Delegate,PaymentViewDelegate{
func DZGLViewController_adr(adr_id: String) {
//此处无用
}
func XinZengDiZhiViewControllerFinishAction_kehu(adr_id: String) {
//此处无用
}
func PaymentViewClose() { func PaymentViewClose() {
paymentView?.removeFromSuperview() paymentView?.removeFromSuperview()
paymentView = nil paymentView = nil
......
...@@ -10,6 +10,10 @@ import UIKit ...@@ -10,6 +10,10 @@ import UIKit
import IQKeyboardManagerSwift import IQKeyboardManagerSwift
class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,UITableViewDelegate,DaiKeXiaDanFooterViewDelegate,TitleAndBtnCellDelegate,GLAlertSelectViewDelegate,DZGLViewControllerDelegate,XuanZeShangPinViewControllerDelegate,DaiKeXiaDanGouWuCellDelegate,GuanLianKehuVCDelegate,XiuGaiYuShouJiaViewControllerDelegate,TitleAndTFCellDelegate, GeliAlertViewDelegate,UITextFieldDelegate{ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,UITableViewDelegate,DaiKeXiaDanFooterViewDelegate,TitleAndBtnCellDelegate,GLAlertSelectViewDelegate,DZGLViewControllerDelegate,XuanZeShangPinViewControllerDelegate,DaiKeXiaDanGouWuCellDelegate,GuanLianKehuVCDelegate,XiuGaiYuShouJiaViewControllerDelegate,TitleAndTFCellDelegate, GeliAlertViewDelegate,UITextFieldDelegate{
func DZGLViewController_adr(adr_id: String) {
//此处无用
}
func DaiKeXiaDanGouWuCell_select_pi_ci(cell: DaiKeXiaDanGouWuCell) { func DaiKeXiaDanGouWuCell_select_pi_ci(cell: DaiKeXiaDanGouWuCell) {
print("选择批次2") print("选择批次2")
} }
......
...@@ -11,8 +11,24 @@ import SwipeCellKit ...@@ -11,8 +11,24 @@ import SwipeCellKit
import LGButton import LGButton
protocol DZGLViewControllerDelegate { protocol DZGLViewControllerDelegate {
func DZGLViewControllerSelect(data:GetAddrsInfoDataModel) func DZGLViewControllerSelect(data:GetAddrsInfoDataModel)
func DZGLViewController_adr(adr_id:String)
} }
class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,SwipeTableViewCellDelegate,UISearchBarDelegate,SearchBarViewDelegate,XinZengDiZhiViewControllerDelegate,GeliAlertViewDelegate{ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,SwipeTableViewCellDelegate,UISearchBarDelegate,SearchBarViewDelegate,XinZengDiZhiViewControllerDelegate,GeliAlertViewDelegate{
func XinZengDiZhiViewControllerFinishAction_kehu(adr_id: String) {
if adr_id.count > 0 {
address_id_arr.append(adr_id)
if address_id_arr.count > 1 {
delegate?.DZGLViewController_adr(adr_id: address_id_arr.joined(separator: ","))
}else{
delegate?.DZGLViewController_adr(adr_id: adr_id)
}
}
listView.mj_header?.beginRefreshing()
}
@IBOutlet weak var holder_view: UIView! @IBOutlet weak var holder_view: UIView!
var is_keHu_list = false var is_keHu_list = false
var kehu_adrArr:Array<GetAddrsInfoDataModel> = [] var kehu_adrArr:Array<GetAddrsInfoDataModel> = []
...@@ -89,7 +105,7 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData ...@@ -89,7 +105,7 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData
var selectIdx:IndexPath? var selectIdx:IndexPath?
var adrInfo:GetAddrsInfoModel? var adrInfo:GetAddrsInfoModel?
var isSelectlogAddress = false var isSelectlogAddress = false
var address_id_arr:Array<String> = []
//列表 //列表
var adrArrs:Array<AddressListDataModel> = [] var adrArrs:Array<AddressListDataModel> = []
@IBOutlet weak var searchBg: UIView! @IBOutlet weak var searchBg: UIView!
...@@ -129,43 +145,27 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData ...@@ -129,43 +145,27 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData
} }
}else{ }else{
if cus_id != nil { //searchbar
HUD.flash(.progress) let searchBr = SearchBarView.init()
searchBgH.constant = 0 self.searchBg.addSubview(searchBr)
getAddrsInfo(["user_token":UserToken as Any,"cus_id":cus_id as Any], success: { (data) in searchBr.snp.makeConstraints { (make) in
self.adrInfo = (data as! GetAddrsInfoModel) make.left.right.equalTo(0)
make.centerY.equalToSuperview()
if self.adrInfo?.data?.count == 0 { make.height.equalTo(35)
self.holder_view.isHidden = false
}
self.listView.reloadData()
HUD.hide()
}) { (error) in
}
}else{
//searchbar
let searchBr = SearchBarView.init()
self.searchBg.addSubview(searchBr)
searchBr.snp.makeConstraints { (make) in
make.left.right.equalTo(0)
make.centerY.equalToSuperview()
make.height.equalTo(35)
}
searchV = searchBr
searchBr.placeholderStr = "请输入收货人地址"
searchBr.cornerRadius = 35/2.0
searchBr.delegate = self
searchBr.delegateL = self
navbar.rightTitle = "新增"
searchBgH.constant = 45
//下拉刷新相关设置
headerMJ.setRefreshingTarget(self, refreshingAction: #selector(loadData))
self.listView!.mj_header = headerMJ
self.listView.mj_header?.beginRefreshing()
} }
searchV = searchBr
searchBr.placeholderStr = "请输入收货人地址"
searchBr.cornerRadius = 35/2.0
searchBr.delegate = self
searchBr.delegateL = self
navbar.rightTitle = "新增"
searchBgH.constant = 45
//下拉刷新相关设置
headerMJ.setRefreshingTarget(self, refreshingAction: #selector(loadData))
self.listView!.mj_header = headerMJ
self.listView.mj_header?.beginRefreshing()
} }
listView.separatorStyle = .none listView.separatorStyle = .none
...@@ -191,11 +191,48 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData ...@@ -191,11 +191,48 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData
listView.estimatedRowHeight = 49 listView.estimatedRowHeight = 49
listView.rowHeight = UITableView.automaticDimension listView.rowHeight = UITableView.automaticDimension
// Do any additional setup after loading the view.
} }
@objc func loadData(){ @objc func loadData(){
if is_keHu_list {
if cus_id != nil {
getAddrsInfo(["user_token":UserToken as Any,"cus_id":cus_id as Any], success: { (data) in
self.adrInfo = (data as! GetAddrsInfoModel)
self.kehu_adrArr.removeAll()
if self.adrInfo?.data?.count == 0 {
self.holder_view.isHidden = false
}else{
self.holder_view.isHidden = true
self.adrInfo?.data?.forEach({ item in
self.kehu_adrArr.append(item)
})
}
self.listView.reloadData()
self.listView.mj_header?.endRefreshing()
}) { (error) in
self.listView.mj_header?.endRefreshing()
}
}else{
getAddrsInfoCaddr(["user_token":UserToken as Any,"caddr_id":address_id_arr.joined(separator: ",") as Any]) { data in
self.adrInfo = (data as! GetAddrsInfoModel)
self.kehu_adrArr.removeAll()
if self.adrInfo?.data?.count == 0 {
self.holder_view.isHidden = false
}else{
self.holder_view.isHidden = true
self.adrInfo?.data?.forEach({ item in
self.kehu_adrArr.append(item)
})
}
self.listView.reloadData()
self.listView.mj_header?.endRefreshing()
} failture: { err in
self.listView.mj_header?.endRefreshing()
}
}
return
}
adrArrs.removeAll() adrArrs.removeAll()
AddressList(["user_token":UserToken as Any,"key_word":keyWord], success: { (data) in AddressList(["user_token":UserToken as Any,"key_word":keyWord], success: { (data) in
let model = data as! AddressListModel let model = data as! AddressListModel
...@@ -207,9 +244,7 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData ...@@ -207,9 +244,7 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData
self.adrArrs.append(item) self.adrArrs.append(item)
}) })
} }
print("adrs == ",self.adrArrs.count)
self.listView.reloadData() self.listView.reloadData()
self.listView.mj_header?.endRefreshing() self.listView.mj_header?.endRefreshing()
}) { (data) in }) { (data) in
self.listView.mj_header?.endRefreshing() self.listView.mj_header?.endRefreshing()
...@@ -221,6 +256,10 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData ...@@ -221,6 +256,10 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData
let vc = XinZengDiZhiViewController() let vc = XinZengDiZhiViewController()
vc.navTitle = "新增地址" vc.navTitle = "新增地址"
vc.delegate = self vc.delegate = self
vc.is_keHu_list = is_keHu_list
if cus_id != nil {
vc.cus_id = cus_id!
}
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
} }
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
...@@ -330,28 +369,31 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData ...@@ -330,28 +369,31 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData
if kehu_adrArr.count > 0 { if kehu_adrArr.count > 0 {
let model = kehu_adrArr[indexPath.row] let model = kehu_adrArr[indexPath.row]
let vc = XinZengDiZhiViewController() let vc = XinZengDiZhiViewController()
vc.is_keHu_list = true
vc.cus_id = cus_id!
vc.caddr_id = model.caddr_id!
vc.delegate = self vc.delegate = self
vc.navTitle = "编辑地址" vc.navTitle = "编辑地址"
vc.provinceIndex = model.province! vc.provinceIndex = model.province!
vc.cityIndex = model.city! vc.cityIndex = model.city!
vc.areaIndex = model.district! vc.areaIndex = model.district!
// vc.address_id = model.address_id! // vc.address_id = model.address_id!
vc.adrStr = model.address! vc.adrStr = model.address!
vc.nameStr = model.consignee! vc.nameStr = model.consignee!
vc.phone = model.mobile! vc.phone = model.mobile!
// vc.tel = model.tel!
// vc.zip = model.zipcode!
vc.is_send_default = false vc.is_send_default = false
// vc.pcdStr = model.province_cn! if model.province_cn != nil {
// if model.city_cn != nil { vc.pcdStr = model.province_cn!
// vc.pcdStr = model.province_cn! + "-" + model.city_cn! if model.city_cn != nil {
// if model.district_cn != nil { vc.pcdStr = model.province_cn! + "-" + model.city_cn!
// vc.pcdStr = model.province_cn! + "-" + model.city_cn! + "-" + model.district_cn! if model.district_cn != nil {
// } vc.pcdStr = model.province_cn! + "-" + model.city_cn! + "-" + model.district_cn!
// } }
// if model.is_send_default == 1 { }
// vc.is_send_default = true }
// } //if model.is_send_default == 1 {
// vc.is_send_default = true
//}
vc.is_default = false vc.is_default = false
if model.is_default == 1 { if model.is_default == 1 {
vc.is_default = true vc.is_default = true
......
...@@ -236,7 +236,9 @@ class KeHuListViewController: BaseViewController,UITableViewDelegate,UITableView ...@@ -236,7 +236,9 @@ class KeHuListViewController: BaseViewController,UITableViewDelegate,UITableView
@IBAction func addAction(_ sender: Any) { @IBAction func addAction(_ sender: Any) {
let vc = XinZengAndBianJiKeHuViewController() let vc = XinZengAndBianJiKeHuViewController()
vc.titleStr = "新增客户" vc.titleStr = "新增客户"
vc.delegate = self vc.delegate = self
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
} }
//MARK: - 自定义delegate //MARK: - 自定义delegate
...@@ -246,6 +248,7 @@ class KeHuListViewController: BaseViewController,UITableViewDelegate,UITableView ...@@ -246,6 +248,7 @@ class KeHuListViewController: BaseViewController,UITableViewDelegate,UITableView
vc.titleStr = "编辑客户" vc.titleStr = "编辑客户"
vc.delegate = self vc.delegate = self
vc.cus_id = model.cus_id! vc.cus_id = model.cus_id!
if model.company != nil { if model.company != nil {
vc.companyName = model.company! vc.companyName = model.company!
} }
......
...@@ -11,11 +11,20 @@ import LGButton ...@@ -11,11 +11,20 @@ import LGButton
protocol XinZengAndBianJiKeHuViewControllerDelegate { protocol XinZengAndBianJiKeHuViewControllerDelegate {
func XinZengAndBianJiKeHuViewControllerFinish() func XinZengAndBianJiKeHuViewControllerFinish()
} }
class XinZengAndBianJiKeHuViewController: BaseViewController,UITableViewDataSource,UITableViewDelegate,BingDingKeHuViewControllerDelegate,GLAlertSelectViewDelegate,UITextFieldDelegate,GeliAlertViewDelegate{ class XinZengAndBianJiKeHuViewController: BaseViewController,UITableViewDataSource,UITableViewDelegate,BingDingKeHuViewControllerDelegate,GLAlertSelectViewDelegate,UITextFieldDelegate,GeliAlertViewDelegate, DZGLViewControllerDelegate{
func DZGLViewControllerSelect(data: GetAddrsInfoDataModel) {
//此处无用
}
func DZGLViewController_adr(adr_id: String) {
address_id = adr_id
print("abc = ",address_id)
}
var delegate:XinZengAndBianJiKeHuViewControllerDelegate? var delegate:XinZengAndBianJiKeHuViewControllerDelegate?
var cus_id:Int? var cus_id:Int?
var user_id:Int? var user_id:Int?
var address_id = ""
func rightBtnClick() { func rightBtnClick() {
let alertView = GeliAlertView(frame: self.view.window!.bounds) let alertView = GeliAlertView(frame: self.view.window!.bounds)
...@@ -55,6 +64,7 @@ class XinZengAndBianJiKeHuViewController: BaseViewController,UITableViewDataSour ...@@ -55,6 +64,7 @@ class XinZengAndBianJiKeHuViewController: BaseViewController,UITableViewDataSour
"discounts_rate":discount as Any "discounts_rate":discount as Any
] ]
if cus_id == nil { if cus_id == nil {
dict["address_id"] = address_id
cusAdd(dict, success: { (data) in cusAdd(dict, success: { (data) in
HUD.hide() HUD.hide()
HUD.flash(.labeledSubSuccess(subtitle: "提交成功"), delay: 1.2) HUD.flash(.labeledSubSuccess(subtitle: "提交成功"), delay: 1.2)
...@@ -63,10 +73,8 @@ class XinZengAndBianJiKeHuViewController: BaseViewController,UITableViewDataSour ...@@ -63,10 +73,8 @@ class XinZengAndBianJiKeHuViewController: BaseViewController,UITableViewDataSour
}) { (err) in }) { (err) in
} }
print("add == ",dict)
}else{ }else{
dict["cus_id"] = cus_id dict["cus_id"] = cus_id
print("edit == ",dict)
cusEdit(dict, success: { (data) in cusEdit(dict, success: { (data) in
HUD.hide() HUD.hide()
HUD.flash(.labeledSubSuccess(subtitle: "编辑成功"), delay: 1.2) HUD.flash(.labeledSubSuccess(subtitle: "编辑成功"), delay: 1.2)
...@@ -188,7 +196,10 @@ class XinZengAndBianJiKeHuViewController: BaseViewController,UITableViewDataSour ...@@ -188,7 +196,10 @@ class XinZengAndBianJiKeHuViewController: BaseViewController,UITableViewDataSour
if indexPath.row == 6 { if indexPath.row == 6 {
let vc = DZGLViewController() let vc = DZGLViewController()
vc.is_keHu_list = true vc.is_keHu_list = true
vc.kehu_adrArr = adrArr // vc.kehu_adrArr = adrArr
vc.cus_id = cus_id
print("vc.cus = ",vc.cus_id)
vc.delegate = self
self.navigationController?.pushViewController(vc, animated: true ) self.navigationController?.pushViewController(vc, animated: true )
} }
if indexPath.row == 3 { if indexPath.row == 3 {
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="18122" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/> <device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="18093"/>
<capability name="Named colors" minToolsVersion="9.0"/> <capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/> <capability name="System colors in document resources" minToolsVersion="11.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