Commit 853747a5 authored by 勾芒's avatar 勾芒

曹云霄

parent 62b1e46a
......@@ -265,17 +265,7 @@
#pragma mark -设置为当前客户、查询购物车数量
- (void)SetupUserShoppingCarNumberRequest
{
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@%@",ServerAddress,@"/shopcart/get/",[Customermanager manager].customerID] WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) {
[[NSNotificationCenter defaultCenter]postNotificationName:REFRESHSHOPPINGCAR object:returnValue[@"data"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
} WithFailureBlock:^(id error) {
}];
[self QueryShoppingCarNumber];
}
......
......@@ -55,6 +55,9 @@
self.orderDetailsTableview.dataSource = self;
self.orderDetailsTableview.delegate = self;
// [self CreateTableviewHeaderView];
//附加信息cell
[self.orderDetailsTableview registerNib:[UINib nibWithNibName:@"AdditionalTableViewCell" bundle:nil] forCellReuseIdentifier:@"fifthcell"];
[self CreateTableviewFooterView];
}
......@@ -123,11 +126,6 @@
lineView.backgroundColor = kTCColor(193, 193, 193);
[headerView addSubview:lineView];
//附加信息cell
[self.orderDetailsTableview registerNib:[UINib nibWithNibName:@"AdditionalTableViewCell" bundle:nil] forCellReuseIdentifier:@"fifthcell"];
self.orderDetailsTableview.tableHeaderView = headerView;
}
......@@ -273,6 +271,10 @@
return nil;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
switch (indexPath.section) {
......
......@@ -41,6 +41,13 @@
@property (nonatomic,strong) NSArray *settlementGoodsdatas;
/**
* 清空已生成订单的商品 ,goodsCode表示选中商品购物车ID
*/
@property (nonatomic,copy) void(^DelecteSelectedGoods)(NSArray *goodsCode);
@end
......@@ -126,7 +126,7 @@
NSIndexPath *indexpath = [NSIndexPath indexPathForRow:i inSection:1];
[addCellArray addObject:indexpath];
}
[self.generateOrderTableview insertRowsAtIndexPaths:addCellArray withRowAnimation:UITableViewRowAnimationLeft];
[self.generateOrderTableview insertRowsAtIndexPaths:addCellArray withRowAnimation:UITableViewRowAnimationBottom];
}
else
{
......@@ -329,15 +329,12 @@
- (IBAction)CreateOrderButtonClick:(UIButton *)sender {
OrderBill *order = [[OrderBill alloc]init];
//分页
DataPage *page = [[DataPage alloc]init];
page.page = 0;
order.datapage = page;
//收货地址
TOOrderEntity *orderReceiver = [[TOOrderEntity alloc]init];
NSArray *Adressarr = [self.datasArray objectAtIndex_opple:1];
......@@ -385,11 +382,21 @@
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/order/save"] WithRequestType:0 WithParameter:order WithReturnValueBlock:^(id returnValue) {
[self RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
//商品购物车id
NSMutableArray *codeArrray = [NSMutableArray array];
for (ShopcarModel *model in _settlementGoodsdatas) {
[codeArrray addObject:model.fid?model.fid:@" "];
}
//调用删除购物车
if (self.DelecteSelectedGoods) {
self.DelecteSelectedGoods(codeArrray);
}
OrderdetailsViewController *orderDetails = [[self getStoryboardWithName] instantiateViewControllerWithIdentifier:@"orderdetails"];
orderDetails.orderCode = returnValue[@"data"];
orderDetails.sectionTitle = @[@"订单信息",@"客户信息",@"收货信息",@"商品清单"];
orderDetails.isShowattachment = NO;
[self.navigationController pushViewController:orderDetails animated:YES];
}else
{
[self ErrorMBProgressView:returnValue[@"message"]];
......
......@@ -153,6 +153,7 @@
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
ShoppingTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Shopping" forIndexPath:indexPath];
......@@ -228,6 +229,44 @@
[array addObject:ZhanweiModel];
GenerateOrdersViewController *generateOrder = [[self getStoryboardWithName] instantiateViewControllerWithIdentifier:@"generateorders"];
generateOrder.settlementGoodsdatas = array;
//清除已经生成订单的商品
[generateOrder setDelecteSelectedGoods:^(NSArray *goodsCode) {
DeleteCartRequest *delecteGoods = [[DeleteCartRequest alloc]init];
delecteGoods.cartIds = goodsCode;
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/shopcart/delete"] WithRequestType:0 WithParameter:delecteGoods WithReturnValueBlock:^(id returnValue) {
[self RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
[self QueryShoppingCarNumber];
//商品cell
NSMutableArray *cellArray = [NSMutableArray array];
//删除商品
for (int i=0; i<self.shopResponseArray.count; i++) {
ShopcarModel *model = [self.shopResponseArray objectAtIndex_opple:i];
if ([goodsCode containsObject:model.fid]) {
[self.shopResponseArray removeObject:model];
NSIndexPath *indexpath = [NSIndexPath indexPathForRow:i inSection:0];
[cellArray addObject:indexpath];
}
}
//删除cell
[self.shoppingTableview deleteRowsAtIndexPaths:cellArray withRowAnimation:UITableViewRowAnimationTop];
}else
{
[self ErrorMBProgressView:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
} WithFailureBlock:^(id error) {
[self RemoveMBProgressHUDLoding];
}];
}];
[self.navigationController pushViewController:generateOrder animated:YES];
}
......@@ -311,6 +350,7 @@
[self RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
[self QueryShoppingCarNumber];
//删除商品
for (ShopcarModel *model in delectemodel) {
[self.shopResponseArray removeObject:model];
......@@ -324,7 +364,7 @@
{
[self ErrorMBProgressView:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
......@@ -335,6 +375,7 @@
}
#pragma mark -改变商品数量
- (void)ChangeGoodsNumber:(int)goodsNumber WithcostPrice:(NSInteger)costprice Withcellindex:(NSInteger)cellindex
{
......
......@@ -601,7 +601,6 @@
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="曹云霄" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="oYO-Ty-li3">
<rect key="frame" x="104" y="13" width="180" height="21"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="1" green="0.7124683436" blue="0.054982668810000003" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
......@@ -609,7 +608,6 @@
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="曹云霄" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="ysN-Xc-Pna">
<rect key="frame" x="104" y="43" width="180" height="21"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="1" green="0.7124683436" blue="0.054982668810000003" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
......@@ -617,7 +615,6 @@
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="曹云霄" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Bad-XW-0bg">
<rect key="frame" x="104" y="74" width="180" height="21"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="1" green="0.7124683436" blue="0.054982668810000003" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
......@@ -625,7 +622,6 @@
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="曹云霄" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="q0f-75-VmW">
<rect key="frame" x="104" y="106" width="180" height="21"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="1" green="0.7124683436" blue="0.054982668810000003" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
......@@ -633,7 +629,6 @@
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="曹云霄" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="eAc-Y2-BcG">
<rect key="frame" x="104" y="136" width="180" height="21"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="1" green="0.7124683436" blue="0.054982668810000003" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
......@@ -641,7 +636,6 @@
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="曹云霄" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="ygb-zQ-59Y">
<rect key="frame" x="104" y="165" width="180" height="21"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="1" green="0.7124683436" blue="0.054982668810000003" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
......@@ -649,7 +643,6 @@
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="曹云霄" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="xeN-1m-zqn">
<rect key="frame" x="403" y="13" width="180" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="1" green="0.7124683436" blue="0.054982668810000003" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
......@@ -657,7 +650,6 @@
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="曹云霄" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="XFH-Ra-nFt">
<rect key="frame" x="403" y="74" width="180" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="1" green="0.7124683436" blue="0.054982668810000003" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
......@@ -665,7 +657,6 @@
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="曹云霄" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="C89-SH-CLU">
<rect key="frame" x="403" y="106" width="180" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="1" green="0.7124683436" blue="0.054982668810000003" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
......@@ -673,7 +664,6 @@
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="曹云霄" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="aUc-nr-JmM">
<rect key="frame" x="403" y="136" width="180" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="1" green="0.7124683436" blue="0.054982668810000003" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
......@@ -681,7 +671,6 @@
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="曹云霄" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="sza-qy-jFZ">
<rect key="frame" x="403" y="43" width="180" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="1" green="0.7124683436" blue="0.054982668810000003" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
......@@ -1185,7 +1174,7 @@
</collectionViewFlowLayout>
<cells>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="productcell" id="J5m-0M-uqb" customClass="ProductCollectionViewCell">
<rect key="frame" x="0.0" y="64" width="300" height="300"/>
<rect key="frame" x="0.0" y="0.0" width="300" height="300"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="300" height="300"/>
......@@ -1261,7 +1250,7 @@
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="productDetailscell" rowHeight="170" id="Sye-2R-IQf" customClass="ProductDetailsTableViewCell">
<rect key="frame" x="0.0" y="92" width="768" height="170"/>
<rect key="frame" x="0.0" y="28" width="768" height="170"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Sye-2R-IQf" id="CXs-SR-gHP">
<rect key="frame" x="0.0" y="0.0" width="768" height="169.5"/>
......
......@@ -90,6 +90,9 @@
+ (id)ReturnOrderStateTitleWithStateCode:(NSInteger)ordercode withPoint:(CGPoint)point WithCode:(NSInteger)code;
/**
* 查询购物车数量
*/
- (void)QueryShoppingCarNumber;
@end
......@@ -286,17 +286,17 @@
{
const NSArray *imageArray = [NSArray arrayWithObjects:@"已撤销",@"已完成",@"已退货", nil];
switch (ordercode) {
case 004://退货
case 4://退货
{
return TCImage([imageArray objectAtIndex_opple:2]);
}
break;
case 005://作废
case 5://作废
{
return TCImage([imageArray objectAtIndex_opple:0]);
}
break;
case 006://完成
case 6://完成
{
return TCImage([imageArray objectAtIndex_opple:1]);
}
......@@ -374,6 +374,23 @@
return nil;
}
#pragma mark -查询购物车数量
- (void)QueryShoppingCarNumber
{
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@%@",ServerAddress,@"/shopcart/get/",[Customermanager manager].customerID] WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) {
NSLog(@"更新购物车数量成功");
[[NSNotificationCenter defaultCenter]postNotificationName:REFRESHSHOPPINGCAR object:returnValue[@"data"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
} WithFailureBlock:^(id error) {
NSLog(@"更新购物车数量失败");
}];
}
......
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