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)")
}
}
//
// 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