Commit 84d7a4a8 authored by lujunye's avatar lujunye

glmessageview,发票信息类型的展示view

parent 65d7c78f
......@@ -7,61 +7,81 @@
//
import UIKit
protocol GLMessageAlertViewDelegate {
func GLMessageAlertViewCloseAction()
class GLMessageAlertView: UIView,UITableViewDelegate,UITableViewDataSource {
@IBOutlet weak var listView: UITableView!
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return datasArr.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndLblCell") as! TitleAndLblCell
let str = datasArr[indexPath.row]
let strs = str.components(separatedBy: ",")
cell.nameLbl.text = strs.first
cell.contentLbl.text = strs.last
return cell
}
}
class GLMessageAlertView: UIView {
var contentView:UIView!
var delegate:GLMessageAlertViewDelegate?
@IBOutlet weak var topLbl: UILabel!
@IBOutlet weak var tbvH: NSLayoutConstraint!
@IBAction func submitAction(_ sender: Any) {
delegate?.GLMessageAlertViewCloseAction()
self.removeFromSuperview()
}
var datasArr:Array<NSString> = ["单位地址,广东省广州市荔湾区环市西路37号富力国际鞋业贸易中心2105","纳税人识别号,HF5241515215142115122125","类型,普通发票"]
var datasArr:Array<NSString> = ["单位地址,广东省广州市荔湾区环市西路37号富力国际鞋业贸易中心2105","纳税人识别号,HF5241515215142115122125","类型,普通发票","单位地址,广东省广州市荔湾区环市西路37号富力国际鞋业贸易中心2105","纳税人识别号,HF5241515215142115122125","类型,普通发票","单位地址,广东省广州市荔湾区环市西路37号富力国际鞋业贸易中心2105","纳税人识别号,HF5241515215142115122125","类型,普通发票","单位地址,广东省广州市荔湾区环市西路37号富力国际鞋业贸易中心2105","纳税人识别号,HF5241515215142115122125","类型,普通发票","单位地址,广东省广州市荔湾区环市西路37号富力国际鞋业贸易中心2105","纳税人识别号,HF5241515215142115122125","类型,普通发票","单位地址,广东省广州市荔湾区环市西路37号富力国际鞋业贸易中心2105","纳税人识别号,HF5241515215142115122125","类型,普通发票"]
@IBOutlet weak var btnLbl: UILabel!
@IBAction func closeAction(_ sender: UIButton) {
sender.removeFromSuperview()
delegate?.GLMessageAlertViewCloseAction()
self.removeFromSuperview()
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 49
}
func setUI(){
topLbl?.layer.cornerRadius = 5
topLbl?.layer.maskedCorners = [CACornerMask.layerMinXMinYCorner,CACornerMask.layerMaxXMinYCorner]
listView.register(UINib(nibName: "TitleAndLblCell", bundle: nil), forCellReuseIdentifier: "TitleAndLblCell")
listView.separatorStyle = .none
if datasArr.count * 49 < 147 {
tbvH.constant = 147
}
if CGFloat(datasArr.count) * 49 > CGFloat(fullScreenHeight) * 0.6 {
tbvH.constant = fullScreenHeight * 0.6
}
}
//初始化时将xib中的view添加进来
override init(frame: CGRect) {
super.init(frame: frame)
contentView = loadViewFromNib()
addSubview(contentView)
contentView.snp.makeConstraints { (make) in
make.left.top.right.bottom.equalToSuperview()
}
}
// /初始化时将xib中的view添加进来
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
contentView = loadViewFromNib()
addSubview(contentView)
contentView.snp.makeConstraints { (make) in
make.left.top.right.bottom.equalToSuperview()
}
}
//加载xib
func loadViewFromNib() -> UIView {
let className = type(of: self)
let bundle = Bundle(for: className)
let name = NSStringFromClass(className).components(separatedBy: ".").last
let nib = UINib(nibName: name!, bundle: bundle)
let view = nib.instantiate(withOwner: self, options: nil).first as! UIView
return view
}
override init(frame: CGRect) {
super.init(frame: frame)
contentView = loadViewFromNib()
addSubview(contentView)
contentView.snp.makeConstraints { (make) in
make.left.top.right.bottom.equalToSuperview()
}
setUI()
}
// /初始化时将xib中的view添加进来
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
contentView = loadViewFromNib()
addSubview(contentView)
contentView.snp.makeConstraints { (make) in
make.left.top.right.bottom.equalToSuperview()
}
setUI()
}
//加载xib
func loadViewFromNib() -> UIView {
let className = type(of: self)
let bundle = Bundle(for: className)
let name = NSStringFromClass(className).components(separatedBy: ".").last
let nib = UINib(nibName: name!, bundle: bundle)
let view = nib.instantiate(withOwner: self, options: nil).first as! UIView
return view
}
}
......@@ -12,6 +12,7 @@
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="GLMessageAlertView" customModule="TestClass" customModuleProvider="target">
<connections>
<outlet property="btnLbl" destination="J4M-4x-wWQ" id="L5R-bG-Rv3"/>
<outlet property="listView" destination="wCN-zG-K2b" id="tAm-2U-bnh"/>
<outlet property="tbvH" destination="U4Q-y5-xZl" id="6Vr-wO-x5I"/>
<outlet property="topLbl" destination="YlV-1D-5EA" id="DMs-28-oOi"/>
</connections>
......
......@@ -33,7 +33,7 @@
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zee-Po-sID">
<rect key="frame" x="57" y="61.5" width="246" height="34.5"/>
<rect key="frame" x="159" y="52" width="144" height="53"/>
<attributedString key="attributedText">
<fragment content="View.tishiLbl.text = &quot;&quot;View.tishiLbl.text = &quot;&quot;View.tishiLbl.text = &quot;&quot;">
<attributes>
......@@ -46,7 +46,10 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" text="标题" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yit-1Y-dYH">
<rect key="frame" x="15" y="70.5" width="27" height="16"/>
<rect key="frame" x="15" y="70.5" width="50" height="16"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="50" id="zVE-BG-soe"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<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">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097.2" 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"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<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">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097.2" 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"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<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">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097.2" 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"/>
......
......@@ -567,8 +567,6 @@ class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewD
// HUD.flash(.label("敬请期待"),delay: 1.2)
// let view = GLMessageAlertView(frame: self.view.bounds)
// self.view.addSubview(view)
let vc = XiaYunDanViewController()
self.navigationController?.pushViewController(vc, animated: true)
return
......
......@@ -149,7 +149,10 @@ class YDLBVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,UISea
// calendarV.removeFromSuperview()
//
// }
func rightBtnClick() {
let vc = XiaYunDanViewController()
self.navigationController?.pushViewController(vc, animated: true)
}
deinit {
NotificationCenter.default.removeObserver(self)
}
......@@ -178,6 +181,8 @@ class YDLBVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,UISea
listView.separatorStyle = .none
listView.register(UINib(nibName: "YunDanLieBiaoCell", bundle: nil), forCellReuseIdentifier: "YunDanLieBiaoCell")
navbar.rightTitle = "新增运单"
let searchBr = SearchBarView.init()
searchVBg.addSubview(searchBr)
searchBr.snp.makeConstraints { (make) in
......
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