Commit 344cc73f authored by 刘俊宏's avatar 刘俊宏

完成普通下运单流程

parent e3c17213
......@@ -199,7 +199,7 @@
<key>下单期望上门时间</key>
<string>Logistics/appointmentTime</string>
<key>物流费用预估</key>
<string>register</string>
<string>Logistics/estimatedCost</string>
<key>运单详情</key>
<string>Logistics/logisticsOrderDetails</string>
<key>拒绝退款</key>
......@@ -222,5 +222,7 @@
<string>Goods/onOff</string>
<key>下运单收发地址信息</key>
<string>Logistics/getAddr</string>
<key>提交运单</key>
<string>Logistics/addLogisticsOrder</string>
</dict>
</plist>
......@@ -135,7 +135,7 @@ class registerModel: Mappable {
}
}
class registerDataModel: Mappable {
var price_jd:Int?
var price_jd:String?
var price_sf : String?
required init?( map: Map) {
......@@ -407,4 +407,30 @@ class logisticsOrderDetailsDataModel: Mappable {
site_delivery_cn <- map["site_delivery_cn"]
fc_flag_cn <- map["fc_flag_cn"]
}
}
//MARK: - 提交运单
class AddLogisticsOrderModel: Mappable {
var code:Int?
var message : String?
var data :AddLogisticsDataModel?
required init?( map: Map) {
}
func mapping(map: Map) {
code <- map["code"]
message <- map["message"]
data <- map["data"]
}
}
class AddLogisticsDataModel: Mappable {
var id:String?
required init?( map: Map) {
}
func mapping(map: Map) {
id <- map["id"]
}
}
......@@ -57,9 +57,9 @@ func appointmentTime(_ params:[String:Any],success:@escaping (_ res:Any)->(),fai
}
//MARK:-- 物流费用预估
/*
user_token 验证token
user_token 验证token s_city r_city weight volume
*/
func register(_ params:[String:Any],success:@escaping (_ res:Any)->(),failture:@escaping(_ error:Error)->()) {
func estimatedCost(_ params:[String:Any],success:@escaping (_ res:Any)->(),failture:@escaping(_ error:Error)->()) {
NetworkRequest.sharedInstance.postRequest("物流费用预估", params, { (rep:DataResponse<registerModel>) in
}, success: { (data) in
success(data)
......@@ -94,3 +94,15 @@ func getAddr(_ params:[String:Any],success:@escaping (_ res:Any)->(),failture:@e
failture(error)
}
}
//MARK:-- 提交运单
/*
user_token 验证token
*/
func addLogisticsOrder(_ params:[String:Any],success:@escaping (_ res:Any)->(),failture:@escaping(_ error:Error)->()) {
NetworkRequest.sharedInstance.postRequest("提交运单", params, { (rep:DataResponse<AddLogisticsOrderModel>) in
}, success: { (data) in
success(data)
}) { (error) in
failture(error)
}
}
......@@ -38,6 +38,9 @@ class GetAddrsInfoDataModel: Mappable {
var is_default:Int?
var addr_cn:String? //联系人详细地址
var addr_name:String? ////完整地址信息(下单收发货才有)
var province_cn:String?
var city_cn:String?
var district_cn:String?
required init?( map: Map) {
......@@ -55,6 +58,9 @@ class GetAddrsInfoDataModel: Mappable {
is_default <- map["is_default"]
addr_cn <- map["addr_cn"]
addr_name <- map["addr_name"]
province_cn <- map["province_cn"]
city_cn <- map["city_cn"]
district_cn <- map["district_cn"]
}
}
......@@ -8,17 +8,29 @@
import UIKit
class TitleAndTFBtnCell: UITableViewCell {
protocol TitleAndTFBtnCellDelegate {
func TitleAndTFBtnCellEndEdit(contentStr:String,cellTag:Int)
}
class TitleAndTFBtnCell: UITableViewCell,UITextFieldDelegate {
var delegate:TitleAndTFBtnCellDelegate?
@IBOutlet weak var contentTf: UITextField!
@IBOutlet weak var nameLbl: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
self.selectionStyle = .none
contentTf.delegate = self
// Initialization code
}
func textFieldDidEndEditing(_ textField: UITextField) {
delegate?.TitleAndTFBtnCellEndEdit(contentStr: textField.text!,cellTag: self.tag)
}
@IBAction func eidtAction(_ sender: Any) {
contentTf.becomeFirstResponder()
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
......
<?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">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
......@@ -40,6 +40,9 @@
<state key="normal" title="编辑">
<color key="titleColor" name="蓝色字体颜色"/>
</state>
<connections>
<action selector="eidtAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="5St-2L-LDo"/>
</connections>
</button>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="bnV-l5-VU7">
<rect key="frame" x="58" y="0.0" width="197" height="43"/>
......
......@@ -8,14 +8,21 @@
import UIKit
protocol WenDuCellDelegate {
func WenDuCellSelect(index:Int)
}
class WenDuCell: UITableViewCell {
var delegate:WenDuCellDelegate?
@IBAction func selectAction(_ sender: UIButton) {
if sender == rightBtn {
if rightBtn.isSelected == true {
rightBtn.isSelected = false
rightBtn.backgroundColor = UIColor.clear
rightBtn.layer.borderWidth = 1
delegate?.WenDuCellSelect(index: 0)
}else{
leftBtn.backgroundColor = UIColor.clear
leftBtn.isSelected = false
......@@ -24,12 +31,17 @@ class WenDuCell: UITableViewCell {
rightBtn.isSelected = true
rightBtn.backgroundColor = UIColor(named: "蓝色字体颜色")
rightBtn.layer.borderWidth = 0
delegate?.WenDuCellSelect(index: 1)
}
}else{
if leftBtn.isSelected == true {
leftBtn.isSelected = false
leftBtn.backgroundColor = UIColor.clear
leftBtn.layer.borderWidth = 1
delegate?.WenDuCellSelect(index: 0)
}else{
leftBtn.isSelected = true
leftBtn.backgroundColor = UIColor(named: "蓝色字体颜色")
......@@ -38,6 +50,9 @@ class WenDuCell: UITableViewCell {
rightBtn.isSelected = false
rightBtn.backgroundColor = UIColor.clear
rightBtn.layer.borderWidth = 1
delegate?.WenDuCellSelect(index: 2)
}
}
}
......
<?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">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
......
......@@ -9,17 +9,33 @@
import Foundation
import LGButton
protocol LogisticalSelectViewDelegate {
func LogisticalSelectViewSure(index:Int)
}
class LogisticalSelectView: UIView {
var delegate:LogisticalSelectViewDelegate?
@IBOutlet weak var jdSelectBtn: UIButton!
@IBOutlet weak var sfSelectBtn: UIButton!
@IBAction func blackAction(_ sender: Any) {
self.removeFromSuperview()
}
@IBOutlet weak var sfPriceLbl: UILabel!
@IBOutlet weak var jdPriceLbl: UILabel!
@IBAction func xiadanAction(_ sender: Any) {
self.removeFromSuperview()
print("xiadanAction")
if jdSelectBtn.isSelected || sfSelectBtn.isSelected {
if jdSelectBtn.isSelected {
delegate?.LogisticalSelectViewSure(index: 1)
}else if sfSelectBtn.isSelected {
delegate?.LogisticalSelectViewSure(index: 2)
}
self.removeFromSuperview()
print("xiadanAction")
}else{
HUD.flash(.label("请选择下单物流"),delay: 1.2)
}
}
......
......@@ -11,7 +11,9 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="LogisticalSelectView">
<connections>
<outlet property="jdPriceLbl" destination="NjJ-Ja-GKH" id="Gxb-tF-ubD"/>
<outlet property="jdSelectBtn" destination="5iJ-FB-kNk" id="EZu-xj-5I9"/>
<outlet property="sfPriceLbl" destination="wwr-FR-oJl" id="B1O-wO-mD7"/>
<outlet property="sfSelectBtn" destination="4U6-AL-8Yv" id="bsK-dU-3Nn"/>
</connections>
</placeholder>
......@@ -76,8 +78,8 @@
<action selector="selectTheLogisticalAction:" destination="-1" eventType="touchUpInside" id="qLk-Ar-qNe"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="京东冷运(预估运费2655元)" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="NjJ-Ja-GKH">
<rect key="frame" x="49" y="66" width="175" height="19"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="京东冷运(预估运费-元)" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="NjJ-Ja-GKH">
<rect key="frame" x="49" y="66" width="151" height="19"/>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="13"/>
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
......
......@@ -10,7 +10,7 @@ import UIKit
class XiaDanChengGongViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource {
var orderID:String?
@IBOutlet weak var listView: UITableView!
override func viewDidLoad() {
......
......@@ -9,7 +9,7 @@
import UIKit
protocol JiTuoWuXinXiViewDelegate {
func JiTuoWuXinXiViewClose()
func JiTuoWuXinXiViewSubmit(itemName:String,tiJi:Float,weight:Float,count:Int,isCheck:Bool)
func JiTuoWuXinXiViewSubmit(itemName:String,tiJi:Float,weight:Float,count:Int,isCheck:Bool,chang:String?,kuang:String?,gao:String?)
}
class JiTuoWuXinXiView: UIView,UITextFieldDelegate{
var contentView:UIView!
......@@ -82,7 +82,7 @@ class JiTuoWuXinXiView: UIView,UITextFieldDelegate{
let tiji = tiJiTF.text as! NSString
let weight = weightTf.text as! NSString
let count = countTf.text as! NSString
delegate?.JiTuoWuXinXiViewSubmit(itemName: itemNameTF.text!, tiJi: tiji.floatValue, weight: weight.floatValue, count: count.integerValue, isCheck: infoSw.isOn)
delegate?.JiTuoWuXinXiViewSubmit(itemName: itemNameTF.text!, tiJi: tiji.floatValue, weight: weight.floatValue, count: count.integerValue, isCheck: infoSw.isOn,chang: changTf.text,kuang: kuanTf.text,gao: gaoTf.text)
}
@IBOutlet weak var tiJiTF: UITextField!
@IBOutlet weak var itemNameTF: UITextField!
......
<?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">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
......@@ -418,7 +418,7 @@
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Trf-1A-2UZ">
<rect key="frame" x="0.0" y="275" width="414" height="43"/>
<subviews>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="n6W-Cn-03r">
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="n6W-Cn-03r">
<rect key="frame" x="350" y="6" width="51" height="31"/>
<color key="onTintColor" name="按钮渐变色下,字体颜色"/>
</switch>
......@@ -527,7 +527,7 @@
<constraint firstItem="rW2-Ka-gAx" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="x4f-1E-FoH"/>
</constraints>
<viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
<point key="canvasLocation" x="131.8840579710145" y="121.875"/>
<point key="canvasLocation" x="-210" y="121"/>
</view>
</objects>
<resources>
......
<?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">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_5" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
......@@ -112,10 +112,9 @@
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="¥420" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TJP-xc-KTh">
<rect key="frame" x="58" y="6.6666666666666288" width="50" height="18.333333333333332"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="-" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TJP-xc-KTh">
<rect key="frame" x="58" y="6.6666666666666288" width="7" height="18.333333333333332"/>
<constraints>
<constraint firstAttribute="width" constant="50" id="XAJ-Gz-OGa"/>
<constraint firstAttribute="height" constant="18.5" id="eTp-WI-Bwg"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
......
......@@ -13,7 +13,7 @@ protocol DZGLViewControllerDelegate {
func DZGLViewControllerSelect(data:GetAddrsInfoDataModel)
}
class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,SwipeTableViewCellDelegate,UISearchBarDelegate,SearchBarViewDelegate,XinZengDiZhiViewControllerDelegate,GeliAlertViewDelegate{
func XinZengDiZhiViewControllerFinishAction(name: String, phone: String, adr: String, data: AddAddressDataModel?) {
func XinZengDiZhiViewControllerFinishAction(name: String, phone: String, adr: String, data: AddAddressDataModel?,province_name:String,city_name:String,district_name:String) {
listView.mj_header?.beginRefreshing()
}
......@@ -227,7 +227,8 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData
cell.nameLbl.text = model?.consignee
cell.phoneLbl.text = model?.mobile
cell.adrLbl.text = model?.addr_name
cell.btn.isSelected = false
if isSelectMotion == false {
cell.btnH.constant = 0
cell.xValue.constant = 0
......@@ -242,7 +243,7 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData
cell.nameLbl.text = model?.consignee
cell.phoneLbl.text = model?.mobile
cell.adrLbl.text = model?.addr_cn
cell.btn.isSelected = false
if isSelectMotion == false {
cell.btnH.constant = 0
cell.xValue.constant = 0
......
......@@ -9,7 +9,7 @@
import UIKit
import SwiftyJSON
protocol XinZengDiZhiViewControllerDelegate {
func XinZengDiZhiViewControllerFinishAction(name:String,phone:String,adr:String, data: AddAddressDataModel?)
func XinZengDiZhiViewControllerFinishAction(name:String,phone:String,adr:String, data: AddAddressDataModel?,province_name:String,city_name:String,district_name:String)
}
class XinZengDiZhiViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,TitleAndTFAndBtnCellDelegate, UIPickerViewDelegate, UIPickerViewDataSource,SJMapViewControllerDelegate,UITextFieldDelegate,TitleAndSwitchCellDelegate,GeliAlertViewDelegate{
var address_id:Int?
......@@ -18,7 +18,7 @@ class XinZengDiZhiViewController: BaseViewController,UITableViewDelegate,UITable
if sender.tag == 999 {
AddressDel(["user_token":UserToken as Any,"address_id":address_id as Any], success: { (data) in
self.delegate?.XinZengDiZhiViewControllerFinishAction(name: self.nameStr, phone: self.phone, adr: self.adrStr, data: nil)
self.delegate?.XinZengDiZhiViewControllerFinishAction(name: self.nameStr, phone: self.phone, adr: self.adrStr, data: nil,province_name:"",city_name:"",district_name:"")
self.navigationController?.popViewController(animated: true)
}) { (error) in
......@@ -32,6 +32,9 @@ class XinZengDiZhiViewController: BaseViewController,UITableViewDelegate,UITable
var areaDict:Dictionary<String,Any> = Dictionary()
cityDict["area_id"] = ""
areaDict["area_id"] = ""
cityDict["area_name"] = ""
areaDict["area_name"] = ""
if (proDict["city_list"] as! NSArray).count > 0 {
cityDict = (proDict["city_list"] as! NSArray)[cityIndex] as! Dictionary<String, Any>
if (cityDict["district_list"] as! NSArray).count > 0 {
......@@ -64,7 +67,7 @@ class XinZengDiZhiViewController: BaseViewController,UITableViewDelegate,UITable
"is_send_default":send_default as Any,
]
EditAddress(dict, success: { (data) in
self.delegate?.XinZengDiZhiViewControllerFinishAction(name: self.nameStr, phone: self.phone, adr: self.adrStr, data: nil)
self.delegate?.XinZengDiZhiViewControllerFinishAction(name: self.nameStr, phone: self.phone, adr: self.adrStr, data: nil,province_name:"",city_name:"",district_name:"")
self.navigationController?.popViewController(animated: true)
HUD.hide()
}) { (error) in
......@@ -88,7 +91,7 @@ class XinZengDiZhiViewController: BaseViewController,UITableViewDelegate,UITable
]
AddAddress(dict, success: { (data) in
let dataModel = data as! AddAddressModel
self.delegate?.XinZengDiZhiViewControllerFinishAction(name: self.nameStr, phone: self.phone, adr: self.adrStr, data: dataModel.data)
self.delegate?.XinZengDiZhiViewControllerFinishAction(name: self.nameStr, phone: self.phone, adr: self.adrStr, data: dataModel.data,province_name:proDict["area_name"] as! String,city_name:cityDict["area_name"] as! String,district_name:areaDict["area_name"] as! String)
self.navigationController?.popViewController(animated: true)
HUD.hide()
}) { (error) in
......
......@@ -10,7 +10,7 @@ import UIKit
protocol ZengZhiServicesViewControllerDelegate {
func ZengZhiServicesViewControllerFinish(price:Float,content:String)
}
class ZengZhiServicesViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,TitleAndSelectCellDelegate,UITextViewDelegate{
class ZengZhiServicesViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,TitleAndSelectCellDelegate,UITextViewDelegate, UITextFieldDelegate{
var delegate:ZengZhiServicesViewControllerDelegate?
......@@ -18,11 +18,16 @@ class ZengZhiServicesViewController: BaseViewController,UITableViewDelegate,UITa
@IBAction func submitAction(_ sender: Any) {
print("submit")
if price.count == 0 {
HUD.flash(.label("请输入价金额"), delay: 1.2)
HUD.flash(.label("请输入价金额"), delay: 1.2)
return
}
let str = price as NSString
if str.floatValue > 200000.00 {
HUD.flash(.label("保价金额超出范围"), delay: 1.2)
return
}
delegate?.ZengZhiServicesViewControllerFinish(price:str.floatValue, content: commend)
self.navigationController?.popViewController(animated: true)
......@@ -61,8 +66,27 @@ class ZengZhiServicesViewController: BaseViewController,UITableViewDelegate,UITa
listView.register(UINib(nibName: "TitleAndSelectCell", bundle: nil), forCellReuseIdentifier: "TitleAndSelect")
textView.delegate = self
textView.text = commend
if commend.count > 0 {
textViewHolderLbl.isHidden = true
}
inputTF.addTarget(self, action: #selector(textViewEdit(sender:)), for: .allEditingEvents)
inputTF.text = price
if price.count > 0 {
holderLbl.isHidden = true
let inpuStr = inputTF.text as! NSString
let pric = inpuStr.floatValue * 0.005
if pric > 10.0 {
priceLbl.text = String(format: "%.2f", (pric))
}else {
if pric > 0.0 {
priceLbl.text = "10.0"
}else {
priceLbl.text = "-"
}
}
}
switch fanHuanIdx {
case 0:
nSet()
......@@ -74,6 +98,7 @@ class ZengZhiServicesViewController: BaseViewController,UITableViewDelegate,UITa
eSet()
break
}
inputTF.delegate = self
// Do any additional setup after loading the view.
}
......@@ -99,12 +124,19 @@ class ZengZhiServicesViewController: BaseViewController,UITableViewDelegate,UITa
return cell
}
func textViewDidChange(_ textView: UITextView) {
commend = textView.text
if textView.text.count != 0 {
textViewHolderLbl.isHidden = true
}else{
textViewHolderLbl.isHidden = false
}
if textView.markedTextRange == nil {
if textView.text.count > 50 {
textView.text = textView.text.subString(start: 0, length: 50)
}
}
commend = textView.text
}
func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool {
countingLbl.text = "\(textView.text.count)/50"
......@@ -124,6 +156,21 @@ class ZengZhiServicesViewController: BaseViewController,UITableViewDelegate,UITa
}
}
func textFieldDidChangeSelection(_ textField: UITextField) {
let inpuStr = inputTF.text as! NSString
let pric = inpuStr.floatValue * 0.005
if pric > 10.0 {
priceLbl.text = String(format: "%.2f", (pric))
}else {
if pric > 0.0 {
priceLbl.text = "10.0"
}else {
priceLbl.text = "-"
}
}
}
func nSet(){
pBtn.backgroundColor = UIColor.clear
pBtn.isSelected = false
......
......@@ -112,7 +112,7 @@
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="请输入报价金额0~30000" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="B5c-XR-qp5">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="请输入保价金额0-200000" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="B5c-XR-qp5">
<rect key="frame" x="10" y="0.0" width="263" height="30"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" name="灰色字体颜色"/>
......@@ -146,17 +146,16 @@
</userDefinedRuntimeAttributes>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="一" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Fzo-B3-gMd">
<rect key="frame" x="381" y="106" width="18" height="21"/>
<rect key="frame" x="385" y="106" width="14" height="21"/>
<constraints>
<constraint firstAttribute="width" constant="18" id="Aza-LZ-V0M"/>
<constraint firstAttribute="height" constant="21" id="C9s-un-cGd"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="13"/>
<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="FxE-Ch-Fg9">
<rect key="frame" x="341" y="108.5" width="40" height="16"/>
<rect key="frame" x="345" y="108.5" width="40" height="16"/>
<constraints>
<constraint firstAttribute="height" constant="16" id="cbd-o5-Pa6"/>
<constraint firstAttribute="width" constant="40" id="gRD-Ca-Wxm"/>
......
......@@ -35,7 +35,7 @@ class JiPaiFangShiViewController: BaseViewController ,SendTimeSelectViewDeleagte
if PLeftBtn.isSelected == false {
receive = 1
}
delegate?.JiPaiFangShiViewControllerDelegateFinish(send: send, receive: receive, pickup_time: "8-10" , day: 0)
delegate?.JiPaiFangShiViewControllerDelegateFinish(send: send, receive: receive, pickup_time: self.pickup_time! , day: self.day!)
self.navigationController?.popViewController(animated: true)
}
@IBOutlet weak var topView: UIView!
......@@ -75,39 +75,76 @@ class JiPaiFangShiViewController: BaseViewController ,SendTimeSelectViewDeleagte
make.right.equalTo(-15)
make.height.equalTo(55)
}
let UserToken = UserDefaults.standard.value(forKey: "user_token")
appointmentTime(["user_token":UserToken as Any], success: { (data) in
let dataModel = data as! appointmentTimeModel
self.timeData = dataModel.data
//需要修改-放上个vc
if dataModel.data?.today == nil {
if self.timeData != nil {
switch self.day {
case 0:
let keys = self.timeData?.today?.keys
let keysArr = keys?.sorted(by: { (str1, str2) -> Bool in
let num1 = str1 as NSString
let num2 = str2 as NSString
return num1.integerValue < num2.integerValue ? true : false
})
for i in 0..<keysArr!.count {
let rightIndexKey = keysArr![i]
let rightText = self.timeData?.today![rightIndexKey as! String]
if self.pickup_time == rightText! {
leftSelectIdx = 0
rightSelectIdx = i
self.timeLbl.text = "今天" + rightText!
}
}
let keys = dataModel.data?.tomorrow?.keys
case 1:
let keys = self.timeData?.tomorrow?.keys
let keysArr = keys?.sorted(by: { (str1, str2) -> Bool in
let num1 = str1 as NSString
let num2 = str2 as NSString
return num1.integerValue < num2.integerValue ? true : false
})
let rightIndexKey = keysArr![0]
let rightText = dataModel.data?.tomorrow![rightIndexKey as! String]
for i in 0..<keysArr!.count {
let rightIndexKey = keysArr![i]
let rightText = self.timeData?.tomorrow![rightIndexKey as! String]
if self.pickup_time == rightText! {
if self.timeData?.today != nil{
leftSelectIdx = 1
}else{
leftSelectIdx = 0
}
rightSelectIdx = i
self.timeLbl.text = "明天" + rightText!
}
}
case 2:
self.timeLbl.text = "明天" + rightText!
}else{
let keys = dataModel.data?.today?.keys
let keys = self.timeData?.taftert?.keys
let keysArr = keys?.sorted(by: { (str1, str2) -> Bool in
let num1 = str1 as NSString
let num2 = str2 as NSString
return num1.integerValue < num2.integerValue ? true : false
})
let rightIndexKey = keysArr![0]
let rightText = dataModel.data?.tomorrow![rightIndexKey as! String]
self.timeLbl.text = "今天" + rightText!
for i in 0..<keysArr!.count {
let rightIndexKey = keysArr![i]
let rightText = self.timeData?.taftert![rightIndexKey as! String]
if self.pickup_time == rightText! {
if self.timeData?.today != nil{
leftSelectIdx = 2
}else{
leftSelectIdx = 1
}
rightSelectIdx = i
self.timeLbl.text = "后天" + rightText!
}
}
default:
break
}
}) { (error) in
}
}
func setYuanJiao(sender:UIView){
let maskPath = UIBezierPath(roundedRect: sender.bounds,
......
......@@ -15,7 +15,7 @@
<outlet property="JLeftBtn" destination="HSp-eJ-pG9" id="suW-JW-uqO"/>
<outlet property="JRightBtn" destination="7aa-WU-1Qb" id="14j-Ai-szJ"/>
<outlet property="PLBL" destination="Hgj-Lr-BmC" id="vkh-ax-rWE"/>
<outlet property="PLeftBtn" destination="GTQ-vx-5qB" id="eBT-aC-t85"/>
<outlet property="PLeftBtn" destination="GBL-MZ-sLn" id="sWh-v8-uaE"/>
<outlet property="PRightBtn" destination="Bh0-6K-n9j" id="Cmk-qJ-Rc9"/>
<outlet property="timeLbl" destination="DPN-ah-dAM" id="qrX-hO-U7t"/>
<outlet property="timeViewHeight" destination="1U5-hJ-N6K" id="cr2-sV-XIE"/>
......@@ -243,18 +243,18 @@
<action selector="sendAction:" destination="-1" eventType="touchUpInside" id="b2J-Y9-Md8"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="GTQ-vx-5qB">
<rect key="frame" x="210" y="15" width="72" height="27"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="GBL-MZ-sLn">
<rect key="frame" x="215" y="15" width="72" height="27"/>
<constraints>
<constraint firstAttribute="width" constant="72" id="f42-o5-2nK"/>
<constraint firstAttribute="height" constant="27" id="nwX-jN-fcs"/>
<constraint firstAttribute="height" constant="27" id="QIV-Ci-tEY"/>
<constraint firstAttribute="width" constant="72" id="epY-3u-AIV"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="tintColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<state key="normal" title="送货上门">
<color key="titleColor" name="灰色字体颜色"/>
</state>
<state key="selected" title="上门提货">
<state key="selected" title="送货上门">
<color key="titleColor" name="白色背景色"/>
</state>
<userDefinedRuntimeAttributes>
......@@ -269,15 +269,15 @@
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="sendAction:" destination="-1" eventType="touchUpInside" id="hWt-N2-04X"/>
<action selector="sendAction:" destination="-1" eventType="touchUpInside" id="sRA-WM-pOC"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="Bh0-6K-n9j" firstAttribute="leading" secondItem="GTQ-vx-5qB" secondAttribute="trailing" constant="15" id="46p-u3-3AE"/>
<constraint firstItem="Gcr-eI-ae4" firstAttribute="leading" secondItem="Hgj-Lr-BmC" secondAttribute="trailing" constant="10" id="9Ps-a3-KTs"/>
<constraint firstItem="GTQ-vx-5qB" firstAttribute="centerY" secondItem="Bh0-6K-n9j" secondAttribute="centerY" id="Xkn-Se-Kbd"/>
<constraint firstItem="Bh0-6K-n9j" firstAttribute="leading" secondItem="GBL-MZ-sLn" secondAttribute="trailing" constant="10" id="Qyh-qZ-1qf"/>
<constraint firstItem="GBL-MZ-sLn" firstAttribute="centerY" secondItem="Bh0-6K-n9j" secondAttribute="centerY" id="dLb-Cc-qVt"/>
<constraint firstItem="Bh0-6K-n9j" firstAttribute="centerY" secondItem="Ul1-px-ztN" secondAttribute="centerY" id="ipr-yd-9sZ"/>
<constraint firstItem="Hgj-Lr-BmC" firstAttribute="centerY" secondItem="Ul1-px-ztN" secondAttribute="centerY" id="jOD-qi-yZu"/>
<constraint firstItem="Hgj-Lr-BmC" firstAttribute="leading" secondItem="Ul1-px-ztN" secondAttribute="leading" id="nab-ys-0dO"/>
......
......@@ -81,7 +81,7 @@ class SendTimeSelectView: UIView,UITableViewDelegate,UITableViewDataSource {
break
}
delegate?.SendTimeSelectViewSubmit(day:"\(leftListArr[leftSelectIdx!]) ",time:rightText,leftSelectIdx:leftSelectIdx!,rightSelectIdx: rightSelectIdx! )
delegate?.SendTimeSelectViewSubmit(day:"\(leftListArr[leftSelectIdx!])",time:rightText,leftSelectIdx:leftSelectIdx!,rightSelectIdx: rightSelectIdx! )
}
@IBOutlet weak var rightListView: UITableView!
@IBOutlet weak var leftListView: UITableView!
......
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