Commit 04aa9143 authored by lujunye's avatar lujunye

货拉拉下单调试

parent a59e414b
......@@ -90,6 +90,8 @@
E02FD9F72455790800E10E27 /* DiZhiGuanLiCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E02FD9F52455790800E10E27 /* DiZhiGuanLiCell.xib */; };
E02FD9FA24557E8600E10E27 /* XinZengDiZhiViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E02FD9F824557E8600E10E27 /* XinZengDiZhiViewController.swift */; };
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 */; };
E030DF372485DD3E002764D3 /* NewRKCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E030DF352485DD3E002764D3 /* NewRKCell.xib */; };
E030DF3B248651A5002764D3 /* NewRKVc.swift in Sources */ = {isa = PBXBuildFile; fileRef = E030DF39248651A5002764D3 /* NewRKVc.swift */; };
......@@ -716,6 +718,8 @@
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>"; };
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>"; };
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>"; };
......@@ -3053,6 +3057,8 @@
F96E48A924CA9559000AB8D4 /* TitleTimeHeaderFooterView.xib */,
F993C66C24CADE2400493CC7 /* WayBillStautsTableViewCell.swift */,
F993C66D24CADE2400493CC7 /* WayBillStautsTableViewCell.xib */,
E030515124E2304600AFB9E9 /* OnlyViewCell.swift */,
E030515224E2304600AFB9E9 /* OnlyViewCell.xib */,
);
path = cell;
sourceTree = "<group>";
......@@ -3289,6 +3295,7 @@
E09B3AD724B2FCAF00E3B238 /* ShareSDKConfigFile.bundle in Resources */,
E06524FA24581A7900CA22E2 /* ChuKuCell.xib in Resources */,
E0CC848824823EC1009B1FE9 /* CRKCell.xib in Resources */,
E030515424E2304600AFB9E9 /* OnlyViewCell.xib in Resources */,
E0337EF62464FCFC00952EF4 /* GYSListViewController.xib in Resources */,
F96E48AA24CA9559000AB8D4 /* TitleTimeHeaderFooterView.xib in Resources */,
E0706EF524B40BE800D8251C /* TitleAndTfYuanCell.xib in Resources */,
......@@ -3708,6 +3715,7 @@
F9011C1024CE6FB200AAF4F5 /* LogisticalSelectView.swift in Sources */,
F950FDDC24518B9500C40530 /* FSCalendar.m in Sources */,
F9FF7BA124760DA9006E305E /* LogisticsCompanyModel.swift in Sources */,
E030515324E2304600AFB9E9 /* OnlyViewCell.swift in Sources */,
E0206327246CD84A007A40C4 /* TitleAndLblView.swift in Sources */,
E007B1D4248F6880004D14CC /* CGDDayCell.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 {
var total_price_fen :Float? //订单预估总价
var order_vehicle_name:String?
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) {
}
......@@ -234,7 +237,8 @@ class orderPriceCalculateDataModel: Mappable {
total_price_fen <- map["total_price_fen"]
order_vehicle_name <- map["order_vehicle_name"]
exceed_distance <- map["exceed_distance"]
spec_req_price_arr <- map["spec_req_price_arr"]
order_price_arr <- map["order_price_arr"]
}
}
class orderPriceCalculateSpecReqDataModel: Mappable {
......
......@@ -11,6 +11,7 @@ import Photos
import Alamofire
import SwiftDate
class PersonCenterViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource {
@IBOutlet weak var editBtn: UIButton!
@IBOutlet weak var shopNameLbl: UILabel!
@IBOutlet weak var iconImg: UIImageView!
......@@ -21,31 +22,31 @@ class PersonCenterViewController: BaseViewController,UITableViewDelegate,UITable
var dataModel : AdminInfoModel? = nil
let listArray = ["格利支付","蓝牙打印设置","权限设置"]
//MARK:--加载数据
func loadData(){
let UserToken = UserDefaults.standard.value(forKey: "user_token")
HUD.flash(.progress)
adminInfo(["user_token":UserToken as Any], success: { (data) in
HUD.hide()
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.nameLbl.text = self.nowDateStr()
}) { (error) in
}
self.nameLbl.text = self.nowDateStr()
}
func nowDateStr() -> String {
let date = Date() + 8.hours
if date.compare(.isMorning) {
return "Hi~早上好!"
return "Hi~早上好!" + (dataModel?.data?.shop_name!)!
}else if date.compare(.isAfternoon) {
return "Hi~下午好!"
return "Hi~下午好!" + (dataModel?.data?.shop_name!)!
}else if date.compare(.isEvening) {
return "Hi~傍晚好!"
return "Hi~傍晚好!" + (dataModel?.data?.shop_name!)!
}else if date.compare(.isNight) {
return "Hi~深夜了!"
return "Hi~深夜了!" + (dataModel?.data?.shop_name!)!
}
return ""
}
......@@ -78,6 +79,15 @@ class PersonCenterViewController: BaseViewController,UITableViewDelegate,UITable
listView?.register(UINib(nibName: "PersonCenterCell", bundle: nil), forCellReuseIdentifier: "listCell")
// 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"
......@@ -111,7 +121,7 @@ class PersonCenterViewController: BaseViewController,UITableViewDelegate,UITable
}
//MARK:--跳转消息中心
@IBAction func toMsgCenterAction(_ sender: Any) {
@objc func toMsgCenterAction(_ sender: Any) {
print("跳转消息中心")
let vc = MsgCenterViewController()
......
<?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="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
......@@ -11,6 +11,7 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="PersonCenterViewController" customModule="TestClass" customModuleProvider="target">
<connections>
<outlet property="editBtn" destination="cLg-xh-ou1" id="smx-MB-zYV"/>
<outlet property="iconImg" destination="DwS-q4-jGe" id="6he-Rl-qwv"/>
<outlet property="listView" destination="5jU-Ew-dGr" id="xBV-SK-mS7"/>
<outlet property="nameLbl" destination="fgk-Rc-0oD" id="YJV-I2-pwb"/>
......@@ -47,16 +48,16 @@
<constraint firstAttribute="height" constant="17" id="cnn-lk-74W"/>
<constraint firstAttribute="width" constant="17" id="g7b-8f-Rof"/>
</constraints>
<state key="normal" image="xiaoxi"/>
<state key="normal" image="edit"/>
<connections>
<action selector="toMsgCenterAction:" destination="-1" eventType="touchUpInside" id="ctm-oG-Q9h"/>
<action selector="editAction:" destination="-1" eventType="touchUpInside" id="rHD-r5-zZh"/>
</connections>
</button>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="DwS-q4-jGe">
<rect key="frame" x="15" y="70" width="75" height="75"/>
<rect key="frame" x="15" y="70" width="0.0" height="75"/>
<constraints>
<constraint firstAttribute="height" constant="75" id="Hma-Cd-TV0"/>
<constraint firstAttribute="width" constant="75" id="HtK-mA-OBM"/>
<constraint firstAttribute="width" id="HtK-mA-OBM"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
......@@ -71,28 +72,19 @@
</userDefinedRuntimeAttributes>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fgk-Rc-0oD">
<rect key="frame" x="100" y="80" width="175" height="17"/>
<rect key="frame" x="25" y="80" width="0.0" height="17"/>
<constraints>
<constraint firstAttribute="height" constant="17" id="V7v-hK-fZO"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" name="标题字颜色"/>
<color key="textColor" name="白色背景色"/>
<nil key="highlightedColor"/>
</label>
<view alpha="0.75" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="L5q-yc-640">
<rect key="frame" x="95" y="105" width="10" height="4"/>
<color key="backgroundColor" name="白色背景色"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="3"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1dW-Zl-K3m">
<rect key="frame" x="100" y="107" width="0.0" height="0.0"/>
<rect key="frame" x="25" y="107" width="0.0" height="0.0"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<fontDescription key="fontDescription" type="system" pointSize="11"/>
<color key="textColor" name="个人中心灰色字体"/>
<color key="textColor" name="白色背景色"/>
<nil key="highlightedColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
......@@ -100,33 +92,6 @@
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="编辑资料" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="FHK-Ns-Jbj">
<rect key="frame" x="290.5" y="99.5" width="54" height="16"/>
<constraints>
<constraint firstAttribute="width" constant="54" id="B8d-gi-Jor"/>
<constraint firstAttribute="height" constant="16" id="M2l-m0-JLo"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="jinru" translatesAutoresizingMaskIntoConstraints="NO" id="g4L-Xg-xC1">
<rect key="frame" x="353.5" y="102" width="6.5" height="11.5"/>
<constraints>
<constraint firstAttribute="height" constant="11.5" id="7qc-IJ-k2g"/>
<constraint firstAttribute="width" constant="6.5" id="eo0-SN-D8w"/>
</constraints>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="rVJ-yV-KJf">
<rect key="frame" x="290" y="92.5" width="85" height="30"/>
<constraints>
<constraint firstAttribute="width" constant="85" id="4P7-o1-qCR"/>
<constraint firstAttribute="height" constant="30" id="66j-1C-Hbd"/>
</constraints>
<connections>
<action selector="editAction:" destination="-1" eventType="touchUpInside" id="jfv-r3-u4X"/>
</connections>
</button>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="5jU-Ew-dGr">
<rect key="frame" x="15" y="175" width="345" height="148"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
......@@ -149,32 +114,20 @@
<constraint firstItem="fgk-Rc-0oD" firstAttribute="top" secondItem="XS7-um-ERL" secondAttribute="bottom" constant="80" id="5Vq-dc-2PO"/>
<constraint firstItem="XS7-um-ERL" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="5dt-Rh-U95"/>
<constraint firstItem="DwS-q4-jGe" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="15" id="7sM-zc-klQ"/>
<constraint firstItem="L5q-yc-640" firstAttribute="bottom" secondItem="1dW-Zl-K3m" secondAttribute="bottom" constant="2" id="9hY-dh-120"/>
<constraint firstItem="L5q-yc-640" firstAttribute="top" secondItem="1dW-Zl-K3m" secondAttribute="top" constant="-2" id="E1O-zB-HgF"/>
<constraint firstItem="1dW-Zl-K3m" firstAttribute="leading" secondItem="fgk-Rc-0oD" secondAttribute="leading" id="EIK-Gd-lLv"/>
<constraint firstItem="FHK-Ns-Jbj" firstAttribute="centerY" secondItem="DwS-q4-jGe" secondAttribute="centerY" id="JK4-XS-vBE"/>
<constraint firstItem="fgk-Rc-0oD" firstAttribute="leading" secondItem="DwS-q4-jGe" secondAttribute="trailing" constant="10" id="K68-Yb-HVk"/>
<constraint firstItem="g4L-Xg-xC1" firstAttribute="centerY" secondItem="DwS-q4-jGe" secondAttribute="centerY" id="M0M-hu-pUF"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="g4L-Xg-xC1" secondAttribute="trailing" constant="15" id="Mrj-Zu-Nyw"/>
<constraint firstItem="5jU-Ew-dGr" firstAttribute="top" secondItem="DwS-q4-jGe" secondAttribute="bottom" constant="30" id="OJH-Vp-JzG"/>
<constraint firstItem="cLg-xh-ou1" firstAttribute="top" secondItem="XS7-um-ERL" secondAttribute="bottom" constant="40" id="RU9-dO-deH"/>
<constraint firstItem="1dW-Zl-K3m" firstAttribute="top" secondItem="fgk-Rc-0oD" secondAttribute="bottom" constant="10" id="UAw-P4-ixK"/>
<constraint firstItem="DwS-q4-jGe" firstAttribute="top" secondItem="XS7-um-ERL" secondAttribute="bottom" constant="70" id="VTx-E9-roD"/>
<constraint firstItem="rVJ-yV-KJf" firstAttribute="leading" secondItem="fgk-Rc-0oD" secondAttribute="trailing" constant="15" id="Vr2-ou-tfd"/>
<constraint firstItem="rVJ-yV-KJf" firstAttribute="trailing" secondItem="fnl-2z-Ty3" secondAttribute="trailing" id="WsU-SM-AkY"/>
<constraint firstItem="L5q-yc-640" firstAttribute="leading" secondItem="1dW-Zl-K3m" secondAttribute="leading" constant="-5" id="ZUA-Dl-gzJ"/>
<constraint firstItem="1dW-Zl-K3m" firstAttribute="leading" secondItem="DwS-q4-jGe" secondAttribute="trailing" constant="10" id="bgX-1r-ER4"/>
<constraint firstItem="g4L-Xg-xC1" firstAttribute="leading" secondItem="FHK-Ns-Jbj" secondAttribute="trailing" constant="9" id="bjJ-fD-OXZ"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="HeU-V1-6DM" secondAttribute="trailing" id="gHU-E2-SuW"/>
<constraint firstItem="XS7-um-ERL" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" constant="-60" id="hST-i2-ChZ"/>
<constraint firstItem="rVJ-yV-KJf" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="1dW-Zl-K3m" secondAttribute="trailing" constant="10" id="kQU-x8-Upg"/>
<constraint firstItem="HeU-V1-6DM" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="mg9-jE-IY9"/>
<constraint firstItem="rVJ-yV-KJf" firstAttribute="centerY" secondItem="DwS-q4-jGe" secondAttribute="centerY" id="rBe-8F-ejm"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="5jU-Ew-dGr" secondAttribute="trailing" constant="15" id="rzW-MO-fAP"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="cLg-xh-ou1" secondAttribute="trailing" constant="15" id="sHN-S7-6ms"/>
<constraint firstItem="5jU-Ew-dGr" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="15" id="v0e-5c-etM"/>
<constraint firstItem="HeU-V1-6DM" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="vP5-n9-lJH"/>
<constraint firstItem="L5q-yc-640" firstAttribute="trailing" secondItem="1dW-Zl-K3m" secondAttribute="trailing" constant="5" id="yMD-Gd-585"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="XS7-um-ERL" secondAttribute="trailing" id="zG1-1C-ytv"/>
</constraints>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
......@@ -182,16 +135,9 @@
</view>
</objects>
<resources>
<image name="jinru" width="13" height="23"/>
<image name="edit" width="16" height="16"/>
<image name="msgBanner" width="750" height="454"/>
<image name="sekuai" width="375" height="30"/>
<image name="xiaoxi" width="34" height="36"/>
<namedColor name="个人中心灰色字体">
<color red="0.3919999897480011" green="0.3919999897480011" blue="0.3919999897480011" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="标题字颜色">
<color red="0.18000000715255737" green="0.18000000715255737" blue="0.18000000715255737" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="白色背景色">
<color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
......
......@@ -14,9 +14,218 @@ import SwiftDate
import SDWebImage
import IQKeyboardManagerSwift
class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,JiTuoWuXinXiViewDelegate,JiPaiFangShiViewControllerDelegate,ZengZhiServicesViewControllerDelegate,AdressSelectCellDelegate,DZGLViewControllerDelegate,XinZengDiZhiViewControllerDelegate,TitleAndTFBtnCellDelegate,WenDuCellDelegate,LogisticalSelectViewDelegate, UIPickerViewDataSource, UIPickerViewDelegate, GLAlertSelectViewDelegate,CLLocationManagerDelegate, CityListViewControllerDelegate,ToAndFormSelectViewControllerDelegate,WayBillAddressCanDelItemCellDelegate,HLLTopCellDelegate{
class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,JiTuoWuXinXiViewDelegate,JiPaiFangShiViewControllerDelegate,ZengZhiServicesViewControllerDelegate,AdressSelectCellDelegate,DZGLViewControllerDelegate,XinZengDiZhiViewControllerDelegate,TitleAndTFBtnCellDelegate,WenDuCellDelegate,LogisticalSelectViewDelegate, UIPickerViewDataSource, UIPickerViewDelegate, GLAlertSelectViewDelegate,CLLocationManagerDelegate, CityListViewControllerDelegate,ToAndFormSelectViewControllerDelegate,WayBillAddressCanDelItemCellDelegate,HLLTopCellDelegate,OtherDemandViewControllerDelegate,OnlyViewCellDelegate, XiaDanUserInfoViewControllerDelegate{
var xiaDanRenMsg:NSString = ""
func XiaDanUserInfoViewControllerData(str: NSString) {
xiaDanRenMsg = str
let arr = xiaDanRenMsg.components(separatedBy: "_")
hPart2P.insert("\(arr.first!)\(arr[1]))", at: 1)
hPart2P.remove(at: 2)
hListView.reloadData()
}
var serviceSelect:Array<String> = []
func OnlyViewCellSelect(idx: String) {
let num = serviceSelect.index(of: idx)
if num == nil {
serviceSelect.append(idx)
}else{
serviceSelect.remove(at: num!)
}
print(serviceSelect)
hListView.reloadData()
}
var selectAr:Array<Int> = []
var spec_select_arr:Array<Int> = []
func OtherDemandViewControllerResult(strs: Array<spec_req_arr_data>,selectArr:Array<Int>) {
var spec_req_arr_str = ""
spec_select_arr.removeAll()
for item in strs{
spec_select_arr.append(item.type!)
}
for i in 0 ..< strs.count{
let item = strs[i]
if i == strs.count - 1 {
spec_req_arr_str += item.name!
}else{
spec_req_arr_str += item.name! + ","
}
}
selectAr.removeAll()
selectAr = selectArr
hPart2P.insert(spec_req_arr_str, at: 2)
hPart2P.remove(at: 3)
if adrArr.count > 0 {
let firstData = adrArr.first! as NSDictionary
if firstData["locName"] as! String != "空" && adrArr.count > 1 {
var adrDs:Array<Any> = []
adrDs.removeAll()
for item in adrArr {
let data = item["adr"] as! cityListDataModel
let dict = ["lat":data.lat_lon!.lat!,"lon":data.lat_lon!.lon!,"city_id":data.city_id!] as [String : Any]
adrDs.append(dict)
}
let lat_lon_arr = dataChangeString(sender: adrDs)
// var std_tag_arr = ""
// if isSpecCar {
// std_tag_arr = "带尾板"
// }
let fD = adrArr.first!
let cityData = fD["adr"] as! cityListDataModel
let params = ["user_token":UserToken as Any,
"nonce_str":String.randomStr(len: 30) as Any,
"city_id":cityData.city_id as Any,
"city_info_revision":carModel?.revision as Any,
"order_vehicle_id":carTypesArr[selectCarType].order_vehicle_id as Any,
"std_tag_arr":"" as Any,
"spec_req_arr":spec_select_arr as Any,
"lat_lon_arr":lat_lon_arr as Any
]
orderPriceCalculate(params, success: { (data) in
let model = data as! orderPriceCalculateModel
self.YuGuPriceLbl.text = "\(model.data!.total_price_fen!/100)"
self.logisticsCostModel = model
let view = self.hListView.footerView(forSection: 1)
view?.layoutIfNeeded()
self.hListView.reloadData()
return
}) { (err) in
}
}
}
hListView.reloadData()
}
@IBAction func setHllOrder(_ sender: Any) {
print("下运单")
if adrArr.count == 0 {
HUD.flash(.label("请选择完整的收发路线"), delay: 1.2)
return
}
if stime == 0 {
HUD.flash(.label("请选择用车时间"), delay: 1.2)
return
}
let msgArr = xiaDanRenMsg.components(separatedBy: "_")
if msgArr.first?.count == 0 || msgArr[1].count == 0 {
HUD.flash(.label("请填写下单联系人及联系电话"), delay: 1.2)
return
}
let dict = adrArr.first
if adrArr.count > 1 && dict!["locName"] as! String != "空" {
let firstDict = adrArr.first
let firstCity = firstDict!["adr"] as! cityListDataModel
let firstArr = (firstDict!["detailAdr"] as! NSString).components(separatedBy: "_")
let lastDict = adrArr.last
let lastArr = (firstDict!["detailAdr"] as! NSString).components(separatedBy: "_")
var lat_lon_Arr:Array<String> = []
for i in 0 ..< adrArr.count {
let item = adrArr[i]
let data = item["adr"] as! cityListDataModel
let dict = ["lat":data.lat_lon?.lat,
"lon":data.lat_lon?.lon]
print("lat_lon_Arr_data == ",dict)
lat_lon_Arr.append(dictChangeString(sender: dict as Dictionary<String, Any>))
}
var addr_info_arr:Array<NSDictionary> = []
for i in 0 ..< adrArr.count {
let item = adrArr[i]
let itemModel = item["adr"] as! cityListDataModel
let itemData = (item["detailAdr"] as! NSString).components(separatedBy: "_")
let dict = ["name":itemData.last as Any,
"addr":item["menPai"] as Any,
"city_id":itemModel.city_id as Any,
"district_name":itemData[1] as Any,
"house_number":item["menPai"] as Any,
"contact_name":firstDict!["shouHuoRen"] as Any,
"contact_phone_no":firstDict!["phoneNum"] as Any,
"lat_lon":lat_lon_Arr[i]]
print("addr_info_arr_data == ",dict)
addr_info_arr.append(dict as NSDictionary)
}
var s_consignee = ""
if (firstDict!["shouHuoRen"] as! String).count > 0 {
s_consignee = firstDict!["shouHuoRen"] as! String
}
var s_mobile = ""
if (firstDict!["phoneNum"] as! String).count > 0 {
s_mobile = firstDict!["shouHuoRen"] as! String
}
var r_mobile = ""
if (lastDict!["phoneNum"] as! String).count > 0 {
r_mobile = lastDict!["phoneNum"] as! String
}
var r_consignee = ""
if (lastDict!["shouHuoRen"] as! String).count > 0 {
r_consignee = lastDict!["shouHuoRen"] as! String
}
let total = YuGuPriceLbl.text! as NSString
let dict1 = ["user_token":UserToken as Any,
"nonce_str":String.randomStr(len: 30) as Any,
"s_city":firstArr[0] as Any,
"s_area":firstArr[1] as Any,
"s_address":firstArr[2] as Any,
"s_consignee":s_consignee as Any,
"s_mobile":s_mobile as Any,
"r_city":lastArr[0] as Any,
"r_area":lastArr[1] as Any,
"r_address":lastArr[2] as Any,
"r_consignee":r_consignee as Any,
"r_mobile":r_mobile as Any,
"city_id":firstCity.city_id as Any,
"city_info_revision":carModel?.revision as Any,
"order_vehicle_id":carTypesArr[selectCarType].order_vehicle_id as Any,
"std_tag_arr":"" as Any,
"spec_req_arr":spec_select_arr as Any,
"order_time":stime as Any,
"total_price_fen":total.floatValue * 100 as Any,
"contact_name":msgArr.first as Any,
"contact_phone_no":msgArr[1] as Any,
"pay_type":"" as Any,
"order_reason":"" as Any,
"remark":msgArr.last as Any,
"sale_plat":guanlianPingStr as Any,
"order_sn":guanlianDingStr as Any,
"addr_info":addr_info_arr as Any
]
print("23399=",dict1)
shopsAuthList(dict1, success: { (data) in
let model = data as! shopsAuthListModel
print("订单号 - ",model.data?.order_display_id)
}) { (err) in
}
}else{
HUD.flash(.label("请选择完整的收发路线"), delay: 1.2)
}
}
@IBOutlet weak var YuGuPriceLbl: UILabel!
func showScrollUI(){
//左右按钮
for item in lineArr{
if item.tag == selectCarType {
item.isHidden = false
......@@ -43,6 +252,56 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
let x = btn.frame.minX
let rect = CGRect(x: Int(x), y: 0, width: Int(w), height: 1)
topBtnScv.scrollRectToVisible(rect, animated: true)
//刷新
if adrArr.count > 0 {
let firstData = adrArr.first! as NSDictionary
if firstData["locName"] as! String != "空" && adrArr.count > 1 {
var adrDs:Array<Any> = []
adrDs.removeAll()
for item in adrArr {
let data = item["adr"] as! cityListDataModel
let dict = ["lat":data.lat_lon!.lat!,"lon":data.lat_lon!.lon!,"city_id":data.city_id!] as [String : Any]
adrDs.append(dict)
}
let lat_lon_arr = dataChangeString(sender: adrDs)
// var std_tag_arr = ""
// if isSpecCar {
// std_tag_arr = "带尾板"
// }
let fD = adrArr.first!
let cityData = fD["adr"] as! cityListDataModel
let params = ["user_token":UserToken as Any,
"nonce_str":String.randomStr(len: 30) as Any,
"city_id":cityData.city_id as Any,
"city_info_revision":carModel?.revision as Any,
"order_vehicle_id":carTypesArr[selectCarType].order_vehicle_id as Any,
"std_tag_arr":"" as Any,
"spec_req_arr":spec_select_arr as Any,
"lat_lon_arr":lat_lon_arr as Any
]
orderPriceCalculate(params, success: { (data) in
let model = data as! orderPriceCalculateModel
self.YuGuPriceLbl.text = "\(model.data!.total_price_fen!/100)"
self.logisticsCostModel = model
let view = self.hListView.footerView(forSection: 1)
view?.layoutIfNeeded()
self.hListView.reloadData()
}) { (err) in
}
}
}
self.hListView.reloadData()
}
func HLLTopCellScrollIdx(idx: Int) {
......@@ -61,6 +320,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
view?.layoutIfNeeded()
hListView.reloadData()
}
var carModel:cityCartDataModel?
fileprivate func extractedFunc() {
HUD.flash(.progress)
......@@ -72,6 +332,8 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
for item in model.data!.vehicle_arr! {
self.carTypesArr.append(item)
}
let view = self.hListView.footerView(forSection: 0)
view?.layoutIfNeeded()
self.setBtnUI(carTypesArr: self.carTypesArr,view: self.topCarBtnSelectView)
self.hListView.reloadData()
}) { (err) in
......@@ -80,11 +342,18 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
}
@IBAction func toDetailpage(_ sender: Any) {
if logisticsCostModel == nil {
HUD.flash(.label("请选择完整的收发路线"), delay: 1.2)
return
}
print("明细跳转 ")
let vc = LogisticsCostDetailViewController()
vc.model = logisticsCostModel
// vc.carModel = carTypesArr[selectCarType]
self.navigationController?.pushViewController(vc, animated: true)
}
func ToAndFormSelectViewControllerSelectAdr(dict: Dictionary<String, Any>, idx: Int) {
let adrModel = dict["adr"] as! cityListDataModel
if idx == 0 {
......@@ -106,19 +375,34 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
adrArr.append(dic)
adrArr.append(dict as NSDictionary)
}else{
if adrArr.count > idx {
adrArr.insert(dict as NSDictionary, at: idx)
adrArr.remove(at: idx+1)
}else{
adrArr.append(dict as NSDictionary)
}
}
let firstData = adrArr.first! as NSDictionary
if firstData["locName"] as! String != "空" && adrArr.count > 1 {
var adrDs:Array<Any> = []
adrDs.removeAll()
for item in adrArr {
let data = item["adr"] as! cityListDataModel
let dict = ["lat":data.lat_lon!.lat!,"lon":data.lat_lon!.lon!,"city_id":data.city_id!] as [String : Any]
adrDs.append(dict)
}
let lat_lon_arr = dataChangeString(sender: adrDs)
// var std_tag_arr = ""
// if isSpecCar {
// std_tag_arr = "带尾板"
// }
let fD = adrArr.first!
let cityData = fD["adr"] as! cityListDataModel
let params = ["user_token":UserToken as Any,
......@@ -126,18 +410,34 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
"city_id":cityData.city_id as Any,
"city_info_revision":carModel?.revision as Any,
"order_vehicle_id":carTypesArr[selectCarType].order_vehicle_id as Any,
// ""
"std_tag_arr":"" as Any,
"spec_req_arr":spec_select_arr as Any,
"lat_lon_arr":lat_lon_arr as Any
]
// orderPriceCalculate(<#T##params: [String : Any]##[String : Any]#>, success: <#T##(Any) -> ()#>, failture: <#T##(Error) -> ()#>)
orderPriceCalculate(params, success: { (data) in
let model = data as! orderPriceCalculateModel
self.YuGuPriceLbl.text = "\(model.data!.total_price_fen!/100)"
self.logisticsCostModel = model
let view = self.hListView.footerView(forSection: 1)
view?.layoutIfNeeded()
self.hListView.reloadData()
return
}) { (err) in
}
}
let view = self.hListView.footerView(forSection: 1)
let view = hListView.footerView(forSection: 1)
view?.layoutIfNeeded()
hListView.reloadData()
self.hListView.reloadData()
}
var logisticsCostModel:orderPriceCalculateModel?
var loc:cityListDataModel!
func CityListViewControllerLocSelect(loc: cityListDataModel) {
......@@ -603,6 +903,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
//MARK: - 货拉拉
hListView.separatorStyle = .none
hListView.register(UINib(nibName: "TitleAndSwitchCell", bundle: nil), forCellReuseIdentifier: "TitleAndSwitchCell")
hListView.register(UINib(nibName: "OnlyViewCell", bundle: nil), forCellReuseIdentifier: "OnlyViewCell")
hListView.register(UINib(nibName: "TitleAndBtnCell", bundle: nil), forCellReuseIdentifier: "TitleAndBtnCell")
hListView.register(UINib(nibName: "TitleAndTFBtnCell", bundle: nil), forCellReuseIdentifier: "TitleAndTFBtnCell")
hListView.register(UINib(nibName: "HLLTopCell", bundle: nil), forCellReuseIdentifier: "HLLTopCell")
......@@ -684,6 +985,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
return 0.1
}
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
if tableView == listView {
let view = UIView()
......@@ -905,7 +1207,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
vc.delegate = self
if adrDatas.count > 0 {
// vc.loc = loc
self.navigationController?.pushViewController(vc, animated: true)
self.navigationController?.pushViewController(vc, animated: true)
}
}
......@@ -921,7 +1223,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
print("左边")
adrArr = tempadrArr
}
print("abc =",adrArr)
hListView.reloadData()
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
......@@ -934,6 +1236,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
}
return 41.5
}else{//货拉拉
if section == 1 {
return 49
}
......@@ -964,6 +1267,15 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
}
}else{//货拉拉
switch section {
case 0:
//MARK: -- 车型附加选项,打开即可使用
// if carTypesArr.count > 0 {
// let carItem = carTypesArr[selectCarType]
// if carItem.vehicle_std_arr!.count > 0 {
// return 2
// }
// }
return 1
case 1:
if adrArr.count < 2 {
return 2
......@@ -971,9 +1283,10 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
return adrArr.count
case 2:return 4
case 3:return 2
default: return 1
default:break
}
}
return 0
}
var bzIdx = 10086
......@@ -1094,10 +1407,14 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
if indexPath.section == 2 {
if indexPath.row == 1 {
let view = XiaDanUserInfoViewController()
view.delegate = self
self.navigationController?.pushViewController(view, animated: true)
}
if indexPath.row == 2 {
let view = OtherDemandViewController()
view.delegate = self
view.carModel = carModel
view.selectArr = selectAr
self.navigationController?.pushViewController(view, animated: true)
}
//保障
......@@ -1198,7 +1515,10 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
}else{//货拉拉
if indexPath.section == 0 {
return 181
if indexPath.row == 0 {
return 181
}
return UITableView.automaticDimension
}
if indexPath.section == 1 {
return UITableView.automaticDimension
......@@ -1294,6 +1614,13 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
}else{
//MARK: - 货拉拉cell
if indexPath.section == 0 {
if indexPath.row == 1 {
let cell = tableView.dequeueReusableCell(withIdentifier: "OnlyViewCell") as! OnlyViewCell
cell.datas = carTypesArr[selectCarType].vehicle_std_arr
cell.delegate = self
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: "HLLTopCell") as! HLLTopCell
cell.datas = carTypesArr
cell.delegate = self
......@@ -1422,8 +1749,10 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
}
}
@objc func topBtnClick(btn:UIButton){
// topBtnScv.setContentOffset(CGPoint(x: btn.frame.minX, y: 0), animated: true)
//顶栏按钮
selectCarType = btn.tag
showScrollUI()
let idx = IndexPath(row: 0, section: 0)
let cell = hListView.cellForRow(at:idx) as! HLLTopCell
......@@ -1820,6 +2149,13 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
let min = mins.i![minIdx]
stime = min.stime!
}
var dateTimeStr = "立刻用车"
if dayIdx != 0 && hourIdx != 0 {
dateTimeStr = "\(day.date!):\(String(describing: day.h![hourIdx].val)):\(String(describing: mins.i![minIdx].val))"
}
hPart2P.insert(dateTimeStr, at: 0)
hPart2P.remove(at: 1)
hListView.reloadData()
bgBtn?.removeFromSuperview()
bgBtn = nil
btmView?.removeFromSuperview()
......
......@@ -11,6 +11,7 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="XiaYunDanViewController" customModule="TestClass" customModuleProvider="target">
<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="hBtnViewH" destination="udi-Jp-eUF" id="lD6-tv-X0U"/>
<outlet property="hListView" destination="IhS-vZ-6YK" id="8cK-6U-GmQ"/>
......@@ -262,8 +263,8 @@
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
</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">
<rect key="frame" x="86.666666666666671" y="769.66666666666663" width="66.000000000000014" height="24"/>
<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="20.666666666666671" height="24"/>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="17"/>
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
......@@ -302,6 +303,9 @@
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="boolean" keyPath="gradientHorizontal" value="YES"/>
</userDefinedRuntimeAttributes>
<connections>
<action selector="setHllOrder:" destination="-1" eventType="touchUpInside" id="xEH-rI-yma"/>
</connections>
</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">
<rect key="frame" x="333.66666666666669" y="771.66666666666663" width="51" height="24"/>
......
......@@ -9,9 +9,11 @@
import UIKit
import LGButton
import ContactsUI
protocol XiaDanUserInfoViewControllerDelegate {
func XiaDanUserInfoViewControllerData(str:NSString)
}
class XiaDanUserInfoViewController: BaseViewController , CNContactPickerDelegate,UITextViewDelegate{
var delegate:XiaDanUserInfoViewControllerDelegate?
@IBOutlet weak var messageCountLbl: UILabel!
@IBOutlet weak var messageTV: UITextView!
@IBOutlet weak var userPhoneTF: UITextField!
......@@ -24,9 +26,14 @@ class XiaDanUserInfoViewController: BaseViewController , CNContactPickerDelegate
self.view.addSubview(navbar)
SetTopFrame(view: contentV, height: 370)
messageTV.delegate = self
}
orderTimeLbl.text = getTimeNow()
}
@IBAction func gotoPhoneAccoutAction(_ sender: UIButton) {
print("gotoPhoneAccoutAction-获取通讯录")
//联系人选择控制器
......@@ -36,6 +43,9 @@ class XiaDanUserInfoViewController: BaseViewController , CNContactPickerDelegate
//弹出控制器
self.present(contactPicker, animated: true, completion: nil)
}
//单选联系人
func contactPicker(_ picker: CNContactPickerViewController,
didSelect contact: CNContact) {
......@@ -60,8 +70,13 @@ class XiaDanUserInfoViewController: BaseViewController , CNContactPickerDelegate
}
@IBAction func sureUserInfoAction(_ sender: LGButton) {
if userPhoneTF.text!.count == 0 || userPhoneTF.text!.count == 0 {
HUD.flash(.label("请填写联系人及联系电话"), delay: 1.2)
return
}
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 {
messageCountLbl.text = "(\(textView.text.count)/200)"
......@@ -79,5 +94,6 @@ class XiaDanUserInfoViewController: BaseViewController , CNContactPickerDelegate
}
}
}
}
<?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"/>
<dependencies>
<deployment identifier="iOS"/>
......@@ -99,6 +99,9 @@
<color key="textColor" name="灰色字体颜色"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<textInputTraits key="textInputTraits"/>
<connections>
<outlet property="delegate" destination="-1" id="5Ta-pi-xhC"/>
</connections>
</textField>
<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"/>
......@@ -108,6 +111,9 @@
<color key="textColor" name="灰色字体颜色"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<textInputTraits key="textInputTraits"/>
<connections>
<outlet property="delegate" destination="-1" id="791-qA-fh2"/>
</connections>
</textField>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="rDc-7c-CwA">
<rect key="frame" x="0.0" y="180.5" width="414" height="5"/>
......@@ -133,6 +139,9 @@
<real key="value" value="5"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<outlet property="delegate" destination="-1" id="JPC-08-MGX"/>
</connections>
</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">
<rect key="frame" x="80" y="206" width="39.5" height="15.5"/>
......
......@@ -23,7 +23,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
var tempLat:CLLocationDegrees = 0
var tempLng:CLLocationDegrees = 0
var tempCityName = ""
var detailAdrStr = ""
@objc func backToCurrentLoc(_ sender: Any) {
print("返回当前位置")
......@@ -76,7 +76,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
return historyArr.count
}
var delegate:ToAndFormSelectViewControllerDelegate?
var dict:Dictionary<String,Any> = Dictionary()
let UserToken = UserDefaults.standard.value(forKey: "user_token")
var loc:cityListDataModel!
var nameStr = ""
......@@ -316,15 +316,18 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
print("sureSelectAddressAction")
if adrDatas!.count > 0 {
for item in adrDatas! {
if cityName.contains(item.name!) {
print("cityNmae = ",cityName,item.name)
if specRecord.contains(item.name!) {
adrData = item
print("test result == ",adrData?.city_id)
}
}
var dict:Dictionary<String,Any> = Dictionary()
dict["menPai"] = addressDetailTF.text
dict["shouHuoRen"] = nameTF.text
dict["phoneNum"] = phoneTF.text
dict["adr"] = adrData
dict["detailAdr"] = detailAdrStr
if locName.count > 0 {
dict["locName"] = titleLbl!.text
var sr_type = 1
......@@ -357,9 +360,10 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
"contact_phone_no": phoneTF.text as Any,
"sr_type":sr_type as Any
]
print("dic == ",dict)
HUD.flash(.progress)
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)
}) { (err) in
......@@ -381,6 +385,10 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
var detailAdr:String = ""
var moveAdrName = ""
var isMove = false
var specRecord = ""
func onPOISearchDone(_ request: AMapPOISearchBaseRequest!, response: AMapPOISearchResponse!) {
if response.count == 0 {
......@@ -423,6 +431,8 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
if loc == nil {
citySelectBtn.setTitle(cityName as String, for: .normal)
}
specRecord = cityName as String + (response.pois.first?.district)!
//通过富文本来设置行间距
let paraph = NSMutableParagraphStyle()
//将行间距设置为28
......@@ -433,7 +443,6 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
city = response.pois.first!.city
ad = response.pois.first?.address as! String
districet = response.pois.first?.district as! String
moveAdrName = response.pois.first?.name as! String
if adrName.count > 0 {
......@@ -442,6 +451,7 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
titleLbl!.text = adrName
str = detailAdr
}
detailAdrStr = "\(city)_\(districet)_\(ad)_\(titleLbl!.text)"
let attributes = [NSAttributedString.Key.font:UIFont.systemFont(ofSize: 11),
NSAttributedString.Key.paragraphStyle: paraph]
......
......@@ -9,15 +9,24 @@
import UIKit
class LogisticsCostDetailViewController: BaseViewController {
var model:orderPriceCalculateModel?
// var carModel:vehicle_arr_data?
@IBOutlet weak var lineView: UIView!
@IBOutlet weak var contentV: UIView!
@IBOutlet weak var priceLbl: UILabel!
@IBOutlet weak var roadKM: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
navbar.title = "费用明细"
self.view.addSubview(navbar)
priceLbl.text = "\(model!.data!.total_price_fen!/100)"
roadKM.text = "(总里程\(model!.data!.distance_total!)公里)"
SetTopFrameView(view: contentV, btmView: self.view)
setCostDetailView()
......@@ -47,8 +56,42 @@ class LogisticsCostDetailViewController: BaseViewController {
make.top.equalTo(lineView.snp_bottom).offset(30)
}
leftLbl.text = "起步价(小面包车)"
rightLbl.text = "¥4548.8"
leftLbl.text = "起步价(\(model!.data!.order_vehicle_name!))"
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"?>
<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"/>
<dependencies>
<deployment identifier="iOS"/>
......@@ -13,6 +13,8 @@
<connections>
<outlet property="contentV" destination="e3L-UF-DVw" id="1NT-my-Rg0"/>
<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"/>
</connections>
</placeholder>
......@@ -24,19 +26,19 @@
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="e3L-UF-DVw">
<rect key="frame" x="0.0" y="44" width="414" height="852"/>
<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">
<rect key="frame" x="108.5" y="52" width="98.5" height="42"/>
<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="170.5" y="52" width="36.5" height="42"/>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="30"/>
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
</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">
<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"/>
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
</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"/>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="15"/>
<color key="textColor" name="标题字颜色"/>
......
......@@ -12,10 +12,12 @@ import SDWebImage
protocol HLLTopCellDelegate {
func HLLTopCellBtnClick(idx:Int)
func HLLTopCellScrollIdx(idx:Int)
// func HLLTopCellOtherClick(isSelect:Bool)
}
class HLLTopCell: UITableViewCell,UIScrollViewDelegate {
var idx = 0
var delegate:HLLTopCellDelegate?
@IBAction func btnClick(_ sender: UIButton) {
leftBtn.isHidden = false
rightBtn.isHidden = false
......@@ -53,6 +55,12 @@ class HLLTopCell: UITableViewCell,UIScrollViewDelegate {
}
}
@IBOutlet weak var btnView: UIView!
@objc func otherClick(_ sender: UIButton) {
print("abc")
}
func scrollViewDidScroll(_ scrollView: UIScrollView) {
leftBtn.isHidden = false
rightBtn.isHidden = false
......@@ -110,10 +118,9 @@ class HLLTopCell: UITableViewCell,UIScrollViewDelegate {
self.selectionStyle = .none
}
override func layoutIfNeeded() {
super.layoutIfNeeded()
if scrollView == nil {
scrollView = UIScrollView(frame: scViewBg.bounds)
scViewBg.addSubview(scrollView!)
......
......@@ -19,7 +19,7 @@
<autoresizingMask key="autoresizingMask"/>
<subviews>
<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>
<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"/>
......@@ -73,7 +73,7 @@
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<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="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"/>
......
//
// 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 @@
import UIKit
import LGButton
protocol OtherDemandViewControllerDelegate {
func OtherDemandViewControllerResult(strs:Array<spec_req_arr_data>,selectArr:Array<Int>)
}
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 listView: UITableView!
var carModel:cityCartDataModel?
override func 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 = "额外需求"
self.view.addSubview(navbar)
SetTopFrameView(view: listView, btmView: sureBtn)
listView.separatorStyle = .none
listView.register(UINib(nibName: "TitleAndSelectCell", bundle: nil), forCellReuseIdentifier: "TitleAndSelectCell")
}
var selectArr:Array<Int> = []
@IBAction func sureDemandAction(_ sender: LGButton) {
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) {
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 {
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 {
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndSelectCell") as! TitleAndSelectCell
if indexPath.row == 0 {
cell.line.isHidden = true
let data = (carModel?.spec_req_arr![indexPath.row])
cell.titleLbl.text = data?.name
cell.tag = indexPath.row
if cell.tag == selectArr[indexPath.row] {
cell.selectBtn.isSelected = true
}else{
cell.line.isHidden = false
cell.selectBtn.isSelected = false
}
return cell
......@@ -76,41 +110,10 @@ class OtherDemandViewController: BaseViewController ,UITableViewDelegate,UITable
make.bottom.equalTo(-5)
}
lbl.text = "其它服务"
lblFU.text = "(多选)"
if section == 0 {
lbl.text = "搬运服务"
lblFU.text = ""
}else{
lbl.text = "其它服务"
lblFU.text = "(多选)"
}
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