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

客户列表(缺cell展示和操作)

parent ca5b8bb8
...@@ -346,6 +346,10 @@ ...@@ -346,6 +346,10 @@
F9171EFC245128B200359C2B /* Interface.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9171EFB245128B200359C2B /* Interface.swift */; }; F9171EFC245128B200359C2B /* Interface.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9171EFB245128B200359C2B /* Interface.swift */; };
F9171F0224513C5B00359C2B /* UpDataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9171F0124513C5B00359C2B /* UpDataModel.swift */; }; F9171F0224513C5B00359C2B /* UpDataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9171F0124513C5B00359C2B /* UpDataModel.swift */; };
F9217E012485E6E800C4CF67 /* MessageListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9217E002485E6E800C4CF67 /* MessageListModel.swift */; }; F9217E012485E6E800C4CF67 /* MessageListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9217E002485E6E800C4CF67 /* MessageListModel.swift */; };
F924B39024971BCB00A913CD /* CustomerInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = F924B38F24971BCB00A913CD /* CustomerInterface.swift */; };
F924B39224971BFB00A913CD /* CusListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F924B39124971BFB00A913CD /* CusListModel.swift */; };
F924B39424971E2000A913CD /* CusSalesStatisticsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F924B39324971E2000A913CD /* CusSalesStatisticsModel.swift */; };
F924B3962497241500A913CD /* GetBindUserModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F924B3952497241500A913CD /* GetBindUserModel.swift */; };
F933C42E2484A66C0058940C /* WorkTestModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F933C42D2484A66C0058940C /* WorkTestModel.swift */; }; F933C42E2484A66C0058940C /* WorkTestModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F933C42D2484A66C0058940C /* WorkTestModel.swift */; };
F933F6C02452C68B00189561 /* PKHUDSystemActivityIndicatorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F933F6AF2452C68B00189561 /* PKHUDSystemActivityIndicatorView.swift */; }; F933F6C02452C68B00189561 /* PKHUDSystemActivityIndicatorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F933F6AF2452C68B00189561 /* PKHUDSystemActivityIndicatorView.swift */; };
F933F6C12452C68B00189561 /* PKHUDAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = F933F6B02452C68B00189561 /* PKHUDAnimation.swift */; }; F933F6C12452C68B00189561 /* PKHUDAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = F933F6B02452C68B00189561 /* PKHUDAnimation.swift */; };
...@@ -895,6 +899,10 @@ ...@@ -895,6 +899,10 @@
F9171EFB245128B200359C2B /* Interface.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Interface.swift; sourceTree = "<group>"; }; F9171EFB245128B200359C2B /* Interface.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Interface.swift; sourceTree = "<group>"; };
F9171F0124513C5B00359C2B /* UpDataModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UpDataModel.swift; sourceTree = "<group>"; }; F9171F0124513C5B00359C2B /* UpDataModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UpDataModel.swift; sourceTree = "<group>"; };
F9217E002485E6E800C4CF67 /* MessageListModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageListModel.swift; sourceTree = "<group>"; }; F9217E002485E6E800C4CF67 /* MessageListModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageListModel.swift; sourceTree = "<group>"; };
F924B38F24971BCB00A913CD /* CustomerInterface.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomerInterface.swift; sourceTree = "<group>"; };
F924B39124971BFB00A913CD /* CusListModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CusListModel.swift; sourceTree = "<group>"; };
F924B39324971E2000A913CD /* CusSalesStatisticsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CusSalesStatisticsModel.swift; sourceTree = "<group>"; };
F924B3952497241500A913CD /* GetBindUserModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GetBindUserModel.swift; sourceTree = "<group>"; };
F933C42D2484A66C0058940C /* WorkTestModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WorkTestModel.swift; sourceTree = "<group>"; }; F933C42D2484A66C0058940C /* WorkTestModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WorkTestModel.swift; sourceTree = "<group>"; };
F933F6AF2452C68B00189561 /* PKHUDSystemActivityIndicatorView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PKHUDSystemActivityIndicatorView.swift; sourceTree = "<group>"; }; F933F6AF2452C68B00189561 /* PKHUDSystemActivityIndicatorView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PKHUDSystemActivityIndicatorView.swift; sourceTree = "<group>"; };
F933F6B02452C68B00189561 /* PKHUDAnimation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PKHUDAnimation.swift; sourceTree = "<group>"; }; F933F6B02452C68B00189561 /* PKHUDAnimation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PKHUDAnimation.swift; sourceTree = "<group>"; };
...@@ -1681,6 +1689,7 @@ ...@@ -1681,6 +1689,7 @@
E09B03A92445B09200211A51 /* Model */ = { E09B03A92445B09200211A51 /* Model */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
F924B38E24971BB600A913CD /* CustomerModel */,
E0EFB9CC24931877005FB0CD /* PurchaseModel */, E0EFB9CC24931877005FB0CD /* PurchaseModel */,
F9697240248F6F550010D39B /* VendorModel */, F9697240248F6F550010D39B /* VendorModel */,
E0AA3A85248F3C1B00CBFC27 /* StatisticsModel */, E0AA3A85248F3C1B00CBFC27 /* StatisticsModel */,
...@@ -1703,6 +1712,7 @@ ...@@ -1703,6 +1712,7 @@
E09B03AA2445B0A300211A51 /* LoginModel.swift */, E09B03AA2445B0A300211A51 /* LoginModel.swift */,
F9171F0124513C5B00359C2B /* UpDataModel.swift */, F9171F0124513C5B00359C2B /* UpDataModel.swift */,
F96407632468DEB400A05E12 /* SaveFileModel.swift */, F96407632468DEB400A05E12 /* SaveFileModel.swift */,
F924B38F24971BCB00A913CD /* CustomerInterface.swift */,
); );
path = Model; path = Model;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -2140,6 +2150,16 @@ ...@@ -2140,6 +2150,16 @@
path = Cell; path = Cell;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
F924B38E24971BB600A913CD /* CustomerModel */ = {
isa = PBXGroup;
children = (
F924B39124971BFB00A913CD /* CusListModel.swift */,
F924B39324971E2000A913CD /* CusSalesStatisticsModel.swift */,
F924B3952497241500A913CD /* GetBindUserModel.swift */,
);
path = CustomerModel;
sourceTree = "<group>";
};
F933F6AD2452C65C00189561 /* HUD */ = { F933F6AD2452C65C00189561 /* HUD */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -3020,6 +3040,7 @@ ...@@ -3020,6 +3040,7 @@
E09F4CA22452D18800BE033D /* ZengZhiServicesViewController.swift in Sources */, E09F4CA22452D18800BE033D /* ZengZhiServicesViewController.swift in Sources */,
F94A315B24628C7E00FEC38E /* WorkItemTableViewCell.swift in Sources */, F94A315B24628C7E00FEC38E /* WorkItemTableViewCell.swift in Sources */,
E0DDCB18244AE2AC00DF54C7 /* XiuGaiYuShouJiaViewController.swift in Sources */, E0DDCB18244AE2AC00DF54C7 /* XiuGaiYuShouJiaViewController.swift in Sources */,
F924B39424971E2000A913CD /* CusSalesStatisticsModel.swift in Sources */,
E0E8ABFD246E359700E3BB54 /* GuiGeModel.swift in Sources */, E0E8ABFD246E359700E3BB54 /* GuiGeModel.swift in Sources */,
F950FDEA2451920200C40530 /* DIYCalendarCell.swift in Sources */, F950FDEA2451920200C40530 /* DIYCalendarCell.swift in Sources */,
F9697242248F6F7C0010D39B /* VendorListModel.swift in Sources */, F9697242248F6F7C0010D39B /* VendorListModel.swift in Sources */,
...@@ -3043,6 +3064,7 @@ ...@@ -3043,6 +3064,7 @@
E0F97B102451728D001BD600 /* AddGuiGeCell.swift in Sources */, E0F97B102451728D001BD600 /* AddGuiGeCell.swift in Sources */,
E0F97B1A2451951D001BD600 /* ShangPinGguiGeCell.swift in Sources */, E0F97B1A2451951D001BD600 /* ShangPinGguiGeCell.swift in Sources */,
E02FD9F62455790800E10E27 /* DiZhiGuanLiCell.swift in Sources */, E02FD9F62455790800E10E27 /* DiZhiGuanLiCell.swift in Sources */,
F924B39224971BFB00A913CD /* CusListModel.swift in Sources */,
E0B946272456775000FBEC9A /* DaiKeXiaDanGouWuCell.swift in Sources */, E0B946272456775000FBEC9A /* DaiKeXiaDanGouWuCell.swift in Sources */,
E0206333246CE450007A40C4 /* HeaderOnlyTitleView.swift in Sources */, E0206333246CE450007A40C4 /* HeaderOnlyTitleView.swift in Sources */,
E0CC8476248227F5009B1FE9 /* InputInitInfoModel.swift in Sources */, E0CC8476248227F5009B1FE9 /* InputInitInfoModel.swift in Sources */,
...@@ -3088,6 +3110,7 @@ ...@@ -3088,6 +3110,7 @@
F94A315724628AC600FEC38E /* WorkItemCollectionViewCell.swift in Sources */, F94A315724628AC600FEC38E /* WorkItemCollectionViewCell.swift in Sources */,
F950FDA52451453A00C40530 /* ShopInfoModel.swift in Sources */, F950FDA52451453A00C40530 /* ShopInfoModel.swift in Sources */,
F96A585024790E300070A057 /* TFHpple.m in Sources */, F96A585024790E300070A057 /* TFHpple.m in Sources */,
F924B39024971BCB00A913CD /* CustomerInterface.swift in Sources */,
E0516F822448086700E373CE /* MsgCenterCell.swift in Sources */, E0516F822448086700E373CE /* MsgCenterCell.swift in Sources */,
F95A9ED524551DF900867849 /* UIView+constraints.swift in Sources */, F95A9ED524551DF900867849 /* UIView+constraints.swift in Sources */,
F956D5B9246A33E2003FF510 /* OrderInterface.swift in Sources */, F956D5B9246A33E2003FF510 /* OrderInterface.swift in Sources */,
...@@ -3182,6 +3205,7 @@ ...@@ -3182,6 +3205,7 @@
F933F6CD2452C68B00189561 /* PKHUDProgressView.swift in Sources */, F933F6CD2452C68B00189561 /* PKHUDProgressView.swift in Sources */,
E0D197BE2448431C002B080C /* BabyOptions.m in Sources */, E0D197BE2448431C002B080C /* BabyOptions.m in Sources */,
E0D197C22448431C002B080C /* BabyRhythm.m in Sources */, E0D197C22448431C002B080C /* BabyRhythm.m in Sources */,
F924B3962497241500A913CD /* GetBindUserModel.swift in Sources */,
F956D5A1246A2D9C003FF510 /* LMNToolBar.m in Sources */, F956D5A1246A2D9C003FF510 /* LMNToolBar.m in Sources */,
F950FDDC24518B9500C40530 /* FSCalendar.m in Sources */, F950FDDC24518B9500C40530 /* FSCalendar.m in Sources */,
F9FF7BA124760DA9006E305E /* LogisticsCompanyModel.swift in Sources */, F9FF7BA124760DA9006E305E /* LogisticsCompanyModel.swift in Sources */,
......
...@@ -298,7 +298,7 @@ func dateConvertString(date:Date, dateFormat:String="yyyy-MM-dd") -> String { ...@@ -298,7 +298,7 @@ func dateConvertString(date:Date, dateFormat:String="yyyy-MM-dd") -> String {
let timeZone = TimeZone.init(identifier: "UTC") let timeZone = TimeZone.init(identifier: "UTC")
let formatter = DateFormatter() let formatter = DateFormatter()
formatter.timeZone = timeZone formatter.timeZone = timeZone
formatter.locale = Locale.init(identifier: "zh_CN") // formatter.locale = Locale.init(identifier: "zh_CN")
formatter.dateFormat = dateFormat formatter.dateFormat = dateFormat
let date = formatter.string(from: date) let date = formatter.string(from: date)
return date.components(separatedBy: " ").first! return date.components(separatedBy: " ").first!
......
...@@ -160,5 +160,15 @@ ...@@ -160,5 +160,15 @@
<string>Vender/vendorEdit</string> <string>Vender/vendorEdit</string>
<key>新增供应商</key> <key>新增供应商</key>
<string>Vender/vendorAdd</string> <string>Vender/vendorAdd</string>
<key>客户列表</key>
<string>Customer/cusList</string>
<key>客户详情(销售统计)</key>
<string>Customer/cusSalesStatistics</string>
<key>新增客户</key>
<string>Customer/cusAdd</string>
<key>编辑客户</key>
<string>Customer/cusEdit</string>
<key>获取绑定用户的用户信息</key>
<string>Customer/getBindUser</string>
</dict> </dict>
</plist> </plist>
//
// CustomerInterface.swift
// GeliBusinessPlatform
//
// Created by 刘俊宏 on 2020/6/15.
// Copyright © 2020 junye lu. All rights reserved.
//
//客户管理
import Foundation
import Alamofire
import SwiftyJSON
import ObjectMapper
//客户列表
/*
params-key(
user_token(用户token )
page
keyword 搜索关键词
sort 排序,1时间倒序,2时间正序,
cus_type 客户类型 1个人 2企业,0全部
*/
func cusList(_ params:[String:Any],success:@escaping (_ res:Any)->(),failture:@escaping(_ error:Error)->()) {
NetworkRequest.sharedInstance.postRequest("客户列表", params, { (rep:DataResponse<CusListModel>) in
}, success: { (data) in
success(data)
}) { (error) in
failture(error)
}
}
//客户详情(销售统计)
/*
params-key(
user_token(用户token )
cus_id 客户id
page
*/
func cusSalesStatistics(_ params:[String:Any],success:@escaping (_ res:Any)->(),failture:@escaping(_ error:Error)->()) {
NetworkRequest.sharedInstance.postRequest("客户详情(销售统计)", params, { (rep:DataResponse<CusSalesStatisticsModel>) in
}, success: { (data) in
success(data)
}) { (error) in
failture(error)
}
}
/*
params-key(
user_token(用户token )
company 公司名
cus_name 客户名
cus_type 客户类型 1个人 2企业
phone 联系电话
user_id 绑定用户的用户id
discounts_rate 优惠率,使用时除100
*/
func cusAdd(_ 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)
}
}
/*
params-key(
user_token(用户token )
company 公司名
cus_name 客户名
cus_type 客户类型 1个人 2企业
phone 联系电话
user_id 绑定用户的用户id
discounts_rate 优惠率,使用时除100
cus_id 客户id
*/
func cusEdit(_ 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)
}
}
/*
params-key(
user_token(用户token )
keyword
*/
func getBindUser(_ params:[String:Any],success:@escaping (_ res:Any)->(),failture:@escaping(_ error:Error)->()) {
NetworkRequest.sharedInstance.postRequest("获取绑定用户的用户信息", params, { (rep:DataResponse<GetBindUserModel>) in
}, success: { (data) in
success(data)
}) { (error) in
failture(error)
}
}
//
// CusListModel.swift
// GeliBusinessPlatform
//
// Created by 刘俊宏 on 2020/6/15.
// Copyright © 2020 junye lu. All rights reserved.
//
import Foundation
import ObjectMapper
//客户列表
class CusListModel: Mappable {
var code:Int?
var message : String?
var data :Array<CusListDataModel>?
required init?( map: Map) {
}
func mapping(map: Map) {
code <- map["code"]
message <- map["message"]
data <- map["data"]
}
}
class CusListDataModel: Mappable {
var cus_id:Int? //客户id
var cus_name:String? //客户名
var company : String? //公司
var cus_type : Int? //客户类型 1个人 2企业
var phone : String? //联系电话
var create_time : Double? //1590485694,
var update_time: Double?
var is_del : Int? //是否删除 1删除 0正常
var shop_id : Int?
var user_id : Int? //绑定的用户id
var discounts_rate : Float? //优惠率,使用时除100
var arrears_money : String? //欠款金额
var province : Int? //省
var city : Int? //市
var district : Int? //区
var address : String?
var user_name : String? //用户名
var addr_res : String? //客户公司地址
required init?( map: Map) {
}
func mapping(map: Map) {
cus_id <- map["cus_id"]
cus_name <- map["cus_name"]
company <- map["company"]
cus_type <- map["cus_type"]
phone <- map["phone"]
create_time <- map["create_time"]
update_time <- map["update_time"]
is_del <- map["is_del"]
shop_id <- map["shop_id"]
user_id <- map["user_id"]
discounts_rate <- map["discounts_rate"]
arrears_money <- map["arrears_money"]
province <- map["province"]
address <- map["address"]
city <- map["city"]
district <- map["district"]
user_name <- map["user_name"]
addr_res <- map["addr_res"]
}
}
//
// CusSalesStatisticsModel.swift
// GeliBusinessPlatform
//
// Created by 刘俊宏 on 2020/6/15.
// Copyright © 2020 junye lu. All rights reserved.
//
import Foundation
import ObjectMapper
//客户详情(销售统计)
class CusSalesStatisticsModel: Mappable {
var code:Int?
var message : String?
var data :Array<CusSalesStatisticsDataModel>?
required init?( map: Map) {
}
func mapping(map: Map) {
code <- map["code"]
message <- map["message"]
data <- map["data"]
}
}
class CusSalesStatisticsDataModel: Mappable {
var sum_number:Int?//商品数量
var sum_amount:String? //商品金额
var sku_id : Int? //商品sku_id
var goods_name : String? //商品名
var order_type : Int? //订单类型,1普通,4预售
required init?( map: Map) {
}
func mapping(map: Map) {
sum_number <- map["sum_number"]
sum_amount <- map["sum_amount"]
sku_id <- map["sku_id"]
goods_name <- map["goods_name"]
order_type <- map["order_type"]
}
}
//
// GetBindUserModel.swift
// GeliBusinessPlatform
//
// Created by 刘俊宏 on 2020/6/15.
// Copyright © 2020 junye lu. All rights reserved.
//
import Foundation
import ObjectMapper
//获取绑定用户的用户信息
class GetBindUserModel: Mappable {
var code:Int?
var message : String?
var data :Array<GetBindUserDataModel>?
required init?( map: Map) {
}
func mapping(map: Map) {
code <- map["code"]
message <- map["message"]
data <- map["data"]
}
}
class GetBindUserDataModel: Mappable {
var user_id:Int?//用户id
var user_name:String? //用户名
required init?( map: Map) {
}
func mapping(map: Map) {
user_id <- map["user_id"]
user_name <- map["user_name"]
}
}
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
import Foundation import Foundation
import ObjectMapper import ObjectMapper
//发送验证码,验证短信验证码,修改登录密码,绑定、更换绑定格利支付账号,简单通用操作接口,普通订单发货,预售订单发货,订单绑定/更换绑定客户,确认订单,订单取消,修改订单商品价格,订单退款,普通订单退货,预售订单退货,修改订单支付方式(状态),商家仓库添加,商家仓库修改,商家仓库删除,提交下单,商品入库审核,商品入库,商品入库申请,商品出库,商品申请出库,商品审核出库,出库入库审核不通过,编辑地址,删除地址,新增采购单,审核采购单,撤销入库,采购单修改支付状态,供应商编辑,新增供应商 //发送验证码,验证短信验证码,修改登录密码,绑定、更换绑定格利支付账号,简单通用操作接口,普通订单发货,预售订单发货,订单绑定/更换绑定客户,确认订单,订单取消,修改订单商品价格,订单退款,普通订单退货,预售订单退货,修改订单支付方式(状态),商家仓库添加,商家仓库修改,商家仓库删除,提交下单,商品入库审核,商品入库,商品入库申请,商品出库,商品申请出库,商品审核出库,出库入库审核不通过,编辑地址,删除地址,新增采购单,审核采购单,撤销入库,采购单修改支付状态,供应商编辑,新增供应商,编辑客户,新增客户,
class UpDataModel: Mappable { class UpDataModel: Mappable {
var code:Int? var code:Int?
......
<?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="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"/> <device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<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="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
...@@ -10,7 +11,7 @@ ...@@ -10,7 +11,7 @@
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="KeHuGuanLiCell" customModule="GeliBusinessPlatform" customModuleProvider="target"> <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="KeHuGuanLiCell" customModule="TestClass" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="375" height="100"/> <rect key="frame" x="0.0" y="0.0" width="375" height="100"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <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"> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
...@@ -239,7 +240,7 @@ ...@@ -239,7 +240,7 @@
<color red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor> </namedColor>
<namedColor name="蓝色字体颜色"> <namedColor name="蓝色字体颜色">
<color red="0.27799999713897705" green="0.56099998950958252" blue="0.88999998569488525" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.27843137254901962" green="0.5607843137254902" blue="0.8901960784313725" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor> </namedColor>
</resources> </resources>
</document> </document>
...@@ -14,6 +14,7 @@ class KeHuListViewController: BaseViewController,UITableViewDelegate,UITableView ...@@ -14,6 +14,7 @@ class KeHuListViewController: BaseViewController,UITableViewDelegate,UITableView
@IBOutlet weak var topView: UIView! @IBOutlet weak var topView: UIView!
@IBOutlet weak var topH: NSLayoutConstraint!
@IBOutlet weak var coverBtn: UIButton! @IBOutlet weak var coverBtn: UIButton!
@IBOutlet weak var rightImg: UIImageView! @IBOutlet weak var rightImg: UIImageView!
@IBOutlet weak var leftImg: UIImageView! @IBOutlet weak var leftImg: UIImageView!
...@@ -28,14 +29,16 @@ class KeHuListViewController: BaseViewController,UITableViewDelegate,UITableView ...@@ -28,14 +29,16 @@ class KeHuListViewController: BaseViewController,UITableViewDelegate,UITableView
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
selectListRecord.append(99) selectListRecord.append(0)
selectListRecord.append(99) selectListRecord.append(0)
navbar.title = "客户管理" navbar.title = "客户管理"
self.view.addSubview(navbar) self.view.addSubview(navbar)
topH.constant = CGFloat(44)
let searchBr = SearchBarView.init() let searchBr = SearchBarView.init()
topView.addSubview(searchBr) topView.addSubview(searchBr)
searchBr.snp.makeConstraints { (make) in searchBr.snp.makeConstraints { (make) in
...@@ -61,7 +64,122 @@ class KeHuListViewController: BaseViewController,UITableViewDelegate,UITableView ...@@ -61,7 +64,122 @@ class KeHuListViewController: BaseViewController,UITableViewDelegate,UITableView
rightSelectView.register(UINib(nibName: "TitleAndTFCell", bundle: nil), forCellReuseIdentifier: "TitleAndTFCell") rightSelectView.register(UINib(nibName: "TitleAndTFCell", bundle: nil), forCellReuseIdentifier: "TitleAndTFCell")
leftSelectView.register(UINib(nibName: "TitleAndTFCell", bundle: nil), forCellReuseIdentifier: "TitleAndTFCell") leftSelectView.register(UINib(nibName: "TitleAndTFCell", bundle: nil), forCellReuseIdentifier: "TitleAndTFCell")
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
//下拉刷新相关设置
headerMJ.setRefreshingTarget(self, refreshingAction: #selector(loadData))
listView.mj_header = headerMJ
//上拉加载相关设置
footerMJ.setRefreshingTarget(self, refreshingAction: #selector(loadMoreData))
listView.mj_footer = footerMJ
listView.mj_header?.beginRefreshing()
}
var page : Int = 0
var keyword: String = ""
var sort : Int = 1 //排序,1时间倒序,2时间正序,
var cus_type : Int = 0 //客户类型 1个人 2企业,0全部
var dataArr:Array<CusListDataModel> = []
//MAKR:--调起搜索后添加个蒙版本
var blackBtnView:UIButton! = nil
func searchBarSearchButtonClicked(_ searchBar: UISearchBar) {
print("点击搜索进行--")
searchBar.resignFirstResponder()
keyword = searchBar.text!
listView.mj_header?.beginRefreshing()
}
//MARK:--取消搜索代理
func clearSearchAction() {
print("取消搜索代理了--")
}
func searchBarTextDidEndEditing(_ searchBar: UISearchBar) {
print("编辑即将结束了--")
removeBlackBtnView()
if searchBar.text?.count == 0 && keyword.count != 0{
keyword = searchBar.text!
listView.mj_header?.beginRefreshing()
}
}
func searchBarShouldBeginEditing(_ searchBar: UISearchBar) -> Bool {
print("调起搜索后添加个蒙版本")
blackBtnView = UIButton ()
blackBtnView.backgroundColor = UIColor.init(named: "提示视图背景色")
self.view.addSubview(blackBtnView)
blackBtnView.snp.makeConstraints { (make) in
make.left.right.bottom.equalToSuperview()
make.top.equalTo(topView!.snp_bottom)
}
blackBtnView.addTarget(self, action: #selector(removeBlackBtnView), for: .touchUpInside)
coverBtn.isHidden = true
leftSelectView.isHidden = true
rightSelectView.isHidden = true
leftImg.image = UIImage(named: "xiala")
leftLbl.textColor = UIColor(named: "标题字颜色")
rightImg.image = UIImage(named: "xiala")
rightLbl.textColor = UIColor(named: "标题字颜色")
return true
}
@objc func removeBlackBtnView(){
if blackBtnView != nil {
blackBtnView.removeFromSuperview()
searchV!.resignFirstResponder()
}
} }
//MARK:--加载数据
@objc func loadData(){
print("加载数据")
let UserToken = UserDefaults.standard.value(forKey: "user_token")
page = 1
cus_type = selectListRecord.first!
sort = selectListRecord.last! + 1
let dic = ["user_token":UserToken as Any,"keyword":keyword,"page":page,"sort":sort,"cus_type":cus_type]
cusList(dic, success: { (data) in
self.dataArr.removeAll()
let dataM = data as! CusListModel
dataM.data?.forEach({ (model) in
self.dataArr.append(model)
})
self.listView.reloadData()
self.listView.mj_header?.endRefreshing()
self.page = 2
if dataM.data?.count == 0 {
self.listView.mj_footer?.endRefreshingWithNoMoreData()
}else{
self.listView.mj_footer?.endRefreshing()
}
}) { (error) in
self.listView.mj_header?.endRefreshing()
}
}
//MARK:--加载更多数据
@objc func loadMoreData(){
print("加载更多数据")
let UserToken = UserDefaults.standard.value(forKey: "user_token")
cus_type = selectListRecord.first!
sort = selectListRecord.last! + 1
let dic = ["user_token":UserToken as Any,"keyword":keyword,"page":page,"sort":sort,"cus_type":cus_type]
cusList(dic, success: { (data) in
let dataM = data as! CusListModel
if dataM.data?.count == 0 {
self.listView.mj_footer?.endRefreshingWithNoMoreData()
}else{
self.page += 1
dataM.data?.forEach({ (model) in
self.dataArr.append(model)
})
self.listView.reloadData()
self.listView.mj_footer?.endRefreshing()
}
}) { (error) in
self.listView.mj_footer?.endRefreshing()
}
}
//MARK: - method //MARK: - method
func setYuanJiao(sender:UIView){ func setYuanJiao(sender:UIView){
let maskPath = UIBezierPath(roundedRect: sender.bounds, let maskPath = UIBezierPath(roundedRect: sender.bounds,
...@@ -124,30 +242,34 @@ class KeHuListViewController: BaseViewController,UITableViewDelegate,UITableView ...@@ -124,30 +242,34 @@ class KeHuListViewController: BaseViewController,UITableViewDelegate,UITableView
vc.titleStr = "编辑客户" vc.titleStr = "编辑客户"
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
} }
func clearSearchAction() {
}
//MARK: - CELL DELEGATE //MARK: - CELL DELEGATE
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if tableView == leftSelectView { if tableView == leftSelectView {
selectListRecord.insert(0, at: indexPath.row) selectListRecord.insert(indexPath.row, at: 0)
selectListRecord.remove(at: indexPath.row+1) selectListRecord.remove(at: 1)
coverBtn.isHidden = true coverBtn.isHidden = true
leftSelectView.isHidden = true leftSelectView.isHidden = true
rightSelectView.isHidden = true rightSelectView.isHidden = true
leftImg.image = UIImage(named: "xiala") leftImg.image = UIImage(named: "xiala")
leftLbl.textColor = UIColor(named: "标题字颜色") leftLbl.textColor = UIColor(named: "标题字颜色")
leftSelectView.reloadData() leftSelectView.reloadData()
listView.mj_header?.beginRefreshing()
leftLbl.text = leftArr[indexPath.row]
} }
if tableView == rightSelectView { if tableView == rightSelectView {
selectListRecord.insert(1, at: indexPath.row) selectListRecord.insert(indexPath.row, at: 1)
selectListRecord.remove(at: indexPath.row+1) selectListRecord.remove(at: 2)
coverBtn.isHidden = true coverBtn.isHidden = true
leftSelectView.isHidden = true leftSelectView.isHidden = true
rightSelectView.isHidden = true rightSelectView.isHidden = true
rightImg.image = UIImage(named: "xiala") rightImg.image = UIImage(named: "xiala")
rightLbl.textColor = UIColor(named: "标题字颜色") rightLbl.textColor = UIColor(named: "标题字颜色")
rightSelectView.reloadData() rightSelectView.reloadData()
listView.mj_header?.beginRefreshing()
rightLbl.text = rightArr[indexPath.row]
} }
//MARK: - 跳转客户详情 //MARK: - 跳转客户详情
if tableView == listView { if tableView == listView {
...@@ -170,13 +292,16 @@ class KeHuListViewController: BaseViewController,UITableViewDelegate,UITableView ...@@ -170,13 +292,16 @@ class KeHuListViewController: BaseViewController,UITableViewDelegate,UITableView
if tableView == rightSelectView { if tableView == rightSelectView {
return 2 return 2
} }
return 3 return self.dataArr.count
} }
let leftArr = ["全部","个人","企业"] let leftArr = ["全部","个人","企业"]
let rightArr = ["新增时间正序","新增时间倒序"] let rightArr = ["新增时间倒序","新增时间正序"]
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if tableView == listView{ if tableView == listView{
let cell = tableView.dequeueReusableCell(withIdentifier: "KeHuGuanLiCell") as! KeHuGuanLiCell let cell = tableView.dequeueReusableCell(withIdentifier: "KeHuGuanLiCell") as! KeHuGuanLiCell
let rowModel = self.dataArr[indexPath.row]
cell.compenyLbl.text = rowModel.company
cell.nameLbl.text = rowModel.cus_name
cell.delegate = self cell.delegate = self
return cell return cell
} }
......
<?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="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"/> <device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<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="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="KeHuListViewController" customModule="GeliBusinessPlatform" customModuleProvider="target"> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="KeHuListViewController" customModule="TestClass" customModuleProvider="target">
<connections> <connections>
<outlet property="coverBtn" destination="mYo-wM-YJR" id="d6H-95-2Rx"/> <outlet property="coverBtn" destination="mYo-wM-YJR" id="d6H-95-2Rx"/>
<outlet property="leftImg" destination="djg-1R-eMn" id="PAa-tQ-ZAR"/> <outlet property="leftImg" destination="djg-1R-eMn" id="PAa-tQ-ZAR"/>
...@@ -18,6 +19,7 @@ ...@@ -18,6 +19,7 @@
<outlet property="rightImg" destination="c9U-yZ-wv6" id="OaT-sb-7zO"/> <outlet property="rightImg" destination="c9U-yZ-wv6" id="OaT-sb-7zO"/>
<outlet property="rightLbl" destination="oLg-fW-ms4" id="p5X-tp-P0h"/> <outlet property="rightLbl" destination="oLg-fW-ms4" id="p5X-tp-P0h"/>
<outlet property="rightSelectView" destination="tBl-X7-ZHN" id="OsM-Et-Cfq"/> <outlet property="rightSelectView" destination="tBl-X7-ZHN" id="OsM-Et-Cfq"/>
<outlet property="topH" destination="EeB-aE-KM1" id="8Co-yF-cqC"/>
<outlet property="topView" destination="UK3-Bv-Spb" id="Gpg-UW-wo0"/> <outlet property="topView" destination="UK3-Bv-Spb" id="Gpg-UW-wo0"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections> </connections>
...@@ -76,10 +78,10 @@ ...@@ -76,10 +78,10 @@
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="xiala" translatesAutoresizingMaskIntoConstraints="NO" id="djg-1R-eMn"> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="xiala" translatesAutoresizingMaskIntoConstraints="NO" id="djg-1R-eMn">
<rect key="frame" x="135.5" y="17.5" width="18" height="9"/> <rect key="frame" x="135.5" y="20" width="9" height="4.5"/>
</imageView> </imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="xiala" translatesAutoresizingMaskIntoConstraints="NO" id="c9U-yZ-wv6"> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="xiala" translatesAutoresizingMaskIntoConstraints="NO" id="c9U-yZ-wv6">
<rect key="frame" x="329" y="18" width="18" height="9"/> <rect key="frame" x="329" y="20.5" width="9" height="4.5"/>
</imageView> </imageView>
</subviews> </subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
......
...@@ -493,7 +493,9 @@ class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewD ...@@ -493,7 +493,9 @@ class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewD
HUD.flash(.label("敬请期待"),delay: 1.2) HUD.flash(.label("敬请期待"),delay: 1.2)
return return
case 80: //客户列表 case 80: //客户列表
HUD.flash(.label("敬请期待"),delay: 1.2) // HUD.flash(.label("敬请期待"),delay: 1.2)
let vc = KeHuListViewController()
self.navigationController?.pushViewController(vc, animated: true)
return return
case 82: //账期用户列表 case 82: //账期用户列表
HUD.flash(.label("敬请期待"),delay: 1.2) HUD.flash(.label("敬请期待"),delay: 1.2)
......
...@@ -64,7 +64,7 @@ class CGDListViewController: BaseViewController ,UISearchBarDelegate, SearchBar ...@@ -64,7 +64,7 @@ class CGDListViewController: BaseViewController ,UISearchBarDelegate, SearchBar
let pagingViewController = PagingViewController(viewControllers: viewControllers) let pagingViewController = PagingViewController(viewControllers: viewControllers)
pagingViewController.indicatorColor = UIColor.init(named: "蓝色字体颜色")! pagingViewController.indicatorColor = UIColor.init(named: "蓝色字体颜色")!
pagingViewController.menuItemSize = .fixed(width: 0, height: 44*glscale) pagingViewController.menuItemSize = .fixed(width: 0, height: 44*glscale)
pagingViewController.menuHorizontalAlignment = .center pagingViewController.menuHorizontalAlignment = .left
pagingViewController.font = UIFont.systemFont(ofSize: 13) pagingViewController.font = UIFont.systemFont(ofSize: 13)
pagingViewController.selectedFont = UIFont.systemFont(ofSize: 13) pagingViewController.selectedFont = UIFont.systemFont(ofSize: 13)
pagingViewController.textColor = UIColor.init(named: "灰色字体颜色")! pagingViewController.textColor = UIColor.init(named: "灰色字体颜色")!
......
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