Commit 206c7343 authored by 刘俊宏's avatar 刘俊宏

新增订单列表类,在仓库管理vc完善搜索操作

parent 6bd1d21b
......@@ -179,6 +179,8 @@
F950FDEA2451920200C40530 /* DIYCalendarCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F950FDE92451920200C40530 /* DIYCalendarCell.swift */; };
F95567A72453DA86009674AB /* WarehoseMangementListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = F95567A52453DA86009674AB /* WarehoseMangementListVC.swift */; };
F95567A82453DA86009674AB /* WarehoseMangementListVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = F95567A62453DA86009674AB /* WarehoseMangementListVC.xib */; };
F95567AB2453E40B009674AB /* OrderListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F95567A92453E40B009674AB /* OrderListViewController.swift */; };
F95567AC2453E40B009674AB /* OrderListViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F95567AA2453E40B009674AB /* OrderListViewController.xib */; };
F95D9B5024484FAE0080D6E3 /* GeliAlertView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F95D9B4F24484FAE0080D6E3 /* GeliAlertView.xib */; };
F95D9B522448530E0080D6E3 /* GeliAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F95D9B512448530E0080D6E3 /* GeliAlertView.swift */; };
F95D9CA424493E840080D6E3 /* ShopInfoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F95D9CA224493E840080D6E3 /* ShopInfoViewController.swift */; };
......@@ -421,6 +423,8 @@
F950FDE92451920200C40530 /* DIYCalendarCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DIYCalendarCell.swift; sourceTree = "<group>"; };
F95567A52453DA86009674AB /* WarehoseMangementListVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WarehoseMangementListVC.swift; sourceTree = "<group>"; };
F95567A62453DA86009674AB /* WarehoseMangementListVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WarehoseMangementListVC.xib; sourceTree = "<group>"; };
F95567A92453E40B009674AB /* OrderListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderListViewController.swift; sourceTree = "<group>"; };
F95567AA2453E40B009674AB /* OrderListViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = OrderListViewController.xib; sourceTree = "<group>"; };
F95D9B4F24484FAE0080D6E3 /* GeliAlertView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GeliAlertView.xib; sourceTree = "<group>"; };
F95D9B512448530E0080D6E3 /* GeliAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GeliAlertView.swift; sourceTree = "<group>"; };
F95D9CA224493E840080D6E3 /* ShopInfoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShopInfoViewController.swift; sourceTree = "<group>"; };
......@@ -1115,6 +1119,8 @@
F961D2722450373B007FBE70 /* 订单列表 */ = {
isa = PBXGroup;
children = (
F95567A92453E40B009674AB /* OrderListViewController.swift */,
F95567AA2453E40B009674AB /* OrderListViewController.xib */,
);
path = "订单列表";
sourceTree = "<group>";
......@@ -1279,6 +1285,7 @@
F969BF1F244EE67900C79953 /* GoodsManageListVC.xib in Resources */,
E0F97B112451728D001BD600 /* AddGuiGeCell.xib in Resources */,
E0C9EF13244E922200277435 /* OrderDViewController.xib in Resources */,
F95567AC2453E40B009674AB /* OrderListViewController.xib in Resources */,
F961D26924500550007FBE70 /* HeaderSelectView.xib in Resources */,
E088CC942447124D000DAA8A /* BindViewController.xib in Resources */,
E0F97B092451620B001BD600 /* ProductDetailViewController.xib in Resources */,
......@@ -1494,6 +1501,7 @@
E09B03A32445AF9500211A51 /* NetworkRequest.swift in Sources */,
E0D46C5624503EC50087B564 /* TitleAndSelectCell.swift in Sources */,
E0F97B022451228A001BD600 /* GLAlertSelectView.swift in Sources */,
F95567AB2453E40B009674AB /* OrderListViewController.swift in Sources */,
E042F730245272FF00CDFA12 /* XiaYunDanViewController.swift in Sources */,
E09B03A72445B04E00211A51 /* BaseViewController.swift in Sources */,
E02DDD9924501A5B00ABB707 /* DelGuiGeCell.swift in Sources */,
......
......@@ -67,9 +67,9 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDeleg
tabBarController.tabBar.backgroundImage = img
NotificationCenter.default.addObserver(self, selector: #selector(popLogout), name: NSNotification.Name(rawValue: "logout"), object: nil)
let v1 = GoodsManageListVC()
let v1 = OrderListViewController()
let v2 = GoodsManageListVC()
let v3 = GoodsManageListVC()
let v3 = DemoViewController()
let v4 = WarehoseMangementListVC()
let v5 = PersonCenterViewController()
......
......@@ -7,9 +7,11 @@
//
import UIKit
protocol SearchBarViewDelegate {
func clearSearchAction()
}
class SearchBarView: UISearchBar {
var delegateL: SearchBarViewDelegate?
override init(frame: CGRect) {
super.init(frame: frame)
......@@ -41,47 +43,41 @@ class SearchBarView: UISearchBar {
self.setPositionAdjustment(UIOffset(horizontal: 10, vertical: 0), for: .search)
self.setImage(UIImage.init(named: "sousuo"), for: .search, state: .normal)
self.placeholder = "搜索相关关键字"
for subV:UIView in self.subviews {
for subv in subV.subviews {
for sbV in subv.subviews {
print("sp\(sbV)")
if sbV.isKind(of: NSClassFromString("UISearchBarTextField")!) {
print("打印\(sbV.subviews)")
let sbvV = sbV as! UITextField
sbvV.textColor = UIColor.init(named: "标题字颜色")
sbvV.clipsToBounds = true
}
}
}
}
let searchField: UITextField = self.value(forKey: "searchField") as! UITextField
searchField.textColor = UIColor.init(named: "标题字颜色")
searchField.clipsToBounds = true
clearAction()
}
//修改圆角
func changecornerRadius(cornerRadius:CGFloat) {
for subV:UIView in self.subviews {
for subv in subV.subviews {
for sbV in subv.subviews {
if sbV.isKind(of: NSClassFromString("UISearchBarTextField")!) {
let sbvV = sbV as! UITextField
sbvV.layer.cornerRadius = cornerRadius
}
}
}
}
let searchField: UITextField = self.value(forKey: "searchField") as! UITextField //先找到输入框控件:UITextField
searchField.layer.cornerRadius = cornerRadius
}
//修改占位字
func changePlstr(placeStr:String?) {
for subV:UIView in self.subviews {
for subv in subV.subviews {
for sbV in subv.subviews {
if sbV.isKind(of: NSClassFromString("UISearchBarTextField")!) {
let sbvV = sbV as! UITextField
let str = NSAttributedString.init(string: placeStr!, attributes: [NSAttributedString.Key.font:UIFont.systemFont(ofSize: 13)])
sbvV.attributedPlaceholder = str
}
}
}
}
let searchField: UITextField = self.value(forKey: "searchField") as! UITextField //先找到输入框控件:UITextField
let str = NSAttributedString.init(string: placeStr!, attributes: [NSAttributedString.Key.font:UIFont.systemFont(ofSize: 13)])
searchField.attributedPlaceholder = str
}
//叉号触发
func clearAction() {
let searchField: UITextField = self.value(forKey: "searchField") as! UITextField //先找到输入框控件:UITextField
let clearBtn: UIButton = searchField.value(forKey: "_clearButton") as! UIButton //输入框中按钮:UIButton
clearBtn.addTarget(self, action: #selector(clearBtnClick), for: .touchUpInside)//给按钮添加事件
}
//按钮事件方法
@objc fileprivate func clearBtnClick() {
//TODO
print("清除触发")
self.delegateL?.clearSearchAction()
}
}
......@@ -9,8 +9,8 @@
import UIKit
import ViewAnimator
class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableViewDelegate, UITableViewDataSource {
class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableViewDelegate, UITableViewDataSource, SearchBarViewDelegate {
weak var searchV: SearchBarView? = nil
@IBOutlet weak var contentView: UIView!
@IBOutlet weak var searchView: UIView!
override func viewDidLoad() {
......@@ -18,30 +18,74 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV
self.view.backgroundColor = UIColor.white
//searchbar
let searchBr = SearchBarView.init()
searchV = searchBr
self.searchView.addSubview(searchBr)
searchBr.snp.makeConstraints { (make) in
make.left.right.equalTo(0)
make.centerY.equalToSuperview()
make.height.equalTo(35)
}
searchBr.delegateL = self
searchBr.placeholderStr = "请输入仓库名称"
searchBr.cornerRadius = 35/2.0
searchBr.delegate = self
setTabv()
}
//MARK:--搜索按钮代理
func searchBarSearchButtonClicked(_ searchBar: UISearchBar) {
print("点击搜索进行--")
searchBar.resignFirstResponder()
tableSearchV = UITableView()
contentView.addSubview(tableSearchV);
tableSearchV.snp.makeConstraints { (make) in
make.top.left.right.bottom.equalToSuperview()
}
tableSearchV.delegate = self
tableSearchV.dataSource = self
tableSearchV.separatorStyle = .none
tableSearchV?.register(UINib(nibName: "WarehoseMangementCell", bundle: nil), forCellReuseIdentifier: "WarehoseMangementCell")
}
//MAKR:--调起搜索后添加个蒙版本
var blackBtnView:UIButton! = nil
func searchBarShouldBeginEditing(_ searchBar: UISearchBar) -> Bool {
print("调起搜索后添加个蒙版本")
blackBtnView = UIButton ()
blackBtnView.backgroundColor = UIColor.init(named: "提示视图背景色")
contentView.addSubview(blackBtnView)
blackBtnView.snp.makeConstraints { (make) in
make.left.right.top.bottom.equalToSuperview()
}
blackBtnView.addTarget(self, action: #selector(removeBlackBtnView), for: .touchUpInside)
return true
}
@objc func removeBlackBtnView(){
if blackBtnView != nil {
blackBtnView.removeFromSuperview()
searchV!.resignFirstResponder()
}
}
//MARK:--清除搜索代理
func clearSearchAction() {
if tableSearchV != nil {
tableSearchV.removeFromSuperview()
}
}
func searchBarTextDidEndEditing(_ searchBar: UISearchBar) {
print("编辑即将结束了--")
removeBlackBtnView()
}
//MARK:--新增代理
@IBAction func addNewWarehose(_ sender: UIButton) {
print("点击新增--")
}
var tableV :UITableView!
var tableSearchV :UITableView! = nil
private let animations = [AnimationType.from(direction: .bottom, offset: 150*glscale)]
func setTabv() {
......@@ -63,6 +107,9 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if tableView == tableSearchV {
return 3
}
return 10
}
......
......@@ -43,7 +43,7 @@
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="IoW-Gs-1nk">
<rect key="frame" x="330" y="8" width="30" height="29"/>
<rect key="frame" x="320" y="8" width="55" height="29"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<state key="normal" title="新增">
<color key="titleColor" name="蓝色字体颜色"/>
......@@ -55,13 +55,14 @@
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="IoW-Gs-1nk" secondAttribute="trailing" constant="15" id="DtM-7e-yIf"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="IoW-Gs-1nk" secondAttribute="trailing" id="DtM-7e-yIf"/>
<constraint firstItem="lfJ-T6-x4o" firstAttribute="top" secondItem="9uz-hT-q6i" secondAttribute="bottom" id="E7j-5b-odp"/>
<constraint firstItem="fng-dx-7gZ" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="Kmb-EP-k8Q"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="lfJ-T6-x4o" secondAttribute="trailing" id="Ql9-tD-xcD"/>
<constraint firstItem="fng-dx-7gZ" firstAttribute="bottom" secondItem="fnl-2z-Ty3" secondAttribute="bottom" id="Qla-b6-j79"/>
<constraint firstAttribute="trailing" secondItem="9uz-hT-q6i" secondAttribute="trailing" constant="55" id="TLN-y8-x1q"/>
<constraint firstItem="9uz-hT-q6i" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="cTb-zk-cpL"/>
<constraint firstItem="IoW-Gs-1nk" firstAttribute="leading" secondItem="9uz-hT-q6i" secondAttribute="trailing" id="dxS-Hj-Vl7"/>
<constraint firstItem="fng-dx-7gZ" firstAttribute="trailing" secondItem="fnl-2z-Ty3" secondAttribute="trailing" id="ftA-wr-c9b"/>
<constraint firstItem="IoW-Gs-1nk" firstAttribute="centerY" secondItem="9uz-hT-q6i" secondAttribute="centerY" id="nWR-hj-Jco"/>
<constraint firstItem="lfJ-T6-x4o" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="wgP-pX-r1Y"/>
......
......@@ -9,7 +9,7 @@
import UIKit
import ViewAnimator
class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollectionViewDataSource ,UICollectionViewDelegateFlowLayout,HeaderSelectViewDelegate,SelectContentViewDelegate,UISearchBarDelegate{
class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollectionViewDataSource ,UICollectionViewDelegateFlowLayout,HeaderSelectViewDelegate,SelectContentViewDelegate,UISearchBarDelegate, SearchBarViewDelegate{
var collection : UICollectionView? = nil
var layout = UICollectionViewFlowLayout()
......@@ -40,6 +40,7 @@ class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollect
searchBr.placeholderStr = "请输入商品名称"
searchBr.cornerRadius = 35/2.0
searchBr.delegate = self
searchBr.delegateL = self
let selectView = HeaderSelectView()
changeBgView.addSubview(selectView)
......@@ -81,6 +82,10 @@ class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollect
func searchBarSearchButtonClicked(_ searchBar: UISearchBar) {
print("点击搜索进行--")
searchBar.resignFirstResponder()
}
//MARK:--取消搜索代理
func clearSearchAction() {
}
//MARK:--新增触发
@IBAction func addNewGoodsAction(_ sender: UIButton) {
......
......@@ -59,7 +59,7 @@
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="g5q-zA-x29">
<rect key="frame" x="330" y="8" width="30" height="29"/>
<rect key="frame" x="320" y="8" width="55" height="29"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<state key="normal" title="新增">
<color key="titleColor" name="蓝色字体颜色"/>
......@@ -71,6 +71,7 @@
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="g5q-zA-x29" firstAttribute="leading" secondItem="H5j-EA-EVh" secondAttribute="trailing" id="20r-im-CBE"/>
<constraint firstItem="H5j-EA-EVh" firstAttribute="leading" secondItem="DIe-mL-vml" secondAttribute="leading" id="7iQ-yY-rDw"/>
<constraint firstItem="H5j-EA-EVh" firstAttribute="top" secondItem="DIe-mL-vml" secondAttribute="top" id="8Ue-bx-ndM"/>
<constraint firstItem="Swh-le-IcW" firstAttribute="top" secondItem="Xeh-de-he4" secondAttribute="bottom" id="Ckh-XQ-l9A"/>
......@@ -79,7 +80,7 @@
<constraint firstAttribute="bottom" secondItem="aXP-zc-ITt" secondAttribute="bottom" id="Zk4-Zv-YTt"/>
<constraint firstAttribute="trailing" secondItem="aXP-zc-ITt" secondAttribute="trailing" id="gAL-Nt-A2P"/>
<constraint firstItem="Swh-le-IcW" firstAttribute="leading" secondItem="DIe-mL-vml" secondAttribute="leading" id="gIg-X5-jrr"/>
<constraint firstAttribute="trailing" secondItem="g5q-zA-x29" secondAttribute="trailing" constant="15" id="mTK-bH-1b3">
<constraint firstAttribute="trailing" secondItem="g5q-zA-x29" secondAttribute="trailing" id="mTK-bH-1b3">
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isAdaptateScreen" value="YES"/>
</userDefinedRuntimeAttributes>
......
//
// OrderListViewController.swift
// GeliBusinessPlatform
//
// Created by 刘俊宏 on 2020/4/25.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
class OrderListViewController: BaseViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13142" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12042"/>
<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="OrderListViewController" customModuleProvider="target">
<connections>
<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="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
</view>
</objects>
</document>
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