Commit 323938fa authored by 刘俊宏's avatar 刘俊宏

完成工作中心首页UI

parent f95974df
......@@ -243,6 +243,14 @@
F94A314B246250DB00FEC38E /* GoodsDetailModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F94A314A246250DB00FEC38E /* GoodsDetailModel.swift */; };
F94A314D2462582F00FEC38E /* GeneralInfoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F94A314C2462582F00FEC38E /* GeneralInfoModel.swift */; };
F94A314F24625AFA00FEC38E /* GoodsUpDataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F94A314E24625AFA00FEC38E /* GoodsUpDataModel.swift */; };
F94A315324626D7800FEC38E /* WorkCViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F94A315124626D7800FEC38E /* WorkCViewController.swift */; };
F94A315424626D7800FEC38E /* WorkCViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F94A315224626D7800FEC38E /* WorkCViewController.xib */; };
F94A315724628AC600FEC38E /* WorkItemCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F94A315524628AC600FEC38E /* WorkItemCollectionViewCell.swift */; };
F94A315824628AC600FEC38E /* WorkItemCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F94A315624628AC600FEC38E /* WorkItemCollectionViewCell.xib */; };
F94A315B24628C7E00FEC38E /* WorkItemTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F94A315924628C7E00FEC38E /* WorkItemTableViewCell.swift */; };
F94A315C24628C7E00FEC38E /* WorkItemTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F94A315A24628C7E00FEC38E /* WorkItemTableViewCell.xib */; };
F94A315F24629DDD00FEC38E /* WorkBannerTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F94A315D24629DDD00FEC38E /* WorkBannerTableViewCell.swift */; };
F94A316024629DDD00FEC38E /* WorkBannerTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F94A315E24629DDD00FEC38E /* WorkBannerTableViewCell.xib */; };
F950FDA32451438A00C40530 /* AdminInfoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F950FDA22451438A00C40530 /* AdminInfoModel.swift */; };
F950FDA52451453A00C40530 /* ShopInfoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F950FDA42451453A00C40530 /* ShopInfoModel.swift */; };
F950FDA72451494500C40530 /* GeliPayInfoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F950FDA62451494500C40530 /* GeliPayInfoModel.swift */; };
......@@ -575,6 +583,14 @@
F94A314A246250DB00FEC38E /* GoodsDetailModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoodsDetailModel.swift; sourceTree = "<group>"; };
F94A314C2462582F00FEC38E /* GeneralInfoModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GeneralInfoModel.swift; sourceTree = "<group>"; };
F94A314E24625AFA00FEC38E /* GoodsUpDataModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoodsUpDataModel.swift; sourceTree = "<group>"; };
F94A315124626D7800FEC38E /* WorkCViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WorkCViewController.swift; sourceTree = "<group>"; };
F94A315224626D7800FEC38E /* WorkCViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WorkCViewController.xib; sourceTree = "<group>"; };
F94A315524628AC600FEC38E /* WorkItemCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WorkItemCollectionViewCell.swift; sourceTree = "<group>"; };
F94A315624628AC600FEC38E /* WorkItemCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WorkItemCollectionViewCell.xib; sourceTree = "<group>"; };
F94A315924628C7E00FEC38E /* WorkItemTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WorkItemTableViewCell.swift; sourceTree = "<group>"; };
F94A315A24628C7E00FEC38E /* WorkItemTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WorkItemTableViewCell.xib; sourceTree = "<group>"; };
F94A315D24629DDD00FEC38E /* WorkBannerTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WorkBannerTableViewCell.swift; sourceTree = "<group>"; };
F94A315E24629DDD00FEC38E /* WorkBannerTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WorkBannerTableViewCell.xib; sourceTree = "<group>"; };
F950FDA22451438A00C40530 /* AdminInfoModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdminInfoModel.swift; sourceTree = "<group>"; };
F950FDA42451453A00C40530 /* ShopInfoModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShopInfoModel.swift; sourceTree = "<group>"; };
F950FDA62451494500C40530 /* GeliPayInfoModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GeliPayInfoModel.swift; sourceTree = "<group>"; };
......@@ -1060,6 +1076,7 @@
E09B03AD2445B0BA00211A51 /* ViewController */ = {
isa = PBXGroup;
children = (
F94A315024626D4000FEC38E /* 工作中心 */,
E0BE8A8D245A9B6500E80134 /* 应付账款 */,
E07B1E75245966C90055BA3C /* 新增采购单 */,
E07B1E64245925F30055BA3C /* 供应商管理 */,
......@@ -1431,6 +1448,21 @@
path = TabBarVc;
sourceTree = "<group>";
};
F94A315024626D4000FEC38E /* 工作中心 */ = {
isa = PBXGroup;
children = (
F94A315124626D7800FEC38E /* WorkCViewController.swift */,
F94A315224626D7800FEC38E /* WorkCViewController.xib */,
F94A315524628AC600FEC38E /* WorkItemCollectionViewCell.swift */,
F94A315624628AC600FEC38E /* WorkItemCollectionViewCell.xib */,
F94A315924628C7E00FEC38E /* WorkItemTableViewCell.swift */,
F94A315A24628C7E00FEC38E /* WorkItemTableViewCell.xib */,
F94A315D24629DDD00FEC38E /* WorkBannerTableViewCell.swift */,
F94A315E24629DDD00FEC38E /* WorkBannerTableViewCell.xib */,
);
path = "工作中心";
sourceTree = "<group>";
};
F950FDAF245171E000C40530 /* TimeSelectView */ = {
isa = PBXGroup;
children = (
......@@ -1751,6 +1783,7 @@
F9DDBE972457D3EC00A32CB2 /* WebViewController.xib in Resources */,
E0F97B0424512299001BD600 /* GLAlertSelectView.xib in Resources */,
F9023F6E2449A9B100DD5A63 /* TitleAndTFCell.xib in Resources */,
F94A315424626D7800FEC38E /* WorkCViewController.xib in Resources */,
E042F7392452766100CDFA12 /* AdressSelectCell.xib in Resources */,
E00E48C32457C0D600F16545 /* XuanZeShangPinViewController.xib in Resources */,
F9023F6A2449A50900DD5A63 /* TitleContentCell.xib in Resources */,
......@@ -1760,6 +1793,7 @@
F969BF1F244EE67900C79953 /* GoodsManageListVC.xib in Resources */,
E0F97B112451728D001BD600 /* AddGuiGeCell.xib in Resources */,
E0C9EF13244E922200277435 /* OrderDViewController.xib in Resources */,
F94A316024629DDD00FEC38E /* WorkBannerTableViewCell.xib in Resources */,
F95567AC2453E40B009674AB /* OrderListViewController.xib in Resources */,
E00E48C72457C99900F16545 /* KuCunShangPinXQViewController.xib in Resources */,
E02FD9F22455705F00E10E27 /* ChuRuKuJiLuCell.xib in Resources */,
......@@ -1808,6 +1842,7 @@
E07B1E79245966E60055BA3C /* XinCaiGouViewController.xib in Resources */,
E0BE8A88245A7A1500E80134 /* JiBenXinXiCell.xib in Resources */,
E0A2E81B24552E3C00D6DB34 /* XinZengPinPaiViewController.xib in Resources */,
F94A315C24628C7E00FEC38E /* WorkItemTableViewCell.xib in Resources */,
E0A7548B244A8F0F00A84B67 /* CheckWareHourseViewController.xib in Resources */,
E0BE8A80245A740600E80134 /* ChengGongCell.xib in Resources */,
F95D9B5024484FAE0080D6E3 /* GeliAlertView.xib in Resources */,
......@@ -1833,6 +1868,7 @@
E0273DDE24551D4500B3FCAE /* OnlyLabelCell.xib in Resources */,
E00D85E5244561FE00F5F816 /* Assets.xcassets in Resources */,
E0A320C72456D01D00AF321C /* DaiKeXiaDanFooterView.xib in Resources */,
F94A315824628AC600FEC38E /* WorkItemCollectionViewCell.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -1924,6 +1960,7 @@
E0A320C52456D01300AF321C /* DaiKeXiaDanFooterView.swift in Sources */,
E0336DD5244EC40000380BE9 /* CreatNewSpecsViewController.swift in Sources */,
E09F4CA22452D18800BE033D /* ZengZhiServicesViewController.swift in Sources */,
F94A315B24628C7E00FEC38E /* WorkItemTableViewCell.swift in Sources */,
E0DDCB18244AE2AC00DF54C7 /* XiuGaiYuShouJiaViewController.swift in Sources */,
F950FDEA2451920200C40530 /* DIYCalendarCell.swift in Sources */,
F950FDE224518B9500C40530 /* FSCalendarCalculator.m in Sources */,
......@@ -1963,6 +2000,7 @@
F95A9EDD24557CD500867849 /* GuanLianKehuVC.swift in Sources */,
E00D85DF244561FD00F5F816 /* AppDelegate.swift in Sources */,
E0516F7F244806C500E373CE /* MsgCenterViewController.swift in Sources */,
F94A315724628AC600FEC38E /* WorkItemCollectionViewCell.swift in Sources */,
F950FDA52451453A00C40530 /* ShopInfoModel.swift in Sources */,
E0516F822448086700E373CE /* MsgCenterCell.swift in Sources */,
F95A9ED524551DF900867849 /* UIView+constraints.swift in Sources */,
......@@ -2036,6 +2074,7 @@
F933F6CE2452C68B00189561 /* PKHUDSquareBaseView.swift in Sources */,
E06524F524580BB600CA22E2 /* BaoZhiQiCell.swift in Sources */,
E0BE8AA4245AA31400E80134 /* YingFuZhangKuanXQViewController.swift in Sources */,
F94A315324626D7800FEC38E /* WorkCViewController.swift in Sources */,
E07B1E62245921A60055BA3C /* KeHuXQCell.swift in Sources */,
E0DDCB1D244AE81800DF54C7 /* GuanLianKeHuCell.swift in Sources */,
E0D197BF2448431C002B080C /* BabyBluetooth.m in Sources */,
......@@ -2075,6 +2114,7 @@
F94A314D2462582F00FEC38E /* GeneralInfoModel.swift in Sources */,
E02DDD8D244FE43900ABB707 /* NewCreateFooter.swift in Sources */,
E0D197CF24485649002B080C /* BluetoothConnectViewController.swift in Sources */,
F94A315F24629DDD00FEC38E /* WorkBannerTableViewCell.swift in Sources */,
E042F73C245288F800CDFA12 /* WenDuCell.swift in Sources */,
F933F6C92452C68B00189561 /* HUD.swift in Sources */,
E0D197BC2448431C002B080C /* BabyPeripheralManager.m in Sources */,
......
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "workbanner.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "workbanner@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "workbanner@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "workdaohanglan.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "workdaohanglan@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "workdaohanglan@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "workerweima.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "workerweima@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "workerweima@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "workjia.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "workjia@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "workjia@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "workjian.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "workjian@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "workjian@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "workkuang.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "workkuang@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "workkuang@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "worktest1.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "worktest1@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "worktest1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "worktest2.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "worktest2@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "worktest2@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "worktop.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "worktop@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "worktop@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "workxiala.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "workxiala@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "workxiala@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "workzhankai.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "workzhankai@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "workzhankai@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
......@@ -75,7 +75,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDeleg
let v1 = OrderListViewController()
let v2 = GoodsManageListVC()
let v3 = LoginViewController()
let v3 = WorkCViewController()
let v4 = WarehoseMangementListVC()
let v5 = PersonCenterViewController()
......@@ -88,6 +88,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDeleg
// Create the SwiftUI view that provides the window contents.
tabBarController.viewControllers = [v1, v2, v3, v4, v5]
tabBarController.selectedIndex = 2
let contentView = tabBarController
if let windowScene = sceneC as? UIWindowScene {
......@@ -109,6 +110,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDeleg
}
//测试代码
if let tabBarItem = v2.tabBarItem as? ESTabBarItem {
DispatchQueue.main.asyncAfter(deadline: .now() + 2 ) {
tabBarItem.badgeValue = "1"
......
//
// WorkBannerTableViewCell.swift
// GeliBusinessPlatform
//
// Created by 刘俊宏 on 2020/5/6.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
class WorkBannerTableViewCell: UITableViewCell {
override func awakeFromNib() {
super.awakeFromNib()
self.selectionStyle = .none
}
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="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16086"/>
<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" rowHeight="171" id="KGk-i7-Jjw" customClass="WorkBannerTableViewCell" customModule="GeliBusinessPlatform" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="353" height="223"/>
<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="353" height="223"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="workbanner" translatesAutoresizingMaskIntoConstraints="NO" id="vYS-b9-DlX">
<rect key="frame" x="0.0" y="0.0" width="353" height="191"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="销售额统计:" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pRd-lf-xl6">
<rect key="frame" x="144" y="20" width="65" height="15"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" name="白色背景色"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="16" translatesAutoresizingMaskIntoConstraints="NO" id="1WB-Jl-YGE">
<rect key="frame" x="15" y="40" width="323" height="45"/>
<attributedString key="attributedText">
<fragment content="132936.86">
<attributes>
<color key="NSColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<font key="NSFont" size="32" name="PingFangSC-Semibold"/>
<paragraphStyle key="NSParagraphStyle" alignment="center" lineBreakMode="truncatingTail" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
</attributes>
</fragment>
</attributedString>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="BZy-Sq-Vha">
<rect key="frame" x="15" y="127" width="323" height="96"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5bk-NQ-8kk">
<rect key="frame" x="135" y="20" width="53" height="19"/>
<attributedString key="attributedText">
<fragment content="已收款:">
<attributes>
<color key="NSColor" name="灰色字体颜色"/>
<font key="NSFont" size="13" name="PingFangSC-Regular"/>
<paragraphStyle key="NSParagraphStyle" alignment="center" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
</attributes>
</fragment>
</attributedString>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="13" translatesAutoresizingMaskIntoConstraints="NO" id="AWN-GF-A3K">
<rect key="frame" x="113.5" y="52" width="96" height="24"/>
<constraints>
<constraint firstAttribute="width" constant="96" id="NU6-YZ-bC0"/>
</constraints>
<attributedString key="attributedText">
<fragment content="2513212011">
<attributes>
<font key="NSFont" size="20" name="DINAlternate-Bold"/>
<paragraphStyle key="NSParagraphStyle" alignment="center" lineBreakMode="truncatingTail" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
</attributes>
</fragment>
</attributedString>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="g61-9M-kva">
<rect key="frame" x="30" y="22.5" width="65" height="14.5"/>
<attributedString key="attributedText">
<fragment content="订单数量:">
<attributes>
<color key="NSColor" name="灰色字体颜色"/>
<font key="NSFont" size="13" name=".PingFangSC-Regular"/>
<paragraphStyle key="NSParagraphStyle" alignment="center" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
</attributes>
</fragment>
</attributedString>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="13" translatesAutoresizingMaskIntoConstraints="NO" id="qC2-6T-Y8x">
<rect key="frame" x="24" y="52" width="77" height="24"/>
<constraints>
<constraint firstAttribute="width" constant="77" id="aHR-yL-a2A"/>
</constraints>
<attributedString key="attributedText">
<fragment content="2513212">
<attributes>
<font key="NSFont" size="20" name="DINAlternate-Bold"/>
<paragraphStyle key="NSParagraphStyle" alignment="center" lineBreakMode="truncatingTail" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
</attributes>
</fragment>
</attributedString>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TeE-zd-u5H">
<rect key="frame" x="241" y="22" width="52" height="15"/>
<attributedString key="attributedText">
<fragment content="待收款:">
<attributes>
<color key="NSColor" name="灰色字体颜色"/>
<font key="NSFont" size="13" name=".PingFangSC-Regular"/>
<paragraphStyle key="NSParagraphStyle" alignment="center" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
</attributes>
</fragment>
</attributedString>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="13" translatesAutoresizingMaskIntoConstraints="NO" id="dTv-Ho-7eq">
<rect key="frame" x="227" y="52" width="80" height="24"/>
<constraints>
<constraint firstAttribute="width" constant="80" id="HOs-uN-tNy"/>
</constraints>
<attributedString key="attributedText">
<fragment content="25132120">
<attributes>
<font key="NSFont" size="20" name="DINAlternate-Bold"/>
<paragraphStyle key="NSParagraphStyle" alignment="center" lineBreakMode="truncatingTail" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
</attributes>
</fragment>
</attributedString>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" name="白色背景色"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="qC2-6T-Y8x" secondAttribute="bottom" constant="20" id="0Gd-By-cqf"/>
<constraint firstItem="AWN-GF-A3K" firstAttribute="centerX" secondItem="BZy-Sq-Vha" secondAttribute="centerX" id="2Cp-WE-gfM"/>
<constraint firstItem="TeE-zd-u5H" firstAttribute="centerY" secondItem="5bk-NQ-8kk" secondAttribute="centerY" id="4ZY-ew-qvp"/>
<constraint firstAttribute="trailing" secondItem="TeE-zd-u5H" secondAttribute="trailing" constant="30" id="6Fe-cU-QEH"/>
<constraint firstAttribute="bottom" secondItem="AWN-GF-A3K" secondAttribute="bottom" constant="20" id="8eQ-Tg-WbA"/>
<constraint firstItem="5bk-NQ-8kk" firstAttribute="top" secondItem="BZy-Sq-Vha" secondAttribute="top" constant="20" id="E2T-zK-qUG"/>
<constraint firstItem="g61-9M-kva" firstAttribute="leading" secondItem="BZy-Sq-Vha" secondAttribute="leading" constant="30" id="ELV-7r-kON"/>
<constraint firstItem="5bk-NQ-8kk" firstAttribute="centerX" secondItem="BZy-Sq-Vha" secondAttribute="centerX" id="Ova-iE-miW"/>
<constraint firstItem="g61-9M-kva" firstAttribute="centerY" secondItem="5bk-NQ-8kk" secondAttribute="centerY" id="QuG-q3-G5S"/>
<constraint firstAttribute="bottom" secondItem="dTv-Ho-7eq" secondAttribute="bottom" constant="20" id="SOg-HH-W7v"/>
<constraint firstItem="qC2-6T-Y8x" firstAttribute="centerX" secondItem="g61-9M-kva" secondAttribute="centerX" id="ccx-Qa-Rsq"/>
<constraint firstItem="dTv-Ho-7eq" firstAttribute="centerX" secondItem="TeE-zd-u5H" secondAttribute="centerX" id="uDg-Uh-zAB"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="10"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
</subviews>
<color key="backgroundColor" name="app底色"/>
<constraints>
<constraint firstItem="vYS-b9-DlX" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="06C-N4-jMV"/>
<constraint firstAttribute="trailing" secondItem="1WB-Jl-YGE" secondAttribute="trailing" constant="15" id="8D1-hB-h1e"/>
<constraint firstItem="BZy-Sq-Vha" firstAttribute="top" secondItem="1WB-Jl-YGE" secondAttribute="bottom" constant="42" id="A5l-3U-AcP"/>
<constraint firstItem="vYS-b9-DlX" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="FRb-tN-AYO"/>
<constraint firstAttribute="trailing" secondItem="vYS-b9-DlX" secondAttribute="trailing" id="KR2-xB-e13"/>
<constraint firstAttribute="bottom" secondItem="BZy-Sq-Vha" secondAttribute="bottom" id="KwF-M4-aPx"/>
<constraint firstItem="pRd-lf-xl6" firstAttribute="centerX" secondItem="H2p-sc-9uM" secondAttribute="centerX" id="TQv-m3-WES"/>
<constraint firstItem="1WB-Jl-YGE" firstAttribute="top" secondItem="pRd-lf-xl6" secondAttribute="bottom" constant="5" id="aPM-wX-gBx"/>
<constraint firstItem="1WB-Jl-YGE" firstAttribute="centerX" secondItem="H2p-sc-9uM" secondAttribute="centerX" id="dP3-3W-uQW"/>
<constraint firstAttribute="trailing" secondItem="BZy-Sq-Vha" secondAttribute="trailing" constant="15" id="iGz-KQ-Rrn"/>
<constraint firstItem="pRd-lf-xl6" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="20" id="nRC-1Q-ZjT"/>
<constraint firstItem="1WB-Jl-YGE" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="p2v-bC-qjh"/>
<constraint firstItem="BZy-Sq-Vha" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="x55-2h-hgu"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<point key="canvasLocation" x="155.79710144927537" y="173.10267857142856"/>
</tableViewCell>
</objects>
<resources>
<image name="workbanner" width="375" height="191"/>
<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.40000000596046448" green="0.40000000596046448" blue="0.40000000596046448" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="白色背景色">
<color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>
//
// WorkCViewController.swift
// GeliBusinessPlatform
//
// Created by 刘俊宏 on 2020/5/6.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewDataSource {
@IBOutlet weak var topNavBtn: UIButton!
@IBOutlet weak var contentView: UIView!
override func viewDidLoad() {
super.viewDidLoad()
setTabv()
}
//MARK:--头部按钮方法
@IBAction func topNavBtnAction(_ sender: UIButton) {
}
var tableV :UITableView!
func setTabv() {
tableV = UITableView()
contentView.addSubview(tableV);
tableV.snp.makeConstraints { (make) in
make.top.left.right.bottom.equalToSuperview()
}
tableV.backgroundColor = UIColor.init(named: "app底色")
tableV.delegate = self
tableV.dataSource = self
tableV.separatorStyle = .none
tableV?.register(UINib(nibName: "WorkItemTableViewCell", bundle: nil), forCellReuseIdentifier: "WorkItemTableViewCell")
tableV?.register(UINib(nibName: "WorkBannerTableViewCell", bundle: nil), forCellReuseIdentifier: "WorkBannerTableViewCell")
//设置estimatedRowHeight属性默认值
tableV.estimatedRowHeight = 44
//rowHeight属性设置为UITableViewAutomaticDimension
tableV.rowHeight = UITableView.automaticDimension
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 4
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.row == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: "WorkBannerTableViewCell") as! WorkBannerTableViewCell
return cell
}else{
let cell = tableView.dequeueReusableCell(withIdentifier: "WorkItemTableViewCell") as! WorkItemTableViewCell
//下面这两个语句一定要添加,否则第一屏显示的collection view尺寸,以及里面的单元格位置会不正确
cell.frame = tableView.bounds
cell.layoutIfNeeded()
let arr = ["常用功能","代办事项","功能列表"]
cell.reloadData(title: arr[indexPath.row - 1], items: [])
if indexPath.row == 1{
cell.gotoImgV.isHidden = false
}else{
cell.gotoImgV.isHidden = true
}
return cell
}
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
print("点中cell--\(indexPath.row)")
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.row == 0 {
return 223*glscale;
}
return tableV.rowHeight
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16086"/>
<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" customClass="WorkCViewController" customModule="GeliBusinessPlatform" customModuleProvider="target">
<connections>
<outlet property="contentView" destination="Ljz-8E-4Zf" id="KmD-fN-LkV"/>
<outlet property="topNavBtn" destination="1ie-Ew-Tp5" id="xH1-fJ-48Y"/>
<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"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="worktop" translatesAutoresizingMaskIntoConstraints="NO" id="66C-br-VYC">
<rect key="frame" x="0.0" y="-90" width="375" height="90"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="workdaohanglan" translatesAutoresizingMaskIntoConstraints="NO" id="X1E-5F-jT9">
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<constraints>
<constraint firstAttribute="height" constant="44" id="FHP-3L-b7g">
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isAdaptateScreen" value="YES"/>
</userDefinedRuntimeAttributes>
</constraint>
</constraints>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="YIb-m5-MdC">
<rect key="frame" x="343" y="11" width="17" height="22"/>
<state key="normal" image="workerweima"/>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ljz-8E-4Zf">
<rect key="frame" x="0.0" y="44" width="375" height="623"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
</view>
<button opaque="NO" contentMode="scaleToFill" semanticContentAttribute="forceRightToLeft" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="1ie-Ew-Tp5">
<rect key="frame" x="164" y="11" width="47" height="22"/>
<state key="normal" title="今日" image="workxiala">
<color key="titleColor" name="白色背景色"/>
</state>
<connections>
<action selector="topNavBtnAction:" destination="-1" eventType="touchUpInside" id="RGM-7a-Ezn"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="X1E-5F-jT9" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="DFv-HO-c0p"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="X1E-5F-jT9" secondAttribute="trailing" id="OgH-dg-ZCT"/>
<constraint firstItem="Ljz-8E-4Zf" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="PPR-dq-rC6"/>
<constraint firstItem="1ie-Ew-Tp5" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="TCt-8V-VOA"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="YIb-m5-MdC" secondAttribute="trailing" constant="15" id="ULs-Fd-CoY"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="Ljz-8E-4Zf" secondAttribute="trailing" id="Z5L-4v-B2X"/>
<constraint firstItem="YIb-m5-MdC" firstAttribute="centerY" secondItem="X1E-5F-jT9" secondAttribute="centerY" id="ZI5-io-bUQ"/>
<constraint firstItem="1ie-Ew-Tp5" firstAttribute="centerY" secondItem="X1E-5F-jT9" secondAttribute="centerY" id="bbq-jr-uIF"/>
<constraint firstItem="X1E-5F-jT9" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="f2E-Nx-hLz"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="Ljz-8E-4Zf" secondAttribute="bottom" id="hLG-4i-Ucw"/>
<constraint firstItem="66C-br-VYC" firstAttribute="trailing" secondItem="fnl-2z-Ty3" secondAttribute="trailing" id="iRS-gk-bGU"/>
<constraint firstItem="66C-br-VYC" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="ipu-dN-Imk"/>
<constraint firstItem="Ljz-8E-4Zf" firstAttribute="top" secondItem="X1E-5F-jT9" secondAttribute="bottom" id="tbU-Hu-Nwy"/>
<constraint firstItem="X1E-5F-jT9" firstAttribute="top" secondItem="66C-br-VYC" secondAttribute="bottom" id="yFS-jd-dcC"/>
</constraints>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<point key="canvasLocation" x="132" y="138.98050974512745"/>
</view>
</objects>
<resources>
<image name="workdaohanglan" width="375" height="44"/>
<image name="workerweima" width="17" height="17"/>
<image name="worktop" width="375" height="90"/>
<image name="workxiala" width="9.5" height="5"/>
<namedColor name="白色背景色">
<color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>
//
// WorkItemCollectionViewCell.swift
// GeliBusinessPlatform
//
// Created by 刘俊宏 on 2020/5/6.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
class WorkItemCollectionViewCell: UICollectionViewCell {
@IBOutlet weak var itemNameLbl: UILabel!
@IBOutlet weak var itemImgV: UIImageView!
@IBOutlet weak var bgImV: UIImageView!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16086"/>
<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"/>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="gTV-IL-0wX" customClass="WorkItemCollectionViewCell" customModule="GeliBusinessPlatform" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="100" height="69"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="100" height="69"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="pg3-lh-kp9">
<rect key="frame" x="0.0" y="0.0" width="100" height="69"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="item名称" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nZJ-9s-cJg">
<rect key="frame" x="3" y="48" width="94" height="14"/>
<fontDescription key="fontDescription" type="system" pointSize="11"/>
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="bianji" translatesAutoresizingMaskIntoConstraints="NO" id="qfI-0k-kQG">
<rect key="frame" x="41.5" y="18" width="17" height="16.5"/>
</imageView>
</subviews>
</view>
<constraints>
<constraint firstAttribute="trailing" secondItem="pg3-lh-kp9" secondAttribute="trailing" id="74N-EK-MFS"/>
<constraint firstItem="nZJ-9s-cJg" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="3" id="8vJ-pB-TcE"/>
<constraint firstAttribute="trailing" secondItem="nZJ-9s-cJg" secondAttribute="trailing" constant="3" id="Adg-76-avT"/>
<constraint firstItem="qfI-0k-kQG" firstAttribute="centerX" secondItem="gTV-IL-0wX" secondAttribute="centerX" id="GAg-aT-ARc"/>
<constraint firstItem="pg3-lh-kp9" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="KBD-1B-1gJ"/>
<constraint firstItem="qfI-0k-kQG" firstAttribute="bottom" secondItem="gTV-IL-0wX" secondAttribute="centerY" id="Lpw-Mk-cR4"/>
<constraint firstAttribute="bottom" secondItem="pg3-lh-kp9" secondAttribute="bottom" id="eFM-R9-BJo"/>
<constraint firstItem="pg3-lh-kp9" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="skh-sW-fEO"/>
<constraint firstAttribute="bottom" secondItem="nZJ-9s-cJg" secondAttribute="bottom" constant="7" id="v6j-Yr-2wF"/>
</constraints>
<viewLayoutGuide key="safeArea" id="ZTg-uK-7eu"/>
<size key="customSize" width="100" height="69"/>
<connections>
<outlet property="bgImV" destination="pg3-lh-kp9" id="usC-7f-KnW"/>
<outlet property="itemImgV" destination="qfI-0k-kQG" id="qLI-Cx-MSh"/>
<outlet property="itemNameLbl" destination="nZJ-9s-cJg" id="D5k-6q-pu9"/>
</connections>
<point key="canvasLocation" x="-18.840579710144929" y="80.691964285714278"/>
</collectionViewCell>
</objects>
<resources>
<image name="bianji" width="17" height="16.5"/>
<namedColor name="标题字颜色">
<color red="0.18000000715255737" green="0.18000000715255737" blue="0.18000000715255737" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>
//
// WorkItemTableViewCell.swift
// GeliBusinessPlatform
//
// Created by 刘俊宏 on 2020/5/6.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
class WorkItemTableViewCell: UITableViewCell , UICollectionViewDelegate, UICollectionViewDataSource {
@IBOutlet weak var collectionViewHeight: NSLayoutConstraint!
@IBOutlet weak var collectionView: UICollectionView!
@IBOutlet weak var titleLbl: UILabel!
@IBOutlet weak var gotoImgV: UIImageView!
//数据
var itemArrs:[String] = []
override func awakeFromNib() {
super.awakeFromNib()
self.selectionStyle = .none
//设置collectionView的代理
self.collectionView.delegate = self
self.collectionView.dataSource = self
// 注册CollectionViewCell
self.collectionView!.register(UINib(nibName:"WorkItemCollectionViewCell", bundle:nil),
forCellWithReuseIdentifier: "WorkItemCollectionViewCell")
}
//加载数据
func reloadData(title:String, items:[String]) {
//设置标题
self.titleLbl.text = title
//保存图片数据
self.itemArrs = items
//collectionView重新加载数据
self.collectionView.reloadData()
//更新collectionView的高度约束
let contentSize = self.collectionView.collectionViewLayout.collectionViewContentSize
collectionViewHeight.constant = contentSize.height
self.collectionView.collectionViewLayout.invalidateLayout()
}
//返回collectionView的单元格数量
func collectionView(_ collectionView: UICollectionView,
numberOfItemsInSection section: Int) -> Int {
return 10
}
//返回对应的单元格
func collectionView(_ collectionView: UICollectionView,
cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "WorkItemCollectionViewCell",
for: indexPath) as! WorkItemCollectionViewCell
// if indexPath.row % 2 == 0 {
// cell.bgImV.image = UIImage.init(named: "workjia")
// }else{
// cell.bgImV.image = UIImage.init(named: "workjian")
//
// }
// if indexPath.row == 10 {
// cell.bgImV.image = UIImage.init(named: "workkuang")
// cell.itemImgV.isHidden = true
// cell.itemNameLbl.isHidden = true
// }
cell.itemNameLbl.text = "itemN\(indexPath.row)"
if indexPath.row % 2 == 0 {
cell.itemImgV.image = UIImage.init(named: "worktest1")
}else{
cell.itemImgV.image = UIImage.init(named: "worktest2")
}
return cell
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
print("选中item=\(indexPath.section)=\(indexPath.row)")
}
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="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16086"/>
<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" rowHeight="220" id="KGk-i7-Jjw" customClass="WorkItemTableViewCell" customModule="GeliBusinessPlatform" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="419" height="198"/>
<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="419" height="198"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ihn-Ad-uPT">
<rect key="frame" x="0.0" y="0.0" width="419" height="15"/>
<color key="backgroundColor" name="app底色"/>
<constraints>
<constraint firstAttribute="height" constant="15" id="ERR-BB-bri"/>
</constraints>
</view>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="jinru" translatesAutoresizingMaskIntoConstraints="NO" id="dum-a9-xsC">
<rect key="frame" x="394" y="67" width="10" height="10"/>
<constraints>
<constraint firstAttribute="height" constant="10" id="fwU-qY-28T"/>
<constraint firstAttribute="width" constant="10" id="vIQ-Wx-UVj"/>
</constraints>
</imageView>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="j1a-a2-V8p">
<rect key="frame" x="0.0" y="114" width="419" height="84"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstAttribute="height" constant="84" id="v8g-As-Pb6"/>
</constraints>
<collectionViewFlowLayout key="collectionViewLayout" automaticEstimatedItemSize="YES" minimumLineSpacing="10" minimumInteritemSpacing="10" id="3O0-vb-gp6">
<size key="itemSize" width="61" height="69"/>
<size key="headerReferenceSize" width="0.0" height="0.0"/>
<size key="footerReferenceSize" width="0.0" height="0.0"/>
<inset key="sectionInset" minX="15" minY="15" maxX="15" maxY="15"/>
</collectionViewFlowLayout>
</collectionView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="U2a-kl-3Rs">
<rect key="frame" x="15" y="30" width="404" height="84"/>
<attributedString key="attributedText">
<fragment content="常用功能">
<attributes>
<color key="NSColor" name="标题字颜色"/>
<font key="NSFont" size="15" name="STHeitiSC-Medium"/>
</attributes>
</fragment>
</attributedString>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="U2a-kl-3Rs" secondAttribute="trailing" id="638-Yz-CeV"/>
<constraint firstItem="j1a-a2-V8p" firstAttribute="top" secondItem="U2a-kl-3Rs" secondAttribute="bottom" id="DGo-Kv-a2w"/>
<constraint firstItem="j1a-a2-V8p" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="E4F-HD-NeP"/>
<constraint firstAttribute="bottom" secondItem="j1a-a2-V8p" secondAttribute="bottom" id="N7G-JE-GMy"/>
<constraint firstAttribute="trailing" secondItem="dum-a9-xsC" secondAttribute="trailing" constant="15" id="NZp-Yo-rhh"/>
<constraint firstItem="U2a-kl-3Rs" firstAttribute="top" secondItem="Ihn-Ad-uPT" secondAttribute="bottom" constant="15" id="UiX-Hp-vmw"/>
<constraint firstItem="dum-a9-xsC" firstAttribute="centerY" secondItem="U2a-kl-3Rs" secondAttribute="centerY" id="XxL-fG-C5E"/>
<constraint firstAttribute="trailing" secondItem="Ihn-Ad-uPT" secondAttribute="trailing" id="faF-lv-sN6"/>
<constraint firstItem="Ihn-Ad-uPT" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="h6g-Kr-D0e"/>
<constraint firstItem="U2a-kl-3Rs" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="hfG-A4-dZY"/>
<constraint firstItem="Ihn-Ad-uPT" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="lp3-SA-ksU"/>
<constraint firstAttribute="trailing" secondItem="j1a-a2-V8p" secondAttribute="trailing" id="rat-IE-T6s"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<connections>
<outlet property="collectionView" destination="j1a-a2-V8p" id="Tgt-LU-8iy"/>
<outlet property="collectionViewHeight" destination="v8g-As-Pb6" id="mea-yU-erh"/>
<outlet property="gotoImgV" destination="dum-a9-xsC" id="oxC-Yd-2dT"/>
<outlet property="titleLbl" destination="U2a-kl-3Rs" id="pbp-im-yey"/>
</connections>
<point key="canvasLocation" x="170.28985507246378" y="87.053571428571431"/>
</tableViewCell>
</objects>
<resources>
<image name="jinru" width="13" height="23"/>
<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>
</resources>
</document>
<?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="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16086"/>
<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"/>
......
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