Commit 874bfd49 authored by Sandy's avatar Sandy

店铺管理

parent 18697307
This diff is collapsed.
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
[self.window makeKeyAndVisible]; [self.window makeKeyAndVisible];
if ([UserInfo shareInstance].userName) { if ([UserInfo shareInstance].uuid) {
BaseViewController *baseVC = [[BaseViewController alloc] init]; BaseViewController *baseVC = [[BaseViewController alloc] init];
self.window.rootViewController = baseVC; self.window.rootViewController = baseVC;
}else{ }else{
......
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "default_commodity_placeholder.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "default_commodity_placeholder@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "greenCycle.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "greenCycle@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "star_icon.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "star_icon@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "erweima_结果.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "erweima_结果@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "Camera.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "Camera@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "Gallery.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "Gallery@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
...@@ -12,9 +12,11 @@ ...@@ -12,9 +12,11 @@
- (void)hideTopLine; - (void)hideTopLine;
- (void)hideRightLine;
- (void)showTopLine; - (void)showTopLine;
- (void)showRightLine;
- (void)hideRightLine;
- (void)showRightLine;
- (void)hideLeftLine;
- (void)showLeftLine;
@end @end
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
@interface AddCommodityCollectionViewCell () @interface AddCommodityCollectionViewCell ()
@property (weak, nonatomic) IBOutlet UIView *viewTopLine; @property (weak, nonatomic) IBOutlet UIView *viewTopLine;
@property (weak, nonatomic) IBOutlet UIView *viewLeftLine;
@property (weak, nonatomic) IBOutlet UIView *viewRightLine; @property (weak, nonatomic) IBOutlet UIView *viewRightLine;
...@@ -20,8 +21,6 @@ ...@@ -20,8 +21,6 @@
self.viewTopLine.hidden = YES; self.viewTopLine.hidden = YES;
} }
- (void)hideRightLine { - (void)hideRightLine {
self.viewRightLine.hidden = YES; self.viewRightLine.hidden = YES;
} }
...@@ -33,7 +32,12 @@ ...@@ -33,7 +32,12 @@
self.viewRightLine.hidden = NO; self.viewRightLine.hidden = NO;
} }
- (void)hideLeftLine {
self.viewLeftLine.hidden = YES;
}
- (void)showLeftLine {
self.viewLeftLine.hidden = NO;
}
- (void)awakeFromNib { - (void)awakeFromNib {
// Initialization code // Initialization code
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<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"> <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"/> <rect key="frame" x="79" y="205" width="68" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/> <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </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"> <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">
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
<constraint firstItem="VbO-vM-Oi6" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="3Kc-Cg-BDM"/> <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="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="iW3-33-j9z" firstAttribute="centerX" secondItem="gTV-IL-0wX" secondAttribute="centerX" id="89M-yh-IKG"/>
<constraint firstItem="B1f-gb-Nqk" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="8e3-id-8qb"/>
<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="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="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="J9w-w0-0Ry" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="G1O-3f-WhQ"/>
...@@ -89,9 +90,11 @@ ...@@ -89,9 +90,11 @@
<variation key="default"> <variation key="default">
<mask key="constraints"> <mask key="constraints">
<exclude reference="Bzz-JX-XmH"/> <exclude reference="Bzz-JX-XmH"/>
<exclude reference="kUQ-de-bIZ"/>
</mask> </mask>
</variation> </variation>
<connections> <connections>
<outlet property="viewLeftLine" destination="hqW-Bi-eFK" id="Jzf-jU-90j"/>
<outlet property="viewRightLine" destination="Bnp-YW-t2r" id="xNo-A8-H0t"/> <outlet property="viewRightLine" destination="Bnp-YW-t2r" id="xNo-A8-H0t"/>
<outlet property="viewTopLine" destination="J9w-w0-0Ry" id="jWz-4K-zES"/> <outlet property="viewTopLine" destination="J9w-w0-0Ry" id="jWz-4K-zES"/>
</connections> </connections>
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
<outlet property="labelName" destination="tFZ-ia-Y0w" id="Cwp-PN-Y3a"/> <outlet property="labelName" destination="tFZ-ia-Y0w" id="Cwp-PN-Y3a"/>
<outlet property="labelSubTitle" destination="qVI-A9-Pct" id="Ofk-Pv-Bfz"/> <outlet property="labelSubTitle" destination="qVI-A9-Pct" id="Ofk-Pv-Bfz"/>
</connections> </connections>
<point key="canvasLocation" x="430.5" y="83"/> <point key="canvasLocation" x="255.5" y="103"/>
</view> </view>
</objects> </objects>
<resources> <resources>
......
//
// SelectPhotoView.h
// ALand
//
// Created by Z on 16/4/5.
// Copyright © 2016年 Z. All rights reserved.
//
#import <UIKit/UIKit.h>
typedef void (^photoBlock)(void);
@interface SelectPhotoView : UIView
@property (nonatomic, copy) photoBlock takePhotoBlock;
@property (nonatomic, copy) photoBlock galleryBlock;
- (void)setFrame:(CGRect)frame;
- (void)showView;
- (void)hideView;
@end
//
// SelectPhotoView.m
// ALand
//
// Created by Z on 16/4/5.
// Copyright © 2016年 Z. All rights reserved.
//
#import "SelectPhotoView.h"
@interface SelectPhotoView ()<UIImagePickerControllerDelegate, UINavigationControllerDelegate>
@property (nonatomic, assign) CGFloat viewHeight;
@end
@implementation SelectPhotoView
- (void)setFrame:(CGRect)frame {
[super setFrame:frame];
self.viewHeight = frame.size.height;
}
- (void)showView {
WS(weakSelf)
CLog(@"%f",self.viewHeight);
[UIView animateWithDuration:0.3 animations:^{
weakSelf.bottom = kHeight;
}];
}
- (void)hideView {
WS(weakSelf)
[UIView animateWithDuration:0.3 animations:^{
weakSelf.top = kHeight;
}];
}
- (IBAction)cameraAction:(id)sender {
self.takePhotoBlock();
}
/*
// 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="SelectPhotoView">
<rect key="frame" x="0.0" y="0.0" width="320" height="105"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="mL7-W5-Qtj">
<rect key="frame" x="160" y="0.0" width="1" height="105"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="width" constant="1" id="hSS-nM-RnO"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="DXs-Bu-BQr">
<rect key="frame" x="0.0" y="0.0" width="160" height="105"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="fC0-nk-0eB">
<rect key="frame" x="50" y="8" width="60" height="60"/>
<constraints>
<constraint firstAttribute="width" constant="60" id="bw7-XH-2tI"/>
<constraint firstAttribute="height" constant="60" id="m1f-Yr-kT9"/>
</constraints>
<state key="normal" image="Camera"/>
<connections>
<action selector="cameraAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="CFh-Bo-zMg"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="拍照" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="BDi-lN-yUi">
<rect key="frame" x="63" y="76" width="34" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="BDi-lN-yUi" firstAttribute="top" secondItem="fC0-nk-0eB" secondAttribute="bottom" constant="8" id="PfF-31-ntl"/>
<constraint firstItem="BDi-lN-yUi" firstAttribute="centerX" secondItem="fC0-nk-0eB" secondAttribute="centerX" id="dSt-V6-fkQ"/>
<constraint firstItem="fC0-nk-0eB" firstAttribute="top" secondItem="DXs-Bu-BQr" secondAttribute="top" constant="8" id="kfK-10-pJb"/>
<constraint firstItem="fC0-nk-0eB" firstAttribute="centerX" secondItem="DXs-Bu-BQr" secondAttribute="centerX" id="wKL-EO-HkY"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="0EW-lo-1s8">
<rect key="frame" x="161" y="0.0" width="159" height="105"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="aeU-ov-OJ3">
<rect key="frame" x="49" y="8" width="60" height="60"/>
<constraints>
<constraint firstAttribute="height" constant="60" id="jev-8a-Don"/>
<constraint firstAttribute="width" constant="60" id="rFa-e3-zhR"/>
</constraints>
<state key="normal" image="Gallery"/>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="图库" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="CfC-ay-xMf">
<rect key="frame" x="62" y="76" width="34" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="CfC-ay-xMf" firstAttribute="top" secondItem="aeU-ov-OJ3" secondAttribute="bottom" constant="8" id="Mkc-XD-axt"/>
<constraint firstItem="aeU-ov-OJ3" firstAttribute="centerX" secondItem="0EW-lo-1s8" secondAttribute="centerX" id="S0z-OF-LXL"/>
<constraint firstItem="CfC-ay-xMf" firstAttribute="centerX" secondItem="aeU-ov-OJ3" secondAttribute="centerX" id="Wfj-ts-zqR"/>
<constraint firstItem="aeU-ov-OJ3" firstAttribute="top" secondItem="0EW-lo-1s8" secondAttribute="top" constant="8" id="vik-VV-6uK"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="0EW-lo-1s8" secondAttribute="bottom" id="0Pz-jN-ZSE"/>
<constraint firstItem="0EW-lo-1s8" firstAttribute="height" secondItem="DXs-Bu-BQr" secondAttribute="height" id="4UE-xH-g85"/>
<constraint firstItem="mL7-W5-Qtj" firstAttribute="leading" secondItem="DXs-Bu-BQr" secondAttribute="trailing" id="77K-XJ-37a"/>
<constraint firstItem="0EW-lo-1s8" firstAttribute="width" secondItem="DXs-Bu-BQr" secondAttribute="width" id="IyI-yi-2yo"/>
<constraint firstAttribute="trailing" secondItem="0EW-lo-1s8" secondAttribute="trailing" id="Joi-5R-gkV"/>
<constraint firstItem="mL7-W5-Qtj" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="PZv-uP-kk0"/>
<constraint firstItem="DXs-Bu-BQr" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="So3-Qy-r4A"/>
<constraint firstAttribute="bottom" secondItem="DXs-Bu-BQr" secondAttribute="bottom" id="T1X-3k-kzA"/>
<constraint firstAttribute="bottom" secondItem="mL7-W5-Qtj" secondAttribute="bottom" id="Vb0-Ng-6rR"/>
<constraint firstItem="0EW-lo-1s8" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="ojP-OG-r59"/>
<constraint firstItem="0EW-lo-1s8" firstAttribute="leading" secondItem="mL7-W5-Qtj" secondAttribute="trailing" id="rhi-yX-DNw"/>
<constraint firstItem="DXs-Bu-BQr" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="v0H-R5-YoR"/>
</constraints>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="354" y="232.5"/>
</view>
</objects>
<resources>
<image name="Camera" width="90" height="90"/>
<image name="Gallery" width="90" height="90"/>
</resources>
</document>
...@@ -34,6 +34,11 @@ ...@@ -34,6 +34,11 @@
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
} }
- (void)setUpdate {
}
//设置navigationbar颜色
- (UIStatusBarStyle)preferredStatusBarStyle { - (UIStatusBarStyle)preferredStatusBarStyle {
return UIStatusBarStyleDefault; return UIStatusBarStyleDefault;
} }
...@@ -51,7 +56,7 @@ ...@@ -51,7 +56,7 @@
_collectionView.sd_layout.topEqualToView(self.view).leftEqualToView(self.view).bottomEqualToView(self.view).rightEqualToView(self.view); _collectionView.sd_layout.topEqualToView(self.view).leftEqualToView(self.view).bottomEqualToView(self.view).rightEqualToView(self.view);
_collectionView.delegate = self; _collectionView.delegate = self;
_collectionView.dataSource = self; _collectionView.dataSource = self;
_collectionView.backgroundColor = [UIColor colorWithHexString:@"EDEBEE"]; _collectionView.backgroundColor = kSysWhite;
_collectionView.contentInset = UIEdgeInsetsMake(0, kMargin, 0, kMargin); _collectionView.contentInset = UIEdgeInsetsMake(0, kMargin, 0, kMargin);
//cell //cell
...@@ -160,10 +165,10 @@ ...@@ -160,10 +165,10 @@
[cell hideTopLine]; [cell hideTopLine];
} }
if ((int)indexPath.row % 4 ==3) { if ((int)indexPath.row % 4 == 0) {
[cell showRightLine]; [cell showLeftLine];
}else{ }else{
[cell hideRightLine]; [cell hideLeftLine];
} }
return cell; return cell;
} }
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#import "SDCycleScrollView.h" #import "SDCycleScrollView.h"
#import "CommodityManagementViewController.h" #import "CommodityManagementViewController.h"
#import "OrderViewController.h" #import "OrderViewController.h"
#import "StoreManagermentViewController.h"
#define kHomeCollectionViewID @"HomeCollectionViewID" #define kHomeCollectionViewID @"HomeCollectionViewID"
#define kCollectionViewHeadHeight 350 #define kCollectionViewHeadHeight 350
...@@ -132,22 +133,44 @@ ...@@ -132,22 +133,44 @@
} }
break; break;
case 2: case 2://分销管理
{
break; }
case 3:
break; break;
case 4: case 3://客户管理
{
}
break;
case 4://店铺管理
{
StoreManagermentViewController *storeVC = [[StoreManagermentViewController alloc] initWithNibName:@"StoreManagermentViewController" bundle:[NSBundle mainBundle]];
storeVC.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:storeVC animated:YES];
}
break; break;
case 5: case 5://邀请合伙人
{
}
break; break;
case 6: case 6://aland商城
{
}
break; break;
case 7: case 7:
{
}
break; break;
......
//
// StoreManagermentViewController.h
// ALand
//
// Created by Z on 16/4/1.
// Copyright © 2016年 Z. All rights reserved.
//
#import "IBTUIViewController.h"
@interface StoreManagermentViewController : IBTUIViewController
@end
//
// StoreManagermentViewController.m
// ALand
//
// Created by Z on 16/4/1.
// Copyright © 2016年 Z. All rights reserved.
//
#import "StoreManagermentViewController.h"
#import "StoreQRCodeViewController.h"
#import "SelectPhotoView.h"
#import "CoverShadowView.h"
@interface StoreManagermentViewController ()<UINavigationControllerDelegate, UIImagePickerControllerDelegate>
@property (nonatomic, strong) SelectPhotoView *photoView;
@property (nonatomic, strong) CoverShadowView *shadowView;
@end
@implementation StoreManagermentViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:YES animated:YES];
}
- (SelectPhotoView *)photoView {
if (!_photoView) {
_photoView = [SelectPhotoView viewWithNibName:@"SelectPhotoView"];
_photoView.frame = CGRectMake(0, kHeight, kWidth, 100);
_shadowView = [[CoverShadowView alloc] initOnTopWithHeight:kHeight];
[self.view.window addSubview:_shadowView];
[_shadowView addSubview:_photoView];
WS(weakSelf)
//拍照
_photoView.takePhotoBlock = ^{
[weakSelf takePhotoAction];
};
//相册
_photoView.galleryBlock = ^{
};
//阴影点击事件
_shadowView.tapAction = ^{
[weakSelf hide];
};
}
return _photoView;
}
- (void)takePhotoAction {
if (![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"找不到相机" delegate:nil cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
} else {
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
// picker.modalTransitionStyle=UIModalTransitionStyleFlipHorizontal;
picker.videoQuality = UIImagePickerControllerQualityTypeLow;
[self presentViewController:picker animated:YES completion:nil];
}
}
/**
* 显示阴影和底部的弹框
*/
- (void)show {
[self.photoView showView];
[self.shadowView show];
}
- (void)hide {
[self.photoView hideView];
[self.shadowView hide];
}
- (IBAction)headSculpture:(id)sender {
CLog(@"头像");
[self show];
}
- (IBAction)shopName:(id)sender {
}
- (IBAction)shopIntroduction:(id)sender {
}
- (IBAction)shopLV:(id)sender {
}
- (IBAction)QRCodeAction:(id)sender {
StoreQRCodeViewController *QRCodeVC = [[StoreQRCodeViewController alloc] initWithNibName:@"StoreQRCodeViewController" bundle:nil];
[self.navigationController pushViewController:QRCodeVC 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
//
// StoreQRCodeViewController.h
// ALand
//
// Created by Z on 16/4/5.
// Copyright © 2016年 Z. All rights reserved.
//
#import "IBTUIViewController.h"
@interface StoreQRCodeViewController : IBTUIViewController
@end
//
// StoreQRCodeViewController.m
// ALand
//
// Created by Z on 16/4/5.
// Copyright © 2016年 Z. All rights reserved.
//
#import "StoreQRCodeViewController.h"
#import "UIImage+QRCode.h"
@interface StoreQRCodeViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *imageViewQRCode;
@end
@implementation StoreQRCodeViewController
- (void)viewDidLoad {
[super viewDidLoad];
UIImage *qrcode = [UIImage createNonInterpolatedUIImageFormCIImage:[UIImage createQRForString:@"http://blog.yourtion.com"] withSize:250.0f];
UIImage *customQrcode = [UIImage imageBlackToTransparent:qrcode withRed:60.0f andGreen:74.0f andBlue:89.0f];
self.imageViewQRCode.image = customQrcode;
// set shadow
self.imageViewQRCode.layer.shadowOffset = CGSizeMake(0, 2);
self.imageViewQRCode.layer.shadowRadius = 2;
self.imageViewQRCode.layer.shadowColor = [UIColor blackColor].CGColor;
self.imageViewQRCode.layer.shadowOpacity = 0.5;
// Do any additional setup after loading the view from its nib.
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:NO animated:YES];
}
- (IBAction)actionSafeToAlbum:(id)sender {
}
- (IBAction)actionShare:(id)sender {
}
- (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
<?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="StoreQRCodeViewController">
<connections>
<outlet property="imageViewQRCode" destination="bLf-3W-zks" id="Pe9-9O-ccv"/>
<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>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="RFH-hd-LUV">
<rect key="frame" x="0.0" y="0.0" width="375" height="349"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="erweima_结果" translatesAutoresizingMaskIntoConstraints="NO" id="bLf-3W-zks">
<rect key="frame" x="67" y="0.0" width="241" height="349"/>
</imageView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="bLf-3W-zks" firstAttribute="top" secondItem="RFH-hd-LUV" secondAttribute="top" id="FAS-oh-mxh"/>
<constraint firstAttribute="trailing" secondItem="bLf-3W-zks" secondAttribute="trailing" constant="67" id="QLR-Uf-j7Q"/>
<constraint firstItem="bLf-3W-zks" firstAttribute="leading" secondItem="RFH-hd-LUV" secondAttribute="leading" constant="67" id="cZa-Uc-k0N"/>
<constraint firstAttribute="bottom" secondItem="bLf-3W-zks" secondAttribute="bottom" id="myM-YP-fkq"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ViK-KX-ySY">
<rect key="frame" x="32" y="429" width="311" height="44"/>
<constraints>
<constraint firstAttribute="height" constant="44" id="ANx-UQ-dVE"/>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="44" id="eiq-IS-QP5"/>
<constraint firstAttribute="width" constant="300" id="mXN-Ku-k0b"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="22"/>
<state key="normal" title="保存至手机" backgroundImage="rigist_btn_bg">
<color key="titleColor" red="0.97254901959999995" green="0.97254901959999995" blue="0.97254901959999995" alpha="1" colorSpace="calibratedRGB"/>
</state>
<variation key="default">
<mask key="constraints">
<exclude reference="mXN-Ku-k0b"/>
</mask>
</variation>
<connections>
<action selector="actionSafeToAlbum:" destination="-1" eventType="touchUpInside" id="tOA-6y-s1M"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="x2U-B2-ts9">
<rect key="frame" x="32" y="506" width="311" height="44"/>
<constraints>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="44" id="7VW-Yx-INi"/>
<constraint firstAttribute="height" constant="44" id="CNC-hG-yQj"/>
<constraint firstAttribute="width" constant="300" id="QwT-i9-ffE"/>
<constraint firstAttribute="height" constant="44" id="d0j-5C-mfJ"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="22"/>
<state key="normal" title="分享给好友" backgroundImage="rigist_btn_bg">
<color key="titleColor" red="0.97254901959999995" green="0.97254901959999995" blue="0.97254901959999995" alpha="1" colorSpace="calibratedRGB"/>
</state>
<variation key="default">
<mask key="constraints">
<exclude reference="7VW-Yx-INi"/>
<exclude reference="CNC-hG-yQj"/>
<exclude reference="QwT-i9-ffE"/>
</mask>
</variation>
<connections>
<action selector="actionShare:" destination="-1" eventType="touchUpInside" id="uco-Ij-IWU"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" red="0.91271875000000002" green="0.91271875000000002" blue="0.91271875000000002" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="RFH-hd-LUV" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="1wK-iV-EeW"/>
<constraint firstItem="x2U-B2-ts9" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="32" id="3YA-UD-xaT"/>
<constraint firstItem="ViK-KX-ySY" firstAttribute="top" secondItem="RFH-hd-LUV" secondAttribute="bottom" constant="80" id="9Gq-7S-kA8"/>
<constraint firstAttribute="trailing" secondItem="x2U-B2-ts9" secondAttribute="trailing" constant="32" id="D41-F6-h4Z"/>
<constraint firstItem="RFH-hd-LUV" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="MIA-sU-jn5"/>
<constraint firstItem="ViK-KX-ySY" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="32" id="WS0-mD-3Ht"/>
<constraint firstAttribute="trailing" secondItem="RFH-hd-LUV" secondAttribute="trailing" id="YtN-QY-ief"/>
<constraint firstAttribute="bottom" secondItem="RFH-hd-LUV" secondAttribute="bottom" constant="318" id="m2v-gS-1IT"/>
<constraint firstItem="x2U-B2-ts9" firstAttribute="top" secondItem="ViK-KX-ySY" secondAttribute="bottom" constant="33" id="qvg-XY-VxV"/>
<constraint firstAttribute="trailing" secondItem="ViK-KX-ySY" secondAttribute="trailing" constant="32" id="u1j-6W-nJr"/>
</constraints>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina47"/>
<point key="canvasLocation" x="286.5" y="386.5"/>
</view>
</objects>
<resources>
<image name="erweima_结果" width="327" height="327"/>
<image name="rigist_btn_bg" width="490" height="65"/>
</resources>
</document>
...@@ -20,6 +20,10 @@ ...@@ -20,6 +20,10 @@
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
} }
- (UIStatusBarStyle)preferredStatusBarStyle {
return UIStatusBarStyleDefault;
}
- (void)viewWillAppear:(BOOL)animated { - (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated]; [super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:YES]; [self.navigationController setNavigationBarHidden:YES];
...@@ -33,8 +37,7 @@ ...@@ -33,8 +37,7 @@
- (IBAction)loginACtion:(UIButton *)sender { - (IBAction)loginACtion:(UIButton *)sender {
ToLoginViewController *toLoginVC = [[ToLoginViewController alloc] initWithNibName:@"ToLoginViewController" bundle:[NSBundle mainBundle]]; ToLoginViewController *toLoginVC = [[ToLoginViewController alloc] initWithNibName:@"ToLoginViewController" bundle:[NSBundle mainBundle]];
//NSLog(@"123");
// ToLoginViewController *toLoginVC = [[ToLoginViewController alloc] init];
[self.navigationController pushViewController:toLoginVC animated:YES]; [self.navigationController pushViewController:toLoginVC animated:YES];
} }
......
...@@ -20,6 +20,9 @@ ...@@ -20,6 +20,9 @@
<subviews> <subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="login_top" translatesAutoresizingMaskIntoConstraints="NO" id="gIO-Jz-jhA"> <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="login_top" translatesAutoresizingMaskIntoConstraints="NO" id="gIO-Jz-jhA">
<rect key="frame" x="71" y="94" width="234" height="136"/> <rect key="frame" x="71" y="94" width="234" height="136"/>
<constraints>
<constraint firstAttribute="width" constant="234" id="jkq-tN-k4O"/>
</constraints>
</imageView> </imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Drd-sW-LYv"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Drd-sW-LYv">
<rect key="frame" x="32" y="274" width="311" height="44"/> <rect key="frame" x="32" y="274" width="311" height="44"/>
......
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#import "RigistViewController.h" #import "RigistViewController.h"
#import "UIButton+countDown.h" #import "UIButton+countDown.h"
#import "AFNetworking.h"
#import "ToLoginViewController.h"
@interface RigistViewController () @interface RigistViewController ()
@property (weak, nonatomic) IBOutlet UIButton *sendCodeBtn; @property (weak, nonatomic) IBOutlet UIButton *sendCodeBtn;
@property (weak, nonatomic) IBOutlet UIButton *setPasswordVisible; @property (weak, nonatomic) IBOutlet UIButton *setPasswordVisible;
...@@ -32,10 +34,6 @@ ...@@ -32,10 +34,6 @@
[self.navigationController setNavigationBarHidden:NO]; [self.navigationController setNavigationBarHidden:NO];
} }
- (IBAction)sendCodeAction:(UIButton *)sender {
[self.sendCodeBtn startWithTime:60 title:@"发送验证码" countDownTitle:@"s" mainColor:nil countColor:nil mainTitleColor:[UIColor colorWithHexString:@"51B2F6"] countTitleColor:[UIColor colorWithHexString:@"888888"]];
}
- (IBAction)toAgreement:(UIButton *)sender { - (IBAction)toAgreement:(UIButton *)sender {
...@@ -53,6 +51,46 @@ ...@@ -53,6 +51,46 @@
} }
} }
// 发送验证码
- (IBAction)sendCodeAction:(UIButton *)sender {
NSDictionary *parameters = @{@"mobilephone":self.phoneNumberTextFiled.text,
@"template":@"1234"};
WS(weakSelf)
[[HTTPCilent shareCilent] GET:@"app/sendSms" parameters:parameters success:^(NSURLSessionDataTask *task, id responseObject) {
[weakSelf.sendCodeBtn startWithTime:60 title:@"发送验证码" countDownTitle:@"s" mainColor:nil countColor:nil mainTitleColor:[UIColor colorWithHexString:@"51B2F6"] countTitleColor:[UIColor colorWithHexString:@"888888"]];
} failure:^(NSURLSessionDataTask *task, NSError *error) {
}];
}
//注册
- (IBAction)actionNext:(id)sender {
NSDictionary *parameters = @{@"domain":@"0001",
@"invitationCode":@"",
@"smsCode":@"1234",
@"mobilephone":self.phoneNumberTextFiled.text,
@"password":[self.passwordTextFiled.text MD5String]};
WS(weakSelf)
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
[[HTTPCilent shareCilent] POST:@"app/resellerRegister" parameters:parameters success:^(NSURLSessionDataTask *task, id responseObject) {
ToLoginViewController *toLoginVC = [[ToLoginViewController alloc] initWithNibName:@"ToLoginViewController" bundle:[NSBundle mainBundle]];
[weakSelf.navigationController pushViewController:toLoginVC animated:YES];
[MBProgressHUD hideHUDForView:self.view animated:YES];
} failure:^(NSURLSessionDataTask *task, NSError *error) {
}];
}
- (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; [super didReceiveMemoryWarning];
......
...@@ -184,6 +184,9 @@ ...@@ -184,6 +184,9 @@
<state key="normal" title="下一步" backgroundImage="rigist_btn_bg"> <state key="normal" title="下一步" backgroundImage="rigist_btn_bg">
<color key="titleColor" red="0.97254901959999995" green="0.97254901959999995" blue="0.97254901959999995" alpha="1" colorSpace="calibratedRGB"/> <color key="titleColor" red="0.97254901959999995" green="0.97254901959999995" blue="0.97254901959999995" alpha="1" colorSpace="calibratedRGB"/>
</state> </state>
<connections>
<action selector="actionNext:" destination="-1" eventType="touchUpInside" id="LW8-WV-Ty7"/>
</connections>
</button> </button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="点击'下一步'即表示同意" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wm7-xw-IwN"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="点击'下一步'即表示同意" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wm7-xw-IwN">
<rect key="frame" x="32" y="350" width="189" height="22"/> <rect key="frame" x="32" y="350" width="189" height="22"/>
......
...@@ -25,6 +25,22 @@ ...@@ -25,6 +25,22 @@
- (IBAction)toLoginAction:(UIButton *)sender { - (IBAction)toLoginAction:(UIButton *)sender {
NSDictionary *paramers = @{@"domain":kDomain,
@"loginName":self.phoneNumberTextFiled.text ,
@"password":[self.passwordTextFiled.text MD5String],
@"rememberMe":@"true"};
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
[[HTTPCilent shareCilent] POST:@"app/resellerLogin" parameters:paramers success:^(NSURLSessionDataTask *task, id responseObject) {
UserInfo *info = [UserInfo shareInstance];
info = [UserInfo mj_objectWithKeyValues:responseObject[@"reseller"]];
[MBProgressHUD hideHUDForView:self.view animated:YES];
} failure:^(NSURLSessionDataTask *task, NSError *error) {
}];
BaseViewController *baseVC = [[BaseViewController alloc] init]; BaseViewController *baseVC = [[BaseViewController alloc] init];
baseVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; baseVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentViewController:baseVC animated:YES completion:nil]; [self presentViewController:baseVC animated:YES completion:nil];
......
//
// UIImage+QRCode.h
// ALand
//
// Created by Z on 16/4/5.
// Copyright © 2016年 Z. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIImage (QRCode)
+ (UIImage *)createNonInterpolatedUIImageFormCIImage:(CIImage *)image withSize:(CGFloat) size;
+ (UIImage*)imageBlackToTransparent:(UIImage*)image withRed:(CGFloat)red andGreen:(CGFloat)green andBlue:(CGFloat)blue;
+ (CIImage *)createQRForString:(NSString *)qrString;
@end
//
// UIImage+QRCode.m
// ALand
//
// Created by Z on 16/4/5.
// Copyright © 2016年 Z. All rights reserved.
//
#import "UIImage+QRCode.h"
@implementation UIImage (QRCode)
#pragma mark - InterpolatedUIImage
+ (UIImage *)createNonInterpolatedUIImageFormCIImage:(CIImage *)image withSize:(CGFloat) size {
CGRect extent = CGRectIntegral(image.extent);
CGFloat scale = MIN(size/CGRectGetWidth(extent), size/CGRectGetHeight(extent));
// create a bitmap image that we'll draw into a bitmap context at the desired size;
size_t width = CGRectGetWidth(extent) * scale;
size_t height = CGRectGetHeight(extent) * scale;
CGColorSpaceRef cs = CGColorSpaceCreateDeviceGray();
CGContextRef bitmapRef = CGBitmapContextCreate(nil, width, height, 8, 0, cs, (CGBitmapInfo)kCGImageAlphaNone);
CIContext *context = [CIContext contextWithOptions:nil];
CGImageRef bitmapImage = [context createCGImage:image fromRect:extent];
CGContextSetInterpolationQuality(bitmapRef, kCGInterpolationNone);
CGContextScaleCTM(bitmapRef, scale, scale);
CGContextDrawImage(bitmapRef, extent, bitmapImage);
// Create an image with the contents of our bitmap
CGImageRef scaledImage = CGBitmapContextCreateImage(bitmapRef);
// Cleanup
CGContextRelease(bitmapRef);
CGImageRelease(bitmapImage);
return [UIImage imageWithCGImage:scaledImage];
}
#pragma mark - QRCodeGenerator
+ (CIImage *)createQRForString:(NSString *)qrString {
// Need to convert the string to a UTF-8 encoded NSData object
NSData *stringData = [qrString dataUsingEncoding:NSUTF8StringEncoding];
// Create the filter
CIFilter *qrFilter = [CIFilter filterWithName:@"CIQRCodeGenerator"];
// Set the message content and error-correction level
[qrFilter setValue:stringData forKey:@"inputMessage"];
[qrFilter setValue:@"M" forKey:@"inputCorrectionLevel"];
// Send the image back
return qrFilter.outputImage;
}
#pragma mark - imageToTransparent
void ProviderReleaseData (void *info, const void *data, size_t size){
free((void*)data);
}
+ (UIImage*)imageBlackToTransparent:(UIImage*)image withRed:(CGFloat)red andGreen:(CGFloat)green andBlue:(CGFloat)blue{
const int imageWidth = image.size.width;
const int imageHeight = image.size.height;
size_t bytesPerRow = imageWidth * 4;
uint32_t* rgbImageBuf = (uint32_t*)malloc(bytesPerRow * imageHeight);
// create context
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGContextRef context = CGBitmapContextCreate(rgbImageBuf, imageWidth, imageHeight, 8, bytesPerRow, colorSpace,
kCGBitmapByteOrder32Little | kCGImageAlphaNoneSkipLast);
CGContextDrawImage(context, CGRectMake(0, 0, imageWidth, imageHeight), image.CGImage);
// traverse pixe
int pixelNum = imageWidth * imageHeight;
uint32_t* pCurPtr = rgbImageBuf;
for (int i = 0; i < pixelNum; i++, pCurPtr++){
if ((*pCurPtr & 0xFFFFFF00) < 0x99999900){
// change color
uint8_t* ptr = (uint8_t*)pCurPtr;
ptr[3] = red; //0~255
ptr[2] = green;
ptr[1] = blue;
}else{
uint8_t* ptr = (uint8_t*)pCurPtr;
ptr[0] = 0;
}
}
// context to image
CGDataProviderRef dataProvider = CGDataProviderCreateWithData(NULL, rgbImageBuf, bytesPerRow * imageHeight, ProviderReleaseData);
CGImageRef imageRef = CGImageCreate(imageWidth, imageHeight, 8, 32, bytesPerRow, colorSpace,
kCGImageAlphaLast | kCGBitmapByteOrder32Little, dataProvider,
NULL, true, kCGRenderingIntentDefault);
CGDataProviderRelease(dataProvider);
UIImage* resultUIImage = [UIImage imageWithCGImage:imageRef];
// release
CGImageRelease(imageRef);
CGContextRelease(context);
CGColorSpaceRelease(colorSpace);
return resultUIImage;
}
@end
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
} }
- (void)doTap { - (void)doTap {
[self hide];
self.tapAction(); self.tapAction();
} }
......
//
// HTTPCilent.h
// ALand
//
// Created by Z on 16/4/5.
// Copyright © 2016年 Z. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface HTTPCilent : NSObject
+ (HTTPCilent *)shareCilent;
- (void)POST:(NSString *)URLString
parameters:(id)parameters
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;
- (void)GET:(NSString *)URLString
parameters:(id)parameters
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;
@end
//
// HTTPCilent.m
// ALand
//
// Created by Z on 16/4/5.
// Copyright © 2016年 Z. All rights reserved.
//
#import "HTTPCilent.h"
#import "AFHTTPSessionManager.h"
#import "NSDictionary+Category.h"
@interface HTTPCilent ()
@property (nonatomic, strong) AFHTTPSessionManager *manager;
@end
@implementation HTTPCilent
+ (HTTPCilent *)shareCilent {
static HTTPCilent *cilent;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
cilent = [[HTTPCilent alloc] init];
});
return cilent;
}
- (AFHTTPSessionManager *)manager {
if (!_manager) {
_manager = [[AFHTTPSessionManager alloc] initWithBaseURL:[NSURL URLWithString:REST_BASE_URL]];
_manager.responseSerializer = [AFJSONResponseSerializer serializer];
_manager.requestSerializer = [AFJSONRequestSerializer serializer];
[_manager.requestSerializer setValue:@"application/json;charset=utf-8" forHTTPHeaderField: @"Content-Type"];
}
return _manager;
}
- (void)POST:(NSString *)URLString
parameters:(id)parameters
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure {
[self.manager POST:URLString parameters:parameters progress:^(NSProgress * _Nonnull uploadProgress) {
} success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
NSDictionary *dic = responseObject;
CLog(@"POST success!-------->%@", [dic JSONString]);
success(task, responseObject);
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
CLog(@"POST请求失败!----->%@", [error localizedDescription]);
failure(task, error);
}];
}
- (void)GET:(NSString *)URLString
parameters:(id)parameters
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure {
[self.manager GET:URLString parameters:parameters progress:^(NSProgress * _Nonnull downloadProgress) {
} success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
NSDictionary *dic = responseObject;
CLog(@"GET success!-------->%@", [dic JSONString]);
success(task, responseObject);
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
CLog(@"GET请求失败!----->%@", [error localizedDescription]);
failure(task, error);
}];
}
@end
...@@ -8,9 +8,131 @@ ...@@ -8,9 +8,131 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@class Certificate,Lastmodifyinfo,Passwordcontrol,Shop,Createinfo,Ownerorg,Logincontrol;
@interface UserInfo : NSObject @interface UserInfo : NSObject
@property (nonatomic, copy) NSString *userName;
@property (nonatomic, copy) NSString *token; @property (nonatomic, copy) NSString *birthday;
@property (nonatomic, copy) NSString *portrait;
@property (nonatomic, strong) Ownerorg *ownerOrg;
@property (nonatomic, copy) NSString *code;
@property (nonatomic, copy) NSString *telephone;
@property (nonatomic, copy) NSString *mobilephone;
@property (nonatomic, copy) NSString *uuid;
@property (nonatomic, strong) Lastmodifyinfo *lastModifyInfo;
@property (nonatomic, copy) NSString *socialContact;
@property (nonatomic, strong) Certificate *certificate;
@property (nonatomic, assign) NSInteger version;
@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *invitationCode;
@property (nonatomic, copy) NSString *state;
@property (nonatomic, copy) NSString *domain;
@property (nonatomic, copy) NSString *idCard;
@property (nonatomic, copy) NSString *gender;
@property (nonatomic, strong) Passwordcontrol *passwordControl;
@property (nonatomic, copy) NSString *postalAddresses;
@property (nonatomic, strong) NSArray *roles;
@property (nonatomic, copy) NSString *referrer;
@property (nonatomic, strong) Shop *shop;
@property (nonatomic, strong) Createinfo *createInfo;
@property (nonatomic, assign) NSInteger order;
@property (nonatomic, strong) Logincontrol *loginControl;
+ (UserInfo *)shareInstance; + (UserInfo *)shareInstance;
@end @end
@interface Certificate : NSObject
@property (nonatomic, strong) NSArray *bankCards;
@property (nonatomic, assign) BOOL idValidated;
@property (nonatomic, copy) NSString *code;
@property (nonatomic, copy) NSString *uuid;
@property (nonatomic, copy) NSString *good;
@property (nonatomic, copy) NSString *trueName;
@property (nonatomic, copy) NSString *name;
@end
@interface Lastmodifyinfo : NSObject
@property (nonatomic, copy) NSString *operator;
@property (nonatomic, assign) long long time;
@end
@interface Passwordcontrol : NSObject
@property (nonatomic, assign) long long created;
@property (nonatomic, assign) long long expiry;
@end
@interface Shop : NSObject
@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *uuid;
@property (nonatomic, copy) NSString *code;
@end
@interface Createinfo : NSObject
@property (nonatomic, copy) NSString *operator;
@property (nonatomic, assign) long long time;
@end
@interface Ownerorg : NSObject
@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *uuid;
@property (nonatomic, copy) NSString *code;
@end
@interface Logincontrol : NSObject
@property (nonatomic, copy) NSString *loginIp;
@property (nonatomic, assign) long long loginTime;
@property (nonatomic, assign) NSInteger failedTimes;
@end
...@@ -20,3 +20,42 @@ ...@@ -20,3 +20,42 @@
@end @end
@implementation Certificate
@end
@implementation Lastmodifyinfo
@end
@implementation Passwordcontrol
@end
@implementation Shop
@end
@implementation Createinfo
@end
@implementation Ownerorg
@end
@implementation Logincontrol
@end
...@@ -52,7 +52,6 @@ ...@@ -52,7 +52,6 @@
+ (NSString *)getWeekFromDate; + (NSString *)getWeekFromDate;
+ (NSString *)getWeekFromDateWithDate: (NSDate *)date; + (NSString *)getWeekFromDateWithDate: (NSDate *)date;
+ (NSInteger)getWeeks:(NSInteger)year; + (NSInteger)getWeeks:(NSInteger)year;
+ (NSInteger)getWeeks:(NSInteger)year;
+ (NSString*)weekdayStringFromDate:(NSDate *)inputDate; + (NSString*)weekdayStringFromDate:(NSDate *)inputDate;
+ (NSString *)countNumAndChangeformat:(NSNumber *)num; + (NSString *)countNumAndChangeformat:(NSNumber *)num;
+ (NSString *)stringDisposeWithFloat:(float)floatValue; + (NSString *)stringDisposeWithFloat:(float)floatValue;
......
...@@ -22,6 +22,11 @@ ...@@ -22,6 +22,11 @@
<string>1</string> <string>1</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UILaunchStoryboardName</key> <key>UILaunchStoryboardName</key>
<string>LaunchScreen</string> <string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key> <key>UIRequiredDeviceCapabilities</key>
......
...@@ -15,4 +15,6 @@ ...@@ -15,4 +15,6 @@
#import "UIImageView+WebCache.h" #import "UIImageView+WebCache.h"
#import "UserInfo.h" #import "UserInfo.h"
#import "UIButton+Category.h" #import "UIButton+Category.h"
#import "HTTPCilent.h"
#import "MJExtension.h"
#endif /* IMPHeader_h */ #endif /* IMPHeader_h */
...@@ -9,5 +9,8 @@ ...@@ -9,5 +9,8 @@
#ifndef UrlHeader_h #ifndef UrlHeader_h
#define UrlHeader_h #define UrlHeader_h
#define REST_BASE_URL @"http://service.bloem.cn/aland-server/rest"
#define kDomain @"0001" //组织代码
#endif /* UrlHeader_h */ #endif /* UrlHeader_h */
...@@ -6,3 +6,5 @@ pod 'FMDB', '~> 2.6' ...@@ -6,3 +6,5 @@ pod 'FMDB', '~> 2.6'
pod 'SSKeychain', '~> 1.3.1' pod 'SSKeychain', '~> 1.3.1'
pod 'IQKeyboardManager', '~> 4.0.0' pod 'IQKeyboardManager', '~> 4.0.0'
pod 'SDCycleScrollView', '~> 1.61' pod 'SDCycleScrollView', '~> 1.61'
pod 'AFNetworking', '~> 3.0.4'
pod 'MJExtension', '~> 3.0.10'
PODS: PODS:
- AFNetworking (3.0.4):
- AFNetworking/NSURLSession (= 3.0.4)
- AFNetworking/Reachability (= 3.0.4)
- AFNetworking/Security (= 3.0.4)
- AFNetworking/Serialization (= 3.0.4)
- AFNetworking/UIKit (= 3.0.4)
- AFNetworking/NSURLSession (3.0.4):
- AFNetworking/Reachability
- AFNetworking/Security
- AFNetworking/Serialization
- AFNetworking/Reachability (3.0.4)
- AFNetworking/Security (3.0.4)
- AFNetworking/Serialization (3.0.4)
- AFNetworking/UIKit (3.0.4):
- AFNetworking/NSURLSession
- FMDB (2.6): - FMDB (2.6):
- FMDB/standard (= 2.6) - FMDB/standard (= 2.6)
- FMDB/standard (2.6) - FMDB/standard (2.6)
- IQKeyboardManager (4.0.0) - IQKeyboardManager (4.0.0)
- MBProgressHUD (0.9.2) - MBProgressHUD (0.9.2)
- MJExtension (3.0.10)
- SDAutoLayout (1.31) - SDAutoLayout (1.31)
- SDCycleScrollView (1.61): - SDCycleScrollView (1.61):
- SDWebImage (~> 3.7) - SDWebImage (~> 3.7)
...@@ -13,18 +29,22 @@ PODS: ...@@ -13,18 +29,22 @@ PODS:
- SSKeychain (1.3.1) - SSKeychain (1.3.1)
DEPENDENCIES: DEPENDENCIES:
- AFNetworking (~> 3.0.4)
- FMDB (~> 2.6) - FMDB (~> 2.6)
- IQKeyboardManager (~> 4.0.0) - IQKeyboardManager (~> 4.0.0)
- MBProgressHUD (~> 0.9.2) - MBProgressHUD (~> 0.9.2)
- MJExtension (~> 3.0.10)
- SDAutoLayout (~> 1.31) - SDAutoLayout (~> 1.31)
- SDCycleScrollView (~> 1.61) - SDCycleScrollView (~> 1.61)
- SDWebImage (~> 3.7.5) - SDWebImage (~> 3.7.5)
- SSKeychain (~> 1.3.1) - SSKeychain (~> 1.3.1)
SPEC CHECKSUMS: SPEC CHECKSUMS:
AFNetworking: a0075feb321559dc78d9d85b55d11caa19eabb93
FMDB: c1968bab3ab0aed38f66cb778ae1e7fa9a652b6e FMDB: c1968bab3ab0aed38f66cb778ae1e7fa9a652b6e
IQKeyboardManager: b91928f7927ba55a5829b4dcf4b7a6736ac9fc22 IQKeyboardManager: b91928f7927ba55a5829b4dcf4b7a6736ac9fc22
MBProgressHUD: 1569cf7ace17a8bac47aabfbb8580a49690386d1 MBProgressHUD: 1569cf7ace17a8bac47aabfbb8580a49690386d1
MJExtension: d86aacb740c87519d20e3cca55b6fa4be6cc7548
SDAutoLayout: 79b8977f863ba4722bb8f8f6f92981d0b8ae932a SDAutoLayout: 79b8977f863ba4722bb8f8f6f92981d0b8ae932a
SDCycleScrollView: a002d85b30cfa9d0ac74069cd3973ca19ff4f22f SDCycleScrollView: a002d85b30cfa9d0ac74069cd3973ca19ff4f22f
SDWebImage: 69c6303e3348fba97e03f65d65d4fbc26740f461 SDWebImage: 69c6303e3348fba97e03f65d65d4fbc26740f461
......
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