Commit 9ff300ba authored by 勾芒's avatar 勾芒

caoyunxiao

parent 4be36868
......@@ -33,9 +33,42 @@
@property (weak, nonatomic) IBOutlet UIButton *enddateButton;
/**
* 所有客户tableview
*/
@property (weak, nonatomic) IBOutlet UITableView *allCustomerTableview;
/**
* 至
*/
@property (weak, nonatomic) IBOutlet UILabel *redesignLabe;
/**
* 最近到访时间:
*/
@property (weak, nonatomic) IBOutlet UILabel *RecentlydateLabe;
@end
This diff is collapsed.
......@@ -7,7 +7,7 @@
//
#import <UIKit/UIKit.h>
#import "MyclientEntityModel.h"
@interface AllCutomerTableViewCell : UITableViewCell
......@@ -54,7 +54,10 @@
@property (weak, nonatomic) IBOutlet UILabel *customerAddress;
/**
* 数据源model
*/
@property (nonatomic,strong) MyclientEntityModel *Model;
......
......@@ -15,6 +15,20 @@
// Initialization code
}
#pragma mark - 数据源赋值
- (void)setModel:(MyclientEntityModel *)Model
{
_Model = Model;
[self.customerHeader sd_setImageWithURL:[NSURL URLWithString:_Model.picture] placeholderImage:ReplaceImage];
self.customerName.text = _Model.name;
self.customerPhoneName.text = _Model.mobile;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
......
......@@ -109,7 +109,6 @@
condition.page = page;
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/consumer/query"] WithRequestType:0 WithParameter:condition WithReturnValueBlock:^(id returnValue) {
[self RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
......@@ -203,6 +202,9 @@
self.customerNameField.text = model.name;
self.phoneNumberField.text = model.mobile;
self.customerAddress.text = model.address;
//保存客户ID
[Shoppersmanager manager].currentCustomer = YES;
[Customermanager manager].customerID = model.fid;
[self.addpersonInformationButton setTitle:@"退出当前客户" forState:UIControlStateNormal];
self.changePersonInformationButton.hidden = NO;
}
......@@ -224,6 +226,8 @@
self.phoneNumberField.enabled = YES;
self.companyNameField.enabled = YES;
self.changePersonInformationButton.hidden = YES;
[Shoppersmanager manager].currentCustomer = NO;
[Customermanager manager].customerID = nil;
//全部为为选中状态
for (InformationTableViewCell *cell in self.informationTableview.visibleCells) {
......@@ -278,6 +282,7 @@
//保存客户ID
[Customermanager manager].customerID = returnValue[@"data"];
[Shoppersmanager manager].currentCustomer = YES;
[self SuccessMBProgressView:returnValue[@"新增成功"]];
[self.addpersonInformationButton setTitle:@"退出当前客户" forState:UIControlStateNormal];
self.changePersonInformationButton.hidden = NO;
......
//
// DateSelectedViewController.h
// Lighting
//
// Created by 曹云霄 on 16/5/13.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
@interface DateSelectedViewController : BaseViewController
/**
* UIDatePickerView
*/
@property (weak, nonatomic) IBOutlet UIDatePicker *datePickerView;
/**
* 完成选择后回调、传回选中时间
*/
@property (nonatomic,copy) void(^selectedDateBlock)(NSDate *date);
@end
//
// DateSelectedViewController.m
// Lighting
//
// Created by 曹云霄 on 16/5/13.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "DateSelectedViewController.h"
@interface DateSelectedViewController ()
@end
@implementation DateSelectedViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
[self uiConfigAction];
}
#pragma mark -布局
- (void)uiConfigAction
{
//今天为最大日期
self.datePickerView.maximumDate = [NSDate date];
[self.datePickerView addTarget:self action:@selector(dateChanged:) forControlEvents:UIControlEventValueChanged];
}
#pragma mark -选择时间完成回调
-(void)dateChanged:(id)sender{
UIDatePicker* control = (UIDatePicker*)sender;
/*添加你自己响应代码*/
NSLog(@"%@",control.date);
}
#pragma mark -完成筛选
- (IBAction)completeScreeningButtonClick:(UIButton *)sender {
if (self.selectedDateBlock) {
self.selectedDateBlock(self.datePickerView.date);
}
[self dismissViewControllerAnimated:YES completion:nil];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="DateSelectedViewController">
<connections>
<outlet property="datePickerView" destination="mwJ-SC-y3o" id="qpR-lf-rFm"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="300" height="250"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<datePicker contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" datePickerMode="date" minuteInterval="1" translatesAutoresizingMaskIntoConstraints="NO" id="mwJ-SC-y3o">
<rect key="frame" x="0.0" y="50" width="300" height="200"/>
<date key="date" timeIntervalSinceReferenceDate="484811565.065534">
<!--2016-05-13 05:52:45 +0000-->
</date>
</datePicker>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="mvi-lG-F1A">
<rect key="frame" x="233" y="0.0" width="67" height="50"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<state key="normal" title="完成">
<color key="titleColor" red="0.34901960780000002" green="0.67450980390000004" blue="0.86274509799999999" alpha="1" colorSpace="calibratedRGB"/>
</state>
<connections>
<action selector="completeScreeningButtonClick:" destination="-1" eventType="touchUpInside" id="kq4-rD-Rra"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="mwJ-SC-y3o" secondAttribute="bottom" id="5Di-Lz-rJb"/>
<constraint firstAttribute="trailing" secondItem="mwJ-SC-y3o" secondAttribute="trailing" id="7qh-ZF-57w"/>
<constraint firstItem="mwJ-SC-y3o" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="K3X-3G-auT"/>
<constraint firstItem="mwJ-SC-y3o" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" constant="50" id="wgw-ou-ZQB"/>
</constraints>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="298" y="131"/>
</view>
</objects>
</document>
......@@ -70,8 +70,8 @@
self.userNameLoginView.layer.cornerRadius = 10;
self.forgotPasswordButton.titleLabel.font = [UIFont boldSystemFontOfSize:16];
self.followHeartView=[[FollowHeartViewController alloc]init];
self.userName.text = @"sh1";
self.passWord.text = @"1234567890";
self.userName.text = @"demo1";
self.passWord.text = @"123456";
}
......
......@@ -25,4 +25,6 @@
@property (nonatomic,copy) NSString *goodsID;
@end
......@@ -92,7 +92,6 @@
#pragma mark -header赋值
- (void)HeaderViewAssignment
{
self.headerView.inventoryNumber.text = [self.entity.inv stringValue];
self.headerView.serialNumber.text = self.entity.series;
self.headerView.nameLabe.text = self.entity.name;
self.headerView.brandName.text = self.entity.brandId;
......@@ -230,23 +229,34 @@
#pragma mark -添加至购物车
- (void)addGoodsShoppingbags
{
TOShopcartEntity *shopCar = [[TOShopcartEntity alloc]init];
shopCar.goodsId = self.entity.fid;
shopCar.goodsCode = self.entity.code;
shopCar.goodsName = self.entity.name;
// shopCar.good
//判断是否有当前客户
if (![Shoppersmanager manager].currentCustomer) {
[self ErrorMBProgressView:@"必须设置当前客户"];
return;
}
[self CreateMBProgressHUDLoding];
SaveShoppingCartRequest *shopCar = [[SaveShoppingCartRequest alloc]init];
shopCar.consumerId = [[Customermanager manager] customerID];
shopCar.goodsId = _goodsID;
shopCar.count = [self.headerView.goodsNumber.text intValue];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/shopcart/save"] WithRequestType:0 WithParameter:shopCar WithReturnValueBlock:^(id returnValue) {
NSLog(@"%@",returnValue);
[self RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
[self SuccessMBProgressView:@"加入购物车成功"];
}else
{
[self ErrorMBProgressView:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
} WithFailureBlock:^(id error) {
NSLog(@"%@",error);
[self RemoveMBProgressHUDLoding];
}];
}
......
......@@ -69,13 +69,13 @@
}
- (void)viewWillAppear:(BOOL)animated
{
if (self.productCollectionView != nil) {
[self getGoodsListDatas];
}
}
//- (void)viewWillAppear:(BOOL)animated
//{
// if (self.productCollectionView != nil) {
//
// [self getGoodsListDatas];
// }
//}
- (void)viewDidLoad {
[super viewDidLoad];
......@@ -83,6 +83,7 @@
self.view.backgroundColor = [UIColor blueColor];
[self uiConfigAction];
[self getGoodsListDatas];
[self getScreeningdatas];
}
......
......@@ -7,7 +7,7 @@
//
#import "BaseViewController.h"
#import "screeningButton.h"
@interface SceneLibraryViewController : BaseViewController
......@@ -29,21 +29,39 @@
*/
@property (weak, nonatomic) IBOutlet UIButton *accordingStyle;
/**
* 数据风格
* 背景View
*/
@property (weak, nonatomic) IBOutlet UIButton *dataStyleButton;
@property (weak, nonatomic) IBOutlet UIView *backView;
/**
* 房型风格
* 风格按钮
*/
@property (weak, nonatomic) IBOutlet UIButton *houseStyleButton;
@property (strong, nonatomic) screeningButton *StyleButton;
/**
* 背景View
* 房型按钮
*/
@property (weak, nonatomic) IBOutlet UIView *backView;
@property (strong, nonatomic) screeningButton *SpaceButton;
@end
......@@ -9,7 +9,7 @@
#import "SceneLibraryViewController.h"
#import "SeceneLibraryCollectionViewCell.h"
@interface SceneLibraryViewController ()<UICollectionViewDelegate,UICollectionViewDataSource>
@interface SceneLibraryViewController ()<UICollectionViewDelegate,UICollectionViewDataSource,ReturnTableviewcellIndexpathdelegate>
......@@ -22,17 +22,39 @@
* 列表数据
*/
@property (nonatomic,strong) SceneResponse *response;
/**
* 筛选cell个数图片
*/
@property (nonatomic,strong) NSArray *imageArray;
@end
@implementation SceneLibraryViewController
#pragma mark -初始化
- (NSArray *)imageArray
{
if (_imageArray == nil) {
_imageArray = [NSArray arrayWithObjects:@"视角1",@"视角",@"视角3", nil];
}
return _imageArray;
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[self uiConfigAction];
[self getdatasAction];
[self getSceneLibrarydatas];
}
#pragma mark -UI
......@@ -44,6 +66,33 @@
self.seceneLibraryCollectionLayout.sectionInset = UIEdgeInsetsMake(5, 0, 5, 0);
self.seceneLibararyCollectionView.dataSource = self;
self.seceneLibararyCollectionView.delegate = self;
//设置按钮
self.StyleButton = [screeningButton buttonWithType:UIButtonTypeCustom];
self.StyleButton.frame = CGRectMake(ScreenWidth-400, 14, 150, 30);
self.StyleButton.backgroundColor = kTCColor(131, 131, 131);
[self.StyleButton setTitle:@"风格" forState:UIControlStateNormal];
[self.StyleButton addTarget:self action:@selector(screeningStyleButtonClick:) forControlEvents:UIControlEventTouchUpInside];
[self.StyleButton setImage:TCImage(@"down_arr") forState:UIControlStateNormal];
self.StyleButton.layer.masksToBounds = YES;
self.StyleButton.layer.cornerRadius = 10;
self.SpaceButton = [screeningButton buttonWithType:UIButtonTypeCustom];
self.SpaceButton.frame = CGRectMake(ScreenWidth-200, 14, 150, 30);
[self.SpaceButton setTitle:@"房型" forState:UIControlStateNormal];
self.SpaceButton.layer.masksToBounds = YES;
self.SpaceButton.backgroundColor = kTCColor(131, 131, 131);
[self.SpaceButton addTarget:self action:@selector(HouseStyleButtonClick:) forControlEvents:UIControlEventTouchUpInside];
[self.SpaceButton setImage:TCImage(@"down_arr") forState:UIControlStateNormal];
self.SpaceButton.layer.cornerRadius = 10;
[self.backView addSubview:self.StyleButton];
[self.backView addSubview:self.SpaceButton];
//默认数据
SceneCondition *condition = [[SceneCondition alloc]init];
DataPage *page = [[DataPage alloc]init];
page.page = 0;
condition.page = page;
[self getSceneLibrarydatas:condition];
}
......@@ -51,10 +100,8 @@
- (void)getdatasAction
{
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/scene/getSceneFilter"] WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[self RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
self.filter = [[SceneFilter alloc]initWithDictionary:returnValue[@"data"] error:nil];
......@@ -69,27 +116,22 @@
} WithFailureBlock:^(id error) {
[self RemoveMBProgressHUDLoding];
}];
}
#pragma mark -获取场景列表数据
- (void)getSceneLibrarydatas
- (void)getSceneLibrarydatas:(SceneCondition *)condition
{
SceneCondition *condition = [[SceneCondition alloc]init];
DataPage *page = [[DataPage alloc]init];
page.page = 0;
condition.page = page;
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/scene/query"] WithRequestType:0 WithParameter:condition WithReturnValueBlock:^(id returnValue) {
[self RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
NSLog(@"%@",returnValue);
self.response = [[SceneResponse alloc]initWithDictionary:returnValue[@"data"] error:nil];
[self.seceneLibararyCollectionView reloadData];
}
else
{
......@@ -100,7 +142,7 @@
} WithFailureBlock:^(id error) {
[self RemoveMBProgressHUDLoding];
}];
}
......@@ -109,58 +151,118 @@
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
SeceneLibraryCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"secenelibrary" forIndexPath:indexPath];
cell.model = [self.response.list objectAtIndex_opple:indexPath.item];
return cell;
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
return 20;
return self.response.list.count;
}
#pragma mark -切换显示风格
- (IBAction)SwitchdisplayStyleClick:(UIButton *)sender {
self.seceneLibraryCollectionLayout.itemSize = CGSizeMake((ScreenWidth-10)/6, (ScreenWidth-10)/6-50);
[self.seceneLibararyCollectionView reloadData];
[self ShowPopoverViewController:CGSizeMake(55, 180) Withdatas:self.imageArray ShowButton:sender SelectedIndex:100];
}
#pragma mark -筛选风格
- (IBAction)screeningStyleButtonClick:(UIButton *)sender {
- (void)screeningStyleButtonClick:(UIButton *)sender {
PopoverViewController *popover = [[PopoverViewController alloc]init];
popover.datasArray = @[@"你好",@"你好"];
popover.contentSize = CGSizeMake(150, 300);
popover.preferredContentSize = CGSizeMake(150, 300);
popover.modalPresentationStyle = UIModalPresentationPopover;
UIPopoverPresentationController *pop = popover.popoverPresentationController;
pop.permittedArrowDirections = UIPopoverArrowDirectionAny;
pop.sourceView = popover.view;
pop.barButtonItem = [[UIBarButtonItem alloc]initWithCustomView:sender];
[self presentViewController:popover animated:YES completion:nil];
[self ShowPopoverViewController:CGSizeMake(200, 300) Withdatas:self.filter.styles ShowButton:sender SelectedIndex:0];
}
#pragma mark -房型风格
- (IBAction)HouseStyleButtonClick:(UIButton *)sender {
- (void)HouseStyleButtonClick:(UIButton *)sender {
[self ShowPopoverViewController:CGSizeMake(200, 300) Withdatas:self.filter.space ShowButton:sender SelectedIndex:1];
}
#pragma mark -弹出popover视图控制器
- (void)ShowPopoverViewController:(CGSize)size Withdatas:(NSArray *)datasArray ShowButton:(UIButton *)button SelectedIndex:(NSInteger)index
{
PopoverViewController *popover = [[PopoverViewController alloc]init];
popover.datasArray = @[@"你好",@"你好"];
popover.contentSize = CGSizeMake(150, 300);
popover.preferredContentSize = CGSizeMake(150, 300);
popover.datasArray = datasArray;
popover.delegate = self;
popover.Selectedindex = index;
if (size.width == 55) {
popover.isPictures = YES;
}
popover.contentSize = size;
popover.preferredContentSize = size;
popover.modalPresentationStyle = UIModalPresentationPopover;
UIPopoverPresentationController *pop = popover.popoverPresentationController;
pop.permittedArrowDirections = UIPopoverArrowDirectionAny;
pop.sourceView = popover.view;
pop.barButtonItem = [[UIBarButtonItem alloc]initWithCustomView:sender];
pop.barButtonItem = [[UIBarButtonItem alloc]initWithCustomView:button];
[self presentViewController:popover animated:YES completion:nil];
}
#pragma mark -选中筛选条件回传typecode
- (void)returnCellindexpathwithrow:(NSString *)Type WithcellTitle:(NSString *)title Withselected:(NSInteger)Selected
{
[self dismissViewControllerAnimated:YES completion:nil];
SceneCondition *condition = [[SceneCondition alloc]init];
DataPage *page = [[DataPage alloc]init];
page.page = 0;
condition.page = page;
//房型code
if (Selected) {
condition.spaceEquals = Type;
[self.SpaceButton setTitle:title forState:UIControlStateNormal];
}else
{//风格code
condition.styleEquals = Type;
[self.StyleButton setTitle:title forState:UIControlStateNormal];
}
[self getSceneLibrarydatas:condition];
}
#pragma mark -筛选条件回传cellindex
- (void)returnWithIndexSelected:(NSInteger)selectedIndex
{
NSInteger showcellNumber;
switch (selectedIndex) {
case 0:
{
showcellNumber = 2;
}
break;
case 1:
{
showcellNumber = 3;
}
break;
case 2:
{
showcellNumber = 4;
}
break;
default:
break;
}
[self.accordingStyle setBackgroundImage:TCImage([self.imageArray objectAtIndex_opple:selectedIndex]) forState:UIControlStateNormal];
[self dismissViewControllerAnimated:YES completion:nil];
self.seceneLibraryCollectionLayout.itemSize = CGSizeMake((ScreenWidth-showcellNumber*2)/showcellNumber, (ScreenWidth-showcellNumber*2)/showcellNumber-50);
[self.seceneLibararyCollectionView reloadData];
}
- (void)didReceiveMemoryWarning {
......
......@@ -10,4 +10,19 @@
@interface SeceneLibraryCollectionViewCell : UICollectionViewCell
/**
* 数据源
*/
@property (nonatomic,strong) TOSceneEntity *model;
/**
* 场景图片
*/
@property (weak, nonatomic) IBOutlet UIImageView *scenarioImageView;
@end
......@@ -10,4 +10,15 @@
@implementation SeceneLibraryCollectionViewCell
#pragma mark -赋值
- (void)setModel:(TOSceneEntity *)model
{
_model = model;
[self.scenarioImageView sd_setImageWithURL:[NSURL URLWithString:_model.pricure] placeholderImage:ReplaceImage];
}
@end
//
// ShopcarModel.h
// Lighting
//
// Created by 曹云霄 on 16/5/13.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "opple_objc_json_client.h"
@interface ShopcarModel : TOShopcartEntity
/**
* 保存选中状态
*/
@property (nonatomic,assign) BOOL isSelected;
/**
* 修改后的价格
*/
@property (nonatomic,copy) NSString *ChangeSprice;
/**
* 选中的商品个数
*/
@property (nonatomic,copy) NSString *SelectedGoodsNumber;
@end
//
// ShopcarModel.m
// Lighting
//
// Created by 曹云霄 on 16/5/13.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "ShopcarModel.h"
@implementation ShopcarModel
@end
......@@ -7,7 +7,7 @@
//
#import <UIKit/UIKit.h>
#import "ShopcarModel.h"
@interface ShoppingTableViewCell : UITableViewCell
/**
......@@ -49,8 +49,10 @@
/**
* 数据源model
*/
@property (nonatomic,strong) ShopcarModel *model;
......
......@@ -16,8 +16,20 @@
}
#pragma mark -赋值
- (void)setModel:(ShopcarModel *)model
{
_model = model;
[self.goodsImageView sd_setImageWithURL:[NSURL URLWithString:_model.goods.pictures] placeholderImage:ReplaceImage];
self.goodsInformationLabe.text = _model.goods.name;
self.tagsPriceLabe.text = [_model.goods.tagPrice stringValue];
self.clinchTextfield.text = [_model.goods.costPrice stringValue];
self.goodsNumbersLabe.text = [NSString stringWithFormat:@"%d",_model.goodsNum];
self.productPriceLabe.text = [_model.goods.costPrice stringValue];
}
#pragma mark -增加或者减少商品
- (IBAction)reduceAndaddButtonClick:(UIButton *)sender {
......@@ -30,7 +42,7 @@
#pragma mark -商品选中
- (IBAction)selectedButtonClick:(UIButton *)sender {
sender.selected = YES;
}
......
......@@ -10,14 +10,20 @@
#import "ShoppingTableViewCell.h"
#import "AppDelegate.h"
#import "GenerateOrdersViewController.h"
#import "ShopcarModel.h"
@interface ShoppingViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *shoppingTableview;
@property (nonatomic,strong) NSMutableArray *datasArray;
/**
* 购物车数据源
*/
@property (nonatomic,strong) NSMutableArray *shopResponseArray;
@end
@implementation ShoppingViewController
......@@ -28,11 +34,11 @@
*/
- (NSMutableArray *)datasArray
{
if (_datasArray == nil) {
if (_shopResponseArray == nil) {
_datasArray = [NSMutableArray array];
_shopResponseArray = [NSMutableArray array];
}
return _datasArray;
return _shopResponseArray;
}
......@@ -41,6 +47,7 @@
// Do any additional setup after loading the view.
[self uiConfigAction];
[self getShoppingCardata];
}
......@@ -73,17 +80,78 @@
self.shoppingTableview.tableFooterView = [UIView new];
}
#pragma mark -获取购物车商品
- (void)getShoppingCardata
{
//判断是否需要请求数据-通过当前客户ID
if (![Shoppersmanager manager].currentCustomer) {
return;
}
ShopCartFilter *shopcarNumber = [[ShopCartFilter alloc]init];
shopcarNumber.consumerId = [Customermanager manager].customerID;
DataPage *Newpage = [[DataPage alloc]init];
Newpage.page = 0;
shopcarNumber.dp = Newpage;
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/shopcart/query"] WithRequestType:0 WithParameter:shopcarNumber WithReturnValueBlock:^(id returnValue) {
[self RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
NSLog(@"%@",returnValue);
ShopCartResponse *shopcar = [[ShopCartResponse alloc]initWithDictionary:returnValue[@"data"] error:nil];
//自定义属性
for (TOShopcartEntity *objc in shopcar.shopcart) {
ShopcarModel *model = [[ShopcarModel alloc]init];
model.goods = objc.goods;
model.fid = objc.fid;
model.createName = objc.createName;
model.createBy = objc.createBy;
model.createDate = objc.createDate;
model.updateName = objc.updateName;
model.updateBy = objc.updateBy;
model.updateDate = objc.updateDate;
model.goodsId = objc.goodsId;
model.goodsNum = objc.goodsNum;
model.consumerId = objc.consumerId;
model.sysOrgCode = objc.sysOrgCode;
[self.shopResponseArray addObject:model];
}
}else
{
[self ErrorMBProgressView:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
} WithFailureBlock:^(id error) {
[self RemoveMBProgressHUDLoding];
}];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
ShoppingTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Shopping" forIndexPath:indexPath];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.model = [self.shopResponseArray objectAtIndex_opple:indexPath.row];
return cell;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 20;
return self.shopResponseArray.count;
}
......
//
// screeningButton.h
// Lighting
//
// Created by 曹云霄 on 16/5/13.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface screeningButton : UIButton
@end
//
// screeningButton.m
// Lighting
//
// Created by 曹云霄 on 16/5/13.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "screeningButton.h"
@implementation screeningButton
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
self.titleLabel.font = [UIFont systemFontOfSize:13];
self.titleLabel.textAlignment = NSTextAlignmentCenter;
}
return self;
}
- (CGRect)titleRectForContentRect:(CGRect)contentRect
{
return CGRectMake((self.frame.size.width-[self ReturnCGsize:self.currentTitle].width)/2, -2, [self ReturnCGsize:self.currentTitle].width, 35);
}
- (CGRect)imageRectForContentRect:(CGRect)contentRect
{
return CGRectMake((self.frame.size.width-[self ReturnCGsize:self.currentTitle].width)/2+[self ReturnCGsize:self.currentTitle].width, (self.frame.size.height-6)/2, 11, 6);
}
- (CGSize)ReturnCGsize:(NSString *)string
{
CGSize S = [string boundingRectWithSize:CGSizeMake(999, 35) options:NSStringDrawingUsesFontLeading | NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:18]} context:nil].size;
return S;
}
@end
......@@ -17,6 +17,10 @@
060D397C1CE45CFE0082AECD /* ImageCropperView.m in Sources */ = {isa = PBXBuildFile; fileRef = 060D39791CE45CFE0082AECD /* ImageCropperView.m */; };
060D397D1CE45CFE0082AECD /* UIImage+Rotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 060D397B1CE45CFE0082AECD /* UIImage+Rotation.m */; };
2906B5D71CD89246000849B4 /* ClientDetailsTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2906B5D61CD89246000849B4 /* ClientDetailsTableViewCell.m */; };
290887061CE58BC2000B7097 /* screeningButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 290887051CE58BC2000B7097 /* screeningButton.m */; };
2908870B1CE5A308000B7097 /* DateSelectedViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 290887091CE5A308000B7097 /* DateSelectedViewController.m */; };
2908870C1CE5A308000B7097 /* DateSelectedViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2908870A1CE5A308000B7097 /* DateSelectedViewController.xib */; };
290887131CE5DF16000B7097 /* ShopcarModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 290887121CE5DF16000B7097 /* ShopcarModel.m */; };
2928F7E71CD087FE0036D761 /* BaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2928F7E61CD087FE0036D761 /* BaseViewController.m */; };
2928F8321CD09E320036D761 /* Toolview.m in Sources */ = {isa = PBXBuildFile; fileRef = 2928F8311CD09E320036D761 /* Toolview.m */; };
2928F8381CD09E730036D761 /* CustomButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 2928F8371CD09E730036D761 /* CustomButton.m */; };
......@@ -126,6 +130,13 @@
060D397B1CE45CFE0082AECD /* UIImage+Rotation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+Rotation.m"; sourceTree = "<group>"; };
2906B5D51CD89246000849B4 /* ClientDetailsTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClientDetailsTableViewCell.h; sourceTree = "<group>"; };
2906B5D61CD89246000849B4 /* ClientDetailsTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ClientDetailsTableViewCell.m; sourceTree = "<group>"; };
290887041CE58BC2000B7097 /* screeningButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = screeningButton.h; sourceTree = "<group>"; };
290887051CE58BC2000B7097 /* screeningButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = screeningButton.m; sourceTree = "<group>"; };
290887081CE5A308000B7097 /* DateSelectedViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DateSelectedViewController.h; sourceTree = "<group>"; };
290887091CE5A308000B7097 /* DateSelectedViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DateSelectedViewController.m; sourceTree = "<group>"; };
2908870A1CE5A308000B7097 /* DateSelectedViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DateSelectedViewController.xib; sourceTree = "<group>"; };
290887111CE5DF16000B7097 /* ShopcarModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShopcarModel.h; sourceTree = "<group>"; };
290887121CE5DF16000B7097 /* ShopcarModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShopcarModel.m; sourceTree = "<group>"; };
2928F7E21CD085F40036D761 /* PrefixHeader.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PrefixHeader.pch; sourceTree = "<group>"; };
2928F7E51CD087FE0036D761 /* BaseViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseViewController.h; sourceTree = "<group>"; };
2928F7E61CD087FE0036D761 /* BaseViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BaseViewController.m; sourceTree = "<group>"; };
......@@ -393,6 +404,25 @@
name = view;
sourceTree = "<group>";
};
290887071CE5A2BE000B7097 /* dateSelectedVC */ = {
isa = PBXGroup;
children = (
290887081CE5A308000B7097 /* DateSelectedViewController.h */,
290887091CE5A308000B7097 /* DateSelectedViewController.m */,
2908870A1CE5A308000B7097 /* DateSelectedViewController.xib */,
);
name = dateSelectedVC;
sourceTree = "<group>";
};
2908870D1CE5D900000B7097 /* shopCarmodel */ = {
isa = PBXGroup;
children = (
290887111CE5DF16000B7097 /* ShopcarModel.h */,
290887121CE5DF16000B7097 /* ShopcarModel.m */,
);
name = shopCarmodel;
sourceTree = "<group>";
};
2928F7DD1CD085430036D761 /* Class */ = {
isa = PBXGroup;
children = (
......@@ -479,6 +509,7 @@
2928F83F1CD0AB830036D761 /* Shoppingcart */ = {
isa = PBXGroup;
children = (
2908870D1CE5D900000B7097 /* shopCarmodel */,
293393521CD3377E000D997B /* view */,
293393501CD329EC000D997B /* controller */,
);
......@@ -889,6 +920,8 @@
children = (
29EAAE931CDC414C00C4DBA2 /* SeceneLibraryCollectionViewCell.h */,
29EAAE941CDC414C00C4DBA2 /* SeceneLibraryCollectionViewCell.m */,
290887041CE58BC2000B7097 /* screeningButton.h */,
290887051CE58BC2000B7097 /* screeningButton.m */,
);
name = view;
sourceTree = "<group>";
......@@ -905,6 +938,7 @@
29EAAE991CDC74A700C4DBA2 /* AllCustomer */ = {
isa = PBXGroup;
children = (
290887071CE5A2BE000B7097 /* dateSelectedVC */,
29EAAEA71CDC7FCF00C4DBA2 /* view */,
29EAAEA61CDC7FC500C4DBA2 /* controller */,
);
......@@ -1062,6 +1096,7 @@
buildActionMask = 2147483647;
files = (
29A938271CDAE31B00F21E54 /* ProductDetailsHeaderView.xib in Resources */,
2908870C1CE5A308000B7097 /* DateSelectedViewController.xib in Resources */,
2942F8A81CDD80CE005B377E /* authenticateView.xib in Resources */,
29807C651CD20F0F00F111B8 /* StoryboardwithCYX.storyboard in Resources */,
29EAAE901CDC3E9700C4DBA2 /* BillingInfoView.xib in Resources */,
......@@ -1161,6 +1196,7 @@
29698D611CE2C11500D72CE7 /* SettlementViewController.m in Sources */,
299876331CD997DF00C90D0A /* OrderInformationTableViewCell.m in Sources */,
2928F7E71CD087FE0036D761 /* BaseViewController.m in Sources */,
2908870B1CE5A308000B7097 /* DateSelectedViewController.m in Sources */,
299876271CD9837C00C90D0A /* OrderTableViewCell.m in Sources */,
2998763C1CD9983A00C90D0A /* CommodityListTableViewCell.m in Sources */,
2962D0791CD1CBC60058829D /* NetworkRequestClassManager.m in Sources */,
......@@ -1169,6 +1205,7 @@
2928F8321CD09E320036D761 /* Toolview.m in Sources */,
2942F8A61CDD80C2005B377E /* authenticateView.m in Sources */,
29BFBD8F1CE44BA900C238FB /* goodsDetailsSectionview.m in Sources */,
290887131CE5DF16000B7097 /* ShopcarModel.m in Sources */,
29BB27681CD9D38E009A0813 /* AllpriceTableViewCell.m in Sources */,
29BB27771CD9DFBA009A0813 /* ProductLibraryViewController.m in Sources */,
29EAAEAA1CDC7FE800C4DBA2 /* AllCutomerTableViewCell.m in Sources */,
......@@ -1203,6 +1240,7 @@
2928F83B1CD0A0CE0036D761 /* CustomTabbarController.m in Sources */,
29EAAE8E1CDC3E8E00C4DBA2 /* BillingInfoView.m in Sources */,
0470D6141CE2938000647F0F /* ProductLibraryView.m in Sources */,
290887061CE58BC2000B7097 /* screeningButton.m in Sources */,
044708611CD7C1E800555827 /* MainSetViewController.m in Sources */,
29E28CE81CE0B91B00812A55 /* HENLENSONG.m in Sources */,
299249441CDB51B100786B1E /* ModifyShippingAddressView.m in Sources */,
......
{
"images" : [
{
"idiom" : "universal",
"filename" : "down_arr.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "down_arr@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
......@@ -14,8 +14,21 @@
*/
@protocol ReturnTableviewcellIndexpathdelegate <NSObject>
- (void)returnCellindexpathwithrow:(NSInteger)index;
/**
* 选中筛选条件对象typecode
*
* @param index NSString
*/
- (void)returnCellindexpathwithrow:(NSString *)Type WithcellTitle:(NSString *)title Withselected:(NSInteger)Selected;
/**
* 选中筛选对象的index
*
* @param selectedIndex NSInteger
*/
- (void)returnWithIndexSelected:(NSInteger)selectedIndex;
@end
......@@ -39,4 +52,16 @@
*/
@property (nonatomic,assign) CGSize contentSize;
/**
* 判断显示图片还是文字
*/
@property (nonatomic,assign) BOOL isPictures;
/**
* 传入身份iD表示当前是风格还是房型
*/
@property (nonatomic,assign) NSInteger Selectedindex;
@end
......@@ -31,16 +31,32 @@
self.popoverTableView.delegate = self;
self.popoverTableView.tableFooterView = [UIView new];
[self.view addSubview:self.popoverTableView];
self.popoverTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
[self.popoverTableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"popovercell"];
}
#pragma mark -填充数据
- (void)setDatasArray:(NSArray *)datasArray
{
_datasArray = datasArray;
[self.popoverTableView reloadData];
}
#pragma mark - UITableViewDataSource
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"popovercell" forIndexPath:indexPath];
cell.textLabel.text = [self.datasArray objectAtIndex_opple:indexPath.row];
//显示纯图片
if (self.isPictures) {
cell.imageView.image = TCImage([self.datasArray objectAtIndex_opple:indexPath.row]);
return cell;
}
cell.textLabel.text = [[self.datasArray objectAtIndex_opple:indexPath.row] typename];
cell.textLabel.textAlignment = NSTextAlignmentCenter;
cell.textLabel.font = [UIFont systemFontOfSize:12];
return cell;
}
......@@ -54,10 +70,28 @@
{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if ([self.delegate respondsToSelector:@selector(returnCellindexpathwithrow:)]) {
[self.delegate returnCellindexpathwithrow:indexPath.row];
}
if (self.isPictures)
{
if ([self.delegate respondsToSelector:@selector(returnWithIndexSelected:)]) {
[self.delegate returnWithIndexSelected:indexPath.row];
}
}else
{
if ([self.delegate respondsToSelector:@selector(returnCellindexpathwithrow:WithcellTitle:Withselected:)]) {
[self.delegate returnCellindexpathwithrow:[[self.datasArray objectAtIndex_opple:indexPath.row] typecode] WithcellTitle:[[self.datasArray objectAtIndex_opple:indexPath.row] typename] Withselected:_Selectedindex];
}
}
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 60;
}
......
......@@ -131,7 +131,7 @@
/**
* 服务器地址
*/
#define ServerAddress @"http://service.bloem.cn/opple-web/app"
#define ServerAddress @"http://139.196.195.30:8090/opple-web/app"
......
......@@ -40,8 +40,10 @@
*/
@property (nonatomic,copy) NSString *passWordString;
/**
* 是否设置了当前客户
*/
@property (nonatomic,assign) BOOL currentCustomer;
@end
This diff is collapsed.
This diff is collapsed.
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