Commit 5e620756 authored by 刘俊宏's avatar 刘俊宏

添加商品管理list vc

parent 76e528cf
......@@ -93,6 +93,8 @@
F95D9CA524493E840080D6E3 /* ShopInfoViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F95D9CA324493E840080D6E3 /* ShopInfoViewController.xib */; };
F969BF07244EC38000C79953 /* GoodsCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F969BF05244EC38000C79953 /* GoodsCollectionViewCell.swift */; };
F969BF08244EC38000C79953 /* GoodsCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F969BF06244EC38000C79953 /* GoodsCollectionViewCell.xib */; };
F969BF1E244EE67900C79953 /* GoodsManageListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = F969BF1C244EE67900C79953 /* GoodsManageListVC.swift */; };
F969BF1F244EE67900C79953 /* GoodsManageListVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = F969BF1D244EE67900C79953 /* GoodsManageListVC.xib */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
......@@ -217,6 +219,8 @@
F95D9CA324493E840080D6E3 /* ShopInfoViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ShopInfoViewController.xib; sourceTree = "<group>"; };
F969BF05244EC38000C79953 /* GoodsCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoodsCollectionViewCell.swift; sourceTree = "<group>"; };
F969BF06244EC38000C79953 /* GoodsCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GoodsCollectionViewCell.xib; sourceTree = "<group>"; };
F969BF1C244EE67900C79953 /* GoodsManageListVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoodsManageListVC.swift; sourceTree = "<group>"; };
F969BF1D244EE67900C79953 /* GoodsManageListVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GoodsManageListVC.xib; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -452,6 +456,7 @@
E09B03AD2445B0BA00211A51 /* ViewController */ = {
isa = PBXGroup;
children = (
F969BF17244EE42700C79953 /* 商品管理 */,
E0336DD2244EC3CA00380BE9 /* 新增规格 */,
E022E131244D80EA00FEF5F7 /* 订单详情 */,
E0DDCB0B244AD84500DF54C7 /* 订单管理 */,
......@@ -659,6 +664,15 @@
path = CollectionCell;
sourceTree = "<group>";
};
F969BF17244EE42700C79953 /* 商品管理 */ = {
isa = PBXGroup;
children = (
F969BF1C244EE67900C79953 /* GoodsManageListVC.swift */,
F969BF1D244EE67900C79953 /* GoodsManageListVC.xib */,
);
path = "商品管理";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
......@@ -778,6 +792,7 @@
F9023F6A2449A50900DD5A63 /* TitleContentCell.xib in Resources */,
E0516F782448003D00E373CE /* PayViewController.xib in Resources */,
E0D197D024485649002B080C /* BluetoothConnectViewController.xib in Resources */,
F969BF1F244EE67900C79953 /* GoodsManageListVC.xib in Resources */,
E0C9EF13244E922200277435 /* OrderDViewController.xib in Resources */,
E088CC942447124D000DAA8A /* BindViewController.xib in Resources */,
E0D197D6244860B1002B080C /* BlueToothCell.xib in Resources */,
......@@ -889,6 +904,7 @@
E0C9EF12244E922200277435 /* OrderDViewController.swift in Sources */,
E0D197BD2448431C002B080C /* BabySpeaker.m in Sources */,
E00D85E1244561FD00F5F816 /* SceneDelegate.swift in Sources */,
F969BF1E244EE67900C79953 /* GoodsManageListVC.swift in Sources */,
E09B03A12445AF7100211A51 /* Define.swift in Sources */,
E08B0674244A98B2001D2E01 /* WareHouseSpCell.swift in Sources */,
E0D197CA24484D90002B080C /* PersonCenterCell.swift in Sources */,
......
......@@ -7,12 +7,36 @@
//
import UIKit
import LGButton
class GoodsCollectionViewCell: UICollectionViewCell {
@IBOutlet weak var codeBtn: UIButton!
@IBOutlet weak var rightBtn: UIButton!
@IBOutlet weak var leftBtn: UIButton!
@IBOutlet weak var lgBtn: LGButton!
@IBOutlet weak var priceLbl: UILabel!
@IBOutlet weak var goodsName: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
@IBAction func lgBtnAction(_ sender: LGButton) {
print("点击图片背景==\(sender.tag)")
}
@IBAction func leftAction(_ sender: UIButton) {
print("点击左边按钮\(sender.tag)")
}
@IBAction func rightAction(_ sender: UIButton) {
print("点击右边按钮\(sender.tag)")
}
@IBAction func codeAction(_ sender: UIButton) {
print("点击二维码按钮\(sender.tag)")
}
}
<?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"/>
<device id="retina6_5" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16086"/>
<capability name="Named colors" minToolsVersion="9.0"/>
......@@ -10,7 +10,7 @@
<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="GoodsCollectionViewCell" customModule="GeliBusinessPlatform" customModuleProvider="target">
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" restorationIdentifier="GoodsCollectionViewCell" id="gTV-IL-0wX" customClass="GoodsCollectionViewCell" customModule="GeliBusinessPlatform" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="165" height="283"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
......@@ -23,15 +23,18 @@
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="MEL-J8-S3c" customClass="LGButton" customModule="LGButton">
<rect key="frame" x="0.0" y="0.0" width="165" height="165"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<accessibility key="accessibilityConfiguration">
<accessibilityTraits key="traits" notEnabled="YES"/>
</accessibility>
<constraints>
<constraint firstAttribute="width" constant="165" id="6rk-H5-BDU">
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isAdaptateScreen" value="YES"/>
<userDefinedRuntimeAttribute type="boolean" keyPath="isAdaptateScreen" value="NO"/>
</userDefinedRuntimeAttributes>
</constraint>
<constraint firstAttribute="height" constant="165" id="vdi-T6-Rva">
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isAdaptateScreen" value="YES"/>
<userDefinedRuntimeAttribute type="boolean" keyPath="isAdaptateScreen" value="NO"/>
</userDefinedRuntimeAttributes>
</constraint>
</constraints>
......@@ -43,6 +46,9 @@
<color key="value" name="商品图背景渐变底色"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="lgBtnAction:" destination="gTV-IL-0wX" eventType="touchUpInside" id="oZP-vs-LlL"/>
</connections>
</view>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="T8c-YA-14K">
<rect key="frame" x="0.0" y="0.0" width="165" height="165"/>
......@@ -50,12 +56,12 @@
<constraints>
<constraint firstAttribute="width" constant="165" id="Evb-BF-yL7">
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isAdaptateScreen" value="YES"/>
<userDefinedRuntimeAttribute type="boolean" keyPath="isAdaptateScreen" value="NO"/>
</userDefinedRuntimeAttributes>
</constraint>
<constraint firstAttribute="height" constant="165" id="Fct-ke-bms">
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isAdaptateScreen" value="YES"/>
<userDefinedRuntimeAttribute type="boolean" keyPath="isAdaptateScreen" value="NO"/>
</userDefinedRuntimeAttributes>
</constraint>
</constraints>
......@@ -75,6 +81,9 @@
</constraint>
</constraints>
<state key="normal" image="二维码"/>
<connections>
<action selector="codeAction:" destination="gTV-IL-0wX" eventType="touchUpInside" id="tFO-u5-3hq"/>
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="zEv-lz-wzj">
<rect key="frame" x="0.0" y="252" width="165" height="1"/>
......@@ -96,16 +105,22 @@
<state key="normal" title="下架">
<color key="titleColor" name="灰色字体颜色"/>
</state>
<connections>
<action selector="leftAction:" destination="gTV-IL-0wX" eventType="touchUpInside" id="cT0-Pg-v8j"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Ygg-2c-Pm9">
<rect key="frame" x="83" y="253" width="82" height="30"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="13"/>
<state key="normal" title="入库"/>
<connections>
<action selector="rightAction:" destination="gTV-IL-0wX" eventType="touchUpInside" id="idn-PT-AwK"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="13" translatesAutoresizingMaskIntoConstraints="NO" id="50H-P6-uG6">
<rect key="frame" x="10" y="218" width="155" height="24"/>
<rect key="frame" x="10.000000000000004" y="218" width="52.333333333333343" height="24"/>
<attributedString key="attributedText">
<fragment content="¥10.00">
<fragment content="¥0.00">
<attributes>
<color key="NSColor" name="蓝色字体颜色"/>
<font key="NSFont" size="17" name="PingFangSC-Medium"/>
......@@ -114,9 +129,18 @@
</fragment>
</attributedString>
<nil key="highlightedColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isSkeletonable" value="YES"/>
<userDefinedRuntimeAttribute type="number" keyPath="linesCornerRadius">
<integer key="value" value="3"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="skeletonLineSpacing">
<real key="value" value="1"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tHK-Kt-m55">
<rect key="frame" x="10" y="175" width="145" height="36.5"/>
<rect key="frame" x="10" y="175" width="145" height="36.666666666666657"/>
<attributedString key="attributedText">
<fragment content="六和川香鸡柳2.5kg*多发点嘎嘎大放送公司的嘎嘎搭嘎">
<attributes>
......@@ -127,6 +151,19 @@
</fragment>
</attributedString>
<nil key="highlightedColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="lastLineFillPercent">
<integer key="value" value="20"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="linesCornerRadius">
<integer key="value" value="3"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="boolean" keyPath="isAdapterFont" value="YES"/>
<userDefinedRuntimeAttribute type="boolean" keyPath="isSkeletonable" value="YES"/>
<userDefinedRuntimeAttribute type="number" keyPath="skeletonLineSpacing">
<real key="value" value="2"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</label>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
......@@ -160,7 +197,7 @@
<constraint firstItem="p8r-r3-3OB" firstAttribute="top" secondItem="zEv-lz-wzj" secondAttribute="bottom" id="dIZ-vd-cyG"/>
<constraint firstItem="T8c-YA-14K" firstAttribute="leading" secondItem="DBH-ay-Cni" secondAttribute="leading" id="fjv-pJ-i1E"/>
<constraint firstItem="zEv-lz-wzj" firstAttribute="leading" secondItem="DBH-ay-Cni" secondAttribute="leading" id="gEC-JS-t6n"/>
<constraint firstAttribute="trailing" secondItem="50H-P6-uG6" secondAttribute="trailing" id="iNx-8b-Qi3"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="50H-P6-uG6" secondAttribute="trailing" constant="10" id="iNx-8b-Qi3"/>
<constraint firstItem="w99-DC-tI2" firstAttribute="top" secondItem="zEv-lz-wzj" secondAttribute="bottom" id="uId-Iz-MlZ"/>
<constraint firstItem="MEL-J8-S3c" firstAttribute="leading" secondItem="DBH-ay-Cni" secondAttribute="leading" id="zKf-Kd-6MK"/>
</constraints>
......@@ -180,11 +217,19 @@
</constraints>
<viewLayoutGuide key="safeArea" id="ZTg-uK-7eu"/>
<size key="customSize" width="136" height="281"/>
<connections>
<outlet property="codeBtn" destination="4Xi-Jf-NQw" id="ORF-0T-7hL"/>
<outlet property="goodsName" destination="tHK-Kt-m55" id="P8Y-sF-MbY"/>
<outlet property="leftBtn" destination="w99-DC-tI2" id="3Vh-3A-Wlg"/>
<outlet property="lgBtn" destination="MEL-J8-S3c" id="Ja4-8M-q7d"/>
<outlet property="priceLbl" destination="50H-P6-uG6" id="xc3-mC-m3H"/>
<outlet property="rightBtn" destination="Ygg-2c-Pm9" id="lzi-pe-PQm"/>
</connections>
<point key="canvasLocation" x="-325.36231884057975" y="123.21428571428571"/>
</collectionViewCell>
</objects>
<resources>
<image name="二维码" width="45.5" height="30"/>
<image name="二维码" width="45.666667938232422" height="30"/>
<namedColor name="商品图背景渐变底色">
<color red="0.98039215686274506" green="0.98039215686274506" blue="0.98039215686274506" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
......
//
// GoodsManageListVC.swift
// GeliBusinessPlatform
//
// Created by 刘俊宏 on 2020/4/21.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
import ViewAnimator
class GoodsManageListVC: BaseViewController, UICollectionViewDelegate, UICollectionViewDataSource ,UICollectionViewDelegateFlowLayout{
var collection : UICollectionView? = nil
let layout = UICollectionViewFlowLayout()
private let animations = [AnimationType.from(direction: .bottom, offset: 100.0)]
private var items = [Any?]()
@IBOutlet weak var contentView: UIView!
override func viewDidLoad() {
super.viewDidLoad()
self.collection = UICollectionView(frame: CGRect(x: 0, y: 0, width: 0, height: 0), collectionViewLayout: layout)
self.collection?.delegate = self
self.collection?.dataSource = self
self.collection?.backgroundColor = UIColor.init(named: "app底色")
self.view.addSubview(self.collection!)
self.collection?.snp.makeConstraints({ (make) in
make.left.right.bottom.equalTo(0);
make.top.equalTo(100)
})
self.collection?.register(UINib(nibName: "GoodsCollectionViewCell", bundle: nil), forCellWithReuseIdentifier: "GoodsCollectionViewCell")
DispatchQueue.main.asyncAfter(deadline: .now() + 0.33) {
self.items = Array(repeating: nil, count: 11)
self.collection?.reloadData()
self.collection?.performBatchUpdates({
UIView.animate(views: self.collection!.orderedVisibleCells,
animations: self.animations, completion: {
})
}, completion: nil)
}
}
func numberOfSections(in collectionView: UICollectionView) -> Int {
return 1
}
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return items.count
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "GoodsCollectionViewCell", for: indexPath) as! GoodsCollectionViewCell
cell.goodsName.showSkeleton(transition: .crossDissolve(0.25))
cell.priceLbl.showSkeleton(transition: .crossDissolve(0.25))
cell.lgBtn.tag = indexPath.row
cell.leftBtn.tag = indexPath.row
cell.rightBtn.tag = indexPath.row
cell.codeBtn.tag = indexPath.row
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
cell.goodsName.hideSkeleton(reloadDataAfter: true, transition: .crossDissolve(0.25))
cell.priceLbl.hideSkeleton(reloadDataAfter: true, transition: .crossDissolve(0.25))
}
return cell
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
return CGSize(width: 165, height: 283)
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
return UIEdgeInsets(top: 15, left: 15, bottom: 0, right: 15)
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
print("选中===\(indexPath)")
}
}
<?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="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="GoodsManageListVC" customModule="GeliBusinessPlatform" customModuleProvider="target">
<connections>
<outlet property="contentView" destination="DIe-mL-vml" id="IT5-kL-Krm"/>
<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>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="DIe-mL-vml">
<rect key="frame" x="0.0" y="44" width="414" height="818"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
</view>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="DIe-mL-vml" secondAttribute="bottom" id="8eN-9n-UIq"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="DIe-mL-vml" secondAttribute="trailing" id="PIK-Ap-4hA"/>
<constraint firstItem="DIe-mL-vml" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="lA8-TH-Cdf"/>
<constraint firstItem="DIe-mL-vml" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="uCS-42-nlf"/>
</constraints>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<point key="canvasLocation" x="133" y="153"/>
</view>
</objects>
</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