Commit 4a0f8916 authored by lujunye's avatar lujunye

货物保障

parent df480168
...@@ -30,6 +30,7 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA ...@@ -30,6 +30,7 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA
func sureGeliAlertViewAction(sender: UIButton) { func sureGeliAlertViewAction(sender: UIButton) {
delegate?.GLAlertSelectViewFinish?(sender:sender,title: ysyfTitle,cellTag: cellTag!) delegate?.GLAlertSelectViewFinish?(sender:sender,title: ysyfTitle,cellTag: cellTag!)
} }
var isBz = false
var isNonSelect = false { var isNonSelect = false {
didSet { didSet {
...@@ -206,6 +207,15 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA ...@@ -206,6 +207,15 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA
} }
let cell = tableView.cellForRow(at: indexPath) as! TitleAndSelectCell let cell = tableView.cellForRow(at: indexPath) as! TitleAndSelectCell
if isMultipleS == false { if isMultipleS == false {
if isBz {
if selectNum == cell.tag {
selectNum = 10086
}else{
selectNum = cell.tag
}
}else{
if isNonSelect { if isNonSelect {
if selectNum != 0 { if selectNum != 0 {
if cell.tag != 0 { if cell.tag != 0 {
...@@ -217,6 +227,7 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA ...@@ -217,6 +227,7 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA
}else{ }else{
selectNum = cell.tag selectNum = cell.tag
} }
}
}else{ }else{
if isShangPinType { if isShangPinType {
if cell.tag == 0 { if cell.tag == 0 {
......
...@@ -12,7 +12,7 @@ import MAMapKit ...@@ -12,7 +12,7 @@ import MAMapKit
import SwiftyJSON import SwiftyJSON
import SwiftDate import SwiftDate
class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,JiTuoWuXinXiViewDelegate,JiPaiFangShiViewControllerDelegate,ZengZhiServicesViewControllerDelegate,AdressSelectCellDelegate,DZGLViewControllerDelegate,XinZengDiZhiViewControllerDelegate,TitleAndTFBtnCellDelegate,WenDuCellDelegate,LogisticalSelectViewDelegate, UIPickerViewDataSource, UIPickerViewDelegate{ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,JiTuoWuXinXiViewDelegate,JiPaiFangShiViewControllerDelegate,ZengZhiServicesViewControllerDelegate,AdressSelectCellDelegate,DZGLViewControllerDelegate,XinZengDiZhiViewControllerDelegate,TitleAndTFBtnCellDelegate,WenDuCellDelegate,LogisticalSelectViewDelegate, UIPickerViewDataSource, UIPickerViewDelegate, GLAlertSelectViewDelegate{
//时间选择背景 //时间选择背景
var bgBtn:UIButton? var bgBtn:UIButton?
...@@ -373,6 +373,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -373,6 +373,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
} }
let hPart2 = ["请选择用车时间","下单联系人信息","额外需求","货物保障"] let hPart2 = ["请选择用车时间","下单联系人信息","额外需求","货物保障"]
var hPart2P = ["","","",""]
let hPart3 = ["关联平台:","关联订单号:"] let hPart3 = ["关联平台:","关联订单号:"]
var isSelectPoripl = false var isSelectPoripl = false
@objc func selectBtnClick(sender:UIButton){ @objc func selectBtnClick(sender:UIButton){
...@@ -538,7 +539,8 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -538,7 +539,8 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
} }
} }
var bzIdx = 10086
var bzArr = ["0元最高保5万","3元最高保10万","4元最高保20万","6元最高保30万","10元最高保50万","40元最高保100万","100元最高保200万"]
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if tableView == listView { if tableView == listView {
if indexPath.section == 1 { if indexPath.section == 1 {
...@@ -589,6 +591,23 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -589,6 +591,23 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
print(indexPath.section,indexPath.row) print(indexPath.section,indexPath.row)
if indexPath.section == 2 { if indexPath.section == 2 {
//保障
if indexPath.row == 3 {
if glSelectView == nil {
let view = GLAlertSelectView(frame: self.view.bounds)
view.delegate = self
view.isBz = true
if bzIdx != 10086 {
view.selectNum = bzIdx
view.tempNum = view.selectNum
}
view.titleLbl.text = "货物保障"
view.dataArr = bzArr
self.view.addSubview(view)
glSelectView = view
}
}
//时间
if indexPath.row == 0 { if indexPath.row == 0 {
if bgBtn == nil { if bgBtn == nil {
let btn = UIButton() let btn = UIButton()
...@@ -618,7 +637,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -618,7 +637,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
} }
} }
} }
var glSelectView:GLAlertSelectView?
@objc func closeAc(){ @objc func closeAc(){
bgBtn?.removeFromSuperview() bgBtn?.removeFromSuperview()
...@@ -790,6 +809,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -790,6 +809,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndBtnCell") as! TitleAndBtnCell let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndBtnCell") as! TitleAndBtnCell
cell.btn.isUserInteractionEnabled = false cell.btn.isUserInteractionEnabled = false
cell.nameLbl.text = hPart2[indexPath.row] cell.nameLbl.text = hPart2[indexPath.row]
cell.contentLbl.text = hPart2P[indexPath.row]
return cell return cell
} }
if indexPath.section == 4 { if indexPath.section == 4 {
...@@ -1287,4 +1307,22 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -1287,4 +1307,22 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
} }
} }
} }
func GLASClose(view: GLAlertSelectView, selectnum: Int, selectArr: Array<Int>) {
bzIdx = selectnum
view.removeFromSuperview()
glSelectView = nil
}
func GLAlertSelectViewClick(selectNum: Int, view: GLAlertSelectView) {
bzIdx = selectNum
if bzIdx != 10086 {
hPart2P.insert(bzArr[bzIdx], at: 3)
hPart2P.remove(at: 4)
hListView.reloadData()
}
view.removeFromSuperview()
glSelectView = nil
}
} }
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