Commit 756482e3 authored by Sandy's avatar Sandy

增加下拉刷新 上拉刷新

parent 9efb8c34
This diff is collapsed.
{
"images" : [
{
"idiom" : "universal",
"filename" : "mybankcard.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"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" : "no_bill_history_icon.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "no_bill_history_icon@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "myBankCard_trumpet.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "myBankCard_trumpet@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
......@@ -24,17 +24,20 @@
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(presentLoginView) name:@"presentLoginView" object:nil];
HomeViewController *homeVC = [[HomeViewController alloc] init];
StoreViewController *storeVC = [[StoreViewController alloc] init];
[self addChildVC:homeVC title:@"店铺" imageName:@"home_tabbar" selectImgName:@"home_selected_tabbar"];
// StoreViewController *storeVC = [[StoreViewController alloc] init];
// [self addChildVC:storeVC title:@"商城" imageName:@"store_tabbar" selectImgName:@"store_selected_tabbar"];
MassageViewController *masageVC = [[MassageViewController alloc] init];
[self addChildVCNoNavigationbar:masageVC title:@"消息" imageName:@"message_tabbar" selectImgName:@"message_selected_tabbar"];
MineViewController *mineVC = [[MineViewController alloc] init];
[self addChildVC:mineVC title:@"我的" imageName:@"mine_tabbar" selectImgName:@"mine_selected_tabbar"];
[self addChildVC:homeVC title:@"店铺" imageName:@"home_tabbar" selectImgName:@"home_selected_tabbar"];
// [self addChildVC:storeVC title:@"商城" imageName:@"store_tabbar" selectImgName:@"store_selected_tabbar"];
[self addChildVCNoNavigationbar:masageVC title:@"消息" imageName:@"message_tabbar" selectImgName:@"message_selected_tabbar"];
[self addChildVC:mineVC title:@"我的" imageName:@"mine_tabbar" selectImgName:@"mine_selected_tabbar"];
UIView *bgView = [[UIView alloc] initWithFrame:self.tabBar.bounds];
bgView.backgroundColor = [UIColor colorWithWhite:0.941 alpha:1.000];
......
......@@ -16,7 +16,7 @@
@property (nonatomic, assign) double salesVolume;
@property (nonatomic, assign) double visited;
@property (nonatomic, strong) CommotityListBrand *brand;
@property (nonatomic, assign) id engName;
@property (nonatomic, strong) id engName;
@property (nonatomic, strong) NSString *pictures;
@property (nonatomic, assign) double price;
@property (nonatomic, assign) double originalPrice;
......
......@@ -18,7 +18,7 @@
@property (nonatomic, strong) NSString *uuid;
@property (nonatomic, strong) JavenCreateInfo *createInfo;
@property (nonatomic, assign) double version;
@property (nonatomic, assign) id internalBaseClassDescription;
@property (nonatomic, strong) id internalBaseClassDescription;
@property (nonatomic, strong) NSString *name;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
......
......@@ -13,8 +13,8 @@
@property (nonatomic, strong) NSString *mobilephone;
@property (nonatomic, strong) NSString *code;
@property (nonatomic, assign) id name;
@property (nonatomic, assign) id portrait;
@property (nonatomic, strong) id name;
@property (nonatomic, strong) id portrait;
@property (nonatomic, strong) NSString *uuid;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
......
......@@ -11,15 +11,15 @@
@interface JavenDetailReseller : NSObject <NSCoding, NSCopying>
@property (nonatomic, assign) id birthday;
@property (nonatomic, assign) id portrait;
@property (nonatomic, strong) id birthday;
@property (nonatomic, strong) id portrait;
@property (nonatomic, strong) JavenOwnerOrg *ownerOrg;
@property (nonatomic, strong) NSString *code;
@property (nonatomic, assign) id telephone;
@property (nonatomic, strong) id telephone;
@property (nonatomic, strong) NSString *mobilephone;
@property (nonatomic, strong) NSString *uuid;
@property (nonatomic, strong) JavenLastModifyInfo *lastModifyInfo;
@property (nonatomic, assign) id socialContact;
@property (nonatomic, strong) id socialContact;
@property (nonatomic, strong) JavenCertificate *certificate;
@property (nonatomic, assign) double version;
@property (nonatomic, strong) NSString *name;
......@@ -29,9 +29,9 @@
@property (nonatomic, strong) JavenPasswordControl *passwordControl;
@property (nonatomic, strong) NSString *gender;
@property (nonatomic, strong) NSArray *roles;
@property (nonatomic, assign) id postalAddresses;
@property (nonatomic, strong) id postalAddresses;
@property (nonatomic, strong) JavenIdCard *idCard;
@property (nonatomic, assign) id referrer;
@property (nonatomic, strong) id referrer;
@property (nonatomic, strong) JavenShop *shop;
@property (nonatomic, strong) JavenCreateInfo *createInfo;
@property (nonatomic, assign) double order;
......
......@@ -14,20 +14,20 @@
@property (nonatomic, assign) BOOL days7Refund;
@property (nonatomic, strong) NSString *code;
@property (nonatomic, strong) JavenOwner *owner;
@property (nonatomic, assign) id upper;
@property (nonatomic, strong) id upper;
@property (nonatomic, strong) NSString *uuid;
@property (nonatomic, strong) NSString *path;
@property (nonatomic, strong) JavenLastModifyInfo *lastModifyInfo;
@property (nonatomic, assign) id contact;
@property (nonatomic, strong) id contact;
@property (nonatomic, assign) double version;
@property (nonatomic, assign) double favorited;
@property (nonatomic, strong) NSString *name;
@property (nonatomic, strong) NSString *state;
@property (nonatomic, strong) NSString *domain;
@property (nonatomic, strong) NSArray *roles;
@property (nonatomic, assign) id upperOrgPath;
@property (nonatomic, strong) id upperOrgPath;
@property (nonatomic, assign) double grade;
@property (nonatomic, assign) id siteDomain;
@property (nonatomic, strong) id siteDomain;
@property (nonatomic, strong) NSString *pictures;
@property (nonatomic, strong) JavenCreateInfo *createInfo;
@property (nonatomic, assign) double order;
......
......@@ -20,18 +20,18 @@
@interface JavenOrderModel : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) NSArray<JavenGoodsDetails *> *goodsDetails;
@property (nonatomic, assign) id shipTrackingNumber;
@property (nonatomic, strong) NSString *shipTrackingNumber;
@property (nonatomic, assign) double total;
@property (nonatomic, assign) double tax;
@property (nonatomic, assign) double commissions;
@property (nonatomic, strong) JavenReseller *reseller;
@property (nonatomic, assign) id shipType;
@property (nonatomic, strong) id shipType;
@property (nonatomic, strong) NSString *billNumber;
@property (nonatomic, assign) id billNumberEx;
@property (nonatomic, strong) id billNumberEx;
@property (nonatomic, assign) double goodsCount;
@property (nonatomic, assign) double discount;
@property (nonatomic, strong) NSString *uuid;
@property (nonatomic, assign) id payMethod;
@property (nonatomic, strong) id payMethod;
@property (nonatomic, strong) JavenLastModifyInfo *lastModifyInfo;
@property (nonatomic, strong) JavenTicket *ticket;
@property (nonatomic, assign) double version;
......@@ -43,9 +43,9 @@
@property (nonatomic, strong) JavenCreateInfo *createInfo;
@property (nonatomic, strong) JavenConsumer *consumer;
@property (nonatomic, assign) double goodsAmount;
@property (nonatomic, assign) id remark;
@property (nonatomic, strong) id remark;
@property (nonatomic, strong) JavenAddress *address;
@property (nonatomic, assign) id shkjtNo;
@property (nonatomic, strong) id shkjtNo;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
......
......@@ -181,8 +181,8 @@
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="K9h-pd-1Nq">
<rect key="frame" x="0.0" y="60" width="320" height="30"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="行邮税:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Hbh-zG-m7Y">
<rect key="frame" x="20" y="5" width="64" height="20"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="税费:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Hbh-zG-m7Y">
<rect key="frame" x="20" y="5" width="48" 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"/>
......
......@@ -17,6 +17,7 @@
@implementation OrderDetailTableViewCell
- (void)awakeFromNib {
self.selectionStyle = UITableViewCellSelectionStyleNone;
// Initialization code
}
......
......@@ -73,8 +73,17 @@
JavenAddress *address = model.address;
self.labelAddress.text = [NSString stringWithFormat:@"%@%@%@%@%@", address.nation ? address.nation : @"", address.province, address.city, address.country, address.address];
self.labelPhoneNumber.text = model.consumer.code;
[[HTTPCilent shareCilent] GET:[NSString stringWithFormat:@"order/getLogistics/%@", model.uuid] parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
} failure:^(NSURLSessionDataTask *task, NSError *error) {
}];
}
- (void)getLogistics {
}
- (IBAction)actionCall:(id)sender {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel://%@", self.labelPhoneNumber.text]]];
}
......
......@@ -11,8 +11,8 @@
<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">
<rect key="frame" x="0.0" y="212" width="320" height="138"/>
<view contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="9kH-LK-wk8">
<rect key="frame" x="0.0" y="176" 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">
<rect key="frame" x="45" y="22" width="68" height="21"/>
......@@ -92,8 +92,8 @@
</mask>
</variation>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="kMe-iN-q0b">
<rect key="frame" x="0.0" y="358" width="320" height="29"/>
<view contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="kMe-iN-q0b">
<rect key="frame" x="0.0" y="322" 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">
<rect key="frame" x="15" y="4" width="68" height="21"/>
......@@ -109,30 +109,33 @@
<constraint firstItem="nUT-vO-b28" firstAttribute="leading" secondItem="kMe-iN-q0b" secondAttribute="leading" constant="15" id="zCP-9S-LPU"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9bs-ar-XXb">
<rect key="frame" x="0.0" y="120" width="320" height="92"/>
<view contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="9bs-ar-XXb">
<rect key="frame" x="0.0" y="120" width="320" height="56"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="在上海市闵行区分公司进行扫描分配,配送员: 谢德彬,手机号18850620680" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="3" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qgd-cT-Y2S" customClass="MBLabelWithFontAdapter">
<rect key="frame" x="45" y="8" width="232" height="54"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="在上海市闵行区分公" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="3" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qgd-cT-Y2S" customClass="MBLabelWithFontAdapter">
<rect key="frame" x="45" y="8" width="232" height="18"/>
<constraints>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="20" id="xsK-I4-7Fb"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="textColor" red="0.48627450979999998" green="0.76470588240000004" blue="0.1450980392" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleAspectFit" image="icon_order_car" translatesAutoresizingMaskIntoConstraints="NO" id="a5k-hm-R8j">
<rect key="frame" x="4" y="23" width="30" height="23"/>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleAspectFit" misplaced="YES" image="icon_order_car" translatesAutoresizingMaskIntoConstraints="NO" id="a5k-hm-R8j">
<rect key="frame" x="4" y="6" width="30" height="23"/>
<constraints>
<constraint firstAttribute="height" constant="23" id="Px1-e0-ZaJ"/>
<constraint firstAttribute="width" constant="30" id="zsC-PQ-qJr"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2016-12-12 12:01:21" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="KAE-q5-yVI">
<rect key="frame" x="45" y="70" width="160" height="21"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="2016-12-12 12:01:21" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="KAE-q5-yVI">
<rect key="frame" x="45" y="34" width="160" 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"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="CPN-ej-33q">
<rect key="frame" x="8" y="91" width="304" height="1"/>
<view contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="CPN-ej-33q">
<rect key="frame" x="8" y="55" width="304" height="1"/>
<color key="backgroundColor" red="0.91271875000000002" green="0.91271875000000002" blue="0.91271875000000002" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="GY3-mx-DLT"/>
......@@ -226,7 +229,7 @@
<outlet property="labelState" destination="nyc-Bh-qZx" id="A7V-bB-9BO"/>
<outlet property="viewExpress" destination="9bs-ar-XXb" id="rCv-CW-UTd"/>
</connections>
<point key="canvasLocation" x="180" y="291"/>
<point key="canvasLocation" x="333" y="231"/>
</view>
</objects>
<resources>
......
......@@ -15,6 +15,7 @@
@property (nonatomic, weak) WKWebView * webView;
@property (nonatomic, strong) CommodityDetailBottomView *bottomView;
@property (nonatomic, strong) CommodityDetailTopView *topView;
@end
@implementation CommodityDetailViewController
......
......@@ -15,9 +15,9 @@
#import "CatgoryModel.h"
#import "JavenHotTagsModel.h"
#import "CommodityListModel/CommotityListModel.h"
#import "MJRefresh.h"
#define kCellID @"commodityCell"
#define kPageSize @10
#define kPageSize 20
@interface CommodityListViewController ()<UICollectionViewDataSource, UICollectionViewDelegate>
@property (nonatomic, strong) UICollectionView *collectionView;
@property (nonatomic, strong) SortView *sortView;
......@@ -38,6 +38,7 @@
self.navigationItem.title = @"商品列表";
self.view.backgroundColor = kBacroundColor;
self.field = @"";
self.page = 0;
self.direction = @"desc";
[self setUpSortView];
......@@ -84,8 +85,8 @@
@"parameters" : @[parameters]}],
@"orders" : @[@{@"field" : self.field,
@"direction" : self.direction}],
@"pageSize" : kPageSize,
@"page" : @0,
@"pageSize" : @(kPageSize),
@"page" : @(self.page),
@"probePages" : @0},
@"fetchParts" : @[@"string"]};
......@@ -95,9 +96,15 @@
for (NSDictionary *dic in responseObject[@"queryResult"]) {
CommotityListModel *model = [CommotityListModel modelObjectWithDictionary:dic];
[weakSelf.arrItemDatas addObject:model];
[weakSelf.collectionView reloadData];
}
[weakSelf.collectionView reloadData];
[weakSelf.collectionView.mj_header endRefreshing];
if ([responseObject[@"queryResult"] count] < kPageSize) {
[weakSelf.collectionView.mj_footer endRefreshingWithNoMoreData];
}else{
[weakSelf.collectionView.mj_footer endRefreshing];
}
} failure:^(NSURLSessionDataTask *task, NSError *error) {
}];
......@@ -128,7 +135,8 @@
}
//排序
- (void)sortAction:(NSInteger)row {
- (void)sortAction:(NSInteger)row
{
switch (row) {
case 0:
{
......@@ -206,6 +214,20 @@
_collectionView.dataSource = self;
_collectionView.backgroundColor = kBacroundColor;
[_collectionView registerNib:[UINib nibWithNibName:@"CommodityListCollectionViewCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:kCellID];
WS(weakSelf)
_collectionView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
weakSelf.page = 0;
[weakSelf resetReloadData];
}];
_collectionView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
self.page += 1;
[weakSelf setUpData];
}];
// _collectionView.mj_footer
}
......
......@@ -13,7 +13,7 @@
#import "JavenCustomer.h"
#import "CustomerViewController.h"
#define kPageSize @10
#define kPageSize @999
#define kCellId @"CustomerTableViewCell.h"
@interface CustomerManagementViewController ()<UISearchBarDelegate, UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) UISearchBar *searchBar;
......@@ -254,7 +254,7 @@
- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar
{
self.sortView.userInteractionEnabled = YES;
// self.sortView.userInteractionEnabled = YES;
self.searchBar.text = @"";
[self.searchBar endEditing:YES];
[self.tableView reloadData];
......@@ -263,7 +263,7 @@
- (BOOL)searchBarShouldBeginEditing:(UISearchBar *)searchBar
{
[self.sortView hide];
self.sortView.userInteractionEnabled = NO;
// self.sortView.userInteractionEnabled = NO;
self.searchBar.showsCancelButton = YES;
return YES;
}
......@@ -276,7 +276,7 @@
}
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar {
self.sortView.userInteractionEnabled = YES;
// self.sortView.userInteractionEnabled = YES;
}
......
......@@ -15,14 +15,19 @@
#import "JavenGoodsDetails.h"
#import "CommotityListModel.h"
#import "CommodityDetailViewController.h"
#import "OrderDetailViewController.h"
#import "CommodityDetailTopView.h"
#define kCellID @"cellId"
#define kPageSize @10
#define kTopHeight 291
@interface CustomerViewController ()<UITableViewDelegate, UITableViewDataSource>
@interface CustomerViewController ()<UITableViewDelegate, UITableViewDataSource, UIScrollViewDelegate>
@property (nonatomic, strong) CustomerTopView *topView;
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) NSMutableArray *arrDatas;
@property (nonatomic, strong) CommodityDetailTopView *aTopBackView;
@end
......@@ -33,6 +38,11 @@
[self setUpTableView];
[self setUpData];
[self.view addSubview:self.aTopBackView];
self.aTopBackView.buttonHome.hidden = YES;
self.aTopBackView.alpha = 0;
kButtonAddAction(self.aTopBackView.buttonBack, popAction);
// Do any additional setup after loading the view from its nib.
}
......@@ -90,15 +100,15 @@
self.topView.labelPhoneNumber.text = self.customer.consumer.mobilephone;
kButtonAddAction(self.topView.buttonBac, popAction);
self.tableView.contentInset = UIEdgeInsetsMake(291, 0, 0, 0);
self.tableView.contentOffset = CGPointMake(0, -291);
self.tableView.contentInset = UIEdgeInsetsMake(kTopHeight, 0, 0, 0);
self.tableView.contentOffset = CGPointMake(0, -kTopHeight);
[self.tableView addSubview:self.topView];
}
- (void)viewDidLayoutSubviews {
self.topView.frame = CGRectMake(0, -291, kWidth, 291);
self.topView.frame = CGRectMake(0, -kTopHeight, kWidth, kTopHeight);
}
......@@ -151,17 +161,34 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
JavenGoodsDetails *details = [self.arrDatas[indexPath.section] goodsDetails][indexPath.row];
CommodityDetailViewController *detailVC = [[CommodityDetailViewController alloc] init];
OrderDetailViewController *orderDetailVC = [[OrderDetailViewController alloc] init];
orderDetailVC.isShowNavigationBar = YES;
orderDetailVC.model = self.arrDatas[indexPath.section];
[self.navigationController pushViewController:orderDetailVC animated:YES];
CommotityListModel *model = [[CommotityListModel alloc] init];
model.uuid = details.goods.uuid;
model.name = details.goods.name;
}
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
OrderDetailTableViewCell *cell = (OrderDetailTableViewCell *)[tableView cellForRowAtIndexPath:indexPath];
detailVC.image = cell.imgCommdity.image;
detailVC.model = model;
[self.navigationController pushViewController:detailVC animated:YES];
CLog(@"%f",scrollView.contentOffset.y);
NSInteger position = -kTopHeight + 64;
if (scrollView.contentOffset.y > position) {
self.aTopBackView.alpha = (scrollView.contentOffset.y - position) * 1.0 / 64 > 1 ? 1 : (scrollView.contentOffset.y - position) * 1.0 / 64.0;
// CLog(@"%f",self.aTopBackView.alpha);
}else{
self.aTopBackView.alpha = 0;
}
}
- (CommodityDetailTopView *)aTopBackView {
if (!_aTopBackView) {
_aTopBackView = [CommodityDetailTopView viewWithNibName:@"CommodityDetailTopView"];
_aTopBackView.frame = CGRectMake(0, 0, kWidth, 86);
}
return _aTopBackView;
}
- (void)didReceiveMemoryWarning {
......
......@@ -12,10 +12,10 @@
#import "OrderExpressTableViewCell.h"
#import "JavenOrderModel.h"
#import "JavenGoodsDetails.h"
#import "MJRefresh.h"
#define kExpressCell @"OrderExpressTableViewCell.h"
#define kCellId @"OrderTableViewCell.h"
#define kPageSize @10
#define kPageSize 4
@interface NoPaymentTableViewController ()
@property (nonatomic, assign) NSInteger page;
......@@ -30,6 +30,17 @@
[self.tableView registerNib:[UINib nibWithNibName:@"OrderExpressTableViewCell" bundle:nil] forCellReuseIdentifier:kExpressCell];
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 64, 0);
WS(weakSelf)
self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
weakSelf.page = 0;
[weakSelf.arrDatas removeAllObjects];
[weakSelf setUpData];
}];
self.tableView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
self.page += 1;
[weakSelf setUpData];
}];
[self setUpData];
}
......@@ -46,7 +57,18 @@
for (NSDictionary *dic in responseObject[@"queryResult"]) {
JavenOrderModel *model = [JavenOrderModel modelObjectWithDictionary:dic];
[weakSelf.arrDatas addObject:model];
[weakSelf.tableView reloadData];
}
[weakSelf.tableView reloadData];
if (weakSelf.arrDatas.count < kPageSize) {
weakSelf.tableView.mj_footer.hidden = YES;
}
[weakSelf.tableView.mj_header endRefreshing];
NSArray *array = responseObject[@"queryResult"];
if ([array count] < kPageSize) {
[weakSelf.tableView.mj_footer endRefreshingWithNoMoreData];
}else{
[weakSelf.tableView.mj_footer endRefreshing];
}
} failure:^(NSURLSessionDataTask *task, NSError *error) {
......@@ -83,8 +105,8 @@
@"parameters" : @[orderState]}],
@"orders" : @[@{@"field" : @"createInfo.time",
@"direction" : @"desc"}],
@"pageSize" : kPageSize,
@"page" : @0,
@"pageSize" : @(kPageSize),
@"page" : @(self.page),
@"probePages" : @0},
@"fetchParts" : @[@"string"]};
return myDictionary;
......@@ -93,14 +115,14 @@
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if ([self.orderTag isEqualToString:@"待支付"]) {
}else if([self.orderTag isEqualToString:@"待发货"]){
}else if ([self.orderTag isEqualToString:@"已发货"]){
return 170 + 120 * [self.arrDatas[indexPath.row] goodsDetails].count;
}else if ([self.orderTag isEqualToString:@"已完成"]){
return 170 + 120 * [self.arrDatas[indexPath.row] goodsDetails].count;
}else if ([self.orderTag isEqualToString:@"已取消"]){
}
// if ([self.orderTag isEqualToString:@"待支付"]) {
// }else if([self.orderTag isEqualToString:@"待发货"]){
// }else if ([self.orderTag isEqualToString:@"已发货"]){
// return 170 + 120 * [self.arrDatas[indexPath.row] goodsDetails].count;
// }else if ([self.orderTag isEqualToString:@"已完成"]){
// return 170 + 120 * [self.arrDatas[indexPath.row] goodsDetails].count;
// }else if ([self.orderTag isEqualToString:@"已取消"]){
// }
return 115 + 120 * [self.arrDatas[indexPath.row] goodsDetails].count;
}
......@@ -114,33 +136,31 @@
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
#warning Incomplete implementation, return the number of sections
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
#warning Incomplete implementation, return the number of rows
return self.arrDatas.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if ([self.orderTag isEqualToString:@"已发货"] || [self.orderTag isEqualToString:@"已完成"]) {
OrderExpressTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kExpressCell forIndexPath:indexPath];
[cell cellWithModel:self.arrDatas[indexPath.row]];
[cell setState:_orderTag];
cell.checkExpress.hidden = NO;
return cell;
}else{
// if ([self.orderTag isEqualToString:@"已发货"] || [self.orderTag isEqualToString:@"已完成"]) {
// OrderExpressTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kExpressCell forIndexPath:indexPath];
//
// [cell cellWithModel:self.arrDatas[indexPath.row]];
// [cell setState:_orderTag];
// cell.checkExpress.hidden = NO;
// return cell;
//
// }else{
OrderTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellId forIndexPath:indexPath];
[cell cellWithModel:self.arrDatas[indexPath.row]];
[cell setState:_orderTag];
return cell;
}
// }
}
......
......@@ -15,4 +15,5 @@
@property (nonatomic, assign) ORDERTOPTYPE orderType;
@property (nonatomic, strong) JavenOrderModel *model;
@end
......@@ -21,6 +21,7 @@
@property (nonatomic, strong) OrderDetailBottomView *bottomView;
@property (nonatomic, strong) OrderDetailTopView *atopView;
@end
@implementation OrderDetailViewController
......@@ -41,6 +42,8 @@
OrderDetailTopView *topView = [OrderDetailTopView viewWithNibName:@"OrderDetailTopView"];
self.atopView = topView;
self.atopView.labelExpressTime.text = self.model.lastModifyInfo.time;
self.atopView.labelExpress.text = self.model.shipType;
self.atopView.orderType = self.orderType;
[self.atopView viewWithModel:self.model];
[self.tableView addSubview:topView];
......@@ -59,6 +62,8 @@
[self.view addSubview:viewBottom];
}
// Do any additional setup after loading the view.
}
......@@ -85,7 +90,7 @@
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 100;
return 110;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
......@@ -114,6 +119,8 @@
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
......
//
// JavenBillModel.h
//
// Created by Z on 16/5/16
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "JavenConsumer.h"
#import "JavenLastModifyInfo.h"
#import "JavenOrder.h"
#import "JavenIncome.h"
#import "JavenCreateInfo.h"
@class JavenConsumer, JavenLastModifyInfo, JavenOrder, JavenIncome, JavenCreateInfo;
@interface JavenBillModel : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) NSString *uuid;
@property (nonatomic, strong) NSString *state;
@property (nonatomic, strong) id confirmDate;
@property (nonatomic, assign) double version;
@property (nonatomic, strong) JavenConsumer *consumer;
@property (nonatomic, strong) NSString *domain;
@property (nonatomic, strong) id refundFlowNum;
@property (nonatomic, strong) JavenLastModifyInfo *lastModifyInfo;
@property (nonatomic, strong) NSString *action;
@property (nonatomic, strong) JavenOrder *order;
@property (nonatomic, strong) JavenIncome *income;
@property (nonatomic, strong) id lowerReseller;
@property (nonatomic, strong) JavenCreateInfo *createInfo;
@property (nonatomic, strong) id remark;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// JavenBillModel.m
//
// Created by Z on 16/5/16
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "JavenBillModel.h"
NSString *const kJavenBillModelUuid = @"uuid";
NSString *const kJavenBillModelState = @"state";
NSString *const kJavenBillModelConfirmDate = @"confirmDate";
NSString *const kJavenBillModelVersion = @"version";
NSString *const kJavenBillModelConsumer = @"consumer";
NSString *const kJavenBillModelDomain = @"domain";
NSString *const kJavenBillModelRefundFlowNum = @"refundFlowNum";
NSString *const kJavenBillModelLastModifyInfo = @"lastModifyInfo";
NSString *const kJavenBillModelAction = @"action";
NSString *const kJavenBillModelOrder = @"order";
NSString *const kJavenBillModelIncome = @"income";
NSString *const kJavenBillModelLowerReseller = @"lowerReseller";
NSString *const kJavenBillModelCreateInfo = @"createInfo";
NSString *const kJavenBillModelRemark = @"remark";
@interface JavenBillModel ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation JavenBillModel
@synthesize uuid = _uuid;
@synthesize state = _state;
@synthesize confirmDate = _confirmDate;
@synthesize version = _version;
@synthesize consumer = _consumer;
@synthesize domain = _domain;
@synthesize refundFlowNum = _refundFlowNum;
@synthesize lastModifyInfo = _lastModifyInfo;
@synthesize action = _action;
@synthesize order = _order;
@synthesize income = _income;
@synthesize lowerReseller = _lowerReseller;
@synthesize createInfo = _createInfo;
@synthesize remark = _remark;
+ (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.uuid = [self objectOrNilForKey:kJavenBillModelUuid fromDictionary:dict];
self.state = [self objectOrNilForKey:kJavenBillModelState fromDictionary:dict];
self.confirmDate = [self objectOrNilForKey:kJavenBillModelConfirmDate fromDictionary:dict];
self.version = [[self objectOrNilForKey:kJavenBillModelVersion fromDictionary:dict] doubleValue];
self.consumer = [JavenConsumer modelObjectWithDictionary:[dict objectForKey:kJavenBillModelConsumer]];
self.domain = [self objectOrNilForKey:kJavenBillModelDomain fromDictionary:dict];
self.refundFlowNum = [self objectOrNilForKey:kJavenBillModelRefundFlowNum fromDictionary:dict];
self.lastModifyInfo = [JavenLastModifyInfo modelObjectWithDictionary:[dict objectForKey:kJavenBillModelLastModifyInfo]];
self.action = [self objectOrNilForKey:kJavenBillModelAction fromDictionary:dict];
self.order = [JavenOrder modelObjectWithDictionary:[dict objectForKey:kJavenBillModelOrder]];
self.income = [JavenIncome modelObjectWithDictionary:[dict objectForKey:kJavenBillModelIncome]];
self.lowerReseller = [self objectOrNilForKey:kJavenBillModelLowerReseller fromDictionary:dict];
self.createInfo = [JavenCreateInfo modelObjectWithDictionary:[dict objectForKey:kJavenBillModelCreateInfo]];
self.remark = [self objectOrNilForKey:kJavenBillModelRemark fromDictionary:dict];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:self.uuid forKey:kJavenBillModelUuid];
[mutableDict setValue:self.state forKey:kJavenBillModelState];
[mutableDict setValue:self.confirmDate forKey:kJavenBillModelConfirmDate];
[mutableDict setValue:[NSNumber numberWithDouble:self.version] forKey:kJavenBillModelVersion];
[mutableDict setValue:[self.consumer dictionaryRepresentation] forKey:kJavenBillModelConsumer];
[mutableDict setValue:self.domain forKey:kJavenBillModelDomain];
[mutableDict setValue:self.refundFlowNum forKey:kJavenBillModelRefundFlowNum];
[mutableDict setValue:[self.lastModifyInfo dictionaryRepresentation] forKey:kJavenBillModelLastModifyInfo];
[mutableDict setValue:self.action forKey:kJavenBillModelAction];
[mutableDict setValue:[self.order dictionaryRepresentation] forKey:kJavenBillModelOrder];
[mutableDict setValue:[self.income dictionaryRepresentation] forKey:kJavenBillModelIncome];
[mutableDict setValue:self.lowerReseller forKey:kJavenBillModelLowerReseller];
[mutableDict setValue:[self.createInfo dictionaryRepresentation] forKey:kJavenBillModelCreateInfo];
[mutableDict setValue:self.remark forKey:kJavenBillModelRemark];
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.uuid = [aDecoder decodeObjectForKey:kJavenBillModelUuid];
self.state = [aDecoder decodeObjectForKey:kJavenBillModelState];
self.confirmDate = [aDecoder decodeObjectForKey:kJavenBillModelConfirmDate];
self.version = [aDecoder decodeDoubleForKey:kJavenBillModelVersion];
self.consumer = [aDecoder decodeObjectForKey:kJavenBillModelConsumer];
self.domain = [aDecoder decodeObjectForKey:kJavenBillModelDomain];
self.refundFlowNum = [aDecoder decodeObjectForKey:kJavenBillModelRefundFlowNum];
self.lastModifyInfo = [aDecoder decodeObjectForKey:kJavenBillModelLastModifyInfo];
self.action = [aDecoder decodeObjectForKey:kJavenBillModelAction];
self.order = [aDecoder decodeObjectForKey:kJavenBillModelOrder];
self.income = [aDecoder decodeObjectForKey:kJavenBillModelIncome];
self.lowerReseller = [aDecoder decodeObjectForKey:kJavenBillModelLowerReseller];
self.createInfo = [aDecoder decodeObjectForKey:kJavenBillModelCreateInfo];
self.remark = [aDecoder decodeObjectForKey:kJavenBillModelRemark];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:_uuid forKey:kJavenBillModelUuid];
[aCoder encodeObject:_state forKey:kJavenBillModelState];
[aCoder encodeObject:_confirmDate forKey:kJavenBillModelConfirmDate];
[aCoder encodeDouble:_version forKey:kJavenBillModelVersion];
[aCoder encodeObject:_consumer forKey:kJavenBillModelConsumer];
[aCoder encodeObject:_domain forKey:kJavenBillModelDomain];
[aCoder encodeObject:_refundFlowNum forKey:kJavenBillModelRefundFlowNum];
[aCoder encodeObject:_lastModifyInfo forKey:kJavenBillModelLastModifyInfo];
[aCoder encodeObject:_action forKey:kJavenBillModelAction];
[aCoder encodeObject:_order forKey:kJavenBillModelOrder];
[aCoder encodeObject:_income forKey:kJavenBillModelIncome];
[aCoder encodeObject:_lowerReseller forKey:kJavenBillModelLowerReseller];
[aCoder encodeObject:_createInfo forKey:kJavenBillModelCreateInfo];
[aCoder encodeObject:_remark forKey:kJavenBillModelRemark];
}
- (id)copyWithZone:(NSZone *)zone
{
JavenBillModel *copy = [[JavenBillModel alloc] init];
if (copy) {
copy.uuid = [self.uuid copyWithZone:zone];
copy.state = [self.state copyWithZone:zone];
copy.confirmDate = [self.confirmDate copyWithZone:zone];
copy.version = self.version;
copy.consumer = [self.consumer copyWithZone:zone];
copy.domain = [self.domain copyWithZone:zone];
copy.refundFlowNum = [self.refundFlowNum copyWithZone:zone];
copy.lastModifyInfo = [self.lastModifyInfo copyWithZone:zone];
copy.action = [self.action copyWithZone:zone];
copy.order = [self.order copyWithZone:zone];
copy.income = [self.income copyWithZone:zone];
copy.lowerReseller = [self.lowerReseller copyWithZone:zone];
copy.createInfo = [self.createInfo copyWithZone:zone];
copy.remark = [self.remark copyWithZone:zone];
}
return copy;
}
@end
......@@ -15,9 +15,8 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="129"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="CD7-rL-3Ij">
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="mybankcard" translatesAutoresizingMaskIntoConstraints="NO" id="CD7-rL-3Ij">
<rect key="frame" x="10" y="0.0" width="300" height="119"/>
<color key="backgroundColor" red="0.95294117649999999" green="0.43921568630000002" blue="0.062745098040000002" alpha="1" colorSpace="calibratedRGB"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="交通银行" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1bl-Gu-RDW">
<rect key="frame" x="90" y="22" width="76" height="23"/>
......@@ -80,5 +79,6 @@
</objects>
<resources>
<image name="8-副本-2(1)" width="165" height="141"/>
<image name="mybankcard" width="1017" height="367"/>
</resources>
</document>
//
// MyBillSectionHeader.h
// ALand
//
// Created by Z on 16/5/17.
// Copyright © 2016年 Z. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface MyBillSectionHeader : UIView
- (void)setHeaderTitle:(NSString *)title;
@end
//
// MyBillSectionHeader.m
// ALand
//
// Created by Z on 16/5/17.
// Copyright © 2016年 Z. All rights reserved.
//
#import "MyBillSectionHeader.h"
@interface MyBillSectionHeader ()
@property (weak, nonatomic) IBOutlet UILabel *labelTitle;
@end
@implementation MyBillSectionHeader
- (void)setHeaderTitle:(NSString *)title
{
self.labelTitle.text = [NSString stringWithFormat:@"%@月",title];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="MyBillSectionHeader">
<rect key="frame" x="0.0" y="0.0" width="320" height="36"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="本月" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2TT-f4-cek">
<rect key="frame" x="18" y="8" width="34" 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"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="0.97254901959999995" green="0.97254901959999995" blue="0.97254901959999995" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="2TT-f4-cek" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="aHN-md-UxT"/>
<constraint firstItem="2TT-f4-cek" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="18" id="k6w-tW-GIe"/>
</constraints>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<connections>
<outlet property="labelTitle" destination="2TT-f4-cek" id="3ln-na-fPp"/>
</connections>
<point key="canvasLocation" x="392" y="43"/>
</view>
</objects>
</document>
//
// MyBillsTableViewCell.h
// ALand
//
// Created by Z on 16/5/16.
// Copyright © 2016年 Z. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "JavenBillModel.h"
@interface MyBillsTableViewCell : UITableViewCell
- (void)cellWithModel:(JavenBillModel *)model;
@end
//
// MyBillsTableViewCell.m
// ALand
//
// Created by Z on 16/5/16.
// Copyright © 2016年 Z. All rights reserved.
//
#import "MyBillsTableViewCell.h"
@interface MyBillsTableViewCell ()
@property (weak, nonatomic) IBOutlet UIImageView *imgIcon;
@property (weak, nonatomic) IBOutlet UILabel *labelAmount;
@property (weak, nonatomic) IBOutlet UILabel *labelDescription;
@property (weak, nonatomic) IBOutlet UILabel *labelDate;
@end
@implementation MyBillsTableViewCell
- (void)awakeFromNib {
self.selectionStyle = UITableViewCellSelectionStyleNone;
self.imgIcon.layer.masksToBounds = YES;
self.imgIcon.layer.cornerRadius = self.imgIcon.width/2;
// Initialization code
}
- (void)cellWithModel:(JavenBillModel *)model
{
NSString *strAmount = [NSString stringWithFormat:@"%.2f", model.income.amount];
self.labelAmount.text = [strAmount hasPrefix:@"-"] ? strAmount : [NSString stringWithFormat:@"+%@", strAmount];
self.labelDate.text = [model.createInfo.time substringWithRange:NSMakeRange(0, 10)];
self.labelDescription.text = model.remark;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="123" id="KGk-i7-Jjw" customClass="MyBillsTableViewCell">
<rect key="frame" x="0.0" y="0.0" width="320" height="123"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="320" height="122"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="defaultUserIcon" translatesAutoresizingMaskIntoConstraints="NO" id="My3-qw-fjr">
<rect key="frame" x="8" y="26" width="70" height="70"/>
<constraints>
<constraint firstAttribute="height" constant="70" id="9fU-fv-8Wl"/>
<constraint firstAttribute="height" constant="70" id="ABX-pT-x4G"/>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="70" id="DBt-FR-BYK"/>
<constraint firstAttribute="width" constant="70" id="XHK-Si-Ecl"/>
<constraint firstAttribute="height" constant="70" id="ftV-gQ-vdu"/>
<constraint firstAttribute="width" constant="70" id="g4W-FH-Ohd"/>
</constraints>
<variation key="default">
<mask key="constraints">
<exclude reference="ABX-pT-x4G"/>
<exclude reference="ftV-gQ-vdu"/>
<exclude reference="g4W-FH-Ohd"/>
</mask>
</variation>
<variation key="heightClass=regular-widthClass=regular">
<mask key="constraints">
<exclude reference="ABX-pT-x4G"/>
<exclude reference="XHK-Si-Ecl"/>
<include reference="ftV-gQ-vdu"/>
<include reference="g4W-FH-Ohd"/>
</mask>
</variation>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="+15.11" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TaQ-cr-NjT">
<rect key="frame" x="86" y="26" width="70" height="30"/>
<fontDescription key="fontDescription" type="system" pointSize="25"/>
<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="用户1883372666购买商品,您获得佣金" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wGb-m1-hGn">
<rect key="frame" x="86" y="68" width="226" height="39"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" white="0.33333333329999998" alpha="0.81551682690000005" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="1kS-6z-lAE">
<rect key="frame" x="0.0" y="121" width="320" height="1"/>
<color key="backgroundColor" red="0.97254901959999995" green="0.97254901959999995" blue="0.97254901959999995" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="BFS-VG-iyE"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2015-00-23" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="g4G-Bl-ACo">
<rect key="frame" x="210" y="30" width="94" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="0.33333333329999998" alpha="0.77563701920000006" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="wGb-m1-hGn" firstAttribute="trailing" secondItem="H2p-sc-9uM" secondAttribute="trailingMargin" id="35Q-sy-Txt"/>
<constraint firstItem="TaQ-cr-NjT" firstAttribute="leading" secondItem="My3-qw-fjr" secondAttribute="trailing" constant="8" id="6La-l3-ux1"/>
<constraint firstItem="My3-qw-fjr" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="8" id="8Eg-HH-8b6"/>
<constraint firstAttribute="bottom" secondItem="1kS-6z-lAE" secondAttribute="bottom" id="CVT-UW-GNc"/>
<constraint firstItem="wGb-m1-hGn" firstAttribute="top" secondItem="TaQ-cr-NjT" secondAttribute="bottom" constant="13" id="DqG-gY-ING"/>
<constraint firstAttribute="trailing" secondItem="1kS-6z-lAE" secondAttribute="trailing" id="GML-gM-8Vr"/>
<constraint firstItem="wGb-m1-hGn" firstAttribute="leading" secondItem="My3-qw-fjr" secondAttribute="trailing" constant="8" id="Gd5-Kb-HTP"/>
<constraint firstItem="g4G-Bl-ACo" firstAttribute="centerY" secondItem="TaQ-cr-NjT" secondAttribute="centerY" id="KTh-My-P4u"/>
<constraint firstItem="wGb-m1-hGn" firstAttribute="top" secondItem="TaQ-cr-NjT" secondAttribute="bottom" constant="12" id="ODg-qG-Muf"/>
<constraint firstItem="1kS-6z-lAE" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="RqO-qZ-2gQ"/>
<constraint firstItem="wGb-m1-hGn" firstAttribute="leading" secondItem="My3-qw-fjr" secondAttribute="trailing" constant="8" id="Uzf-X5-BVd"/>
<constraint firstItem="g4G-Bl-ACo" firstAttribute="centerY" secondItem="TaQ-cr-NjT" secondAttribute="centerY" id="Y7g-sp-vwh"/>
<constraint firstItem="TaQ-cr-NjT" firstAttribute="leading" secondItem="My3-qw-fjr" secondAttribute="trailing" constant="8" id="bVa-Y7-UN4"/>
<constraint firstItem="My3-qw-fjr" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="fUy-Rf-Wti"/>
<constraint firstItem="TaQ-cr-NjT" firstAttribute="top" secondItem="My3-qw-fjr" secondAttribute="top" id="p5v-Y0-aQb"/>
<constraint firstAttribute="trailingMargin" secondItem="g4G-Bl-ACo" secondAttribute="trailing" constant="8" id="pq8-oa-cAG"/>
</constraints>
<variation key="default">
<mask key="constraints">
<exclude reference="6La-l3-ux1"/>
<exclude reference="DqG-gY-ING"/>
<exclude reference="Uzf-X5-BVd"/>
<exclude reference="Y7g-sp-vwh"/>
</mask>
</variation>
</tableViewCellContentView>
<connections>
<outlet property="imgIcon" destination="My3-qw-fjr" id="9wh-c5-LpJ"/>
<outlet property="labelAmount" destination="TaQ-cr-NjT" id="8Mb-93-CdM"/>
<outlet property="labelDate" destination="g4G-Bl-ACo" id="1kQ-6e-rCh"/>
<outlet property="labelDescription" destination="wGb-m1-hGn" id="FRR-WQ-xNi"/>
</connections>
<point key="canvasLocation" x="397" y="348.5"/>
</tableViewCell>
</objects>
<resources>
<image name="defaultUserIcon" width="84" height="84"/>
</resources>
</document>
//
// NoBillHistoryView.h
// ALand
//
// Created by Z on 16/5/18.
// Copyright © 2016年 Z. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface NoBillHistoryView : UIView
@end
//
// NoBillHistoryView.m
// ALand
//
// Created by Z on 16/5/18.
// Copyright © 2016年 Z. All rights reserved.
//
#import "NoBillHistoryView.h"
@implementation NoBillHistoryView
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="NoBillHistoryView">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleAspectFit" image="no_bill_history_icon" translatesAutoresizingMaskIntoConstraints="NO" id="wcx-Jt-zCa">
<rect key="frame" x="108" y="204" width="160" height="160"/>
<constraints>
<constraint firstAttribute="width" constant="160" id="1OI-85-nOX"/>
<constraint firstAttribute="height" constant="160" id="B4j-iP-BlW"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="店长,您还没有账单~" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="MqP-1n-k8Z">
<rect key="frame" x="97" y="389" width="182" height="23"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="19"/>
<color key="textColor" white="0.33333333329999998" alpha="0.61230769230000004" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="0.94509803921568625" green="0.94509803921568625" blue="0.94509803921568625" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="MqP-1n-k8Z" firstAttribute="top" secondItem="wcx-Jt-zCa" secondAttribute="bottom" constant="25" id="16g-tZ-M4g"/>
<constraint firstItem="wcx-Jt-zCa" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="3HR-mU-iRz"/>
<constraint firstItem="wcx-Jt-zCa" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" constant="-50" id="SVB-gp-3S8"/>
<constraint firstItem="MqP-1n-k8Z" firstAttribute="centerX" secondItem="wcx-Jt-zCa" secondAttribute="centerX" id="sca-tb-TMg"/>
</constraints>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina47"/>
</view>
</objects>
<resources>
<image name="no_bill_history_icon" width="206" height="215"/>
</resources>
</document>
......@@ -40,17 +40,19 @@
@"expiry" : @0};
WS(weakSelf)
[[HTTPCilent shareCilent] POST:@"reseller/modifyPassword" parameters:params success:^(NSURLSessionDataTask *task, id responseObject) {
[MBProgressHUD hideHUDForView:weakSelf.view];
if (kIsResponseSuccess(responseObject)) {
[[NSUserDefaults standardUserDefaults] setObject:[weakSelf.labelNewPassword.text MD5String] forKey:@"passWord"];
[[NSUserDefaults standardUserDefaults] synchronize];
[weakSelf reloginAction];
[MBProgressHUD hideHUDForView:weakSelf.view];
[MBProgressHUD Javen_showSuccess:@"修改成功!" onView:weakSelf.view delay:0.7 complete:^{
[weakSelf popAction];
}];
}else{
[MBProgressHUD Javen_showError:responseObject[@"message"] onView:weakSelf.view delay:0.7 complete:nil];
}
} failure:^(NSURLSessionDataTask *task, NSError *error) {
......
......@@ -9,14 +9,23 @@
#import "MyAcountViewController.h"
#import "JavenShopModel.h"
#import "MyAcountHelfViewController.h"
#import "MyBillViewController.h"
@interface MyAcountViewController ()
@property (nonatomic, strong) JavenShopModel *shopModel;
/** 待确认 */
@property (weak, nonatomic) IBOutlet UILabel *labelUnconfirmedBalance;
/** 可提现 */
@property (weak, nonatomic) IBOutlet UILabel *labelLalanc;
/** 已提现 */
@property (weak, nonatomic) IBOutlet UILabel *labelWithdrawAmount;
/** 累计收入 */
@property (weak, nonatomic) IBOutlet UILabel *labelAccumulatedIncome;
/** 账户余额 */
@property (weak, nonatomic) IBOutlet UILabel *labelTotalBalance;
/** 自销收入 */
@property (weak, nonatomic) IBOutlet UILabel *labelSelfSalesIncome;
/** 团队收入 */
@property (weak, nonatomic) IBOutlet UILabel *labelTeamIncome;
@end
......@@ -30,7 +39,6 @@
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
}
- (void)setUpdata {
......@@ -38,16 +46,21 @@
WS(weakSelf)
[[HTTPCilent shareCilent] GET:[NSString stringWithFormat:@"commission/getAccount/%@", [UserInfo shareInstance].uuid] parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
CLog(@"%p",weakSelf.shopModel);
NSDictionary *dic = responseObject[@"commissionAccount"];
weakSelf.labelLalanc.text = kMoneyFromIDNumber(dic[@"balance"]);
weakSelf.labelWithdrawAmount.text = kMoneyFromIDNumber(dic[@"withdrawAmount"]);
weakSelf.labelUnconfirmedBalance.text = kMoneyFromIDNumber(dic[@"unconfirmedBalance"]);
weakSelf.labelAccumulatedIncome.text = kMoneyFromIDNumber(dic[@"accumulatedIncome"]);
double unconfirmBalance = [dic[@"unconfirmedBalance"] doubleValue];
double balance = [dic[@"balance"] doubleValue];
weakSelf.labelTotalBalance.text = [NSString stringWithFormat:@"%.2f", (balance + unconfirmBalance)];
if (kIsResponseSuccess(responseObject)) {
CLog(@"%p",weakSelf.shopModel);
NSDictionary *dic = responseObject[@"commissionAccount"];
weakSelf.labelLalanc.text = kMoneyFromIDNumber(dic[@"balance"]);
weakSelf.labelWithdrawAmount.text = kMoneyFromIDNumber(dic[@"withdrawAmount"]);
weakSelf.labelUnconfirmedBalance.text = kMoneyFromIDNumber(dic[@"unconfirmedBalance"]);
weakSelf.labelAccumulatedIncome.text = kMoneyFromIDNumber(dic[@"accumulatedIncome"]);
weakSelf.labelSelfSalesIncome.text = kMoneyFromIDNumber(dic[@"selfIncome"]);
double unconfirmBalance = [dic[@"unconfirmedBalance"] doubleValue];
double balance = [dic[@"balance"] doubleValue];
weakSelf.labelTotalBalance.text = [NSString stringWithFormat:@"%.2f", (balance + unconfirmBalance)];
}else{
}
//[weakSelf.viewHomeTop updateTopViewInfo:weakSelf.shopModel];
} failure:^(NSURLSessionDataTask *task, NSError *error) {
......@@ -64,6 +77,9 @@
}
- (IBAction)actionGoBill:(id)sender {
MyBillViewController *billVC = [[MyBillViewController alloc] init];
billVC.isShowNavigationBar = YES;
[self.navigationController pushViewController:billVC animated:YES];
}
......
......@@ -29,7 +29,6 @@
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
NSString *strBankCardID = [textField.text stringByReplacingCharactersInRange:range withString:string];//变化后的字符串
if ([strBankCardID bankCardluhmCheck]) {
self.btnNext.enabled = YES;
}else{
......
......@@ -42,7 +42,6 @@
//对文字进行加工并赋值
- (void)machineStrings {
self.labelBankName.text = [MyBankClass returnBankName:self.bankCardID];
CLog(@"%@", self.labelBankName.text);
self.labelBankCardID.text = [NSString stringWithFormat:@"***************%@",[self.bankCardID substringWithRange:NSMakeRange(self.bankCardID.length - 4, 4)]];
}
......@@ -60,19 +59,19 @@
}
- (NSDictionary *)getParams {
JavenBankCards *bankCard;
JavenBankCards *bankCard;
if (self.reseller.certificate.bankCards.count > 0) {
bankCard = self.reseller.certificate.bankCards[0];
}else{
bankCard = [[JavenBankCards alloc] init];
}
bankCard.cardNo = self.bankCardID;
bankCard.bank = [self.labelBankName.text componentsSeparatedByString:@"·"][0];
bankCard.carrier = self.labelName.text;
NSDictionary *dic = [bankCard dictionaryRepresentation];
self.reseller.certificate.bankCards = @[dic];
NSDictionary *params = [self getParamsWithReseller:self.reseller];
return params;
}
......
......@@ -61,14 +61,14 @@
<constraint firstItem="WEh-Gr-4nd" firstAttribute="centerY" secondItem="abt-Dn-0ed" secondAttribute="centerY" id="rVO-mt-ccc"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="请填写银行卡信息(均已加密保护,保障您的用卡安全)" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sce-xX-4Yd">
<rect key="frame" x="8" y="128" width="304" height="36"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="请填写银行卡信息(均已加密保护,保障您的用卡安全;每月月底我们会将您的可提现余额转入您的提现账户,请务必填写正确!" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="3" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sce-xX-4Yd">
<rect key="frame" x="8" y="128" width="304" height="54"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="rQj-07-ht8">
<rect key="frame" x="0.0" y="172" width="320" height="50"/>
<rect key="frame" x="0.0" y="190" width="320" height="50"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="jlD-wV-7se">
<rect key="frame" x="0.0" y="0.0" width="320" height="50"/>
......@@ -118,7 +118,7 @@
</constraints>
</view>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="BO0-6u-dcw" userLabel="同意支付协议(已隐藏,暂时不做)">
<rect key="frame" x="22" y="230" width="25" height="25"/>
<rect key="frame" x="22" y="248" width="25" height="25"/>
<constraints>
<constraint firstAttribute="width" constant="25" id="1Oa-9x-EHd"/>
<constraint firstAttribute="height" constant="25" id="5vJ-Qd-78r"/>
......@@ -132,13 +132,13 @@
</connections>
</button>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="同意" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Wg9-bP-7rd">
<rect key="frame" x="55" y="232" width="36" height="22"/>
<rect key="frame" x="55" y="250" width="36" height="22"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="FIo-A2-df0">
<rect key="frame" x="91" y="226" width="108" height="34"/>
<rect key="frame" x="91" y="244" width="108" height="34"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<state key="normal" title="《支付协议》"/>
</button>
......
//
// ChangeMyBankCardViewController.h
// ALand
//
// Created by Z on 16/5/17.
// Copyright © 2016年 Z. All rights reserved.
//
#import "IBTUIViewController.h"
#import "JavenResellerBigModel.h"
@interface ChangeMyBankCardViewController : IBTUIViewController
@property (nonatomic, strong) JavenResellerBigModel *reseller;
@end
//
// ChangeMyBankCardViewController.m
// ALand
//
// Created by Z on 16/5/17.
// Copyright © 2016年 Z. All rights reserved.
//
#import "ChangeMyBankCardViewController.h"
#import "NSString+Category.h"
#import "MyBankClass.h"
#import "JavenBankCards.h"
@interface ChangeMyBankCardViewController ()<UITextFieldDelegate>
@property (weak, nonatomic) IBOutlet UITextField *labelCardNO;
@property (weak, nonatomic) IBOutlet UITextField *labelName;
@property (weak, nonatomic) IBOutlet UITextField *labelCardName;
@property (weak, nonatomic) IBOutlet UIButton *btnBottom;
@end
@implementation ChangeMyBankCardViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self setUpDefaults];
// Do any additional setup after loading the view from its nib.
}
- (void)setUpDefaults {
JavenBankCards *bankCard;
if (self.reseller.certificate.bankCards.count > 0) {
bankCard = self.reseller.certificate.bankCards[0];
}else{
bankCard = [[JavenBankCards alloc] init];
}
self.labelCardName.text = bankCard.bank;
self.labelCardNO.text = bankCard.cardNo;
self.labelName.text = bankCard.carrier;
self.title = @"修改银行卡";
self.labelCardNO.delegate = self;
}
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
//check cardNo validate
NSString *strBankCardID = [textField.text stringByReplacingCharactersInRange:range withString:string];//变化后的字符串
if ([strBankCardID bankCardluhmCheck]) {
NSString *strBankNameAndType = [MyBankClass returnBankName:strBankCardID];
self.labelCardName.text = [strBankNameAndType componentsSeparatedByString:@"·"][0];
}else{
self.labelCardName.text = @"";
}
return YES;
}
- (BOOL)textFieldShouldClear:(UITextField *)textField {
self.labelCardName.text = @"";
return YES;
}
- (IBAction)actionChange:(id)sender {
NSString *strCardNO = self.labelCardNO.text;
NSString *strCardName = self.labelCardName.text;
NSString *strName = self.labelName.text;
if (strCardNO.length > 0 && strCardName.length > 0 && strName.length > 0) {
[self changeResellerInfoWithDic:[self getParams]];
}else{
}
}
/** 发送网络请求的参数 */
- (NSDictionary *)getParams {
JavenBankCards *bankCard;
if (self.reseller.certificate.bankCards.count > 0) {
bankCard = self.reseller.certificate.bankCards[0];
}else{
bankCard = [[JavenBankCards alloc] init];
}
bankCard.cardNo = self.labelCardNO.text;
bankCard.bank = self.labelCardName.text;
bankCard.carrier = self.labelName.text;
NSDictionary *dic = [bankCard dictionaryRepresentation];
self.reseller.certificate.bankCards = @[dic];
NSDictionary *params = [self getParamsWithReseller:self.reseller];
return params;
}
- (NSDictionary *)getParamsWithReseller:(JavenResellerBigModel *)resellerModel {
UserInfo *user = [UserInfo shareInstance];
NSDictionary *reseller = [resellerModel dictionaryRepresentation];
NSDictionary *params = @{@"operCtx" : @{@"time" : [[NSDate date] timeStampNumber],
@"domain" : user.domain,
@"operator" : @{@"id" : user.uuid,
@"fullName" : user.name}},
@"reseller" : reseller};
return params;
}
/** 把修改的信息上传到服务器 */
- (void)changeResellerInfoWithDic:(NSDictionary *)params
{
[MBProgressHUD Javen_showMessage:@"提交中…" onView:self.view];
WS(weakSelf)
[[HTTPCilent shareCilent] POST:@"reseller/save" parameters:params success:^(NSURLSessionDataTask *task, id responseObject) {
[MBProgressHUD hideHUDForView:weakSelf.view];
if ([responseObject[@"code"] isEqualToNumber:@0]) {
[MBProgressHUD Javen_showSuccess:@"修改成功!" onView:weakSelf.view delay:0.7 complete:^{
[weakSelf popAction];
}];
}else{
[MBProgressHUD Javen_showError:responseObject[@"message"] onView:weakSelf.view delay:0.7 complete:nil];
}
} failure:^(NSURLSessionDataTask *task, NSError *error) {
}];
}
- (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
......@@ -11,7 +11,7 @@
#import "AddBankCardIDViewController.h"
#import "UITableView+Category.h"
#import "BankTableViewCell.h"
#import "ChangeMyBankCardViewController.h"
#define kCellID @"cellID"
@interface MyBandCardViewController ()<UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) UIImageView *imgNoCardBackview;
......@@ -81,10 +81,20 @@
}
- (void)goAddBankCardID {
AddBankCardIDViewController *addBankIDVC = [[AddBankCardIDViewController alloc] init];
addBankIDVC.isShowNavigationBar = YES;
addBankIDVC.reseller = self.reseller;
[self.navigationController pushViewController:addBankIDVC animated:YES];
if (self.bottomView.btnAdd.isSelected) {
//修改银行卡
ChangeMyBankCardViewController *changeVC = [[ChangeMyBankCardViewController alloc] init];
changeVC.isShowNavigationBar = YES;
changeVC.reseller = self.reseller;
[self PushViewController:changeVC animated:YES];
}else{
//添加银行卡
AddBankCardIDViewController *addBankIDVC = [[AddBankCardIDViewController alloc] init];
addBankIDVC.isShowNavigationBar = YES;
addBankIDVC.reseller = self.reseller;
[self.navigationController pushViewController:addBankIDVC animated:YES];
}
}
- (void)getReseller{
......
//
// MyBillViewController.h
// ALand
//
// Created by Z on 16/5/16.
// Copyright © 2016年 Z. All rights reserved.
//
#import "IBTUIViewController.h"
@interface MyBillViewController : IBTUIViewController
@end
//
// MyBillViewController.m
// ALand
//
// Created by Z on 16/5/16.
// Copyright © 2016年 Z. All rights reserved.
//
#import "MyBillViewController.h"
#import "JavenSingleSortView.h"
#import "UITableView+Category.h"
#import "MyBillsTableViewCell.h"
#import "JavenBillModel.h"
#import "MyBillSectionHeader.h"
#import "NoBillHistoryView.h"
#define kCellID @"MyBillsTableViewCell.h"
#define kPageSize @999
#define kHeader @"header"
@interface MyBillViewController ()<UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) id state;
@property (nonatomic, strong) id confirmed;
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) NSMutableArray *arrDatas;
@property (nonatomic, strong) NSMutableDictionary *dicMonthData;
@property (nonatomic, strong) NSMutableArray *arrSortedData;
@property (nonatomic, strong) NSMutableArray *arrSortedMonths;
@property (nonatomic, strong) NoBillHistoryView *noBillHistoryView;
@end
@implementation MyBillViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.state = [NSNull null];
self.confirmed = [NSNull null];
JavenSingleSortView *sortView = [JavenSingleSortView sortViewTitles:@[@"全部账单",@"进账单",@"出账单",@"待确认账单"]];
sortView.frame = CGRectMake(0, 0, 150, 35);
self.navigationItem.titleView = sortView;
sortView.leftTableSelect = ^(NSInteger row){
[self changeConditions:row];
};
[self setUpTableView];
[self setUpData];
self.noBillHistoryView = [NoBillHistoryView viewWithNibName:@"NoBillHistoryView"];
self.noBillHistoryView.hidden = YES;
[self.view addSubview:self.noBillHistoryView];
// Do any additional setup after loading the view from its nib.
}
- (void)viewWillLayoutSubviews {
self.noBillHistoryView.frame = CGRectMake(0, 0, kWidth, kHeight);
}
#pragma mark - tableviewDelegate
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return self.arrSortedMonths.count;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 100;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [self.arrSortedData[section] count];
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
return 30;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
MyBillSectionHeader *header = [MyBillSectionHeader viewWithNibName:@"MyBillSectionHeader"];;
[header setHeaderTitle:self.arrSortedMonths[section]];
return header;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
MyBillsTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellID forIndexPath:indexPath];
[cell cellWithModel:self.arrSortedData[indexPath.section][indexPath.row]];
return cell;
}
- (void)setUpTableView {
self.tableView = [UITableView plainTableViewWithTarget:self cellNibName:@"MyBillsTableViewCell" cellId:kCellID];
[self.tableView registerNib:[UINib nibWithNibName:@"MyBillSectionHeader" bundle:nil] forHeaderFooterViewReuseIdentifier:kHeader];
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
self.tableView.frame = CGRectMake(0, 0, kWidth, kHeight - 64);
[self.view addSubview:self.tableView];
}
- (void)changeConditions:(NSInteger)row
{
self.navigationController.navigationBar.userInteractionEnabled = NO;
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
switch (row) {
case 0:
{
self.state = [NSNull null];
self.confirmed = @"";
}
break;
case 1://
{
self.state = @[@"income"];
self.confirmed = @"confirmed only";
}
break;
case 2://
{
self.state = @[@"refund",@"withdraw"];
self.confirmed = [NSNull null];
}
break;
case 3://
{
self.state = @[@"income"];
self.confirmed = @"action equals";
}
break;
default:
break;
}
[self resetReloadData];
}
- (void)resetReloadData {
[self.dicMonthData removeAllObjects];
[self.arrSortedData removeAllObjects];
[self.arrDatas removeAllObjects];
[self.arrSortedMonths removeAllObjects];
[self setUpData];
}
- (void)setUpData {
WS(weakSelf)
[[HTTPCilent shareCilent] POST:@"commission/queryAccountHistory" parameters:[self getParams] success:^(NSURLSessionDataTask *task, id responseObject) {
if (kIsResponseSuccess(responseObject)) {
for (NSDictionary *dic in responseObject[@"queryResult"]) {
JavenBillModel *model = [JavenBillModel modelObjectWithDictionary:dic];
[weakSelf.dicMonthData setObject:model forKey:[model.createInfo.time substringWithRange:NSMakeRange(0, 7)]];
[weakSelf.arrDatas addObject:model];
}
weakSelf.noBillHistoryView.hidden = !weakSelf.arrDatas.count == 0;
[weakSelf sortModelWithMonth];
[MBProgressHUD hideHUDForView:weakSelf.view animated:YES];
self.navigationController.navigationBar.userInteractionEnabled = YES;
[weakSelf.tableView reloadData];
}
} failure:^(NSURLSessionDataTask *task, NSError *error) {
}];
}
- (void)sortModelWithMonth
{
NSArray *months = self.dicMonthData.allKeys;
// NSArray *months = @[@"2016-01",@"2015-03",@"2016-01",@"2016-05"];
NSArray *sortMonths = [months sortedArrayUsingComparator:^NSComparisonResult(id _Nonnull obj1, id _Nonnull obj2) {
return [obj2 compare:obj1];
}];
NSInteger count = sortMonths.count > 3 ? 3 : sortMonths.count;
for (NSInteger i = 0; i < count; i++) {
NSMutableArray *array = [NSMutableArray array];
for (JavenBillModel *model in self.arrDatas) {
NSString *timeStr = [model.createInfo.time substringWithRange:NSMakeRange(0, 7)];
if ([timeStr isEqualToString:sortMonths[i]]) {
CLog(@"%@", model.createInfo.time);
[array addObject:model];
}
}
[self.arrSortedMonths addObject:sortMonths[i]];
[self.arrSortedData addObject:array];
}
}
- (NSDictionary *)getParams
{
NSDictionary *myDictionary = @{@"defintion" : @{@"conditions" : @[@{@"operation" : @"domain equals",
@"parameter" : @{@"operation" : @"string"},
@"parameters" : @[[UserInfo shareInstance].domain]},
@{@"operation" : @"reseller uuid equals",
@"parameter" : @{@"operation" : @"string"},
@"parameters" : @[[UserInfo shareInstance].uuid]},
@{@"operation" : @"action equals",
@"parameter" : @{@"operation" : @"string"},
@"parameters" : self.state},
@{@"operation" : self.confirmed,
@"parameter" : @{@"operation" : @"string"},
@"parameters" : [NSNull null]}
],
@"orders" : @[@{@"field" : @"createInfo.time",
@"direction" : @"desc"}],
@"pageSize" : kPageSize,
@"page" : @0,
@"probePages" : @0},
@"fetchParts" : @[@"string"]};
return myDictionary;
}
#pragma mark - lazyLoading
- (NSMutableArray *)arrDatas {
if (!_arrDatas) {
_arrDatas = [NSMutableArray array];
}
return _arrDatas;
}
- (NSMutableDictionary *)dicMonthData {
if (!_dicMonthData) {
_dicMonthData = [NSMutableDictionary dictionary];
}
return _dicMonthData;
}
- (NSMutableArray *)arrSortedData {
if (!_arrSortedData) {
_arrSortedData = [NSMutableArray array];
}
return _arrSortedData;
}
- (NSMutableArray *)arrSortedMonths {
if (!_arrSortedMonths) {
_arrSortedMonths = [NSMutableArray array];
}
return _arrSortedMonths;
}
- (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
......@@ -83,7 +83,7 @@
initInfo.nickName=resellerInfo.name;
initInfo.email=@"Your user email";
initInfo.email=@"unkown";
ZCKitInfo *uiInfo=[ZCKitInfo new];
......
......@@ -148,6 +148,7 @@
return @"";
}
//正则判断手机号码格式
+ (BOOL)validatePhone:(NSString *)phone
{
......
//
// JavenSingleSortView.h
// ALand
//
// Created by Z on 16/5/16.
// Copyright © 2016年 Z. All rights reserved.
//
#import <UIKit/UIKit.h>
typedef void (^sortBlock)(BOOL);
typedef void (^selectedRow)(NSInteger);
@interface JavenSingleSortView : UIView
@property (nonatomic, copy) sortBlock leftSortAction;
@property (nonatomic, copy) sortBlock rightAction;
@property (nonatomic, copy) selectedRow rightTableSelect;
@property (nonatomic, copy) selectedRow leftTableSelect;
+ (instancetype)sortViewTitles:(NSArray *)leftTitles;
- (void)hide;;
- (void)defaultSelectISLeft:(BOOL)isLeft row:(NSInteger)row;
- (NSArray *)getCurrentTitles;
@end
//
// JavenSingleSortView.m
// ALand
//
// Created by Z on 16/5/16.
// Copyright © 2016年 Z. All rights reserved.
//
#import "JavenSingleSortView.h"
#import "CoverShadowView.h"
#import "IBTUIViewController.h"
@interface JavenSingleSortView ()
<UITableViewDataSource, UITableViewDelegate>
@property (nonatomic, assign) CGFloat clickCount;
@property (nonatomic, strong) CoverShadowView *coverView;
@property (nonatomic, strong) UIButton *leftBtn;
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) NSArray *arrTitles;
@property (nonatomic, strong) NSArray *arrLeft;
@property (nonatomic, assign) NSInteger selectedMark;
@property (nonatomic, strong) CoverShadowView *viewTopCover;
@property (nonatomic, assign) BOOL isTableOpen;
@property (nonatomic, assign) BOOL isLeft;
@property (nonatomic, assign) BOOL isLeftOpen;
@property (nonatomic, assign) CGFloat PI;
@end
@implementation JavenSingleSortView
+ (instancetype)sortViewTitles:(NSArray *)leftTitles
{
JavenSingleSortView *sortView = [[JavenSingleSortView alloc] initSortViewTitles:leftTitles];
return sortView;
}
- (instancetype)initSortViewTitles:(NSArray *)leftTitles {
self = [super init];
self.PI = 3.143;
self.arrLeft = leftTitles;
// self.backgroundColor = kSysWhite;
UIButton *leftButton = [UIButton buttonWithType:UIButtonTypeCustom];
[self addSubview:leftButton];
self.leftBtn = leftButton;
[leftButton setTitle:[NSString stringWithFormat:@"%@ ", leftTitles[0]] forState:UIControlStateNormal];
[leftButton setTitleColor:kTextColorBlack forState:UIControlStateNormal];
[leftButton setImage:[UIImage imageNamed:@"downIcon"] forState:UIControlStateNormal];
[leftButton addTarget:self action:@selector(leftAction:) forControlEvents:UIControlEventTouchUpInside];
leftButton.imageView.tintColor = kTextColorGray;
leftButton.imageEdgeInsets = UIEdgeInsetsMake(0, 115, 0, 0);
leftButton.sd_layout.topEqualToView(self).leftEqualToView(self).rightSpaceToView(self,0).bottomEqualToView(self);
[leftButton updateLayout];
return self;
}
- (CoverShadowView *)coverView {
if (!_coverView) {
_coverView = [[CoverShadowView alloc] initWithSpaceToTop:64];
[self.window addSubview:_coverView];
WS(weakSelf)
_coverView.tapAction = ^{
[weakSelf hide];
};
}
return _coverView;
}
- (UITableView *)tableView {
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 62, ScreenSize.width, 0) style:UITableViewStylePlain];
_tableView.delegate = self;
_tableView.dataSource = self;
[_tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"reuseIdentifier"];
[self.window addSubview:_tableView];
[self showTableView];
}
return _tableView;
}
#pragma mark ==============animate==============
- (void)showTableView {
[self.coverView show];
[self setOtherUserInteraction:NO];
WS(weakSelf)
self.isTableOpen = YES;
[UIView animateWithDuration:0.3 delay:0 options:(UIViewAnimationOptionCurveEaseIn) animations:^{
weakSelf.tableView.height = 44 * weakSelf.arrTitles.count;
[weakSelf.tableView reloadData];
} completion:nil];
}
- (void)hideTableView {
[self.coverView hide];
[self setOtherUserInteraction:YES];
self.isTableOpen = NO;
WS(weakSelf)
[UIView animateWithDuration:0.3 animations:^{
weakSelf.tableView.height = 0;
}];
}
//设置界面上其它的按钮是否可以点击
- (void)setOtherUserInteraction:(BOOL)state {
// [self viewController].navigationItem.leftBarButtonItem.enabled = state;
// [self viewController].navigationItem.rightBarButtonItem.enabled = state;
//[self viewController].view.userInteractionEnabled = state;
}
#pragma mark ==============table delegate==============
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.arrTitles.count;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[self.tableView deselectRowAtIndexPath:indexPath animated:YES];
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
[cell setAccessoryType:UITableViewCellAccessoryCheckmark];
self.selectedMark = indexPath.row;
[tableView reloadData];
NSString *space;
if (self.arrTitles == self.arrLeft) {
space = @"left";
[self leftAction:nil];
[self setBtn:self.leftBtn Title:self.arrTitles[indexPath.row]];
CLog(@"%@", self.arrTitles[indexPath.row]);
[self.leftBtn setTitleColor:kCustomGreenColor forState:UIControlStateNormal];
self.leftTableSelect(indexPath.row);
self.isLeft = YES;
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"reuseIdentifier" forIndexPath:indexPath];
cell.textLabel.text = self.arrTitles[indexPath.row];
// Configure the cell...
cell.tintColor = kCustomGreenColor;
if (self.isLeft == self.isLeftOpen) {
if (self.selectedMark == indexPath.row) {
cell.textLabel.textColor = kCustomGreenColor;
[cell setAccessoryType:UITableViewCellAccessoryCheckmark];
}else{
cell.textLabel.textColor = [UIColor blackColor];
[cell setAccessoryType:UITableViewCellAccessoryNone];
}
}else{
cell.textLabel.textColor = [UIColor blackColor];
[cell setAccessoryType:UITableViewCellAccessoryNone];
}
return cell;
}
- (void)setBtn:(UIButton *)btn Title:(NSString *)str {
//只是为了让标题位置正确
[btn setTitle:[NSString stringWithFormat:@"%@ ",str] forState:UIControlStateNormal];
if (str.length > 6) {
btn.imageEdgeInsets = UIEdgeInsetsMake(0, 135, 0, 0);
btn.titleEdgeInsets = UIEdgeInsetsMake(0, -20, 0, 0);
}else if (str.length > 4) {
btn.imageEdgeInsets = UIEdgeInsetsMake(0, 130, 0, 0);
btn.titleEdgeInsets = UIEdgeInsetsMake(0, -10, 0, 0);
}else{
btn.imageEdgeInsets = UIEdgeInsetsMake(0, 115, 0, 0);
btn.titleEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 0);
}
NSLog(@"%f", self.leftBtn.titleLabel.frame.size.width);
}
- (void)leftAction:(UIButton *)btn {
// [self rightIconAnimateToDefault];
_arrTitles = _arrLeft;
if (self.clickCount != self.PI) {
[self showTableView];
self.isLeftOpen = YES;
}else{
[self hideTableView];
self.isLeftOpen = NO;
}
[self iconAnimate];
}
#pragma mark =========== animate ===========
//控制左边的按钮上的剪头动画
- (void)iconAnimate {
self.clickCount = self.clickCount + self.PI;
if (self.clickCount > self.PI * 2 ) {
self.clickCount = self.PI;
}
WS(weakSelf)
[UIView animateWithDuration:0.3 animations:^{
weakSelf.leftBtn.imageView.transform = CGAffineTransformMakeRotation(weakSelf.clickCount);
}];
}
- (void)leftIconAnimateToDefault {
self.leftBtn.imageView.transform = CGAffineTransformMakeRotation(0);
self.isLeftOpen = NO;
self.clickCount = 0;
}
- (UIViewController *)viewController
{
for (UIView* next = [self superview]; next; next = next.superview) {
UIResponder *nextResponder = [next nextResponder];
if ([nextResponder isKindOfClass:[IBTUIViewController class]]) {
return (UIViewController *)nextResponder;
}
}
return nil;
}
- (void)hide {
if (self.isTableOpen == YES) {
if (_arrTitles == _arrLeft) {
[self leftAction:nil];
}else{
// [self rightBtnAction];
}
}
}
- (void)defaultSelectISLeft:(BOOL)isLeft row:(NSInteger)row
{
self.selectedMark = row;
if (isLeft) {
self.isLeft = YES;
self.arrTitles = self.arrLeft;
[self setBtn:self.leftBtn Title:self.arrTitles[row]];
[self.leftBtn setTitleColor:kCustomGreenColor forState:UIControlStateNormal];
// [self.rightBtn setTitleColor:kTextColorBlack forState:UIControlStateNormal];
self.isLeft = YES;
}else{
// self.isLeft = NO;
// self.arrTitles = self.arrRight;
// [self setBtn:self.rightBtn Title:self.arrTitles[row]];
// [self.leftBtn setTitleColor:kTextColorBlack forState:UIControlStateNormal];
// [self.rightBtn setTitleColor:kCustomGreenColor forState:UIControlStateNormal];
// self.isLeft = NO;
}
}
- (NSArray *)getCurrentTitles {
NSArray *array = [NSArray arrayWithArray:self.arrTitles];
return array;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end
......@@ -16,7 +16,7 @@
@property (nonatomic, assign) double salesVolume;
@property (nonatomic, assign) double visited;
@property (nonatomic, strong) JavenBrand *brand;
@property (nonatomic, assign) id engName;
@property (nonatomic, strong) id engName;
@property (nonatomic, strong) NSString *pictures;
@property (nonatomic, assign) double price;
@property (nonatomic, assign) double originalPrice;
......
//
// JavenIncome.h
//
// Created by Z on 16/5/16
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@class JavenReseller;
@interface JavenIncome : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) JavenReseller *reseller;
@property (nonatomic, assign) double incomeLevel;
@property (nonatomic, assign) double amount;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// JavenIncome.m
//
// Created by Z on 16/5/16
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "JavenIncome.h"
#import "JavenReseller.h"
NSString *const kJavenIncomeReseller = @"reseller";
NSString *const kJavenIncomeIncomeLevel = @"incomeLevel";
NSString *const kJavenIncomeAmount = @"amount";
@interface JavenIncome ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation JavenIncome
@synthesize reseller = _reseller;
@synthesize incomeLevel = _incomeLevel;
@synthesize amount = _amount;
+ (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.reseller = [JavenReseller modelObjectWithDictionary:[dict objectForKey:kJavenIncomeReseller]];
self.incomeLevel = [[self objectOrNilForKey:kJavenIncomeIncomeLevel fromDictionary:dict] doubleValue];
self.amount = [[self objectOrNilForKey:kJavenIncomeAmount fromDictionary:dict] doubleValue];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:[self.reseller dictionaryRepresentation] forKey:kJavenIncomeReseller];
[mutableDict setValue:[NSNumber numberWithDouble:self.incomeLevel] forKey:kJavenIncomeIncomeLevel];
[mutableDict setValue:[NSNumber numberWithDouble:self.amount] forKey:kJavenIncomeAmount];
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.reseller = [aDecoder decodeObjectForKey:kJavenIncomeReseller];
self.incomeLevel = [aDecoder decodeDoubleForKey:kJavenIncomeIncomeLevel];
self.amount = [aDecoder decodeDoubleForKey:kJavenIncomeAmount];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:_reseller forKey:kJavenIncomeReseller];
[aCoder encodeDouble:_incomeLevel forKey:kJavenIncomeIncomeLevel];
[aCoder encodeDouble:_amount forKey:kJavenIncomeAmount];
}
- (id)copyWithZone:(NSZone *)zone
{
JavenIncome *copy = [[JavenIncome alloc] init];
if (copy) {
copy.reseller = [self.reseller copyWithZone:zone];
copy.incomeLevel = self.incomeLevel;
copy.amount = self.amount;
}
return copy;
}
@end
//
// JavenOrder.h
//
// Created by Z on 16/5/16
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface JavenOrder : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) id name;
@property (nonatomic, strong) id uuid;
@property (nonatomic, strong) id code;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// JavenOrder.m
//
// Created by Z on 16/5/16
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "JavenOrder.h"
NSString *const kJavenOrderName = @"name";
NSString *const kJavenOrderUuid = @"uuid";
NSString *const kJavenOrderCode = @"code";
@interface JavenOrder ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation JavenOrder
@synthesize name = _name;
@synthesize uuid = _uuid;
@synthesize code = _code;
+ (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.name = [self objectOrNilForKey:kJavenOrderName fromDictionary:dict];
self.uuid = [self objectOrNilForKey:kJavenOrderUuid fromDictionary:dict];
self.code = [self objectOrNilForKey:kJavenOrderCode fromDictionary:dict];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:self.name forKey:kJavenOrderName];
[mutableDict setValue:self.uuid forKey:kJavenOrderUuid];
[mutableDict setValue:self.code forKey:kJavenOrderCode];
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.name = [aDecoder decodeObjectForKey:kJavenOrderName];
self.uuid = [aDecoder decodeObjectForKey:kJavenOrderUuid];
self.code = [aDecoder decodeObjectForKey:kJavenOrderCode];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:_name forKey:kJavenOrderName];
[aCoder encodeObject:_uuid forKey:kJavenOrderUuid];
[aCoder encodeObject:_code forKey:kJavenOrderCode];
}
- (id)copyWithZone:(NSZone *)zone
{
JavenOrder *copy = [[JavenOrder alloc] init];
if (copy) {
copy.name = [self.name copyWithZone:zone];
copy.uuid = [self.uuid copyWithZone:zone];
copy.code = [self.code copyWithZone:zone];
}
return copy;
}
@end
......@@ -12,8 +12,8 @@
@interface JavenPasswordControl : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) NSString *created;
@property (nonatomic, assign) id initPassword;
@property (nonatomic, assign) id expiry;
@property (nonatomic, strong) id initPassword;
@property (nonatomic, strong) id expiry;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
......
......@@ -14,24 +14,24 @@
@property (nonatomic, assign) BOOL days7Refund;
@property (nonatomic, strong) NSString *code;
@property (nonatomic, strong) JavenOwner *owner;
@property (nonatomic, assign) id upper;
@property (nonatomic, strong) id upper;
@property (nonatomic, strong) NSString *uuid;
@property (nonatomic, strong) NSString *path;
@property (nonatomic, strong) JavenLastModifyInfo *lastModifyInfo;
@property (nonatomic, assign) id contact;
@property (nonatomic, strong) id contact;
@property (nonatomic, assign) double version;
@property (nonatomic, assign) double favorited;
@property (nonatomic, strong) NSString *name;
@property (nonatomic, strong) NSString *state;
@property (nonatomic, strong) NSString *domain;
@property (nonatomic, strong) NSArray *roles;
@property (nonatomic, assign) id upperOrgPath;
@property (nonatomic, strong) id upperOrgPath;
@property (nonatomic, assign) double grade;
@property (nonatomic, assign) id siteDomain;
@property (nonatomic, strong) id siteDomain;
@property (nonatomic, strong) NSString *pictures;
@property (nonatomic, strong) JavenCreateInfo *createInfo;
@property (nonatomic, assign) double order;
@property (nonatomic, assign) id shopDescription;
@property (nonatomic, strong) id shopDescription;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
......
......@@ -13,7 +13,7 @@
@property (nonatomic, strong) NSString *type;
@property (nonatomic, strong) NSString *content;
@property (nonatomic, assign) id title;
@property (nonatomic, strong) id title;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
......
......@@ -10,4 +10,5 @@ pod 'AFNetworking', '~> 3.0.4'
pod 'MJExtension', '~> 3.0.10'
pod 'UMengSocial', '~> 5.0'
pod "Qiniu", :git => 'https://github.com/qiniu/objc-sdk.git', :branch => 'AFNetworking-3.x'
pod 'SobotFramework', '~> 1.4.2'
\ No newline at end of file
pod 'SobotFramework', '~> 1.4.2'
pod 'MJRefresh', '~> 3.1.0'
\ No newline at end of file
......@@ -21,6 +21,7 @@ PODS:
- IQKeyboardManager (4.0.2)
- MBProgressHUD (0.9.2)
- MJExtension (3.0.10)
- MJRefresh (3.1.0)
- Qiniu (7.0.16):
- AFNetworking (~> 3)
- HappyDNS (~> 0.2)
......@@ -40,6 +41,7 @@ DEPENDENCIES:
- IQKeyboardManager (~> 4.0.0)
- MBProgressHUD (~> 0.9.2)
- MJExtension (~> 3.0.10)
- MJRefresh (~> 3.1.0)
- Qiniu (from `https://github.com/qiniu/objc-sdk.git`, branch `AFNetworking-3.x`)
- SDAutoLayout (~> 1.31)
- SDCycleScrollView (~> 1.61)
......@@ -65,6 +67,7 @@ SPEC CHECKSUMS:
IQKeyboardManager: 2341089c4ae25fa2fa82ce356a259fcd267dc6b6
MBProgressHUD: 1569cf7ace17a8bac47aabfbb8580a49690386d1
MJExtension: d86aacb740c87519d20e3cca55b6fa4be6cc7548
MJRefresh: 743e6404967d1c2c688472ea3ecfde247d872db4
Qiniu: 340bc55a6478d89591754aa7d1fd8b5977863991
SDAutoLayout: ea6e2ae9fbb438aa2feb0c4363dba9297e98638a
SDCycleScrollView: 806fedb9342ab03b58b84442f985517b42c7cbb7
......
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