Commit eae5f8f2 authored by lujunye's avatar lujunye

分销商品管理界面

parent b4cfb21c
......@@ -186,6 +186,10 @@
E0707DD624624B5200E039A8 /* AMap.bundle in Resources */ = {isa = PBXBuildFile; fileRef = E0707DD524624B5200E039A8 /* AMap.bundle */; };
E074B69C24DD305600777003 /* TitleHeaderCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E074B69A24DD305500777003 /* TitleHeaderCell.swift */; };
E074B69D24DD305600777003 /* TitleHeaderCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E074B69B24DD305500777003 /* TitleHeaderCell.xib */; };
E077DC5F255124B8000B0DA5 /* GYS_HZ_Vc.swift in Sources */ = {isa = PBXBuildFile; fileRef = E077DC5D255124B8000B0DA5 /* GYS_HZ_Vc.swift */; };
E077DC60255124B8000B0DA5 /* GYS_HZ_Vc.xib in Resources */ = {isa = PBXBuildFile; fileRef = E077DC5E255124B8000B0DA5 /* GYS_HZ_Vc.xib */; };
E077DC6A25512E94000B0DA5 /* FX_Product_GuanLiVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = E077DC6825512E94000B0DA5 /* FX_Product_GuanLiVC.swift */; };
E077DC6B25512E94000B0DA5 /* FX_Product_GuanLiVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = E077DC6925512E94000B0DA5 /* FX_Product_GuanLiVC.xib */; };
E07B1E5E24591AA50055BA3C /* KeHuXQViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E07B1E5C24591AA50055BA3C /* KeHuXQViewController.swift */; };
E07B1E5F24591AA50055BA3C /* KeHuXQViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E07B1E5D24591AA50055BA3C /* KeHuXQViewController.xib */; };
E07B1E62245921A60055BA3C /* KeHuXQCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E07B1E60245921A60055BA3C /* KeHuXQCell.swift */; };
......@@ -826,6 +830,10 @@
E0707DD524624B5200E039A8 /* AMap.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = AMap.bundle; path = MAMapKit.framework/AMap.bundle; sourceTree = "<group>"; };
E074B69A24DD305500777003 /* TitleHeaderCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TitleHeaderCell.swift; sourceTree = "<group>"; };
E074B69B24DD305500777003 /* TitleHeaderCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TitleHeaderCell.xib; sourceTree = "<group>"; };
E077DC5D255124B8000B0DA5 /* GYS_HZ_Vc.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GYS_HZ_Vc.swift; sourceTree = "<group>"; };
E077DC5E255124B8000B0DA5 /* GYS_HZ_Vc.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GYS_HZ_Vc.xib; sourceTree = "<group>"; };
E077DC6825512E94000B0DA5 /* FX_Product_GuanLiVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FX_Product_GuanLiVC.swift; sourceTree = "<group>"; };
E077DC6925512E94000B0DA5 /* FX_Product_GuanLiVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = FX_Product_GuanLiVC.xib; sourceTree = "<group>"; };
E07B1E5C24591AA50055BA3C /* KeHuXQViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeHuXQViewController.swift; sourceTree = "<group>"; };
E07B1E5D24591AA50055BA3C /* KeHuXQViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KeHuXQViewController.xib; sourceTree = "<group>"; };
E07B1E60245921A60055BA3C /* KeHuXQCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeHuXQCell.swift; sourceTree = "<group>"; };
......@@ -1818,6 +1826,24 @@
path = "地图";
sourceTree = "<group>";
};
E077DC5C25512489000B0DA5 /* 供应商合作管理 */ = {
isa = PBXGroup;
children = (
E077DC5D255124B8000B0DA5 /* GYS_HZ_Vc.swift */,
E077DC5E255124B8000B0DA5 /* GYS_HZ_Vc.xib */,
);
path = "供应商合作管理";
sourceTree = "<group>";
};
E077DC6725512E73000B0DA5 /* 分销商品管理 */ = {
isa = PBXGroup;
children = (
E077DC6825512E94000B0DA5 /* FX_Product_GuanLiVC.swift */,
E077DC6925512E94000B0DA5 /* FX_Product_GuanLiVC.xib */,
);
path = "分销商品管理";
sourceTree = "<group>";
};
E07B1E64245925F30055BA3C /* 供应商管理 */ = {
isa = PBXGroup;
children = (
......@@ -1973,6 +1999,8 @@
E09B03AD2445B0BA00211A51 /* ViewController */ = {
isa = PBXGroup;
children = (
E077DC6725512E73000B0DA5 /* 分销商品管理 */,
E077DC5C25512489000B0DA5 /* 供应商合作管理 */,
E0AD92E62550E4DD00D82C17 /* 供应商分销商品管理 */,
F9C2F6EF254FDEAC00516E00 /* 分销商分账设置 */,
F9A4AB6A24C9220C00094BD1 /* 货拉拉 */,
......@@ -3268,6 +3296,7 @@
F9023F63244999F500DD5A63 /* WarehoseMangementCell.xib in Resources */,
E051EBD824A1F0ED00892DA9 /* CGDCell.xib in Resources */,
E01E5485254FD34C00A2620C /* GYS_GuanLi_Cell.xib in Resources */,
E077DC6B25512E94000B0DA5 /* FX_Product_GuanLiVC.xib in Resources */,
F96E48A024CA7930000AB8D4 /* WaybillDetailViewController.xib in Resources */,
E0BE8A84245A76AF00E80134 /* XiaDanCGDiZhiCell.xib in Resources */,
E0516F832448086700E373CE /* MsgCenterCell.xib in Resources */,
......@@ -3428,6 +3457,7 @@
F9D44E8424CBC50700FBD8DB /* WayBillAddressCanDelItemCell.xib in Resources */,
E007B1D9248F7276004D14CC /* CGDCell1.xib in Resources */,
E0DDCB1E244AE81800DF54C7 /* GuanLianKeHuCell.xib in Resources */,
E077DC60255124B8000B0DA5 /* GYS_HZ_Vc.xib in Resources */,
E0DDCB14244ADF2C00DF54C7 /* ChangePriceNormalCell.xib in Resources */,
E01EA1A5245A60E000F019D5 /* XiaDanChengGongViewController.xib in Resources */,
E042F74124528CD500CDFA12 /* TitleAndOnlyBtnCell.xib in Resources */,
......@@ -3706,6 +3736,7 @@
F96E48A324CA79D4000AB8D4 /* WayBillAddressItemCell.swift in Sources */,
E0273DDD24551D4500B3FCAE /* OnlyLabelCell.swift in Sources */,
F950FDD724518B9500C40530 /* FSCalendarCollectionView.m in Sources */,
E077DC5F255124B8000B0DA5 /* GYS_HZ_Vc.swift in Sources */,
E02C88262456B24F00925766 /* WuLiuGenZongViewController.swift in Sources */,
E09B03C62445BF6700211A51 /* NavBarView.swift in Sources */,
E07C2FFA24ECCD4D0043649B /* GLMessageAlertView.swift in Sources */,
......@@ -3804,6 +3835,7 @@
F9531F3A2465108800724BEE /* JXPhotoBrowserNoneAnimator.swift in Sources */,
E07B1E62245921A60055BA3C /* KeHuXQCell.swift in Sources */,
E0CC847C24823087009B1FE9 /* GetGoodBatchModel.swift in Sources */,
E077DC6A25512E94000B0DA5 /* FX_Product_GuanLiVC.swift in Sources */,
E0AA3A89248F3E1400CBFC27 /* StatisticsInterface.swift in Sources */,
E0F8E91F248747D200817A08 /* NewCKVc.swift in Sources */,
E0239202249069FD00C4C632 /* CGDXQVc.swift in Sources */,
......
{
"images" : [
{
"filename" : "down_black.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "down_black@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "down_black@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
......@@ -7,9 +7,22 @@
//
import UIKit
protocol GYS_FX_ProductCellDelegate {
func GYS_FX_ProductCellTableViewCellSelect(idx:Int)
}
class GYS_FX_ProductCellTableViewCell: UITableViewCell {
var delegate:GYS_FX_ProductCellDelegate?
@IBAction func selectProductAction(_ sender: UIButton) {
// left_btn.isSelected = !left_btn.isSelected
// select_Img.image = UIImage(named: "daixuan")
// if left_btn.isSelected {
// select_Img.image = UIImage(named: "yuxuan")
// }
delegate?.GYS_FX_ProductCellTableViewCellSelect(idx: self.tag)
}
@IBOutlet weak var left_btn: UIButton!
@IBOutlet weak var select_Img: UIImageView!
@IBOutlet weak var old_price_Lbl: UILabel!//原价
@IBOutlet weak var new_price_Lbl: UILabel!//分销价
......@@ -28,7 +41,7 @@ class GYS_FX_ProductCellTableViewCell: UITableViewCell {
submitBtn.titleLabel?.numberOfLines = 0
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
......
......@@ -157,12 +157,31 @@
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="daixuan" translatesAutoresizingMaskIntoConstraints="NO" id="ewJ-WY-yIu">
<rect key="frame" x="15" y="55" width="20" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="6Qe-hc-uBa"/>
<constraint firstAttribute="width" constant="20" id="ka8-3G-rLG"/>
</constraints>
</imageView>
<button opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="qor-h2-doo">
<rect key="frame" x="0.0" y="0.0" width="0.0" height="125"/>
<connections>
<action selector="selectProductAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="NOo-Tc-hel"/>
</connections>
</button>
</subviews>
<constraints>
<constraint firstItem="qor-h2-doo" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="1Rc-t8-dYc"/>
<constraint firstItem="z5k-CZ-aID" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="5" id="93A-sx-62m"/>
<constraint firstItem="z5k-CZ-aID" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="Hm5-HY-mc7"/>
<constraint firstAttribute="trailing" secondItem="z5k-CZ-aID" secondAttribute="trailing" id="QlL-HX-GPj"/>
<constraint firstItem="z5k-CZ-aID" firstAttribute="leading" secondItem="qor-h2-doo" secondAttribute="trailing" id="R8V-tN-40j"/>
<constraint firstItem="ewJ-WY-yIu" firstAttribute="centerY" secondItem="z5k-CZ-aID" secondAttribute="centerY" id="WQE-1A-Y6f"/>
<constraint firstAttribute="bottom" secondItem="qor-h2-doo" secondAttribute="bottom" id="XAt-ib-eqo"/>
<constraint firstAttribute="bottom" secondItem="z5k-CZ-aID" secondAttribute="bottom" id="XjJ-nm-8dX"/>
<constraint firstItem="ewJ-WY-yIu" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="dgr-9M-YjQ"/>
<constraint firstItem="qor-h2-doo" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="f9o-ck-MzT"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
......@@ -171,18 +190,21 @@
<outlet property="FX_Percent_Lbl" destination="rhK-mv-sfb" id="2jQ-Xp-BSC"/>
<outlet property="item_Icon_Img" destination="WYJ-BO-wv9" id="vgb-ui-8ct"/>
<outlet property="leftValue" destination="Hm5-HY-mc7" id="USY-ug-Pjx"/>
<outlet property="left_btn" destination="qor-h2-doo" id="D95-B4-Mtj"/>
<outlet property="new_price_Lbl" destination="N0T-3l-rU8" id="Phq-aR-dw2"/>
<outlet property="old_price_Lbl" destination="Bjz-wA-QCI" id="QpF-xT-Cmt"/>
<outlet property="select_Img" destination="ewJ-WY-yIu" id="VXJ-6q-8Lj"/>
<outlet property="sell_total_Lbl" destination="kGs-Qz-GbO" id="aV5-7D-azv"/>
<outlet property="store_lbl" destination="k6M-ar-xGi" id="t58-eL-8IV"/>
<outlet property="submitBtn" destination="Cae-xu-msI" id="2xy-ux-krI"/>
<outlet property="submit_Btn_W" destination="TbZ-Ta-i8s" id="FMB-6V-kPg"/>
<outlet property="title_Lbl" destination="io4-Mx-VZ7" id="Usl-Mp-pm1"/>
</connections>
<point key="canvasLocation" x="260.14492753623188" y="119.53125"/>
<point key="canvasLocation" x="258.69565217391306" y="119.53125"/>
</tableViewCell>
</objects>
<resources>
<image name="daixuan" width="19" height="19"/>
<namedColor name="#E37847">
<color red="0.88999998569488525" green="0.47099998593330383" blue="0.27799999713897705" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
......
......@@ -7,21 +7,19 @@
//
import UIKit
protocol GYS_GuanLi_CellDelegate {
func GYS_GuanLi_CellStopAction(idx:Int)
}
class GYS_GuanLi_Cell: UITableViewCell {
var isFenXiaoShang : Bool = false //分销商管理 == true,改变合作按钮颜色。
var delegate:GYS_GuanLi_CellDelegate?
@IBOutlet weak var icon_Img: UIImageView!//公司LOGO
@IBOutlet weak var status_Lbl: UILabel!//状态
@IBOutlet weak var time_Lbl: UILabel!//时间
@IBOutlet weak var adr_Lbl: UILabel!//地址
@IBOutlet weak var title_Lbl: UILabel!//公司名
@IBAction func stopAction(_ sender: UIButton) {
if isFenXiaoShang {
//分销商管理,删除功能。
return
}
print("终止合作")
delegate?.GYS_GuanLi_CellStopAction(idx: self.tag)
}
@IBOutlet weak var submitBtn: UIButton!//终止按钮-默认隐藏
override func awakeFromNib() {
......@@ -38,7 +36,7 @@ class GYS_GuanLi_Cell: UITableViewCell {
submitBtn.layer.borderWidth = 1
submitBtn.layer.borderColor = UIColor(named: "按钮背景颜色")?.cgColor
submitBtn.setTitle("删除", for: .normal)
submitBtn.titleLabel?.textColor = UIColor(named: "按钮背景颜色")
submitBtn.setTitleColor(UIColor(named: "按钮背景颜色"), for: .normal)
}
}
override func setSelected(_ selected: Bool, animated: Bool) {
......
......@@ -20,7 +20,7 @@
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="cfa-aa-rbj">
<rect key="frame" x="15" y="146" width="360" height="2"/>
<color key="backgroundColor" name="提示语字体颜色"/>
<color key="backgroundColor" name="灰色分界线"/>
<constraints>
<constraint firstAttribute="height" constant="2" id="QNY-k4-3Ls"/>
</constraints>
......@@ -104,7 +104,7 @@
<color key="textColor" name="9A9A9A"/>
<nil key="highlightedColor"/>
</label>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="upr-nd-ZPR">
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="upr-nd-ZPR">
<rect key="frame" x="280" y="101" width="80" height="30"/>
<color key="backgroundColor" name="#F57575"/>
<constraints>
......@@ -177,5 +177,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>
......@@ -51,6 +51,7 @@ class GYS_FX_SearchViewController: BaseViewController,UITableViewDelegate,UITabl
searchV?.changecornerRadius(cornerRadius: 35*0.5)
searchBr.delegate = self
searchBr.delegateL = self
searchBr.snp.makeConstraints { (make) in
make.left.equalTo(0)
make.right.equalTo(0)
......
//
// GYS_HZ_Vc.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/11/3.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
class GYS_HZ_Vc: BaseViewController,UITableViewDelegate,UITableViewDataSource, UISearchBarDelegate, SearchBarViewDelegate,GYS_GuanLi_CellDelegate{
func GYS_GuanLi_CellStopAction(idx:Int) {
print("target = ",idx)
}
var keyword = ""
func searchBarSearchButtonClicked(_ searchBar: UISearchBar) {
print("点击搜索进行--")
searchBar.resignFirstResponder()
keyword = searchBar.text!
}
//MARK:--取消搜索代理
func clearSearchAction() {
print("取消搜索代理了--")
}
func searchBarTextDidEndEditing(_ searchBar: UISearchBar) {
print("编辑即将结束了--")
if searchBar.text?.count == 0 && keyword.count != 0{
keyword = searchBar.text!
}
print("key - ",searchBar.text!)
}
func searchBarShouldBeginEditing(_ searchBar: UISearchBar) -> Bool {
print("调起搜索后添加个蒙版本")
return true
}
var title_str = ""
weak var searchV: SearchBarView? = nil
@IBOutlet weak var search_view: UIView!
@IBOutlet weak var home_list_tbv: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
SetTopFrame(view: search_view, height: 44)
navbar.title = title_str
self.view.addSubview(navbar)
let searchBr = SearchBarView.init()
searchV = searchBr
var holder_str = "请输入供应商名称"
if title_str == "分销商管理" {
navbar.rightTitle = "新增店铺"
// holder_str = "请输入供应商名称"
}
searchBr.placeholderStr = holder_str
self.search_view.addSubview(searchBr)
searchV?.changecornerRadius(cornerRadius: 35*0.5)
searchBr.delegate = self
searchBr.delegateL = self
searchBr.snp.makeConstraints { (make) in
make.left.equalTo(0)
make.right.equalTo(0)
make.centerY.equalToSuperview()
make.height.equalTo(35)
}
home_list_tbv.register(UINib(nibName: "GYS_GuanLi_Cell", bundle: nil), forCellReuseIdentifier: "GYS_GuanLi_Cell")
home_list_tbv.separatorStyle = .none
// Do any additional setup after loading the view.
}
//MARK: - tableview_delegate
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 3
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "GYS_GuanLi_Cell") as! GYS_GuanLi_Cell
cell.delegate = self
if title_str == "分销商管理" {
cell.isFenXiaoShang = true
}
cell.tag = indexPath.row
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 148
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.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="GYS_HZ_Vc" customModule="TestClass" customModuleProvider="target">
<connections>
<outlet property="home_list_tbv" destination="f0E-BN-PPh" id="Jpa-vj-qQx"/>
<outlet property="search_view" destination="04E-ze-DHm" id="H8v-jO-Odr"/>
<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="04E-ze-DHm">
<rect key="frame" x="0.0" y="44" width="414" height="44"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="height" constant="44" id="72B-mD-ZMY"/>
</constraints>
</view>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="f0E-BN-PPh">
<rect key="frame" x="0.0" y="88" width="414" height="808"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<connections>
<outlet property="dataSource" destination="-1" id="8fU-JY-MXI"/>
<outlet property="delegate" destination="-1" id="xPj-eI-OLC"/>
</connections>
</tableView>
</subviews>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="f0E-BN-PPh" firstAttribute="top" secondItem="04E-ze-DHm" secondAttribute="bottom" id="8lh-kQ-UdH"/>
<constraint firstItem="f0E-BN-PPh" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="K9R-Lw-ZD6"/>
<constraint firstItem="04E-ze-DHm" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="RQR-zA-wUg"/>
<constraint firstAttribute="bottom" secondItem="f0E-BN-PPh" secondAttribute="bottom" id="Wgp-tw-dtq"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="04E-ze-DHm" secondAttribute="trailing" id="ksR-2f-0rm"/>
<constraint firstItem="04E-ze-DHm" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="oxW-3i-dki"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="f0E-BN-PPh" secondAttribute="trailing" id="r6y-er-ecp"/>
</constraints>
<point key="canvasLocation" x="142" y="76"/>
</view>
</objects>
<resources>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
//
// FX_Product_GuanLiVC.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/11/3.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
class FX_Product_GuanLiVC: BaseViewController,UITableViewDelegate,UITableViewDataSource, UISearchBarDelegate, SearchBarViewDelegate,GYS_FX_ProductCellDelegate {
var keyword = ""
func searchBarSearchButtonClicked(_ searchBar: UISearchBar) {
print("点击搜索进行--")
searchBar.resignFirstResponder()
keyword = searchBar.text!
}
//MARK:--取消搜索代理
func clearSearchAction() {
print("取消搜索代理了--")
}
func searchBarTextDidEndEditing(_ searchBar: UISearchBar) {
print("编辑即将结束了--")
if searchBar.text?.count == 0 && keyword.count != 0{
keyword = searchBar.text!
}
print("key - ",searchBar.text!)
}
func searchBarShouldBeginEditing(_ searchBar: UISearchBar) -> Bool {
print("调起搜索后添加个蒙版本")
return true
}
@IBAction func allSelect(_ sender: UIButton) {
sender.isSelected = !sender.isSelected
selectItem.removeAll()
if sender.isSelected {
home_list_tbv.visibleCells.forEach { (item) in
let cell = item as! GYS_FX_ProductCellTableViewCell
selectItem.append(cell.tag)
}
}
home_list_tbv.reloadData()
}
var is_Edit = false
func rightBtnClick() {
is_Edit = !is_Edit
navbar.rightTitle = "编辑商品"
edit_bottom_view_H.constant = 0
if is_Edit{
navbar.rightTitle = "取消"
if IS_IPHONE_X {
edit_bottom_view_H.constant = 83
}else{
edit_bottom_view_H.constant = 49
}
}
home_list_tbv.reloadData()
}
@IBOutlet weak var home_list_tbv: UITableView!
@IBOutlet weak var right_title: UILabel!
@IBOutlet weak var left_title: UILabel!
@IBOutlet weak var right_arrow_img: UIButton!
@IBOutlet weak var left_arrow_img: UIImageView!
@IBOutlet weak var count_lbl: UILabel!//数量
@IBOutlet weak var search_view: UIView!
weak var searchV: SearchBarView? = nil
@IBOutlet weak var edit_bottom_view_H: NSLayoutConstraint!
override func viewDidLoad() {
super.viewDidLoad()
SetTopFrame(view: search_view, height: 44)
navbar.title = "分销商品管理"
self.view.addSubview(navbar)
navbar.rightTitle = "编辑商品"
let searchBr = SearchBarView.init()
searchV = searchBr
searchBr.placeholderStr = "请输入分销商品名称"
self.search_view.addSubview(searchBr)
searchV?.changecornerRadius(cornerRadius: 35*0.5)
searchBr.delegate = self
searchBr.delegateL = self
searchBr.snp.makeConstraints { (make) in
make.left.equalTo(0)
make.right.equalTo(0)
make.centerY.equalToSuperview()
make.height.equalTo(35)
}
home_list_tbv.register(UINib(nibName: "GYS_FX_ProductCellTableViewCell", bundle: nil), forCellReuseIdentifier: "GYS_FX_ProductCellTableViewCell")
home_list_tbv.separatorStyle = .none
// Do any additional setup after loading the view.
}
//MARK: - tableview_delegate
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 30
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "GYS_FX_ProductCellTableViewCell") as! GYS_FX_ProductCellTableViewCell
cell.submitBtn.setTitle("设置", for: .normal)
cell.submitBtn.setTitleColor(UIColor(named: "按钮背景颜色"), for: .normal)
cell.tag = indexPath.row
cell.delegate = self
if is_Edit{
cell.leftValue.constant = 45
cell.submit_Btn_W.constant = 10
cell.submitBtn.isHidden = true
cell.left_btn.isUserInteractionEnabled = true
cell.select_Img.isHidden = false
cell.select_Img.image = UIImage(named: "daixuan")
selectItem.forEach { (idx) in
if idx == indexPath.row {
cell.select_Img.image = UIImage(named: "yuxuan")
}
}
}else{
cell.leftValue.constant = 0
cell.submit_Btn_W.constant = 50
cell.submitBtn.isHidden = false
cell.left_btn.isUserInteractionEnabled = false
cell.select_Img.isHidden = true
}
return cell
}
var selectItem:Array<Int> = []
func GYS_FX_ProductCellTableViewCellSelect(idx: Int) {
if selectItem.contains(idx){
let index = selectItem.firstIndex(of: idx)
selectItem.remove(at: index!)
}else{
selectItem.append(idx)
}
home_list_tbv.reloadData()
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 125
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
}
}
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