Commit e190d86e authored by lujunye's avatar lujunye

代客下单逻辑补充

parent 20e6b0bd
......@@ -25,6 +25,9 @@ import IQKeyboardManagerSwift
}
class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleAndSelectCellDelegate,KuWeiCellCellDelegate,UITextFieldDelegate{
var deSelectArr:Array<Int> = []
var isMultipleS:Bool = false
var contentView:UIView!
var delegate:GLAlertSelectViewDelegate?
......@@ -175,12 +178,12 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA
cell.delegate = self
cell.tag = indexPath.row
let model = kuWeiArr[indexPath.row] as! ShopWarehouseDetailDataPositionModel
print("3",model.p_name)
cell.nameTF.text = model.p_name
cell.nameTF.delegate = self
cell.nameTF.isUserInteractionEnabled = false
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: "selectTbvCell") as! TitleAndSelectCell
cell.titleLbl.text = dataArr[indexPath.row] as! String
cell.delegate = self
......@@ -200,6 +203,15 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA
cell.selectBtn.isSelected = true
}
}
print("deSelectArr.count",deSelectArr.count)
if deSelectArr.count > 0 {
for i in deSelectArr {
if i == indexPath.row {
cell.titleLbl.textColor = UIColor(named: "灰色字体颜色")
cell.selectBtn.isUserInteractionEnabled = false
}
}
}
return cell
}
@IBAction func submitClick(_ sender: Any) {
......
......@@ -11,6 +11,8 @@ import UIKit
protocol XuanZeShangPinViewControllerDelegate {
func XuanZeShangPinViewControllerSubmitAction(datas:Array<Any>)
func XuanZeShangPinViewControllerYuShou(YuShouData:String)
func XuanZeShangPinViewControllerEdit(datas:Array<Any>)
}
class XuanZeShangPinViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,XuanZeShangPinCellDelegate,UISearchBarDelegate,SearchBarViewDelegate{
......@@ -21,14 +23,20 @@ class XuanZeShangPinViewController: BaseViewController,UITableViewDelegate,UITab
//XuanZeShangPinCell
@IBAction func submitAction(_ sender: Any) {
print("submit")
if barTitle == "修改价格"{
delegate?.XuanZeShangPinViewControllerEdit(datas:["返回","数据"])
}else{
if isYuShou {
delegate?.XuanZeShangPinViewControllerYuShou(YuShouData: "abc")
}else{
delegate?.XuanZeShangPinViewControllerSubmitAction(datas: selectIdxArr)
}
}
self.navigationController?.popViewController(animated: true)
}
var barTitle:String?//
@IBOutlet weak var btmLbl: UILabel!
@IBOutlet weak var listView: UITableView!
@IBOutlet weak var topView: UIView!
......@@ -40,7 +48,7 @@ class XuanZeShangPinViewController: BaseViewController,UITableViewDelegate,UITab
override func viewDidLoad() {
super.viewDidLoad()
navbar.title = "选择商品"
navbar.title = barTitle
self.view.addSubview(navbar)
listView.separatorStyle = .none
......@@ -80,31 +88,40 @@ class XuanZeShangPinViewController: BaseViewController,UITableViewDelegate,UITab
let cell = tableView.dequeueReusableCell(withIdentifier: "XuanZeShangPinCell") as! XuanZeShangPinCell
cell.delegate = self
cell.idx = indexPath
if isYuShou {//预售
if idx == indexPath {
cell.selectBtn.isSelected = true
cell.btmView.isHidden = false
cell.btmViewHeight.constant = 89
}else{
cell.selectBtn.isSelected = false
cell.btmView.isHidden = true
cell.btmViewHeight.constant = 0
}
}else{//非预售
cell.selectBtn.isSelected = false
cell.btmView.isHidden = true
cell.btmViewHeight.constant = 0
for idx in selectIdxArr {
if idx == indexPath{
if barTitle == "修改价格"{
cell.selectBtn.isHidden = true
cell.btmView.isHidden = false
cell.btmViewHeight.constant = 89
}else{
if isYuShou {//预售
if idx == indexPath {
cell.selectBtn.isSelected = true
cell.btmView.isHidden = false
cell.btmViewHeight.constant = 89
}else{
cell.selectBtn.isSelected = false
cell.btmView.isHidden = true
cell.btmViewHeight.constant = 0
}
}else{//非预售
cell.selectBtn.isSelected = false
cell.btmView.isHidden = true
cell.btmViewHeight.constant = 0
for idx in selectIdxArr {
if idx == indexPath{
cell.selectBtn.isSelected = true
cell.btmView.isHidden = false
cell.btmViewHeight.constant = 89
}
}
}
}
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if barTitle == "修改价格"{
return 210
}
if idx != nil {
if indexPath == idx {
return 210
......@@ -119,7 +136,7 @@ class XuanZeShangPinViewController: BaseViewController,UITableViewDelegate,UITab
}
//MARK: - SELF DELEGATE
func XuanZeShangPinCellBtnClick(index:IndexPath) {
if isYuShou{
......
......@@ -8,7 +8,7 @@
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="XuanZeShangPinViewController" customModule="GeliBusinessPlatform" customModuleProvider="target">
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="XuanZeShangPinViewController" customModule="TestClass" customModuleProvider="target">
<connections>
<outlet property="btmLbl" destination="5Kt-Ig-zbb" id="fUx-No-8SV"/>
<outlet property="listView" destination="YuT-X7-ecw" id="wKf-Ej-i9r"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<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" customClass="ChangeGoodsPriceVC" customModule="GeliBusinessPlatform" customModuleProvider="target">
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ChangeGoodsPriceVC" customModule="TestClass" customModuleProvider="target">
<connections>
<outlet property="sureBtn" destination="u6y-CU-3oP" id="jeI-hQ-epr"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<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" customClass="XiuGaiYuShouJiaViewController" customModule="GeliBusinessPlatform" customModuleProvider="target">
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="XiuGaiYuShouJiaViewController" customModule="TestClass" customModuleProvider="target">
<connections>
<outlet property="color" destination="af6-Wa-4Sy" id="gC1-9R-E1C"/>
<outlet property="countLbl" destination="nUd-42-xVV" id="HNp-gi-Qb7"/>
......
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