Commit 70168907 authored by lujunye's avatar lujunye

collectionView跳转串联

parent 5c1b463a
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "shanchu@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "shanchu@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
......@@ -7,10 +7,13 @@
//
import UIKit
@objc protocol AddGuiGeCellDelegate {
@objc optional func AddGuiGeCellClick(cell:AddGuiGeCell)
}
class AddGuiGeCell: UITableViewCell {
var delegate:AddGuiGeCellDelegate?
@IBAction func btnClick(_ sender: Any) {
delegate?.AddGuiGeCellClick?(cell: self)
}
@IBOutlet weak var imgBtn: UIButton!
override func awakeFromNib() {
......
......@@ -17,12 +17,17 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="100"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="WR0-yV-WjT">
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="moren" translatesAutoresizingMaskIntoConstraints="NO" id="WR0-yV-WjT">
<rect key="frame" x="15" y="15" width="70" height="70"/>
<constraints>
<constraint firstAttribute="height" constant="70" id="wQz-zj-1mU"/>
<constraint firstAttribute="width" constant="70" id="zUn-zO-Lh1"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="3"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="sender" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="k7A-Qs-Puc">
<rect key="frame" x="95" y="15" width="42" height="18.5"/>
......@@ -171,6 +176,7 @@
<resources>
<image name="daixuan" width="19" height="19"/>
<image name="guanlian" width="15.5" height="12.5"/>
<image name="moren" width="70" height="70"/>
<image name="yuxuan" width="19" height="19"/>
<namedColor name="企业、预售字体">
<color red="1" green="0.68999999761581421" blue="0.47099998593330383" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
......@@ -185,7 +191,7 @@
<color red="0.92941176470588238" green="0.92941176470588238" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="灰色字体颜色">
<color red="0.40000000596046448" green="0.40000000596046448" blue="0.40000000596046448" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>
......@@ -12,6 +12,8 @@ import UIKit
}
class TitleAndBtnCell: UITableViewCell {
var delegate:TitleAndBtnCellDelegate?
@IBOutlet weak var imgView: UIImageView!
@IBOutlet weak var btn: UIButton!
@IBOutlet weak var lineWidth: NSLayoutConstraint!
@IBOutlet weak var arrowImg: UIImageView!
@IBOutlet weak var contentLbl: UILabel!
......
......@@ -52,6 +52,24 @@
<constraint firstAttribute="height" constant="1" id="tUg-7c-ise"/>
</constraints>
</view>
<imageView hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="HSb-Uo-Ffy">
<rect key="frame" x="220" y="-13" width="70" height="70"/>
<constraints>
<constraint firstAttribute="height" constant="70" id="bTd-RW-kmX"/>
<constraint firstAttribute="width" constant="70" id="w93-Pg-zM5"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="3"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="borderColor">
<color key="value" name="搜索框背景色"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
<real key="value" value="0.5"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</imageView>
</subviews>
<constraints>
<constraint firstItem="7nL-vu-Tdl" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="0CE-BN-7lF"/>
......@@ -67,10 +85,12 @@
<userDefinedRuntimeAttribute type="boolean" keyPath="isAdaptateScreen" value="YES"/>
</userDefinedRuntimeAttributes>
</constraint>
<constraint firstItem="HSb-Uo-Ffy" firstAttribute="centerY" secondItem="VXU-ef-rsF" secondAttribute="centerY" id="IPI-in-Eb1"/>
<constraint firstAttribute="trailing" secondItem="Gf0-pG-ZDj" secondAttribute="trailing" constant="15" id="kO1-WA-Gey"/>
<constraint firstAttribute="bottom" secondItem="VXU-ef-rsF" secondAttribute="bottom" id="n4S-aO-XLT"/>
<constraint firstItem="VXU-ef-rsF" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="poY-Yq-IFn"/>
<constraint firstItem="7nL-vu-Tdl" firstAttribute="leading" secondItem="EfU-Eu-amU" secondAttribute="trailing" id="s1W-ZL-Aso"/>
<constraint firstItem="HSb-Uo-Ffy" firstAttribute="trailing" secondItem="Gf0-pG-ZDj" secondAttribute="trailing" constant="-15" id="vCg-rn-59B"/>
<constraint firstAttribute="bottom" secondItem="rLc-3F-snj" secondAttribute="bottom" id="z7b-6d-7aF"/>
<constraint firstAttribute="bottom" secondItem="7nL-vu-Tdl" secondAttribute="bottom" id="zGG-y9-TeV"/>
</constraints>
......@@ -78,7 +98,9 @@
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<connections>
<outlet property="arrowImg" destination="Gf0-pG-ZDj" id="uaE-Be-XYP"/>
<outlet property="btn" destination="VXU-ef-rsF" id="92Z-x4-AVW"/>
<outlet property="contentLbl" destination="7nL-vu-Tdl" id="sEW-G5-GaR"/>
<outlet property="imgView" destination="HSb-Uo-Ffy" id="9RM-uK-s3I"/>
<outlet property="lineWidth" destination="EUi-Y9-d4w" id="0on-lp-cbT"/>
<outlet property="nameLbl" destination="EfU-Eu-amU" id="XOH-Zx-SHi"/>
</connections>
......@@ -87,6 +109,9 @@
</objects>
<resources>
<image name="jinruDetail" width="4.5" height="9"/>
<namedColor name="搜索框背景色">
<color red="0.9137254901960784" green="0.90588235294117647" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="标题字颜色">
<color red="0.18000000715255737" green="0.18000000715255737" blue="0.18000000715255737" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
......@@ -94,7 +119,7 @@
<color red="0.92941176470588238" green="0.92941176470588238" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="灰色字体颜色">
<color red="0.40000000596046448" green="0.40000000596046448" blue="0.40000000596046448" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>
......@@ -7,16 +7,22 @@
//
import UIKit
@objc protocol TitleAndOnlyBtnCellDelegate {
@objc optional func TitleAndOnlyBtnCellBtnClick(cell:TitleAndOnlyBtnCell)
@objc optional func TitleAndOnlyBtnCellEditBtnClick(cell:TitleAndOnlyBtnCell)
}
class TitleAndOnlyBtnCell: UITableViewCell {
var delegate:TitleAndOnlyBtnCellDelegate?
@IBAction func selectImgAction(_ sender: Any) {
delegate?.TitleAndOnlyBtnCellBtnClick?(cell: self)
}
@IBOutlet weak var imgBgView: UIView!
@IBOutlet weak var imgView: UIImageView!
@IBOutlet weak var button: UIButton!
@IBAction func editAction(_ sender: Any) {
delegate?.TitleAndOnlyBtnCellEditBtnClick?(cell: self)
}
@IBOutlet weak var titleLbl: UILabel!
override func awakeFromNib() {
......
......@@ -27,7 +27,7 @@
<color key="titleColor" name="蓝色字体颜色"/>
</state>
<connections>
<action selector="editAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="9ec-99-TPg"/>
<action selector="selectImgAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="MC4-pu-O2G"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="标题" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kTB-YG-ytP">
......@@ -74,7 +74,7 @@
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="RqJ-Pm-7z4">
<rect key="frame" x="115" y="0.0" width="35" height="100"/>
<connections>
<action selector="selectImgAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="2sB-QX-soP"/>
<action selector="editAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="xhC-vf-Kd9"/>
</connections>
</button>
</subviews>
......
......@@ -13,6 +13,7 @@ import UIKit
class TitleAndSelectCell: UITableViewCell {
var delegate:TitleAndSelectCellDelegate?
@IBOutlet weak var selectBtn: UIButton!
@IBOutlet weak var line: UIView!
@IBAction func selectClick(_ sender: UIButton) {
delegate?.TitleAndSelectCellClick?(content: sender, cell: self)
}
......
......@@ -34,8 +34,17 @@
<action selector="selectClick:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="s1q-8q-wPh"/>
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="LBE-H5-roD">
<rect key="frame" x="15" y="0.0" width="305" height="1"/>
<color key="backgroundColor" name="灰色分界线"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="kMV-gg-KFH"/>
</constraints>
</view>
</subviews>
<constraints>
<constraint firstItem="LBE-H5-roD" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="1LE-hY-HgS"/>
<constraint firstItem="LBE-H5-roD" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="DIA-7g-f77"/>
<constraint firstItem="4Hx-2L-jWw" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="GnK-Zb-hVm">
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isAdaptateScreen" value="YES"/>
......@@ -43,6 +52,7 @@
</constraint>
<constraint firstItem="nmk-ai-I5m" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="Qle-nk-kP9"/>
<constraint firstAttribute="trailing" secondItem="4Hx-2L-jWw" secondAttribute="trailing" id="ZYQ-eh-y1K"/>
<constraint firstAttribute="trailing" secondItem="LBE-H5-roD" secondAttribute="trailing" id="gLI-1M-XFu"/>
<constraint firstAttribute="bottom" secondItem="4Hx-2L-jWw" secondAttribute="bottom" id="hYK-3c-bmk"/>
<constraint firstItem="4Hx-2L-jWw" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="vAt-h5-RDj"/>
<constraint firstAttribute="bottom" secondItem="nmk-ai-I5m" secondAttribute="bottom" id="y5f-9e-nDa"/>
......@@ -55,10 +65,11 @@
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<connections>
<outlet property="line" destination="LBE-H5-roD" id="c4o-gG-gD0"/>
<outlet property="selectBtn" destination="nmk-ai-I5m" id="Ds3-GX-gVv"/>
<outlet property="titleLbl" destination="4Hx-2L-jWw" id="1dE-sY-xMj"/>
</connections>
<point key="canvasLocation" x="132" y="122"/>
<point key="canvasLocation" x="131.8840579710145" y="121.875"/>
</tableViewCell>
</objects>
<resources>
......@@ -67,5 +78,8 @@
<namedColor name="标题字颜色">
<color red="0.18000000715255737" green="0.18000000715255737" blue="0.18000000715255737" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="灰色分界线">
<color red="0.92941176470588238" green="0.92941176470588238" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>
......@@ -7,9 +7,13 @@
//
import UIKit
@objc protocol TitleAndTFAndBtnCellDelegate {
@objc optional func TitleAndTFAndBtnCellBtnClick()
}
class TitleAndTFAndBtnCell: UITableViewCell {
var delegate:TitleAndTFAndBtnCellDelegate?
@IBAction func adressBtnClick(_ sender: Any) {
delegate?.TitleAndTFAndBtnCellBtnClick?()
}
@IBOutlet weak var titleLbl: UILabel!
......
......@@ -35,16 +35,16 @@
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="dingwei" translatesAutoresizingMaskIntoConstraints="NO" id="39q-TE-sPp">
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="dzdingwei" translatesAutoresizingMaskIntoConstraints="NO" id="39q-TE-sPp">
<rect key="frame" x="347" y="16" width="14" height="17"/>
<constraints>
<constraint firstAttribute="width" constant="14" id="gkC-Mw-BcZ"/>
<constraint firstAttribute="height" constant="17" id="q8D-q4-voQ"/>
<constraint firstAttribute="height" constant="17" id="EYG-Zs-c4A"/>
<constraint firstAttribute="width" constant="14" id="Kai-ig-cv8"/>
</constraints>
</imageView>
<button opaque="NO" alpha="0.5" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bwc-Q5-ss2">
<rect key="frame" x="343" y="0.0" width="32" height="49"/>
<color key="backgroundColor" red="1" green="0.68026518489999999" blue="0.40248129399999999" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<connections>
<action selector="adressBtnClick:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="TFs-Rt-XxY"/>
</connections>
......@@ -60,15 +60,15 @@
<constraints>
<constraint firstAttribute="bottom" secondItem="bwc-Q5-ss2" secondAttribute="bottom" id="1fZ-DZ-3E5"/>
<constraint firstItem="eEc-iL-cFf" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="4eB-ea-kj1"/>
<constraint firstItem="39q-TE-sPp" firstAttribute="centerY" secondItem="Vjh-6z-siE" secondAttribute="centerY" id="8EO-Jh-qqi"/>
<constraint firstAttribute="trailing" secondItem="39q-TE-sPp" secondAttribute="trailing" constant="14" id="75r-ph-qAW"/>
<constraint firstItem="r0w-jb-SPa" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="8HA-oK-W1G"/>
<constraint firstAttribute="trailing" secondItem="r0w-jb-SPa" secondAttribute="trailing" id="8wP-2s-Ejq"/>
<constraint firstAttribute="trailing" secondItem="39q-TE-sPp" secondAttribute="trailing" constant="14" id="A2n-ca-AoG"/>
<constraint firstItem="bwc-Q5-ss2" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="I3L-Hd-pqh"/>
<constraint firstItem="bwc-Q5-ss2" firstAttribute="leading" secondItem="Vjh-6z-siE" secondAttribute="trailing" constant="5" id="ToH-64-Q5M"/>
<constraint firstAttribute="bottom" secondItem="r0w-jb-SPa" secondAttribute="bottom" id="fnr-U8-qwJ"/>
<constraint firstAttribute="trailing" secondItem="bwc-Q5-ss2" secondAttribute="trailing" id="iAh-MP-EpF"/>
<constraint firstAttribute="trailing" secondItem="Vjh-6z-siE" secondAttribute="trailing" constant="37" id="k28-XJ-GC7"/>
<constraint firstItem="39q-TE-sPp" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="kaz-gR-W9G"/>
<constraint firstItem="Vjh-6z-siE" firstAttribute="centerY" secondItem="eEc-iL-cFf" secondAttribute="centerY" id="ldC-dl-C90"/>
<constraint firstItem="eEc-iL-cFf" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="vBQ-UK-oG0"/>
<constraint firstItem="Vjh-6z-siE" firstAttribute="leading" secondItem="eEc-iL-cFf" secondAttribute="trailing" constant="10" id="yXZ-cg-Vkf"/>
......@@ -83,7 +83,7 @@
</tableViewCell>
</objects>
<resources>
<image name="dingwei" width="14" height="17"/>
<image name="dzdingwei" width="14" height="17"/>
<namedColor name="标题字颜色">
<color red="0.18000000715255737" green="0.18000000715255737" blue="0.18000000715255737" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
......
......@@ -11,14 +11,14 @@
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="TitleAndTFCell" customModule="GeliBusinessPlatform" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="320" height="50"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="50"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="320" height="50"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="50"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="zvz-cN-gmt">
<rect key="frame" x="15" y="49" width="305" height="1"/>
<rect key="frame" x="15" y="49" width="360" height="1"/>
<color key="backgroundColor" name="灰色分界线"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="qV8-4M-UFb"/>
......@@ -31,7 +31,7 @@
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入内容" textAlignment="right" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="Q6V-I9-aNd">
<rect key="frame" x="65" y="15.5" width="240" height="19"/>
<rect key="frame" x="65" y="15.5" width="295" height="19"/>
<color key="textColor" name="标题字颜色"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<textInputTraits key="textInputTraits"/>
......
......@@ -116,7 +116,7 @@
</imageView>
<button opaque="NO" alpha="0.5" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="PKT-ps-1jb">
<rect key="frame" x="226.5" y="-5.5" width="30" height="30"/>
<color key="backgroundColor" systemColor="systemIndigoColor" red="0.34509803919999998" green="0.33725490200000002" blue="0.83921568629999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="30" id="CQg-fc-t1x"/>
<constraint firstAttribute="height" constant="30" id="enX-y3-FNN"/>
......@@ -127,7 +127,7 @@
</button>
<button opaque="NO" alpha="0.5" tag="1" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ApV-Jy-dQR">
<rect key="frame" x="339" y="-5.5" width="30" height="30"/>
<color key="backgroundColor" red="0.0" green="0.20784313730000001" blue="0.63137254899999995" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="30" id="9Mx-0J-NeB"/>
<constraint firstAttribute="height" constant="30" id="hP6-Ad-IOi"/>
......@@ -267,7 +267,7 @@
<color red="0.92941176470588238" green="0.92941176470588238" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="灰色字体颜色">
<color red="0.40000000596046448" green="0.40000000596046448" blue="0.40000000596046448" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="蓝色字体颜色">
<color red="0.27799999713897705" green="0.56099998950958252" blue="0.88999998569488525" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
......
......@@ -51,7 +51,7 @@
</imageView>
<button opaque="NO" alpha="0.5" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="eKc-LO-OD0">
<rect key="frame" x="85" y="-5" width="40" height="40"/>
<color key="backgroundColor" red="1" green="0.68026518489999999" blue="0.40248129399999999" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="Qu8-tq-Vzl"/>
<constraint firstAttribute="width" constant="40" id="xwK-5A-mHO"/>
......@@ -158,7 +158,7 @@
<color red="0.92941176470588238" green="0.92941176470588238" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="灰色字体颜色">
<color red="0.40000000596046448" green="0.40000000596046448" blue="0.40000000596046448" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="白色背景色">
<color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
......
......@@ -8,8 +8,10 @@
import UIKit
class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,UITableViewDelegate,DaiKeXiaDanFooterViewDelegate{
class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,UITableViewDelegate,DaiKeXiaDanFooterViewDelegate,TitleAndBtnCellDelegate,GLAlertSelectViewDelegate{
var glSelectView:GLAlertSelectView? = nil
var holderArr = ["未支付","未付款","自提","暂不出库","0","0"]
let p3Arr = ["支付状态","支付方式","提货方式","出货状态","运费","其他费用"]
var footerView:DaiKeXiaDanFooterView?
var itemArr = NSMutableArray()
......@@ -34,16 +36,16 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
//TitleAndBtnCell TitleAndTFCell
// Do any additional setup after loading the view.
}
@objc func addProductAction(){
print("添加商品")
}
//MARK: - cell delegate
func addAction() {
itemArr.add("0")
UIView.performWithoutAnimation {
let set = NSIndexSet(index: 1)
listView.reloadSections(set as IndexSet, with: .none)
}
let vc = XuanZeShangPinViewController()
self.navigationController?.pushViewController(vc, animated: true)
// itemArr.add("0")
// UIView.performWithoutAnimation {
// let set = NSIndexSet(index: 1)
// listView.reloadSections(set as IndexSet, with: .none)
// }
}
//footer
......@@ -112,14 +114,88 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
}
return 49
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
switch indexPath.section {
case 0:
if indexPath.row == 0 {
let vc = GuanLianKehuVC()
self.navigationController?.pushViewController(vc, animated: true)
}else{
if glSelectView == nil {
let view = GLAlertSelectView(frame: self.view.bounds)
view.isMultipleSelect = false//是否多选
view.delegate = self
view.titleLbl.text = "请选择订单类型"
view.dataArr = ["普通订单","预售下单"]
self.view.addSubview(view)
glSelectView = view
}
}
break
case 1:
break
default:
break
}
}
func btnClick(content: String, cell: TitleAndBtnCell) {
if glSelectView == nil {
let view = GLAlertSelectView(frame: self.view.bounds)
view.isMultipleSelect = false//是否多选
view.delegate = self
switch cell.tag {
case 0://支付状态
view.titleLbl.text = "请选择\(p3Arr[cell.tag])"
view.dataArr = ["预售","普通","期货","团购"]
break
case 1://支付方式
view.titleLbl.text = "请选择\(p3Arr[cell.tag])"
view.dataArr = ["预售","普通","期货","团购"]
break
case 2://提货方式
view.titleLbl.text = "请选择\(p3Arr[cell.tag])"
view.dataArr = ["预售","普通","期货","团购"]
break
default://出货状态
view.titleLbl.text = "请选择\(p3Arr[cell.tag])"
view.dataArr = ["预售","普通","期货","团购"]
break
}
self.view.addSubview(view)
glSelectView = view
}
}
func GLAlertSelectViewClick(selectNum: Int, view: UIView) {
print("单选",selectNum)
glSelectView?.removeFromSuperview()
glSelectView = nil
}
func GLAlertMoreSelectViewClick(sender: NSArray, view:UIView) {
print("多选",sender)
glSelectView?.removeFromSuperview()
glSelectView = nil
}
func GLAlertSelectViewClose(sender: UIButton) {
glSelectView?.removeFromSuperview()
glSelectView = nil
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
switch indexPath.section {
case 0:
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndBtnCell") as! TitleAndBtnCell
if indexPath.row == 0 {
cell.nameLbl.text = "客户:"
cell.contentLbl.text = "请选择关联客户"
}
if indexPath.row == 1 {
cell.nameLbl.text = "订单类型:"
cell.contentLbl.text = "请选择订单类型"
}
cell.btn.isUserInteractionEnabled = false
return cell
case 1:
let cell = tableView.dequeueReusableCell(withIdentifier: "DaiKeXiaDanGouWuCell") as! DaiKeXiaDanGouWuCell
......@@ -127,7 +203,10 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
default:
if indexPath.row < 4 {
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndBtnCell") as! TitleAndBtnCell
cell.delegate = self
cell.nameLbl.text = p3Arr[indexPath.row]
cell.contentLbl.text = holderArr[indexPath.row]
cell.tag = indexPath.row
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell
......
......@@ -8,32 +8,52 @@
import UIKit
class XuanZeShangPinViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,XuanZeShangPinCellDelegate{
class XuanZeShangPinViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,XuanZeShangPinCellDelegate,UISearchBarDelegate,SearchBarViewDelegate{
//XuanZeShangPinCell
var searchV : SearchBarView? = nil
//XuanZeShangPinCell
@IBAction func submitAction(_ sender: Any) {
}
var idx:IndexPath?
@IBOutlet weak var btmLbl: UILabel!
@IBOutlet weak var listView: UITableView!
@IBOutlet weak var topView: UIView!
override func viewDidLoad() {
super.viewDidLoad()
navbar.title = "选择商品"
self.view.addSubview(navbar)
listView.separatorStyle = .none
listView.snp.makeConstraints { (make) in
make.top.equalTo(NavCGRect.height)
make.left.right.equalTo(0)
make.bottom.equalTo(btmLbl.snp_top)
SetTopFrame(view: topView, height: 44)
let searchBr = SearchBarView.init()
topView.addSubview(searchBr)
searchBr.snp.makeConstraints { (make) in
make.left.equalTo(10)
make.right.equalTo(-10)
make.centerY.equalToSuperview()
make.height.equalTo(30)
}
searchV = searchBr
searchBr.placeholderStr = "请输入品牌名称/商品编码"
searchBr.cornerRadius = 30*0.5
searchBr.delegate = self
searchBr.delegateL = self
listView.register(UINib(nibName: "XuanZeShangPinCell", bundle: nil), forCellReuseIdentifier: "XuanZeShangPinCell")
}
func clearSearchAction() {
print("清楚搜索文字")
}
func searchBarSearchButtonClicked(_ searchBar: UISearchBar) {
print("点击搜索进行--")
searchBar.resignFirstResponder()
//MARK: - cell delegate
}
//MARK: - cell delegate
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 8
}
......
......@@ -12,6 +12,7 @@
<connections>
<outlet property="btmLbl" destination="5Kt-Ig-zbb" id="fUx-No-8SV"/>
<outlet property="listView" destination="YuT-X7-ecw" id="wKf-Ej-i9r"/>
<outlet property="topView" destination="czv-6x-Jkg" id="kMR-43-Prh"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
......@@ -46,27 +47,37 @@
<nil key="highlightedColor"/>
</label>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="YuT-X7-ecw">
<rect key="frame" x="0.0" y="44" width="414" height="769"/>
<rect key="frame" x="0.0" y="88" width="414" height="725"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<connections>
<outlet property="dataSource" destination="-1" id="pf9-cD-hFe"/>
<outlet property="delegate" destination="-1" id="kFX-d5-Tz7"/>
</connections>
</tableView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="czv-6x-Jkg">
<rect key="frame" x="0.0" y="44" width="414" height="44"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstAttribute="height" constant="44" id="SDE-Q6-JnV"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="YuT-X7-ecw" secondAttribute="trailing" id="9Rc-E2-u9s"/>
<constraint firstItem="YuT-X7-ecw" firstAttribute="top" secondItem="czv-6x-Jkg" secondAttribute="bottom" id="70Q-Qt-Cgd"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="5Kt-Ig-zbb" secondAttribute="trailing" id="9nZ-Ef-l1a"/>
<constraint firstItem="IB6-lV-KWZ" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="BdU-A8-HfN"/>
<constraint firstItem="IB6-lV-KWZ" firstAttribute="top" secondItem="5Kt-Ig-zbb" secondAttribute="top" id="Bw1-yn-w9z"/>
<constraint firstItem="YuT-X7-ecw" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="LVQ-qR-vHK"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="czv-6x-Jkg" secondAttribute="trailing" id="CVu-Ly-yEo"/>
<constraint firstItem="YuT-X7-ecw" firstAttribute="trailing" secondItem="fnl-2z-Ty3" secondAttribute="trailing" id="CeF-wt-3Pe"/>
<constraint firstItem="5Kt-Ig-zbb" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="Zxi-kb-DhB"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="5Kt-Ig-zbb" secondAttribute="bottom" id="aeg-df-E1I"/>
<constraint firstItem="IB6-lV-KWZ" firstAttribute="top" secondItem="YuT-X7-ecw" secondAttribute="bottom" id="uUk-FK-syJ"/>
<constraint firstItem="YuT-X7-ecw" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="eRL-ku-YjT"/>
<constraint firstItem="IB6-lV-KWZ" firstAttribute="top" secondItem="YuT-X7-ecw" secondAttribute="bottom" id="oo2-zd-D8w"/>
<constraint firstAttribute="trailing" secondItem="IB6-lV-KWZ" secondAttribute="trailing" id="v8D-Yo-QxM"/>
<constraint firstAttribute="bottom" secondItem="IB6-lV-KWZ" secondAttribute="bottom" id="w8M-CY-ifc"/>
<constraint firstItem="YuT-X7-ecw" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="xFN-or-L0x"/>
<constraint firstItem="czv-6x-Jkg" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="xab-I0-cj9"/>
<constraint firstItem="czv-6x-Jkg" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="y1o-em-TkH"/>
</constraints>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<point key="canvasLocation" x="131.8840579710145" y="121.875"/>
......
......@@ -159,7 +159,7 @@
<color red="0.92941176470588238" green="0.92941176470588238" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="灰色字体颜色">
<color red="0.40000000596046448" green="0.40000000596046448" blue="0.40000000596046448" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>
......@@ -9,7 +9,7 @@
import UIKit
import LGButton
class GYSGLViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource{
class GYSGLViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,TitleAndTFAndBtnCellDelegate,TitleAndOnlyBtnCellDelegate{
var gysName:String = ""
var dzStr:String = ""
......@@ -39,8 +39,9 @@ class GYSGLViewController: BaseViewController,UITableViewDelegate,UITableViewDat
btmBtn.alpha = 0.5
btmBtn.isUserInteractionEnabled = false
}
//测试
//测试有无图片状态数据
img1 = UIImage()
}
let titleArr = ["基本信息","联系人信息","其它信息"]
//MARK: - cell delegate
......@@ -105,6 +106,7 @@ class GYSGLViewController: BaseViewController,UITableViewDelegate,UITableViewDat
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFAndBtnCell") as! TitleAndTFAndBtnCell
cell.titleLbl.text = sec1Arr[indexPath.row]
cell.textTF.placeholder = hold1Arr[indexPath.row]
cell.delegate = self
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell
......@@ -120,6 +122,7 @@ class GYSGLViewController: BaseViewController,UITableViewDelegate,UITableViewDat
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndOnlyBtnCell") as! TitleAndOnlyBtnCell
cell.titleLbl.text = sec3Arr[indexPath.row]
cell.button.setTitle("上传", for: .normal)
cell.delegate = self
if img1 != nil {
if indexPath.row == 0 {
cell.imgBgView.isHidden = false
......@@ -136,5 +139,15 @@ class GYSGLViewController: BaseViewController,UITableViewDelegate,UITableViewDat
return cell
}
}
//自定义cell delegate
func TitleAndOnlyBtnCellEditBtnClick(cell: TitleAndOnlyBtnCell) {
print("编辑图片")
}
func TitleAndOnlyBtnCellBtnClick(cell: TitleAndOnlyBtnCell) {
print("选择图片")
}
func TitleAndTFAndBtnCellBtnClick() {
let vc = SJMapViewController()
self.navigationController?.pushViewController(vc, animated: true)
}
}
//
// GYSListViewController.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/5/8.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
class GYSListViewController: BaseViewController,UITableViewDataSource,UITableViewDelegate,UISearchBarDelegate,SearchBarViewDelegate{
var searchV : SearchBarView? = nil
@IBOutlet weak var topView: UIView!
@IBOutlet weak var btmLbl: UILabel!
@IBOutlet weak var listView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
navbar.title = "供应商管理"
self.view.addSubview(navbar)
let searchBr = SearchBarView.init()
topView.addSubview(searchBr)
searchBr.snp.makeConstraints { (make) in
make.left.equalTo(10)
make.right.equalTo(-10)
make.centerY.equalToSuperview()
make.height.equalTo(30)
}
searchV = searchBr
searchBr.placeholderStr = "供应商名称/联系人/电话号码"
searchBr.cornerRadius = 30*0.5
searchBr.delegate = self
searchBr.delegateL = self
SetTopFrame(view: topView, height: 44)
listView.separatorStyle = .none
listView.register(UINib(nibName: "GYSGLCell", bundle: nil), forCellReuseIdentifier: "GYSGLCell")
// Do any additional setup after loading the view.
}
@IBAction func addAction(_ sender: Any) {
}
//MARK: - 自定义DELEGATE
func clearSearchAction() {
}
//MARK: - CELL DELEGATE
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let vc = GYSGLViewController()
self.navigationController?.pushViewController(vc, animated: true)
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 105.5
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 3
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "GYSGLCell") as! GYSGLCell
return cell
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="GYSListViewController" customModule="GeliBusinessPlatform" customModuleProvider="target">
<connections>
<outlet property="btmLbl" destination="z9e-bT-lDi" id="BcP-Rc-hrF"/>
<outlet property="listView" destination="Qqa-3M-ZQN" id="jPb-Zb-3ct"/>
<outlet property="topView" destination="WnZ-DY-vHR" id="XMu-Wk-fUB"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9kx-tK-PfB" 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="addAction:" destination="-1" eventType="touchUpInside" id="zO7-w9-pFi"/>
</connections>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="新增" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="z9e-bT-lDi">
<rect key="frame" x="0.0" y="813" width="414" height="49"/>
<constraints>
<constraint firstAttribute="height" constant="49" id="wVI-Ir-3Mv"/>
</constraints>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="17"/>
<color key="textColor" name="白色背景色"/>
<nil key="highlightedColor"/>
</label>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="Qqa-3M-ZQN">
<rect key="frame" x="0.0" y="88" width="414" height="725"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<connections>
<outlet property="dataSource" destination="-1" id="TVJ-KE-qtq"/>
<outlet property="delegate" destination="-1" id="QYO-PN-ejg"/>
</connections>
</tableView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="WnZ-DY-vHR">
<rect key="frame" x="0.0" y="44" width="414" height="44"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstAttribute="height" constant="44" id="w6B-Wh-pPi"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="9kx-tK-PfB" firstAttribute="top" secondItem="z9e-bT-lDi" secondAttribute="top" id="0NX-2N-3lZ"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="z9e-bT-lDi" secondAttribute="trailing" id="1tN-8Q-GT2"/>
<constraint firstItem="WnZ-DY-vHR" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="2mi-zr-Yva"/>
<constraint firstItem="Qqa-3M-ZQN" firstAttribute="top" secondItem="WnZ-DY-vHR" secondAttribute="bottom" id="4rW-cQ-kze"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="z9e-bT-lDi" secondAttribute="bottom" id="6TD-5Y-pYJ"/>
<constraint firstAttribute="trailing" secondItem="9kx-tK-PfB" secondAttribute="trailing" id="96j-cI-Iqa"/>
<constraint firstItem="9kx-tK-PfB" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="ChR-lV-J3e"/>
<constraint firstItem="9kx-tK-PfB" firstAttribute="top" secondItem="Qqa-3M-ZQN" secondAttribute="bottom" id="HWT-td-3YR"/>
<constraint firstItem="Qqa-3M-ZQN" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="JW9-f8-KXu"/>
<constraint firstItem="z9e-bT-lDi" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="L1D-ab-UEl"/>
<constraint firstItem="WnZ-DY-vHR" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="TWT-lE-SpD"/>
<constraint firstItem="Qqa-3M-ZQN" firstAttribute="trailing" secondItem="fnl-2z-Ty3" secondAttribute="trailing" id="ZEj-0r-CwC"/>
<constraint firstAttribute="bottom" secondItem="9kx-tK-PfB" secondAttribute="bottom" id="il2-ke-p14"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="WnZ-DY-vHR" secondAttribute="trailing" id="ooy-cD-b4B"/>
</constraints>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<point key="canvasLocation" x="131.8840579710145" y="131.91964285714286"/>
</view>
</objects>
<resources>
<namedColor name="按钮渐变色上">
<color red="0.3880000114440918" green="0.62400001287460327" blue="0.90200001001358032" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="按钮渐变色下,字体颜色">
<color red="0.27843137254901962" green="0.5607843137254902" blue="0.8901960784313725" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="白色背景色">
<color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>
//
// DZGLTableView.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/5/8.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
class DZGLTableView: UITableView {
override func layoutSubviews() {
super.layoutSubviews()
if #available(iOS 11.0, *) {
for subview in self.subviews where subview.isKind(of: NSClassFromString("UISwipeActionPullView")!) {
subview.backgroundColor = UIColor(named: "#F57575")
for view in subview.subviews where view.isKind(of: NSClassFromString("UISwipeActionStandardButton")!) {
view.backgroundColor = UIColor(named: "#F57575")
let deleteBtn = setupDeleteBtn(frame: CGRect(x: 0, y: 0, width: 65, height: self.bounds.size.height))
view.addSubview(deleteBtn)
view.bringSubviewToFront(deleteBtn)
}
}
} else { // IOS 10以及以下
for subview in subviews where subview.isKind(of: NSClassFromString("UITableViewCellDeleteConfirmationView")!) {
subview.backgroundColor = UIColor(named: "#F57575")
for view in subview.subviews where view.isKind(of: UIButton.self) {
view.backgroundColor = UIColor(named: "#F57575")
let deleteBtn = setupDeleteBtn(frame: view.frame)
view.addSubview(deleteBtn)
view.bringSubviewToFront(deleteBtn)
}
}
}
}
private func setupDeleteBtn(frame: CGRect) -> UIButton {
let deleteBtn = UIButton(type: .custom)
deleteBtn.frame = frame
deleteBtn.backgroundColor = UIColor(named: "#F57575")
deleteBtn.setImage(UIImage(named: "shanchuWhite"), for: .normal)
return deleteBtn
}
}
//
// DZGLViewController.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/5/7.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource{
@IBOutlet weak var listView: DZGLTableView!
override func viewDidLoad() {
super.viewDidLoad()
navbar.title = "地址管理"
navbar.rightTitle = "新增"
self.view.addSubview(navbar)
listView.separatorStyle = .none
SetTopFrame(view: listView, height: fullScreenHeight-NavCGRect.height)
listView.register(UINib(nibName: "DiZhiGuanLiCell", bundle: nil), forCellReuseIdentifier: "DiZhiGuanLiCell")
// Do any additional setup after loading the view.
}
func rightBtnClick() {
let vc = XinZengDiZhiViewController()
vc.navTitle = "新增地址"
self.navigationController?.pushViewController(vc, animated: true)
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 3
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 49
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "DiZhiGuanLiCell") as! DiZhiGuanLiCell
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
print(indexPath.row)
let vc = XinZengDiZhiViewController()
vc.navTitle = "编辑地址"
self.navigationController?.pushViewController(vc, animated: true)
}
//MARK:- 左滑删除
func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
return true
}
func tableView(_ tableView: UITableView, editingStyleForRowAt indexPath: IndexPath) -> UITableViewCell.EditingStyle {
return .delete
}
func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) {
let cell = tableView.cellForRow(at: indexPath) as! DiZhiGuanLiCell
print(cell.nameLbl.text)
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="DZGLViewController" customModule="GeliBusinessPlatform" customModuleProvider="target">
<connections>
<outlet property="listView" destination="PT0-ms-ns9" id="I4E-LU-xmE"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="PT0-ms-ns9" customClass="DZGLTableView" customModule="GeliBusinessPlatform" customModuleProvider="target">
<rect key="frame" x="0.0" y="44" width="414" height="818"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<connections>
<outlet property="dataSource" destination="-1" id="S9q-iF-ucu"/>
<outlet property="delegate" destination="-1" id="GCo-1t-z5P"/>
</connections>
</tableView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="PT0-ms-ns9" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="CdY-4j-SHV"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="PT0-ms-ns9" secondAttribute="trailing" id="ZJi-7I-Sxa"/>
<constraint firstItem="PT0-ms-ns9" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="gk5-jK-11s"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="PT0-ms-ns9" secondAttribute="bottom" id="ix1-ZR-9a5"/>
</constraints>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<point key="canvasLocation" x="133" y="132"/>
</view>
</objects>
</document>
......@@ -10,6 +10,11 @@ import UIKit
class DiZhiGuanLiCell: UITableViewCell {
@IBOutlet weak var adrLbl: UILabel!
@IBOutlet weak var yellowLbl: UILabel!
@IBOutlet weak var blueLbl: UILabel!
@IBOutlet weak var phoneLbl: UILabel!
@IBOutlet weak var nameLbl: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
self.selectionStyle = .none
......
......@@ -49,7 +49,7 @@
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="寄" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jf6-0X-5eB">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="寄" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jf6-0X-5eB">
<rect key="frame" x="159" y="16.5" width="18" height="18"/>
<constraints>
<constraint firstAttribute="width" constant="18" id="Euu-6m-2fN"/>
......@@ -70,7 +70,7 @@
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="收" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mWp-V0-KaZ">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="收" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mWp-V0-KaZ">
<rect key="frame" x="187" y="16.5" width="18" height="18"/>
<constraints>
<constraint firstAttribute="width" constant="18" id="Zrg-2c-fbB"/>
......@@ -128,6 +128,13 @@
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<connections>
<outlet property="adrLbl" destination="SOh-hJ-gKS" id="L7w-a5-WXV"/>
<outlet property="blueLbl" destination="jf6-0X-5eB" id="8kh-Kf-KNP"/>
<outlet property="nameLbl" destination="vAQ-5q-KPr" id="Z7m-rl-JTe"/>
<outlet property="phoneLbl" destination="0Zd-v3-Vtu" id="3CH-Ai-KUY"/>
<outlet property="yellowLbl" destination="mWp-V0-KaZ" id="La4-PQ-SDN"/>
</connections>
<point key="canvasLocation" x="131.15942028985509" y="121.54017857142857"/>
</tableViewCell>
</objects>
......@@ -143,7 +150,7 @@
<color red="0.92941176470588238" green="0.92941176470588238" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="灰色字体颜色">
<color red="0.40000000596046448" green="0.40000000596046448" blue="0.40000000596046448" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="蓝色字体颜色">
<color red="0.27799999713897705" green="0.56099998950958252" blue="0.88999998569488525" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
......
......@@ -8,19 +8,21 @@
import UIKit
class XinZengDiZhiViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource {
class XinZengDiZhiViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,TitleAndTFAndBtnCellDelegate{
let titleArr = ["收货人:","地址:","详细地址:","手机号:","电话:","邮编:"]
let holderArr = ["请填写收货人姓名","请选择城市","请输入详细地址","请输入手机号","请输入电话","请输入邮编"]
@IBOutlet weak var listView: UITableView!
@IBAction func saveAction(_ sender: Any) {
print("保存")
}
var navTitle:String?
override func viewDidLoad() {
super.viewDidLoad()
navbar.title = "新增地址"
// if 编辑状态 {
// navbar.rightTitle = "删除"
// }
navbar.title = navTitle
if navTitle == "编辑地址" {
navbar.rightTitle = "删除"
}
self.view.addSubview(navbar)
listView.separatorStyle = .none
......@@ -41,6 +43,10 @@ class XinZengDiZhiViewController: BaseViewController,UITableViewDelegate,UITable
print("删除")
}
//MARK: - cell delegate
func TitleAndTFAndBtnCellBtnClick() {
let vc = SJMapViewController()
self.navigationController?.pushViewController(vc, animated: true)
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 10*glscale))
view.backgroundColor = UIColor.clear
......@@ -82,6 +88,7 @@ class XinZengDiZhiViewController: BaseViewController,UITableViewDelegate,UITable
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFAndBtnCell") as! TitleAndTFAndBtnCell
cell.titleLbl.text = titleArr[indexPath.row]
cell.textTF.placeholder = holderArr[indexPath.row]
cell.delegate = self
return cell
default:
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndSwitchCell") as! TitleAndSwitchCell
......@@ -92,4 +99,6 @@ class XinZengDiZhiViewController: BaseViewController,UITableViewDelegate,UITable
return cell
}
}
}
//
// YingFuZhangKuanViewController.swift
// BingDingKeHuViewController.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/4/30.
// Created by junye lu on 2020/5/8.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
class YingFuZhangKuanViewController: BaseViewController,UISearchBarDelegate,SearchBarViewDelegate,UITableViewDelegate,UITableViewDataSource {
class BingDingKeHuViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,UISearchBarDelegate,SearchBarViewDelegate{
var searchV : SearchBarView? = nil
@IBOutlet weak var searchBgView: UIView!
@IBAction func submitAction(_ sender: Any) {
}
@IBOutlet weak var listView: UITableView!
@IBOutlet weak var topView: UIView!
override func viewDidLoad() {
super.viewDidLoad()
navbar.title = "应付账款"
navbar.title = "绑定客户"
self.view.addSubview(navbar)
//searchbar
SetTopFrame(view: topView, height: 44)
listView.separatorStyle = .none
let searchBr = SearchBarView.init()
self.searchBgView.addSubview(searchBr)
topView.addSubview(searchBr)
searchBr.snp.makeConstraints { (make) in
make.left.right.equalTo(0)
make.left.equalTo(10)
make.right.equalTo(-10)
make.centerY.equalToSuperview()
make.height.equalTo(35)
make.height.equalTo(30)
}
searchV = searchBr
searchBr.placeholderStr = "请输入客户名称"
searchBr.cornerRadius = 35/2.0
searchBr.placeholderStr = "客户名称/联系人/电话号码"
searchBr.cornerRadius = 30*0.5
searchBr.delegate = self
searchBr.delegateL = self
SetTopFrame(view: searchBgView, height: 44)
listView.separatorStyle = .none
listView.register(UINib(nibName: "YingFuZhangKuanCell", bundle: nil), forCellReuseIdentifier: "YingFuZhangKuanCell")
listView.register(UINib(nibName: "TitleAndSelectCell", bundle: nil), forCellReuseIdentifier: "TitleAndSelectCell")
// Do any additional setup after loading the view.
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 49))
view.backgroundColor = UIColor.white
let title = UILabel()
title.text = "当前应付款余额总计:"
title.font = UIFont.boldSystemFont(ofSize: 13)
title.textColor = UIColor(named: "灰色字体颜色")
view.addSubview(title)
title.sizeToFit()
title.snp.makeConstraints { (make) in
make.left.equalTo(15)
make.top.bottom.equalTo(0)
make.width.equalTo(title.bounds.size.width)
}
let ti1 = UILabel()
ti1.text = "¥-594153"
ti1.font = UIFont.boldSystemFont(ofSize: 13)
ti1.textColor = UIColor(named: "#F57575")
view.addSubview(ti1)
ti1.snp.makeConstraints { (make) in
make.left.equalTo(title.snp_right)
make.top.right.bottom.equalTo(0)
}
let l1 = UIView()
l1.backgroundColor = UIColor(named: "灰色分界线")
view.addSubview(l1)
l1.snp.makeConstraints { (make) in
make.height.equalTo(1)
make.top.right.left.equalTo(0)
}
let l11 = UIView()
l11.backgroundColor = UIColor(named: "灰色分界线")
view.addSubview(l11)
l11.snp.makeConstraints { (make) in
make.height.equalTo(1)
make.bottom.right.left.equalTo(0)
}
//MARK: - 自定义delegate
func clearSearchAction() {
return view
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
//MARK: - CELL DELEGATE
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 49
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 10
return 3
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "YingFuZhangKuanCell") as! YingFuZhangKuanCell
return cell
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndSelectCell") as! TitleAndSelectCell
if indexPath.row == 0 {
cell.line.isHidden = true
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 49
}
func clearSearchAction() {
return cell
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="BingDingKeHuViewController" customModule="GeliBusinessPlatform" customModuleProvider="target">
<connections>
<outlet property="listView" destination="dKr-ht-gTe" id="mGl-dV-lVW"/>
<outlet property="topView" destination="ZWZ-oM-W0w" id="5XG-aj-fid"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ZWZ-oM-W0w">
<rect key="frame" x="0.0" y="44" width="414" height="44"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="UIj-ks-JoE">
<rect key="frame" x="0.0" y="43" width="414" height="1"/>
<color key="backgroundColor" name="灰色分界线"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="Yc0-on-q4i"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="UIj-ks-JoE" firstAttribute="leading" secondItem="ZWZ-oM-W0w" secondAttribute="leading" id="MMZ-Lo-dG6"/>
<constraint firstAttribute="bottom" secondItem="UIj-ks-JoE" secondAttribute="bottom" id="UbT-Jl-0be"/>
<constraint firstAttribute="height" constant="44" id="r2i-Ur-e7M"/>
<constraint firstAttribute="trailing" secondItem="UIj-ks-JoE" secondAttribute="trailing" id="zal-3h-2wG"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="HiK-IG-NhA" 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="touchUpInside" id="hFL-7N-GNZ"/>
</connections>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="确定" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kkL-Ex-f4m">
<rect key="frame" x="0.0" y="813" width="414" height="49"/>
<constraints>
<constraint firstAttribute="height" constant="49" id="Yb7-gA-qwt"/>
</constraints>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="17"/>
<color key="textColor" name="白色背景色"/>
<nil key="highlightedColor"/>
</label>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="dKr-ht-gTe">
<rect key="frame" x="0.0" y="88" width="414" height="725"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<connections>
<outlet property="dataSource" destination="-1" id="T9B-sO-Xae"/>
<outlet property="delegate" destination="-1" id="NHC-Qg-o7I"/>
</connections>
</tableView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="dKr-ht-gTe" secondAttribute="trailing" id="43h-Tk-BLk"/>
<constraint firstItem="kkL-Ex-f4m" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="6fP-Od-1GN"/>
<constraint firstItem="ZWZ-oM-W0w" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="70Z-1r-nqn"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="ZWZ-oM-W0w" secondAttribute="trailing" id="8Lq-Ci-rQ4"/>
<constraint firstAttribute="trailing" secondItem="HiK-IG-NhA" secondAttribute="trailing" id="8UO-fm-V9M"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="kkL-Ex-f4m" secondAttribute="trailing" id="Dt5-x2-Zla"/>
<constraint firstItem="HiK-IG-NhA" firstAttribute="top" secondItem="kkL-Ex-f4m" secondAttribute="top" id="EjZ-tD-J1o"/>
<constraint firstItem="HiK-IG-NhA" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="KId-Lx-jpM"/>
<constraint firstItem="ZWZ-oM-W0w" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="Plx-4T-nwh"/>
<constraint firstItem="HiK-IG-NhA" firstAttribute="top" secondItem="dKr-ht-gTe" secondAttribute="bottom" id="Xxt-jm-DYG"/>
<constraint firstItem="dKr-ht-gTe" firstAttribute="top" secondItem="ZWZ-oM-W0w" secondAttribute="bottom" id="dDc-Sh-1jr"/>
<constraint firstItem="dKr-ht-gTe" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="fRN-TY-xOr"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="kkL-Ex-f4m" secondAttribute="bottom" id="prc-F4-zba"/>
<constraint firstAttribute="bottom" secondItem="HiK-IG-NhA" secondAttribute="bottom" id="yzd-34-HCk"/>
</constraints>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<point key="canvasLocation" x="131.8840579710145" y="131.91964285714286"/>
</view>
</objects>
<resources>
<namedColor name="按钮渐变色上">
<color red="0.3880000114440918" green="0.62400001287460327" blue="0.90200001001358032" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="按钮渐变色下,字体颜色">
<color red="0.27843137254901962" green="0.5607843137254902" blue="0.8901960784313725" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="灰色分界线">
<color red="0.92941176470588238" green="0.92941176470588238" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="白色背景色">
<color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>
......@@ -7,9 +7,11 @@
//
import UIKit
@objc protocol KeHuGuanLiCellDelegate {
@objc optional func KeHuGuanLiCellEditClick(cell:KeHuGuanLiCell)
}
class KeHuGuanLiCell: UITableViewCell {
var delegate:KeHuGuanLiCellDelegate?
@IBOutlet weak var iconImg: UIImageView!
@IBOutlet weak var compenyLbl: UILabel!
@IBOutlet weak var nameLbl: UILabel!
......@@ -19,9 +21,12 @@ class KeHuGuanLiCell: UITableViewCell {
@IBOutlet weak var statusLbl1: UILabel!
@IBOutlet weak var statusLbl2: UILabel!
@IBOutlet weak var statusLbl3: UILabel!
var phoneNum:String? = "phoneNum"
@IBAction func phoneCallAction(_ sender: Any) {
print("打电话方法 拼接\(phoneNum)")
}
@IBAction func editAction(_ sender: Any) {
delegate?.KeHuGuanLiCellEditClick?(cell: self)
}
override func awakeFromNib() {
super.awakeFromNib()
......
......@@ -236,7 +236,7 @@
<color red="0.92941176470588238" green="0.92941176470588238" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="灰色字体颜色">
<color red="0.40000000596046448" green="0.40000000596046448" blue="0.40000000596046448" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="蓝色字体颜色">
<color red="0.27799999713897705" green="0.56099998950958252" blue="0.88999998569488525" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
......
//
// KeHuListViewController.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/5/8.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
class KeHuListViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,UISearchBarDelegate,SearchBarViewDelegate,KeHuGuanLiCellDelegate{
var searchV : SearchBarView? = nil
@IBOutlet weak var topView: UIView!
@IBOutlet weak var coverBtn: UIButton!
@IBOutlet weak var rightImg: UIImageView!
@IBOutlet weak var leftImg: UIImageView!
@IBOutlet weak var rightLbl: UILabel!
@IBOutlet weak var leftLbl: UILabel!
@IBOutlet weak var listView: UITableView!
@IBOutlet weak var leftSelectView: UITableView!
@IBOutlet weak var rightSelectView: UITableView!
let selectListRecord = NSMutableArray()
override func viewDidLoad() {
super.viewDidLoad()
selectListRecord.add(99)
selectListRecord.add(99)
navbar.title = "客户管理"
self.view.addSubview(navbar)
let searchBr = SearchBarView.init()
topView.addSubview(searchBr)
searchBr.snp.makeConstraints { (make) in
make.left.equalTo(10)
make.right.equalTo(-10)
make.centerY.equalToSuperview()
make.height.equalTo(30)
}
searchV = searchBr
searchBr.placeholderStr = "客户名称/联系人/电话号码"
searchBr.cornerRadius = 30*0.5
searchBr.delegate = self
searchBr.delegateL = self
listView.separatorStyle = .none
rightSelectView.separatorStyle = .none
leftSelectView.separatorStyle = .none
setYuanJiao(sender: leftSelectView)
setYuanJiao(sender: rightSelectView)
listView.register(UINib(nibName: "KeHuGuanLiCell", bundle: nil), forCellReuseIdentifier: "KeHuGuanLiCell")
rightSelectView.register(UINib(nibName: "TitleAndTFCell", bundle: nil), forCellReuseIdentifier: "TitleAndTFCell")
leftSelectView.register(UINib(nibName: "TitleAndTFCell", bundle: nil), forCellReuseIdentifier: "TitleAndTFCell")
// Do any additional setup after loading the view.
}
//MARK: - method
func setYuanJiao(sender:UIView){
let maskPath = UIBezierPath(roundedRect: sender.bounds,
byRoundingCorners:[.bottomRight, .bottomLeft], cornerRadii:CGSize(width:5, height:5))
let masklayer = CAShapeLayer()
masklayer.frame = sender.bounds
masklayer.path = maskPath.cgPath
sender.layer.mask = masklayer
}
@IBAction func closeAction(_ sender: Any) {
coverBtn.isHidden = true
leftSelectView.isHidden = true
rightSelectView.isHidden = true
leftImg.image = UIImage(named: "xiala")
leftLbl.textColor = UIColor(named: "标题字颜色")
rightImg.image = UIImage(named: "xiala")
rightLbl.textColor = UIColor(named: "标题字颜色")
}
@IBAction func btnClick(_ sender: UIButton) {
//
//UI
if sender.tag == 0 {
leftLbl.textColor = UIColor(named: "蓝色字体颜色")
rightLbl.textColor = UIColor(named: "标题字颜色")
leftSelectView.isHidden = !leftSelectView.isHidden
rightSelectView.isHidden = true
coverBtn.isHidden = leftSelectView.isHidden
if leftSelectView.isHidden == true {
leftImg.image = UIImage(named: "xiala")
leftLbl.textColor = UIColor(named: "标题字颜色")
}else{
leftImg.image = UIImage(named: "shangla")
rightImg.image = UIImage(named: "xiala")
}
}else{
leftLbl.textColor = UIColor(named: "标题字颜色")
rightLbl.textColor = UIColor(named: "蓝色字体颜色")
rightSelectView.isHidden = !rightSelectView.isHidden
leftSelectView.isHidden = true
coverBtn.isHidden = rightSelectView.isHidden
if rightSelectView.isHidden == true {
rightImg.image = UIImage(named: "xiala")
rightLbl.textColor = UIColor(named: "标题字颜色")
}else{
rightImg.image = UIImage(named: "shangla")
leftImg.image = UIImage(named: "xiala")
}
}
}
@IBAction func addAction(_ sender: Any) {
let vc = XinZengAndBianJiKeHuViewController()
vc.titleStr = "新增客户"
self.navigationController?.pushViewController(vc, animated: true)
}
//MARK: - 自定义delegate
func KeHuGuanLiCellEditClick(cell: KeHuGuanLiCell) {
let vc = XinZengAndBianJiKeHuViewController()
vc.titleStr = "编辑客户"
self.navigationController?.pushViewController(vc, animated: true)
}
func clearSearchAction() {
}
//MARK: - CELL DELEGATE
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if tableView == leftSelectView {
selectListRecord.replaceObject(at: 0, with: indexPath.row)
coverBtn.isHidden = true
leftSelectView.isHidden = true
rightSelectView.isHidden = true
leftImg.image = UIImage(named: "xiala")
leftLbl.textColor = UIColor(named: "标题字颜色")
leftSelectView.reloadData()
}
if tableView == rightSelectView {
selectListRecord.replaceObject(at: 1, with: indexPath.row)
coverBtn.isHidden = true
leftSelectView.isHidden = true
rightSelectView.isHidden = true
rightImg.image = UIImage(named: "xiala")
rightLbl.textColor = UIColor(named: "标题字颜色")
rightSelectView.reloadData()
}
//MARK: - 跳转客户详情
if tableView == listView {
let vc = KeHuXQViewController()
self.navigationController?.pushViewController(vc, animated: true)
}
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if tableView == listView {
return 100
}
return 49
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if tableView == leftSelectView {
return 3
}
if tableView == rightSelectView {
return 2
}
return 3
}
let leftArr = ["全部","个人","企业"]
let rightArr = ["新增时间正序","新增时间倒序"]
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if tableView == listView{
let cell = tableView.dequeueReusableCell(withIdentifier: "KeHuGuanLiCell") as! KeHuGuanLiCell
cell.delegate = self
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell
cell.textTF.isHidden = true
cell.textTF.isUserInteractionEnabled = false
cell.nameLbl.textColor = UIColor(named: "标题字颜色")
if tableView == leftSelectView {
cell.nameLbl.text = leftArr[indexPath.row]
let num:Int = selectListRecord.firstObject as! Int
if num == indexPath.row {
cell.nameLbl.textColor = UIColor(named: "蓝色字体颜色")
}
}
if tableView == rightSelectView {
cell.nameLbl.text = rightArr[indexPath.row]
let num:Int = selectListRecord.lastObject as! Int
if num == indexPath.row {
cell.nameLbl.textColor = UIColor(named: "蓝色字体颜色")
}
}
return cell
}
}
......@@ -59,12 +59,18 @@ class XinZengAndBianJiKeHuViewController: BaseViewController,UITableViewDataSour
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return titleArr.count
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if indexPath.row == 3 {
let vc = BingDingKeHuViewController()
self.navigationController?.pushViewController(vc, animated: true)
}
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.row == 3 || indexPath.row == 4 {
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndBtnCell") as! TitleAndBtnCell
cell.nameLbl.text = titleArr[indexPath.row]
cell.contentLbl.text = holderArr[indexPath.row]
cell.btn.isUserInteractionEnabled = false
if indexPath.row == 3 {
if bindKehu.count > 0 {
cell.contentLbl.text = bindKehu
......
......@@ -101,7 +101,7 @@
<color red="0.27843137254901962" green="0.5607843137254902" blue="0.8901960784313725" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="灰色字体颜色">
<color red="0.40000000596046448" green="0.40000000596046448" blue="0.40000000596046448" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="白色背景色">
<color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
......
......@@ -8,7 +8,7 @@
import UIKit
class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewDataSource ,WorkSelectTimeViewDelegate{
class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewDataSource ,WorkSelectTimeViewDelegate,WorkItemTableViewCellDelegate{
@IBOutlet weak var topNavBtn: UIButton!
@IBOutlet weak var contentView: UIView!
......@@ -80,6 +80,7 @@ class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewD
let cell = tableView.dequeueReusableCell(withIdentifier: "WorkItemTableViewCell") as! WorkItemTableViewCell
//下面这两个语句一定要添加,否则第一屏显示的collection view尺寸,以及里面的单元格位置会不正确
cell.frame = tableView.bounds
cell.delegate = self
cell.layoutIfNeeded()
let arr = ["常用功能","代办事项","功能列表"]
cell.reloadData(title: arr[indexPath.row - 1], items: [])
......@@ -90,7 +91,6 @@ class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewD
}
return cell
}
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
print("点中cell--\(indexPath.row)")
......@@ -100,7 +100,6 @@ class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewD
}
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.row == 0 {
return 223*glscale;
......@@ -108,7 +107,53 @@ class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewD
return tableV.rowHeight
}
//MARK: - diy cell delegate
func WorkItemTableViewCellBtnClick(sender: WorkItemTableViewCell, idx: IndexPath) {
print("选中item=\(idx.section)=\(idx.row)")
let target = ""
switch target {
case "代客下单":
let vc = DaiKeXiaDanGouWuViewController()
self.navigationController?.pushViewController(vc, animated: true)
break
case "地址管理":
let vc = DZGLViewController()
self.navigationController?.pushViewController(vc, animated: true)
break
case "品牌列表":
let vc = PinPaiListViewController()
self.navigationController?.pushViewController(vc, animated: true)
break
case "新增采购单":
let vc = XinCaiGouViewController()
self.navigationController?.pushViewController(vc, animated: true)
break
case "应收账款":
let vc = YingFuZKListViewController()
vc.barTitle = "应收账款"
self.navigationController?.pushViewController(vc, animated: true)
break
case "应付账款":
let vc = YingFuZKListViewController()
vc.barTitle = "应付账款"
self.navigationController?.pushViewController(vc, animated: true)
break
case "供应商管理":
let vc = GYSListViewController()
self.navigationController?.pushViewController(vc, animated: true)
break
case "收支统计":
let vc = ShouZhiTongJiViewController()
self.navigationController?.pushViewController(vc, animated: true)
break
case "客户管理":
let vc = KeHuListViewController()
self.navigationController?.pushViewController(vc, animated: true)
break
default:
break
}
}
}
......@@ -7,9 +7,11 @@
//
import UIKit
@objc protocol WorkItemTableViewCellDelegate {
@objc optional func WorkItemTableViewCellBtnClick(sender:WorkItemTableViewCell,idx:IndexPath)
}
class WorkItemTableViewCell: UITableViewCell , UICollectionViewDelegate, UICollectionViewDataSource {
var delegate:WorkItemTableViewCellDelegate?
@IBOutlet weak var collectionViewHeight: NSLayoutConstraint!
@IBOutlet weak var collectionView: UICollectionView!
@IBOutlet weak var titleLbl: UILabel!
......@@ -86,7 +88,8 @@ class WorkItemTableViewCell: UITableViewCell , UICollectionViewDelegate, UIColle
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
print("选中item=\(indexPath.section)=\(indexPath.row)")
// print("1选中item=\(indexPath.section)=\(indexPath.row)")
delegate?.WorkItemTableViewCellBtnClick?(sender: self, idx: indexPath)
}
......
//
// YingFuZKListViewController.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/5/8.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
class YingFuZKListViewController: BaseViewController,UISearchBarDelegate,SearchBarViewDelegate,UITableViewDataSource,UITableViewDelegate {
@IBOutlet weak var titleLbl: UILabel!
@IBOutlet weak var totalPriceLbl: UILabel!
@IBOutlet weak var topView: UIView!
@IBOutlet weak var listView: UITableView!
var searchV : SearchBarView? = nil
var barTitle:String?
override func viewDidLoad() {
super.viewDidLoad()
navbar.title = barTitle
self.view.addSubview(navbar)
listView.separatorStyle = .none
SetTopFrame(view: topView, height: 44)
if barTitle == "应收账款" {
titleLbl.text = "当前应收款余额总计:"
}
let searchBr = SearchBarView.init()
topView.addSubview(searchBr)
searchBr.snp.makeConstraints { (make) in
make.left.equalTo(10)
make.right.equalTo(-10)
make.centerY.equalToSuperview()
make.height.equalTo(30)
}
searchV = searchBr
searchBr.placeholderStr = "请输入品牌名称/商品编码"
searchBr.cornerRadius = 30*0.5
searchBr.delegate = self
searchBr.delegateL = self
listView.register(UINib(nibName: "YingFuZhangKuanCell", bundle: nil), forCellReuseIdentifier: "YingFuZhangKuanCell")
}
//MARK: - CELL DELEGATE
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let vc = YingFuZhangKuanXQViewController()
vc.navTitle = "\(navbar.title!)详情"
self.navigationController?.pushViewController(vc, animated: true)
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 49
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 3
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "YingFuZhangKuanCell") as! YingFuZhangKuanCell
return cell
}
//MARK: - 自定义DELEGATE
func clearSearchAction() {
}
}
......@@ -213,7 +213,7 @@
<color red="0.92941176470588238" green="0.92941176470588238" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="灰色字体颜色">
<color red="0.40000000596046448" green="0.40000000596046448" blue="0.40000000596046448" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>
......@@ -9,8 +9,7 @@
import UIKit
class YingFuZhangKuanXQViewController:BaseViewController,UISearchBarDelegate,SearchBarViewDelegate,UITableViewDelegate,UITableViewDataSource {
var navTitle:String = "应收账款详情"
// var navTitle:String = "应付账款详情"
var navTitle:String = ""
var searchV : SearchBarView? = nil
@IBOutlet weak var listView: UITableView!
@IBOutlet weak var searchBGView: UIView!
......
//
// PinPaiListViewController.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/5/8.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
class PinPaiListViewController: BaseViewController,UISearchBarDelegate,SearchBarViewDelegate,UITableViewDelegate,UITableViewDataSource{
@IBOutlet weak var topView: UIView!
@IBOutlet weak var listView: UITableView!
var searchV : SearchBarView? = nil
override func viewDidLoad() {
super.viewDidLoad()
navbar.title = "品牌列表"
navbar.rightTitle = "新增"
self.view.addSubview(navbar)
SetTopFrame(view: topView, height: 44)
listView.separatorStyle = .none
let searchBr = SearchBarView.init()
topView.addSubview(searchBr)
searchBr.snp.makeConstraints { (make) in
make.left.equalTo(10)
make.right.equalTo(-10)
make.centerY.equalToSuperview()
make.height.equalTo(30)
}
searchV = searchBr
searchBr.placeholderStr = "请输入品牌名称/商品编码"
searchBr.cornerRadius = 30*0.5
searchBr.delegate = self
searchBr.delegateL = self
listView.register(UINib(nibName: "TitleAndBtnCell", bundle: nil), forCellReuseIdentifier: "TitleAndBtnCell")
// Do any additional setup after loading the view.
}
func rightBtnClick() {
let vc = XinZengPinPaiViewController()
vc.navTitle = "新增品牌"
self.navigationController?.pushViewController(vc, animated: true)
}
func clearSearchAction() {
print("清楚搜索文字")
}
func searchBarSearchButtonClicked(_ searchBar: UISearchBar) {
print("点击搜索进行--")
searchBar.resignFirstResponder()
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 49
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 3
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndBtnCell") as! TitleAndBtnCell
cell.nameLbl.text = "天地壹号"
cell.contentLbl.text = ""
cell.btn.isUserInteractionEnabled = false
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let vc = XinZengPinPaiViewController()
vc.navTitle = "编辑品牌"
self.navigationController?.pushViewController(vc, animated: true)
}
}
......@@ -3,15 +3,14 @@
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="YingFuZhangKuanViewController" customModule="GeliBusinessPlatform" customModuleProvider="target">
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="PinPaiListViewController" customModule="GeliBusinessPlatform" customModuleProvider="target">
<connections>
<outlet property="listView" destination="e48-X0-feC" id="Jpc-0I-r4J"/>
<outlet property="searchBgView" destination="4rg-BF-ud7" id="bK5-m1-G34"/>
<outlet property="listView" destination="u1k-5i-gDO" id="yRs-QD-hlI"/>
<outlet property="topView" destination="8ei-hi-CSb" id="Gf2-pT-Nnu"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
......@@ -20,39 +19,34 @@
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4rg-BF-ud7">
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="8ei-hi-CSb">
<rect key="frame" x="0.0" y="44" width="414" height="44"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstAttribute="height" constant="44" id="pRR-hl-89Q"/>
<constraint firstAttribute="height" constant="44" id="eG8-dq-d0M"/>
</constraints>
</view>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="e48-X0-feC">
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="u1k-5i-gDO">
<rect key="frame" x="0.0" y="88" width="414" height="774"/>
<color key="backgroundColor" name="app底色"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<connections>
<outlet property="dataSource" destination="-1" id="Wir-12-2ul"/>
<outlet property="delegate" destination="-1" id="XGW-BV-gPf"/>
<outlet property="dataSource" destination="-1" id="wNq-qE-Qfi"/>
<outlet property="delegate" destination="-1" id="QMP-Ey-BaB"/>
</connections>
</tableView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="4rg-BF-ud7" secondAttribute="trailing" id="3Pl-H0-jBI"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="e48-X0-feC" secondAttribute="bottom" id="7Ox-tP-iaa"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="e48-X0-feC" secondAttribute="trailing" id="Ksc-2F-dTk"/>
<constraint firstItem="e48-X0-feC" firstAttribute="top" secondItem="4rg-BF-ud7" secondAttribute="bottom" id="LV4-cd-CJd"/>
<constraint firstItem="4rg-BF-ud7" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="hze-mb-f8Z"/>
<constraint firstItem="4rg-BF-ud7" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="iZc-60-Uut"/>
<constraint firstItem="e48-X0-feC" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="ooV-6b-IXy"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="8ei-hi-CSb" secondAttribute="trailing" id="1sp-OU-PVp"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="u1k-5i-gDO" secondAttribute="trailing" id="ACy-YM-7rO"/>
<constraint firstItem="8ei-hi-CSb" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="NDo-1d-XVB"/>
<constraint firstItem="u1k-5i-gDO" firstAttribute="top" secondItem="8ei-hi-CSb" secondAttribute="bottom" id="U4T-vU-Gcn"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="u1k-5i-gDO" secondAttribute="bottom" id="ZQL-aV-zrz"/>
<constraint firstItem="8ei-hi-CSb" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="bZk-D7-usz"/>
<constraint firstItem="u1k-5i-gDO" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="tyP-du-bhA"/>
</constraints>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<point key="canvasLocation" x="132" y="122"/>
<point key="canvasLocation" x="133" y="132"/>
</view>
</objects>
<resources>
<namedColor name="app底色">
<color red="0.94509803921568625" green="0.94509803921568625" blue="0.94509803921568625" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>
......@@ -9,17 +9,19 @@
import UIKit
import LGButton
class XinZengPinPaiViewController: BaseViewController,UITableViewDataSource,UITableViewDelegate {
class XinZengPinPaiViewController: BaseViewController,UITableViewDataSource,UITableViewDelegate,TitleAndBtnCellDelegate {
let titleArr = ["品牌名称","品牌图标","站点地址","品牌描述"]
let holderArr = ["请输入品牌名称","0","请输入站点地址如:www.gelifood.com","0"]
@IBOutlet weak var btmBtn: LGButton!
@IBOutlet weak var btnTitleLbl: UILabel!
@IBOutlet weak var listView: UITableView!
var navTitle:String?
override func viewDidLoad() {
super.viewDidLoad()
navbar.title = "新增品牌"
// if 编辑状态 {
// navbar.rightTitle = "删除"
// }
navbar.title = navTitle
if navTitle == "编辑品牌" {
navbar.rightTitle = "删除"
}
self.view.addSubview(navbar)
......@@ -42,7 +44,7 @@ class XinZengPinPaiViewController: BaseViewController,UITableViewDataSource,UITa
}
@IBAction func btnAction(_ sender: Any) {
print("提交")
}
//MARK: - cell delegate
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
......@@ -54,6 +56,9 @@ class XinZengPinPaiViewController: BaseViewController,UITableViewDataSource,UITa
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return titleArr.count
}
func btnClick(content: String, cell: TitleAndBtnCell) {
print(content)
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
switch indexPath.row {
case 0,2:
......@@ -65,6 +70,7 @@ class XinZengPinPaiViewController: BaseViewController,UITableViewDataSource,UITa
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndBtn") as! TitleAndBtnCell
cell.nameLbl.text = titleArr[indexPath.row]
cell.contentLbl.text = "上传图片"
cell.delegate = self
return cell
default:
let cell = tableView.dequeueReusableCell(withIdentifier: "TilteAndTextView") as! TilteAndTextViewCell
......
......@@ -8,9 +8,9 @@
import UIKit
class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource{
class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,GLAlertSelectViewDelegate,AddGuiGeCellDelegate{
var glSelectView:GLAlertSelectView? = nil
@IBOutlet weak var lineView: UIView!
@IBAction func btnAction(_ sender: Any) {
......@@ -27,9 +27,9 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
super.viewDidLoad()
//编辑状态
// isEdit = true
// data = NSDictionary()
//
// isEdit = true
// data = NSDictionary()
//
navbar.title = "新增采购单"
self.view.addSubview(navbar)
......@@ -184,6 +184,33 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
}
return 49
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if indexPath.section == 0 {
if indexPath.row == 2{
if glSelectView == nil {
let view = GLAlertSelectView(frame: self.view.bounds)
view.isMultipleSelect = false//是否多选
view.delegate = self
view.titleLbl.text = "请选择供应商"
view.dataArr = ["普通订单","预售下单"]
self.view.addSubview(view)
glSelectView = view
}
}
if indexPath.row == 5 {
if glSelectView == nil {
let view = GLAlertSelectView(frame: self.view.bounds)
view.isMultipleSelect = false//是否多选
view.delegate = self
view.titleLbl.text = "请选择购物类型"
view.dataArr = ["普通订单","预售下单"]
self.view.addSubview(view)
glSelectView = view
}
}
}
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
switch indexPath.section {
case 0:
......@@ -191,6 +218,7 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndBtnCell") as! TitleAndBtnCell
cell.nameLbl.text = p1Arr[indexPath.row]
cell.contentLbl.text = hold1Arr[indexPath.row]
cell.btn.isUserInteractionEnabled = false
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell
......@@ -198,7 +226,7 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
cell.textTF.placeholder = hold1Arr[indexPath.row]
return cell
case 1:
if data != nil{
if data != nil{//有数据
let cell = tableView.dequeueReusableCell(withIdentifier: "DaiKeXiaDanGouWuCell") as! DaiKeXiaDanGouWuCell
cell.delImg.isHidden = true
cell.delBtn.isHidden = true
......@@ -207,6 +235,7 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
}
let cell = tableView.dequeueReusableCell(withIdentifier: "AddGuiGeCell") as! AddGuiGeCell
cell.imgBtn.setImage(UIImage(named: "tianjiashangpin"), for: .normal)
cell.delegate = self
return cell
default:
if indexPath.row == 0 {
......@@ -221,5 +250,25 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
}
}
}
//MARK: - 自定义Delegate
func AddGuiGeCellClick(cell: AddGuiGeCell) {
print("AddGuiGeCellClick")
}
func GLAlertSelectViewClick(selectNum: Int, view: UIView) {
print("单选",selectNum)
glSelectView?.removeFromSuperview()
glSelectView = nil
}
func GLAlertMoreSelectViewClick(sender: NSArray, view:UIView) {
print("多选",sender)
glSelectView?.removeFromSuperview()
glSelectView = nil
}
func GLAlertSelectViewClose(sender: UIButton) {
glSelectView?.removeFromSuperview()
glSelectView = nil
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment