Commit d2bce164 authored by 刘俊宏's avatar 刘俊宏

仓库管理列表完善

parent 8c71329b
{ {
"info" : {
"version" : 1,
"author" : "xcode"
},
"colors" : [ "colors" : [
{ {
"idiom" : "universal",
"color" : { "color" : {
"color-space" : "srgb", "color-space" : "srgb",
"components" : { "components" : {
"red" : "0.278",
"alpha" : "1.000", "alpha" : "1.000",
"blue" : "0.890", "blue" : "0xE3",
"green" : "0.561" "green" : "0x8F",
"red" : "0x47"
} }
} },
"idiom" : "universal"
} }
] ],
} "info" : {
\ No newline at end of file "author" : "xcode",
"version" : 1
}
}
<?xml version="1.0" encoding="UTF-8"?> <?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"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/> <device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<capability name="Named colors" minToolsVersion="9.0"/> <capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="WarehoseMangementCell" customModule="GeliBusinessPlatform" customModuleProvider="target"> <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="WarehoseMangementCell" customModule="TestClass" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="320" height="94"/> <rect key="frame" x="0.0" y="0.0" width="320" height="94"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <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"> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
......
...@@ -97,19 +97,12 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV ...@@ -97,19 +97,12 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV
func searchBarSearchButtonClicked(_ searchBar: UISearchBar) { func searchBarSearchButtonClicked(_ searchBar: UISearchBar) {
print("点击搜索进行--") print("点击搜索进行--")
searchBar.resignFirstResponder() searchBar.resignFirstResponder()
keyWord = searchBar.text!
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")
if blackBtnView != nil { if blackBtnView != nil {
blackBtnView.removeFromSuperview() blackBtnView.removeFromSuperview()
} }
self.tableV.mj_header?.beginRefreshing()
} }
//MAKR:--调起搜索后添加个蒙版本 //MAKR:--调起搜索后添加个蒙版本
var blackBtnView:UIButton! = nil var blackBtnView:UIButton! = nil
...@@ -132,9 +125,8 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV ...@@ -132,9 +125,8 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV
} }
//MARK:--清除搜索代理 //MARK:--清除搜索代理
func clearSearchAction() { func clearSearchAction() {
if tableSearchV != nil { keyWord = ""
tableSearchV.removeFromSuperview() self.loadData()
}
} }
func searchBarTextDidEndEditing(_ searchBar: UISearchBar) { func searchBarTextDidEndEditing(_ searchBar: UISearchBar) {
print("编辑即将结束了--") print("编辑即将结束了--")
...@@ -157,8 +149,7 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV ...@@ -157,8 +149,7 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV
var warehourseArr:Array<ShopWarehouseListDataModel> = []//仓库数组 var warehourseArr:Array<ShopWarehouseListDataModel> = []//仓库数组
var tableV :UITableView! var tableV :UITableView!
var tableSearchV :UITableView! = nil
private let animations = [AnimationType.from(direction: .bottom, offset: 150*glscale)] private let animations = [AnimationType.from(direction: .bottom, offset: 150*glscale)]
func setTabv() { func setTabv() {
...@@ -179,15 +170,36 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV ...@@ -179,15 +170,36 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV
}, completion: nil) }, completion: nil)
} }
let typeArr = ["常温","冷藏","冷冻"] let typeArr = ["","常温","冷藏","冷冻"]
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "WarehoseMangementCell") as! WarehoseMangementCell let cell = tableView.dequeueReusableCell(withIdentifier: "WarehoseMangementCell") as! WarehoseMangementCell
cell.delegate = self cell.delegate = self
let model = warehourseArr[indexPath.row] let model = warehourseArr[indexPath.row]
cell.nameLbl.text = model.w_name cell.nameLbl.text = model.w_name
cell.statusLbl.text = typeArr[model.w_type!] cell.statusLbl.text = typeArr[model.w_type!]
cell.statusLbl.isHidden = false
cell.adrLbl.text = model.w_address! cell.adrLbl.text = model.w_address!
cell.kuCunLbl.text = "\(model.inventory_count!)" cell.kuCunLbl.text = "\(model.inventory_count!)"
switch model.w_type {
case 0:
//异常
cell.statusLbl.isHidden = true
break
case 1:
cell.statusLbl.backgroundColor = UIColor(named: "标题背景色")
cell.statusLbl.alpha = 1
break
case 2:
cell.statusLbl.backgroundColor = UIColor(named: "蓝色字体颜色")
cell.statusLbl.alpha = 0.5
break
case 3:
cell.statusLbl.backgroundColor = UIColor(named: "蓝色字体颜色")
cell.statusLbl.alpha = 1
break
default:
break
}
return cell return cell
} }
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
...@@ -237,9 +249,7 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV ...@@ -237,9 +249,7 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV
return [deleteAction,] return [deleteAction,]
} }
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if tableView == tableSearchV {
return 3
}
return warehourseArr.count return warehourseArr.count
} }
} }
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