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 @@
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="226" height="75"/>
<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"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<textInputTraits key="textInputTraits"/>
</textField>
</subviews>
......
......@@ -11,6 +11,8 @@
typedef void (^addSuccessBlock)(void);
@interface CommodityListCollectionViewCell : UICollectionViewCell
@property (weak, nonatomic) IBOutlet UIImageView *imageViewTop;
@property (weak, nonatomic) IBOutlet UILabel *labelRealPrice;
@property (weak, nonatomic) IBOutlet UILabel *labelSalePrice;
@property (nonatomic, copy) addSuccessBlock successBlock;
......
......@@ -11,7 +11,6 @@
#import "addCommodityRequestModel.h"
#import "MBLabelWithFontAdapter.h"
@interface CommodityListCollectionViewCell ()
@property (weak, nonatomic) IBOutlet UIImageView *imageViewTop;
@property (weak, nonatomic) IBOutlet MBLabelWithFontAdapter *labelTitle;
@property (weak, nonatomic) IBOutlet UILabel *labelPrice;
@property (weak, nonatomic) IBOutlet UILabel *labelOriginalPrice;
......@@ -19,6 +18,7 @@
@property (weak, nonatomic) IBOutlet MBLabelWithFontAdapter *labelBrokerageRate; //佣金
@property (weak, nonatomic) IBOutlet UILabel *labelSalesVolume; //销量
@end
@implementation CommodityListCollectionViewCell
......@@ -33,51 +33,14 @@
self.labelTitle.text = model.name;
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) {
}];
}
- (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];
- (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)awakeFromNib {
// Initialization code
}
......
......@@ -57,6 +57,9 @@
<constraint firstAttribute="width" constant="22" id="yua-IV-f6J"/>
</constraints>
<state key="normal" image="commodityShare"/>
<connections>
<action selector="shareAction:" destination="gTV-IL-0wX" eventType="touchUpInside" id="uXk-3N-njR"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" 佣金:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="i9h-vh-UNx">
<rect key="frame" x="1" y="12" width="45" height="20"/>
......
......@@ -41,7 +41,7 @@
[self hideSortView];
AddCommodityViewController *addVC = [[AddCommodityViewController alloc] init];
addVC.hidesBottomBarWhenPushed = YES;
addVC.isShowNavigationBar = YES;
[[self viewController].navigationController pushViewController:addVC animated:YES];
......
......@@ -14,7 +14,7 @@
<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"/>
<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"/>
</state>
<connections>
......@@ -24,7 +24,7 @@
<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"/>
<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"/>
</state>
<connections>
......@@ -59,6 +59,7 @@
</button>
</objects>
<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>
</document>
......@@ -7,7 +7,8 @@
//
#import <UIKit/UIKit.h>
#import "JavenCustomer.h"
@interface CustomerTableViewCell : UITableViewCell
- (void)cellwithModel:(JavenCustomer *)model;
@end
......@@ -7,13 +7,25 @@
//
#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
- (void)awakeFromNib {
// 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 {
[super setSelected:selected animated:animated];
......
......@@ -28,26 +28,26 @@
</variation>
</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">
<rect key="frame" x="91" y="42" width="73" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<rect key="frame" x="91" y="43" width="69" height="20"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</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">
<rect key="frame" x="164" y="42" width="11" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<rect key="frame" x="160" y="43" width="10" height="20"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="收入总计:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0K4-NW-0GC" customClass="MBLabelWithFontAdapter">
<rect key="frame" x="213" y="42" width="73" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<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="217" y="43" width="69" height="20"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</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">
<rect key="frame" x="286" y="42" width="45" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<rect key="frame" x="288" y="43" width="43" height="20"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
......@@ -82,6 +82,11 @@
</mask>
</variation>
</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"/>
</tableViewCell>
</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 @@
- (void)cellWithModel:(JavenResellerModel *)model
{
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];
}
......
......@@ -13,7 +13,7 @@
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="168" height="202"/>
<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"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<color key="textColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
......@@ -22,10 +22,11 @@
<fontDescription key="fontDescription" type="system" pointSize="6"/>
</variation>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" verticalCompressionResistancePriority="749" image="team_icon" translatesAutoresizingMaskIntoConstraints="NO" id="Vil-wZ-5TN">
<rect key="frame" x="37" y="48" width="94" height="77"/>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalCompressionResistancePriority="749" image="team_icon" translatesAutoresizingMaskIntoConstraints="NO" id="Vil-wZ-5TN">
<rect key="frame" x="20" y="48" width="128" height="77"/>
<constraints>
<constraint firstAttribute="height" constant="90" id="ag5-Ds-Xru"/>
<constraint firstAttribute="height" relation="lessThanOrEqual" constant="77" id="hkW-5I-rUN"/>
</constraints>
<variation key="default">
<mask key="constraints">
......@@ -50,8 +51,8 @@
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="qvP-Dh-9Iw">
<rect key="frame" x="44" y="170" width="80" height="22"/>
<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">
<rect key="frame" x="10" y="0.0" width="60" height="21"/>
<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="22"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
......@@ -72,10 +73,12 @@
</view>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<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 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="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 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"/>
......@@ -83,9 +86,9 @@
<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="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 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>
<size key="customSize" width="168" height="202"/>
<variation key="default">
......@@ -100,7 +103,7 @@
<outlet property="labelTeamNums" destination="9UQ-ZX-IV8" id="y5y-qh-ZHr"/>
<outlet property="viewAmountBackround" destination="qvP-Dh-9Iw" id="GxS-BJ-U1V"/>
</connections>
<point key="canvasLocation" x="266" y="286"/>
<point key="canvasLocation" x="144" y="276"/>
</collectionViewCell>
</objects>
<resources>
......
......@@ -11,5 +11,5 @@
@interface MyteamTopView : UIView
- (void)setTeamNums:(NSInteger)nums bonus:(CGFloat)bonus;
- (void)setTeamNums:(NSNumber *)nums bonus:(NSNumber *)bonus;
@end
......@@ -16,10 +16,10 @@
@implementation MyteamTopView
- (void)setTeamNums:(NSInteger)nums bonus:(CGFloat)bonus
- (void)setTeamNums:(NSNumber *)nums bonus:(NSNumber *)bonus
{
self.labelTeamNums.text = [NSString stringWithFormat:@"%lu", nums];
self.labelTeamBonus.text = [NSString stringWithFormat:@"¥%0.2f", bonus];
self.labelTeamNums.text = [NSString stringWithFormat:@"%@", nums];
self.labelTeamBonus.text = [NSString stringWithFormat:@"¥%0.2f", [bonus floatValue]];
}
/*
......
......@@ -11,32 +11,32 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="402"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<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"/>
<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"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="谢德彬" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="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"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="手机号:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="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"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</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"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="highlightedColor"/>
</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"/>
<constraints>
<constraint firstAttribute="width" constant="50" id="2su-RU-ZJh"/>
......@@ -46,14 +46,14 @@
<action selector="actionCall:" destination="-1" eventType="touchUpInside" id="2Q6-do-hGR"/>
</connections>
</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"/>
<constraints>
<constraint firstAttribute="width" constant="30" id="eth-Xe-EGH"/>
<constraint firstAttribute="height" constant="23" id="yMF-z8-J4m"/>
</constraints>
</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"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<nil key="highlightedColor"/>
......@@ -92,10 +92,10 @@
</mask>
</variation>
</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"/>
<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"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
......
......@@ -27,8 +27,8 @@
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="待支付" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="J5p-Wx-HPf">
<rect key="frame" x="272" y="18" width="51" height="21"/>
<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="286" y="18" width="51" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
......@@ -45,22 +45,22 @@
<color key="textColor" red="0.63360416669999997" green="0.63360416669999997" blue="0.63360416669999997" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="14H-w4-6eU">
<rect key="frame" x="8" y="74" width="315" height="1"/>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="14H-w4-6eU">
<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"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="yeu-SB-vLO"/>
</constraints>
</view>
<view contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="7at-Z4-fCe">
<rect key="frame" x="0.0" y="0.0" width="331" height="10"/>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="7at-Z4-fCe">
<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"/>
<constraints>
<constraint firstAttribute="height" constant="10" id="L0q-yU-oH5"/>
</constraints>
</view>
<view contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="NKY-p0-eZH">
<rect key="frame" x="0.0" y="78" width="331" height="44"/>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="NKY-p0-eZH">
<rect key="frame" x="0.0" y="100" width="345" height="44"/>
<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">
<rect key="frame" x="105" y="15" width="39" height="21"/>
......@@ -111,8 +111,8 @@
<constraint firstAttribute="bottom" secondItem="iIr-bn-6Cs" secondAttribute="bottom" constant="8" id="zjJ-zV-2cl"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" misplaced="YES" 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"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ajs-cQ-mp9">
<rect key="frame" x="172" y="152" width="165" height="39"/>
<constraints>
<constraint firstAttribute="width" constant="216" id="9Dj-0z-J1R"/>
<constraint firstAttribute="height" constant="39" id="XeW-Ie-n9B"/>
......@@ -125,8 +125,8 @@
</state>
<variation key="default">
<mask key="constraints">
<exclude reference="rfY-Fy-ksn"/>
<exclude reference="9Dj-0z-J1R"/>
<exclude reference="rfY-Fy-ksn"/>
</mask>
</variation>
</button>
......@@ -161,9 +161,9 @@
</constraints>
<variation key="default">
<mask key="constraints">
<exclude reference="VNt-rr-aff"/>
<exclude reference="Nmp-Jf-G7O"/>
<exclude reference="Sn2-4c-1gK"/>
<exclude reference="VNt-rr-aff"/>
<exclude reference="gQj-Wb-5YI"/>
</mask>
</variation>
......
......@@ -10,5 +10,7 @@
#import "CommodityListModel/CommotityListModel.h"
@interface CommodityDetailViewController : IBTUIViewController
@property (nonatomic, strong) CommotityListModel *model;
@property (nonatomic, strong) UIImage *image;
@end
......@@ -42,6 +42,7 @@
[self.view addSubview:self.bottomView];
[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.
}
......@@ -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
......
......@@ -216,6 +216,8 @@
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
CommodityDetailViewController *detailVC = [[CommodityDetailViewController alloc] init];
detailVC.model = self.arrItemDatas[indexPath.row];
CommodityListCollectionViewCell *cell = (CommodityListCollectionViewCell *)[collectionView cellForItemAtIndexPath:indexPath];
detailVC.image = cell.imageViewTop.image;
[self.navigationController pushViewController:detailVC animated:YES];
}
......
......@@ -8,7 +8,7 @@
#import "MoreHotBrandViewController.h"
#import "HotCommodityCell.h"
#import "CommodityListViewController.h"
#define kHotCellId @"addCommodityCellHot"
#define kMargin 0
......@@ -57,6 +57,14 @@
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 {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
......
......@@ -8,7 +8,7 @@
#import "MoreHotTagViewController.h"
#import "AddCommodityCollectionViewCell.h"
#import "CommodityListViewController.h"
#define kCellId @"AddCommodityCollectionViewCell.h"
#define kMargin 0
......@@ -55,6 +55,14 @@
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 {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
......
......@@ -41,6 +41,7 @@
@implementation CommodityManagementViewController
//跳转添加商品在CommodityManagementTopView里面跳转,注意看一下
- (void)viewDidLoad {
[super viewDidLoad];
self.condition = @"shop online only";
......
......@@ -10,24 +10,79 @@
#import "UITableView+Category.h"
#import "JavenSortView.h"
#import "CustomerTableViewCell.h"
#import "JavenCustomer.h"
#import "CustomerViewController.h"
#define kPageSize @10
#define kCellId @"CustomerTableViewCell.h"
@interface CustomerManagementViewController ()<UISearchBarDelegate, UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) UISearchBar *searchBar;
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) JavenSortView *sortView;
@property (nonatomic, strong) NSMutableArray *arrCellData;
@property (nonatomic, copy) NSString *field; //排序的字段
@property (nonatomic, copy) NSString *direction; //排序的顺序 升序或降序
@end
@implementation CustomerManagementViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.field = @"commission";
self.direction = @"desc";
self.view.backgroundColor = kBacroundColor;
[self setUpSearchBar];
[self setUpSortView];
[self setUptableView];
[self setUpData];
// 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 {
UIView *titleView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kWidth - 60, 35)];//allocate titleView
UIColor *color = self.navigationController.navigationBar.barTintColor;
......@@ -51,9 +106,88 @@
self.sortView = [JavenSortView sortViewLeftTitles:arrLeftTitles rightTitles:arrRightTitles];
self.sortView.frame = CGRectMake(0, 0, kWidth, 40);
[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 {
self.tableView = [UITableView plainTableViewWithTarget:self cellNibName:@"CustomerTableViewCell" cellId:kCellId];
......@@ -64,18 +198,27 @@
#pragma mark =========== tableview delegate ===========
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 10;
return self.arrCellData.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
CustomerTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellId forIndexPath:indexPath];
[cell cellwithModel:self.arrCellData[indexPath.row]];
return cell;
}
- (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 ===========
......
//
// 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 @@
[super viewDidLoad];
// 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 {
[super didReceiveMemoryWarning];
......
......@@ -32,6 +32,9 @@
<exclude reference="L0k-pB-2Td"/>
</mask>
</variation>
<connections>
<action selector="invitePartner:" destination="-1" eventType="touchUpInside" id="ga3-Mi-vZP"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
......
......@@ -15,6 +15,8 @@
@interface MyTeamViewController ()<UICollectionViewDelegate, UICollectionViewDataSource>
@property (nonatomic, strong) UICollectionView *collectionView;
@property (nonatomic, strong) NSMutableArray *arrData;
@property (nonatomic, strong) MyteamTopView *topView;
@end
@implementation MyTeamViewController
......@@ -24,6 +26,7 @@
self.arrData = [NSMutableArray array];
self.navigationItem.title = @"我的团队";
[self setUpCollectionView];
[self setUpTotalData];
[self setUpData];
// Do any additional setup after loading the view.
}
......@@ -33,7 +36,7 @@
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.minimumInteritemSpacing = 0;
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.contentInset = UIEdgeInsetsMake(140, 0, 0, 0);
self.collectionView.backgroundColor = kBacroundColor;
......@@ -45,19 +48,34 @@
[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 {
NSDictionary *params = @{@"defintion" : @{@"conditions" : @[@{@"operation" : @"reseller uuid equals",
@"parameters" : @[[UserInfo shareInstance].uuid]},
@{@"operation" : @"domain equals",
@"parameters" : @[[UserInfo shareInstance].domain]}],
@"orders" : @[@{@"direction" : @"desc",
@"field" : @""}],
@"page" : @0,
@"pageSize" : @999,
@"probePages" : @0},
@"fetchParts" : [NSNull null]};
@"parameters" : @[[UserInfo shareInstance].uuid]},
@{@"operation" : @"domain equals",
@"parameters" : @[[UserInfo shareInstance].domain]}],
@"orders" : @[@{@"direction" : @"desc",
@"field" : @""}],
@"page" : @0,
@"pageSize" : @999,
@"probePages" : @0},
@"fetchParts" : [NSNull null]};
WS(weakSelf)
[[HTTPCilent shareCilent] POST:@"reseller/team/query" parameters:params success:^(NSURLSessionDataTask *task, id responseObject) {
......@@ -78,6 +96,7 @@
- (void)setUpTopView {
MyteamTopView *topView = [MyteamTopView viewWithNibName:@"MyTeamTopView"];
self.topView = topView;
topView.frame = CGRectMake(0, -140 + 20, kWidth, 100);
[self.collectionView addSubview:topView];
}
......
......@@ -19,8 +19,11 @@
@property (nonatomic, strong) SelectPhotoView *photoView;
@property (nonatomic, strong) CoverShadowView *shadowView;
@property (nonatomic, strong) JavenShopModel *shopModel;
@property (weak, nonatomic) IBOutlet UIButton *buttonBac;
@property (weak, nonatomic) IBOutlet UILabel *labelName;
@property (weak, nonatomic) IBOutlet UILabel *labelDescription;
@property (nonatomic, copy) NSString *urlStr;
@end
......@@ -28,6 +31,9 @@
- (void)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.
}
......@@ -138,14 +144,14 @@
}
- (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 {
StoreQRCodeViewController *QRCodeVC = [[StoreQRCodeViewController alloc] initWithNibName:@"StoreQRCodeViewController" bundle:nil];
QRCodeVC.urlStr = self.urlStr;
[self.navigationController pushViewController:QRCodeVC animated:YES];
}
......
......@@ -9,6 +9,7 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="StoreManagermentViewController">
<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="labelName" destination="R3l-SJ-mVe" id="N6s-z3-sA1"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
......@@ -76,10 +77,10 @@
</variation>
</imageView>
<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>
<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>
<state key="normal" image="bac"/>
<connections>
......
......@@ -9,5 +9,6 @@
#import "IBTUIViewController.h"
@interface StoreQRCodeViewController : IBTUIViewController
@property (nonatomic, copy) NSString *urlStr;
@end
......@@ -10,6 +10,7 @@
#import "UIImage+QRCode.h"
@interface StoreQRCodeViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *imageViewQRCode;
@property (weak, nonatomic) IBOutlet UIButton *buttonSave;
@end
......@@ -18,7 +19,7 @@
- (void)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];
self.imageViewQRCode.image = customQrcode;
// set shadow
......@@ -33,26 +34,41 @@
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:NO animated:YES];
}
#pragma mark =========== actions ===========
//保存到相册
- (IBAction)actionSafeToAlbum:(id)sender {
UIImageWriteToSavedPhotosAlbum( self.imageViewQRCode.image, self, @selector(image:didFinishSavingWithError:contextInfo:) , nil ) ;
self.buttonSave.userInteractionEnabled = NO; //防止多次点击
UIImageWriteToSavedPhotosAlbum( self.imageViewQRCode.image, self, @selector(image:didFinishSavingWithError:contextInfo:) , nil ) ;
}
//分享
- (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
contextInfo:(void *)contextInfo
{
// Was there an error?
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
{
[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
}
}
......
......@@ -7,6 +7,7 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="StoreQRCodeViewController">
<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="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
......@@ -16,24 +17,24 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="RFH-hd-LUV">
<view contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="RFH-hd-LUV">
<rect key="frame" x="0.0" y="0.0" width="375" height="349"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="erweima_结果" translatesAutoresizingMaskIntoConstraints="NO" id="bLf-3W-zks">
<rect key="frame" x="67" y="0.0" width="241" height="349"/>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" image="erweima_结果" translatesAutoresizingMaskIntoConstraints="NO" id="bLf-3W-zks">
<rect key="frame" x="50" y="50" width="275" height="249"/>
</imageView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="bLf-3W-zks" firstAttribute="top" secondItem="RFH-hd-LUV" secondAttribute="top" id="FAS-oh-mxh"/>
<constraint firstAttribute="trailing" secondItem="bLf-3W-zks" secondAttribute="trailing" constant="67" id="QLR-Uf-j7Q"/>
<constraint firstAttribute="height" 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 firstAttribute="bottom" secondItem="bLf-3W-zks" secondAttribute="bottom" id="myM-YP-fkq"/>
<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="50" id="QLR-Uf-j7Q"/>
<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="50" id="cZa-Uc-k0N"/>
<constraint firstAttribute="bottom" secondItem="bLf-3W-zks" secondAttribute="bottom" constant="50" id="myM-YP-fkq"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ViK-KX-ySY">
<rect key="frame" x="32" y="429" width="311" height="44"/>
<rect key="frame" x="32" y="446" width="311" height="44"/>
<constraints>
<constraint firstAttribute="height" constant="44" id="ANx-UQ-dVE"/>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="44" id="eiq-IS-QP5"/>
......@@ -53,7 +54,7 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="x2U-B2-ts9">
<rect key="frame" x="32" y="506" width="311" height="44"/>
<rect key="frame" x="32" y="523" width="311" height="44"/>
<constraints>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="44" id="7VW-Yx-INi"/>
<constraint firstAttribute="height" constant="44" id="CNC-hG-yQj"/>
......@@ -80,16 +81,17 @@
<constraints>
<constraint firstItem="RFH-hd-LUV" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="1wK-iV-EeW"/>
<constraint firstItem="x2U-B2-ts9" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="32" id="3YA-UD-xaT"/>
<constraint firstItem="ViK-KX-ySY" firstAttribute="top" secondItem="RFH-hd-LUV" secondAttribute="bottom" constant="80" id="9Gq-7S-kA8"/>
<constraint firstAttribute="trailing" secondItem="x2U-B2-ts9" secondAttribute="trailing" constant="32" id="D41-F6-h4Z"/>
<constraint 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="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 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 firstAttribute="trailing" secondItem="ViK-KX-ySY" secondAttribute="trailing" constant="32" id="u1j-6W-nJr"/>
</constraints>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina47"/>
<point key="canvasLocation" x="286.5" y="386.5"/>
<point key="canvasLocation" x="68.5" y="460.5"/>
</view>
</objects>
<resources>
......
......@@ -44,20 +44,21 @@
//本地已有密码时登录
- (void)defaultLoginAction {
BaseViewController *baseVC = [[BaseViewController alloc] init];
baseVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentViewController:baseVC animated:YES completion:nil];
// BaseViewController *baseVC = [[BaseViewController alloc] init];
// baseVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
// [self presentViewController:baseVC animated:YES completion:nil];
if ([[NSUserDefaults standardUserDefaults] objectForKey:@"passWord"]) {
NSDictionary *paramers = @{@"domain":kDomain,
NSDictionary *params = @{@"domain":kDomain,
@"loginName":[[NSUserDefaults standardUserDefaults] objectForKey:@"userName"] ,
@"password":[[NSUserDefaults standardUserDefaults] objectForKey:@"passWord"],
@"rememberMe":@"true"};
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
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];
......@@ -67,11 +68,13 @@
[info UserInfoWithDictionary:responseObject[@"reseller"]];
info.webShopBaseUrl = responseObject[@"appConfig"][@"webShopBaseUrl"];
BaseViewController *baseVC = [[BaseViewController alloc] init];
baseVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[weakSelf presentViewController:baseVC animated:YES completion:nil];
}else{
[[NSUserDefaults standardUserDefaults] setObject:nil forKey:@"passWord"];
[MBProgressHUD Javen_showError:responseObject[@"message"] onView:weakSelf.view delay:2 complete:nil];
}
......
......@@ -8,6 +8,7 @@
#import "MineViewController.h"
#import "SettingViewController.h"
#import "MyAcountViewController.h"
@interface MineViewController ()
@end
......@@ -20,10 +21,16 @@
}
- (IBAction)myAcount:(id)sender {
CLog(@"myAcount");
MyAcountViewController *acountVC = [[MyAcountViewController alloc] init];
acountVC.isShowNavigationBar = NO;
[self.navigationController pushViewController:acountVC animated:YES];
}
- (IBAction)actionSetting:(id)sender {
SettingViewController *settingVC = [[SettingViewController alloc] init];
settingVC.isShowNavigationBar = YES;
settingVC.hidesBottomBarWhenPushed = 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 @@
#import "SettingViewController.h"
@interface SettingViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *imageViewIcon;
@property (weak, nonatomic) IBOutlet UILabel *signature;//个性签名
@property (weak, nonatomic) IBOutlet UILabel *phoneNumber;
@end
......@@ -16,6 +19,9 @@
- (void)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.
}
- (IBAction)loginOut:(id)sender {
......
......@@ -150,6 +150,7 @@
[hud show:YES];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(time * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self hideHUDForView:view animated:YES];
if (complete) {
......
......@@ -12,6 +12,8 @@
@property (nonatomic, copy) NSString *title;
@property (nonatomic, copy) NSString *url;
@property (nonatomic, copy) NSString *content;
@property (nonatomic, strong) UIImage *image;
@end
......@@ -15,13 +15,23 @@
- (IBAction)shareToWeiChatSession:(id)sender {
[UMSocialData defaultData].extConfig.wechatSessionData.url = self.url;
[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) {
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 {
}
......
......@@ -89,6 +89,7 @@
<rect key="frame" x="0.0" y="0.0" width="80" height="140"/>
<connections>
<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>
</button>
</subviews>
......
......@@ -11,5 +11,5 @@
@interface ShareInstance : NSObject
+ (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
......@@ -28,7 +28,7 @@
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];
......@@ -44,6 +44,7 @@
self.shareContentView.title = title;
self.shareContentView.content = content;
self.shareContentView.url = url;
self.shareContentView.image = image;
[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