Commit 1f749328 authored by Sandy's avatar Sandy

no message

parent 756482e3
......@@ -150,6 +150,8 @@
19632DB31CB39B250024A8A1 /* SelectPhotoView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 19632DB21CB39B250024A8A1 /* SelectPhotoView.xib */; };
196944DC1CEC4E6C0036E574 /* NoBillHistoryView.m in Sources */ = {isa = PBXBuildFile; fileRef = 196944DB1CEC4E6C0036E574 /* NoBillHistoryView.m */; };
196944DE1CEC4E780036E574 /* NoBillHistoryView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 196944DD1CEC4E780036E574 /* NoBillHistoryView.xib */; };
196944E11CEC75FA0036E574 /* JavenAdModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 196944E01CEC75FA0036E574 /* JavenAdModel.m */; };
196944E51CEC7D500036E574 /* HomeAdViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 196944E31CEC7D500036E574 /* HomeAdViewController.m */; };
1979751C1CA8CDF300407E3F /* CommodityDetailBottomView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1979751B1CA8CDF300407E3F /* CommodityDetailBottomView.xib */; };
1979751F1CA8D51700407E3F /* CommodityDetailBottomView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1979751E1CA8D51700407E3F /* CommodityDetailBottomView.m */; };
197975221CA8DA8200407E3F /* CommodityDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 197975211CA8DA8200407E3F /* CommodityDetailViewController.m */; };
......@@ -592,6 +594,10 @@
196944DA1CEC4E6C0036E574 /* NoBillHistoryView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NoBillHistoryView.h; sourceTree = "<group>"; };
196944DB1CEC4E6C0036E574 /* NoBillHistoryView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NoBillHistoryView.m; sourceTree = "<group>"; };
196944DD1CEC4E780036E574 /* NoBillHistoryView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = NoBillHistoryView.xib; sourceTree = "<group>"; };
196944DF1CEC75FA0036E574 /* JavenAdModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavenAdModel.h; sourceTree = "<group>"; };
196944E01CEC75FA0036E574 /* JavenAdModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JavenAdModel.m; sourceTree = "<group>"; };
196944E21CEC7D500036E574 /* HomeAdViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HomeAdViewController.h; sourceTree = "<group>"; };
196944E31CEC7D500036E574 /* HomeAdViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HomeAdViewController.m; sourceTree = "<group>"; };
1979751B1CA8CDF300407E3F /* CommodityDetailBottomView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CommodityDetailBottomView.xib; sourceTree = "<group>"; };
1979751D1CA8D51700407E3F /* CommodityDetailBottomView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommodityDetailBottomView.h; sourceTree = "<group>"; };
1979751E1CA8D51700407E3F /* CommodityDetailBottomView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommodityDetailBottomView.m; sourceTree = "<group>"; };
......@@ -1778,17 +1784,19 @@
19DCCA861C9A95E70072C3BF /* Model */ = {
isa = PBXGroup;
children = (
1912FCC71CCDC652004CF976 /* MyTeams */,
1929401B1CC8D9EF00E377EE /* InviteParterner */,
1900A3441CB6305100B2B7C4 /* Commodity */,
1900A3451CB6305100B2B7C4 /* CommodityManagement */,
19DC6B301CC0D5330064A9FD /* CustomerManagement */,
19DC6AFA1CBF867E0064A9FD /* JavenShopModel.h */,
19DC6AFB1CBF867E0064A9FD /* JavenShopModel.m */,
197BA6801CD851DB000E2087 /* JavenDetailReseller.h */,
197BA6811CD851DB000E2087 /* JavenDetailReseller.m */,
1929401B1CC8D9EF00E377EE /* InviteParterner */,
196944DF1CEC75FA0036E574 /* JavenAdModel.h */,
196944E01CEC75FA0036E574 /* JavenAdModel.m */,
197BA6871CD865D1000E2087 /* JavencommissionAccountModel.h */,
197BA6881CD865D1000E2087 /* JavencommissionAccountModel.m */,
1900A3441CB6305100B2B7C4 /* Commodity */,
1900A3451CB6305100B2B7C4 /* CommodityManagement */,
197BA6801CD851DB000E2087 /* JavenDetailReseller.h */,
197BA6811CD851DB000E2087 /* JavenDetailReseller.m */,
19DC6AFA1CBF867E0064A9FD /* JavenShopModel.h */,
19DC6AFB1CBF867E0064A9FD /* JavenShopModel.m */,
1912FCC71CCDC652004CF976 /* MyTeams */,
1900A3461CB6305100B2B7C4 /* Order */,
1900A3471CB6305100B2B7C4 /* Storemanagement */,
);
......@@ -1836,6 +1844,8 @@
1929F18D1CA10C94000E9B26 /* HomeCollectionViewController.m */,
1921EF6E1CE5C0E900B0BC4A /* ShopWebViewController.h */,
1921EF6F1CE5C0E900B0BC4A /* ShopWebViewController.m */,
196944E21CEC7D500036E574 /* HomeAdViewController.h */,
196944E31CEC7D500036E574 /* HomeAdViewController.m */,
);
path = ViewController;
sourceTree = "<group>";
......@@ -2241,6 +2251,7 @@
TargetAttributes = {
1940D2E61C9A56730080678C = {
CreatedOnToolsVersion = 7.2.1;
DevelopmentTeam = 4WRSWKXL27;
};
1940D2F91C9A56730080678C = {
CreatedOnToolsVersion = 7.2.1;
......@@ -2423,6 +2434,7 @@
194FB0BA1CE2E95B0089A3D5 /* UserInfoShop.m in Sources */,
1912FCD71CCDC945004CF976 /* JavenReseller.m in Sources */,
199B4D861CAE43F800451E0E /* OrderDetailTableViewCell.m in Sources */,
196944E11CEC75FA0036E574 /* JavenAdModel.m in Sources */,
199BC7B11C9AD4FD00E4E0B8 /* LoginViewController.m in Sources */,
1979752E1CA90D6C00407E3F /* CommodityManagementViewController.m in Sources */,
19DCCBE21C9AA0450072C3BF /* JTOptionsViewController.m in Sources */,
......@@ -2599,6 +2611,7 @@
19DCCBF11C9AA1D50072C3BF /* ICRUserUtil.m in Sources */,
19563C971CDB22AD00AFD0E0 /* AddBankCardIDViewController.m in Sources */,
19DCCB6C1C9A9EB30072C3BF /* IBTTabBarController.m in Sources */,
196944E51CEC7D500036E574 /* HomeAdViewController.m in Sources */,
197BA6701CD8515D000E2087 /* JavenCreateInfo.m in Sources */,
19632DB11CB39B190024A8A1 /* SelectPhotoView.m in Sources */,
19DCCB621C9A9EB30072C3BF /* IBTTableViewInfo.m in Sources */,
......@@ -2793,6 +2806,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
ENABLE_BITCODE = NO;
GCC_PREFIX_HEADER = Aland/PrefixHeader.pch;
HEADER_SEARCH_PATHS = (
......@@ -2821,6 +2835,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
ENABLE_BITCODE = NO;
GCC_PREFIX_HEADER = Aland/PrefixHeader.pch;
HEADER_SEARCH_PATHS = (
......
{
"images" : [
{
"idiom" : "universal",
"filename" : "goodsPlaceHolder.jpg",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
......@@ -2,7 +2,7 @@
"images" : [
{
"idiom" : "universal",
"filename" : "launch.png",
"filename" : "launch.jpg",
"scale" : "1x"
},
{
......
......@@ -6,6 +6,8 @@
//
#import <Foundation/Foundation.h>
#import "CommotityListCategory.h"
#import "CommotityListBrand.h"
@class CommotityListCategory, CommotityListBrand;
......
......@@ -6,8 +6,6 @@
//
#import "CommotityListModel.h"
#import "CommotityListCategory.h"
#import "CommotityListBrand.h"
NSString *const kCommotityListModelUuid = @"uuid";
......
//
// JavenAdModel.h
//
// Created by Z on 16/5/18
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface JavenAdModel : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) NSString *picture;
@property (nonatomic, assign) double order;
@property (nonatomic, strong) NSString *url;
@property (nonatomic, strong) NSString *uuid;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// JavenAdModel.m
//
// Created by Z on 16/5/18
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "JavenAdModel.h"
NSString *const kJavenAdModelPicture = @"picture";
NSString *const kJavenAdModelOrder = @"order";
NSString *const kJavenAdModelUrl = @"url";
NSString *const kJavenAdModelUuid = @"uuid";
@interface JavenAdModel ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation JavenAdModel
@synthesize picture = _picture;
@synthesize order = _order;
@synthesize url = _url;
@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.picture = [self objectOrNilForKey:kJavenAdModelPicture fromDictionary:dict];
self.order = [[self objectOrNilForKey:kJavenAdModelOrder fromDictionary:dict] doubleValue];
self.url = [self objectOrNilForKey:kJavenAdModelUrl fromDictionary:dict];
self.uuid = [self objectOrNilForKey:kJavenAdModelUuid fromDictionary:dict];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:self.picture forKey:kJavenAdModelPicture];
[mutableDict setValue:[NSNumber numberWithDouble:self.order] forKey:kJavenAdModelOrder];
[mutableDict setValue:self.url forKey:kJavenAdModelUrl];
[mutableDict setValue:self.uuid forKey:kJavenAdModelUuid];
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.picture = [aDecoder decodeObjectForKey:kJavenAdModelPicture];
self.order = [aDecoder decodeDoubleForKey:kJavenAdModelOrder];
self.url = [aDecoder decodeObjectForKey:kJavenAdModelUrl];
self.uuid = [aDecoder decodeObjectForKey:kJavenAdModelUuid];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:_picture forKey:kJavenAdModelPicture];
[aCoder encodeDouble:_order forKey:kJavenAdModelOrder];
[aCoder encodeObject:_url forKey:kJavenAdModelUrl];
[aCoder encodeObject:_uuid forKey:kJavenAdModelUuid];
}
- (id)copyWithZone:(NSZone *)zone
{
JavenAdModel *copy = [[JavenAdModel alloc] init];
if (copy) {
copy.picture = [self.picture copyWithZone:zone];
copy.order = self.order;
copy.url = [self.url copyWithZone:zone];
copy.uuid = [self.uuid copyWithZone:zone];
}
return copy;
}
@end
......@@ -40,8 +40,7 @@
WS(weakSelf)
[userInfo checkGoodIsAddedWithGoodUuid:self.model.uuid result:^(BOOL isAdded) {
if (isAdded) {
[[ShareInstance shareInstace] showWithTitle:userInfo.shop.name content:[NSString stringWithFormat:@"%@仅售%.0f 品质由我保证 健康由你作主",self.model.name, self.model.price] url:[NSString stringWithFormat:@"%@Wap/detail/shop_id/%@/id/%@/hastbar/0/.html", userInfo.webShopBaseUrl, userInfo.shop.uuid, self.model.uuid] image:self.imageViewTop.image];
[[ShareInstance shareInstace] shareGoodsWithGoodsModel:self.model image:self.imageViewTop.image];
}else{
[MBProgressHUD Javen_showError:@"请先添加到店铺!" onView:weakSelf.window delay:0.7 complete:nil];
}
......
......@@ -14,7 +14,7 @@
<rect key="frame" x="0.0" y="0.0" width="200" height="340"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="commodityImage" translatesAutoresizingMaskIntoConstraints="NO" id="cBw-zL-p9z">
<rect key="frame" x="0.0" y="0.0" width="200" height="200"/>
<rect key="frame" x="5" y="0.0" width="190" height="200"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Bloem天然草本更年期综合营养胶囊100粒" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vlk-5l-QDd" customClass="MBLabelWithFontAdapter">
<rect key="frame" x="10" y="204" width="180" height="41"/>
......@@ -117,7 +117,7 @@
<constraints>
<constraint firstItem="i9h-vh-UNx" firstAttribute="leading" secondItem="FUs-8c-aeb" secondAttribute="leading" id="09G-JC-AXp"/>
<constraint firstItem="i9h-vh-UNx" firstAttribute="leading" secondItem="FUs-8c-aeb" secondAttribute="leading" constant="2" id="0za-eJ-0pr"/>
<constraint firstItem="cBw-zL-p9z" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="1Yu-wi-HgC"/>
<constraint firstItem="cBw-zL-p9z" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="5" id="1Yu-wi-HgC"/>
<constraint firstItem="4sA-5e-zpi" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="14" id="4L0-Gu-xfw"/>
<constraint firstItem="ig6-43-sUi" firstAttribute="centerY" secondItem="FUs-8c-aeb" secondAttribute="centerY" id="5JQ-Rz-YcG"/>
<constraint firstAttribute="bottom" secondItem="pU7-bv-8QS" secondAttribute="bottom" id="6nt-pW-mCL"/>
......@@ -130,7 +130,7 @@
<constraint firstItem="JDW-37-wfV" firstAttribute="bottom" secondItem="ig6-43-sUi" secondAttribute="bottom" id="I9c-HN-6Vj"/>
<constraint firstItem="FUs-8c-aeb" firstAttribute="leading" secondItem="vlk-5l-QDd" secondAttribute="leading" id="IdZ-yI-Aba"/>
<constraint firstItem="i9h-vh-UNx" firstAttribute="leading" secondItem="4sA-5e-zpi" secondAttribute="leading" id="Ji2-Tc-SFb"/>
<constraint firstAttribute="trailing" secondItem="cBw-zL-p9z" secondAttribute="trailing" id="LMr-oe-Zgo"/>
<constraint firstAttribute="trailing" secondItem="cBw-zL-p9z" secondAttribute="trailing" constant="5" id="LMr-oe-Zgo"/>
<constraint firstItem="DLG-sh-uU2" firstAttribute="centerY" secondItem="FUs-8c-aeb" secondAttribute="centerY" constant="3" id="Lk7-4I-6zG"/>
<constraint firstItem="ig6-43-sUi" firstAttribute="leading" secondItem="FUs-8c-aeb" secondAttribute="trailing" constant="7" id="ORt-QK-sOe"/>
<constraint firstItem="pU7-bv-8QS" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="Ozj-J8-BYp"/>
......
......@@ -8,8 +8,15 @@
#import "HomeCollectionFooterReusableView.h"
#import "SDCycleScrollView.h"
@implementation HomeCollectionFooterReusableView
#import "JavenAdModel.h"
#import "HomeAdViewController.h"
#import "UIView+Category.h"
@interface HomeCollectionFooterReusableView ()<SDCycleScrollViewDelegate>
@property (nonatomic, strong) NSMutableArray<JavenAdModel *> *arrDatas;
@end
@implementation HomeCollectionFooterReusableView
- (instancetype)initWithFrame:(CGRect)frame
{
......@@ -19,14 +26,47 @@
CGFloat width = frame.size.width;
CGFloat height = frame.size.height;
SDCycleScrollView *scrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0, width, height) imageNamesGroup:@[@"cyclescrollplaceholder",@"cyclescrollplaceholder"]];
WS(weakSelf)
[[HTTPCilent shareCilent] GET:@"adsense/getAll" parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
NSMutableArray *arrPic = [NSMutableArray array];
for (NSDictionary *dic in responseObject[@"list"]) {
JavenAdModel *model = [JavenAdModel modelObjectWithDictionary:dic];
[weakSelf.arrDatas addObject: model];
[arrPic addObject:model.picture];
}
SDCycleScrollView *scrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0, width, height) delegate:self placeholderImage:[UIImage imageNamed:@"cyclescrollplaceholder"]];
scrollView.imageURLStringsGroup = arrPic;
scrollView.bannerImageViewContentMode = UIViewContentModeScaleAspectFill;
scrollView.autoScrollTimeInterval = 3;
[self addSubview:scrollView];
[weakSelf addSubview:scrollView];
} failure:^(NSURLSessionDataTask *task, NSError *error) {
}];
}
return self;
}
- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index
{
HomeAdViewController *adVC = [[HomeAdViewController alloc] init];
adVC.isShowNavigationBar = YES;
adVC.strUrl = [self.arrDatas[index] url];
[[self viewController] PushViewController:adVC animated:YES];
}
- (NSMutableArray *)arrDatas {
if (!_arrDatas) {
_arrDatas = [NSMutableArray array];
}
return _arrDatas;
}
@end
......@@ -48,7 +48,6 @@
/** 检查是否收藏 */
- (void)checkIsFavorite {
WS(weakSelf);
[[UserInfo shareInstance] checkGoodIsAddedWithGoodUuid:self.model.uuid result:^(BOOL isAdded) {
weakSelf.bottomView.buttonShop.selected = isAdded;
......@@ -62,7 +61,6 @@
}
- (void)homeAction {
CLog(@"home");
[self.navigationController popToRootViewControllerAnimated:YES];
}
......@@ -134,7 +132,8 @@
return param;
}
- (void)setUpWebView {
- (void)setUpWebView
{
UserInfo *userInfo = [UserInfo shareInstance];
NSString *urlStr = [NSString stringWithFormat:@"%@Wap/detail/shop_id/%@/id/%@/hastbar/1/.html", userInfo.webShopBaseUrl, userInfo.shop.uuid, self.model.uuid];
WKWebView *webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, kWidth, kHeight - 67)];
......@@ -178,7 +177,8 @@
[userInfo checkGoodIsAddedWithGoodUuid:self.model.uuid result:^(BOOL isAdded) {
if (isAdded) {
[[ShareInstance shareInstace] showWithTitle:userInfo.shop.name content:[NSString stringWithFormat:@"%@仅售%.0f 品质由我保证 健康由你作主",self.model.name, self.model.price] url:[NSString stringWithFormat:@"%@Wap/detail/shop_id/%@/id/%@/hastbar/0/.html", userInfo.webShopBaseUrl, userInfo.shop.uuid, self.model.uuid] image:self.image];
[[ShareInstance shareInstace] shareGoodsWithGoodsModel:self.model image:self.image];
}else{
[MBProgressHUD Javen_showError:@"请先添加到店铺!" onView:weakSelf.view delay:0.7 complete:nil];
}
......
......@@ -245,9 +245,7 @@
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
CommodityListCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kCellID forIndexPath:indexPath];
cell.successBlock = ^{
};
[cell cellWithModel:self.arrItemDatas[indexPath.row]];
return cell;
}
......
......@@ -12,19 +12,21 @@
#import "CustomerTableViewCell.h"
#import "JavenCustomer.h"
#import "CustomerViewController.h"
#define kPageSize @999
#import "MJRefresh.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, strong) NSArray *results;
@property (nonatomic, strong) NSMutableArray *results;
@property (nonatomic, assign) NSInteger page;
@property (nonatomic, copy) NSString *field; //排序的字段
@property (nonatomic, copy) NSString *direction; //排序的顺序 升序或降序
@property (nonatomic, copy) NSString *customerCreateDate;
@property (nonatomic, strong) id phoneNo;
@end
......@@ -32,11 +34,9 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.field = @"commission";
self.direction = @"desc";
self.customerCreateDate = @"2011-04-09 00:00:00";
self.view.backgroundColor = kBacroundColor;
self.page = 0;
[self setUpDefaultConditions];
[self setUpSearchBar];
[self setUpSortView];
[self setUptableView];
......@@ -44,6 +44,15 @@
// Do any additional setup after loading the view.
}
- (void)setUpDefaultConditions {
self.field = @"commission";
self.direction = @"desc";
self.customerCreateDate = @"2011-04-09 00:00:00";
self.phoneNo = [NSNull null];
}
- (NSMutableArray *)arrCellData {
if (!_arrCellData) {
_arrCellData = [NSMutableArray array];
......@@ -51,24 +60,34 @@
return _arrCellData;
}
- (void)setUpData {
- (NSMutableArray *)results {
if (!_results) {
_results = [NSMutableArray array];
}
return _results;
}
- (void)setUpData {
WS(weakSelf)
[[HTTPCilent shareCilent] POST:@"reseller/customer/query" parameters:[self getParams] success:^(NSURLSessionDataTask *task, id responseObject) {
if ([responseObject[@"code"] isEqualToNumber:@0]) {
NSMutableArray *arr = weakSelf.searchBar.isFirstResponder ? weakSelf.results : weakSelf.arrCellData;
for (NSDictionary *dic in responseObject[@"queryResult"]) {
JavenCustomer *customer = [JavenCustomer modelObjectWithDictionary:dic];
[weakSelf.arrCellData addObject:customer];
[arr addObject:customer];
}
if ([responseObject[@"queryResult"] count] < kPageSize) {
[weakSelf.tableView.mj_footer endRefreshingWithNoMoreData];
}else{
[weakSelf.tableView.mj_footer endRefreshing];
}
[weakSelf.tableView reloadData];
}else{
}
} failure:^(NSURLSessionDataTask *task, NSError *error) {
}];
......@@ -84,11 +103,14 @@
@"parameters" : @[self.customerCreateDate, [NSNull null]]},
@{@"operation" : @"reseller uuid equals",
@"parameter" : @{@"operation" : @"string"},
@"parameters" : @[[UserInfo shareInstance].uuid]}],
@"parameters" : @[[UserInfo shareInstance].uuid]},
@{@"operation" : @"mobilephone equals",
@"parameter" : @{@"operation" : @"string"},
@"parameters" : @[_phoneNo]}],
@"orders" : @[@{@"field" : self.field,
@"direction" : self.direction}],
@"pageSize" : kPageSize,
@"page" : @0,
@"pageSize" : @(kPageSize),
@"page" : @(self.page),
@"probePages" : @0},
@"fetchParts" : @[@""]};
return params;
......@@ -131,6 +153,7 @@
}
- (void)rightSortAction:(NSInteger)row {
self.page = 0;
switch (row) {
case 0:
{
......@@ -161,6 +184,7 @@
//排序
- (void)leftSortAction:(NSInteger)row {
self.page = 0;
switch (row) {
case 0:
{
......@@ -207,6 +231,12 @@
self.tableView = [UITableView plainTableViewWithTarget:self cellNibName:@"CustomerTableViewCell" cellId:kCellId];
[self.view addSubview:self.tableView];
self.tableView.sd_layout.topSpaceToView(self.sortView,0).leftEqualToView(self.view).rightEqualToView(self.view).bottomEqualToView(self.view);
WS(weakSelf)
self.tableView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
weakSelf.page += 1;
[weakSelf setUpData];
}];
}
#pragma mark =========== tableview delegate ===========
......@@ -247,15 +277,14 @@
- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText
{
NSPredicate *pred = [NSPredicate predicateWithFormat:@"consumer.mobilephone contains [cd] %@", searchText];
self.results = [self.arrCellData filteredArrayUsingPredicate:pred];
[self.tableView reloadData];
self.phoneNo = searchText;
}
- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar
{
// self.sortView.userInteractionEnabled = YES;
self.searchBar.text = @"";
self.phoneNo = [NSNull null];
[self.searchBar endEditing:YES];
[self.tableView reloadData];
}
......@@ -277,6 +306,9 @@
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar {
// self.sortView.userInteractionEnabled = YES;
[self.results removeAllObjects];
[self setUpDefaultConditions];
[self setUpData];
}
......
//
// HomeAdViewController.h
// ALand
//
// Created by Z on 16/5/18.
// Copyright © 2016年 Z. All rights reserved.
//
#import "IBTUIViewController.h"
@interface HomeAdViewController : IBTUIViewController
@property (nonatomic, copy) NSString *strUrl;
@end
//
// HomeAdViewController.m
// ALand
//
// Created by Z on 16/5/18.
// Copyright © 2016年 Z. All rights reserved.
//
#import "HomeAdViewController.h"
#import <WebKit/WebKit.h>
@interface HomeAdViewController ()<WKNavigationDelegate>
@property (nonatomic, strong) WKWebView *webView;
@end
@implementation HomeAdViewController
- (void)viewDidLoad {
[super viewDidLoad];
WKWebView *webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, kWidth, kHeight - 64)];
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.baidu.com"]]];
self.webView = webView;
webView.navigationDelegate = self;
[self.view addSubview:webView];
// Do any additional setup after loading the view from its nib.
}
// 页面开始加载时调用
- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation
{
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
}
// 当内容开始返回时调用
- (void)webView:(WKWebView *)webView didCommitNavigation:(WKNavigation *)navigation
{
}
// 页面加载完成之后调用
- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation
{
self.title = webView.title;
[MBProgressHUD hideHUDForView:self.view];
}
// 页面加载失败时调用
- (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation
{
}
- (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
......@@ -34,7 +34,6 @@
WS(weakSelf)
[[HTTPCilent shareCilent] GET:[NSString stringWithFormat:@"shop/get/%@", [UserInfo shareInstance].shop.uuid] parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
UserInfo *info = [UserInfo shareInstance];
if (weakSelf.shopModel) {
[weakSelf.shopModel updateWithDictionary:responseObject[@"shop"]];
}else{
......
......@@ -54,8 +54,7 @@
- (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 appIcon]];
[[ShareInstance shareInstace] invitePartner];
}
......
......@@ -56,11 +56,11 @@
self.tableView.tableFooterView = self.bottomView;
//底部查看物流按钮
if (self.orderType == ORDERTOPTYPE_TRANSPORTED) {
SeeLogistics *viewBottom = [SeeLogistics viewWithNibName:@"SeeLogistics"];
viewBottom.frame = CGRectMake(0, kHeight - 64 - 65, kWidth, 64 + 65);
[self.view addSubview:viewBottom];
}
// if (self.orderType == ORDERTOPTYPE_TRANSPORTED) {
// SeeLogistics *viewBottom = [SeeLogistics viewWithNibName:@"SeeLogistics"];
// viewBottom.frame = CGRectMake(0, kHeight - 64 - 65, kWidth, 64 + 65);
// [self.view addSubview:viewBottom];
// }
......
......@@ -7,11 +7,20 @@
//
#import <Foundation/Foundation.h>
#import "CommotityListModel.h"
@interface ShareInstance : NSObject
+ (ShareInstance *)shareInstace;
- (void)showWithTitle:(NSString *)title content:(NSString *)content url:(NSString *)url image:(UIImage *)image;
/** 分享店铺 */
- (void)shareShopWithTitle:(NSString *)title shopDescription:(NSString *)shopDescription url:(NSString *)url image:(UIImage *)image imageUrl:(NSString *)imageUrl;
/** 邀请合伙人 */
- (void)invitePartner;
/** 分享商品 */
- (void)shareGoodsWithGoodsModel:(CommotityListModel *)model image:(UIImage *)image;
@end
......@@ -9,7 +9,7 @@
#import "ShareInstance.h"
#import "CoverShadowView.h"
#import "ShareContentView.h"
#import "CommotityListBrand.h"
#define kWindow [UIApplication sharedApplication].keyWindow
@interface ShareInstance ()
@property (nonatomic, strong) CoverShadowView *cover;
......@@ -28,19 +28,6 @@
return instance;
}
- (void)shareShopWithTitle:(NSString *)title shopDescription:(NSString *)shopDescription url:(NSString *)url image:(UIImage *)image imageUrl:(NSString *)imageUrl
{
if (!title || title.length == 0) {
[MBProgressHUD Javen_showError:@"请填写店铺名!" onView:kWindow delay:0.7 complete:nil];
}else if(!shopDescription || shopDescription.length == 0){
[MBProgressHUD Javen_showError:@"请填写店铺简介!" onView:kWindow delay:0.7 complete:nil];
}else if (!imageUrl || imageUrl.length < 5) {
[MBProgressHUD Javen_showError:@"请上传店铺头像!" onView:kWindow delay:0.7 complete:nil];
}else{
[self showWithTitle:title content:shopDescription url:url image:image];
}
}
- (void)showWithTitle:(NSString *)title content:(NSString *)content url:(NSString *)url image:(UIImage *)image
{
......@@ -82,4 +69,45 @@
}
return _shareContentView;
}
- (void)shareShopWithTitle:(NSString *)title shopDescription:(NSString *)shopDescription url:(NSString *)url image:(UIImage *)image imageUrl:(NSString *)imageUrl
{
if (!title || title.length == 0) {
[MBProgressHUD Javen_showError:@"请填写店铺名!" onView:kWindow delay:0.7 complete:nil];
}else if(!shopDescription || shopDescription.length == 0){
[MBProgressHUD Javen_showError:@"请填写店铺简介!" onView:kWindow delay:0.7 complete:nil];
}else if (!imageUrl || imageUrl.length < 5) {
[MBProgressHUD Javen_showError:@"请上传店铺头像!" onView:kWindow delay:0.7 complete:nil];
}else{
[self showWithTitle:title content:shopDescription url:url image:image];
}
}
- (void)invitePartner
{
NSString *urlStr = [NSString stringWithFormat:@"%@ShopUser/gpregister/invitationCode/%@.html", [UserInfo shareInstance].webShopBaseUrl, [UserInfo shareInstance].invitationCode];
[self showWithTitle:@"欢迎加入新营养部落,一起共创健康未来。" content:@"在新营养部落开店,享受自由健康生活,免费游览欧洲北美。" url:urlStr image:[UIImage appIcon]];
}
- (void)shareGoodsWithGoodsModel:(CommotityListModel *)model image:(UIImage *)image
{
[MBProgressHUD showHUDAddedTo:kWindow animated:YES];
[[HTTPCilent shareCilent] GET:[NSString stringWithFormat:@"goods/brand/get/%@", model.brand.uuid] parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
[MBProgressHUD hideHUDForView:kWindow];
if (kIsResponseSuccess(responseObject)) {
NSString *description = responseObject[@"goodsBrand"][@"description"];
[self showWithTitle:model.name content:description url:[NSString stringWithFormat:@"%@Wap/detail/shop_id/%@/id/%@/hastbar/0/.html", [UserInfo shareInstance].webShopBaseUrl, [UserInfo shareInstance].shop.uuid, model.uuid] image:image];
}
} failure:^(NSURLSessionDataTask *task, NSError *error) {
}];
}
@end
......@@ -5,7 +5,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>zh_CN</string>
<key>CFBundleDisplayName</key>
<string>Aland</string>
<string>新营养部落</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
......@@ -43,44 +43,15 @@
</array>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>LSApplicationQueriesSchemes</key>
<array>
<!-- 微信 URL Scheme 白名单-->
<string>wechat</string>
<string>weixin</string>
<!-- 新浪微博 URL Scheme 白名单-->
<string>sinaweibohd</string>
<string>sinaweibo</string>
<string>sinaweibosso</string>
<string>weibosdk</string>
<string>weibosdk2.5</string>
<!-- QQ、Qzone URL Scheme 白名单-->
<string>mqqapi</string>
<string>mqq</string>
<string>mqqOpensdkSSoLogin</string>
......@@ -105,40 +76,46 @@
<string>mqzoneopensdkapi</string>
<string>mqqbrowser</string>
<string>mttbrowser</string>
<!-- 支付宝 URL Scheme 白名单-->
<string>alipay</string>
<string>alipayshare</string>
<!-- 人人 URL Scheme 白名单-->
<string>renrenios</string>
<string>renrenapi</string>
<string>renren</string>
<string>renreniphone</string>
<!-- 来往 URL Scheme 白名单-->
<string>laiwangsso</string>
<!-- 易信 URL Scheme 白名单-->
<string>yixin</string>
<string>yixinopenapi</string>
<!-- instagram URL Scheme 白名单-->
<string>instagram</string>
<!-- whatsapp URL Scheme 白名单-->
<string>whatsapp</string>
<!-- line URL Scheme 白名单-->
<string>line</string>
<!-- Facebook URL Scheme 白名单-->
<string>fbapi</string>
<string>fb-messenger-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
......@@ -24,7 +24,7 @@
#define kCutLineColorGray [UIColor colorWithWhite:0.820 alpha:1.000]
#define kCutLineColorDarkGray [UIColor colorWithWhite:0.757 alpha:1.000]
#define kPriceColor [UIColor colorWithRed:1.000 green:0.392 blue:0.392 alpha:1.000];
#define kPlaceHolderImage [UIImage imageNamed:@""]
#define kPlaceHolderImage [UIImage imageNamed:@"goodsPlaceHolder"]
#define kUserIconPlaceHolderImage [UIImage imageNamed:@"defaultUserIcon"]
......
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