Commit 2d647ca1 authored by lujunye's avatar lujunye

修正收支统计bug

parent 344cc73f
...@@ -796,6 +796,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -796,6 +796,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
let button = UIButton(frame: CGRect(x: fullScreenWidth-44, y: 0, width: 44, height: 44)) let button = UIButton(frame: CGRect(x: fullScreenWidth-44, y: 0, width: 44, height: 44))
// button.setImage(UIImage(named: ""), for: .normal) // button.setImage(UIImage(named: ""), for: .normal)
view.addSubview(button) view.addSubview(button)
button.addTarget(self, action: #selector(selectAllCars), for: .touchUpInside)
let line = UIView() let line = UIView()
line.backgroundColor = UIColor(named: "灰色分界线") line.backgroundColor = UIColor(named: "灰色分界线")
view.addSubview(line) view.addSubview(line)
...@@ -837,8 +838,90 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -837,8 +838,90 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
topBtnLine.layer.masksToBounds = true topBtnLine.layer.masksToBounds = true
view.addSubview(topBtnLine) view.addSubview(topBtnLine)
} }
var carTypesArr:Array<String> = ["小面包车","中面包车","小货车","中货车","5米2","ababa"]
//MARK: - 选择所有车型
var carTypesArr:Array<String> = ["1","2","3","4","5","6"]
var carListView:UIView?
var cBtn:UIButton?
@objc func closeCarList(){
carListView?.isHidden = true
cBtn?.isHidden = true
}
@objc func selectAllCars(){
cBtn?.isHidden = false
carListView?.isHidden = false
let w = fullScreenWidth / 3
var a = 0
if carTypesArr.count % 3 != 0 {
a = 1
}
let h = w * CGFloat(a + carTypesArr.count / 3)
if carListView == nil {
let view = UIView(frame: CGRect(x: 0, y: topBtnView.frame.maxY, width: fullScreenWidth, height: h + 44))
view.backgroundColor = UIColor.white
self.view.addSubview(view)
carListView = view
let lbl = UILabel(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 44))
lbl.text = "所有车型"
lbl.textAlignment = .center
lbl.font = UIFont.systemFont(ofSize: 13)
lbl.textColor = UIColor(named: "标题字颜色")
carListView!.addSubview(lbl)
let closeBtn = UIButton(frame: CGRect(x: fullScreenWidth-44, y: 0, width: 44, height: 44))
closeBtn.backgroundColor = UIColor.red
closeBtn.addTarget(self, action: #selector(closeCarList), for: .touchUpInside)
carListView!.addSubview(closeBtn)
let line = UIView(frame: CGRect(x: 0, y: 43.5, width: fullScreenWidth, height: 0.5))
line.backgroundColor = UIColor(named: "灰色分界线")
carListView!.addSubview(line)
for i in 0 ..< carTypesArr.count {
setCarListUI(index: i, bg: carListView!)
}
}
let width = CGFloat(3 - carTypesArr.count % 3) * w
let yValue = (CGFloat(carTypesArr.count / 3) * w )+44
let lineV = UIView(frame: CGRect(x: fullScreenWidth - width, y: yValue, width: width, height: w))
lineV.layer.borderColor = UIColor(named: "灰色分界线")?.cgColor
lineV.layer.borderWidth = 0.5
carListView!.addSubview(lineV)
if cBtn == nil {
cBtn = UIButton()
cBtn!.backgroundColor = UIColor(named: "标题字颜色")
cBtn!.alpha = 0.4
cBtn?.addTarget(self, action: #selector(closeCarList), for: .touchUpInside)
self.view.addSubview(cBtn!)
cBtn?.snp_makeConstraints({ (make) in
make.top.equalTo(carListView!.snp_bottom).offset(0)
make.left.right.bottom.equalToSuperview()
})
}
}
func setCarListUI(index:Int,bg:UIView){
let w = fullScreenWidth / 3
let cols = 3
let col = index % cols
let row = index / cols
let shopX = CGFloat(col) * w
let shopY = CGFloat(row) * w
let btn = UIButton(frame: CGRect(x: shopX, y: shopY+44, width: w, height: w))
btn.layer.borderColor = UIColor(named: "灰色分界线")?.cgColor
btn.layer.borderWidth = 0.5
btn.setTitle("\(index)", for: .normal)
btn.setTitleColor(UIColor.black, for: .normal)
bg.addSubview(btn)
}
//MARK:---预估费用操作 //MARK:---预估费用操作
var logPayPriceModel :registerDataModel? var logPayPriceModel :registerDataModel?
func getLogPayPrice() { func getLogPayPrice() {
...@@ -869,22 +952,22 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -869,22 +952,22 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
}else{ }else{
site_delivery = 0 site_delivery = 0
} }
// var infoArr:Array<Any> = [] // var infoArr:Array<Any> = []
// infoArr.append(["order_sn":guanlianDingStr as Any]) // infoArr.append(["order_sn":guanlianDingStr as Any])
// infoArr.append(["sale_plat":guanlianPingStr as Any]) // infoArr.append(["sale_plat":guanlianPingStr as Any])
// infoArr.append(["express_item_name":itemName as Any]) // infoArr.append(["express_item_name":itemName as Any])
// infoArr.append(["weight":weight as Any]) // infoArr.append(["weight":weight as Any])
// infoArr.append(["volume":tiJi as Any]) // infoArr.append(["volume":tiJi as Any])
// infoArr.append(["express_item_qty":count as Any]) // infoArr.append(["express_item_qty":count as Any])
// infoArr.append(["tempture_num":wenduIndex as Any]) // infoArr.append(["tempture_num":wenduIndex as Any])
// infoArr.append(["home_delivery_on":home_delivery_on as Any]) // infoArr.append(["home_delivery_on":home_delivery_on as Any])
// infoArr.append(["site_delivery":site_delivery as Any]) // infoArr.append(["site_delivery":site_delivery as Any])
// infoArr.append(["remark":commend as Any]) // infoArr.append(["remark":commend as Any])
// infoArr.append(["guarantee_value":price as Any]) // infoArr.append(["guarantee_value":price as Any])
// infoArr.append(["fc_flag":0 as Any]) // infoArr.append(["fc_flag":0 as Any])
// infoArr.append(["pickup_time":pickup_time as Any]) // infoArr.append(["pickup_time":pickup_time as Any])
// infoArr.append(["day":day as Any]) // infoArr.append(["day":day as Any])
// infoArr.append(["lc_id":lc_id as Any]) // infoArr.append(["lc_id":lc_id as Any])
let infodic = ["order_sn":guanlianDingStr as Any, let infodic = ["order_sn":guanlianDingStr as Any,
"sale_plat":guanlianPingStr as Any, "sale_plat":guanlianPingStr as Any,
...@@ -901,28 +984,28 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -901,28 +984,28 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
"pickup_time":pickup_time as Any, "pickup_time":pickup_time as Any,
"day":day as Any, "day":day as Any,
"lc_id":lc_id as Any] "lc_id":lc_id as Any]
// var addrArr:Array<Any> = [] // var addrArr:Array<Any> = []
// //
// addrArr.append(["r_consignee":sender as Any]) // addrArr.append(["r_consignee":sender as Any])
// addrArr.append(["r_country":1 as Any]) // addrArr.append(["r_country":1 as Any])
// addrArr.append(["r_province":s_province as Any]) // addrArr.append(["r_province":s_province as Any])
// addrArr.append(["r_city":s_city as Any]) // addrArr.append(["r_city":s_city as Any])
// addrArr.append(["r_district":s_district as Any]) // addrArr.append(["r_district":s_district as Any])
// addrArr.append(["r_province_name":s_province_name as Any]) // addrArr.append(["r_province_name":s_province_name as Any])
// addrArr.append(["r_city_name":s_city_name as Any]) // addrArr.append(["r_city_name":s_city_name as Any])
// addrArr.append(["r_district_name":s_district_name as Any]) // addrArr.append(["r_district_name":s_district_name as Any])
// addrArr.append(["r_address":sendAdr as Any]) // addrArr.append(["r_address":sendAdr as Any])
// addrArr.append(["r_mobile":sendPhone as Any]) // addrArr.append(["r_mobile":sendPhone as Any])
// addrArr.append(["s_consignee":receiver as Any]) // addrArr.append(["s_consignee":receiver as Any])
// addrArr.append(["s_country":1 as Any]) // addrArr.append(["s_country":1 as Any])
// addrArr.append(["s_province":r_province as Any]) // addrArr.append(["s_province":r_province as Any])
// addrArr.append(["s_city":r_city as Any]) // addrArr.append(["s_city":r_city as Any])
// addrArr.append(["s_district":r_district as Any]) // addrArr.append(["s_district":r_district as Any])
// addrArr.append(["s_province_name":r_province_name as Any]) // addrArr.append(["s_province_name":r_province_name as Any])
// addrArr.append(["s_city_name":r_city_name as Any]) // addrArr.append(["s_city_name":r_city_name as Any])
// addrArr.append(["s_district_name":r_district_name as Any]) // addrArr.append(["s_district_name":r_district_name as Any])
// addrArr.append(["s_address":receiveAdr as Any]) // addrArr.append(["s_address":receiveAdr as Any])
// addrArr.append(["s_mobile":receivePhone as Any]) // addrArr.append(["s_mobile":receivePhone as Any])
let addrdic = ["r_consignee":sender as Any, let addrdic = ["r_consignee":sender as Any,
"r_country":1 as Any, "r_country":1 as Any,
......
<?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="16097" 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.2" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_5" orientation="portrait" appearance="light"/> <device id="retina6_5" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
......
...@@ -72,8 +72,8 @@ class ShouZhiTongJiViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -72,8 +72,8 @@ class ShouZhiTongJiViewController: BaseViewController,UITableViewDelegate,UITabl
self.bottomHolder.remove(at: 1) self.bottomHolder.remove(at: 1)
} }
if model.data?.expend?.temp_purchase != nil { if model.data?.expend?.temp_purchase != nil {
self.bottomArr.insert("\(model.data!.expend!.temp_purchase!)", at: 1) self.bottomHolder.insert("\(model.data!.expend!.temp_purchase!)", at: 1)
self.bottomArr.remove(at: 2) self.bottomHolder.remove(at: 2)
} }
if model.data?.expend?.salary != nil { if model.data?.expend?.salary != nil {
self.bottomHolder.insert("\(model.data!.expend!.salary!)", at: 2) self.bottomHolder.insert("\(model.data!.expend!.salary!)", at: 2)
......
...@@ -68,14 +68,16 @@ class HLLTopCell: UITableViewCell,UIScrollViewDelegate { ...@@ -68,14 +68,16 @@ class HLLTopCell: UITableViewCell,UIScrollViewDelegate {
self.selectionStyle = .none self.selectionStyle = .none
}
override func layoutIfNeeded() {
super.layoutIfNeeded()
scrollView = UIScrollView(frame: scViewBg.bounds) scrollView = UIScrollView(frame: scViewBg.bounds)
scViewBg.addSubview(scrollView!) scViewBg.addSubview(scrollView!)
scrollView?.isPagingEnabled = true scrollView?.isPagingEnabled = true
scrollView?.showsHorizontalScrollIndicator = false scrollView?.showsHorizontalScrollIndicator = false
scrollView?.delegate = self scrollView?.delegate = self
}
override func layoutIfNeeded() {
super.layoutIfNeeded()
var num = datas.count - 1 var num = datas.count - 1
if num > 5 { if num > 5 {
num = 5 num = 5
......
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