Commit d52d86df authored by Sandy's avatar Sandy

bugs fix

parent 6c8072cc
This diff is collapsed.
{
"images" : [
{
"idiom" : "universal",
"filename" : "commodityManage_Manager.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "commodityManage_Manager@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "commodityManage_add.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "commodityManage_add@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" : "select_tick.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "select_tick@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "select_warning.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "select_warning@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "icon_bill.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "icon_bill@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
//
// JavenConsumer.h
//
// Created by Z on 16/4/28
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface JavenConsumer : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) NSString *mobilephone;
@property (nonatomic, strong) NSString *code;
@property (nonatomic, assign) id name;
@property (nonatomic, assign) id portrait;
@property (nonatomic, strong) NSString *uuid;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// JavenConsumer.m
//
// Created by Z on 16/4/28
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "JavenConsumer.h"
NSString *const kJavenConsumerMobilephone = @"mobilephone";
NSString *const kJavenConsumerCode = @"code";
NSString *const kJavenConsumerName = @"name";
NSString *const kJavenConsumerPortrait = @"portrait";
NSString *const kJavenConsumerUuid = @"uuid";
@interface JavenConsumer ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation JavenConsumer
@synthesize mobilephone = _mobilephone;
@synthesize code = _code;
@synthesize name = _name;
@synthesize portrait = _portrait;
@synthesize uuid = _uuid;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.mobilephone = [self objectOrNilForKey:kJavenConsumerMobilephone fromDictionary:dict];
self.code = [self objectOrNilForKey:kJavenConsumerCode fromDictionary:dict];
self.name = [self objectOrNilForKey:kJavenConsumerName fromDictionary:dict];
self.portrait = [self objectOrNilForKey:kJavenConsumerPortrait fromDictionary:dict];
self.uuid = [self objectOrNilForKey:kJavenConsumerUuid fromDictionary:dict];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:self.mobilephone forKey:kJavenConsumerMobilephone];
[mutableDict setValue:self.code forKey:kJavenConsumerCode];
[mutableDict setValue:self.name forKey:kJavenConsumerName];
[mutableDict setValue:self.portrait forKey:kJavenConsumerPortrait];
[mutableDict setValue:self.uuid forKey:kJavenConsumerUuid];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.mobilephone = [aDecoder decodeObjectForKey:kJavenConsumerMobilephone];
self.code = [aDecoder decodeObjectForKey:kJavenConsumerCode];
self.name = [aDecoder decodeObjectForKey:kJavenConsumerName];
self.portrait = [aDecoder decodeObjectForKey:kJavenConsumerPortrait];
self.uuid = [aDecoder decodeObjectForKey:kJavenConsumerUuid];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:_mobilephone forKey:kJavenConsumerMobilephone];
[aCoder encodeObject:_code forKey:kJavenConsumerCode];
[aCoder encodeObject:_name forKey:kJavenConsumerName];
[aCoder encodeObject:_portrait forKey:kJavenConsumerPortrait];
[aCoder encodeObject:_uuid forKey:kJavenConsumerUuid];
}
- (id)copyWithZone:(NSZone *)zone
{
JavenConsumer *copy = [[JavenConsumer alloc] init];
if (copy) {
copy.mobilephone = [self.mobilephone copyWithZone:zone];
copy.code = [self.code copyWithZone:zone];
copy.name = [self.name copyWithZone:zone];
copy.portrait = [self.portrait copyWithZone:zone];
copy.uuid = [self.uuid copyWithZone:zone];
}
return copy;
}
@end
//
// JavenCustomer.h
//
// Created by Z on 16/4/28
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "JavenConsumer.h"
@interface JavenCustomer : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) JavenConsumer *consumer;
@property (nonatomic, assign) double orderCount;
@property (nonatomic, assign) double commissionTotal;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// JavenCustomer.m
//
// Created by Z on 16/4/28
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "JavenCustomer.h"
#import "JavenConsumer.h"
NSString *const kJavenCustomerConsumer = @"consumer";
NSString *const kJavenCustomerOrderCount = @"orderCount";
NSString *const kJavenCustomerCommissionTotal = @"commissionTotal";
@interface JavenCustomer ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation JavenCustomer
@synthesize consumer = _consumer;
@synthesize orderCount = _orderCount;
@synthesize commissionTotal = _commissionTotal;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.consumer = [JavenConsumer modelObjectWithDictionary:[dict objectForKey:kJavenCustomerConsumer]];
self.orderCount = [[self objectOrNilForKey:kJavenCustomerOrderCount fromDictionary:dict] doubleValue];
self.commissionTotal = [[self objectOrNilForKey:kJavenCustomerCommissionTotal fromDictionary:dict] doubleValue];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:[self.consumer dictionaryRepresentation] forKey:kJavenCustomerConsumer];
[mutableDict setValue:[NSNumber numberWithDouble:self.orderCount] forKey:kJavenCustomerOrderCount];
[mutableDict setValue:[NSNumber numberWithDouble:self.commissionTotal] forKey:kJavenCustomerCommissionTotal];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.consumer = [aDecoder decodeObjectForKey:kJavenCustomerConsumer];
self.orderCount = [aDecoder decodeDoubleForKey:kJavenCustomerOrderCount];
self.commissionTotal = [aDecoder decodeDoubleForKey:kJavenCustomerCommissionTotal];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:_consumer forKey:kJavenCustomerConsumer];
[aCoder encodeDouble:_orderCount forKey:kJavenCustomerOrderCount];
[aCoder encodeDouble:_commissionTotal forKey:kJavenCustomerCommissionTotal];
}
- (id)copyWithZone:(NSZone *)zone
{
JavenCustomer *copy = [[JavenCustomer alloc] init];
if (copy) {
copy.consumer = [self.consumer copyWithZone:zone];
copy.orderCount = self.orderCount;
copy.commissionTotal = self.commissionTotal;
}
return copy;
}
@end
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center"> <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="226" height="75"/> <rect key="frame" x="0.0" y="0.0" width="226" height="75"/>
<subviews> <subviews>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="热门标签" borderStyle="roundedRect" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="HQp-oR-4tI"> <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="热门标签" borderStyle="roundedRect" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="HQp-oR-4tI" customClass="MBTextFieldWithFontAdapter">
<rect key="frame" x="5" y="10" width="216" height="55"/> <rect key="frame" x="5" y="10" width="216" height="55"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <fontDescription key="fontDescription" type="system" pointSize="15"/>
<textInputTraits key="textInputTraits"/> <textInputTraits key="textInputTraits"/>
</textField> </textField>
</subviews> </subviews>
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
typedef void (^addSuccessBlock)(void); typedef void (^addSuccessBlock)(void);
@interface CommodityListCollectionViewCell : UICollectionViewCell @interface CommodityListCollectionViewCell : UICollectionViewCell
@property (weak, nonatomic) IBOutlet UIImageView *imageViewTop;
@property (weak, nonatomic) IBOutlet UILabel *labelRealPrice; @property (weak, nonatomic) IBOutlet UILabel *labelRealPrice;
@property (weak, nonatomic) IBOutlet UILabel *labelSalePrice; @property (weak, nonatomic) IBOutlet UILabel *labelSalePrice;
@property (nonatomic, copy) addSuccessBlock successBlock; @property (nonatomic, copy) addSuccessBlock successBlock;
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#import "addCommodityRequestModel.h" #import "addCommodityRequestModel.h"
#import "MBLabelWithFontAdapter.h" #import "MBLabelWithFontAdapter.h"
@interface CommodityListCollectionViewCell () @interface CommodityListCollectionViewCell ()
@property (weak, nonatomic) IBOutlet UIImageView *imageViewTop;
@property (weak, nonatomic) IBOutlet MBLabelWithFontAdapter *labelTitle; @property (weak, nonatomic) IBOutlet MBLabelWithFontAdapter *labelTitle;
@property (weak, nonatomic) IBOutlet UILabel *labelPrice; @property (weak, nonatomic) IBOutlet UILabel *labelPrice;
@property (weak, nonatomic) IBOutlet UILabel *labelOriginalPrice; @property (weak, nonatomic) IBOutlet UILabel *labelOriginalPrice;
...@@ -19,6 +18,7 @@ ...@@ -19,6 +18,7 @@
@property (weak, nonatomic) IBOutlet MBLabelWithFontAdapter *labelBrokerageRate; //佣金 @property (weak, nonatomic) IBOutlet MBLabelWithFontAdapter *labelBrokerageRate; //佣金
@property (weak, nonatomic) IBOutlet UILabel *labelSalesVolume; //销量 @property (weak, nonatomic) IBOutlet UILabel *labelSalesVolume; //销量
@end @end
@implementation CommodityListCollectionViewCell @implementation CommodityListCollectionViewCell
...@@ -33,51 +33,14 @@ ...@@ -33,51 +33,14 @@
self.labelTitle.text = model.name; self.labelTitle.text = model.name;
self.model = model; self.model = model;
} }
- (IBAction)actionAdd:(id)sender {
CLog(@"添加商品");
UserInfo *info = [UserInfo shareInstance];
NSDictionary *param = @{
@"operCtx": @{
@"time": [[NSDate date] timeStampNumber],
@"domain": info.domain,
@"operator": @{
@"id": info.uuid,
@"fullName": info.name
}
},
@"shopUuid": info.shop.uuid,
@"goodsUuid":self.model.uuid
};
WS(weakSelf)
[[HTTPCilent shareCilent] POST:@"shop/addGoods" parameters:param success:^(NSURLSessionDataTask *task, id responseObject) {
if ([responseObject[@"code"] isEqualToNumber: @0]) {
[weakSelf addSUccess];
}
} failure:^(NSURLSessionDataTask *task, NSError *error) {
}];
- (IBAction)shareAction:(id)sender {
UserInfo *userInfo = [UserInfo shareInstance];
[[ShareInstance shareInstace] showWithTitle:@"Aland" content:self.model.name url:[NSString stringWithFormat:@"%@Wap/detail/shop_id/%@/id/%@/hastbar/0/.html", userInfo.webShopBaseUrl, userInfo.shop.uuid, self.model.uuid] image:self.imageViewTop.image];
} }
- (void)addSUccess {
//添加成功提示框
MBProgressHUD *hud = [[MBProgressHUD alloc] initWithView:self.window];
[self.window addSubview:hud];
hud.animationType = MBProgressHUDAnimationFade;
hud.removeFromSuperViewOnHide = YES;
hud.labelText = @"添加成功!";
hud.mode = MBProgressHUDModeText;
[hud show:YES];
[hud hide:YES afterDelay:1];
}
- (void)awakeFromNib { - (void)awakeFromNib {
// Initialization code // Initialization code
} }
......
...@@ -57,6 +57,9 @@ ...@@ -57,6 +57,9 @@
<constraint firstAttribute="width" constant="22" id="yua-IV-f6J"/> <constraint firstAttribute="width" constant="22" id="yua-IV-f6J"/>
</constraints> </constraints>
<state key="normal" image="commodityShare"/> <state key="normal" image="commodityShare"/>
<connections>
<action selector="shareAction:" destination="gTV-IL-0wX" eventType="touchUpInside" id="uXk-3N-njR"/>
</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="i9h-vh-UNx"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" 佣金:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="i9h-vh-UNx">
<rect key="frame" x="1" y="12" width="45" height="20"/> <rect key="frame" x="1" y="12" width="45" height="20"/>
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
[self hideSortView]; [self hideSortView];
AddCommodityViewController *addVC = [[AddCommodityViewController alloc] init]; AddCommodityViewController *addVC = [[AddCommodityViewController alloc] init];
addVC.hidesBottomBarWhenPushed = YES; addVC.hidesBottomBarWhenPushed = YES;
addVC.isShowNavigationBar = YES;
[[self viewController].navigationController pushViewController:addVC animated:YES]; [[self viewController].navigationController pushViewController:addVC animated:YES];
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="y9I-zx-duH"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="y9I-zx-duH">
<rect key="frame" x="0.0" y="10" width="160" height="110"/> <rect key="frame" x="0.0" y="10" width="160" height="110"/>
<fontDescription key="fontDescription" type="system" pointSize="19"/> <fontDescription key="fontDescription" type="system" pointSize="19"/>
<state key="normal" title="添加商品" image="blueCycle"> <state key="normal" title="添加商品" image="commodityManage_add">
<color key="titleColor" red="0.066666666669999999" green="0.066666666669999999" blue="0.066666666669999999" alpha="1" colorSpace="calibratedRGB"/> <color key="titleColor" red="0.066666666669999999" green="0.066666666669999999" blue="0.066666666669999999" alpha="1" colorSpace="calibratedRGB"/>
</state> </state>
<connections> <connections>
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="uY6-mf-dlQ"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="uY6-mf-dlQ">
<rect key="frame" x="160" y="10" width="160" height="110"/> <rect key="frame" x="160" y="10" width="160" height="110"/>
<fontDescription key="fontDescription" type="system" pointSize="19"/> <fontDescription key="fontDescription" type="system" pointSize="19"/>
<state key="normal" title="商品管理" image="blueCycle"> <state key="normal" title="商品管理" image="commodityManage_Manager">
<color key="titleColor" red="0.066666666669999999" green="0.066666666669999999" blue="0.066666666669999999" alpha="1" colorSpace="calibratedRGB"/> <color key="titleColor" red="0.066666666669999999" green="0.066666666669999999" blue="0.066666666669999999" alpha="1" colorSpace="calibratedRGB"/>
</state> </state>
<connections> <connections>
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
</button> </button>
</objects> </objects>
<resources> <resources>
<image name="blueCycle" width="62" height="62"/> <image name="commodityManage_Manager" width="75" height="75"/>
<image name="commodityManage_add" width="75" height="75"/>
</resources> </resources>
</document> </document>
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "JavenCustomer.h"
@interface CustomerTableViewCell : UITableViewCell @interface CustomerTableViewCell : UITableViewCell
- (void)cellwithModel:(JavenCustomer *)model;
@end @end
...@@ -7,13 +7,25 @@ ...@@ -7,13 +7,25 @@
// //
#import "CustomerTableViewCell.h" #import "CustomerTableViewCell.h"
#import "MBLabelWithFontAdapter.h"
@interface CustomerTableViewCell ()
@property (weak, nonatomic) IBOutlet MBLabelWithFontAdapter *labelOrderCount;
@property (weak, nonatomic) IBOutlet MBLabelWithFontAdapter *labelCommissionTotal;
@property (weak, nonatomic) IBOutlet UILabel *labelPhoneNumber;
@end
@implementation CustomerTableViewCell @implementation CustomerTableViewCell
- (void)awakeFromNib { - (void)awakeFromNib {
// Initialization code // Initialization code
} }
- (void)cellwithModel:(JavenCustomer *)model {
self.labelOrderCount.text = [NSString stringWithFormat:@"%.0f",model.orderCount];
self.labelCommissionTotal.text = [NSString stringWithFormat:@"%.2f", model.commissionTotal];
self.labelPhoneNumber.text = [NSString stringWithFormat:@"%@", model.consumer.mobilephone];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated { - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated]; [super setSelected:selected animated:animated];
......
...@@ -28,26 +28,26 @@ ...@@ -28,26 +28,26 @@
</variation> </variation>
</imageView> </imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="订单总数:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5XS-Sk-n6g" customClass="MBLabelWithFontAdapter"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="订单总数:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5XS-Sk-n6g" customClass="MBLabelWithFontAdapter">
<rect key="frame" x="91" y="42" width="73" height="21"/> <rect key="frame" x="91" y="43" width="69" height="20"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> <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" text="8" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3bd-RB-h0V" customClass="MBLabelWithFontAdapter"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="8" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3bd-RB-h0V" customClass="MBLabelWithFontAdapter">
<rect key="frame" x="164" y="42" width="11" height="21"/> <rect key="frame" x="160" y="43" width="10" height="20"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="1" 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" text="收入总计:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0K4-NW-0GC" customClass="MBLabelWithFontAdapter"> <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="0K4-NW-0GC" customClass="MBLabelWithFontAdapter">
<rect key="frame" x="213" y="42" width="73" height="21"/> <rect key="frame" x="217" y="43" width="69" height="20"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> <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" text="32.89" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Cfg-Yj-Odk" customClass="MBLabelWithFontAdapter"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="32.89" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Cfg-Yj-Odk" customClass="MBLabelWithFontAdapter">
<rect key="frame" x="286" y="42" width="45" height="21"/> <rect key="frame" x="288" y="43" width="43" height="20"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
...@@ -82,6 +82,11 @@ ...@@ -82,6 +82,11 @@
</mask> </mask>
</variation> </variation>
</tableViewCellContentView> </tableViewCellContentView>
<connections>
<outlet property="labelCommissionTotal" destination="Cfg-Yj-Odk" id="VgE-RY-fE8"/>
<outlet property="labelOrderCount" destination="3bd-RB-h0V" id="G5w-h5-ZNv"/>
<outlet property="labelPhoneNumber" destination="pwt-qX-7g4" id="HjI-WH-NYs"/>
</connections>
<point key="canvasLocation" x="289.5" y="326"/> <point key="canvasLocation" x="289.5" y="326"/>
</tableViewCell> </tableViewCell>
</objects> </objects>
......
//
// CustomerTopView.h
// ALand
//
// Created by Z on 16/4/28.
// Copyright © 2016年 Z. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface CustomerTopView : UIView
@end
//
// CustomerTopView.m
// ALand
//
// Created by Z on 16/4/28.
// Copyright © 2016年 Z. All rights reserved.
//
#import "CustomerTopView.h"
@implementation CustomerTopView
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
- (void)cellWithModel:(JavenResellerModel *)model - (void)cellWithModel:(JavenResellerModel *)model
{ {
self.labelPhone.text = model.reseller.name; self.labelPhone.text = model.reseller.name;
self.labelTeamNums.text = [NSString stringWithFormat:@"一级成员(%d)", 2]; //self.labelTeamNums.text = [NSString stringWithFormat:@"一级成员(%d)", 2];
self.labelAmount.text = [NSString stringWithFormat:@"¥%0.2f",model.commission]; self.labelAmount.text = [NSString stringWithFormat:@"¥%0.2f",model.commission];
} }
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center"> <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="168" height="202"/> <rect key="frame" x="0.0" y="0.0" width="168" height="202"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="一级成员(3)" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9UQ-ZX-IV8" customClass="MBLabelWithFontAdapter"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="一级成员" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9UQ-ZX-IV8" customClass="MBLabelWithFontAdapter">
<rect key="frame" x="0.0" y="16" width="168" height="22"/> <rect key="frame" x="0.0" y="16" width="168" height="22"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/> <fontDescription key="fontDescription" type="system" pointSize="18"/>
<color key="textColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
...@@ -22,10 +22,11 @@ ...@@ -22,10 +22,11 @@
<fontDescription key="fontDescription" type="system" pointSize="6"/> <fontDescription key="fontDescription" type="system" pointSize="6"/>
</variation> </variation>
</label> </label>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" verticalCompressionResistancePriority="749" image="team_icon" translatesAutoresizingMaskIntoConstraints="NO" id="Vil-wZ-5TN"> <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalCompressionResistancePriority="749" image="team_icon" translatesAutoresizingMaskIntoConstraints="NO" id="Vil-wZ-5TN">
<rect key="frame" x="37" y="48" width="94" height="77"/> <rect key="frame" x="20" y="48" width="128" height="77"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="90" id="ag5-Ds-Xru"/> <constraint firstAttribute="height" constant="90" id="ag5-Ds-Xru"/>
<constraint firstAttribute="height" relation="lessThanOrEqual" constant="77" id="hkW-5I-rUN"/>
</constraints> </constraints>
<variation key="default"> <variation key="default">
<mask key="constraints"> <mask key="constraints">
...@@ -50,8 +51,8 @@ ...@@ -50,8 +51,8 @@
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="qvP-Dh-9Iw"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="qvP-Dh-9Iw">
<rect key="frame" x="44" y="170" width="80" height="22"/> <rect key="frame" x="44" y="170" width="80" height="22"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="¥12.99" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QVd-gK-ILm"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="¥12.99" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QVd-gK-ILm">
<rect key="frame" x="10" y="0.0" width="60" height="21"/> <rect key="frame" x="10" y="0.0" width="60" height="22"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
...@@ -72,10 +73,12 @@ ...@@ -72,10 +73,12 @@
</view> </view>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints> <constraints>
<constraint firstAttribute="trailing" secondItem="Vil-wZ-5TN" secondAttribute="trailing" constant="20" id="48t-Lh-Uwb"/>
<constraint firstItem="qvP-Dh-9Iw" firstAttribute="top" secondItem="dAd-yS-LSa" secondAttribute="bottom" constant="5" id="5z2-Rk-xGs"/> <constraint firstItem="qvP-Dh-9Iw" firstAttribute="top" secondItem="dAd-yS-LSa" secondAttribute="bottom" constant="5" id="5z2-Rk-xGs"/>
<constraint firstAttribute="trailing" secondItem="dAd-yS-LSa" secondAttribute="trailing" id="6OH-F9-UuD"/> <constraint firstAttribute="trailing" secondItem="dAd-yS-LSa" secondAttribute="trailing" id="6OH-F9-UuD"/>
<constraint firstItem="Vil-wZ-5TN" firstAttribute="top" secondItem="9UQ-ZX-IV8" secondAttribute="bottom" constant="10" id="9IE-NA-PdK"/> <constraint firstItem="Vil-wZ-5TN" firstAttribute="top" secondItem="9UQ-ZX-IV8" secondAttribute="bottom" constant="10" id="9IE-NA-PdK"/>
<constraint firstItem="9UQ-ZX-IV8" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="CDy-0B-L5T"/> <constraint firstItem="9UQ-ZX-IV8" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="CDy-0B-L5T"/>
<constraint firstItem="Vil-wZ-5TN" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="20" id="DJV-bA-amL"/>
<constraint firstItem="9UQ-ZX-IV8" firstAttribute="centerX" secondItem="gTV-IL-0wX" secondAttribute="centerX" id="DQh-zj-Ftt"/> <constraint firstItem="9UQ-ZX-IV8" firstAttribute="centerX" secondItem="gTV-IL-0wX" secondAttribute="centerX" id="DQh-zj-Ftt"/>
<constraint firstAttribute="trailing" secondItem="9UQ-ZX-IV8" secondAttribute="trailing" id="QRa-Bc-d9w"/> <constraint firstAttribute="trailing" secondItem="9UQ-ZX-IV8" secondAttribute="trailing" id="QRa-Bc-d9w"/>
<constraint firstItem="dAd-yS-LSa" firstAttribute="centerX" secondItem="gTV-IL-0wX" secondAttribute="centerX" id="eGV-fi-VMP"/> <constraint firstItem="dAd-yS-LSa" firstAttribute="centerX" secondItem="gTV-IL-0wX" secondAttribute="centerX" id="eGV-fi-VMP"/>
...@@ -83,9 +86,9 @@ ...@@ -83,9 +86,9 @@
<constraint firstItem="Vil-wZ-5TN" firstAttribute="centerX" secondItem="gTV-IL-0wX" secondAttribute="centerX" id="hrh-N3-yQ5"/> <constraint firstItem="Vil-wZ-5TN" firstAttribute="centerX" secondItem="gTV-IL-0wX" secondAttribute="centerX" id="hrh-N3-yQ5"/>
<constraint firstItem="qvP-Dh-9Iw" firstAttribute="centerX" secondItem="gTV-IL-0wX" secondAttribute="centerX" id="inO-P9-3ET"/> <constraint firstItem="qvP-Dh-9Iw" firstAttribute="centerX" secondItem="gTV-IL-0wX" secondAttribute="centerX" id="inO-P9-3ET"/>
<constraint firstItem="dAd-yS-LSa" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="jJ4-Nh-VLs"/> <constraint firstItem="dAd-yS-LSa" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="jJ4-Nh-VLs"/>
<constraint firstItem="dAd-yS-LSa" firstAttribute="top" relation="greaterThanOrEqual" secondItem="Vil-wZ-5TN" secondAttribute="bottom" constant="10" id="u2a-Xe-ZIw"/>
<constraint firstAttribute="bottom" secondItem="qvP-Dh-9Iw" secondAttribute="bottom" constant="10" id="uoA-LK-Pp1"/> <constraint firstAttribute="bottom" secondItem="qvP-Dh-9Iw" secondAttribute="bottom" constant="10" id="uoA-LK-Pp1"/>
<constraint firstItem="9UQ-ZX-IV8" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" constant="16" id="vXA-Uo-Z7y"/> <constraint firstItem="9UQ-ZX-IV8" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" constant="16" id="vXA-Uo-Z7y"/>
<constraint firstItem="dAd-yS-LSa" firstAttribute="top" secondItem="Vil-wZ-5TN" secondAttribute="bottom" constant="20" id="xEe-Sr-XXa"/>
</constraints> </constraints>
<size key="customSize" width="168" height="202"/> <size key="customSize" width="168" height="202"/>
<variation key="default"> <variation key="default">
...@@ -100,7 +103,7 @@ ...@@ -100,7 +103,7 @@
<outlet property="labelTeamNums" destination="9UQ-ZX-IV8" id="y5y-qh-ZHr"/> <outlet property="labelTeamNums" destination="9UQ-ZX-IV8" id="y5y-qh-ZHr"/>
<outlet property="viewAmountBackround" destination="qvP-Dh-9Iw" id="GxS-BJ-U1V"/> <outlet property="viewAmountBackround" destination="qvP-Dh-9Iw" id="GxS-BJ-U1V"/>
</connections> </connections>
<point key="canvasLocation" x="266" y="286"/> <point key="canvasLocation" x="144" y="276"/>
</collectionViewCell> </collectionViewCell>
</objects> </objects>
<resources> <resources>
......
...@@ -11,5 +11,5 @@ ...@@ -11,5 +11,5 @@
@interface MyteamTopView : UIView @interface MyteamTopView : UIView
- (void)setTeamNums:(NSInteger)nums bonus:(CGFloat)bonus; - (void)setTeamNums:(NSNumber *)nums bonus:(NSNumber *)bonus;
@end @end
...@@ -16,10 +16,10 @@ ...@@ -16,10 +16,10 @@
@implementation MyteamTopView @implementation MyteamTopView
- (void)setTeamNums:(NSInteger)nums bonus:(CGFloat)bonus - (void)setTeamNums:(NSNumber *)nums bonus:(NSNumber *)bonus
{ {
self.labelTeamNums.text = [NSString stringWithFormat:@"%lu", nums]; self.labelTeamNums.text = [NSString stringWithFormat:@"%@", nums];
self.labelTeamBonus.text = [NSString stringWithFormat:@"¥%0.2f", bonus]; self.labelTeamBonus.text = [NSString stringWithFormat:@"¥%0.2f", [bonus floatValue]];
} }
/* /*
......
...@@ -11,32 +11,32 @@ ...@@ -11,32 +11,32 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="402"/> <rect key="frame" x="0.0" y="0.0" width="320" height="402"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9kH-LK-wk8"> <view contentMode="scaleToFill" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="9kH-LK-wk8">
<rect key="frame" x="0.0" y="212" width="320" height="138"/> <rect key="frame" x="0.0" y="212" width="320" height="138"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="收货人:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Xru-fq-ja3"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" misplaced="YES" text="收货人:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Xru-fq-ja3">
<rect key="frame" x="45" y="22" width="68" height="21"/> <rect key="frame" x="45" y="22" width="68" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/> <color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="谢德彬" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="J01-8B-y5r"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" misplaced="YES" text="谢德彬" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="J01-8B-y5r">
<rect key="frame" x="115" y="22" width="51" height="21"/> <rect key="frame" x="115" y="22" width="51" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="手机号:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6Vh-Et-vJt"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" misplaced="YES" text="手机号:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6Vh-Et-vJt">
<rect key="frame" x="45" y="51" width="68" height="21"/> <rect key="frame" x="45" y="51" width="68" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/> <color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="18321155536" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="v7R-er-zaD"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" misplaced="YES" text="18321155536" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="v7R-er-zaD">
<rect key="frame" x="115" y="51" width="105" height="21"/> <rect key="frame" x="115" y="51" width="105" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Yca-8a-HcF"> <button opaque="NO" contentMode="scaleToFill" ambiguous="YES" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Yca-8a-HcF">
<rect key="frame" x="262" y="22" width="50" height="50"/> <rect key="frame" x="262" y="22" width="50" height="50"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="50" id="2su-RU-ZJh"/> <constraint firstAttribute="width" constant="50" id="2su-RU-ZJh"/>
...@@ -46,14 +46,14 @@ ...@@ -46,14 +46,14 @@
<action selector="actionCall:" destination="-1" eventType="touchUpInside" id="2Q6-do-hGR"/> <action selector="actionCall:" destination="-1" eventType="touchUpInside" id="2Q6-do-hGR"/>
</connections> </connections>
</button> </button>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleAspectFit" image="icon_order_address" translatesAutoresizingMaskIntoConstraints="NO" id="OeX-RE-d2m"> <imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleAspectFit" ambiguous="YES" misplaced="YES" image="icon_order_address" translatesAutoresizingMaskIntoConstraints="NO" id="OeX-RE-d2m">
<rect key="frame" x="4" y="92" width="30" height="23"/> <rect key="frame" x="4" y="92" width="30" height="23"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="30" id="eth-Xe-EGH"/> <constraint firstAttribute="width" constant="30" id="eth-Xe-EGH"/>
<constraint firstAttribute="height" constant="23" id="yMF-z8-J4m"/> <constraint firstAttribute="height" constant="23" id="yMF-z8-J4m"/>
</constraints> </constraints>
</imageView> </imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="上海市 上海市 闵行区 鹤坡南路55弄2号232室上海市 上海市 闵行区 鹤坡南路55弄2号232室" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rM9-W2-1PT"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" misplaced="YES" text="上海市 上海市 闵行区 鹤坡南路55弄2号232室上海市 上海市 闵行区 鹤坡南路55弄2号232室" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rM9-W2-1PT">
<rect key="frame" x="45" y="76" width="267" height="54"/> <rect key="frame" x="45" y="76" width="267" height="54"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/> <fontDescription key="fontDescription" type="system" pointSize="15"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
...@@ -92,10 +92,10 @@ ...@@ -92,10 +92,10 @@
</mask> </mask>
</variation> </variation>
</view> </view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="kMe-iN-q0b"> <view contentMode="scaleToFill" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="kMe-iN-q0b">
<rect key="frame" x="0.0" y="358" width="320" height="29"/> <rect key="frame" x="0.0" y="358" width="320" height="29"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="商品信息" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nUT-vO-b28"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="商品信息" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nUT-vO-b28">
<rect key="frame" x="15" y="4" width="68" height="21"/> <rect key="frame" x="15" y="4" width="68" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/> <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<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" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="J5p-Wx-HPf"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="待支付" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="J5p-Wx-HPf">
<rect key="frame" x="272" y="18" width="51" height="21"/> <rect key="frame" x="286" y="18" width="51" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
...@@ -45,22 +45,22 @@ ...@@ -45,22 +45,22 @@
<color key="textColor" red="0.63360416669999997" green="0.63360416669999997" blue="0.63360416669999997" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="0.63360416669999997" green="0.63360416669999997" blue="0.63360416669999997" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<view contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="14H-w4-6eU"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="14H-w4-6eU">
<rect key="frame" x="8" y="74" width="315" height="1"/> <rect key="frame" x="8" y="74" width="329" height="1"/>
<color key="backgroundColor" red="0.94901960780000005" green="0.94901960780000005" blue="0.94901960780000005" alpha="1" colorSpace="calibratedRGB"/> <color key="backgroundColor" red="0.94901960780000005" green="0.94901960780000005" blue="0.94901960780000005" alpha="1" colorSpace="calibratedRGB"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="1" id="yeu-SB-vLO"/> <constraint firstAttribute="height" constant="1" id="yeu-SB-vLO"/>
</constraints> </constraints>
</view> </view>
<view contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="7at-Z4-fCe"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="7at-Z4-fCe">
<rect key="frame" x="0.0" y="0.0" width="331" height="10"/> <rect key="frame" x="0.0" y="0.0" width="345" height="10"/>
<color key="backgroundColor" red="0.86666666670000003" green="0.86666666670000003" blue="0.86666666670000003" alpha="1" colorSpace="calibratedRGB"/> <color key="backgroundColor" red="0.86666666670000003" green="0.86666666670000003" blue="0.86666666670000003" alpha="1" colorSpace="calibratedRGB"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="10" id="L0q-yU-oH5"/> <constraint firstAttribute="height" constant="10" id="L0q-yU-oH5"/>
</constraints> </constraints>
</view> </view>
<view contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="NKY-p0-eZH"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="NKY-p0-eZH">
<rect key="frame" x="0.0" y="78" width="331" height="44"/> <rect key="frame" x="0.0" y="100" width="345" height="44"/>
<subviews> <subviews>
<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="NSP-00-fgb"> <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="NSP-00-fgb">
<rect key="frame" x="105" y="15" width="39" height="21"/> <rect key="frame" x="105" y="15" width="39" height="21"/>
...@@ -111,8 +111,8 @@ ...@@ -111,8 +111,8 @@
<constraint firstAttribute="bottom" secondItem="iIr-bn-6Cs" secondAttribute="bottom" constant="8" id="zjJ-zV-2cl"/> <constraint firstAttribute="bottom" secondItem="iIr-bn-6Cs" secondAttribute="bottom" constant="8" id="zjJ-zV-2cl"/>
</constraints> </constraints>
</view> </view>
<button opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ajs-cQ-mp9"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ajs-cQ-mp9">
<rect key="frame" x="158" y="130" width="165" height="39"/> <rect key="frame" x="172" y="152" width="165" height="39"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="216" id="9Dj-0z-J1R"/> <constraint firstAttribute="width" constant="216" id="9Dj-0z-J1R"/>
<constraint firstAttribute="height" constant="39" id="XeW-Ie-n9B"/> <constraint firstAttribute="height" constant="39" id="XeW-Ie-n9B"/>
...@@ -125,8 +125,8 @@ ...@@ -125,8 +125,8 @@
</state> </state>
<variation key="default"> <variation key="default">
<mask key="constraints"> <mask key="constraints">
<exclude reference="rfY-Fy-ksn"/>
<exclude reference="9Dj-0z-J1R"/> <exclude reference="9Dj-0z-J1R"/>
<exclude reference="rfY-Fy-ksn"/>
</mask> </mask>
</variation> </variation>
</button> </button>
...@@ -161,9 +161,9 @@ ...@@ -161,9 +161,9 @@
</constraints> </constraints>
<variation key="default"> <variation key="default">
<mask key="constraints"> <mask key="constraints">
<exclude reference="VNt-rr-aff"/>
<exclude reference="Nmp-Jf-G7O"/> <exclude reference="Nmp-Jf-G7O"/>
<exclude reference="Sn2-4c-1gK"/> <exclude reference="Sn2-4c-1gK"/>
<exclude reference="VNt-rr-aff"/>
<exclude reference="gQj-Wb-5YI"/> <exclude reference="gQj-Wb-5YI"/>
</mask> </mask>
</variation> </variation>
......
...@@ -10,5 +10,7 @@ ...@@ -10,5 +10,7 @@
#import "CommodityListModel/CommotityListModel.h" #import "CommodityListModel/CommotityListModel.h"
@interface CommodityDetailViewController : IBTUIViewController @interface CommodityDetailViewController : IBTUIViewController
@property (nonatomic, strong) CommotityListModel *model; @property (nonatomic, strong) CommotityListModel *model;
@property (nonatomic, strong) UIImage *image;
@end @end
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
[self.view addSubview:self.bottomView]; [self.view addSubview:self.bottomView];
[self.bottomView.buttonShop addTarget:self action:@selector(addCommodity) forControlEvents:UIControlEventTouchUpInside]; [self.bottomView.buttonShop addTarget:self action:@selector(addCommodity) forControlEvents:UIControlEventTouchUpInside];
[self.bottomView.buttonShare addTarget:self action:@selector(shareAction) forControlEvents:UIControlEventTouchUpInside];
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
} }
...@@ -100,6 +101,10 @@ ...@@ -100,6 +101,10 @@
} }
- (void)shareAction {
UserInfo *userInfo = [UserInfo shareInstance];
[[ShareInstance shareInstace] showWithTitle:@"Aland" content:self.model.name url:[NSString stringWithFormat:@"%@Wap/detail/shop_id/%@/id/%@/hastbar/0/.html", userInfo.webShopBaseUrl, userInfo.shop.uuid, self.model.uuid] image:self.image];
}
//隐藏navigationbar //隐藏navigationbar
......
...@@ -216,6 +216,8 @@ ...@@ -216,6 +216,8 @@
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
CommodityDetailViewController *detailVC = [[CommodityDetailViewController alloc] init]; CommodityDetailViewController *detailVC = [[CommodityDetailViewController alloc] init];
detailVC.model = self.arrItemDatas[indexPath.row]; detailVC.model = self.arrItemDatas[indexPath.row];
CommodityListCollectionViewCell *cell = (CommodityListCollectionViewCell *)[collectionView cellForItemAtIndexPath:indexPath];
detailVC.image = cell.imageViewTop.image;
[self.navigationController pushViewController:detailVC animated:YES]; [self.navigationController pushViewController:detailVC animated:YES];
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#import "MoreHotBrandViewController.h" #import "MoreHotBrandViewController.h"
#import "HotCommodityCell.h" #import "HotCommodityCell.h"
#import "CommodityListViewController.h"
#define kHotCellId @"addCommodityCellHot" #define kHotCellId @"addCommodityCellHot"
#define kMargin 0 #define kMargin 0
...@@ -57,6 +57,14 @@ ...@@ -57,6 +57,14 @@
return cell; return cell;
} }
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
CommodityListViewController *commodityVC = [[CommodityListViewController alloc] init];
commodityVC.hidesBottomBarWhenPushed = YES;
commodityVC.isShowNavigationBar = YES;
commodityVC.model = self.arrItems[indexPath.row];
[self.navigationController pushViewController:commodityVC animated:YES];
}
- (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; [super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated. // Dispose of any resources that can be recreated.
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#import "MoreHotTagViewController.h" #import "MoreHotTagViewController.h"
#import "AddCommodityCollectionViewCell.h" #import "AddCommodityCollectionViewCell.h"
#import "CommodityListViewController.h"
#define kCellId @"AddCommodityCollectionViewCell.h" #define kCellId @"AddCommodityCollectionViewCell.h"
#define kMargin 0 #define kMargin 0
...@@ -55,6 +55,14 @@ ...@@ -55,6 +55,14 @@
return cell; return cell;
} }
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
CommodityListViewController *commodityVC = [[CommodityListViewController alloc] init];
commodityVC.hidesBottomBarWhenPushed = YES;
commodityVC.isShowNavigationBar = YES;
commodityVC.model = self.arrItems[indexPath.row];
[self.navigationController pushViewController:commodityVC animated:YES];
}
- (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; [super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated. // Dispose of any resources that can be recreated.
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
@implementation CommodityManagementViewController @implementation CommodityManagementViewController
//跳转添加商品在CommodityManagementTopView里面跳转,注意看一下
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
self.condition = @"shop online only"; self.condition = @"shop online only";
......
...@@ -10,24 +10,79 @@ ...@@ -10,24 +10,79 @@
#import "UITableView+Category.h" #import "UITableView+Category.h"
#import "JavenSortView.h" #import "JavenSortView.h"
#import "CustomerTableViewCell.h" #import "CustomerTableViewCell.h"
#import "JavenCustomer.h"
#import "CustomerViewController.h"
#define kPageSize @10
#define kCellId @"CustomerTableViewCell.h" #define kCellId @"CustomerTableViewCell.h"
@interface CustomerManagementViewController ()<UISearchBarDelegate, UITableViewDelegate, UITableViewDataSource> @interface CustomerManagementViewController ()<UISearchBarDelegate, UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) UISearchBar *searchBar; @property (nonatomic, strong) UISearchBar *searchBar;
@property (nonatomic, strong) UITableView *tableView; @property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) JavenSortView *sortView; @property (nonatomic, strong) JavenSortView *sortView;
@property (nonatomic, strong) NSMutableArray *arrCellData;
@property (nonatomic, copy) NSString *field; //排序的字段
@property (nonatomic, copy) NSString *direction; //排序的顺序 升序或降序
@end @end
@implementation CustomerManagementViewController @implementation CustomerManagementViewController
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
self.field = @"commission";
self.direction = @"desc";
self.view.backgroundColor = kBacroundColor; self.view.backgroundColor = kBacroundColor;
[self setUpSearchBar]; [self setUpSearchBar];
[self setUpSortView]; [self setUpSortView];
[self setUptableView]; [self setUptableView];
[self setUpData];
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
} }
- (NSMutableArray *)arrCellData {
if (!_arrCellData) {
_arrCellData = [NSMutableArray array];
}
return _arrCellData;
}
- (void)setUpData {
NSDictionary *params = @{@"defintion" : @{@"conditions" : @[@{@"operation" : @"domain equals",
@"parameter" : @{@"operation" : @"string"},
@"parameters" : @[[UserInfo shareInstance].domain]},
@{@"operation" : @"reseller uuid equals",
@"parameter" : @{@"operation" : @"string"},
@"parameters" : @[[UserInfo shareInstance].uuid]}],
@"orders" : @[@{@"field" : self.field,
@"direction" : self.direction}],
@"pageSize" : kPageSize,
@"page" : @0,
@"probePages" : @0},
@"fetchParts" : @[@"string"]};
WS(weakSelf)
[[HTTPCilent shareCilent] POST:@"reseller/customer/query" parameters:params success:^(NSURLSessionDataTask *task, id responseObject) {
if ([responseObject[@"code"] isEqualToNumber:@0]) {
for (NSDictionary *dic in responseObject[@"queryResult"]) {
JavenCustomer *customer = [JavenCustomer modelObjectWithDictionary:dic];
[weakSelf.arrCellData addObject:customer];
}
[weakSelf.tableView reloadData];
}else{
}
} failure:^(NSURLSessionDataTask *task, NSError *error) {
}];
}
- (void)setUpSearchBar { - (void)setUpSearchBar {
UIView *titleView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kWidth - 60, 35)];//allocate titleView UIView *titleView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kWidth - 60, 35)];//allocate titleView
UIColor *color = self.navigationController.navigationBar.barTintColor; UIColor *color = self.navigationController.navigationBar.barTintColor;
...@@ -51,9 +106,88 @@ ...@@ -51,9 +106,88 @@
self.sortView = [JavenSortView sortViewLeftTitles:arrLeftTitles rightTitles:arrRightTitles]; self.sortView = [JavenSortView sortViewLeftTitles:arrLeftTitles rightTitles:arrRightTitles];
self.sortView.frame = CGRectMake(0, 0, kWidth, 40); self.sortView.frame = CGRectMake(0, 0, kWidth, 40);
[self.view addSubview:self.sortView]; [self.view addSubview:self.sortView];
WS(weakSelf)
_sortView.leftTableSelect = ^(NSInteger row){
[weakSelf leftSortAction:row];
CLog(@"%ld", (long)row);
};
_sortView.rightTableSelect = ^(NSInteger row){
[weakSelf rightSortAction:row];
};
}
- (void)rightSortAction:(NSInteger)row {
switch (row) {
case 0:
{
self.field = @"commission";
self.direction = @"desc";
}
break;
case 1://订单数 高-低
{
self.field = @"order count";
self.direction = @"desc";
}
break;
case 2://收入 高-低
{
self.field = @"commission";
self.direction = @"desc";
}
break;
default:
break;
}
[self resetReloadData];
}
//排序
- (void)leftSortAction:(NSInteger)row {
switch (row) {
case 0:
{
self.field = @"commission";
self.direction = @"desc";
}
break;
case 1://价格 高-低
{
self.field = @"consumer create time";
NSDateFormatter *f = [[NSDateFormatter alloc] init];
[f setDateFormat:@"yyyy-MM-dd"];
NSString *dateStr = [f stringFromDate:[NSDate date]];
NSString *appendStr = [dateStr stringByAppendingString:@" 00:00:00"];
self.direction = appendStr;
}
break;
case 2://价格 低-高
{
self.field = @" spec price";
self.direction = @"asc";
}
break;
default:
break;
}
[self resetReloadData];
} }
//改变排序条件之后重新请求数据
- (void)resetReloadData {
[self.arrCellData removeAllObjects];
[self setUpData];
}
- (void)setUptableView { - (void)setUptableView {
self.tableView = [UITableView plainTableViewWithTarget:self cellNibName:@"CustomerTableViewCell" cellId:kCellId]; self.tableView = [UITableView plainTableViewWithTarget:self cellNibName:@"CustomerTableViewCell" cellId:kCellId];
...@@ -64,18 +198,27 @@ ...@@ -64,18 +198,27 @@
#pragma mark =========== tableview delegate =========== #pragma mark =========== tableview delegate ===========
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{ {
return 10; return self.arrCellData.count;
} }
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{ {
CustomerTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellId forIndexPath:indexPath]; CustomerTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellId forIndexPath:indexPath];
[cell cellwithModel:self.arrCellData[indexPath.row]];
return cell; return cell;
} }
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{ {
return kAutoValue(110); return 110;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
CustomerViewController *customerVC = [[CustomerViewController alloc] init];
customerVC.isShowNavigationBar = NO;
[self.navigationController pushViewController:customerVC animated:YES];
} }
#pragma mark =========== searchbar delegate =========== #pragma mark =========== searchbar delegate ===========
......
//
// CustomerViewController.h
// ALand
//
// Created by Z on 16/4/28.
// Copyright © 2016年 Z. All rights reserved.
//
#import "IBTUIViewController.h"
@interface CustomerViewController : IBTUIViewController
@end
//
// CustomerViewController.m
// ALand
//
// Created by Z on 16/4/28.
// Copyright © 2016年 Z. All rights reserved.
//
#import "CustomerViewController.h"
#import "CustomerTopView.h"
@interface CustomerViewController ()
@property (nonatomic, strong) CustomerTopView *topView;
@end
@implementation CustomerViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self setUpTopView];
// Do any additional setup after loading the view from its nib.
}
- (void)setUpTopView{
self.topView = [CustomerTopView viewWithNibName:@"CustomerTopView"];
self.topView.frame = CGRectMake(0, 0, kWidth, 291);
[self.view addSubview:self.topView];
}
- (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
...@@ -18,6 +18,12 @@ ...@@ -18,6 +18,12 @@
[super viewDidLoad]; [super viewDidLoad];
// Do any additional setup after loading the view from its nib. // Do any additional setup after loading the view from its nib.
} }
- (IBAction)invitePartner:(id)sender {
NSString *urlStr = [NSString stringWithFormat:@"%@ShopUser/gpregister/invitationCode/%@.html", [UserInfo shareInstance].webShopBaseUrl, [UserInfo shareInstance].invitationCode];
[[ShareInstance shareInstace] showWithTitle:@"Aland" content:@"大伙加入,共同致富!" url:urlStr image:[UIImage imageNamed:@"Camera"]];
}
- (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; [super didReceiveMemoryWarning];
......
...@@ -32,6 +32,9 @@ ...@@ -32,6 +32,9 @@
<exclude reference="L0k-pB-2Td"/> <exclude reference="L0k-pB-2Td"/>
</mask> </mask>
</variation> </variation>
<connections>
<action selector="invitePartner:" destination="-1" eventType="touchUpInside" id="ga3-Mi-vZP"/>
</connections>
</button> </button>
</subviews> </subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
@interface MyTeamViewController ()<UICollectionViewDelegate, UICollectionViewDataSource> @interface MyTeamViewController ()<UICollectionViewDelegate, UICollectionViewDataSource>
@property (nonatomic, strong) UICollectionView *collectionView; @property (nonatomic, strong) UICollectionView *collectionView;
@property (nonatomic, strong) NSMutableArray *arrData; @property (nonatomic, strong) NSMutableArray *arrData;
@property (nonatomic, strong) MyteamTopView *topView;
@end @end
@implementation MyTeamViewController @implementation MyTeamViewController
...@@ -24,6 +26,7 @@ ...@@ -24,6 +26,7 @@
self.arrData = [NSMutableArray array]; self.arrData = [NSMutableArray array];
self.navigationItem.title = @"我的团队"; self.navigationItem.title = @"我的团队";
[self setUpCollectionView]; [self setUpCollectionView];
[self setUpTotalData];
[self setUpData]; [self setUpData];
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
} }
...@@ -33,7 +36,7 @@ ...@@ -33,7 +36,7 @@
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.minimumInteritemSpacing = 0; layout.minimumInteritemSpacing = 0;
layout.minimumLineSpacing = 1; layout.minimumLineSpacing = 1;
layout.itemSize = CGSizeMake(kWidth / 3, kWidth * 2 / 3); layout.itemSize = CGSizeMake(kWidth / 3, kAutoValue(200));
self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, kWidth, kHeight - 64) collectionViewLayout:layout]; self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, kWidth, kHeight - 64) collectionViewLayout:layout];
self.collectionView.contentInset = UIEdgeInsetsMake(140, 0, 0, 0); self.collectionView.contentInset = UIEdgeInsetsMake(140, 0, 0, 0);
self.collectionView.backgroundColor = kBacroundColor; self.collectionView.backgroundColor = kBacroundColor;
...@@ -45,6 +48,21 @@ ...@@ -45,6 +48,21 @@
[self setUpTopView]; [self setUpTopView];
} }
- (void)setUpTotalData {
WS(weakSelf)
[[HTTPCilent shareCilent] GET:[NSString stringWithFormat:@"reseller/team/getTeamInfo/%@", [UserInfo shareInstance].uuid] parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
NSNumber *teamNums = responseObject[@"memberCount"];
NSNumber *bonus = responseObject[@"commissionTotal"];
[weakSelf.topView setTeamNums:teamNums bonus:bonus];
} failure:^(NSURLSessionDataTask *task, NSError *error) {
}];
}
- (void)setUpData { - (void)setUpData {
...@@ -78,6 +96,7 @@ ...@@ -78,6 +96,7 @@
- (void)setUpTopView { - (void)setUpTopView {
MyteamTopView *topView = [MyteamTopView viewWithNibName:@"MyTeamTopView"]; MyteamTopView *topView = [MyteamTopView viewWithNibName:@"MyTeamTopView"];
self.topView = topView;
topView.frame = CGRectMake(0, -140 + 20, kWidth, 100); topView.frame = CGRectMake(0, -140 + 20, kWidth, 100);
[self.collectionView addSubview:topView]; [self.collectionView addSubview:topView];
} }
......
...@@ -19,8 +19,11 @@ ...@@ -19,8 +19,11 @@
@property (nonatomic, strong) SelectPhotoView *photoView; @property (nonatomic, strong) SelectPhotoView *photoView;
@property (nonatomic, strong) CoverShadowView *shadowView; @property (nonatomic, strong) CoverShadowView *shadowView;
@property (nonatomic, strong) JavenShopModel *shopModel; @property (nonatomic, strong) JavenShopModel *shopModel;
@property (weak, nonatomic) IBOutlet UIButton *buttonBac;
@property (weak, nonatomic) IBOutlet UILabel *labelName; @property (weak, nonatomic) IBOutlet UILabel *labelName;
@property (weak, nonatomic) IBOutlet UILabel *labelDescription; @property (weak, nonatomic) IBOutlet UILabel *labelDescription;
@property (nonatomic, copy) NSString *urlStr;
@end @end
...@@ -28,6 +31,9 @@ ...@@ -28,6 +31,9 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
self.buttonBac.imageView.contentMode = UIViewContentModeScaleAspectFit;
UserInfo *userInfo = [UserInfo shareInstance];
self.urlStr = [NSString stringWithFormat:@"%@Wap/index_shop/shop_id/%@.html", userInfo.webShopBaseUrl, userInfo.shop.uuid];
// Do any additional setup after loading the view from its nib. // Do any additional setup after loading the view from its nib.
} }
...@@ -138,14 +144,14 @@ ...@@ -138,14 +144,14 @@
} }
- (IBAction)actionShare:(id)sender { - (IBAction)actionShare:(id)sender {
[[ShareInstance shareInstace] showWithTitle:@"" content:@"" url:@""]; [[ShareInstance shareInstace] showWithTitle:@"Aland" content:@"快来看看我的小店吧! " url:self.urlStr image:[UIImage imageNamed:@"btn_share_shop"]];
} }
- (IBAction)QRCodeAction:(id)sender { - (IBAction)QRCodeAction:(id)sender {
StoreQRCodeViewController *QRCodeVC = [[StoreQRCodeViewController alloc] initWithNibName:@"StoreQRCodeViewController" bundle:nil]; StoreQRCodeViewController *QRCodeVC = [[StoreQRCodeViewController alloc] initWithNibName:@"StoreQRCodeViewController" bundle:nil];
QRCodeVC.urlStr = self.urlStr;
[self.navigationController pushViewController:QRCodeVC animated:YES]; [self.navigationController pushViewController:QRCodeVC animated:YES];
} }
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="StoreManagermentViewController"> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="StoreManagermentViewController">
<connections> <connections>
<outlet property="buttonBac" destination="Iih-6D-NVq" id="Qaj-ot-Ynu"/>
<outlet property="labelDescription" destination="asy-i8-hFm" id="Zdn-05-Att"/> <outlet property="labelDescription" destination="asy-i8-hFm" id="Zdn-05-Att"/>
<outlet property="labelName" destination="R3l-SJ-mVe" id="N6s-z3-sA1"/> <outlet property="labelName" destination="R3l-SJ-mVe" id="N6s-z3-sA1"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
...@@ -76,10 +77,10 @@ ...@@ -76,10 +77,10 @@
</variation> </variation>
</imageView> </imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Iih-6D-NVq"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Iih-6D-NVq">
<rect key="frame" x="12" y="20" width="12" height="40"/> <rect key="frame" x="12" y="20" width="10" height="40"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="40" id="7JS-ak-NAa"/> <constraint firstAttribute="height" constant="40" id="7JS-ak-NAa"/>
<constraint firstAttribute="width" constant="12" id="CPa-fC-cp8"/> <constraint firstAttribute="width" constant="10" id="CPa-fC-cp8"/>
</constraints> </constraints>
<state key="normal" image="bac"/> <state key="normal" image="bac"/>
<connections> <connections>
......
...@@ -9,5 +9,6 @@ ...@@ -9,5 +9,6 @@
#import "IBTUIViewController.h" #import "IBTUIViewController.h"
@interface StoreQRCodeViewController : IBTUIViewController @interface StoreQRCodeViewController : IBTUIViewController
@property (nonatomic, copy) NSString *urlStr;
@end @end
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#import "UIImage+QRCode.h" #import "UIImage+QRCode.h"
@interface StoreQRCodeViewController () @interface StoreQRCodeViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *imageViewQRCode; @property (weak, nonatomic) IBOutlet UIImageView *imageViewQRCode;
@property (weak, nonatomic) IBOutlet UIButton *buttonSave;
@end @end
...@@ -18,7 +19,7 @@ ...@@ -18,7 +19,7 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
UIImage *qrcode = [UIImage createNonInterpolatedUIImageFormCIImage:[UIImage createQRForString:@"http://list.jd.hk/list.html?cat=1319%2C1527%2C1556&gjz=0&go=0"] withSize:250.0f]; UIImage *qrcode = [UIImage createNonInterpolatedUIImageFormCIImage:[UIImage createQRForString:self.urlStr] withSize:250.0f];
UIImage *customQrcode = [UIImage imageBlackToTransparent:qrcode withRed:60.0f andGreen:74.0f andBlue:89.0f]; UIImage *customQrcode = [UIImage imageBlackToTransparent:qrcode withRed:60.0f andGreen:74.0f andBlue:89.0f];
self.imageViewQRCode.image = customQrcode; self.imageViewQRCode.image = customQrcode;
// set shadow // set shadow
...@@ -33,26 +34,41 @@ ...@@ -33,26 +34,41 @@
[super viewWillAppear:animated]; [super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:NO animated:YES]; [self.navigationController setNavigationBarHidden:NO animated:YES];
} }
- (IBAction)actionSafeToAlbum:(id)sender {
#pragma mark =========== actions ===========
//保存到相册
- (IBAction)actionSafeToAlbum:(id)sender {
self.buttonSave.userInteractionEnabled = NO; //防止多次点击
UIImageWriteToSavedPhotosAlbum( self.imageViewQRCode.image, self, @selector(image:didFinishSavingWithError:contextInfo:) , nil ) ; UIImageWriteToSavedPhotosAlbum( self.imageViewQRCode.image, self, @selector(image:didFinishSavingWithError:contextInfo:) , nil ) ;
} }
//分享
- (IBAction)actionShare:(id)sender { - (IBAction)actionShare:(id)sender {
[[ShareInstance shareInstace] showWithTitle:@"Aland" content:@"快来看看我的小店吧! " url:self.urlStr image:[UIImage imageNamed:@"btn_share_shop"]];
} }
- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error - (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error
contextInfo:(void *)contextInfo contextInfo:(void *)contextInfo
{ {
// Was there an error? // Was there an error?
if (error != NULL) if (error != NULL)
{ {
// Show error message…
WS(weakSelf);
[MBProgressHUD Javen_showError:@"保存失败!" onView:self.view delay:0.4 complete:^{
weakSelf.buttonSave.userInteractionEnabled = YES;
}];
} }
else // No errors else // No errors
{ {
[MBProgressHUD Javen_showSuccess:@"保存成功!" onView:self.view delay:0.4 complete:nil];
WS(weakSelf)
[MBProgressHUD Javen_showSuccess:@"保存成功!" onView:self.view delay:0.4 complete:^{
weakSelf.buttonSave.userInteractionEnabled = YES;
}];
// Show message image successfully saved // Show message image successfully saved
} }
} }
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="StoreQRCodeViewController"> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="StoreQRCodeViewController">
<connections> <connections>
<outlet property="buttonSave" destination="ViK-KX-ySY" id="i2F-nS-h87"/>
<outlet property="imageViewQRCode" destination="bLf-3W-zks" id="Pe9-9O-ccv"/> <outlet property="imageViewQRCode" destination="bLf-3W-zks" id="Pe9-9O-ccv"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections> </connections>
...@@ -16,24 +17,24 @@ ...@@ -16,24 +17,24 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/> <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="RFH-hd-LUV"> <view contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="RFH-hd-LUV">
<rect key="frame" x="0.0" y="0.0" width="375" height="349"/> <rect key="frame" x="0.0" y="0.0" width="375" height="349"/>
<subviews> <subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="erweima_结果" translatesAutoresizingMaskIntoConstraints="NO" id="bLf-3W-zks"> <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" image="erweima_结果" translatesAutoresizingMaskIntoConstraints="NO" id="bLf-3W-zks">
<rect key="frame" x="67" y="0.0" width="241" height="349"/> <rect key="frame" x="50" y="50" width="275" height="249"/>
</imageView> </imageView>
</subviews> </subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints> <constraints>
<constraint firstItem="bLf-3W-zks" firstAttribute="top" secondItem="RFH-hd-LUV" secondAttribute="top" id="FAS-oh-mxh"/> <constraint firstItem="bLf-3W-zks" firstAttribute="top" secondItem="RFH-hd-LUV" secondAttribute="top" constant="50" id="FAS-oh-mxh"/>
<constraint firstAttribute="trailing" secondItem="bLf-3W-zks" secondAttribute="trailing" constant="67" id="QLR-Uf-j7Q"/> <constraint firstAttribute="trailing" secondItem="bLf-3W-zks" secondAttribute="trailing" constant="50" id="QLR-Uf-j7Q"/>
<constraint firstAttribute="height" constant="349" id="WbD-h8-Yh2"/> <constraint firstAttribute="height" relation="lessThanOrEqual" constant="349" id="WbD-h8-Yh2"/>
<constraint firstItem="bLf-3W-zks" firstAttribute="leading" secondItem="RFH-hd-LUV" secondAttribute="leading" constant="67" id="cZa-Uc-k0N"/> <constraint firstItem="bLf-3W-zks" firstAttribute="leading" secondItem="RFH-hd-LUV" secondAttribute="leading" constant="50" id="cZa-Uc-k0N"/>
<constraint firstAttribute="bottom" secondItem="bLf-3W-zks" secondAttribute="bottom" id="myM-YP-fkq"/> <constraint firstAttribute="bottom" secondItem="bLf-3W-zks" secondAttribute="bottom" constant="50" id="myM-YP-fkq"/>
</constraints> </constraints>
</view> </view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ViK-KX-ySY"> <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"/> <rect key="frame" x="32" y="446" width="311" height="44"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="44" id="ANx-UQ-dVE"/> <constraint firstAttribute="height" constant="44" id="ANx-UQ-dVE"/>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="44" id="eiq-IS-QP5"/> <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="44" id="eiq-IS-QP5"/>
...@@ -53,7 +54,7 @@ ...@@ -53,7 +54,7 @@
</connections> </connections>
</button> </button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="x2U-B2-ts9"> <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"/> <rect key="frame" x="32" y="523" width="311" height="44"/>
<constraints> <constraints>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="44" id="7VW-Yx-INi"/> <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="44" id="7VW-Yx-INi"/>
<constraint firstAttribute="height" constant="44" id="CNC-hG-yQj"/> <constraint firstAttribute="height" constant="44" id="CNC-hG-yQj"/>
...@@ -80,16 +81,17 @@ ...@@ -80,16 +81,17 @@
<constraints> <constraints>
<constraint firstItem="RFH-hd-LUV" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="1wK-iV-EeW"/> <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="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 firstAttribute="trailing" secondItem="x2U-B2-ts9" secondAttribute="trailing" constant="32" id="D41-F6-h4Z"/>
<constraint firstAttribute="bottom" secondItem="x2U-B2-ts9" secondAttribute="bottom" constant="100" id="GMU-tK-lNb"/>
<constraint firstItem="RFH-hd-LUV" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="MIA-sU-jn5"/> <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 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="trailing" secondItem="RFH-hd-LUV" secondAttribute="trailing" id="YtN-QY-ief"/>
<constraint firstItem="ViK-KX-ySY" firstAttribute="top" relation="greaterThanOrEqual" secondItem="RFH-hd-LUV" secondAttribute="bottom" constant="10" id="hLf-P3-L8E"/>
<constraint firstItem="x2U-B2-ts9" firstAttribute="top" secondItem="ViK-KX-ySY" secondAttribute="bottom" constant="33" id="qvg-XY-VxV"/> <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"/> <constraint firstAttribute="trailing" secondItem="ViK-KX-ySY" secondAttribute="trailing" constant="32" id="u1j-6W-nJr"/>
</constraints> </constraints>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina47"/> <simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina47"/>
<point key="canvasLocation" x="286.5" y="386.5"/> <point key="canvasLocation" x="68.5" y="460.5"/>
</view> </view>
</objects> </objects>
<resources> <resources>
......
...@@ -44,20 +44,21 @@ ...@@ -44,20 +44,21 @@
//本地已有密码时登录 //本地已有密码时登录
- (void)defaultLoginAction { - (void)defaultLoginAction {
BaseViewController *baseVC = [[BaseViewController alloc] init];
baseVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; // BaseViewController *baseVC = [[BaseViewController alloc] init];
[self presentViewController:baseVC animated:YES completion:nil]; // baseVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
// [self presentViewController:baseVC animated:YES completion:nil];
if ([[NSUserDefaults standardUserDefaults] objectForKey:@"passWord"]) { if ([[NSUserDefaults standardUserDefaults] objectForKey:@"passWord"]) {
NSDictionary *paramers = @{@"domain":kDomain, NSDictionary *params = @{@"domain":kDomain,
@"loginName":[[NSUserDefaults standardUserDefaults] objectForKey:@"userName"] , @"loginName":[[NSUserDefaults standardUserDefaults] objectForKey:@"userName"] ,
@"password":[[NSUserDefaults standardUserDefaults] objectForKey:@"passWord"], @"password":[[NSUserDefaults standardUserDefaults] objectForKey:@"passWord"],
@"rememberMe":@"true"}; @"rememberMe":@"true"};
[MBProgressHUD showHUDAddedTo:self.view animated:YES]; [MBProgressHUD showHUDAddedTo:self.view animated:YES];
WS(weakSelf) WS(weakSelf)
[[HTTPCilent shareCilent] POST:@"app/resellerLogin" parameters:paramers success:^(NSURLSessionDataTask *task, id responseObject) { [[HTTPCilent shareCilent] POST:@"app/resellerLogin" parameters:params success:^(NSURLSessionDataTask *task, id responseObject) {
[MBProgressHUD hideHUDForView:self.view animated:YES]; [MBProgressHUD hideHUDForView:self.view animated:YES];
...@@ -67,11 +68,13 @@ ...@@ -67,11 +68,13 @@
[info UserInfoWithDictionary:responseObject[@"reseller"]]; [info UserInfoWithDictionary:responseObject[@"reseller"]];
info.webShopBaseUrl = responseObject[@"appConfig"][@"webShopBaseUrl"]; info.webShopBaseUrl = responseObject[@"appConfig"][@"webShopBaseUrl"];
BaseViewController *baseVC = [[BaseViewController alloc] init]; BaseViewController *baseVC = [[BaseViewController alloc] init];
baseVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; baseVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[weakSelf presentViewController:baseVC animated:YES completion:nil]; [weakSelf presentViewController:baseVC animated:YES completion:nil];
}else{ }else{
[[NSUserDefaults standardUserDefaults] setObject:nil forKey:@"passWord"]; [[NSUserDefaults standardUserDefaults] setObject:nil forKey:@"passWord"];
[MBProgressHUD Javen_showError:responseObject[@"message"] onView:weakSelf.view delay:2 complete:nil]; [MBProgressHUD Javen_showError:responseObject[@"message"] onView:weakSelf.view delay:2 complete:nil];
} }
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#import "MineViewController.h" #import "MineViewController.h"
#import "SettingViewController.h" #import "SettingViewController.h"
#import "MyAcountViewController.h"
@interface MineViewController () @interface MineViewController ()
@end @end
...@@ -20,10 +21,16 @@ ...@@ -20,10 +21,16 @@
} }
- (IBAction)myAcount:(id)sender { - (IBAction)myAcount:(id)sender {
CLog(@"myAcount"); CLog(@"myAcount");
MyAcountViewController *acountVC = [[MyAcountViewController alloc] init];
acountVC.isShowNavigationBar = NO;
[self.navigationController pushViewController:acountVC animated:YES];
} }
- (IBAction)actionSetting:(id)sender { - (IBAction)actionSetting:(id)sender {
SettingViewController *settingVC = [[SettingViewController alloc] init]; SettingViewController *settingVC = [[SettingViewController alloc] init];
settingVC.isShowNavigationBar = YES; settingVC.isShowNavigationBar = YES;
settingVC.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:settingVC animated:YES]; [self.navigationController pushViewController:settingVC animated:YES];
} }
......
//
// MyAcountViewController.h
// ALand
//
// Created by Z on 16/4/28.
// Copyright © 2016年 Z. All rights reserved.
//
#import "IBTUIViewController.h"
@interface MyAcountViewController : IBTUIViewController
@end
//
// MyAcountViewController.m
// ALand
//
// Created by Z on 16/4/28.
// Copyright © 2016年 Z. All rights reserved.
//
#import "MyAcountViewController.h"
@interface MyAcountViewController ()
@end
@implementation MyAcountViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
}
- (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
This diff is collapsed.
...@@ -9,6 +9,9 @@ ...@@ -9,6 +9,9 @@
#import "SettingViewController.h" #import "SettingViewController.h"
@interface SettingViewController () @interface SettingViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *imageViewIcon;
@property (weak, nonatomic) IBOutlet UILabel *signature;//个性签名
@property (weak, nonatomic) IBOutlet UILabel *phoneNumber;
@end @end
...@@ -16,6 +19,9 @@ ...@@ -16,6 +19,9 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
NSString *cutPhoneNumber = [[UserInfo shareInstance].mobilephone substringWithRange:NSMakeRange(7, 4)];
self.phoneNumber.text = [NSString stringWithFormat:@"手机号码(%@)", cutPhoneNumber];
self.title = @"设置";
// Do any additional setup after loading the view from its nib. // Do any additional setup after loading the view from its nib.
} }
- (IBAction)loginOut:(id)sender { - (IBAction)loginOut:(id)sender {
......
...@@ -150,6 +150,7 @@ ...@@ -150,6 +150,7 @@
[hud show:YES]; [hud show:YES];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(time * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(time * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self hideHUDForView:view animated:YES]; [self hideHUDForView:view animated:YES];
if (complete) { if (complete) {
......
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
@property (nonatomic, copy) NSString *title; @property (nonatomic, copy) NSString *title;
@property (nonatomic, copy) NSString *url; @property (nonatomic, copy) NSString *url;
@property (nonatomic, copy) NSString *content; @property (nonatomic, copy) NSString *content;
@property (nonatomic, strong) UIImage *image;
@end @end
...@@ -15,13 +15,23 @@ ...@@ -15,13 +15,23 @@
- (IBAction)shareToWeiChatSession:(id)sender { - (IBAction)shareToWeiChatSession:(id)sender {
[UMSocialData defaultData].extConfig.wechatSessionData.url = self.url; [UMSocialData defaultData].extConfig.wechatSessionData.url = self.url;
[UMSocialData defaultData].extConfig.wechatSessionData.title = self.title; [UMSocialData defaultData].extConfig.wechatSessionData.title = self.title;
[[UMSocialDataService defaultDataService] postSNSWithTypes:@[UMShareToWechatSession] content:self.content image:[UIImage imageNamed:@"add_commodityIcon0"] location:nil urlResource:nil presentedController:nil completion:^(UMSocialResponseEntity *response){ [[UMSocialDataService defaultDataService] postSNSWithTypes:@[UMShareToWechatSession] content:self.content image:self.image location:nil urlResource:nil presentedController:nil completion:^(UMSocialResponseEntity *response){
if (response.responseCode == UMSResponseCodeSuccess) { if (response.responseCode == UMSResponseCodeSuccess) {
NSLog(@"分享成功!"); NSLog(@"分享成功!");
} }
}]; }];
} }
- (IBAction)shareWxTimeLine:(id)sender {
[UMSocialData defaultData].extConfig.wechatTimelineData.url = self.url;
[UMSocialData defaultData].extConfig.wechatTimelineData.title = self.content;
[[UMSocialDataService defaultDataService] postSNSWithTypes:@[UMShareToWechatTimeline] content:self.content image:self.image location:nil urlResource:nil presentedController:nil completion:^(UMSocialResponseEntity *response){
if (response.responseCode == UMSResponseCodeSuccess) {
NSLog(@"分享成功!");
}
}];
}
- (IBAction)shareToWeiChatTimeLine:(id)sender { - (IBAction)shareToWeiChatTimeLine:(id)sender {
} }
......
...@@ -89,6 +89,7 @@ ...@@ -89,6 +89,7 @@
<rect key="frame" x="0.0" y="0.0" width="80" height="140"/> <rect key="frame" x="0.0" y="0.0" width="80" height="140"/>
<connections> <connections>
<action selector="shareToWeiChatTimeLine:" destination="iN0-l3-epB" eventType="touchUpInside" id="YUs-vP-14q"/> <action selector="shareToWeiChatTimeLine:" destination="iN0-l3-epB" eventType="touchUpInside" id="YUs-vP-14q"/>
<action selector="shareWxTimeLine:" destination="iN0-l3-epB" eventType="touchUpInside" id="i9L-NL-xpZ"/>
</connections> </connections>
</button> </button>
</subviews> </subviews>
......
...@@ -11,5 +11,5 @@ ...@@ -11,5 +11,5 @@
@interface ShareInstance : NSObject @interface ShareInstance : NSObject
+ (ShareInstance *)shareInstace; + (ShareInstance *)shareInstace;
- (void)showWithTitle:(NSString *)title content:(NSString *)content url:(NSString *)url; - (void)showWithTitle:(NSString *)title content:(NSString *)content url:(NSString *)url image:(UIImage *)image;
@end @end
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
return instance; return instance;
} }
- (void)showWithTitle:(NSString *)title content:(NSString *)content url:(NSString *)url { - (void)showWithTitle:(NSString *)title content:(NSString *)content url:(NSString *)url image:(UIImage *)image{
[self.cover show]; [self.cover show];
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
self.shareContentView.title = title; self.shareContentView.title = title;
self.shareContentView.content = content; self.shareContentView.content = content;
self.shareContentView.url = url; self.shareContentView.url = url;
self.shareContentView.image = image;
[MyTools animateFromBottomDuration:0.5 view:self.shareContentView viewHeight:140]; [MyTools animateFromBottomDuration:0.5 view:self.shareContentView viewHeight:140];
} }
......
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