Commit b1c877eb authored by lujunye's avatar lujunye

发票信息展示

parent 0dfe446a
...@@ -24,15 +24,98 @@ class InvoiceInfoModel: Mappable { ...@@ -24,15 +24,98 @@ class InvoiceInfoModel: Mappable {
} }
} }
class InvoiceInfoReceverData: Mappable {
var consignee:String?
var mobile : String?
var address : String?
required init?( map: Map) {
}
func mapping(map: Map) {
consignee <- map["consignee"]
mobile <- map["mobile"]
address <- map["address"]
}
}
class InvoiceInfoDataModel: Mappable { class InvoiceInfoDataModel: Mappable {
var invoice_id:Int?
var name:String? //单位名称
var duty_paragraph:String?//税号
var address:String? //地址
var account_name:String?//单位开户名称
var account:String? //单位开户账号
var tel:String?//电话号码
var code:String? //邮政编码
var license:String?//营业执照
var type:Int? //1增值税专用发票 2增值税普通发票
var belong:Int?//1单位 2个人
var user_id:Int? //用户
var invoice_status:Int?//是否已开发票:0,未开,1,已开
var invoice_time:Int? //开发票时间
var serial_number:String?//流水号
var add_time:Int? //添加时间
var invoice_type:Int?//1电子发票 2 纸质发票
var downloads:Int? //下载次数
var email:String?//邮箱
var invoice_code:String? //发票号
var status:Int?//开票状态(1等待开票2开票成功)
var invoice_img:String? //发票图片
var invoice_remark:String?//备注
var send_address:InvoiceInfoReceverData? //发票寄送地址
var inv_type:Int?//1 普通发票 2合并发票
var is_merge:Int? //是否为合并发票,1是0非
var invoice_tag:Int?//发票标签:1商品明细 2商品类别
required init?( map: Map) { required init?( map: Map) {
} }
func mapping(map: Map) { func mapping(map: Map) {
invoice_id <- map["invoice_id"]
name <- map["name"]
duty_paragraph <- map["duty_paragraph"]
address <- map["address"]
account_name <- map["account_name"]
account <- map["account"]
tel <- map["tel"]
code <- map["code"]
license <- map["license"]
type <- map["type"]
belong <- map["belong"]
user_id <- map["user_id"]
invoice_status <- map["invoice_status"]
invoice_time <- map["invoice_time"]
serial_number <- map["serial_number"]
add_time <- map["add_time"]
invoice_type <- map["invoice_type"]
downloads <- map["downloads"]
email <- map["email"]
invoice_code <- map["invoice_code"]
status <- map["status"]
invoice_img <- map["invoice_img"]
invoice_remark <- map["invoice_remark"]
send_address <- map["send_address"]
inv_type <- map["inv_type"]
is_merge <- map["is_merge"]
invoice_tag <- map["invoice_tag"]
} }
} }
...@@ -20,6 +20,10 @@ class GLMessageAlertView: UIView,UITableViewDelegate,UITableViewDataSource { ...@@ -20,6 +20,10 @@ class GLMessageAlertView: UIView,UITableViewDelegate,UITableViewDataSource {
let strs = str.components(separatedBy: ",") let strs = str.components(separatedBy: ",")
cell.nameLbl.text = strs.first cell.nameLbl.text = strs.first
cell.contentLbl.text = strs.last cell.contentLbl.text = strs.last
if strs.last?.count == 0 {
cell.contentLbl.text = "--"
}
return cell return cell
} }
...@@ -30,7 +34,7 @@ class GLMessageAlertView: UIView,UITableViewDelegate,UITableViewDataSource { ...@@ -30,7 +34,7 @@ class GLMessageAlertView: UIView,UITableViewDelegate,UITableViewDataSource {
@IBAction func submitAction(_ sender: Any) { @IBAction func submitAction(_ sender: Any) {
self.removeFromSuperview() self.removeFromSuperview()
} }
var datasArr:Array<NSString> = ["单位地址,广东省广州市荔湾区环市西路37号富力国际鞋业贸易中心2105","纳税人识别号,HF5241515215142115122125","类型,普通发票","单位地址,广东省广州市荔湾区环市西路37号富力国际鞋业贸易中心2105","纳税人识别号,HF5241515215142115122125","类型,普通发票","单位地址,广东省广州市荔湾区环市西路37号富力国际鞋业贸易中心2105","纳税人识别号,HF5241515215142115122125","类型,普通发票","单位地址,广东省广州市荔湾区环市西路37号富力国际鞋业贸易中心2105","纳税人识别号,HF5241515215142115122125","类型,普通发票","单位地址,广东省广州市荔湾区环市西路37号富力国际鞋业贸易中心2105","纳税人识别号,HF5241515215142115122125","类型,普通发票","单位地址,广东省广州市荔湾区环市西路37号富力国际鞋业贸易中心2105","纳税人识别号,HF5241515215142115122125","类型,普通发票"] var datasArr:Array<String> = ["单位地址,广东省广州市荔湾区环市西路37号富力国际鞋业贸易中心2105","纳税人识别号,HF5241515215142115122125","类型,普通发票","单位地址,广东省广州市荔湾区环市西路37号富力国际鞋业贸易中心2105","纳税人识别号,HF5241515215142115122125","类型,普通发票","单位地址,广东省广州市荔湾区环市西路37号富力国际鞋业贸易中心2105","纳税人识别号,HF5241515215142115122125","类型,普通发票","单位地址,广东省广州市荔湾区环市西路37号富力国际鞋业贸易中心2105","纳税人识别号,HF5241515215142115122125","类型,普通发票","单位地址,广东省广州市荔湾区环市西路37号富力国际鞋业贸易中心2105","纳税人识别号,HF5241515215142115122125","类型,普通发票","单位地址,广东省广州市荔湾区环市西路37号富力国际鞋业贸易中心2105","纳税人识别号,HF5241515215142115122125","类型,普通发票"]
@IBOutlet weak var btnLbl: UILabel! @IBOutlet weak var btnLbl: UILabel!
@IBAction func closeAction(_ sender: UIButton) { @IBAction func closeAction(_ sender: UIButton) {
......
<?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="16097.2" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <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"/> <device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
<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="System colors in document resources" minToolsVersion="11.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"/>
</dependencies> </dependencies>
<objects> <objects>
...@@ -22,7 +23,7 @@ ...@@ -22,7 +23,7 @@
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/> <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<button opaque="NO" alpha="0.40000000000000002" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6IR-Z3-KFf"> <button opaque="NO" alpha="0.40000000000000002" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6IR-Z3-KFf">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/> <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<color key="backgroundColor" name="标题字颜色"/> <color key="backgroundColor" name="标题字颜色"/>
<color key="tintColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="tintColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
...@@ -33,7 +34,7 @@ ...@@ -33,7 +34,7 @@
</button> </button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="2v6-Uq-44p" customClass="LGButton" customModule="LGButton"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="2v6-Uq-44p" customClass="LGButton" customModule="LGButton">
<rect key="frame" x="0.0" y="813" width="414" height="83"/> <rect key="frame" x="0.0" y="813" width="414" height="83"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor"/>
<userDefinedRuntimeAttributes> <userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="gradientStartColor"> <userDefinedRuntimeAttribute type="color" keyPath="gradientStartColor">
<color key="value" name="按钮渐变色上"/> <color key="value" name="按钮渐变色上"/>
...@@ -58,7 +59,7 @@ ...@@ -58,7 +59,7 @@
</label> </label>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="wCN-zG-K2b"> <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="wCN-zG-K2b">
<rect key="frame" x="0.0" y="663" width="414" height="150"/> <rect key="frame" x="0.0" y="663" width="414" height="150"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="150" id="U4Q-y5-xZl"/> <constraint firstAttribute="height" constant="150" id="U4Q-y5-xZl"/>
</constraints> </constraints>
...@@ -86,6 +87,7 @@ ...@@ -86,6 +87,7 @@
</constraints> </constraints>
</view> </view>
</subviews> </subviews>
<viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints> <constraints>
<constraint firstAttribute="trailing" secondItem="6IR-Z3-KFf" secondAttribute="trailing" id="1St-sF-4tf"/> <constraint firstAttribute="trailing" secondItem="6IR-Z3-KFf" secondAttribute="trailing" id="1St-sF-4tf"/>
...@@ -109,10 +111,14 @@ ...@@ -109,10 +111,14 @@
<constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="X4c-4d-3n7" secondAttribute="trailing" id="z1l-Yb-MlE"/> <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="X4c-4d-3n7" secondAttribute="trailing" id="z1l-Yb-MlE"/>
<constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="J4M-4x-wWQ" secondAttribute="trailing" id="zmi-XG-FAL"/> <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="J4M-4x-wWQ" secondAttribute="trailing" id="zmi-XG-FAL"/>
</constraints> </constraints>
<viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
<point key="canvasLocation" x="131.8840579710145" y="112.5"/> <point key="canvasLocation" x="131.8840579710145" y="112.5"/>
</view> </view>
</objects> </objects>
<designables>
<designable name="2v6-Uq-44p">
<size key="intrinsicContentSize" width="10" height="10"/>
</designable>
</designables>
<resources> <resources>
<namedColor name="按钮渐变色上"> <namedColor name="按钮渐变色上">
<color red="0.3880000114440918" green="0.62400001287460327" blue="0.90200001001358032" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.3880000114440918" green="0.62400001287460327" blue="0.90200001001358032" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
...@@ -129,5 +135,8 @@ ...@@ -129,5 +135,8 @@
<namedColor name="白色背景色"> <namedColor name="白色背景色">
<color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor> </namedColor>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources> </resources>
</document> </document>
...@@ -10,6 +10,8 @@ import UIKit ...@@ -10,6 +10,8 @@ import UIKit
class HeaderOnlyTitleView: UIView { class HeaderOnlyTitleView: UIView {
var contentView:UIView! var contentView:UIView!
@IBOutlet weak var nameLbl: UILabel! @IBOutlet weak var nameLbl: UILabel!
override init(frame: CGRect) { override init(frame: CGRect) {
super.init(frame: frame) super.init(frame: frame)
......
<?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" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="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"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="HeaderOnlyTitleView" customModule="GeliBusinessPlatform" customModuleProvider="target"> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="HeaderOnlyTitleView" customModule="TestClass" customModuleProvider="target">
<connections> <connections>
<outlet property="nameLbl" destination="cTI-ht-UY7" id="lzl-GW-IYx"/> <outlet property="nameLbl" destination="cTI-ht-UY7" id="lzl-GW-IYx"/>
</connections> </connections>
...@@ -16,7 +17,7 @@ ...@@ -16,7 +17,7 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="39"/> <rect key="frame" x="0.0" y="0.0" width="375" height="39"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cTI-ht-UY7"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cTI-ht-UY7">
<rect key="frame" x="15" y="15" width="30" height="21"/> <rect key="frame" x="15" y="15" width="30" height="21"/>
<attributedString key="attributedText"> <attributedString key="attributedText">
<fragment content="标题"> <fragment content="标题">
...@@ -35,7 +36,7 @@ ...@@ -35,7 +36,7 @@
<constraint firstItem="cTI-ht-UY7" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="15" id="ooK-B0-hxK"/> <constraint firstItem="cTI-ht-UY7" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="15" id="ooK-B0-hxK"/>
</constraints> </constraints>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="133" y="138"/> <point key="canvasLocation" x="132.60869565217394" y="137.61160714285714"/>
</view> </view>
</objects> </objects>
<resources> <resources>
......
...@@ -229,6 +229,14 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -229,6 +229,14 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
} }
} }
var btnLbl:UILabel!
var invoiceList:UITableView!
@objc func closeCoverAction(btn:UIButton){
btn.removeFromSuperview()
btnLbl?.removeFromSuperview()
invoiceList.removeFromSuperview()
}
//MARK:--发票信息栏目代理 //MARK:--发票信息栏目代理
var segmentIndex = 1 var segmentIndex = 1
func segmentChangeIndex(index: Int) { func segmentChangeIndex(index: Int) {
...@@ -240,9 +248,60 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -240,9 +248,60 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
switch selectString { switch selectString {
case "查看发票信息": case "查看发票信息":
HUD.show(.progress) HUD.show(.progress)
getInvoiceInfo(["user_token":UserToken as Any,"order_id":StringByInt(number: self.orderId!) as Any]) { (data) in getInvoiceInfo(["user_token":UserToken as Any,"order_id":StringByInt(number: self.orderId!) as Any]) { [self] (data) in
HUD.hide() HUD.hide()
let model = data as! InvoiceInfoModel
let modelData = model.data as! InvoiceInfoDataModel
var dataArray:Array<String> = []
dataArray.removeAll()
if modelData.type == 1 {//增值税专用
dataArray.append("类型,增值税专用发票")
dataArray.append("纳税人识别号," + modelData.duty_paragraph!)
dataArray.append("注册地址," + modelData.address!)
dataArray.append("注册电话," + modelData.tel!)
dataArray.append("开户银行," + modelData.account_name!)
dataArray.append("银行账号," + modelData.account!)
dataArray.append("收票人姓名," + (modelData.send_address?.consignee)!)
dataArray.append("收票人手机," + (modelData.send_address?.mobile)!)
dataArray.append("收票人地址," + (modelData.send_address?.address)!)
}else{//增值税普通
dataArray.append("类型,普通发票")
if modelData.belong == 1 {//单位
dataArray.append("发票抬头,单位")
dataArray.append("单位名称," + modelData.name!)
dataArray.append("纳税人识别号," + modelData.duty_paragraph!)
dataArray.append("单位地址," + modelData.address!)
dataArray.append("单位电话," + modelData.tel!)
dataArray.append("开户银行," + modelData.account_name!)
dataArray.append("银行账号," + modelData.account!)
var invoiceTag = "商品明细"
if modelData.invoice_tag == 2{
invoiceTag = "商品类别"
}
dataArray.append("发票内容," + invoiceTag)
dataArray.append("收票人手机," + (modelData.send_address?.mobile)!)
dataArray.append("收票人邮箱," + modelData.email!)
}else{//个人
dataArray.append("发票抬头,个人")
dataArray.append("个人名称," + modelData.name!)
var invoiceTag = "商品明细"
if modelData.invoice_tag == 2{
invoiceTag = "商品类别"
}
dataArray.append("发票内容," + invoiceTag)
dataArray.append("收票人手机," + (modelData.send_address?.mobile)!)
dataArray.append("收票人信息," + (modelData.send_address?.consignee)!)
dataArray.append("收票人邮箱," + modelData.email!)
}
}
let view = GLMessageAlertView(frame: self.view.bounds)
view.topLbl.text = "发票信息"
view.datasArr = dataArray
self.view.addSubview(view)
} failture: { (error) in } failture: { (error) in
} }
...@@ -1067,6 +1126,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -1067,6 +1126,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
//MARK: - header delegate //MARK: - header delegate
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView() let view = UIView()
view.subviews.forEach { (subV) in view.subviews.forEach { (subV) in
subV.removeFromSuperview() subV.removeFromSuperview()
...@@ -1103,6 +1163,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -1103,6 +1163,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
view.addSubview(view1) view.addSubview(view1)
return view return view
default: default:
break break
} }
......
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