Commit 7b8bccd6 authored by lujunye's avatar lujunye

整理代码

parent 2ed63472
...@@ -5,23 +5,23 @@ ...@@ -5,23 +5,23 @@
version = "2.0"> version = "2.0">
<Breakpoints> <Breakpoints>
<BreakpointProxy <BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.SwiftErrorBreakpoint"> BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
<BreakpointContent <BreakpointContent
uuid = "46B6B765-5B4F-49F9-BFB7-4E596F3F184F" uuid = "46523EDE-134D-4CC0-9B0D-03CF99ED75C4"
shouldBeEnabled = "Yes" shouldBeEnabled = "Yes"
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No"> continueAfterRunningActions = "No"
scope = "1"
stopOnStyle = "0">
</BreakpointContent> </BreakpointContent>
</BreakpointProxy> </BreakpointProxy>
<BreakpointProxy <BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint"> BreakpointExtensionID = "Xcode.Breakpoint.SwiftErrorBreakpoint">
<BreakpointContent <BreakpointContent
uuid = "B61C3BDB-EDAD-4F1C-9E1B-3E983CC96C75" uuid = "07A0A3DD-FE69-427B-BC36-C6421ABF6B4E"
shouldBeEnabled = "Yes" shouldBeEnabled = "Yes"
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No">
scope = "1"
stopOnStyle = "0">
</BreakpointContent> </BreakpointContent>
</BreakpointProxy> </BreakpointProxy>
</Breakpoints> </Breakpoints>
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "tjxq@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "tjxq@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
...@@ -11,7 +11,7 @@ import IQKeyboardManagerSwift ...@@ -11,7 +11,7 @@ import IQKeyboardManagerSwift
@objc protocol GLAlertSelectViewDelegate { @objc protocol GLAlertSelectViewDelegate {
//普通状态(单多选) //普通状态(单多选)
@objc optional func GLAlertSelectViewClick(selectNum:NSString,view:GLAlertSelectView)//单选 @objc optional func GLAlertSelectViewClick(selectNum:Int,view:GLAlertSelectView)//单选
@objc optional func GLAlertMoreSelectViewClick(sender:NSArray,view:UIView)//多选 @objc optional func GLAlertMoreSelectViewClick(sender:NSArray,view:UIView)//多选
//通用 //通用
@objc optional func GLAlertSelectViewClose(sender:UIButton)//关闭 @objc optional func GLAlertSelectViewClose(sender:UIButton)//关闭
...@@ -29,7 +29,7 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA ...@@ -29,7 +29,7 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA
var delegate:GLAlertSelectViewDelegate? var delegate:GLAlertSelectViewDelegate?
var inputTextTF:UITextField? var inputTextTF:UITextField?
var selectArray:NSMutableArray? var selectArray:NSMutableArray?
var selectNum:String? = "" var selectNum:Int?
var selectLblText:String? = "" var selectLblText:String? = ""
var dataArr = Array<String>(){ var dataArr = Array<String>(){
...@@ -149,6 +149,8 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA ...@@ -149,6 +149,8 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA
cell.titleLbl.text = dataArr[indexPath.row] cell.titleLbl.text = dataArr[indexPath.row]
cell.delegate = self cell.delegate = self
cell.tag = indexPath.row cell.tag = indexPath.row
cell.titleLbl.textColor = UIColor(named: "标题字颜色")
cell.selectBtn.isSelected = false
if isMultipleS == true { if isMultipleS == true {
for item in selectArray! { for item in selectArray! {
let row = "\(item)" as! NSString let row = "\(item)" as! NSString
...@@ -158,8 +160,7 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA ...@@ -158,8 +160,7 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA
} }
} }
}else{ }else{
let str = selectNum as! NSString if selectNum == indexPath.row {
if str.integerValue == indexPath.row {
cell.titleLbl.textColor = UIColor(named: "蓝色字体颜色") cell.titleLbl.textColor = UIColor(named: "蓝色字体颜色")
cell.selectBtn.isSelected = true cell.selectBtn.isSelected = true
} }
...@@ -170,8 +171,8 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA ...@@ -170,8 +171,8 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA
if (titleLbl.text?.contains("库位"))! { if (titleLbl.text?.contains("库位"))! {
}else{ }else{
if selectNum!.count > 0 { if isMultipleS == false {
delegate?.GLAlertSelectViewClick?(selectNum: selectNum as! NSString,view: self) delegate?.GLAlertSelectViewClick?(selectNum: selectNum!,view: self)
}else{ }else{
delegate?.GLAlertMoreSelectViewClick?(sender: selectArray!,view:self) delegate?.GLAlertMoreSelectViewClick?(sender: selectArray!,view:self)
...@@ -181,29 +182,17 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA ...@@ -181,29 +182,17 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA
//MARK: - 自定义CELL DELEGATE //MARK: - 自定义CELL DELEGATE
//普通 //普通
func TitleAndSelectCellClick(content: UIButton, cell: TitleAndSelectCell) { func TitleAndSelectCellClick(content: UIButton, cell: TitleAndSelectCell) {
if selectNum!.count > 0 {
for item in selectTbv.visibleCells { if isMultipleS == false {
let cel = item as! TitleAndSelectCell selectNum = cell.tag
cel.titleLbl.textColor = UIColor(named: "标题字颜色")
cel.selectBtn.isSelected = false
if cell == cel {
cel.selectBtn.isSelected = true
cel.titleLbl.textColor = UIColor(named: "蓝色字体颜色")
selectNum = "\(cel.tag)"
}
}
}else{ }else{
cell.titleLbl.textColor = UIColor(named: "")
if cell.selectBtn.isSelected == true { if cell.selectBtn.isSelected == true {
cell.selectBtn.isSelected = false
cell.titleLbl.textColor = UIColor(named: "标题字颜色")
selectArray!.replaceObject(at: cell.tag, with: "99") selectArray!.replaceObject(at: cell.tag, with: "99")
}else{ }else{
cell.titleLbl.textColor = UIColor(named: "蓝色字体颜色")
cell.selectBtn.isSelected = true
selectArray!.replaceObject(at: cell.tag, with: cell.tag) selectArray!.replaceObject(at: cell.tag, with: cell.tag)
} }
} }
selectTbv.reloadData()
} }
//库位 //库位
func editClickAction(sender: Int) { func editClickAction(sender: Int) {
......
...@@ -12,6 +12,7 @@ import UIKit ...@@ -12,6 +12,7 @@ import UIKit
} }
class AddGuiGeCell: UITableViewCell { class AddGuiGeCell: UITableViewCell {
var delegate:AddGuiGeCellDelegate? var delegate:AddGuiGeCellDelegate?
@IBOutlet weak var btmH: NSLayoutConstraint!
@IBAction func btnClick(_ sender: Any) { @IBAction func btnClick(_ sender: Any) {
delegate?.AddGuiGeCellClick?(cell: self) delegate?.AddGuiGeCellClick?(cell: self)
} }
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
</tableViewCellContentView> </tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/> <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<connections> <connections>
<outlet property="btmH" destination="log-wz-xog" id="axu-Jf-zWN"/>
<outlet property="imgBtn" destination="FpT-RN-ad7" id="DdI-mW-7wW"/> <outlet property="imgBtn" destination="FpT-RN-ad7" id="DdI-mW-7wW"/>
</connections> </connections>
<point key="canvasLocation" x="132" y="122"/> <point key="canvasLocation" x="132" y="122"/>
......
...@@ -95,7 +95,7 @@ class AddImgCell: UITableViewCell { ...@@ -95,7 +95,7 @@ class AddImgCell: UITableViewCell {
make.right.equalTo(img.snp_right).offset(6) make.right.equalTo(img.snp_right).offset(6)
make.width.height.equalTo(15) make.width.height.equalTo(15)
} }
delImg.isHidden = isEdit! delImg.isHidden = !isEdit!
let delBtn = UIButton() let delBtn = UIButton()
delBtn.isUserInteractionEnabled = isEdit! delBtn.isUserInteractionEnabled = isEdit!
......
...@@ -7,15 +7,15 @@ ...@@ -7,15 +7,15 @@
// //
import UIKit import UIKit
@objc protocol ShangPinGguiGeCellDelegate { protocol ShangPinGguiGeCellDelegate {
@objc optional func ShangPinGguiGeCellEditAction(cell:ShangPinGguiGeCell) func ShangPinGguiGeCellEditAction(cell:ShangPinGguiGeCell)
} }
class ShangPinGguiGeCell: UITableViewCell { class ShangPinGguiGeCell: UITableViewCell {
var delegate:ShangPinGguiGeCellDelegate? var delegate:ShangPinGguiGeCellDelegate?
@IBAction func editAction(_ sender: Any) { @IBAction func editAction(_ sender: Any) {
delegate?.ShangPinGguiGeCellEditAction?(cell: self) delegate?.ShangPinGguiGeCellEditAction(cell: self)
} }
// var itemIdx:Int?
@IBOutlet weak var btn: UIButton! @IBOutlet weak var btn: UIButton!
@IBOutlet weak var tempLbl: UILabel! @IBOutlet weak var tempLbl: UILabel!
@IBOutlet weak var weightLbl: UILabel! @IBOutlet weak var weightLbl: UILabel!
......
...@@ -8,11 +8,7 @@ ...@@ -8,11 +8,7 @@
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<connections>
<outlet property="btn" destination="yWF-ML-clI" id="Bg6-Sd-ken"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="ShangPinGguiGeCell" customModule="GeliBusinessPlatform" customModuleProvider="target"> <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="ShangPinGguiGeCell" customModule="GeliBusinessPlatform" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="375" height="146"/> <rect key="frame" x="0.0" y="0.0" width="375" height="146"/>
...@@ -90,7 +86,7 @@ ...@@ -90,7 +86,7 @@
<color key="titleColor" name="蓝色字体颜色"/> <color key="titleColor" name="蓝色字体颜色"/>
</state> </state>
<connections> <connections>
<action selector="editAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="NUZ-aA-T5Q"/> <action selector="editAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="91o-np-dL3"/>
</connections> </connections>
</button> </button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="K2a-dA-ghw"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="K2a-dA-ghw">
...@@ -153,12 +149,12 @@ ...@@ -153,12 +149,12 @@
</tableViewCellContentView> </tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/> <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<connections> <connections>
<outlet property="btn" destination="yWF-ML-clI" id="Doh-Sc-3q4"/> <outlet property="btn" destination="yWF-ML-clI" id="D0u-7Q-exy"/>
<outlet property="danWeiLbl" destination="oOy-dE-JIB" id="Dw6-Zt-80o"/> <outlet property="danWeiLbl" destination="oOy-dE-JIB" id="mAU-7i-WZz"/>
<outlet property="guiGeLbl" destination="GPm-DS-HCD" id="ePF-lx-scy"/> <outlet property="guiGeLbl" destination="GPm-DS-HCD" id="HD8-uW-HzQ"/>
<outlet property="sellPriceLbl" destination="Mw0-dB-6KQ" id="ofk-s2-w0v"/> <outlet property="sellPriceLbl" destination="Mw0-dB-6KQ" id="LxY-Qz-4j7"/>
<outlet property="tempLbl" destination="bIm-PK-kvk" id="QrY-UP-WZk"/> <outlet property="tempLbl" destination="bIm-PK-kvk" id="PfP-6Q-if1"/>
<outlet property="weightLbl" destination="EeX-7S-sb3" id="bkH-WA-6Wt"/> <outlet property="weightLbl" destination="EeX-7S-sb3" id="yjA-Zu-wCa"/>
</connections> </connections>
<point key="canvasLocation" x="131.15942028985509" y="121.875"/> <point key="canvasLocation" x="131.15942028985509" y="121.875"/>
</tableViewCell> </tableViewCell>
......
...@@ -10,7 +10,7 @@ import UIKit ...@@ -10,7 +10,7 @@ import UIKit
class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,UITableViewDelegate,DaiKeXiaDanFooterViewDelegate,TitleAndBtnCellDelegate,GLAlertSelectViewDelegate{ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,UITableViewDelegate,DaiKeXiaDanFooterViewDelegate,TitleAndBtnCellDelegate,GLAlertSelectViewDelegate{
var orderType = "99" //订单类型 var orderType:Int? //订单类型
var glSelectView:GLAlertSelectView? = nil var glSelectView:GLAlertSelectView? = nil
var holderArr = ["未支付","未付款","自提","暂不出库","0","0"] var holderArr = ["未支付","未付款","自提","暂不出库","0","0"]
...@@ -127,7 +127,7 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U ...@@ -127,7 +127,7 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
if glSelectView == nil { if glSelectView == nil {
let view = GLAlertSelectView(frame: self.view.bounds) let view = GLAlertSelectView(frame: self.view.bounds)
// view.isMultipleSelect = false//是否多选 // view.isMultipleSelect = false//是否多选
view.selectNum = orderType view.selectNum = orderType!
view.delegate = self view.delegate = self
view.titleLbl.text = "请选择订单类型" view.titleLbl.text = "请选择订单类型"
view.dataArr = ["普通订单","预售下单"] view.dataArr = ["普通订单","预售下单"]
...@@ -142,10 +142,10 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U ...@@ -142,10 +142,10 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
break break
} }
} }
var zhiFuType = "99" var zhiFuType:Int?
var zhiFuWay = "99" var zhiFuWay:Int?
var tiHuoWay = "99" var tiHuoWay:Int?
var chuHuoWay = "99" var chuHuoWay:Int?
func btnClick(content: String, cell: TitleAndBtnCell) { func btnClick(content: String, cell: TitleAndBtnCell) {
if glSelectView == nil { if glSelectView == nil {
let view = GLAlertSelectView(frame: self.view.bounds) let view = GLAlertSelectView(frame: self.view.bounds)
...@@ -153,22 +153,22 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U ...@@ -153,22 +153,22 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
view.delegate = self view.delegate = self
switch cell.tag { switch cell.tag {
case 0://支付状态 case 0://支付状态
view.selectNum = zhiFuType view.selectNum = zhiFuType!
view.titleLbl.text = "请选择\(p3Arr[cell.tag])" view.titleLbl.text = "请选择\(p3Arr[cell.tag])"
view.dataArr = ["预售","普通","期货","团购"] view.dataArr = ["预售","普通","期货","团购"]
break break
case 1://支付方式 case 1://支付方式
view.selectNum = zhiFuWay view.selectNum = zhiFuWay!
view.titleLbl.text = "请选择\(p3Arr[cell.tag])" view.titleLbl.text = "请选择\(p3Arr[cell.tag])"
view.dataArr = ["预售","普通","期货","团购"] view.dataArr = ["预售","普通","期货","团购"]
break break
case 2://提货方式 case 2://提货方式
view.selectNum = tiHuoWay view.selectNum = tiHuoWay!
view.titleLbl.text = "请选择\(p3Arr[cell.tag])" view.titleLbl.text = "请选择\(p3Arr[cell.tag])"
view.dataArr = ["预售","普通","期货","团购"] view.dataArr = ["预售","普通","期货","团购"]
break break
default://出货状态 default://出货状态
view.selectNum = chuHuoWay view.selectNum = chuHuoWay!
view.titleLbl.text = "请选择\(p3Arr[cell.tag])" view.titleLbl.text = "请选择\(p3Arr[cell.tag])"
view.dataArr = ["预售","普通","期货","团购"] view.dataArr = ["预售","普通","期货","团购"]
break break
...@@ -178,7 +178,7 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U ...@@ -178,7 +178,7 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
glSelectView = view glSelectView = view
} }
} }
func GLAlertSelectViewClick(selectNum: NSString, view: GLAlertSelectView) { func GLAlertSelectViewClick(selectNum: Int, view: GLAlertSelectView) {
print("单选",selectNum) print("单选",selectNum)
glSelectView?.removeFromSuperview() glSelectView?.removeFromSuperview()
glSelectView = nil glSelectView = nil
......
...@@ -31,10 +31,10 @@ class EditProductViewController: BaseViewController,UITableViewDelegate,UITableV ...@@ -31,10 +31,10 @@ class EditProductViewController: BaseViewController,UITableViewDelegate,UITableV
var itemTypeArr = NSMutableArray() var itemTypeArr = NSMutableArray()
var shangPinStatus = "99" var shangPinStatus:Int?
var shangPinStatusArr = ["热销","爆款","新品","促销","外采","团购"] var shangPinStatusArr = ["热销","爆款","新品","促销","外采","团购"]
var yunShuType = "99" var yunShuType:Int?
var yunShuTypeArr = ["冷链","常温","热链"] var yunShuTypeArr = ["冷链","常温","热链"]
//MARK:--保存按钮 //MARK:--保存按钮
@IBOutlet weak var bottomView: UIView! @IBOutlet weak var bottomView: UIView!
...@@ -426,7 +426,7 @@ class EditProductViewController: BaseViewController,UITableViewDelegate,UITableV ...@@ -426,7 +426,7 @@ class EditProductViewController: BaseViewController,UITableViewDelegate,UITableV
view.titleLbl.text = "请选择商品类型" view.titleLbl.text = "请选择商品类型"
view.delegate = self view.delegate = self
view.dataArr = shangPinStatusArr view.dataArr = shangPinStatusArr
view.selectNum = shangPinStatus view.selectNum = shangPinStatus!
self.view.addSubview(view) self.view.addSubview(view)
glSelectView = view glSelectView = view
} }
...@@ -436,7 +436,7 @@ class EditProductViewController: BaseViewController,UITableViewDelegate,UITableV ...@@ -436,7 +436,7 @@ class EditProductViewController: BaseViewController,UITableViewDelegate,UITableV
view.titleLbl.text = "请选择运输方式" view.titleLbl.text = "请选择运输方式"
view.delegate = self view.delegate = self
view.dataArr = yunShuTypeArr view.dataArr = yunShuTypeArr
view.selectNum = yunShuType view.selectNum = yunShuType!
self.view.addSubview(view) self.view.addSubview(view)
glSelectView = view glSelectView = view
} }
...@@ -458,17 +458,17 @@ class EditProductViewController: BaseViewController,UITableViewDelegate,UITableV ...@@ -458,17 +458,17 @@ class EditProductViewController: BaseViewController,UITableViewDelegate,UITableV
} }
func GLAlertSelectViewClick(selectNum: NSString, view: GLAlertSelectView) { func GLAlertSelectViewClick(selectNum: Int, view: GLAlertSelectView) {
print("单选",selectNum) print("单选",selectNum)
print(view.titleLbl.text) print(view.titleLbl.text)
switch view.titleLbl.text { switch view.titleLbl.text {
case "请选择商品类型": case "请选择商品类型":
shangPinStatus = selectNum as String shangPinStatus = selectNum
tishixxArr1.replaceObject(at: view.tag, with: shangPinStatusArr[selectNum.integerValue]) tishixxArr1.replaceObject(at: view.tag, with: shangPinStatusArr[selectNum])
break break
case "请选择运输方式": case "请选择运输方式":
yunShuType = selectNum as String yunShuType = selectNum
tishixxArr1.replaceObject(at: view.tag, with: yunShuTypeArr[selectNum.integerValue]) tishixxArr1.replaceObject(at: view.tag, with: yunShuTypeArr[selectNum])
break break
default: default:
break break
......
...@@ -164,14 +164,10 @@ class SJMapViewController: UIViewController,AMapLocationManagerDelegate,MAMapVie ...@@ -164,14 +164,10 @@ class SJMapViewController: UIViewController,AMapLocationManagerDelegate,MAMapVie
if idx == indexPath { if idx == indexPath {
return return
}else{ }else{
for item in tableView.visibleCells {
let cell = item as! SJMapCell
cell.imgView.isHidden = true
}
idx = indexPath idx = indexPath
let cell = tableView.cellForRow(at: idx!) as! SJMapCell let cell = tableView.cellForRow(at: idx!) as! SJMapCell
cell.imgView.isHidden = false
mapView.setCenter(CLLocationCoordinate2D(latitude:CLLocationDegrees(cell.lat!), longitude: CLLocationDegrees(cell.lng!)), animated: false) mapView.setCenter(CLLocationCoordinate2D(latitude:CLLocationDegrees(cell.lat!), longitude: CLLocationDegrees(cell.lng!)), animated: false)
listView?.reloadData()
} }
} }
......
...@@ -8,12 +8,24 @@ ...@@ -8,12 +8,24 @@
import UIKit import UIKit
class JiPaiFangShiViewController: BaseViewController { class JiPaiFangShiViewController: BaseViewController ,SendTimeSelectViewDeleagte{
func SendTimeSelectViewSubmit(date: String) {
print(date)
sendTimeView?.removeFromSuperview()
sendTimeView = nil
}
func SendTimeSelectViewClose() {
sendTimeView?.removeFromSuperview()
sendTimeView = nil
}
var sendTimeView:SendTimeSelectView?
@IBAction func selectTimeAction(_ sender: UIButton) { @IBAction func selectTimeAction(_ sender: UIButton) {
if sendTimeView == nil {
let view = SendTimeSelectView(frame:self.view.bounds) let view = SendTimeSelectView(frame:self.view.bounds)
view.delegate = self
self.view.addSubview(view) self.view.addSubview(view)
sendTimeView = view
}
} }
@IBOutlet weak var topView: UIView! @IBOutlet weak var topView: UIView!
@IBOutlet weak var PLBL: UILabel! @IBOutlet weak var PLBL: UILabel!
......
...@@ -7,19 +7,28 @@ ...@@ -7,19 +7,28 @@
// //
import UIKit import UIKit
protocol SendTimeSelectViewDeleagte {
func SendTimeSelectViewClose()
func SendTimeSelectViewSubmit(date:String)
}
class SendTimeSelectView: UIView,UITableViewDelegate,UITableViewDataSource { class SendTimeSelectView: UIView,UITableViewDelegate,UITableViewDataSource {
var delegate:SendTimeSelectViewDeleagte?
let leftListArr = ["今天","明天","后天"] let leftListArr = ["今天","明天","后天"]
let rightListArr = ["1","2","3"] let rightListArr = ["1","2","3"]
var contentView:UIView! var contentView:UIView!
var leftSelectIdx:Int?
var rightSelectIdx:Int?
@IBAction func submitAction(_ sender: Any) { @IBAction func submitAction(_ sender: Any) {
delegate?.SendTimeSelectViewSubmit(date:"\(leftListArr[leftSelectIdx!]) \(rightListArr[rightSelectIdx!])")
} }
@IBOutlet weak var rightListView: UITableView! @IBOutlet weak var rightListView: UITableView!
@IBOutlet weak var leftListView: UITableView! @IBOutlet weak var leftListView: UITableView!
@IBOutlet weak var bottomView: UIView! @IBOutlet weak var bottomView: UIView!
@IBAction func closeAction(_ sender: Any) {
delegate?.SendTimeSelectViewClose()
}
func setUI(){ func setUI(){
let maskPath = UIBezierPath(roundedRect: bottomView.bounds, let maskPath = UIBezierPath(roundedRect: bottomView.bounds,
byRoundingCorners:[.topLeft, .topRight], cornerRadii:CGSize(width:3, height:3)) byRoundingCorners:[.topLeft, .topRight], cornerRadii:CGSize(width:3, height:3))
...@@ -83,46 +92,42 @@ class SendTimeSelectView: UIView,UITableViewDelegate,UITableViewDataSource { ...@@ -83,46 +92,42 @@ class SendTimeSelectView: UIView,UITableViewDelegate,UITableViewDataSource {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "OnlyLabel") as! OnlyLabelCell let cell = tableView.dequeueReusableCell(withIdentifier: "OnlyLabel") as! OnlyLabelCell
cell.tag = indexPath.row cell.tag = indexPath.row
cell.titleLbl.text = rightListArr[indexPath.row]
if tableView == leftListView { if tableView == leftListView {
cell.titleLbl.text = leftListArr[indexPath.row] cell.titleLbl.text = leftListArr[indexPath.row]
cell.titleLbl.textColor = UIColor(named: "灰色字体颜色")
cell.titleLbl.font = UIFont.systemFont(ofSize: 13)
cell.backgroundColor = UIColor(named: "搜索框背景色")
if leftSelectIdx == indexPath.row{
cell.titleLbl.textColor = UIColor(named: "标题字颜色")
cell.titleLbl.font = UIFont.boldSystemFont(ofSize: 13)
cell.backgroundColor = UIColor.white
}
}else{
cell.titleLbl.text = rightListArr[indexPath.row]
cell.titleLbl.textColor = UIColor(named: "灰色字体颜色")
cell.titleLbl.font = UIFont.systemFont(ofSize: 13)
if rightSelectIdx == indexPath.row{
cell.titleLbl.textColor = UIColor(named: "蓝色字体颜色")
cell.titleLbl.font = UIFont.systemFont (ofSize: 13)
}
} }
return cell return cell
} }
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if tableView == leftListView { if tableView == leftListView {
// leftSelectIdx = indexPath.row
rightSelectIdx = nil
//cell状态效果 rightListView.reloadData()
for item in leftListView.visibleCells { leftListView.reloadData()
let cel = item as! OnlyLabelCell
cel.titleLbl.textColor = UIColor(named: "灰色字体颜色")
cel.titleLbl.font = UIFont.systemFont(ofSize: 13)
cel.backgroundColor = UIColor(named: "搜索框背景色")
if cel.tag == indexPath.row {
cel.titleLbl.textColor = UIColor(named: "标题字颜色")
cel.titleLbl.font = UIFont.boldSystemFont(ofSize: 13)
cel.backgroundColor = UIColor.white
}
}
} }
if tableView == rightListView { if tableView == rightListView {
// rightSelectIdx = indexPath.row
rightListView.reloadData()
//cell状态效果
for item in rightListView.visibleCells {
let cel = item as! OnlyLabelCell
cel.titleLbl.textColor = UIColor(named: "灰色字体颜色")
cel.titleLbl.font = UIFont.systemFont(ofSize: 13)
if cel.tag == indexPath.row {
cel.titleLbl.textColor = UIColor(named: "蓝色字体颜色")
cel.titleLbl.font = UIFont.systemFont (ofSize: 13)
}
} }
} }
}
} }
...@@ -81,6 +81,9 @@ class PinPaiListViewController: BaseViewController,UISearchBarDelegate,SearchBar ...@@ -81,6 +81,9 @@ class PinPaiListViewController: BaseViewController,UISearchBarDelegate,SearchBar
if selectIdx == indexPath.row { if selectIdx == indexPath.row {
cell.titleLbl.textColor = UIColor(named: "蓝色字体颜色") cell.titleLbl.textColor = UIColor(named: "蓝色字体颜色")
cell.selectBtn.isSelected = true cell.selectBtn.isSelected = true
}else{
cell.titleLbl.textColor = UIColor(named: "标题字颜色")
cell.selectBtn.isSelected = false
} }
// let rowModel = dataModelArray![indexPath.row] as! GeneralInfoBrandModel // let rowModel = dataModelArray![indexPath.row] as! GeneralInfoBrandModel
// cell.nameLbl.text = rowModel.brand_name // cell.nameLbl.text = rowModel.brand_name
...@@ -95,9 +98,10 @@ class PinPaiListViewController: BaseViewController,UISearchBarDelegate,SearchBar ...@@ -95,9 +98,10 @@ class PinPaiListViewController: BaseViewController,UISearchBarDelegate,SearchBar
var selectModel : GeneralInfoBrandModel? = nil var selectModel : GeneralInfoBrandModel? = nil
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if isSelectData { if isSelectData {
let rowModel = dataModelArray![indexPath.row] as! GeneralInfoBrandModel // let rowModel = dataModelArray![indexPath.row] as! GeneralInfoBrandModel
selectModel = rowModel // selectModel = rowModel
selectIdx = indexPath.row
listView.reloadData()
}else{ }else{
let vc = XinZengPinPaiViewController() let vc = XinZengPinPaiViewController()
vc.navTitle = "编辑品牌" vc.navTitle = "编辑品牌"
...@@ -120,18 +124,9 @@ class PinPaiListViewController: BaseViewController,UISearchBarDelegate,SearchBar ...@@ -120,18 +124,9 @@ class PinPaiListViewController: BaseViewController,UISearchBarDelegate,SearchBar
//MARK:--自定义celldelegate //MARK:--自定义celldelegate
func TitleAndSelectCellClick(content: UIButton, cell: TitleAndSelectCell) { func TitleAndSelectCellClick(content: UIButton, cell: TitleAndSelectCell) {
print(cell.tag) print(cell.tag)
selectIdx = cell.tag selectIdx = cell.tag
listView.reloadData()
let cells = listView.visibleCells as! Array<TitleAndSelectCell>
for item in cells {
item.titleLbl.textColor = UIColor(named: "标题字颜色")
item.selectBtn.isSelected = false
if item == cell {
item.titleLbl.textColor = UIColor(named: "蓝色字体颜色")
item.selectBtn.isSelected = true
}
}
} }
} }
...@@ -8,16 +8,15 @@ ...@@ -8,16 +8,15 @@
import UIKit import UIKit
import LGButton import LGButton
@objc protocol CreatNewSpecsViewControllerDelegate { protocol CreatNewSpecsViewControllerDelegate {
@objc optional func CreatNewSpecsViewControllerSaveAction(datas:NSMutableArray) func CreatNewSpecsViewControllerSaveAction(datas:NSMutableArray)
@objc optional func CreatNewSpecsViewControllerDeleteAction() func CreatNewSpecsViewControllerDeleteAction()
} }
class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,TitleAndTFCellDelegate,TitleAndBtnCellDelegate,TitleAndSwitchCellDelegate,TitleAndSwitchHeaderViewDelegate,NewCreateHeaderDelegate,NewCreateFooterDelegate,YuShouCellDelegate,GLAlertSelectViewDelegate,PuTongJieTiCellDelegate,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout{ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,TitleAndTFCellDelegate,TitleAndBtnCellDelegate,TitleAndSwitchCellDelegate,TitleAndSwitchHeaderViewDelegate,NewCreateHeaderDelegate,NewCreateFooterDelegate,YuShouCellDelegate,GLAlertSelectViewDelegate,PuTongJieTiCellDelegate,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout{
var layout = UICollectionViewFlowLayout() var layout = UICollectionViewFlowLayout()
var delegate:CreatNewSpecsViewControllerDelegate? var delegate:CreatNewSpecsViewControllerDelegate?
var collectView:UICollectionView? var collectView:UICollectionView?
var datasArr:NSMutableArray = [] var datasArr:NSMutableArray = []
...@@ -85,7 +84,6 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -85,7 +84,6 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
} }
override func viewWillAppear(_ animated: Bool) { override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated) super.viewWillAppear(animated)
print("item == ",selectIdx?.item)
collectView?.selectItem(at:selectIdx, animated: false, scrollPosition: .bottom) collectView?.selectItem(at:selectIdx, animated: false, scrollPosition: .bottom)
} }
@IBOutlet weak var topBarView: UIView! @IBOutlet weak var topBarView: UIView!
...@@ -201,12 +199,11 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -201,12 +199,11 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
dict["isYuShouSetting"] = isYuShouSetting dict["isYuShouSetting"] = isYuShouSetting
dict["yuShouPrice"] = yuShouPrice dict["yuShouPrice"] = yuShouPrice
if barTitle?.contains("编辑") == true { if barTitle?.contains("编辑") == true {
print("abc == ",selectIdx?.item)
datasArr.replaceObject(at: selectIdx!.item, with: dict) datasArr.replaceObject(at: selectIdx!.item, with: dict)
}else{ }else{
datasArr.add(dict) datasArr.add(dict)
} }
delegate?.CreatNewSpecsViewControllerSaveAction?(datas: datasArr) delegate?.CreatNewSpecsViewControllerSaveAction(datas: datasArr)
self.navigationController?.popViewController(animated: true) self.navigationController?.popViewController(animated: true)
} }
//MARK: - cell delegate //MARK: - cell delegate
...@@ -266,13 +263,13 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -266,13 +263,13 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
cell.nameLbl.text = titleArray[indexPath.row] cell.nameLbl.text = titleArray[indexPath.row]
cell.contentLbl.text = pliceHolderArr[indexPath.row] cell.contentLbl.text = pliceHolderArr[indexPath.row]
if indexPath.row == 3 { if indexPath.row == 3 {
if tempSelect != "99" { if tempSelect != nil {
cell.contentLbl.text = selectListArr[tempSelect.integerValue] cell.contentLbl.text = selectListArr[tempSelect!]
} }
} }
if indexPath.row == 4 { if indexPath.row == 4 {
if itemDanWeiSelect != "99" { if itemDanWeiSelect != nil {
cell.contentLbl.text = selectListArr[itemDanWeiSelect.integerValue] cell.contentLbl.text = selectListArr1[itemDanWeiSelect!]
} }
} }
if datasArr.count > 0 { if datasArr.count > 0 {
...@@ -353,7 +350,7 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -353,7 +350,7 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
} }
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if indexPath.section == 3 { if indexPath.section == 3 {
delegate?.CreatNewSpecsViewControllerDeleteAction?() delegate?.CreatNewSpecsViewControllerDeleteAction()
} }
} }
...@@ -447,16 +444,16 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -447,16 +444,16 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
break break
} }
} }
func GLAlertSelectViewClick(selectNum: NSString, view: GLAlertSelectView) { func GLAlertSelectViewClick(selectNum: Int, view: GLAlertSelectView) {
let cell = listTbv.cellForRow(at: IndexPath(row: view.tag, section: 0)) as! TitleAndBtnCell let cell = listTbv.cellForRow(at: IndexPath(row: view.tag, section: 0)) as! TitleAndBtnCell
if view.tag == 3 { if view.tag == 3 {
tempSelect = selectNum tempSelect = selectNum
wenDu = selectListArr[selectNum.integerValue] wenDu = selectListArr[selectNum]
cell.contentLbl.text = selectListArr[selectNum.integerValue] cell.contentLbl.text = selectListArr[selectNum]
}else{ }else{
itemDanWeiSelect = selectNum itemDanWeiSelect = selectNum
cell.contentLbl.text = selectListArr1[selectNum.integerValue] cell.contentLbl.text = selectListArr1[selectNum]
danWei = selectListArr1[selectNum.integerValue] danWei = selectListArr1[selectNum]
} }
...@@ -471,8 +468,8 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -471,8 +468,8 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
// var tempSelectArr = NSMutableArray() // var tempSelectArr = NSMutableArray()
var tempSelect:NSString = "99" var tempSelect:Int?
var itemDanWeiSelect:NSString = "99" var itemDanWeiSelect:Int?
func btnClick(content: String, cell: TitleAndBtnCell) { func btnClick(content: String, cell: TitleAndBtnCell) {
if cell.tag == 3 { if cell.tag == 3 {
...@@ -482,7 +479,9 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -482,7 +479,9 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
view.titleLbl.text = "请选择商品温藏" view.titleLbl.text = "请选择商品温藏"
view.delegate = self view.delegate = self
view.dataArr = selectListArr view.dataArr = selectListArr
view.selectNum = tempSelect as String //单选 if tempSelect != nil {
view.selectNum = tempSelect!
}
self.view.addSubview(view) self.view.addSubview(view)
selectView = view selectView = view
} }
...@@ -492,7 +491,9 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -492,7 +491,9 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
view.tag = cell.tag view.tag = cell.tag
view.titleLbl.text = "请选择商品单位" view.titleLbl.text = "请选择商品单位"
view.delegate = self view.delegate = self
view.selectNum = itemDanWeiSelect as String if itemDanWeiSelect != nil {
view.selectNum = itemDanWeiSelect!
}
view.dataArr = selectListArr1 view.dataArr = selectListArr1
self.view.addSubview(view) self.view.addSubview(view)
selectView = view selectView = view
......
...@@ -22,7 +22,7 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -22,7 +22,7 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
var isEdit:Bool? var isEdit:Bool?
//测试数据 //测试数据
var data:NSDictionary? = nil var data:NSDictionary? = nil
var gouWuType = "99" //购物类型 var gouWuType:Int? //购物类型
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
...@@ -195,7 +195,7 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -195,7 +195,7 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
if glSelectView == nil { if glSelectView == nil {
let view = GLAlertSelectView(frame: self.view.bounds) let view = GLAlertSelectView(frame: self.view.bounds)
// view.isMultipleSelect = false//是否多选 // view.isMultipleSelect = false//是否多选
view.selectNum = gouWuType view.selectNum = gouWuType!
view.delegate = self view.delegate = self
view.titleLbl.text = "请选择购物类型" view.titleLbl.text = "请选择购物类型"
view.dataArr = ["普通订单","预售下单"] view.dataArr = ["普通订单","预售下单"]
...@@ -251,7 +251,7 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -251,7 +251,7 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
print("AddGuiGeCellClick") print("AddGuiGeCellClick")
} }
func GLAlertSelectViewClick(selectNum: NSString, view: GLAlertSelectView) { func GLAlertSelectViewClick(selectNum: Int, view: GLAlertSelectView) {
print("单选",selectNum) print("单选",selectNum)
glSelectView?.removeFromSuperview() glSelectView?.removeFromSuperview()
glSelectView = nil glSelectView = nil
......
...@@ -89,9 +89,9 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -89,9 +89,9 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
case 3: case 3:
let view = HeaderOnlyTitleView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 39)) let view = HeaderOnlyTitleView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 39))
if isYuShou { if isYuShou {
view.nameLbl.text = "收货信息"
}else{
view.nameLbl.text = "订单信息" view.nameLbl.text = "订单信息"
}else{
view.nameLbl.text = "收货信息"
} }
return view return view
case 4: case 4:
...@@ -177,8 +177,8 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -177,8 +177,8 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell
cell.textTF.isUserInteractionEnabled = false cell.textTF.isUserInteractionEnabled = false
if isYuShou { if isYuShou {
cell.nameLbl.text = yuShouTitleArr[indexPath.row] cell.nameLbl.text = nonYuShouPart3Arr[indexPath.row]
cell.textTF.text = yuShouTitleArr[indexPath.row] cell.textTF.text = nonYuShouPart3Arr[indexPath.row]
cell.delegate = self cell.delegate = self
if indexPath.row == yuShouTitleArr.count - 1 { if indexPath.row == yuShouTitleArr.count - 1 {
cell.line.isHidden = true cell.line.isHidden = true
...@@ -196,8 +196,8 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -196,8 +196,8 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
if isYuShou { if isYuShou {
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell
cell.textTF.isUserInteractionEnabled = false cell.textTF.isUserInteractionEnabled = false
cell.nameLbl.text = YuShouPart3Arr[indexPath.row] cell.nameLbl.text = nonYuShouPart3Arr[indexPath.row]
cell.textTF.text = YuShouPart3Arr[indexPath.row] cell.textTF.text = nonYuShouPart3Arr[indexPath.row]
return cell return cell
}else{ }else{
if indexPath.row == 4 || indexPath.row == 5 || indexPath.row == 9 { if indexPath.row == 4 || indexPath.row == 5 || indexPath.row == 9 {
......
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