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>
......
...@@ -27,56 +27,16 @@ ...@@ -27,56 +27,16 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<button opaque="NO" alpha="0.5" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6Sh-qF-UK5"> <button opaque="NO" alpha="0.5" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6Sh-qF-UK5">
<rect key="frame" x="0.0" y="44" width="414" height="818"/> <rect key="frame" x="0.0" y="-92" width="414" height="1108"/>
<color key="backgroundColor" name="标题字颜色"/> <color key="backgroundColor" name="标题字颜色"/>
</button> </button>
<view alpha="0.5" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="tDf-Te-gP3"> <view alpha="0.5" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="tDf-Te-gP3">
<rect key="frame" x="0.0" y="0.0" width="414" height="44"/> <rect key="frame" x="0.0" y="0.0" width="414" height="44"/>
<color key="backgroundColor" name="标题字颜色"/> <color key="backgroundColor" name="标题字颜色"/>
</view> </view>
<view userInteractionEnabled="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Z9Q-fQ-f12" customClass="LGButton" customModule="LGButton">
<rect key="frame" x="0.0" y="862" width="414" height="60"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstAttribute="height" constant="60" id="JME-PC-LPi"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="gradientStartColor">
<color key="value" name="按钮渐变色上"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="gradientEndColor">
<color key="value" name="按钮渐变色下,字体颜色"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="boolean" keyPath="gradientHorizontal" value="YES"/>
</userDefinedRuntimeAttributes>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="rW2-Ka-gAx"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="rW2-Ka-gAx">
<rect key="frame" x="0.0" y="490" width="414" height="372"/> <rect key="frame" x="0.0" y="495" width="414" height="318"/>
<subviews> <subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="W4e-rq-GWo" customClass="LGButton" customModule="LGButton">
<rect key="frame" x="0.0" y="323" width="414" height="49"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstAttribute="height" constant="49" id="GSb-Ls-6mX"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="gradientStartColor">
<color key="value" name="按钮渐变色上"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="gradientEndColor">
<color key="value" name="按钮渐变色下,字体颜色"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="boolean" keyPath="gradientHorizontal" value="YES"/>
<userDefinedRuntimeAttribute type="string" keyPath="titleString" value="确定"/>
<userDefinedRuntimeAttribute type="number" keyPath="titleFontSize">
<real key="value" value="17"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="string" keyPath="titleFontName" value="PingFangSC"/>
</userDefinedRuntimeAttributes>
<connections>
<action selector="submitAction:" destination="-1" eventType="touchUpInside" id="TdR-2t-Ltl"/>
</connections>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ufe-WI-qAR"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ufe-WI-qAR">
<rect key="frame" x="0.0" y="0.0" width="414" height="51"/> <rect key="frame" x="0.0" y="0.0" width="414" height="51"/>
<constraints> <constraints>
...@@ -450,21 +410,14 @@ ...@@ -450,21 +410,14 @@
</constraints> </constraints>
</view> </view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Trf-1A-2UZ"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Trf-1A-2UZ">
<rect key="frame" x="0.0" y="275" width="414" height="48"/> <rect key="frame" x="0.0" y="275" width="414" height="43"/>
<subviews> <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" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="n6W-Cn-03r">
<rect key="frame" x="352" y="8.5" width="49" height="31"/> <rect key="frame" x="350" y="6" width="51" height="31"/>
<constraints>
<constraint firstAttribute="height" constant="31" id="5F8-am-PsJ"/>
<constraint firstAttribute="width" constant="47" id="XcT-Ta-L1s"/>
</constraints>
<color key="onTintColor" name="按钮渐变色下,字体颜色"/> <color key="onTintColor" name="按钮渐变色下,字体颜色"/>
</switch> </switch>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="动物检疫证:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="K1L-ek-eBf"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="动物检疫证:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="K1L-ek-eBf">
<rect key="frame" x="15" y="13.5" width="337" height="21"/> <rect key="frame" x="15" y="14.5" width="74" height="14.5"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="OvT-8g-gl9"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="12"/> <fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" name="标题字颜色"/> <color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
...@@ -472,60 +425,92 @@ ...@@ -472,60 +425,92 @@
</subviews> </subviews>
<color key="backgroundColor" name="白色背景色"/> <color key="backgroundColor" name="白色背景色"/>
<constraints> <constraints>
<constraint firstItem="n6W-Cn-03r" firstAttribute="centerY" secondItem="Trf-1A-2UZ" secondAttribute="centerY" id="Se7-2p-B6v"/> <constraint firstItem="K1L-ek-eBf" firstAttribute="centerY" secondItem="Trf-1A-2UZ" secondAttribute="centerY" id="WyV-QL-bCZ"/>
<constraint firstAttribute="trailing" secondItem="n6W-Cn-03r" secondAttribute="trailing" constant="15" id="b5P-is-9PD"/> <constraint firstItem="K1L-ek-eBf" firstAttribute="leading" secondItem="Trf-1A-2UZ" secondAttribute="leading" constant="15" id="X27-na-xmD"/>
<constraint firstItem="n6W-Cn-03r" firstAttribute="leading" secondItem="K1L-ek-eBf" secondAttribute="trailing" id="cpZ-Ue-UYF"/> <constraint firstAttribute="height" constant="43" id="yI9-mB-aeO"/>
<constraint firstItem="K1L-ek-eBf" firstAttribute="leading" secondItem="Trf-1A-2UZ" secondAttribute="leading" constant="15" id="lI5-X0-uUt"/> <constraint firstItem="n6W-Cn-03r" firstAttribute="centerY" secondItem="Trf-1A-2UZ" secondAttribute="centerY" id="yzO-Po-Hso"/>
<constraint firstItem="K1L-ek-eBf" firstAttribute="centerY" secondItem="n6W-Cn-03r" secondAttribute="centerY" id="qT6-JB-w9v"/> <constraint firstAttribute="trailing" secondItem="n6W-Cn-03r" secondAttribute="trailing" constant="15" id="zxA-c4-De6"/>
</constraints> </constraints>
</view> </view>
</subviews> </subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints> <constraints>
<constraint firstItem="Trf-1A-2UZ" firstAttribute="top" secondItem="9xb-ef-BR6" secondAttribute="bottom" id="0S2-42-Xxc"/>
<constraint firstAttribute="trailing" secondItem="Trf-1A-2UZ" secondAttribute="trailing" id="69j-3i-jrN"/>
<constraint firstItem="3m5-vv-wjM" firstAttribute="top" secondItem="G9X-pI-5Ce" secondAttribute="bottom" id="6HS-cH-xzB"/> <constraint firstItem="3m5-vv-wjM" firstAttribute="top" secondItem="G9X-pI-5Ce" secondAttribute="bottom" id="6HS-cH-xzB"/>
<constraint firstAttribute="trailing" secondItem="P6u-9D-ZKm" secondAttribute="trailing" id="9NH-ae-s2d"/> <constraint firstAttribute="trailing" secondItem="P6u-9D-ZKm" secondAttribute="trailing" id="9NH-ae-s2d"/>
<constraint firstItem="Ufe-WI-qAR" firstAttribute="top" secondItem="rW2-Ka-gAx" secondAttribute="top" id="9tx-oZ-KLE"/> <constraint firstItem="Ufe-WI-qAR" firstAttribute="top" secondItem="rW2-Ka-gAx" secondAttribute="top" id="9tx-oZ-KLE"/>
<constraint firstAttribute="bottom" secondItem="W4e-rq-GWo" secondAttribute="bottom" id="CnI-ir-g74"/>
<constraint firstItem="W4e-rq-GWo" firstAttribute="leading" secondItem="rW2-Ka-gAx" secondAttribute="leading" id="F1C-KN-y5l"/>
<constraint firstItem="9xb-ef-BR6" firstAttribute="leading" secondItem="rW2-Ka-gAx" secondAttribute="leading" id="F1k-rF-Jdo"/> <constraint firstItem="9xb-ef-BR6" firstAttribute="leading" secondItem="rW2-Ka-gAx" secondAttribute="leading" id="F1k-rF-Jdo"/>
<constraint firstItem="G9X-pI-5Ce" firstAttribute="top" secondItem="P6u-9D-ZKm" secondAttribute="bottom" id="HwL-CO-LHP"/> <constraint firstItem="G9X-pI-5Ce" firstAttribute="top" secondItem="P6u-9D-ZKm" secondAttribute="bottom" id="HwL-CO-LHP"/>
<constraint firstItem="G9X-pI-5Ce" firstAttribute="leading" secondItem="rW2-Ka-gAx" secondAttribute="leading" id="J32-7j-OpU"/> <constraint firstItem="G9X-pI-5Ce" firstAttribute="leading" secondItem="rW2-Ka-gAx" secondAttribute="leading" id="J32-7j-OpU"/>
<constraint firstItem="Trf-1A-2UZ" firstAttribute="leading" secondItem="rW2-Ka-gAx" secondAttribute="leading" id="JF1-iT-7e5"/>
<constraint firstItem="3m5-vv-wjM" firstAttribute="leading" secondItem="rW2-Ka-gAx" secondAttribute="leading" id="Qdd-rt-qFk"/> <constraint firstItem="3m5-vv-wjM" firstAttribute="leading" secondItem="rW2-Ka-gAx" secondAttribute="leading" id="Qdd-rt-qFk"/>
<constraint firstItem="HOF-TP-XRe" firstAttribute="leading" secondItem="rW2-Ka-gAx" secondAttribute="leading" id="Rle-2X-fot"/> <constraint firstItem="HOF-TP-XRe" firstAttribute="leading" secondItem="rW2-Ka-gAx" secondAttribute="leading" id="Rle-2X-fot"/>
<constraint firstItem="W4e-rq-GWo" firstAttribute="top" secondItem="Trf-1A-2UZ" secondAttribute="bottom" id="UXV-bm-aDQ"/>
<constraint firstAttribute="trailing" secondItem="G9X-pI-5Ce" secondAttribute="trailing" id="WDh-VB-SY3"/> <constraint firstAttribute="trailing" secondItem="G9X-pI-5Ce" secondAttribute="trailing" id="WDh-VB-SY3"/>
<constraint firstAttribute="trailing" secondItem="9xb-ef-BR6" secondAttribute="trailing" id="Wfd-Zb-JQm"/> <constraint firstAttribute="trailing" secondItem="9xb-ef-BR6" secondAttribute="trailing" id="Wfd-Zb-JQm"/>
<constraint firstItem="HOF-TP-XRe" firstAttribute="top" secondItem="Ufe-WI-qAR" secondAttribute="bottom" id="Wq2-5N-E0z"/> <constraint firstItem="HOF-TP-XRe" firstAttribute="top" secondItem="Ufe-WI-qAR" secondAttribute="bottom" id="Wq2-5N-E0z"/>
<constraint firstAttribute="trailing" secondItem="3m5-vv-wjM" secondAttribute="trailing" id="aED-IL-b0O"/> <constraint firstAttribute="trailing" secondItem="3m5-vv-wjM" secondAttribute="trailing" id="aED-IL-b0O"/>
<constraint firstItem="Trf-1A-2UZ" firstAttribute="leading" secondItem="rW2-Ka-gAx" secondAttribute="leading" id="bQ1-nz-kvy"/>
<constraint firstAttribute="trailing" secondItem="HOF-TP-XRe" secondAttribute="trailing" id="diI-HO-EFh"/> <constraint firstAttribute="trailing" secondItem="HOF-TP-XRe" secondAttribute="trailing" id="diI-HO-EFh"/>
<constraint firstAttribute="height" constant="372" id="eAp-Aj-L92"/> <constraint firstAttribute="height" constant="318" id="eAp-Aj-L92"/>
<constraint firstItem="9xb-ef-BR6" firstAttribute="top" secondItem="3m5-vv-wjM" secondAttribute="bottom" id="eTx-WO-ZrZ"/> <constraint firstItem="9xb-ef-BR6" firstAttribute="top" secondItem="3m5-vv-wjM" secondAttribute="bottom" id="eTx-WO-ZrZ"/>
<constraint firstItem="Ufe-WI-qAR" firstAttribute="leading" secondItem="rW2-Ka-gAx" secondAttribute="leading" id="gTo-oN-cLg"/> <constraint firstItem="Ufe-WI-qAR" firstAttribute="leading" secondItem="rW2-Ka-gAx" secondAttribute="leading" id="gTo-oN-cLg"/>
<constraint firstAttribute="trailing" secondItem="Ufe-WI-qAR" secondAttribute="trailing" id="hV8-R6-19E"/> <constraint firstAttribute="trailing" secondItem="Ufe-WI-qAR" secondAttribute="trailing" id="hV8-R6-19E"/>
<constraint firstItem="P6u-9D-ZKm" firstAttribute="leading" secondItem="rW2-Ka-gAx" secondAttribute="leading" id="hq6-OF-b5V"/> <constraint firstItem="P6u-9D-ZKm" firstAttribute="leading" secondItem="rW2-Ka-gAx" secondAttribute="leading" id="hq6-OF-b5V"/>
<constraint firstAttribute="trailing" secondItem="Trf-1A-2UZ" secondAttribute="trailing" id="jne-sK-XiQ"/>
<constraint firstItem="P6u-9D-ZKm" firstAttribute="top" secondItem="HOF-TP-XRe" secondAttribute="bottom" id="qWH-3f-0Ca"/> <constraint firstItem="P6u-9D-ZKm" firstAttribute="top" secondItem="HOF-TP-XRe" secondAttribute="bottom" id="qWH-3f-0Ca"/>
<constraint firstAttribute="trailing" secondItem="W4e-rq-GWo" secondAttribute="trailing" id="rbw-5V-eYv"/> <constraint firstItem="Trf-1A-2UZ" firstAttribute="top" secondItem="9xb-ef-BR6" secondAttribute="bottom" id="rt6-MH-8ac"/>
</constraints> </constraints>
</view> </view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="gq9-xD-Wd8" customClass="LGButton" customModule="LGButton">
<rect key="frame" x="0.0" y="813" width="414" height="83"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="gradientStartColor">
<color key="value" name="按钮渐变色上"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="gradientEndColor">
<color key="value" name="按钮渐变色下,字体颜色"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="boolean" keyPath="gradientHorizontal" value="YES"/>
</userDefinedRuntimeAttributes>
<connections>
<action selector="submitAction:" destination="-1" eventType="valueChanged" id="bci-rS-ceQ"/>
</connections>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="i2O-Lc-NwB">
<rect key="frame" x="0.0" y="813" width="414" height="49"/>
<constraints>
<constraint firstAttribute="height" constant="49" id="K5Q-0x-Nfa"/>
</constraints>
<attributedString key="attributedText">
<fragment content="确定">
<attributes>
<color key="NSColor" name="白色背景色"/>
<font key="NSFont" size="17" name="PingFangSC-Medium"/>
<paragraphStyle key="NSParagraphStyle" alignment="center" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
</attributes>
</fragment>
</attributedString>
<nil key="highlightedColor"/>
</label>
</subviews> </subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints> <constraints>
<constraint firstItem="Z9Q-fQ-f12" firstAttribute="top" secondItem="rW2-Ka-gAx" secondAttribute="bottom" id="0jq-P0-IfO"/> <constraint firstItem="gq9-xD-Wd8" firstAttribute="top" secondItem="i2O-Lc-NwB" secondAttribute="top" id="5aU-gh-ZPo"/>
<constraint firstItem="6Sh-qF-UK5" firstAttribute="top" secondItem="vUN-kp-3ea" secondAttribute="top" id="BEH-1L-gfy"/> <constraint firstItem="rW2-Ka-gAx" firstAttribute="bottom" secondItem="vUN-kp-3ea" secondAttribute="bottom" constant="-49" id="9k5-X2-pnB"/>
<constraint firstItem="6Sh-qF-UK5" firstAttribute="top" secondItem="vUN-kp-3ea" secondAttribute="top" constant="-136" id="BEH-1L-gfy"/>
<constraint firstAttribute="trailing" secondItem="gq9-xD-Wd8" secondAttribute="trailing" id="Bzi-eL-ajv"/>
<constraint firstAttribute="bottom" secondItem="gq9-xD-Wd8" secondAttribute="bottom" id="EVw-zY-FJl"/>
<constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="rW2-Ka-gAx" secondAttribute="trailing" id="IfG-9S-fZ5"/> <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="rW2-Ka-gAx" secondAttribute="trailing" id="IfG-9S-fZ5"/>
<constraint firstItem="6Sh-qF-UK5" firstAttribute="top" secondItem="tDf-Te-gP3" secondAttribute="bottom" id="N9W-fu-qJZ"/> <constraint firstItem="i2O-Lc-NwB" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="JhM-bb-elg"/>
<constraint firstItem="Z9Q-fQ-f12" firstAttribute="top" secondItem="6Sh-qF-UK5" secondAttribute="bottom" id="T6v-Cx-fQD"/> <constraint firstItem="6Sh-qF-UK5" firstAttribute="top" secondItem="tDf-Te-gP3" secondAttribute="bottom" constant="-136" id="N9W-fu-qJZ"/>
<constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="6Sh-qF-UK5" secondAttribute="trailing" id="UCg-B2-JXR"/> <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="6Sh-qF-UK5" secondAttribute="trailing" id="UCg-B2-JXR"/>
<constraint firstItem="tDf-Te-gP3" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="VXM-Yf-Vxh"/> <constraint firstItem="tDf-Te-gP3" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="VXM-Yf-Vxh"/>
<constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="i2O-Lc-NwB" secondAttribute="trailing" id="ht6-ge-aco"/>
<constraint firstItem="6Sh-qF-UK5" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="hxs-hs-0GO"/> <constraint firstItem="6Sh-qF-UK5" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="hxs-hs-0GO"/>
<constraint firstItem="tDf-Te-gP3" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="j1O-jc-bP8"/> <constraint firstItem="tDf-Te-gP3" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="j1O-jc-bP8"/>
<constraint firstItem="vUN-kp-3ea" firstAttribute="bottom" secondItem="6Sh-qF-UK5" secondAttribute="bottom" id="p0G-24-PI1"/> <constraint firstItem="gq9-xD-Wd8" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="laU-gC-rJG"/>
<constraint firstAttribute="trailing" secondItem="Z9Q-fQ-f12" secondAttribute="trailing" id="srH-BV-xIs"/> <constraint firstItem="vUN-kp-3ea" firstAttribute="bottom" secondItem="6Sh-qF-UK5" secondAttribute="bottom" constant="-154" id="p0G-24-PI1"/>
<constraint firstItem="Z9Q-fQ-f12" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="toL-bK-g4M"/>
<constraint firstAttribute="trailing" secondItem="tDf-Te-gP3" secondAttribute="trailing" id="uOz-jT-nGj"/> <constraint firstAttribute="trailing" secondItem="tDf-Te-gP3" secondAttribute="trailing" id="uOz-jT-nGj"/>
<constraint firstItem="vUN-kp-3ea" firstAttribute="bottom" secondItem="i2O-Lc-NwB" secondAttribute="bottom" id="wZT-BC-AYX"/>
<constraint firstItem="rW2-Ka-gAx" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="x4f-1E-FoH"/> <constraint firstItem="rW2-Ka-gAx" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="x4f-1E-FoH"/>
</constraints> </constraints>
<viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/> <viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
...@@ -559,6 +544,9 @@ ...@@ -559,6 +544,9 @@
<namedColor name="白色背景色"> <namedColor name="白色背景色">
<color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor> </namedColor>
<namedColor name="白色背景色">
<color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="蓝色字体颜色"> <namedColor name="蓝色字体颜色">
<color red="0.27799999713897705" green="0.56099998950958252" blue="0.88999998569488525" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.27799999713897705" green="0.56099998950958252" blue="0.88999998569488525" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor> </namedColor>
......
...@@ -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
......
...@@ -10,7 +10,7 @@ import UIKit ...@@ -10,7 +10,7 @@ import UIKit
import LGButton import LGButton
import Photos import Photos
class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,CommendCellDelegate,TitleAndBtnCellDelegate,GLAlertSelectViewDelegate,GoodsClassViewControllerDelegate,PinPaiListViewControllerDelegate,AddImgCellDelegate,AddGuiGeCellDelegate,CreatNewSpecsViewControllerDelegate,ShangPinGguiGeCellDelegate,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout,TitleAndSwitchCellDelegate{ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,TitleAndBtnCellDelegate,GLAlertSelectViewDelegate,GoodsClassViewControllerDelegate,PinPaiListViewControllerDelegate,AddImgCellDelegate,AddGuiGeCellDelegate,CreatNewSpecsViewControllerDelegate,ShangPinGguiGeCellDelegate,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout,TitleAndSwitchCellDelegate,TitleAndTFCellDelegate{
let titleArr = ["商品信息","商品图片","商品规格","预售设置","其它信息","商品详情"] let titleArr = ["商品信息","商品图片","商品规格","预售设置","其它信息","商品详情"]
...@@ -26,30 +26,46 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -26,30 +26,46 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
var layout = UICollectionViewFlowLayout() var layout = UICollectionViewFlowLayout()
var glSelectView:GLAlertSelectView? var glSelectView:GLAlertSelectView?
var selectIdx:IndexPath?
var selectIdx:IndexPath?//多规格状态下点击collectionCell的row记录
var isYuShouShangPin:Bool?//是否为预售商品
var itemTypeArr = NSMutableArray()//多选 var itemTypeArr = NSMutableArray()//多选
var isYuShou:Bool = false//是否预售 var isYuShou:Bool = false//是否预售
var shangPinStatus = "99"//商品状态 var shangPinStatus:Int?//商品状态
var yunShuType = "99"//运输类型 var yunShuType:Int?//运输类型
var maxFiveImgsArr = NSMutableArray()//多图 var maxFiveImgsArr = NSMutableArray()//多图
var singleImgArr = NSMutableArray()//单张图 var singleImgArr = NSMutableArray()//单张图
var itemName = ""//商品名称
var qiMaiShuLiang = ""//起卖数量
var shiFouQZ = false//是否清真
var shiFouXJ = false//是否询价
var keyWord = ""//关键字
var wuLiuPrice = ""//物流费用
var guiGeArr:NSMutableArray = []//规格数组,根据规格资料数量控制右上角新增按钮是否显示
//MARK:--保存按钮 //MARK:--保存按钮
@IBAction func submitAction(_ sender: Any) { @IBAction func submitAction(_ sender: Any) {
print("保存按钮submitAction") print("保存按钮submitAction")
print(itemName)//商品名称
print(itemTypeArr)//商品类型
print(qiMaiShuLiang)//起卖数量
print(shiFouQZ)//是否清真
print(shiFouXJ)//是否询价
print(singleImgArr.firstObject)//商品封面图
print(maxFiveImgsArr)//商品主图
print(guiGeArr)//商品规格
print(keyWord)//关键字
print(wuLiuPrice)//物流费用
print(shangPinStatusArr[shangPinStatus!])//商品状态
print(yunShuTypeArr[yunShuType!])//运输方式
} }
@IBOutlet weak var submitBtn: LGButton! @IBOutlet weak var submitBtn: LGButton!
@IBOutlet weak var listTbv: UITableView! @IBOutlet weak var listTbv: UITableView!
var cellHeight = 18.5
var contentStr:String = ""
var guiGeArr:NSMutableArray = []//根据规格资料数量控制右上角新增按钮是否显示
@IBOutlet weak var lgBtnLbl: UILabel! @IBOutlet weak var lgBtnLbl: UILabel!
var cellHeight = 18.5
var isYuShouShangPin:Bool?//是否为预售商品
var generalInfoModel : GeneralInfoModel? = nil var generalInfoModel : GeneralInfoModel? = nil
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
...@@ -80,35 +96,19 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -80,35 +96,19 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
listTbv.register(UINib(nibName: "TitleAndBtnCell", bundle: nil), forCellReuseIdentifier: "TitleAndBtn") listTbv.register(UINib(nibName: "TitleAndBtnCell", bundle: nil), forCellReuseIdentifier: "TitleAndBtn")
listTbv.register(UINib(nibName: "AddImgCell", bundle: nil), forCellReuseIdentifier: "AddImg") listTbv.register(UINib(nibName: "AddImgCell", bundle: nil), forCellReuseIdentifier: "AddImg")
listTbv.register(UINib(nibName: "AddGuiGeCell", bundle: nil), forCellReuseIdentifier: "AddGuiGe") listTbv.register(UINib(nibName: "AddGuiGeCell", bundle: nil), forCellReuseIdentifier: "AddGuiGe")
listTbv.register(UINib(nibName: "CommendCell", bundle: nil), forCellReuseIdentifier: "Commend")
listTbv.register(UINib(nibName: "YuShouWeiKuanFaHuoCell", bundle: nil), forCellReuseIdentifier: "YuShouWeiKuanFaHuoCell") listTbv.register(UINib(nibName: "YuShouWeiKuanFaHuoCell", bundle: nil), forCellReuseIdentifier: "YuShouWeiKuanFaHuoCell")
listTbv.register(UINib(nibName: "ShangPinGguiGeCell", bundle: nil), forCellReuseIdentifier: "ShangPinGguiGeCell") listTbv.register(UINib(nibName: "ShangPinGguiGeCell", bundle: nil), forCellReuseIdentifier: "ShangPinGguiGeCell")
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
} }
//MARK: - cell delegate //MARK: - cell delegate
func numberOfSections(in tableView: UITableView) -> Int {
return 6
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
switch section {
case 0: return 7
case 1:return 2
case 2:return 1
case 3:return 4
case 4:return 5
default:return 2
}
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
switch indexPath.section { switch indexPath.section {
case 0: case 0:
if indexPath.row == 0 || indexPath.row == 4 { if indexPath.row == 0 || indexPath.row == 4 {
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTF") as! TitleAndTFCell let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTF") as! TitleAndTFCell
cell.nameLbl.text = spxxArr[indexPath.row] cell.nameLbl.text = spxxArr[indexPath.row]
cell.textTF.placeholder = tishixxArr[indexPath.row] as! String cell.textTF.placeholder = tishixxArr[indexPath.row] as! String
cell.delegate = self
return cell return cell
} }
if indexPath.row > 4{ if indexPath.row > 4{
...@@ -137,6 +137,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -137,6 +137,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
} }
cell.delegate = self cell.delegate = self
cell.addBtn.tag = indexPath.row cell.addBtn.tag = indexPath.row
cell.isEdit = true
return cell return cell
case 2: case 2:
if guiGeArr.count > 0 { if guiGeArr.count > 0 {
...@@ -148,13 +149,13 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -148,13 +149,13 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
}else{ }else{
dict = guiGeArr.firstObject as! NSDictionary dict = guiGeArr.firstObject as! NSDictionary
} }
cell.tempLbl.text = "冷藏:\(String(describing: dict["wenDu"]!))℃" cell.tempLbl.text = "冷藏:\(String(describing: dict["wenDu"]!))℃"
cell.weightLbl.text = "重量(kg):\(String(describing: dict["weight"]!))kg" cell.weightLbl.text = "重量(kg):\(String(describing: dict["weight"]!))kg"
cell.guiGeLbl.text = "规格:\(String(describing: dict["guiGe"]!))kg/件" cell.guiGeLbl.text = "规格:\(String(describing: dict["guiGe"]!))kg/件"
cell.danWeiLbl.text = "单位:\(String(describing: dict["danWei"]!))" cell.danWeiLbl.text = "单位:\(String(describing: dict["danWei"]!))"
cell.sellPriceLbl.text = "售价:¥\(dict["price"]!)" cell.sellPriceLbl.text = "售价:¥\(dict["price"]!)"
return cell return cell
} }
let cell = tableView.dequeueReusableCell(withIdentifier: "AddGuiGe") as! AddGuiGeCell let cell = tableView.dequeueReusableCell(withIdentifier: "AddGuiGe") as! AddGuiGeCell
...@@ -187,154 +188,34 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -187,154 +188,34 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
cell.nameLbl.text = qtxxArr[indexPath.row] cell.nameLbl.text = qtxxArr[indexPath.row]
cell.textTF.placeholder = tishixxArr1[indexPath.row] as! String cell.textTF.placeholder = tishixxArr1[indexPath.row] as! String
cell.tag = indexPath.row cell.tag = indexPath.row
cell.delegate = self
return cell return cell
}else{ }else{
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndBtn") as! TitleAndBtnCell let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndBtn") as! TitleAndBtnCell
cell.nameLbl.text = qtxxArr[indexPath.row] cell.nameLbl.text = qtxxArr[indexPath.row]
cell.tag = indexPath.row cell.tag = indexPath.row
cell.contentLbl.text = tishixxArr1[indexPath.row] as! String cell.contentLbl.text = tishixxArr1[indexPath.row] as! String
cell.delegate = self cell.delegate = self
return cell return cell
} }
default: default:
if indexPath.row == 0 { let cell = tableView.dequeueReusableCell(withIdentifier: "AddGuiGe") as! AddGuiGeCell
let cell = tableView.dequeueReusableCell(withIdentifier: "Commend") as! CommendCell cell.imgBtn.setImage(UIImage(named: "XiaYunDanViewController"), for: .normal)
cell.delegate = self cell.delegate = self
return cell cell.imgBtn.tag = indexPath.row
}else{ cell.imgBtn.setImage(UIImage(named: "tjxq"), for: .normal)
let cell = tableView.dequeueReusableCell(withIdentifier: "AddGuiGe") as! AddGuiGeCell cell.btmH.constant = 25
cell.imgBtn.setImage(UIImage(named: "tupian"), for: .normal) return cell
cell.delegate = self
cell.imgBtn.tag = indexPath.row
return cell
}
} }
} }
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
} }
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { //MARK: - 底部广告软文跳转
switch indexPath.section { func AddGuiGeCellClick(cell: AddGuiGeCell) {
case 0: return 49 print("底部广告软文跳转")
case 1:return 148.5 }
case 2:
if guiGeArr.count > 0 {
return 146
}
return 123.5
case 3:
if isYuShouShangPin == false {
return 0.01
}else{
return 49
}
case 4:return 49
default:
if indexPath.row == 0 {
return CGFloat(cellHeight)+27.5
}else{
return 155.5
}
}
}
//MARK: - tableview header
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
if section == 3 {
if isYuShouShangPin == false {
return UIView()
}
}
let view = UIView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 39))
let lbl = UILabel(frame: CGRect(x: 15, y: 15, width: fullScreenWidth, height: 21))
lbl.text = titleArr[section]
lbl.textColor = UIColor(named: "标题字颜色")
lbl.font = UIFont.boldSystemFont(ofSize: 15)
view.addSubview(lbl)
if section == 2 && guiGeArr.count > 0{
let btn = UIButton()
btn.setTitle(" 新增", for: .normal)
btn.titleLabel?.font = UIFont.systemFont(ofSize: 13)
btn.setTitleColor(UIColor(named: "蓝色字体颜色"), for: .normal)
btn.setImage(UIImage(named: "jiahaoXG"), for: .normal)
view.addSubview(btn)
btn.sizeToFit()
btn.snp.makeConstraints { (make) in
make.centerY.equalTo(lbl.snp_centerY)
make.right.equalTo(-15)
make.height.equalTo(btn.frame.size.height)
make.width.equalTo(btn.frame.size.width)
}
let btn2 = UIButton()
view.addSubview(btn2)
btn2.snp.makeConstraints { (make) in
make.top.right.bottom.equalTo(0)
make.width.equalTo(80)
}
btn2.addTarget(self, action: #selector(addGuiGe), for: .touchUpInside)
if guiGeArr.count > 1 {
view.frame = CGRect(x: 0, y: 0, width: fullScreenWidth, height: 80)
let collectionView = UICollectionView(frame: CGRect(x: 0, y: 0, width: 0, height: 0), collectionViewLayout: layout)
collectionView.backgroundColor = UIColor.white
collectionView.delegate = self
collectionView.dataSource = self
view.addSubview(collectionView)
collectionView.snp.makeConstraints { (make) in
make.bottom.left.right.equalTo(0)
make.height.equalTo(41)
}
collectionView.showsHorizontalScrollIndicator = false
collectionView.isPagingEnabled = true
layout.itemSize = CGSize(width: fullScreenWidth*0.5, height: 41)
layout.scrollDirection = .horizontal
collectionView.collectionViewLayout = layout
collectionView.register(UINib(nibName: "ItemCell", bundle: nil), forCellWithReuseIdentifier: "ItemCell")
collectionView.selectItem(at:selectIdx, animated: false, scrollPosition: .left)
}
}
return view
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
if section == 3 {
if isYuShouShangPin == false {
return 0.001
}
}
if section == 2 {
if guiGeArr.count > 1 {
return 80
}
}
return 39
}
//MARK: - tableview footer
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
let view = UIView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 10))
view.backgroundColor = UIColor(named: "app底色")
return view
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
if section == 3 {
if isYuShouShangPin == false {
return 0.001
}
}
return 10
}
//MARK: - 自定义delegate
func CommendCellSendH(height: CGFloat) {
cellHeight = Double(height)
listTbv.beginUpdates()
listTbv.endUpdates()
}
func CommendCellSendStr(content: String) {
print("CommendCellSendStr")
}
override func backAction() {
self.navigationController?.popViewController(animated: true)
}
//MARK: -- 点击按钮事件,跳转或者展示选择界面 //MARK: -- 点击按钮事件,跳转或者展示选择界面
func btnClick(content: String, cell: TitleAndBtnCell) { func btnClick(content: String, cell: TitleAndBtnCell) {
if cell.nameLbl.text == "商品类型" { if cell.nameLbl.text == "商品类型" {
...@@ -369,7 +250,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -369,7 +250,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
} }
if cell.nameLbl.text == "国家" { if cell.nameLbl.text == "国家" {
print("选择国家")
} }
if cell.nameLbl.text == "商品状态" { if cell.nameLbl.text == "商品状态" {
let view = GLAlertSelectView(frame: self.view.bounds) let view = GLAlertSelectView(frame: self.view.bounds)
...@@ -377,7 +258,9 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -377,7 +258,9 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
view.titleLbl.text = "请选择商品类型" view.titleLbl.text = "请选择商品类型"
view.delegate = self view.delegate = self
view.dataArr = shangPinStatusArr view.dataArr = shangPinStatusArr
view.selectNum = shangPinStatus if shangPinStatus != nil {
view.selectNum = shangPinStatus!
}
self.view.addSubview(view) self.view.addSubview(view)
glSelectView = view glSelectView = view
} }
...@@ -387,7 +270,9 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -387,7 +270,9 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
view.titleLbl.text = "请选择运输方式" view.titleLbl.text = "请选择运输方式"
view.delegate = self view.delegate = self
view.dataArr = yunShuTypeArr view.dataArr = yunShuTypeArr
view.selectNum = yunShuType if yunShuType != nil{
view.selectNum = yunShuType!
}
self.view.addSubview(view) self.view.addSubview(view)
glSelectView = view glSelectView = view
} }
...@@ -407,17 +292,61 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -407,17 +292,61 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
print("选择品牌返回的数据=\(sender)") print("选择品牌返回的数据=\(sender)")
} }
//MARK:--图片选择处理
func AddImgCellBtnClick(cell: AddImgCell) {
if cell.addBtn.tag == 0 {//仅一张
_ = self.presentHGImagePicker(maxSelected:1) { (assets) in
//结果处理
print("共选择了\(assets.count)张图片,分别如下:")
let option = PHImageRequestOptions()
option.isSynchronous = true
option.isNetworkAccessAllowed = true
for asset in assets {
PHImageManager.default().requestImage(for: asset, targetSize: PHImageManagerMaximumSize , contentMode: .default , options: option, resultHandler: { (image, _: [AnyHashable : Any]?) in
// print("上传图片==\(image)")
self.singleImgArr.add(image)
})
}
cell.imgs = self.singleImgArr
}
}else{//可多张
_ = self.presentHGImagePicker(maxSelected:5) { (assets) in
//结果处理
print("共选择了\(assets.count)张图片,分别如下:")
let option = PHImageRequestOptions()
option.isSynchronous = true
option.isNetworkAccessAllowed = true
for asset in assets {
PHImageManager.default().requestImage(for: asset, targetSize: PHImageManagerMaximumSize , contentMode: .default , options: option, resultHandler: { (image, _: [AnyHashable : Any]?) in
// print("上传图片==\(image)")
self.maxFiveImgsArr.add(image)
})
}
cell.imgs = self.maxFiveImgsArr
}
}
}
//MARK: - 删除图片处理
func DelImgCellBtnClick(sender: UIButton, cell: AddImgCell) {
if cell.isSingle == true {
singleImgArr.removeObject(at: sender.tag)
listTbv.reloadData()
}else{
maxFiveImgsArr.removeObject(at: sender.tag)
listTbv.reloadData()
}
}
//MARK: - GLAlertView(单选)下的页面 //MARK: - GLAlertView(单选)下的页面
func GLAlertSelectViewClick(selectNum: NSString, view: GLAlertSelectView) { func GLAlertSelectViewClick(selectNum: Int, view: GLAlertSelectView) {
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
...@@ -426,7 +355,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -426,7 +355,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
glSelectView = nil glSelectView = nil
listTbv.reloadData() listTbv.reloadData()
} }
//MARK: - GLAlertView(多选)下的页面 //MARK: - GLAlertView(多选)下的页面
func GLAlertMoreSelectViewClick(sender: NSArray, view:UIView) { func GLAlertMoreSelectViewClick(sender: NSArray, view:UIView) {
itemTypeArr = sender as! NSMutableArray itemTypeArr = sender as! NSMutableArray
...@@ -460,49 +389,23 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -460,49 +389,23 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
glSelectView?.removeFromSuperview() glSelectView?.removeFromSuperview()
glSelectView = nil glSelectView = nil
} }
//MARK: - titleAndTFdelegate
//MARK: - 图片处理 func textFieldContent(content: String, cell: TitleAndTFCell) {
func DelImgCellBtnClick(sender: UIButton, cell: AddImgCell) { switch cell.nameLbl.text {
if cell.isSingle == true { case "商品名称":
singleImgArr.removeObject(at: sender.tag) itemName = content
listTbv.reloadData() break
}else{ case "起卖数量":
maxFiveImgsArr.removeObject(at: sender.tag) qiMaiShuLiang = content
listTbv.reloadData() break
} case "关键字":
keyWord = content
} break
func AddImgCellBtnClick(cell: AddImgCell) { case "物流费用":
if cell.addBtn.tag == 0 {//仅一张 wuLiuPrice = content
_ = self.presentHGImagePicker(maxSelected:1) { (assets) in break
//结果处理 default:
print("共选择了\(assets.count)张图片,分别如下:") break
let option = PHImageRequestOptions()
option.isSynchronous = true
option.isNetworkAccessAllowed = true
for asset in assets {
PHImageManager.default().requestImage(for: asset, targetSize: PHImageManagerMaximumSize , contentMode: .default , options: option, resultHandler: { (image, _: [AnyHashable : Any]?) in
// print("上传图片==\(image)")
self.singleImgArr.add(image)
})
}
cell.imgs = self.singleImgArr
}
}else{//可多张
_ = self.presentHGImagePicker(maxSelected:5) { (assets) in
//结果处理
print("共选择了\(assets.count)张图片,分别如下:")
let option = PHImageRequestOptions()
option.isSynchronous = true
option.isNetworkAccessAllowed = true
for asset in assets {
PHImageManager.default().requestImage(for: asset, targetSize: PHImageManagerMaximumSize , contentMode: .default , options: option, resultHandler: { (image, _: [AnyHashable : Any]?) in
// print("上传图片==\(image)")
self.maxFiveImgsArr.add(image)
})
}
cell.imgs = self.maxFiveImgsArr
}
} }
} }
//MARK: - 编辑规格 //MARK: - 编辑规格
...@@ -538,15 +441,12 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -538,15 +441,12 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
vc.delegate = self vc.delegate = self
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
} }
//MARK: - 删除规格 //MARK: - 删除规格
func CreatNewSpecsViewControllerDeleteAction() { func CreatNewSpecsViewControllerDeleteAction() {
print("删除数据") print("删除数据")
} }
func AddGuiGeCellClick(cell: AddGuiGeCell) {
// //MARK: - 新增规格
print("商品详情添加图片")
}
//MARK: - 新增规格
@objc func addGuiGe(){ @objc func addGuiGe(){
print("新增规格") print("新增规格")
let vc = CreatNewSpecsViewController() let vc = CreatNewSpecsViewController()
...@@ -557,15 +457,12 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -557,15 +457,12 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
vc.datasArr = guiGeArr vc.datasArr = guiGeArr
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
} }
@objc func addImageAction(sender:UIButton){
print(sender.tag) //MARK: - 新增、编辑规格
}
func CreatNewSpecsViewControllerSaveAction(datas: NSMutableArray) { func CreatNewSpecsViewControllerSaveAction(datas: NSMutableArray) {
guiGeArr = datas guiGeArr = datas
listTbv.reloadData() listTbv.reloadData()
} }
//MARK: - COLLECTIONVIEW DELEGATE //MARK: - COLLECTIONVIEW DELEGATE
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat { func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
return 0 return 0
...@@ -594,8 +491,140 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -594,8 +491,140 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
selectIdx = indexPath selectIdx = indexPath
//刷新cell //刷新cell
print("selectItem",selectIdx?.item)
listTbv.reloadData() listTbv.reloadData()
collectionView.reloadData() collectionView.reloadData()
} }
//MARK: - switchClick
func switchClick(content: UISwitch, cell: TitleAndSwitchCell) {
switch cell.namelbl.text {
case "是否清真":
shiFouQZ = content.isOn
break
case "是否询价":
shiFouXJ = content.isOn
break
default:
break
}
}
func numberOfSections(in tableView: UITableView) -> Int {
return 6
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
switch section {
case 0: return 7
case 1:return 2
case 2:return 1
case 3:return 4
case 4:return 5
default:return 1
}
}
//MARK: - tableview footer
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
let view = UIView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 10))
view.backgroundColor = UIColor(named: "app底色")
return view
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
if section == 3 {
if isYuShouShangPin == false {
return 0.001
}
}
return 10
}
//MARK: - tableview header
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
if section == 3 {
if isYuShouShangPin == false {
return UIView()
}
}
let view = UIView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 39))
let lbl = UILabel(frame: CGRect(x: 15, y: 15, width: fullScreenWidth, height: 21))
lbl.text = titleArr[section]
lbl.textColor = UIColor(named: "标题字颜色")
lbl.font = UIFont.boldSystemFont(ofSize: 15)
view.addSubview(lbl)
if section == 2 && guiGeArr.count > 0{
let btn = UIButton()
btn.setTitle(" 新增", for: .normal)
btn.titleLabel?.font = UIFont.systemFont(ofSize: 13)
btn.setTitleColor(UIColor(named: "蓝色字体颜色"), for: .normal)
btn.setImage(UIImage(named: "jiahaoXG"), for: .normal)
view.addSubview(btn)
btn.sizeToFit()
btn.snp.makeConstraints { (make) in
make.centerY.equalTo(lbl.snp_centerY)
make.right.equalTo(-15)
make.height.equalTo(btn.frame.size.height)
make.width.equalTo(btn.frame.size.width)
}
let btn2 = UIButton()
view.addSubview(btn2)
btn2.snp.makeConstraints { (make) in
make.top.right.bottom.equalTo(0)
make.width.equalTo(80)
}
btn2.addTarget(self, action: #selector(addGuiGe), for: .touchUpInside)
if guiGeArr.count > 1 {
view.frame = CGRect(x: 0, y: 0, width: fullScreenWidth, height: 80)
let collectionView = UICollectionView(frame: CGRect(x: 0, y: 0, width: 0, height: 0), collectionViewLayout: layout)
collectionView.backgroundColor = UIColor.white
collectionView.delegate = self
collectionView.dataSource = self
view.addSubview(collectionView)
collectionView.snp.makeConstraints { (make) in
make.bottom.left.right.equalTo(0)
make.height.equalTo(41)
}
collectionView.showsHorizontalScrollIndicator = false
collectionView.isPagingEnabled = true
layout.itemSize = CGSize(width: fullScreenWidth*0.5, height: 41)
layout.scrollDirection = .horizontal
collectionView.collectionViewLayout = layout
collectionView.register(UINib(nibName: "ItemCell", bundle: nil), forCellWithReuseIdentifier: "ItemCell")
collectionView.selectItem(at:selectIdx, animated: false, scrollPosition: .left)
}
}
return view
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
if section == 3 {
if isYuShouShangPin == false {
return 0.001
}
}
if section == 2 {
if guiGeArr.count > 1 {
return 80
}
}
return 39
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
switch indexPath.section {
case 0: return 49
case 1:return 148.5
case 2:
if guiGeArr.count > 0 {
return 146
}
return 123.5
case 3:
if isYuShouShangPin == false {
return 0.01
}else{
return 49
}
case 4:return 49
default:
return 98
}
}
override func backAction() {
self.navigationController?.popViewController(animated: true)
}
} }
...@@ -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) {
let view = SendTimeSelectView(frame:self.view.bounds) if sendTimeView == nil {
self.view.addSubview(view) let view = SendTimeSelectView(frame:self.view.bounds)
view.delegate = self
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!
...@@ -51,7 +63,7 @@ class JiPaiFangShiViewController: BaseViewController { ...@@ -51,7 +63,7 @@ class JiPaiFangShiViewController: BaseViewController {
} }
func setYuanJiao(sender:UIView){ func setYuanJiao(sender:UIView){
let maskPath = UIBezierPath(roundedRect: sender.bounds, let maskPath = UIBezierPath(roundedRect: sender.bounds,
byRoundingCorners:[.bottomRight, .topRight], cornerRadii:CGSize(width:2, height:2)) byRoundingCorners:[.bottomRight, .topRight], cornerRadii:CGSize(width:2, height:2))
let masklayer = CAShapeLayer() let masklayer = CAShapeLayer()
masklayer.frame = sender.bounds masklayer.frame = sender.bounds
masklayer.path = maskPath.cgPath masklayer.path = maskPath.cgPath
...@@ -60,23 +72,23 @@ class JiPaiFangShiViewController: BaseViewController { ...@@ -60,23 +72,23 @@ class JiPaiFangShiViewController: BaseViewController {
@IBAction func sendAction(_ sender: UIButton) { @IBAction func sendAction(_ sender: UIButton) {
if sender == PLeftBtn { if sender == PLeftBtn {
PRightBtn.backgroundColor = UIColor.clear PRightBtn.backgroundColor = UIColor.clear
PRightBtn.isSelected = false PRightBtn.isSelected = false
PRightBtn.layer.borderWidth = 1 PRightBtn.layer.borderWidth = 1
PLeftBtn.isSelected = true PLeftBtn.isSelected = true
PLeftBtn.backgroundColor = UIColor(named: "蓝色字体颜色") PLeftBtn.backgroundColor = UIColor(named: "蓝色字体颜色")
PLeftBtn.layer.borderWidth = 0 PLeftBtn.layer.borderWidth = 0
}else{ }else{
PLeftBtn.backgroundColor = UIColor.clear PLeftBtn.backgroundColor = UIColor.clear
PLeftBtn.isSelected = false PLeftBtn.isSelected = false
PLeftBtn.layer.borderWidth = 1 PLeftBtn.layer.borderWidth = 1
PRightBtn.isSelected = true PRightBtn.isSelected = true
PRightBtn.backgroundColor = UIColor(named: "蓝色字体颜色") PRightBtn.backgroundColor = UIColor(named: "蓝色字体颜色")
PRightBtn.layer.borderWidth = 0 PRightBtn.layer.borderWidth = 0
} }
} }
...@@ -84,26 +96,26 @@ class JiPaiFangShiViewController: BaseViewController { ...@@ -84,26 +96,26 @@ class JiPaiFangShiViewController: BaseViewController {
@IBAction func getAction(_ sender: UIButton) { @IBAction func getAction(_ sender: UIButton) {
if sender == JLeftBtn { if sender == JLeftBtn {
JRightBtn.backgroundColor = UIColor.clear JRightBtn.backgroundColor = UIColor.clear
JRightBtn.isSelected = false JRightBtn.isSelected = false
JRightBtn.layer.borderWidth = 1 JRightBtn.layer.borderWidth = 1
JLeftBtn.isSelected = true JLeftBtn.isSelected = true
JLeftBtn.backgroundColor = UIColor(named: "蓝色字体颜色") JLeftBtn.backgroundColor = UIColor(named: "蓝色字体颜色")
JLeftBtn.layer.borderWidth = 0 JLeftBtn.layer.borderWidth = 0
timeViewHeight.constant = 45 timeViewHeight.constant = 45
}else{ }else{
JLeftBtn.backgroundColor = UIColor.clear JLeftBtn.backgroundColor = UIColor.clear
JLeftBtn.isSelected = false JLeftBtn.isSelected = false
JLeftBtn.layer.borderWidth = 1 JLeftBtn.layer.borderWidth = 1
timeViewHeight.constant = 0.01 timeViewHeight.constant = 0.01
JRightBtn.isSelected = true JRightBtn.isSelected = true
JRightBtn.backgroundColor = UIColor(named: "蓝色字体颜色") JRightBtn.backgroundColor = UIColor(named: "蓝色字体颜色")
JRightBtn.layer.borderWidth = 0 JRightBtn.layer.borderWidth = 0
} }
} }
......
...@@ -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)
}
}
} }
} }
} }
...@@ -21,58 +21,44 @@ ...@@ -21,58 +21,44 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<button opaque="NO" alpha="0.5" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Pzj-OB-7vE"> <button opaque="NO" alpha="0.5" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Pzj-OB-7vE">
<rect key="frame" x="0.0" y="44" width="414" height="818"/> <rect key="frame" x="0.0" y="-60" width="414" height="1016"/>
<color key="backgroundColor" name="标题字颜色"/> <color key="backgroundColor" name="标题字颜色"/>
<connections>
<action selector="closeAction:" destination="-1" eventType="touchUpInside" id="2Nl-ek-T0g"/>
</connections>
</button> </button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="NDY-nX-rrQ"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="NDY-nX-rrQ">
<rect key="frame" x="0.0" y="502" width="414" height="360"/> <rect key="frame" x="0.0" y="502" width="414" height="311"/>
<subviews> <subviews>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="bby-Me-LEh" customClass="LGButton" customModule="LGButton"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="期望上门时间" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YFX-9l-JIo">
<rect key="frame" x="0.0" y="311" width="414" height="49"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="gradientStartColor">
<color key="value" name="按钮渐变色上"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="gradientEndColor">
<color key="value" name="按钮渐变色下,字体颜色"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="boolean" keyPath="gradientHorizontal" value="YES"/>
<userDefinedRuntimeAttribute type="string" keyPath="titleString" value="确定"/>
<userDefinedRuntimeAttribute type="number" keyPath="titleFontSize">
<real key="value" value="17"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="string" keyPath="titleFontName" value="PingFangSC"/>
</userDefinedRuntimeAttributes>
<connections>
<action selector="submitAction:" destination="-1" eventType="touchUpInside" id="k6O-tJ-5iq"/>
</connections>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="期望上门时间" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YFX-9l-JIo">
<rect key="frame" x="0.0" y="0.0" width="414" height="50"/> <rect key="frame" x="0.0" y="0.0" width="414" height="50"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <constraints>
<constraint firstAttribute="height" constant="50" id="579-R7-5y6"/>
</constraints>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="15"/> <fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="15"/>
<color key="textColor" name="标题字颜色"/> <color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Qul-rX-gAx"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Qul-rX-gAx">
<rect key="frame" x="0.0" y="50" width="414" height="1"/> <rect key="frame" x="0.0" y="50" width="414" height="1"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" name="灰色分界线"/> <color key="backgroundColor" name="灰色分界线"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="atF-8h-2ur"/>
</constraints>
</view> </view>
<tableView clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="QvL-x6-Nh2"> <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="QvL-x6-Nh2">
<rect key="frame" x="0.0" y="51" width="120" height="260"/> <rect key="frame" x="0.0" y="51" width="120" height="260"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" name="搜索框背景色"/> <color key="backgroundColor" name="搜索框背景色"/>
<constraints>
<constraint firstAttribute="width" constant="120" id="5Zm-SS-f0u"/>
</constraints>
<connections> <connections>
<outlet property="dataSource" destination="-1" id="g69-0j-TlD"/> <outlet property="dataSource" destination="-1" id="g69-0j-TlD"/>
<outlet property="delegate" destination="-1" id="OFq-A5-YDR"/> <outlet property="delegate" destination="-1" id="OFq-A5-YDR"/>
</connections> </connections>
</tableView> </tableView>
<tableView clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="JWY-Hf-Cvn"> <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="JWY-Hf-Cvn">
<rect key="frame" x="120" y="51" width="294" height="260"/> <rect key="frame" x="120" y="51" width="294" height="260"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<connections> <connections>
<outlet property="dataSource" destination="-1" id="07f-lH-rDV"/> <outlet property="dataSource" destination="-1" id="07f-lH-rDV"/>
...@@ -81,26 +67,74 @@ ...@@ -81,26 +67,74 @@
</tableView> </tableView>
</subviews> </subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="JWY-Hf-Cvn" secondAttribute="trailing" id="0Vp-EF-sd0"/>
<constraint firstItem="Qul-rX-gAx" firstAttribute="leading" secondItem="NDY-nX-rrQ" secondAttribute="leading" id="1fY-uR-k7D"/>
<constraint firstItem="YFX-9l-JIo" firstAttribute="leading" secondItem="NDY-nX-rrQ" secondAttribute="leading" id="1yL-EO-dGc"/>
<constraint firstAttribute="bottom" secondItem="QvL-x6-Nh2" secondAttribute="bottom" id="5ZZ-Pc-nyE"/>
<constraint firstItem="Qul-rX-gAx" firstAttribute="top" secondItem="YFX-9l-JIo" secondAttribute="bottom" id="Jlg-y7-K0j"/>
<constraint firstItem="YFX-9l-JIo" firstAttribute="top" secondItem="NDY-nX-rrQ" secondAttribute="top" id="OG5-Zp-0Z5"/>
<constraint firstAttribute="trailing" secondItem="YFX-9l-JIo" secondAttribute="trailing" id="PXm-8u-5eA"/>
<constraint firstAttribute="height" constant="311" id="ekl-CL-hHJ"/>
<constraint firstItem="JWY-Hf-Cvn" firstAttribute="top" secondItem="Qul-rX-gAx" secondAttribute="bottom" id="elT-0f-lRU"/>
<constraint firstAttribute="bottom" secondItem="JWY-Hf-Cvn" secondAttribute="bottom" id="gOn-Sv-tbI"/>
<constraint firstItem="QvL-x6-Nh2" firstAttribute="top" secondItem="Qul-rX-gAx" secondAttribute="bottom" id="lqy-ZZ-FHd"/>
<constraint firstItem="JWY-Hf-Cvn" firstAttribute="leading" secondItem="QvL-x6-Nh2" secondAttribute="trailing" id="mqL-fT-aH2"/>
<constraint firstAttribute="trailing" secondItem="Qul-rX-gAx" secondAttribute="trailing" id="nbS-UW-E2K"/>
<constraint firstItem="QvL-x6-Nh2" firstAttribute="leading" secondItem="NDY-nX-rrQ" secondAttribute="leading" id="s7H-WP-h4P"/>
</constraints>
</view> </view>
<view alpha="0.5" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="vti-4i-27f"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="QPf-cc-IOc" customClass="LGButton" customModule="LGButton">
<rect key="frame" x="0.0" y="-6" width="414" height="50"/> <rect key="frame" x="0.0" y="813" width="414" height="83"/>
<color key="backgroundColor" name="标题字颜色"/> <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstAttribute="height" constant="83" id="QVy-lU-nMy"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="gradientStartColor">
<color key="value" name="按钮渐变色上"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="gradientEndColor">
<color key="value" name="按钮渐变色下,字体颜色"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="boolean" keyPath="gradientHorizontal" value="YES"/>
</userDefinedRuntimeAttributes>
<connections>
<action selector="submitAction:" destination="-1" eventType="valueChanged" id="paV-fh-4L7"/>
</connections>
</view> </view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Dmy-0B-RQj">
<rect key="frame" x="0.0" y="813" width="414" height="49"/>
<constraints>
<constraint firstAttribute="height" constant="49" id="Z5f-xt-94M"/>
</constraints>
<attributedString key="attributedText">
<fragment content="确定">
<attributes>
<color key="NSColor" name="白色背景色"/>
<font key="NSFont" size="17" name="PingFangSC-Medium"/>
<paragraphStyle key="NSParagraphStyle" alignment="center" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
</attributes>
</fragment>
</attributedString>
<nil key="highlightedColor"/>
</label>
</subviews> </subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints> <constraints>
<constraint firstItem="Pzj-OB-7vE" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="AFW-j5-u0x"/> <constraint firstItem="Pzj-OB-7vE" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="-60" id="6RX-jF-T34"/>
<constraint firstItem="Pzj-OB-7vE" firstAttribute="top" secondItem="vti-4i-27f" secondAttribute="bottom" id="E0r-R8-HJA"/> <constraint firstItem="Dmy-0B-RQj" firstAttribute="bottom" secondItem="vUN-kp-3ea" secondAttribute="bottom" id="BTL-Ju-jwq"/>
<constraint firstItem="vti-4i-27f" firstAttribute="trailing" secondItem="Pzj-OB-7vE" secondAttribute="trailing" id="Htb-Y8-LDS"/> <constraint firstItem="QPf-cc-IOc" firstAttribute="top" secondItem="NDY-nX-rrQ" secondAttribute="bottom" id="E3f-Jz-7zg"/>
<constraint firstAttribute="bottom" secondItem="vti-4i-27f" secondAttribute="bottom" constant="852" id="HwX-R9-csQ"/> <constraint firstAttribute="bottom" secondItem="Pzj-OB-7vE" secondAttribute="bottom" constant="-60" id="FOI-0h-ESL"/>
<constraint firstItem="vti-4i-27f" firstAttribute="leading" secondItem="Pzj-OB-7vE" secondAttribute="leading" id="NSW-Cb-lEn"/> <constraint firstItem="Pzj-OB-7vE" firstAttribute="trailing" secondItem="vUN-kp-3ea" secondAttribute="trailing" id="Pai-yb-WCE"/>
<constraint firstItem="vti-4i-27f" firstAttribute="leading" secondItem="NDY-nX-rrQ" secondAttribute="leading" id="R5o-xt-6cH"/> <constraint firstItem="Dmy-0B-RQj" firstAttribute="trailing" secondItem="vUN-kp-3ea" secondAttribute="trailing" id="UdG-mf-RzW"/>
<constraint firstItem="Pzj-OB-7vE" firstAttribute="bottom" secondItem="vUN-kp-3ea" secondAttribute="bottom" id="TPi-74-1lB"/> <constraint firstItem="Pzj-OB-7vE" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="Yxv-2q-Qip"/>
<constraint firstItem="vti-4i-27f" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="-6" id="UTz-6Q-eEg"/> <constraint firstItem="NDY-nX-rrQ" firstAttribute="trailing" secondItem="vUN-kp-3ea" secondAttribute="trailing" id="fXf-NH-dbm"/>
<constraint firstItem="NDY-nX-rrQ" firstAttribute="bottom" secondItem="vUN-kp-3ea" secondAttribute="bottom" id="bqN-Hs-EOD"/> <constraint firstItem="Dmy-0B-RQj" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="mfD-mV-IdW"/>
<constraint firstItem="Pzj-OB-7vE" firstAttribute="trailing" secondItem="vUN-kp-3ea" secondAttribute="trailing" id="kUF-Q8-JgT"/> <constraint firstItem="QPf-cc-IOc" firstAttribute="trailing" secondItem="vUN-kp-3ea" secondAttribute="trailing" id="qgh-vO-5VB"/>
<constraint firstItem="NDY-nX-rrQ" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="502" id="ptB-vl-YvK"/> <constraint firstAttribute="bottom" secondItem="QPf-cc-IOc" secondAttribute="bottom" id="sCY-pY-Dcu"/>
<constraint firstItem="vti-4i-27f" firstAttribute="trailing" secondItem="NDY-nX-rrQ" secondAttribute="trailing" id="q2A-wH-Xva"/> <constraint firstItem="QPf-cc-IOc" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="uMi-Hd-vIt"/>
<constraint firstItem="NDY-nX-rrQ" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="wUR-i3-vDQ"/>
</constraints> </constraints>
<viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/> <viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
<point key="canvasLocation" x="131.8840579710145" y="121.875"/> <point key="canvasLocation" x="131.8840579710145" y="121.875"/>
...@@ -111,7 +145,7 @@ ...@@ -111,7 +145,7 @@
<color red="0.3880000114440918" green="0.62400001287460327" blue="0.90200001001358032" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.3880000114440918" green="0.62400001287460327" blue="0.90200001001358032" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor> </namedColor>
<namedColor name="按钮渐变色下,字体颜色"> <namedColor name="按钮渐变色下,字体颜色">
<color red="0.27450980392156865" green="0.5607843137254902" blue="0.88627450980392153" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.27843137254901962" green="0.5607843137254902" blue="0.8901960784313725" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor> </namedColor>
<namedColor name="搜索框背景色"> <namedColor name="搜索框背景色">
<color red="0.9137254901960784" green="0.90588235294117647" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.9137254901960784" green="0.90588235294117647" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
...@@ -122,5 +156,8 @@ ...@@ -122,5 +156,8 @@
<namedColor name="灰色分界线"> <namedColor name="灰色分界线">
<color red="0.92941176470588238" green="0.92941176470588238" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.92941176470588238" green="0.92941176470588238" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor> </namedColor>
<namedColor name="白色背景色">
<color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources> </resources>
</document> </document>
...@@ -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