Commit 6c487b97 authored by Sandy's avatar Sandy

添加商品界面

parent 8b28ccf0
This diff is collapsed.
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "add_commodityIcon0.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "add_commodityIcon0@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "add_commodityIcon1.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "add_commodityIcon1@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "classify.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "classify@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "hotBrand.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "hotBrand@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "hotIcon.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "hotIcon@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "searchiIcon.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "searchiIcon@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
//
// AddCommodityCollectionViewCell.h
// ALand
//
// Created by Z on 16/3/25.
// Copyright © 2016年 Z. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AddCommodityCollectionViewCell : UICollectionViewCell
- (void)hideTopLine;
- (void)hideRightLine;
- (void)showTopLine;
- (void)showRightLine;
@end
//
// AddCommodityCollectionViewCell.m
// ALand
//
// Created by Z on 16/3/25.
// Copyright © 2016年 Z. All rights reserved.
//
#import "AddCommodityCollectionViewCell.h"
@interface AddCommodityCollectionViewCell ()
@property (weak, nonatomic) IBOutlet UIView *viewTopLine;
@property (weak, nonatomic) IBOutlet UIView *viewRightLine;
@end
@implementation AddCommodityCollectionViewCell
- (void)hideTopLine {
self.viewTopLine.hidden = YES;
}
- (void)hideRightLine {
self.viewRightLine.hidden = YES;
}
- (void)showTopLine {
self.viewTopLine.hidden = NO;
}
- (void)showRightLine {
self.viewRightLine.hidden = NO;
}
- (void)awakeFromNib {
// Initialization code
}
@end
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
</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="AddCommodityCollectionViewCell">
<rect key="frame" x="0.0" y="0.0" width="226" height="260"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="226" height="260"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="add_commodityIcon0" translatesAutoresizingMaskIntoConstraints="NO" id="VbO-vM-Oi6">
<rect key="frame" x="10" y="0.0" width="206" height="207"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="产品分类" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="iW3-33-j9z">
<rect key="frame" x="79" y="205" width="68" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="简单说明文字" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JTo-s2-j2V">
<rect key="frame" x="71" y="226" width="84" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Bnp-YW-t2r">
<rect key="frame" x="225" y="0.0" width="1" height="260"/>
<color key="backgroundColor" red="0.86666666670000003" green="0.86666666670000003" blue="0.86666666670000003" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="width" constant="1" id="ujO-4Z-hRU"/>
</constraints>
</view>
<view contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="hqW-Bi-eFK">
<rect key="frame" x="0.0" y="0.0" width="1" height="283"/>
<color key="backgroundColor" red="0.86666666670000003" green="0.86666666670000003" blue="0.86666666670000003" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="width" constant="1" id="9wt-oB-BgM"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="J9w-w0-0Ry">
<rect key="frame" x="0.0" y="0.0" width="226" height="1"/>
<color key="backgroundColor" red="0.86666666670000003" green="0.86666666670000003" blue="0.86666666670000003" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="IJv-Ir-sHp"/>
</constraints>
</view>
<view contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="B1f-gb-Nqk">
<rect key="frame" x="1" y="259" width="224" height="1"/>
<color key="backgroundColor" red="0.86666666670000003" green="0.86666666670000003" blue="0.86666666670000003" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="Ofc-Mg-21c"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="Bnp-YW-t2r" secondAttribute="trailing" id="0o1-iL-DRb"/>
<constraint firstAttribute="bottom" secondItem="hqW-Bi-eFK" secondAttribute="bottom" id="1SV-5a-rwU"/>
<constraint firstAttribute="bottom" secondItem="VbO-vM-Oi6" secondAttribute="bottom" constant="53" id="2O3-ul-Lhg"/>
<constraint firstItem="VbO-vM-Oi6" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="3Kc-Cg-BDM"/>
<constraint firstItem="J9w-w0-0Ry" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="3hw-cc-Voc"/>
<constraint firstItem="iW3-33-j9z" firstAttribute="centerX" secondItem="gTV-IL-0wX" secondAttribute="centerX" id="89M-yh-IKG"/>
<constraint firstItem="Bnp-YW-t2r" firstAttribute="leading" secondItem="B1f-gb-Nqk" secondAttribute="trailing" id="Bzz-JX-XmH"/>
<constraint firstItem="Bnp-YW-t2r" firstAttribute="leading" secondItem="JTo-s2-j2V" secondAttribute="trailing" constant="2" id="EnA-gs-Itk"/>
<constraint firstItem="J9w-w0-0Ry" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="G1O-3f-WhQ"/>
<constraint firstItem="VbO-vM-Oi6" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="10" id="Go3-TY-US1"/>
<constraint firstAttribute="bottom" secondItem="B1f-gb-Nqk" secondAttribute="bottom" id="KXo-CP-tCl"/>
<constraint firstItem="Bnp-YW-t2r" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="Ni4-0H-opg"/>
<constraint firstItem="JTo-s2-j2V" firstAttribute="top" secondItem="iW3-33-j9z" secondAttribute="bottom" id="Ok3-KB-BTo"/>
<constraint firstAttribute="bottom" secondItem="iW3-33-j9z" secondAttribute="bottom" constant="34" id="RKM-iA-5RX"/>
<constraint firstItem="JTo-s2-j2V" firstAttribute="centerX" secondItem="gTV-IL-0wX" secondAttribute="centerX" id="TaH-n4-lmk"/>
<constraint firstAttribute="bottom" secondItem="Bnp-YW-t2r" secondAttribute="bottom" id="Z5h-g4-SZt"/>
<constraint firstItem="hqW-Bi-eFK" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="azw-Kd-8yr"/>
<constraint firstAttribute="trailing" secondItem="B1f-gb-Nqk" secondAttribute="trailing" id="dHY-QN-XGE"/>
<constraint firstAttribute="trailing" secondItem="VbO-vM-Oi6" secondAttribute="trailing" constant="10" id="hxc-Ei-6zf"/>
<constraint firstAttribute="trailing" secondItem="J9w-w0-0Ry" secondAttribute="trailing" id="j3H-pc-fZM"/>
<constraint firstItem="B1f-gb-Nqk" firstAttribute="leading" secondItem="hqW-Bi-eFK" secondAttribute="trailing" id="kUQ-de-bIZ"/>
<constraint firstItem="hqW-Bi-eFK" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="qPr-Mi-woO"/>
<constraint firstItem="JTo-s2-j2V" firstAttribute="leading" secondItem="hqW-Bi-eFK" secondAttribute="trailing" constant="2" id="yAk-6g-3yQ"/>
</constraints>
<size key="customSize" width="383" height="260"/>
<variation key="default">
<mask key="constraints">
<exclude reference="Bzz-JX-XmH"/>
</mask>
</variation>
<connections>
<outlet property="viewRightLine" destination="Bnp-YW-t2r" id="xNo-A8-H0t"/>
<outlet property="viewTopLine" destination="J9w-w0-0Ry" id="jWz-4K-zES"/>
</connections>
<point key="canvasLocation" x="187" y="361"/>
</collectionViewCell>
</objects>
<resources>
<image name="add_commodityIcon0" width="74" height="68"/>
</resources>
</document>
//
// AddCommodityFooterCollectionReusableView.h
// ALand
//
// Created by Z on 16/3/25.
// Copyright © 2016年 Z. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AddCommodityFooterCollectionReusableView : UICollectionReusableView
@end
//
// AddCommodityFooterCollectionReusableView.m
// ALand
//
// Created by Z on 16/3/25.
// Copyright © 2016年 Z. All rights reserved.
//
#import "AddCommodityFooterCollectionReusableView.h"
@implementation AddCommodityFooterCollectionReusableView
- (void)awakeFromNib {
// Initialization code
}
@end
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<collectionReusableView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="U6b-Vx-4bR" customClass="AddCommodityFooterCollectionReusableView">
<rect key="frame" x="0.0" y="0.0" width="320" height="50"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="gvK-br-f33">
<rect key="frame" x="0.0" y="25" width="320" height="25"/>
<color key="backgroundColor" red="0.92941176470588238" green="0.92156862745098034" blue="0.93333333333333335" alpha="1" colorSpace="calibratedRGB"/>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="OS0-IE-Zsu">
<rect key="frame" x="160" y="24" width="1" height="1"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="XQq-gH-Fa6"/>
<constraint firstAttribute="width" constant="1" id="rC0-nE-JYR"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="gvK-br-f33" firstAttribute="top" secondItem="OS0-IE-Zsu" secondAttribute="bottom" id="4Ph-k9-xn7"/>
<constraint firstItem="OS0-IE-Zsu" firstAttribute="centerY" secondItem="U6b-Vx-4bR" secondAttribute="centerY" id="8W5-iY-Ywu"/>
<constraint firstItem="gvK-br-f33" firstAttribute="leading" secondItem="U6b-Vx-4bR" secondAttribute="leading" id="8jt-VK-rFN"/>
<constraint firstAttribute="trailing" secondItem="gvK-br-f33" secondAttribute="trailing" id="OsG-Ds-KxA"/>
<constraint firstAttribute="bottom" secondItem="gvK-br-f33" secondAttribute="bottom" id="jKs-lW-GvG"/>
<constraint firstItem="OS0-IE-Zsu" firstAttribute="centerX" secondItem="U6b-Vx-4bR" secondAttribute="centerX" id="juP-YU-avn"/>
</constraints>
<point key="canvasLocation" x="344" y="258"/>
</collectionReusableView>
</objects>
</document>
//
// AddCommodityHeaderCollectionReusableView.h
// ALand
//
// Created by Z on 16/3/25.
// Copyright © 2016年 Z. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AddCommodityHeaderCollectionReusableView : UICollectionReusableView
- (void)sectionHot;
- (void)sectionNormalWithTitle:(NSString *)title;
@end
//
// AddCommodityHeaderCollectionReusableView.m
// ALand
//
// Created by Z on 16/3/25.
// Copyright © 2016年 Z. All rights reserved.
//
#import "AddCommodityHeaderCollectionReusableView.h"
@interface AddCommodityHeaderCollectionReusableView ()
@property (weak, nonatomic) IBOutlet UIImageView *icon;
@property (weak, nonatomic) IBOutlet UILabel *labelTitle;
@end
@implementation AddCommodityHeaderCollectionReusableView
- (void)sectionHot {
[self.icon setImage:[UIImage imageNamed:@"hotBrand"]];
self.labelTitle.text = @"热门品牌";
}
- (void)sectionNormalWithTitle:(NSString *)title {
[self.icon setImage:[UIImage imageNamed:@"classify"]];
self.labelTitle.text = title;
}
- (void)awakeFromNib {
// Initialization code
}
@end
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<collectionReusableView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="U6b-Vx-4bR" customClass="AddCommodityHeaderCollectionReusableView">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="hotBrand" translatesAutoresizingMaskIntoConstraints="NO" id="WtT-uw-0m7">
<rect key="frame" x="10" y="10" width="25" height="25"/>
<constraints>
<constraint firstAttribute="width" constant="25" id="MeY-Zw-K0H"/>
<constraint firstAttribute="height" constant="25" id="nQv-9Y-ZcU"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="热门品牌" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bpK-m4-bmM">
<rect key="frame" x="43" y="10" width="80" height="24"/>
<fontDescription key="fontDescription" type="system" pointSize="20"/>
<color key="textColor" red="0.066666666669999999" green="0.066666666669999999" blue="0.066666666669999999" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="WtT-uw-0m7" firstAttribute="leading" secondItem="U6b-Vx-4bR" secondAttribute="leading" constant="10" id="FfV-VQ-99C"/>
<constraint firstItem="WtT-uw-0m7" firstAttribute="centerY" secondItem="U6b-Vx-4bR" secondAttribute="centerY" id="Nju-Hc-tFE"/>
<constraint firstItem="bpK-m4-bmM" firstAttribute="centerY" secondItem="U6b-Vx-4bR" secondAttribute="centerY" id="SvN-l1-9vC"/>
<constraint firstItem="bpK-m4-bmM" firstAttribute="leading" secondItem="WtT-uw-0m7" secondAttribute="trailing" constant="8" id="fqp-RR-E9w"/>
<constraint firstItem="bpK-m4-bmM" firstAttribute="leading" secondItem="WtT-uw-0m7" secondAttribute="trailing" constant="8" id="hBU-xb-fed"/>
<constraint firstItem="WtT-uw-0m7" firstAttribute="leading" secondItem="U6b-Vx-4bR" secondAttribute="leading" constant="16" id="j2K-tC-hkP"/>
</constraints>
<variation key="default">
<mask key="constraints">
<exclude reference="j2K-tC-hkP"/>
<exclude reference="fqp-RR-E9w"/>
</mask>
</variation>
<connections>
<outlet property="icon" destination="WtT-uw-0m7" id="3DK-Ih-GMv"/>
<outlet property="labelTitle" destination="bpK-m4-bmM" id="aoa-SR-gL3"/>
</connections>
<point key="canvasLocation" x="328" y="401"/>
</collectionReusableView>
</objects>
<resources>
<image name="hotBrand" width="27" height="26"/>
</resources>
</document>
//
// AddCommodityHeaderView.h
// ALand
//
// Created by Z on 16/3/25.
// Copyright © 2016年 Z. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AddCommodityHeaderView : UIView
@end
//
// AddCommodityHeaderView.m
// ALand
//
// Created by Z on 16/3/25.
// Copyright © 2016年 Z. All rights reserved.
//
#import "AddCommodityHeaderView.h"
@implementation AddCommodityHeaderView
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="AddCommodityHeaderView">
<rect key="frame" x="0.0" y="0.0" width="372" height="57"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="hotBrand" translatesAutoresizingMaskIntoConstraints="NO" id="a28-jF-73M">
<rect key="frame" x="20" y="10" width="30" height="36"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="热门品牌" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4pf-wP-4a8">
<rect key="frame" x="58" y="17" width="76" height="23"/>
<fontDescription key="fontDescription" type="system" pointSize="19"/>
<color key="textColor" red="0.066666666666666666" green="0.066666666666666666" blue="0.066666666666666666" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="4pf-wP-4a8" firstAttribute="leading" secondItem="a28-jF-73M" secondAttribute="trailing" constant="8" id="JxI-j8-msM"/>
<constraint firstItem="a28-jF-73M" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" id="OYa-Bs-EkV"/>
<constraint firstItem="4pf-wP-4a8" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="QKI-Ib-v3D"/>
<constraint firstAttribute="trailing" secondItem="a28-jF-73M" secondAttribute="trailing" constant="322" id="etU-0H-TVV"/>
<constraint firstItem="a28-jF-73M" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="10" id="lTX-ss-Xmj"/>
<constraint firstAttribute="bottom" secondItem="a28-jF-73M" secondAttribute="bottom" constant="11" id="pef-uJ-mcg"/>
</constraints>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="342" y="386.5"/>
</view>
</objects>
<resources>
<image name="hotBrand" width="27" height="26"/>
</resources>
</document>
......@@ -19,34 +19,34 @@
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Bloem天然草本更年期综合营养胶囊100粒" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vlk-5l-QDd">
<rect key="frame" x="10" y="182" width="175" height="43"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<color key="textColor" red="0.066666666666666666" green="0.066666666666666666" blue="0.066666666666666666" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" ¥" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="FUs-8c-aeb">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text=" ¥" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="FUs-8c-aeb">
<rect key="frame" x="10" y="238" width="26" height="24"/>
<fontDescription key="fontDescription" type="system" pointSize="20"/>
<color key="textColor" red="1" green="0.39215686274509803" blue="0.39215686274509803" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="239" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ig6-43-sUi">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="239" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ig6-43-sUi">
<rect key="frame" x="36" y="238" width="37" height="24"/>
<fontDescription key="fontDescription" type="system" pointSize="20"/>
<color key="textColor" red="1" green="0.3921568627" blue="0.3921568627" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="¥239" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JDW-37-wfV">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="¥239" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JDW-37-wfV">
<rect key="frame" x="80" y="242" width="45" height="20"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" 佣金:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PoN-DX-HOp">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text=" 佣金:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PoN-DX-HOp">
<rect key="frame" x="10" y="263" width="57" height="20"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="¥4.88" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="LFM-Hc-7OR">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="¥4.88" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="LFM-Hc-7OR">
<rect key="frame" x="67" y="262" width="55" height="22"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<color key="textColor" red="0.2666666667" green="0.2666666667" blue="0.2666666667" alpha="1" colorSpace="calibratedRGB"/>
......@@ -110,6 +110,7 @@
<constraint firstItem="FUs-8c-aeb" firstAttribute="top" secondItem="vlk-5l-QDd" secondAttribute="bottom" constant="13" id="6o1-q3-rPs"/>
<constraint firstAttribute="trailing" secondItem="vlk-5l-QDd" secondAttribute="trailing" constant="10" id="9iV-bh-YX2"/>
<constraint firstItem="PoN-DX-HOp" firstAttribute="leading" secondItem="FUs-8c-aeb" secondAttribute="leading" id="FwR-VT-5sa"/>
<constraint firstItem="FUs-8c-aeb" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="5" id="Gap-ae-3qZ"/>
<constraint firstItem="JDW-37-wfV" firstAttribute="bottom" secondItem="ig6-43-sUi" secondAttribute="bottom" id="I9c-HN-6Vj"/>
<constraint firstItem="PoN-DX-HOp" firstAttribute="top" secondItem="ig6-43-sUi" secondAttribute="bottom" constant="1" id="IKe-FV-TzR"/>
<constraint firstItem="FUs-8c-aeb" firstAttribute="leading" secondItem="vlk-5l-QDd" secondAttribute="leading" id="IdZ-yI-Aba"/>
......@@ -130,6 +131,7 @@
<size key="customSize" width="195" height="334"/>
<variation key="default">
<mask key="constraints">
<exclude reference="IdZ-yI-Aba"/>
<exclude reference="ORt-QK-sOe"/>
<exclude reference="jQQ-3k-JFb"/>
</mask>
......
//
// HotCommodityCell.h
// ALand
//
// Created by Z on 16/3/25.
// Copyright © 2016年 Z. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface HotCommodityCell : UICollectionViewCell
- (void)hideRight;
- (void)showRight;
@end
//
// HotCommodityCell.m
// ALand
//
// Created by Z on 16/3/25.
// Copyright © 2016年 Z. All rights reserved.
//
#import "HotCommodityCell.h"
@interface HotCommodityCell ()
@property (weak, nonatomic) IBOutlet UIView *viewRight;
@end
@implementation HotCommodityCell
- (void)hideRight {
self.viewRight.hidden = YES;
}
- (void)showRight {
self.viewRight.hidden = NO;
}
- (void)awakeFromNib {
// Initialization code
}
@end
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="HotCommodityCell"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="gTV-IL-0wX" customClass="HotCommodityCell">
<rect key="frame" x="0.0" y="0.0" width="315" height="220"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="315" height="220"/>
<subviews>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleAspectFit" misplaced="YES" image="hotIcon" translatesAutoresizingMaskIntoConstraints="NO" id="JCd-BI-c3c">
<rect key="frame" x="74" y="56" width="142" height="110"/>
</imageView>
<view contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="wkg-ww-hVo">
<rect key="frame" x="8" y="56" width="37" height="118"/>
<color key="backgroundColor" red="0.86666666670000003" green="0.86666666670000003" blue="0.86666666670000003" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="width" constant="1" id="OFH-0O-7Hg"/>
</constraints>
</view>
<view contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="0uc-Vm-6A8">
<rect key="frame" x="258" y="61" width="37" height="118"/>
<color key="backgroundColor" red="0.86666666670000003" green="0.86666666670000003" blue="0.86666666670000003" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="width" constant="1" id="R0Y-1m-QUt"/>
</constraints>
</view>
<view contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="S8b-kg-0m9" customClass="HotCommodityCell">
<rect key="frame" x="95" y="189" width="98" height="23"/>
<color key="backgroundColor" red="0.86666666670000003" green="0.86666666670000003" blue="0.86666666670000003" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="u30-NM-gWn"/>
</constraints>
</view>
<view contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="bSo-Z3-jeB">
<rect key="frame" x="93" y="7" width="98" height="23"/>
<color key="backgroundColor" red="0.86666666670000003" green="0.86666666670000003" blue="0.86666666670000003" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="Qhj-QZ-2YV"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="JCd-BI-c3c" secondAttribute="bottom" id="3s0-9D-J5B"/>
<constraint firstAttribute="trailing" secondItem="0uc-Vm-6A8" secondAttribute="trailing" id="7Uy-0p-BcR"/>
<constraint firstAttribute="bottom" secondItem="0uc-Vm-6A8" secondAttribute="bottom" id="HLh-LE-pjI"/>
<constraint firstItem="wkg-ww-hVo" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="HiI-vW-u5f"/>
<constraint firstItem="bSo-Z3-jeB" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="Lt7-ZX-UZB"/>
<constraint firstAttribute="trailing" secondItem="JCd-BI-c3c" secondAttribute="trailing" constant="10" id="Oc6-Od-4dP"/>
<constraint firstAttribute="bottom" secondItem="wkg-ww-hVo" secondAttribute="bottom" id="Tbl-mU-NcN"/>
<constraint firstAttribute="trailing" secondItem="S8b-kg-0m9" secondAttribute="trailing" id="a9t-ju-DFw"/>
<constraint firstItem="bSo-Z3-jeB" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="aTz-VG-Mb0"/>
<constraint firstItem="JCd-BI-c3c" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="jU1-gS-GOs"/>
<constraint firstItem="S8b-kg-0m9" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="l1o-tz-FMI"/>
<constraint firstItem="0uc-Vm-6A8" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="mFN-Em-JNo"/>
<constraint firstAttribute="trailing" secondItem="bSo-Z3-jeB" secondAttribute="trailing" id="nz2-uM-vfo"/>
<constraint firstAttribute="bottom" secondItem="S8b-kg-0m9" secondAttribute="bottom" id="u3v-ET-XDG"/>
<constraint firstItem="JCd-BI-c3c" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="10" id="wtm-8M-atL"/>
<constraint firstItem="wkg-ww-hVo" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="xVX-jx-Bpq"/>
</constraints>
<size key="customSize" width="315" height="220"/>
<connections>
<outlet property="viewRight" destination="0uc-Vm-6A8" id="JG4-kH-v8Y"/>
</connections>
<point key="canvasLocation" x="392.5" y="285"/>
</collectionViewCell>
</objects>
<resources>
<image name="hotIcon" width="127" height="68"/>
</resources>
</document>
......@@ -61,6 +61,8 @@
- (void)rightBtnAction {
[self.rightBtn setTitleColor:kCustomGreenColor forState:UIControlStateNormal];
[self.leftBtn setTitleColor:kTextColorBlack forState:UIControlStateNormal];
[self iconAnimate];
[self hideTableView];
}
- (CoverShadowView *)coverView {
......@@ -182,7 +184,6 @@
}
- (void)iconAnimate {
self.clickCount = self.clickCount + M_PI;
if (self.clickCount > M_PI * 2 ) {
self.clickCount = M_PI;
......
......@@ -13,8 +13,8 @@
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="162" height="88"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="cell描述" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WbW-XT-8QE">
<rect key="frame" x="3" y="34" width="156" height="21"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="cell描述" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WbW-XT-8QE">
<rect key="frame" x="0.0" y="35" width="162" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
......
//
// AddCommodityViewController.h
// ALand
//
// Created by Z on 16/3/25.
// Copyright © 2016年 Z. All rights reserved.
//
#import "IBTUIViewController.h"
@interface AddCommodityViewController : IBTUIViewController
@end
//
// AddCommodityViewController.m
// ALand
//
// Created by Z on kMargin/3/25.
// Copyright © 20kMargin年 Z. All rights reserved.
//
#import "AddCommodityViewController.h"
#import "AddCommodityCollectionViewCell.h"
#import "AddCommodityHeaderView.h"
#import "AddCommodityHeaderCollectionReusableView.h"
#import "HotCommodityCell.h"
#import "AddCommodityFooterCollectionReusableView.h"
#import "CommodityListViewController.h"
#define kHotCellId @"addCommodityCellHot"
#define kCellId @"addCommodityCell"
#define kHeaderId @"headerId"
#define kFooterId @"footerId"
#define kMargin 0
@interface AddCommodityViewController ()<UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout>
@property (nonatomic, strong) UICollectionView *collectionView;
@end
@implementation AddCommodityViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationItem.title = @"添加商品";
[self setUpCollectionView];
// Do any additional setup after loading the view.
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:NO];
}
- (void)setUpCollectionView {
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
[self.view addSubview:_collectionView];
_collectionView.sd_layout.topEqualToView(self.view).leftEqualToView(self.view).bottomEqualToView(self.view).rightEqualToView(self.view);
_collectionView.delegate = self;
_collectionView.dataSource = self;
_collectionView.backgroundColor = [UIColor colorWithHexString:@"EDEBEE"];
_collectionView.contentInset = UIEdgeInsetsMake(0, kMargin, 0, kMargin);
//cell
[_collectionView registerNib:[UINib nibWithNibName:@"HotCommodityCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:kHotCellId];
[_collectionView registerNib:[UINib nibWithNibName:@"AddCommodityCollectionViewCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:kCellId];
//header
[_collectionView registerNib:[UINib nibWithNibName:@"AddCommodityHeaderCollectionReusableView" bundle:[NSBundle mainBundle]] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:kHeaderId];
[_collectionView registerNib:[UINib nibWithNibName:@"AddCommodityFooterCollectionReusableView" bundle:[NSBundle mainBundle]] forSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:kFooterId];
}
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout referenceSizeForFooterInSection:(NSInteger)section {
return CGSizeMake(kWidth, 30);
}
#pragma mark ==============collectionViewHeader==============
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section {
return CGSizeMake(ScreenSize.width, 44);
}
- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath {
if (kind == UICollectionElementKindSectionHeader) {
AddCommodityHeaderCollectionReusableView *reuseHeaderView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:kHeaderId forIndexPath:indexPath];
if (indexPath.section == 0) {
[reuseHeaderView sectionHot];
}else{
[reuseHeaderView sectionNormalWithTitle:@"分类"];
}
return reuseHeaderView;
}else if (kind == UICollectionElementKindSectionFooter){
AddCommodityFooterCollectionReusableView *reuseFooter = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:kFooterId forIndexPath:indexPath];
return reuseFooter;
}
return nil;
}
#pragma mark ============== items ==============
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0) {
return CGSizeMake((ScreenSize.width - kMargin * 2)/3, kAutoValue(100));
}else{
return CGSizeMake((ScreenSize.width - kMargin * 2)/4, kAutoValue(160));
}
}
-(CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section{
//两个item的列间距
return 0;
}
-(CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section{
//如果一组中有多行item,设置行间距
return 0;
}
- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
return 5;
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
if (section == 0) {
return 3;
}else{
return 8;
}
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0) {
HotCommodityCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kHotCellId forIndexPath:indexPath];
//
if ((int)indexPath.row % 3 == 2) {
[cell showRight];
}else{
[cell hideRight];
}
return cell;
}else{
AddCommodityCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kCellId forIndexPath:indexPath];
if ((int)indexPath.row / 4 == 0) {
[cell showTopLine];
}else{
[cell hideTopLine];
}
if ((int)indexPath.row % 4 ==3) {
[cell showRightLine];
}else{
[cell hideRightLine];
}
return cell;
}
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
CommodityListViewController *commodityVC = [[CommodityListViewController alloc] init];
commodityVC.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:commodityVC animated:YES];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
......@@ -26,11 +26,6 @@
// Do any additional setup after loading the view.
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:NO];
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
//CLog(@"%@",NSStringFromCGRect(_sortView.frame));
......
......@@ -10,6 +10,7 @@
#import "MoneyView.h"
#import "HomeCollectionViewCell.h"
#import "CommodityListViewController.h"
#import "AddCommodityViewController.h"
#define kHomeCollectionViewID @"HomeCollectionViewID"
#define kCollectionViewHeadHeight 350
#import "SDCycleScrollView.h"
......@@ -24,7 +25,7 @@
[super viewDidLoad];
self.automaticallyAdjustsScrollViewInsets = NO;
_cellTitle = @[@"商品管理",@"订单管理",@"分销管理",@"客户管理",@"店铺管理",@"邀请合伙人",@"aland商城"];
_cellTitle = @[@"商品管理",@"订单管理",@"分销管理",@"客户管理",@"店铺管理",@"邀请合伙人",@"aland商城",@""];
......@@ -87,9 +88,10 @@
- (void)touchAddAction {
CLog(@"添加商品");
CommodityListViewController *commodityVC = [[CommodityListViewController alloc] init];
commodityVC.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:commodityVC animated:YES];
AddCommodityViewController *addVC = [[AddCommodityViewController alloc] init];
addVC.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:addVC animated:YES];
}
......
......@@ -23,13 +23,35 @@
#define kCutLineColorLiteGray [UIColor colorWithWhite:0.867 alpha:1.000]
#define kCutLineColorGray [UIColor colorWithWhite:0.820 alpha:1.000]
#define kCutLineColorDarkGray [UIColor colorWithWhite:0.757 alpha:1.000]
#define kPriceColor [UIColor colorWithRed:1.000 green:0.392 blue:0.392 alpha:1.000];
#pragma mark =========== 通用宏定义 start ===========
#define kBounds [UIScreen mainScreen].bounds
#define kWidth [UIScreen mainScreen].bounds.size.width
#define kHeight [UIScreen mainScreen].bounds.size.height
#define kAutoValue(value) (float)value / 375 * kWidth
#define WS(weakSelf) __weak __typeof(&*self)weakSelf = self;
#define HexColor(colorStr) [UIColor colorWithHexString:colorStr]
#define RGBA(R,G,B,A) [UIColor colorWithRed:R/255.0f green:G/255.0f blue:B/255.0f alpha:A]
#define ScreenSize ([[UIScreen mainScreen] bounds].size)
#define IOS7 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0)
#define FontSize(num) [UIFont systemFontOfSize:num]
#define AppWindow [[UIApplication sharedApplication].delegate window]
#define GXF_NSUSERFEFTAULTS [NSUserDefaults standardUserDefaults]
#define IsNotNullObject(Object) ![(Object) isKindOfClass:[NSNull class]]
#define IsNumObject(Object) (IsNotNullObject(Object) && [(Object) isKindOfClass:[NSNumber class]])
#define IsStrObject(Object) (IsNotNullObject(Object) && [(Object) isKindOfClass:[NSString class]] && [Object length] > 0)
#define IsIntObject(Object) (IsNotNullObject(Object) && [Object integerValue] >= 0)
#define IsFloatObject(Object) (IsNotNullObject(Object) && [Object floatValue] >= 0)
#define IsUintObject(Object) (IsNotNullObject(Object) && [Object intValue] > 0)
#define IsArrayObject(Object) [(Object) isKindOfClass:[NSArray class]]
#define IsDictObject(Object) [(Object) isKindOfClass:[NSDictionary class]]
#define IsErrorObject(Object) ![(Object) isKindOfClass:[NSError class]]
#define kSysWhite [UIColor whiteColor]
#pragma mark =========== end ===========
#define ICR_TINTCOLOR [UIColor colorWithR:63 g:134 b:244 a:1]//天蓝色
......@@ -45,23 +67,9 @@
#define ICR_IMAGE_BG_COLOR [UIColor colorWithW:242 a:1]
#define HexColor(colorStr) [UIColor colorWithHexString:colorStr]
#define RGBA(R,G,B,A) [UIColor colorWithRed:R/255.0f green:G/255.0f blue:B/255.0f alpha:A]
#define ScreenSize ([[UIScreen mainScreen] bounds].size)
#define IOS7 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0)
#define FontSize(num) [UIFont systemFontOfSize:num]
#define AppWindow [[UIApplication sharedApplication].delegate window]
#define GXF_NSUSERFEFTAULTS [NSUserDefaults standardUserDefaults]
#define IsNotNullObject(Object) ![(Object) isKindOfClass:[NSNull class]]
#define IsNumObject(Object) (IsNotNullObject(Object) && [(Object) isKindOfClass:[NSNumber class]])
#define IsStrObject(Object) (IsNotNullObject(Object) && [(Object) isKindOfClass:[NSString class]] && [Object length] > 0)
#define IsIntObject(Object) (IsNotNullObject(Object) && [Object integerValue] >= 0)
#define IsFloatObject(Object) (IsNotNullObject(Object) && [Object floatValue] >= 0)
#define IsUintObject(Object) (IsNotNullObject(Object) && [Object intValue] > 0)
#define IsArrayObject(Object) [(Object) isKindOfClass:[NSArray class]]
#define IsDictObject(Object) [(Object) isKindOfClass:[NSDictionary class]]
#define IsErrorObject(Object) ![(Object) isKindOfClass:[NSError class]]
#endif /* AppHeader_h */
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