Commit 7a3499b3 authored by lujunye's avatar lujunye

格利商品安全溯源信息

parent cc448fb1
{
"images" : [
{
"filename" : "编组 3.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "编组 3@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "编组 3@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "路径备份 2.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "路径备份 2@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "路径备份 2@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "路径.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "路径@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "路径@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "编组 3.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "编组 3@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "编组 3@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
...@@ -54,6 +54,7 @@ class printOrder_data_res_model: Mappable { ...@@ -54,6 +54,7 @@ class printOrder_data_res_model: Mappable {
var add_time_year:String?//年 var add_time_year:String?//年
var add_time_month:String?//月 var add_time_month:String?//月
var add_time_day:String?//日 var add_time_day:String?//日
var print_type:Int?//默认打印
required init?( map: Map) { required init?( map: Map) {
...@@ -78,6 +79,8 @@ class printOrder_data_res_model: Mappable { ...@@ -78,6 +79,8 @@ class printOrder_data_res_model: Mappable {
add_time_year <- map["add_time_year"] add_time_year <- map["add_time_year"]
add_time_month <- map["add_time_month"] add_time_month <- map["add_time_month"]
add_time_day <- map["add_time_day"] add_time_day <- map["add_time_day"]
print_type <- map["print_type"]
} }
} }
......
...@@ -13,6 +13,7 @@ protocol DaiKeXiaDanGouWuCellDelegate { ...@@ -13,6 +13,7 @@ protocol DaiKeXiaDanGouWuCellDelegate {
func DaiKeXiaDanGouWuCell_check(cell:DaiKeXiaDanGouWuCell) func DaiKeXiaDanGouWuCell_check(cell:DaiKeXiaDanGouWuCell)
} }
class DaiKeXiaDanGouWuCell: UITableViewCell,UITextViewDelegate { class DaiKeXiaDanGouWuCell: UITableViewCell,UITextViewDelegate {
@IBOutlet weak var btm_line: UIView!
@IBOutlet weak var arrow_img: UIImageView! @IBOutlet weak var arrow_img: UIImageView!
@IBOutlet weak var check_button: UIButton! @IBOutlet weak var check_button: UIButton!
var isFx = false var isFx = false
...@@ -55,6 +56,7 @@ class DaiKeXiaDanGouWuCell: UITableViewCell,UITextViewDelegate { ...@@ -55,6 +56,7 @@ class DaiKeXiaDanGouWuCell: UITableViewCell,UITextViewDelegate {
delImg.isHidden = true delImg.isHidden = true
delBtn.isHidden = true delBtn.isHidden = true
holder_lbl.isHidden = true holder_lbl.isHidden = true
} }
} }
} }
......
...@@ -233,6 +233,7 @@ ...@@ -233,6 +233,7 @@
<connections> <connections>
<outlet property="arrow_img" destination="2p2-7L-Hi7" id="iJ8-Mg-yL3"/> <outlet property="arrow_img" destination="2p2-7L-Hi7" id="iJ8-Mg-yL3"/>
<outlet property="btmLIneWidth" destination="qMJ-nI-cSg" id="dsM-yO-8bv"/> <outlet property="btmLIneWidth" destination="qMJ-nI-cSg" id="dsM-yO-8bv"/>
<outlet property="btm_line" destination="oAm-E1-HwQ" id="vp2-Uf-gI6"/>
<outlet property="bz_lbl" destination="ykh-Oc-5e6" id="1JL-Gh-kqG"/> <outlet property="bz_lbl" destination="ykh-Oc-5e6" id="1JL-Gh-kqG"/>
<outlet property="changeBtn" destination="4lb-rz-I6F" id="OEf-1Q-OVb"/> <outlet property="changeBtn" destination="4lb-rz-I6F" id="OEf-1Q-OVb"/>
<outlet property="check_button" destination="DvI-Hk-ZNE" id="egI-io-mdA"/> <outlet property="check_button" destination="DvI-Hk-ZNE" id="egI-io-mdA"/>
......
...@@ -478,7 +478,10 @@ class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewD ...@@ -478,7 +478,10 @@ class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewD
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
return return
case 63: //入库--直接入库 case 63: //入库--直接入库
let vc = NewRKVc() // let vc = NewRKVc()
// self.navigationController?.pushViewController(vc, animated: true)
let vc = S_Y_Detail_Vc()
vc.user_type = 1
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
return return
case 64: //出库--直接出库 case 64: //出库--直接出库
......
...@@ -43,7 +43,7 @@ class PrintListMgVc: BaseViewController, PagingViewControllerDelegate,UIPrintInt ...@@ -43,7 +43,7 @@ class PrintListMgVc: BaseViewController, PagingViewControllerDelegate,UIPrintInt
pc.printInfo = printInfo pc.printInfo = printInfo
pc.delegate = self pc.delegate = self
if userName != "不二制油" { //普通 if userName == "不二制油" { //普通
let dic = ["user_token":UserToken as Any, let dic = ["user_token":UserToken as Any,
"order_id":order_id as Any, "order_id":order_id as Any,
"remittance_account":"" as Any, "remittance_account":"" as Any,
...@@ -158,6 +158,7 @@ class PrintListMgVc: BaseViewController, PagingViewControllerDelegate,UIPrintInt ...@@ -158,6 +158,7 @@ class PrintListMgVc: BaseViewController, PagingViewControllerDelegate,UIPrintInt
@IBOutlet weak var contentV: UIView! @IBOutlet weak var contentV: UIView!
var printData:printOrder_data_res_model?{ var printData:printOrder_data_res_model?{
didSet{ didSet{
viewControllers.forEach { (vc) in viewControllers.forEach { (vc) in
if printData?.province_id != nil { if printData?.province_id != nil {
vc.provinceIndex = (printData?.province_id)! vc.provinceIndex = (printData?.province_id)!
...@@ -231,7 +232,7 @@ class PrintListMgVc: BaseViewController, PagingViewControllerDelegate,UIPrintInt ...@@ -231,7 +232,7 @@ class PrintListMgVc: BaseViewController, PagingViewControllerDelegate,UIPrintInt
self.view.addSubview(navbar) self.view.addSubview(navbar)
SetTopFrameView(view: contentV, btmView: self.view) SetTopFrameView(view: contentV, btmView: self.view)
if userName != "不二制油" { if userName == "不二制油" {
normal_type_btn.isHidden = false normal_type_btn.isHidden = false
}else{ }else{
normal_type_btn.isHidden = true normal_type_btn.isHidden = true
...@@ -254,7 +255,7 @@ class PrintListMgVc: BaseViewController, PagingViewControllerDelegate,UIPrintInt ...@@ -254,7 +255,7 @@ class PrintListMgVc: BaseViewController, PagingViewControllerDelegate,UIPrintInt
} }
holder_img.isHidden = normal_type_btn.isHidden holder_img.isHidden = normal_type_btn.isHidden
pagingVC?.select(index: selectIndex)
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
} }
......
...@@ -377,7 +377,7 @@ class PrintViewController: BaseViewController,UITableViewDelegate,UITableViewDat ...@@ -377,7 +377,7 @@ class PrintViewController: BaseViewController,UITableViewDelegate,UITableViewDat
list_view.separatorStyle = .none list_view.separatorStyle = .none
list_view.showsVerticalScrollIndicator = false list_view.showsVerticalScrollIndicator = false
getIndex() getIndex()
if userName == "不二制油"{ if userName != "不二制油"{
get_location_id() get_location_id()
} }
} }
......
//
// S_Y_Detail_Vc.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2021/1/27.
// Copyright © 2021 junye lu. All rights reserved.
//
import UIKit
class S_Y_Detail_Vc: BaseViewController ,UITableViewDataSource,UITableViewDelegate, scv_cell_delegate{
func scv_cell_check_img(idx: Int) {
print("图片 = ",idx)
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if user_type == 0 {
return 9
}
return 11
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.row == 0 {
return 442
}
if indexPath.row < 7 && indexPath.row != 0 {
return 80.5
}
if user_type == 0 {
if indexPath.row == 8 {
return 197
}
}else{
if indexPath.row > 8 {
return 197
}
}
return 114
}
var two_titles = ["","","","","","","","供货单位名称"]
let titles = ["","商品名称","商品规格","产品产地","商品条码","生产日期","保质期","","","",""]
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.row == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: "img_title_cell") as! img_title_cell
return cell
}
if indexPath.row < 7 && indexPath.row != 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: "one_title_cell") as! one_title_cell
cell.title_lbl.text = titles[indexPath.row]
return cell
}
if user_type == 0 {
if indexPath.row == 8 {
let cell = tableView.dequeueReusableCell(withIdentifier: "scv_cell") as! scv_cell
return cell
}
}else{
if indexPath.row > 8 {
let cell = tableView.dequeueReusableCell(withIdentifier: "scv_cell") as! scv_cell
cell.title_lbl.text = "供货商资质证书"
cell.delegate = self
if indexPath.row == 10 {
if user_type == 1 {
cell.title_lbl.text = "经销商资质证书"
}else{
cell.title_lbl.text = "代理商资质证书"
}
}
return cell
}
}
let cell = tableView.dequeueReusableCell(withIdentifier: "two_title_cell") as! two_title_cell
cell.title_2_lbl.text = "统一社会信用代码"
cell.title_1_lbl.text = two_titles[indexPath.row]
return cell
}
var user_type = 0{
didSet{
if user_type == 1 {
two_titles.append("经销商单位名称")
}
if user_type == 2 {
two_titles.append("代理商单位名称")
}
}
}
@IBOutlet weak var list_view: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
navbar.title = "格利商品安全溯源信息"
self.view.addSubview(navbar)
list_view.snp.makeConstraints { (make) in
make.top.equalTo(navbar.snp_bottom)
make.left.right.bottom.equalTo(0)
}
list_view.separatorStyle = .none
list_view.showsVerticalScrollIndicator = false
list_view.register(UINib(nibName: "scv_cell", bundle: nil), forCellReuseIdentifier: "scv_cell")
list_view.register(UINib(nibName: "two_title_cell", bundle: nil), forCellReuseIdentifier: "two_title_cell")
list_view.register(UINib(nibName: "one_title_cell", bundle: nil), forCellReuseIdentifier: "one_title_cell")
list_view.register(UINib(nibName: "img_title_cell", bundle: nil), forCellReuseIdentifier: "img_title_cell")
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17701" 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="17703"/>
<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="S_Y_Detail_Vc" customModule="TestClass" customModuleProvider="target">
<connections>
<outlet property="list_view" destination="eIg-pi-wtm" id="A05-9w-f3c"/>
<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>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="eIg-pi-wtm">
<rect key="frame" x="0.0" y="44" width="414" height="852"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<connections>
<outlet property="dataSource" destination="-1" id="KCc-CE-MzM"/>
<outlet property="delegate" destination="-1" id="NjD-p8-MrN"/>
</connections>
</tableView>
</subviews>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="eIg-pi-wtm" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="4Sd-Hd-7aj"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="eIg-pi-wtm" secondAttribute="trailing" id="FA9-GN-cGO"/>
<constraint firstAttribute="bottom" secondItem="eIg-pi-wtm" secondAttribute="bottom" id="hcS-2Q-XKU"/>
<constraint firstItem="eIg-pi-wtm" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="k9K-2Q-62v"/>
</constraints>
<point key="canvasLocation" x="142" y="59"/>
</view>
</objects>
<resources>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
//
// img_title_cell.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2021/1/27.
// Copyright © 2021 junye lu. All rights reserved.
//
import UIKit
class img_title_cell: UITableViewCell {
@IBOutlet weak var img_view: UIImageView!
@IBOutlet weak var name_lbl: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
self.selectionStyle = .none
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17701" 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="17703"/>
<capability name="Named colors" 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"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="img_title_cell" customModule="TestClass" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="375" height="442"/>
<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">
<rect key="frame" x="0.0" y="0.0" width="375" height="442"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="rak-sc-7q0">
<rect key="frame" x="0.0" y="0.0" width="375" height="375"/>
<constraints>
<constraint firstAttribute="height" constant="375" id="xyg-eo-yBQ"/>
</constraints>
</imageView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="8gT-lP-oMT">
<rect key="frame" x="0.0" y="375" width="375" height="62"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="标题" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wXl-BH-s8v">
<rect key="frame" x="15" y="15" width="345" height="32"/>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="15"/>
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="wXl-BH-s8v" secondAttribute="trailing" constant="15" id="Ads-ES-n2H"/>
<constraint firstItem="wXl-BH-s8v" firstAttribute="top" secondItem="8gT-lP-oMT" secondAttribute="top" constant="15" id="Ahy-f4-ikE"/>
<constraint firstAttribute="bottom" secondItem="wXl-BH-s8v" secondAttribute="bottom" constant="15" id="N5u-7z-xv2"/>
<constraint firstItem="wXl-BH-s8v" firstAttribute="leading" secondItem="8gT-lP-oMT" secondAttribute="leading" constant="15" id="rct-Z2-QaS"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" name="app底色"/>
<constraints>
<constraint firstItem="8gT-lP-oMT" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="XiF-G2-wiN"/>
<constraint firstItem="8gT-lP-oMT" firstAttribute="top" secondItem="rak-sc-7q0" secondAttribute="bottom" id="eos-H3-7i2"/>
<constraint firstItem="rak-sc-7q0" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="ft9-XJ-eJg"/>
<constraint firstAttribute="trailing" secondItem="8gT-lP-oMT" secondAttribute="trailing" id="iDC-UX-1dq"/>
<constraint firstAttribute="bottom" secondItem="8gT-lP-oMT" secondAttribute="bottom" constant="5" id="pTm-lP-xZP"/>
<constraint firstItem="rak-sc-7q0" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="ryr-Mr-plF"/>
<constraint firstAttribute="trailing" secondItem="rak-sc-7q0" secondAttribute="trailing" id="uCU-Vf-35r"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<connections>
<outlet property="img_view" destination="rak-sc-7q0" id="tak-PE-OZE"/>
<outlet property="name_lbl" destination="wXl-BH-s8v" id="xAi-Hg-4Gl"/>
</connections>
<point key="canvasLocation" x="141.30434782608697" y="55.580357142857139"/>
</tableViewCell>
</objects>
<resources>
<namedColor name="app底色">
<color red="0.94509803921568625" green="0.94509803921568625" blue="0.94509803921568625" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="标题字颜色">
<color red="0.18000000715255737" green="0.18000000715255737" blue="0.18000000715255737" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
//
// one_title_cell.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2021/1/27.
// Copyright © 2021 junye lu. All rights reserved.
//
import UIKit
class one_title_cell: UITableViewCell {
@IBOutlet weak var content_lbl: UILabel!
@IBOutlet weak var title_lbl: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
self.selectionStyle = .none
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17701" 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="17703"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<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"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="one_title_cell" customModule="TestClass" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="375" height="80.5"/>
<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">
<rect key="frame" x="0.0" y="0.0" width="375" height="80.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Le1-hI-qXY">
<rect key="frame" x="15" y="79.5" width="360" height="1"/>
<color key="backgroundColor" name="灰色分界线"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="qdo-PB-zAX"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="DPG-Lk-Nqo">
<rect key="frame" x="15" y="10" width="33" height="18.5"/>
<constraints>
<constraint firstAttribute="height" constant="18.5" id="64F-Kp-lI6"/>
</constraints>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="13"/>
<color key="textColor" name="个人中心灰色字体"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gPA-WE-zaw">
<rect key="frame" x="15" y="33.5" width="345" height="41"/>
<string key="text">法国进口鲜冻红金枪鱼法国进口鲜冻红金法国口鲜冻红金进
口鲜冻红金</string>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="13"/>
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="gPA-WE-zaw" secondAttribute="trailing" constant="15" id="52Z-9E-XpV"/>
<constraint firstItem="Le1-hI-qXY" firstAttribute="top" secondItem="gPA-WE-zaw" secondAttribute="bottom" constant="5" id="G0B-9D-GHZ"/>
<constraint firstItem="DPG-Lk-Nqo" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="NTz-dp-oX2"/>
<constraint firstItem="gPA-WE-zaw" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="Z6t-fa-wY3"/>
<constraint firstAttribute="trailing" secondItem="Le1-hI-qXY" secondAttribute="trailing" id="eQO-ln-PKQ"/>
<constraint firstAttribute="bottom" secondItem="Le1-hI-qXY" secondAttribute="bottom" id="khz-mc-U1A"/>
<constraint firstItem="DPG-Lk-Nqo" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="10" id="qNX-rv-we3"/>
<constraint firstItem="Le1-hI-qXY" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="qaK-Wu-0FS"/>
<constraint firstItem="gPA-WE-zaw" firstAttribute="top" secondItem="DPG-Lk-Nqo" secondAttribute="bottom" constant="5" id="xl0-TP-kKg"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<connections>
<outlet property="content_lbl" destination="gPA-WE-zaw" id="GcT-Va-wVh"/>
<outlet property="title_lbl" destination="DPG-Lk-Nqo" id="83Y-kU-VIq"/>
</connections>
<point key="canvasLocation" x="141" y="94"/>
</tableViewCell>
</objects>
<resources>
<namedColor name="个人中心灰色字体">
<color red="0.38823529411764707" green="0.38823529411764707" blue="0.38823529411764707" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<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>
//
// scv_cell.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2021/1/27.
// Copyright © 2021 junye lu. All rights reserved.
//
import UIKit
protocol scv_cell_delegate {
func scv_cell_check_img(idx:Int)
}
class scv_cell: UITableViewCell {
var delegate:scv_cell_delegate?
@IBOutlet weak var right_arrow: UIImageView!
@IBOutlet weak var left_arrow: UIImageView!
@IBOutlet weak var title_lbl: UILabel!
let scrollview = UIScrollView(frame: CGRect(x: 45, y: 53.5, width: ScreenWidth-90, height: 123.5))
@IBAction func tap_action(_ sender: UIButton) {
if sender == left_btn {
left_btn.isHidden = true
left_arrow.isHidden = true
right_arrow.isHidden = false
right_btn.isHidden = false
scrollview.setContentOffset(CGPoint(x: 0, y: 0), animated: true)
}else{
right_btn.isHidden = true
right_arrow.isHidden = true
left_btn.isHidden = false
left_arrow.isHidden = false
scrollview.setContentOffset(CGPoint(x: ScreenWidth-90, y: 0), animated: true)
}
}
@IBOutlet weak var right_btn: UIButton!
@IBOutlet weak var left_btn: UIButton!
let titles = ["营业执照","生产许可证","商品流通许可证"]
override func awakeFromNib() {
super.awakeFromNib()
self.selectionStyle = .none
// Initialization code
scrollview.showsHorizontalScrollIndicator = false
scrollview.isPagingEnabled = true
scrollview.contentSize = CGSize(width: (ScreenWidth-90)*2, height: 123.5)
self.contentView.addSubview(scrollview)
let width = (ScreenWidth-115)*0.5
for i in 0 ..< 3 {
let btn = UIButton(frame: CGRect(x: CGFloat(i)*(width+25), y: 0, width: width, height: 95))
btn.backgroundColor = UIColor.blue
if i == 1 {
btn.backgroundColor = UIColor.gray
}
btn.tag = i
btn.addTarget(self, action: #selector(btn_click(btn:)), for: .touchUpInside)
scrollview.addSubview(btn)
let lbl = UILabel()
lbl.textAlignment = .center
lbl.textColor = UIColor(named: "标题字颜色")
lbl.text = titles[i]
lbl.font = UIFont(name: "PingFangSC-Medium", size: 13)
scrollview.addSubview(lbl)
lbl.snp.makeConstraints { (make) in
make.centerX.equalTo(btn.snp.centerX)
make.top.equalTo(btn.snp_bottom).offset(10)
make.width.equalTo(btn.snp_width)
make.height.equalTo(18.5)
}
}
}
@objc func btn_click(btn:UIButton){
delegate?.scv_cell_check_img(idx: btn.tag)
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
}
This diff is collapsed.
//
// two_title_cell.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2021/1/27.
// Copyright © 2021 junye lu. All rights reserved.
//
import UIKit
class two_title_cell: UITableViewCell {
@IBOutlet weak var content_2_lbl: UILabel!
@IBOutlet weak var title_2_lbl: UILabel!
@IBOutlet weak var title_1_lbl: UILabel!
@IBOutlet weak var content_1_lbl: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
self.selectionStyle = .none
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17701" 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="17703"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<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"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="two_title_cell" customModule="TestClass" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="375" height="114"/>
<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">
<rect key="frame" x="0.0" y="0.0" width="375" height="114"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="tnB-mz-Hwe">
<rect key="frame" x="15" y="113" width="360" height="1"/>
<color key="backgroundColor" name="灰色分界线"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="fm3-TJ-8pk"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="acv-qK-gmn">
<rect key="frame" x="15" y="10" width="33" height="18.5"/>
<constraints>
<constraint firstAttribute="height" constant="18.5" id="LYx-gD-Gkc"/>
</constraints>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="13"/>
<color key="textColor" name="个人中心灰色字体"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="NIe-e5-x6Q">
<rect key="frame" x="15" y="33.5" width="345" height="18.5"/>
<constraints>
<constraint firstAttribute="height" constant="18.5" id="JCX-4S-E5p"/>
</constraints>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="13"/>
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bEx-3M-ori">
<rect key="frame" x="15" y="62" width="33" height="18.5"/>
<constraints>
<constraint firstAttribute="height" constant="18.5" id="2it-2t-aJv"/>
</constraints>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="13"/>
<color key="textColor" name="个人中心灰色字体"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="IH2-Ru-pJb">
<rect key="frame" x="15" y="85.5" width="345" height="18.5"/>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="13"/>
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstAttribute="bottom" secondItem="tnB-mz-Hwe" secondAttribute="bottom" id="4Oc-Qf-Oib"/>
<constraint firstItem="NIe-e5-x6Q" firstAttribute="top" secondItem="acv-qK-gmn" secondAttribute="bottom" constant="5" id="4cs-2K-yLo"/>
<constraint firstItem="NIe-e5-x6Q" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="5ZF-kW-zTa"/>
<constraint firstItem="IH2-Ru-pJb" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="8i9-jE-Tdv"/>
<constraint firstAttribute="trailing" secondItem="IH2-Ru-pJb" secondAttribute="trailing" constant="15" id="A9T-bu-Tz6"/>
<constraint firstItem="acv-qK-gmn" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="10" id="MuB-vZ-xNN"/>
<constraint firstItem="IH2-Ru-pJb" firstAttribute="top" secondItem="bEx-3M-ori" secondAttribute="bottom" constant="5" id="POA-oM-oYk"/>
<constraint firstAttribute="trailing" secondItem="tnB-mz-Hwe" secondAttribute="trailing" id="SFF-4J-t4V"/>
<constraint firstItem="bEx-3M-ori" firstAttribute="top" secondItem="NIe-e5-x6Q" secondAttribute="bottom" constant="10" id="T6u-Hn-tSq"/>
<constraint firstItem="acv-qK-gmn" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="dSU-H7-ARZ"/>
<constraint firstItem="bEx-3M-ori" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="ocO-Yf-7Jy"/>
<constraint firstItem="tnB-mz-Hwe" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="pLe-xD-6b7"/>
<constraint firstAttribute="trailing" secondItem="NIe-e5-x6Q" secondAttribute="trailing" constant="15" id="xOp-DC-XMN"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<connections>
<outlet property="content_1_lbl" destination="NIe-e5-x6Q" id="cLs-gk-SuR"/>
<outlet property="content_2_lbl" destination="IH2-Ru-pJb" id="0GX-g8-fPh"/>
<outlet property="title_1_lbl" destination="acv-qK-gmn" id="LJk-kz-Ljm"/>
<outlet property="title_2_lbl" destination="bEx-3M-ori" id="0ax-zT-PHl"/>
</connections>
<point key="canvasLocation" x="142" y="102"/>
</tableViewCell>
</objects>
<resources>
<namedColor name="个人中心灰色字体">
<color red="0.38823529411764707" green="0.38823529411764707" blue="0.38823529411764707" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<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>
...@@ -11,7 +11,30 @@ import Photos ...@@ -11,7 +11,30 @@ import Photos
protocol OrderDViewControllerDelegate { protocol OrderDViewControllerDelegate {
func refishingOrderDchange() func refishingOrderDchange()
} }
class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,TitleAndBtnCellDelegate,GuanLianKehuVCDelegate,OrderDViewFooterViewDelegate,TitleAndTFCellDelegate,GeliAlertViewDelegate,GLAlertSelectViewDelegate,XiuGaiYuShouJiaViewControllerDelegate,ChangeGoodsPriceVCDelegate,GeliAlertTextFiledDelegate,GeliAlertTextViewDelegate,UpBillDataTableViewCellDelegate{ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,TitleAndBtnCellDelegate,GuanLianKehuVCDelegate,OrderDViewFooterViewDelegate,TitleAndTFCellDelegate,GeliAlertViewDelegate,GLAlertSelectViewDelegate,XiuGaiYuShouJiaViewControllerDelegate,ChangeGoodsPriceVCDelegate,GeliAlertTextFiledDelegate,GeliAlertTextViewDelegate,UpBillDataTableViewCellDelegate, DaiKeXiaDanGouWuCellDelegate, S_Y_View_Delegate{
func S_Y_View_Check_Detail() {
print("查看溯源")
let vc = S_Y_Detail_Vc()
vc.user_type = 1
self.navigationController?.pushViewController(vc, animated: true)
}
func DaiKeXiaDanGouWuCellDelAction(cell: DaiKeXiaDanGouWuCell) {
//此处无用
}
func DaiKeXiaDanGouWuCellRemarkChange(cell: DaiKeXiaDanGouWuCell) {
//此处无用
}
func DaiKeXiaDanGouWuCell_check(cell: DaiKeXiaDanGouWuCell) {
print("溯源")
print("check S_Y")
let vc = S_Y_View(frame: self.view.bounds)
vc.delegate = self
self.view.addSubview(vc)
}
var lmIdx = 100 var lmIdx = 100
...@@ -431,13 +454,20 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -431,13 +454,20 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
case 1: case 1:
//MARK:--商品cell //MARK:--商品cell
let cell = tableView.dequeueReusableCell(withIdentifier: "DaiKeXiaDanGouWuCell") as! DaiKeXiaDanGouWuCell let cell = tableView.dequeueReusableCell(withIdentifier: "DaiKeXiaDanGouWuCell") as! DaiKeXiaDanGouWuCell
// cell.priceLbl.isHidden = false cell.delegate = self
cell.isDetail = true cell.isDetail = true
// cell.selectBtn.isHidden = true
let rowModel = self.dataMdoel?.order_goods![indexPath.row] let rowModel = self.dataMdoel?.order_goods![indexPath.row]
if self.dataMdoel?.order_goods != nil {
if (self.dataMdoel?.order_goods!.count)! > 2 && check_all == false{
if indexPath.row == 1 {
cell.btm_line.isHidden = true
}
}
if indexPath.row == (self.dataMdoel?.order_goods!.count)! - 1 {
cell.btm_line.isHidden = true
}
}
cell.check_button.isHidden = false
cell.imgView?.sd_setImage(with: URL(string: SERVERCE_ImageHost + (rowModel?.goods_thumb)!)) cell.imgView?.sd_setImage(with: URL(string: SERVERCE_ImageHost + (rowModel?.goods_thumb)!))
cell.content_tv.text = rowModel?.remark cell.content_tv.text = rowModel?.remark
cell.titleLbl.text = rowModel?.goods_name cell.titleLbl.text = rowModel?.goods_name
...@@ -752,12 +782,18 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -752,12 +782,18 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
return cell return cell
} }
var check_all = false
//MARK:--查看全部商品 //MARK:--查看全部商品
func OrderDViewFooterViewBtnClick() { func OrderDViewFooterViewBtnClick(img:OrderDViewFooterView) {
print("查看全部商品") print("查看全部商品")
let vc = ShowAlGoodsViewController() check_all = !check_all
vc.order_goods = self.dataMdoel?.order_goods self.listView.reloadData()
self.navigationController?.pushViewController(vc, animated: true)
// let vc = ShowAlGoodsViewController()
// vc.order_goods = self.dataMdoel?.order_goods
// self.navigationController?.pushViewController(vc, animated: true)
} }
//MARK:--选择的关联客户返回数据 //MARK:--选择的关联客户返回数据
...@@ -1047,10 +1083,15 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -1047,10 +1083,15 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
if self.dataMdoel != nil { if self.dataMdoel != nil {
if (self.dataMdoel?.order_goods?.count)! < 2 { if (self.dataMdoel?.order_goods?.count)! < 2 {
num = (self.dataMdoel?.order_goods?.count)! num = (self.dataMdoel?.order_goods?.count)!
}else{
//abc
if check_all {
num = (self.dataMdoel?.order_goods?.count)!
}else{ }else{
num = 2 num = 2
} }
} }
}
return num return num
} }
...@@ -1094,7 +1135,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -1094,7 +1135,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
if (self.dataMdoel?.order_goods?.count)! > 2 { if (self.dataMdoel?.order_goods?.count)! > 2 {
let view = OrderDViewFooterView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 33.5)) let view = OrderDViewFooterView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 33.5))
view.delegate = self view.delegate = self
view.nameLbl.text = "查看全部(共" + StringByInt(number: (self.dataMdoel?.order_goods!.count)!) + "个商品)" view.check_all = check_all
return view return view
} }
} }
...@@ -1375,6 +1416,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -1375,6 +1416,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
let vc = PrintListMgVc() let vc = PrintListMgVc()
vc.printData = d.data?.order_res vc.printData = d.data?.order_res
vc.order_id = self.orderId! vc.order_id = self.orderId!
vc.selectIndex = (d.data?.order_res?.print_type)!-1
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
} failture: { (err) in } failture: { (err) in
......
...@@ -8,16 +8,27 @@ ...@@ -8,16 +8,27 @@
import UIKit import UIKit
@objc protocol OrderDViewFooterViewDelegate { @objc protocol OrderDViewFooterViewDelegate {
@objc optional func OrderDViewFooterViewBtnClick() @objc optional func OrderDViewFooterViewBtnClick(img:OrderDViewFooterView)
} }
class OrderDViewFooterView: UIView { class OrderDViewFooterView: UIView {
@IBOutlet weak var arrow_img: UIImageView!
var check_all = false {
didSet{
if check_all {
arrow_img.image = UIImage(named: "up_ar")
}else{
arrow_img.image = UIImage(named: "down_ar")
}
}
}
var contentView:UIView! var contentView:UIView!
var delegate:OrderDViewFooterViewDelegate? var delegate:OrderDViewFooterViewDelegate?
@IBOutlet weak var nameLbl: UILabel! @IBOutlet weak var nameLbl: UILabel!
//初始化时将xib中的view添加进来 //初始化时将xib中的view添加进来
@IBAction func pushAction(_ sender: Any) { @IBAction func pushAction(_ sender: Any) {
delegate?.OrderDViewFooterViewBtnClick?() delegate?.OrderDViewFooterViewBtnClick?(img: self)
} }
override init(frame: CGRect) { override init(frame: CGRect) {
super.init(frame: frame) super.init(frame: frame)
contentView = loadViewFromNib() contentView = loadViewFromNib()
...@@ -32,6 +43,7 @@ class OrderDViewFooterView: UIView { ...@@ -32,6 +43,7 @@ class OrderDViewFooterView: UIView {
super.init(coder: aDecoder) super.init(coder: aDecoder)
contentView = loadViewFromNib() contentView = loadViewFromNib()
addSubview(contentView) addSubview(contentView)
contentView.snp.makeConstraints { (make) in contentView.snp.makeConstraints { (make) in
make.left.top.right.bottom.equalToSuperview() make.left.top.right.bottom.equalToSuperview()
} }
......
<?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="17701" 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="17703"/>
<capability name="Named colors" minToolsVersion="9.0"/> <capability name="Named colors" 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"/>
</dependencies> </dependencies>
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="OrderDViewFooterView" customModule="GeliBusinessPlatform" customModuleProvider="target"> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="OrderDViewFooterView" customModule="TestClass" customModuleProvider="target">
<connections> <connections>
<outlet property="arrow_img" destination="Qc3-GU-bzm" id="lHI-7H-T03"/>
<outlet property="nameLbl" destination="rj1-Gd-MWT" id="KSu-0f-TCJ"/> <outlet property="nameLbl" destination="rj1-Gd-MWT" id="KSu-0f-TCJ"/>
</connections> </connections>
</placeholder> </placeholder>
...@@ -17,27 +19,36 @@ ...@@ -17,27 +19,36 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="34"/> <rect key="frame" x="0.0" y="0.0" width="375" height="34"/>
<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" text="查看全部(共20个商品)" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rj1-Gd-MWT"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rj1-Gd-MWT">
<rect key="frame" x="0.0" y="0.0" width="375" height="16"/> <rect key="frame" x="0.0" y="0.0" width="375" height="0.0"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/> <fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" name="蓝色字体颜色"/> <color key="textColor" name="蓝色字体颜色"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Y9f-zb-HLE"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Y9f-zb-HLE">
<rect key="frame" x="0.0" y="0.0" width="375" height="34"/> <rect key="frame" x="0.0" y="0.0" width="375" height="34"/>
<connections> <connections>
<action selector="pushAction:" destination="-1" eventType="touchUpInside" id="CgM-7b-gUF"/> <action selector="pushAction:" destination="-1" eventType="touchUpInside" id="CgM-7b-gUF"/>
</connections> </connections>
</button> </button>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="down_ar" translatesAutoresizingMaskIntoConstraints="NO" id="Qc3-GU-bzm">
<rect key="frame" x="182" y="5" width="11" height="10"/>
<constraints>
<constraint firstAttribute="width" constant="11" id="0MZ-m8-rzj"/>
<constraint firstAttribute="height" constant="10" id="R0d-Qs-rTC"/>
</constraints>
</imageView>
</subviews> </subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints> <constraints>
<constraint firstAttribute="trailing" secondItem="Y9f-zb-HLE" secondAttribute="trailing" id="8xs-gb-RG2"/> <constraint firstAttribute="trailing" secondItem="Y9f-zb-HLE" secondAttribute="trailing" id="8xs-gb-RG2"/>
<constraint firstItem="Qc3-GU-bzm" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="5" id="JcM-xj-WZq"/>
<constraint firstAttribute="bottom" secondItem="Y9f-zb-HLE" secondAttribute="bottom" id="WaI-Zw-HGe"/> <constraint firstAttribute="bottom" secondItem="Y9f-zb-HLE" secondAttribute="bottom" id="WaI-Zw-HGe"/>
<constraint firstItem="Y9f-zb-HLE" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="YUZ-JY-agY"/> <constraint firstItem="Y9f-zb-HLE" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="YUZ-JY-agY"/>
<constraint firstItem="Y9f-zb-HLE" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="l9s-Wb-cxT"/> <constraint firstItem="Y9f-zb-HLE" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="l9s-Wb-cxT"/>
<constraint firstItem="rj1-Gd-MWT" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="lgW-4x-UBl"/> <constraint firstItem="rj1-Gd-MWT" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="lgW-4x-UBl"/>
<constraint firstItem="rj1-Gd-MWT" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="oyd-48-QGP"/> <constraint firstItem="rj1-Gd-MWT" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="oyd-48-QGP"/>
<constraint firstItem="Qc3-GU-bzm" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="snn-as-tcZ"/>
<constraint firstAttribute="trailing" secondItem="rj1-Gd-MWT" secondAttribute="trailing" id="yIC-RO-Ugz"/> <constraint firstAttribute="trailing" secondItem="rj1-Gd-MWT" secondAttribute="trailing" id="yIC-RO-Ugz"/>
</constraints> </constraints>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
...@@ -45,8 +56,9 @@ ...@@ -45,8 +56,9 @@
</view> </view>
</objects> </objects>
<resources> <resources>
<image name="down_ar" width="12" height="11"/>
<namedColor name="蓝色字体颜色"> <namedColor name="蓝色字体颜色">
<color red="0.27799999713897705" green="0.56099998950958252" blue="0.88999998569488525" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.27843137254901962" green="0.5607843137254902" blue="0.8901960784313725" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor> </namedColor>
</resources> </resources>
</document> </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