Commit 04aa9143 authored by lujunye's avatar lujunye

货拉拉下单调试

parent a59e414b
...@@ -90,6 +90,8 @@ ...@@ -90,6 +90,8 @@
E02FD9F72455790800E10E27 /* DiZhiGuanLiCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E02FD9F52455790800E10E27 /* DiZhiGuanLiCell.xib */; }; E02FD9F72455790800E10E27 /* DiZhiGuanLiCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E02FD9F52455790800E10E27 /* DiZhiGuanLiCell.xib */; };
E02FD9FA24557E8600E10E27 /* XinZengDiZhiViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E02FD9F824557E8600E10E27 /* XinZengDiZhiViewController.swift */; }; E02FD9FA24557E8600E10E27 /* XinZengDiZhiViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E02FD9F824557E8600E10E27 /* XinZengDiZhiViewController.swift */; };
E02FD9FB24557E8600E10E27 /* XinZengDiZhiViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E02FD9F924557E8600E10E27 /* XinZengDiZhiViewController.xib */; }; E02FD9FB24557E8600E10E27 /* XinZengDiZhiViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E02FD9F924557E8600E10E27 /* XinZengDiZhiViewController.xib */; };
E030515324E2304600AFB9E9 /* OnlyViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E030515124E2304600AFB9E9 /* OnlyViewCell.swift */; };
E030515424E2304600AFB9E9 /* OnlyViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E030515224E2304600AFB9E9 /* OnlyViewCell.xib */; };
E030DF362485DD3E002764D3 /* NewRKCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E030DF342485DD3E002764D3 /* NewRKCell.swift */; }; E030DF362485DD3E002764D3 /* NewRKCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E030DF342485DD3E002764D3 /* NewRKCell.swift */; };
E030DF372485DD3E002764D3 /* NewRKCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E030DF352485DD3E002764D3 /* NewRKCell.xib */; }; E030DF372485DD3E002764D3 /* NewRKCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E030DF352485DD3E002764D3 /* NewRKCell.xib */; };
E030DF3B248651A5002764D3 /* NewRKVc.swift in Sources */ = {isa = PBXBuildFile; fileRef = E030DF39248651A5002764D3 /* NewRKVc.swift */; }; E030DF3B248651A5002764D3 /* NewRKVc.swift in Sources */ = {isa = PBXBuildFile; fileRef = E030DF39248651A5002764D3 /* NewRKVc.swift */; };
...@@ -716,6 +718,8 @@ ...@@ -716,6 +718,8 @@
E02FD9F52455790800E10E27 /* DiZhiGuanLiCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = DiZhiGuanLiCell.xib; sourceTree = "<group>"; }; E02FD9F52455790800E10E27 /* DiZhiGuanLiCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = DiZhiGuanLiCell.xib; sourceTree = "<group>"; };
E02FD9F824557E8600E10E27 /* XinZengDiZhiViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XinZengDiZhiViewController.swift; sourceTree = "<group>"; }; E02FD9F824557E8600E10E27 /* XinZengDiZhiViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XinZengDiZhiViewController.swift; sourceTree = "<group>"; };
E02FD9F924557E8600E10E27 /* XinZengDiZhiViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = XinZengDiZhiViewController.xib; sourceTree = "<group>"; }; E02FD9F924557E8600E10E27 /* XinZengDiZhiViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = XinZengDiZhiViewController.xib; sourceTree = "<group>"; };
E030515124E2304600AFB9E9 /* OnlyViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnlyViewCell.swift; sourceTree = "<group>"; };
E030515224E2304600AFB9E9 /* OnlyViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = OnlyViewCell.xib; sourceTree = "<group>"; };
E030DF342485DD3E002764D3 /* NewRKCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewRKCell.swift; sourceTree = "<group>"; }; E030DF342485DD3E002764D3 /* NewRKCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewRKCell.swift; sourceTree = "<group>"; };
E030DF352485DD3E002764D3 /* NewRKCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NewRKCell.xib; sourceTree = "<group>"; }; E030DF352485DD3E002764D3 /* NewRKCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NewRKCell.xib; sourceTree = "<group>"; };
E030DF39248651A5002764D3 /* NewRKVc.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewRKVc.swift; sourceTree = "<group>"; }; E030DF39248651A5002764D3 /* NewRKVc.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewRKVc.swift; sourceTree = "<group>"; };
...@@ -3053,6 +3057,8 @@ ...@@ -3053,6 +3057,8 @@
F96E48A924CA9559000AB8D4 /* TitleTimeHeaderFooterView.xib */, F96E48A924CA9559000AB8D4 /* TitleTimeHeaderFooterView.xib */,
F993C66C24CADE2400493CC7 /* WayBillStautsTableViewCell.swift */, F993C66C24CADE2400493CC7 /* WayBillStautsTableViewCell.swift */,
F993C66D24CADE2400493CC7 /* WayBillStautsTableViewCell.xib */, F993C66D24CADE2400493CC7 /* WayBillStautsTableViewCell.xib */,
E030515124E2304600AFB9E9 /* OnlyViewCell.swift */,
E030515224E2304600AFB9E9 /* OnlyViewCell.xib */,
); );
path = cell; path = cell;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -3289,6 +3295,7 @@ ...@@ -3289,6 +3295,7 @@
E09B3AD724B2FCAF00E3B238 /* ShareSDKConfigFile.bundle in Resources */, E09B3AD724B2FCAF00E3B238 /* ShareSDKConfigFile.bundle in Resources */,
E06524FA24581A7900CA22E2 /* ChuKuCell.xib in Resources */, E06524FA24581A7900CA22E2 /* ChuKuCell.xib in Resources */,
E0CC848824823EC1009B1FE9 /* CRKCell.xib in Resources */, E0CC848824823EC1009B1FE9 /* CRKCell.xib in Resources */,
E030515424E2304600AFB9E9 /* OnlyViewCell.xib in Resources */,
E0337EF62464FCFC00952EF4 /* GYSListViewController.xib in Resources */, E0337EF62464FCFC00952EF4 /* GYSListViewController.xib in Resources */,
F96E48AA24CA9559000AB8D4 /* TitleTimeHeaderFooterView.xib in Resources */, F96E48AA24CA9559000AB8D4 /* TitleTimeHeaderFooterView.xib in Resources */,
E0706EF524B40BE800D8251C /* TitleAndTfYuanCell.xib in Resources */, E0706EF524B40BE800D8251C /* TitleAndTfYuanCell.xib in Resources */,
...@@ -3708,6 +3715,7 @@ ...@@ -3708,6 +3715,7 @@
F9011C1024CE6FB200AAF4F5 /* LogisticalSelectView.swift in Sources */, F9011C1024CE6FB200AAF4F5 /* LogisticalSelectView.swift in Sources */,
F950FDDC24518B9500C40530 /* FSCalendar.m in Sources */, F950FDDC24518B9500C40530 /* FSCalendar.m in Sources */,
F9FF7BA124760DA9006E305E /* LogisticsCompanyModel.swift in Sources */, F9FF7BA124760DA9006E305E /* LogisticsCompanyModel.swift in Sources */,
E030515324E2304600AFB9E9 /* OnlyViewCell.swift in Sources */,
E0206327246CD84A007A40C4 /* TitleAndLblView.swift in Sources */, E0206327246CD84A007A40C4 /* TitleAndLblView.swift in Sources */,
E007B1D4248F6880004D14CC /* CGDDayCell.swift in Sources */, E007B1D4248F6880004D14CC /* CGDDayCell.swift in Sources */,
F942A7FD247500C300FDFC47 /* TestClass.swift in Sources */, F942A7FD247500C300FDFC47 /* TestClass.swift in Sources */,
......
{
"images" : [
{
"filename" : "edit.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "edit@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "edit@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
...@@ -223,7 +223,10 @@ class orderPriceCalculateDataModel: Mappable { ...@@ -223,7 +223,10 @@ class orderPriceCalculateDataModel: Mappable {
var total_price_fen :Float? //订单预估总价 var total_price_fen :Float? //订单预估总价
var order_vehicle_name:String? var order_vehicle_name:String?
var exceed_distance : Int? var exceed_distance : Int?
var spec_req_price_arr:Array<orderPriceCalculateSpecReqDataModel>? //增值(额外)服务项已经价格
var order_price_arr:Array<orderPriceCalculateOrderPriceDataModel>?
// var vehicle_std_price_arr:Array<>
required init?( map: Map) { required init?( map: Map) {
} }
...@@ -234,7 +237,8 @@ class orderPriceCalculateDataModel: Mappable { ...@@ -234,7 +237,8 @@ class orderPriceCalculateDataModel: Mappable {
total_price_fen <- map["total_price_fen"] total_price_fen <- map["total_price_fen"]
order_vehicle_name <- map["order_vehicle_name"] order_vehicle_name <- map["order_vehicle_name"]
exceed_distance <- map["exceed_distance"] exceed_distance <- map["exceed_distance"]
spec_req_price_arr <- map["spec_req_price_arr"]
order_price_arr <- map["order_price_arr"]
} }
} }
class orderPriceCalculateSpecReqDataModel: Mappable { class orderPriceCalculateSpecReqDataModel: Mappable {
......
...@@ -11,6 +11,7 @@ import Photos ...@@ -11,6 +11,7 @@ import Photos
import Alamofire import Alamofire
import SwiftDate import SwiftDate
class PersonCenterViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource { class PersonCenterViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource {
@IBOutlet weak var editBtn: UIButton!
@IBOutlet weak var shopNameLbl: UILabel! @IBOutlet weak var shopNameLbl: UILabel!
@IBOutlet weak var iconImg: UIImageView! @IBOutlet weak var iconImg: UIImageView!
...@@ -21,31 +22,31 @@ class PersonCenterViewController: BaseViewController,UITableViewDelegate,UITable ...@@ -21,31 +22,31 @@ class PersonCenterViewController: BaseViewController,UITableViewDelegate,UITable
var dataModel : AdminInfoModel? = nil var dataModel : AdminInfoModel? = nil
let listArray = ["格利支付","蓝牙打印设置","权限设置"] let listArray = ["格利支付","蓝牙打印设置","权限设置"]
//MARK:--加载数据 //MARK:--加载数据
func loadData(){ func loadData(){
let UserToken = UserDefaults.standard.value(forKey: "user_token") let UserToken = UserDefaults.standard.value(forKey: "user_token")
HUD.flash(.progress)
adminInfo(["user_token":UserToken as Any], success: { (data) in adminInfo(["user_token":UserToken as Any], success: { (data) in
HUD.hide()
self.dataModel = (data as! AdminInfoModel) self.dataModel = (data as! AdminInfoModel)
self.iconImg.sd_setImage(with: URL(string: SERVERCE_ImageHost + (self.dataModel?.data?.shop_img)!), placeholderImage: UIImage.init(named: "个人设置头像")) // self.iconImg.sd_setImage(with: URL(string: SERVERCE_ImageHost + (self.dataModel?.data?.shop_img)!), placeholderImage: UIImage.init(named: "个人设置头像"))
//
self.shopNameLbl.text = self.dataModel?.data?.stall_name self.shopNameLbl.text = self.dataModel?.data?.stall_name
self.nameLbl.text = self.nowDateStr()
}) { (error) in }) { (error) in
} }
self.nameLbl.text = self.nowDateStr()
} }
func nowDateStr() -> String { func nowDateStr() -> String {
let date = Date() + 8.hours let date = Date() + 8.hours
if date.compare(.isMorning) { if date.compare(.isMorning) {
return "Hi~早上好!" return "Hi~早上好!" + (dataModel?.data?.shop_name!)!
}else if date.compare(.isAfternoon) { }else if date.compare(.isAfternoon) {
return "Hi~下午好!" return "Hi~下午好!" + (dataModel?.data?.shop_name!)!
}else if date.compare(.isEvening) { }else if date.compare(.isEvening) {
return "Hi~傍晚好!" return "Hi~傍晚好!" + (dataModel?.data?.shop_name!)!
}else if date.compare(.isNight) { }else if date.compare(.isNight) {
return "Hi~深夜了!" return "Hi~深夜了!" + (dataModel?.data?.shop_name!)!
} }
return "" return ""
} }
...@@ -78,6 +79,15 @@ class PersonCenterViewController: BaseViewController,UITableViewDelegate,UITable ...@@ -78,6 +79,15 @@ class PersonCenterViewController: BaseViewController,UITableViewDelegate,UITable
listView?.register(UINib(nibName: "PersonCenterCell", bundle: nil), forCellReuseIdentifier: "listCell") listView?.register(UINib(nibName: "PersonCenterCell", bundle: nil), forCellReuseIdentifier: "listCell")
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
let btn = UIButton()
self.view.addSubview(btn)
btn.snp.makeConstraints { (make) in
make.centerY.equalTo(editBtn.snp.centerY)
make.left.equalTo(15)
make.height.width.equalTo(17)
}
btn.setImage(UIImage(named: "xiaoxi"), for: .normal)
btn.addTarget(self, action: #selector(toMsgCenterAction(_:)), for: .touchUpInside)
/* /*
自适应字体大小后重新编辑背景框 自适应字体大小后重新编辑背景框
shopNameLbl.text = "123" shopNameLbl.text = "123"
...@@ -111,7 +121,7 @@ class PersonCenterViewController: BaseViewController,UITableViewDelegate,UITable ...@@ -111,7 +121,7 @@ class PersonCenterViewController: BaseViewController,UITableViewDelegate,UITable
} }
//MARK:--跳转消息中心 //MARK:--跳转消息中心
@IBAction func toMsgCenterAction(_ sender: Any) { @objc func toMsgCenterAction(_ sender: Any) {
print("跳转消息中心") print("跳转消息中心")
let vc = MsgCenterViewController() let vc = MsgCenterViewController()
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="XiaYunDanViewController" customModule="TestClass" customModuleProvider="target"> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="XiaYunDanViewController" customModule="TestClass" customModuleProvider="target">
<connections> <connections>
<outlet property="YuGuPriceLbl" destination="b3u-F0-etc" id="F8r-lf-53O"/>
<outlet property="bottomView" destination="BXb-QP-ceT" id="mix-bc-FvQ"/> <outlet property="bottomView" destination="BXb-QP-ceT" id="mix-bc-FvQ"/>
<outlet property="hBtnViewH" destination="udi-Jp-eUF" id="lD6-tv-X0U"/> <outlet property="hBtnViewH" destination="udi-Jp-eUF" id="lD6-tv-X0U"/>
<outlet property="hListView" destination="IhS-vZ-6YK" id="8cK-6U-GmQ"/> <outlet property="hListView" destination="IhS-vZ-6YK" id="8cK-6U-GmQ"/>
...@@ -262,8 +263,8 @@ ...@@ -262,8 +263,8 @@
<color key="textColor" name="标题字颜色"/> <color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="6050.30" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="b3u-F0-etc"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="--" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="b3u-F0-etc">
<rect key="frame" x="86.666666666666671" y="769.66666666666663" width="66.000000000000014" height="24"/> <rect key="frame" x="86.666666666666671" y="769.66666666666663" width="20.666666666666671" height="24"/>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="17"/> <fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="17"/>
<color key="textColor" name="标题字颜色"/> <color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
...@@ -302,6 +303,9 @@ ...@@ -302,6 +303,9 @@
</userDefinedRuntimeAttribute> </userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="boolean" keyPath="gradientHorizontal" value="YES"/> <userDefinedRuntimeAttribute type="boolean" keyPath="gradientHorizontal" value="YES"/>
</userDefinedRuntimeAttributes> </userDefinedRuntimeAttributes>
<connections>
<action selector="setHllOrder:" destination="-1" eventType="touchUpInside" id="xEH-rI-yma"/>
</connections>
</view> </view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="下运单" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WGD-xV-qZB"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="下运单" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WGD-xV-qZB">
<rect key="frame" x="333.66666666666669" y="771.66666666666663" width="51" height="24"/> <rect key="frame" x="333.66666666666669" y="771.66666666666663" width="51" height="24"/>
......
...@@ -9,9 +9,11 @@ ...@@ -9,9 +9,11 @@
import UIKit import UIKit
import LGButton import LGButton
import ContactsUI import ContactsUI
protocol XiaDanUserInfoViewControllerDelegate {
func XiaDanUserInfoViewControllerData(str:NSString)
}
class XiaDanUserInfoViewController: BaseViewController , CNContactPickerDelegate,UITextViewDelegate{ class XiaDanUserInfoViewController: BaseViewController , CNContactPickerDelegate,UITextViewDelegate{
var delegate:XiaDanUserInfoViewControllerDelegate?
@IBOutlet weak var messageCountLbl: UILabel! @IBOutlet weak var messageCountLbl: UILabel!
@IBOutlet weak var messageTV: UITextView! @IBOutlet weak var messageTV: UITextView!
@IBOutlet weak var userPhoneTF: UITextField! @IBOutlet weak var userPhoneTF: UITextField!
...@@ -24,9 +26,14 @@ class XiaDanUserInfoViewController: BaseViewController , CNContactPickerDelegate ...@@ -24,9 +26,14 @@ class XiaDanUserInfoViewController: BaseViewController , CNContactPickerDelegate
self.view.addSubview(navbar) self.view.addSubview(navbar)
SetTopFrame(view: contentV, height: 370) SetTopFrame(view: contentV, height: 370)
messageTV.delegate = self messageTV.delegate = self
} orderTimeLbl.text = getTimeNow()
}
@IBAction func gotoPhoneAccoutAction(_ sender: UIButton) { @IBAction func gotoPhoneAccoutAction(_ sender: UIButton) {
print("gotoPhoneAccoutAction-获取通讯录") print("gotoPhoneAccoutAction-获取通讯录")
//联系人选择控制器 //联系人选择控制器
...@@ -36,6 +43,9 @@ class XiaDanUserInfoViewController: BaseViewController , CNContactPickerDelegate ...@@ -36,6 +43,9 @@ class XiaDanUserInfoViewController: BaseViewController , CNContactPickerDelegate
//弹出控制器 //弹出控制器
self.present(contactPicker, animated: true, completion: nil) self.present(contactPicker, animated: true, completion: nil)
} }
//单选联系人 //单选联系人
func contactPicker(_ picker: CNContactPickerViewController, func contactPicker(_ picker: CNContactPickerViewController,
didSelect contact: CNContact) { didSelect contact: CNContact) {
...@@ -60,8 +70,13 @@ class XiaDanUserInfoViewController: BaseViewController , CNContactPickerDelegate ...@@ -60,8 +70,13 @@ class XiaDanUserInfoViewController: BaseViewController , CNContactPickerDelegate
} }
@IBAction func sureUserInfoAction(_ sender: LGButton) { @IBAction func sureUserInfoAction(_ sender: LGButton) {
if userPhoneTF.text!.count == 0 || userPhoneTF.text!.count == 0 {
HUD.flash(.label("请填写联系人及联系电话"), delay: 1.2)
return
}
print("sureUserInfoAction-确定") print("sureUserInfoAction-确定")
delegate?.XiaDanUserInfoViewControllerData(str: "\(userNameTF!.text!)_\(userPhoneTF!.text!)_\(messageTV!.text!)" as NSString)
self.navigationController?.popViewController(animated: true)
} }
func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool { func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool {
messageCountLbl.text = "(\(textView.text.count)/200)" messageCountLbl.text = "(\(textView.text.count)/200)"
...@@ -79,5 +94,6 @@ class XiaDanUserInfoViewController: BaseViewController , CNContactPickerDelegate ...@@ -79,5 +94,6 @@ class XiaDanUserInfoViewController: BaseViewController , CNContactPickerDelegate
} }
} }
} }
} }
<?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_1" orientation="portrait" appearance="light"/> <device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
...@@ -99,6 +99,9 @@ ...@@ -99,6 +99,9 @@
<color key="textColor" name="灰色字体颜色"/> <color key="textColor" name="灰色字体颜色"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/> <fontDescription key="fontDescription" type="system" pointSize="13"/>
<textInputTraits key="textInputTraits"/> <textInputTraits key="textInputTraits"/>
<connections>
<outlet property="delegate" destination="-1" id="5Ta-pi-xhC"/>
</connections>
</textField> </textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入联系电话" textAlignment="right" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="tmU-Qx-tY7"> <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入联系电话" textAlignment="right" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="tmU-Qx-tY7">
<rect key="frame" x="83" y="140.5" width="217" height="40"/> <rect key="frame" x="83" y="140.5" width="217" height="40"/>
...@@ -108,6 +111,9 @@ ...@@ -108,6 +111,9 @@
<color key="textColor" name="灰色字体颜色"/> <color key="textColor" name="灰色字体颜色"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/> <fontDescription key="fontDescription" type="system" pointSize="13"/>
<textInputTraits key="textInputTraits"/> <textInputTraits key="textInputTraits"/>
<connections>
<outlet property="delegate" destination="-1" id="791-qA-fh2"/>
</connections>
</textField> </textField>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="rDc-7c-CwA"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="rDc-7c-CwA">
<rect key="frame" x="0.0" y="180.5" width="414" height="5"/> <rect key="frame" x="0.0" y="180.5" width="414" height="5"/>
...@@ -133,6 +139,9 @@ ...@@ -133,6 +139,9 @@
<real key="value" value="5"/> <real key="value" value="5"/>
</userDefinedRuntimeAttribute> </userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes> </userDefinedRuntimeAttributes>
<connections>
<outlet property="delegate" destination="-1" id="JPC-08-MGX"/>
</connections>
</textView> </textView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="(0/200)" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Tht-t1-aXt"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="(0/200)" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Tht-t1-aXt">
<rect key="frame" x="80" y="206" width="39.5" height="15.5"/> <rect key="frame" x="80" y="206" width="39.5" height="15.5"/>
......
...@@ -23,7 +23,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo ...@@ -23,7 +23,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
var tempLat:CLLocationDegrees = 0 var tempLat:CLLocationDegrees = 0
var tempLng:CLLocationDegrees = 0 var tempLng:CLLocationDegrees = 0
var tempCityName = "" var tempCityName = ""
var detailAdrStr = ""
@objc func backToCurrentLoc(_ sender: Any) { @objc func backToCurrentLoc(_ sender: Any) {
print("返回当前位置") print("返回当前位置")
...@@ -76,7 +76,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo ...@@ -76,7 +76,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
return historyArr.count return historyArr.count
} }
var delegate:ToAndFormSelectViewControllerDelegate? var delegate:ToAndFormSelectViewControllerDelegate?
var dict:Dictionary<String,Any> = Dictionary()
let UserToken = UserDefaults.standard.value(forKey: "user_token") let UserToken = UserDefaults.standard.value(forKey: "user_token")
var loc:cityListDataModel! var loc:cityListDataModel!
var nameStr = "" var nameStr = ""
...@@ -316,15 +316,18 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo ...@@ -316,15 +316,18 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
print("sureSelectAddressAction") print("sureSelectAddressAction")
if adrDatas!.count > 0 { if adrDatas!.count > 0 {
for item in adrDatas! { for item in adrDatas! {
if cityName.contains(item.name!) { print("cityNmae = ",cityName,item.name)
if specRecord.contains(item.name!) {
adrData = item adrData = item
print("test result == ",adrData?.city_id)
} }
} }
var dict:Dictionary<String,Any> = Dictionary()
dict["menPai"] = addressDetailTF.text dict["menPai"] = addressDetailTF.text
dict["shouHuoRen"] = nameTF.text dict["shouHuoRen"] = nameTF.text
dict["phoneNum"] = phoneTF.text dict["phoneNum"] = phoneTF.text
dict["adr"] = adrData dict["adr"] = adrData
dict["detailAdr"] = detailAdrStr
if locName.count > 0 { if locName.count > 0 {
dict["locName"] = titleLbl!.text dict["locName"] = titleLbl!.text
var sr_type = 1 var sr_type = 1
...@@ -357,9 +360,10 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo ...@@ -357,9 +360,10 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
"contact_phone_no": phoneTF.text as Any, "contact_phone_no": phoneTF.text as Any,
"sr_type":sr_type as Any "sr_type":sr_type as Any
] ]
print("dic == ",dict) HUD.flash(.progress)
setSearchLog(dic, success: { (data) in setSearchLog(dic, success: { (data) in
self.delegate?.ToAndFormSelectViewControllerSelectAdr(dict: self.dict,idx:self.idx!) HUD.hide()
self.delegate?.ToAndFormSelectViewControllerSelectAdr(dict: dict,idx:self.idx!)
self.navigationController?.popViewController(animated: true) self.navigationController?.popViewController(animated: true)
}) { (err) in }) { (err) in
...@@ -381,6 +385,10 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo ...@@ -381,6 +385,10 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
var detailAdr:String = "" var detailAdr:String = ""
var moveAdrName = "" var moveAdrName = ""
var isMove = false var isMove = false
var specRecord = ""
func onPOISearchDone(_ request: AMapPOISearchBaseRequest!, response: AMapPOISearchResponse!) { func onPOISearchDone(_ request: AMapPOISearchBaseRequest!, response: AMapPOISearchResponse!) {
if response.count == 0 { if response.count == 0 {
...@@ -423,6 +431,8 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo ...@@ -423,6 +431,8 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
if loc == nil { if loc == nil {
citySelectBtn.setTitle(cityName as String, for: .normal) citySelectBtn.setTitle(cityName as String, for: .normal)
} }
specRecord = cityName as String + (response.pois.first?.district)!
//通过富文本来设置行间距 //通过富文本来设置行间距
let paraph = NSMutableParagraphStyle() let paraph = NSMutableParagraphStyle()
//将行间距设置为28 //将行间距设置为28
...@@ -433,7 +443,6 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo ...@@ -433,7 +443,6 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
city = response.pois.first!.city city = response.pois.first!.city
ad = response.pois.first?.address as! String ad = response.pois.first?.address as! String
districet = response.pois.first?.district as! String districet = response.pois.first?.district as! String
moveAdrName = response.pois.first?.name as! String moveAdrName = response.pois.first?.name as! String
if adrName.count > 0 { if adrName.count > 0 {
...@@ -442,6 +451,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo ...@@ -442,6 +451,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
titleLbl!.text = adrName titleLbl!.text = adrName
str = detailAdr str = detailAdr
} }
detailAdrStr = "\(city)_\(districet)_\(ad)_\(titleLbl!.text)"
let attributes = [NSAttributedString.Key.font:UIFont.systemFont(ofSize: 11), let attributes = [NSAttributedString.Key.font:UIFont.systemFont(ofSize: 11),
NSAttributedString.Key.paragraphStyle: paraph] NSAttributedString.Key.paragraphStyle: paraph]
......
...@@ -9,15 +9,24 @@ ...@@ -9,15 +9,24 @@
import UIKit import UIKit
class LogisticsCostDetailViewController: BaseViewController { class LogisticsCostDetailViewController: BaseViewController {
var model:orderPriceCalculateModel?
// var carModel:vehicle_arr_data?
@IBOutlet weak var lineView: UIView! @IBOutlet weak var lineView: UIView!
@IBOutlet weak var contentV: UIView! @IBOutlet weak var contentV: UIView!
@IBOutlet weak var priceLbl: UILabel!
@IBOutlet weak var roadKM: UILabel!
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
navbar.title = "费用明细" navbar.title = "费用明细"
self.view.addSubview(navbar) self.view.addSubview(navbar)
priceLbl.text = "\(model!.data!.total_price_fen!/100)"
roadKM.text = "(总里程\(model!.data!.distance_total!)公里)"
SetTopFrameView(view: contentV, btmView: self.view) SetTopFrameView(view: contentV, btmView: self.view)
setCostDetailView() setCostDetailView()
...@@ -47,8 +56,42 @@ class LogisticsCostDetailViewController: BaseViewController { ...@@ -47,8 +56,42 @@ class LogisticsCostDetailViewController: BaseViewController {
make.top.equalTo(lineView.snp_bottom).offset(30) make.top.equalTo(lineView.snp_bottom).offset(30)
} }
leftLbl.text = "起步价(小面包车)" leftLbl.text = "起步价(\(model!.data!.order_vehicle_name!))"
rightLbl.text = "¥4548.8" for item in model!.data!.order_price_arr! {
if item.type == 1 {
rightLbl.text = \(String(describing: item.price_fen!/100))"
}
}
for i in 0 ..< model!.data!.spec_req_price_arr!.count {
let leftL = UILabel()
leftL.textAlignment = .left
leftL.textColor = UIColor.init(named: "灰色字体颜色")
leftL.font = UIFont.init(name: "PingFang SC", size: 13)
contentV.addSubview(leftL)
let rightL = UILabel()
rightL.textAlignment = .right
rightL.textColor = UIColor.init(named: "灰色字体颜色")
rightL.font = UIFont.init(name: "PingFang SC", size: 13)
contentV.addSubview(rightL)
let y = 5 + CGFloat(25) * CGFloat(i)
leftL.snp.makeConstraints { (make) in
make.left.equalTo(45)
make.top.equalTo(leftLbl.snp_bottom).offset(y)
}
rightL.snp.makeConstraints { (make) in
make.right.equalTo(-45)
make.centerY.equalTo(leftL.snp_centerY)
}
let mo = model?.data?.spec_req_price_arr![i]
leftL.text = mo?.name!
let price = mo!.price_fen!/100
rightL.text = "\(price)"
}
} }
......
<?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_1" orientation="portrait" appearance="light"/> <device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
<connections> <connections>
<outlet property="contentV" destination="e3L-UF-DVw" id="1NT-my-Rg0"/> <outlet property="contentV" destination="e3L-UF-DVw" id="1NT-my-Rg0"/>
<outlet property="lineView" destination="cYG-RP-3Ac" id="rkw-i7-b7g"/> <outlet property="lineView" destination="cYG-RP-3Ac" id="rkw-i7-b7g"/>
<outlet property="priceLbl" destination="4zD-0t-aeW" id="IdF-6T-P3f"/>
<outlet property="roadKM" destination="mah-gJ-VGh" id="Yqm-EJ-6hu"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections> </connections>
</placeholder> </placeholder>
...@@ -24,19 +26,19 @@ ...@@ -24,19 +26,19 @@
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="e3L-UF-DVw"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="e3L-UF-DVw">
<rect key="frame" x="0.0" y="44" width="414" height="852"/> <rect key="frame" x="0.0" y="44" width="414" height="852"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="5262.2" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4zD-0t-aeW"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="--" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4zD-0t-aeW">
<rect key="frame" x="108.5" y="52" width="98.5" height="42"/> <rect key="frame" x="170.5" y="52" width="36.5" height="42"/>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="30"/> <fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="30"/>
<color key="textColor" name="标题字颜色"/> <color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="¥" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wQA-CT-1Xv"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="¥" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wQA-CT-1Xv">
<rect key="frame" x="90.5" y="66" width="15" height="21"/> <rect key="frame" x="152.5" y="66" width="15" height="21"/>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="15"/> <fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="15"/>
<color key="textColor" name="标题字颜色"/> <color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="(总里程328.5公里)" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mah-gJ-VGh"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="(总里程--公里)" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mah-gJ-VGh">
<rect key="frame" x="210" y="66" width="184" height="21"/> <rect key="frame" x="210" y="66" width="184" height="21"/>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="15"/> <fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="15"/>
<color key="textColor" name="标题字颜色"/> <color key="textColor" name="标题字颜色"/>
......
...@@ -12,10 +12,12 @@ import SDWebImage ...@@ -12,10 +12,12 @@ import SDWebImage
protocol HLLTopCellDelegate { protocol HLLTopCellDelegate {
func HLLTopCellBtnClick(idx:Int) func HLLTopCellBtnClick(idx:Int)
func HLLTopCellScrollIdx(idx:Int) func HLLTopCellScrollIdx(idx:Int)
// func HLLTopCellOtherClick(isSelect:Bool)
} }
class HLLTopCell: UITableViewCell,UIScrollViewDelegate { class HLLTopCell: UITableViewCell,UIScrollViewDelegate {
var idx = 0 var idx = 0
var delegate:HLLTopCellDelegate? var delegate:HLLTopCellDelegate?
@IBAction func btnClick(_ sender: UIButton) { @IBAction func btnClick(_ sender: UIButton) {
leftBtn.isHidden = false leftBtn.isHidden = false
rightBtn.isHidden = false rightBtn.isHidden = false
...@@ -53,6 +55,12 @@ class HLLTopCell: UITableViewCell,UIScrollViewDelegate { ...@@ -53,6 +55,12 @@ class HLLTopCell: UITableViewCell,UIScrollViewDelegate {
} }
} }
@IBOutlet weak var btnView: UIView!
@objc func otherClick(_ sender: UIButton) {
print("abc")
}
func scrollViewDidScroll(_ scrollView: UIScrollView) { func scrollViewDidScroll(_ scrollView: UIScrollView) {
leftBtn.isHidden = false leftBtn.isHidden = false
rightBtn.isHidden = false rightBtn.isHidden = false
...@@ -110,10 +118,9 @@ class HLLTopCell: UITableViewCell,UIScrollViewDelegate { ...@@ -110,10 +118,9 @@ class HLLTopCell: UITableViewCell,UIScrollViewDelegate {
self.selectionStyle = .none self.selectionStyle = .none
} }
override func layoutIfNeeded() { override func layoutIfNeeded() {
super.layoutIfNeeded() super.layoutIfNeeded()
if scrollView == nil { if scrollView == nil {
scrollView = UIScrollView(frame: scViewBg.bounds) scrollView = UIScrollView(frame: scViewBg.bounds)
scViewBg.addSubview(scrollView!) scViewBg.addSubview(scrollView!)
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<subviews> <subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="6H1-9e-5gM"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="6H1-9e-5gM">
<rect key="frame" x="0.0" y="126" width="375" height="55"/> <rect key="frame" x="0.0" y="130" width="375" height="51"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="长宽高" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AsL-1h-Y7c"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="长宽高" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AsL-1h-Y7c">
<rect key="frame" x="167.5" y="0.0" width="40" height="18.5"/> <rect key="frame" x="167.5" y="0.0" width="40" height="18.5"/>
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints> <constraints>
<constraint firstItem="AsL-1h-Y7c" firstAttribute="top" secondItem="6H1-9e-5gM" secondAttribute="top" id="4Dh-9v-gYg"/> <constraint firstItem="AsL-1h-Y7c" firstAttribute="top" secondItem="6H1-9e-5gM" secondAttribute="top" id="4Dh-9v-gYg"/>
<constraint firstAttribute="height" constant="55" id="7Is-x1-1hq"/> <constraint firstAttribute="height" constant="51" id="7Is-x1-1hq"/>
<constraint firstItem="wLi-w7-vL4" firstAttribute="top" secondItem="6H1-9e-5gM" secondAttribute="top" id="EzS-pi-dWY"/> <constraint firstItem="wLi-w7-vL4" firstAttribute="top" secondItem="6H1-9e-5gM" secondAttribute="top" id="EzS-pi-dWY"/>
<constraint firstItem="Yit-BG-pxY" firstAttribute="centerY" secondItem="aC7-Bu-5oE" secondAttribute="centerY" id="FEL-Zp-Y4G"/> <constraint firstItem="Yit-BG-pxY" firstAttribute="centerY" secondItem="aC7-Bu-5oE" secondAttribute="centerY" id="FEL-Zp-Y4G"/>
<constraint firstItem="Yit-BG-pxY" firstAttribute="leading" secondItem="dcU-lR-ZVX" secondAttribute="leading" id="GgP-zY-J9k"/> <constraint firstItem="Yit-BG-pxY" firstAttribute="leading" secondItem="dcU-lR-ZVX" secondAttribute="leading" id="GgP-zY-J9k"/>
......
//
// OnlyViewCell.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/8/11.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
protocol OnlyViewCellDelegate {
func OnlyViewCellSelect(idx:String)
}
class OnlyViewCell: UITableViewCell {
var delegate:OnlyViewCellDelegate?
@IBOutlet weak var btnViewH: NSLayoutConstraint!
var datas:Array<vehicle_std_arr_data>?
@IBOutlet weak var btnView: UIView!
override func awakeFromNib() {
super.awakeFromNib()
self.selectionStyle = .none
// Initialization code
}
var isNotReady:Bool = true
override func layoutSubviews() {
super.layoutSubviews()
if isNotReady {
for index in 0 ..< datas!.count{
let item = datas![index]
let width = fullScreenWidth - 30
let w = width / 3
let cols = 3
let col = index % cols
let row = index / cols
let shopX = CGFloat(col) * (w + 10)
let shopY = CGFloat(row) * (20 + 5)
let btn = UIButton(frame: CGRect(x: shopX , y: shopY , width: w, height: 20))
btn.setImage(UIImage(named: "daixuan"), for: .normal)
btn.setImage(UIImage(named: "yuxuan"), for: .selected)
btn.addTarget(self, action: #selector(carSelect(sender:)), for: .touchUpInside)
btn.tag = index
btn.setTitle(" " + item.name!, for: .normal)
btn.titleLabel?.font = UIFont.systemFont(ofSize: 11)
btn.setTitleColor(UIColor(named: "灰色字体颜色"), for: .normal)
btn.titleLabel?.font = UIFont.systemFont(ofSize: 13)
btnView.addSubview(btn)
if index == datas!.count - 1 {
btnViewH.constant = shopY+20
isNotReady = false
}
}
}
}
@objc func carSelect(sender:UIButton){
if sender.isSelected {
sender.isSelected = false
}else{
sender.isSelected = true
}
delegate?.OnlyViewCellSelect(idx: datas![sender.tag].name!)
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
}
<?xml version="1.0" encoding="UTF-8"?>
<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_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<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"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="120" id="KGk-i7-Jjw" customClass="OnlyViewCell" customModule="TestClass" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="358" height="70"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" ambiguous="YES" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="358" height="70"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="车型要求(选填)" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nxw-mB-tIY">
<rect key="frame" x="15" y="15" width="343" height="15"/>
<constraints>
<constraint firstAttribute="height" constant="15" id="SwB-bC-emJ"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" name="提示语字体颜色"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="iu3-IV-bvt">
<rect key="frame" x="15" y="35" width="328" height="20"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="Em9-Te-Ur4"/>
</constraints>
</view>
</subviews>
<constraints>
<constraint firstAttribute="bottom" secondItem="iu3-IV-bvt" secondAttribute="bottom" constant="5" id="4Vy-jc-B8s"/>
<constraint firstAttribute="trailing" secondItem="nxw-mB-tIY" secondAttribute="trailing" id="J0o-lx-7Qv"/>
<constraint firstItem="iu3-IV-bvt" firstAttribute="top" secondItem="nxw-mB-tIY" secondAttribute="bottom" constant="5" id="ZEM-Bc-0bm"/>
<constraint firstItem="nxw-mB-tIY" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="kyu-lW-jyd"/>
<constraint firstItem="nxw-mB-tIY" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="15" id="lCG-YP-UeP"/>
<constraint firstItem="iu3-IV-bvt" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="ty5-cS-pOb"/>
<constraint firstAttribute="trailing" secondItem="iu3-IV-bvt" secondAttribute="trailing" constant="15" id="zHv-gn-NaB"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<connections>
<outlet property="btnView" destination="iu3-IV-bvt" id="7yu-Zh-1ee"/>
<outlet property="btnViewH" destination="Em9-Te-Ur4" id="PgY-Yr-rgk"/>
</connections>
<point key="canvasLocation" x="89.855072463768124" y="111.16071428571428"/>
</tableViewCell>
</objects>
<resources>
<namedColor name="提示语字体颜色">
<color red="0.70588235294117652" green="0.70588235294117652" blue="0.70588235294117652" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>
...@@ -8,41 +8,75 @@ ...@@ -8,41 +8,75 @@
import UIKit import UIKit
import LGButton import LGButton
protocol OtherDemandViewControllerDelegate {
func OtherDemandViewControllerResult(strs:Array<spec_req_arr_data>,selectArr:Array<Int>)
}
class OtherDemandViewController: BaseViewController ,UITableViewDelegate,UITableViewDataSource{ class OtherDemandViewController: BaseViewController ,UITableViewDelegate,UITableViewDataSource{
var delegate:OtherDemandViewControllerDelegate?
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if carModel != nil && ((carModel?.spec_req_arr!.count)!) > 0 {
return (carModel?.spec_req_arr!.count)!
}
return 0
}
@IBOutlet weak var sureBtn: LGButton! @IBOutlet weak var sureBtn: LGButton!
@IBOutlet weak var listView: UITableView! @IBOutlet weak var listView: UITableView!
var carModel:cityCartDataModel?
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
if selectArr.count == 0 {
if carModel != nil && carModel!.spec_req_arr!.count > 0 {
for _ in carModel!.spec_req_arr! {
selectArr.append((carModel?.spec_req_arr!.count)!)
}
}
}
navbar.title = "额外需求" navbar.title = "额外需求"
self.view.addSubview(navbar) self.view.addSubview(navbar)
SetTopFrameView(view: listView, btmView: sureBtn) SetTopFrameView(view: listView, btmView: sureBtn)
listView.separatorStyle = .none listView.separatorStyle = .none
listView.register(UINib(nibName: "TitleAndSelectCell", bundle: nil), forCellReuseIdentifier: "TitleAndSelectCell") listView.register(UINib(nibName: "TitleAndSelectCell", bundle: nil), forCellReuseIdentifier: "TitleAndSelectCell")
} }
var selectArr:Array<Int> = []
@IBAction func sureDemandAction(_ sender: LGButton) { @IBAction func sureDemandAction(_ sender: LGButton) {
print("sureDemandAction") print("sureDemandAction")
var tempArr:Array<spec_req_arr_data> = []
for item in selectArr {
if item != selectArr.count {
tempArr.append((carModel?.spec_req_arr![item]) as! spec_req_arr_data)
}
}
delegate?.OtherDemandViewControllerResult(strs: tempArr,selectArr: selectArr)
self.navigationController?.popViewController(animated: true)
} }
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
print(indexPath)
let item = selectArr[indexPath.row]
if item == indexPath.row {
selectArr.insert(selectArr.count, at: indexPath.row)
}else{
selectArr.insert(indexPath.row, at: indexPath.row)
}
selectArr.remove(at: indexPath.row + 1)
tableView.reloadData()
} }
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 50 return 50
} }
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 2
}
func numberOfSections(in tableView: UITableView) -> Int {
return 2;
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndSelectCell") as! TitleAndSelectCell let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndSelectCell") as! TitleAndSelectCell
if indexPath.row == 0 { let data = (carModel?.spec_req_arr![indexPath.row])
cell.line.isHidden = true cell.titleLbl.text = data?.name
cell.tag = indexPath.row
if cell.tag == selectArr[indexPath.row] {
cell.selectBtn.isSelected = true
}else{ }else{
cell.line.isHidden = false cell.selectBtn.isSelected = false
} }
return cell return cell
...@@ -76,41 +110,10 @@ class OtherDemandViewController: BaseViewController ,UITableViewDelegate,UITable ...@@ -76,41 +110,10 @@ class OtherDemandViewController: BaseViewController ,UITableViewDelegate,UITable
make.bottom.equalTo(-5) make.bottom.equalTo(-5)
} }
lbl.text = "其它服务"
lblFU.text = "(多选)"
if section == 0 {
lbl.text = "搬运服务"
lblFU.text = ""
}else{
lbl.text = "其它服务"
lblFU.text = "(多选)"
}
return view return view
} }
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
if section == 0 {
return 40
}
return 0.01
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
let view = UIView()
for suv in view.subviews {
suv.removeFromSuperview()
}
if section == 0 {
let lbl = UILabel()
lbl.text = "以上两种搬运服务二选一,无需求可不选"
lbl.textColor = UIColor.init(named: "灰色字体颜色")
lbl.font = UIFont.init(name: "PingFang SC", size: 11)
view.addSubview(lbl)
lbl.snp.makeConstraints { (make) in
make.left.equalTo(15)
make.top.equalTo(5)
}
}
return view
}
} }
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