Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
Opple-iOS
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张杰
Opple-iOS
Commits
58637248
Commit
58637248
authored
May 25, 2016
by
勾芒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复所有显示金额
parent
c03e5b1c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
8 deletions
+11
-8
AllpriceTableViewCell.m
Lighting/Class/AllpriceTableViewCell.m
+1
-1
CommodityListTableViewCell.m
Lighting/Class/CommodityListTableViewCell.m
+2
-2
GenerateOrdersViewController.m
Lighting/Class/Shoppingcart/GenerateOrdersViewController.m
+3
-3
ShoppingTableViewCell.m
Lighting/Class/Shoppingcart/ShoppingTableViewCell.m
+4
-1
ShoppingViewController.m
Lighting/Class/Shoppingcart/ShoppingViewController.m
+1
-1
No files found.
Lighting/Class/AllpriceTableViewCell.m
View file @
58637248
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
for
(
ShopcarModel
*
model
in
_goodsAllprice
)
{
for
(
ShopcarModel
*
model
in
_goodsAllprice
)
{
allNumber
+=
model
.
goodsNum
;
allNumber
+=
model
.
goodsNum
;
allPrice
+=
[
model
.
goods
.
costPrice
floatValue
]
*
model
.
goodsNum
;
allPrice
+=
[
model
.
costPrice
floatValue
]
*
model
.
goodsNum
;
}
}
self
.
goodsAllNumber
.
text
=
[
NSString
stringWithFormat
:
@"%ld"
,
allNumber
];
self
.
goodsAllNumber
.
text
=
[
NSString
stringWithFormat
:
@"%ld"
,
allNumber
];
self
.
goodsAllPrice
.
text
=
[
NSString
stringWithFormat
:
@"¥%.2f"
,
allPrice
];
self
.
goodsAllPrice
.
text
=
[
NSString
stringWithFormat
:
@"¥%.2f"
,
allPrice
];
...
...
Lighting/Class/CommodityListTableViewCell.m
View file @
58637248
...
@@ -25,10 +25,10 @@
...
@@ -25,10 +25,10 @@
self
.
specifications
.
text
=
_model
.
goods
.
size
;
self
.
specifications
.
text
=
_model
.
goods
.
size
;
self
.
goodsCode
.
text
=
_model
.
goods
.
code
;
self
.
goodsCode
.
text
=
_model
.
goods
.
code
;
self
.
goodsNumber
.
text
=
[
NSString
stringWithFormat
:
@"数量 X%d"
,
_model
.
goodsNum
];
self
.
goodsNumber
.
text
=
[
NSString
stringWithFormat
:
@"数量 X%d"
,
_model
.
goodsNum
];
self
.
clinchPrice
.
text
=
[
NSString
stringWithFormat
:
@"成交价 ¥%.2f"
,[
_model
.
goods
.
costPrice
floatValue
]];
self
.
clinchPrice
.
text
=
[
NSString
stringWithFormat
:
@"成交价 ¥%.2f"
,[
_model
.
costPrice
floatValue
]];
//计算总价格
//计算总价格
NSInteger
number
=
_model
.
goodsNum
;
NSInteger
number
=
_model
.
goodsNum
;
CGFloat
price
=
[
_model
.
goods
.
costPrice
floatValue
];
CGFloat
price
=
[
_model
.
costPrice
floatValue
];
CGFloat
allPrice
=
number
*
price
;
CGFloat
allPrice
=
number
*
price
;
self
.
totalPrice
.
text
=
[
NSString
stringWithFormat
:
@"¥%.2f"
,
allPrice
];
self
.
totalPrice
.
text
=
[
NSString
stringWithFormat
:
@"¥%.2f"
,
allPrice
];
}
}
...
...
Lighting/Class/Shoppingcart/GenerateOrdersViewController.m
View file @
58637248
...
@@ -393,15 +393,15 @@
...
@@ -393,15 +393,15 @@
orderGoods
.
goodsName
=
model
.
goods
.
name
;
orderGoods
.
goodsName
=
model
.
goods
.
name
;
orderGoods
.
goodsBrand
=
model
.
goods
.
brandId
;
orderGoods
.
goodsBrand
=
model
.
goods
.
brandId
;
orderGoods
.
goodsNum
=
[
NSString
stringWithFormat
:
@"%d"
,
model
.
goodsNum
];
orderGoods
.
goodsNum
=
[
NSString
stringWithFormat
:
@"%d"
,
model
.
goodsNum
];
orderGoods
.
goodsPrice
=
model
.
goods
.
costPrice
;
orderGoods
.
goodsPrice
=
model
.
costPrice
;
orderGoods
.
remark
=
model
.
goods
.
spec
;
orderGoods
.
remark
=
model
.
goods
.
spec
;
orderGoods
.
goodsUnit
=
model
.
goods
.
unit
;
orderGoods
.
goodsUnit
=
model
.
goods
.
unit
;
//总价
//总价
allPrice
+=
model
.
goodsNum
*
[
model
.
goods
.
costPrice
floatValue
];
allPrice
+=
model
.
goodsNum
*
[
model
.
costPrice
floatValue
];
//总数量
//总数量
allNumber
+=
model
.
goodsNum
;
allNumber
+=
model
.
goodsNum
;
orderGoods
.
goodsTotalPrice
=
[
NSNumber
numberWithFloat
:
model
.
goodsNum
*
[
model
.
goods
.
costPrice
floatValue
]];
orderGoods
.
goodsTotalPrice
=
[
NSNumber
numberWithFloat
:
model
.
goodsNum
*
[
model
.
costPrice
floatValue
]];
[
goodidArr
addObject
:
orderGoods
];
[
goodidArr
addObject
:
orderGoods
];
}
}
//总价
//总价
...
...
Lighting/Class/Shoppingcart/ShoppingTableViewCell.m
View file @
58637248
...
@@ -39,7 +39,10 @@
...
@@ -39,7 +39,10 @@
self
.
tagsPriceLabe
.
text
=
[
_model
.
goods
.
tagPrice
stringValue
];
self
.
tagsPriceLabe
.
text
=
[
_model
.
goods
.
tagPrice
stringValue
];
self
.
clinchTextfield
.
text
=
[
_model
.
costPrice
stringValue
]?[
_model
.
costPrice
stringValue
]:[
_model
.
goods
.
tagPrice
stringValue
];
self
.
clinchTextfield
.
text
=
[
_model
.
costPrice
stringValue
]?[
_model
.
costPrice
stringValue
]:[
_model
.
goods
.
tagPrice
stringValue
];
self
.
goodsNumbersLabe
.
text
=
[
NSString
stringWithFormat
:
@"%d"
,
_model
.
goodsNum
];
self
.
goodsNumbersLabe
.
text
=
[
NSString
stringWithFormat
:
@"%d"
,
_model
.
goodsNum
];
self
.
productPriceLabe
.
text
=
[
NSString
stringWithFormat
:
@"¥%.2f"
,[
self
.
goodsNumbersLabe
.
text
floatValue
]
*
([
_model
.
costPrice
floatValue
]?[
_model
.
costPrice
floatValue
]:[
_model
.
goods
.
tagPrice
floatValue
])];;
if
([
_model
.
costPrice
integerValue
]
==
0
)
{
_model
.
costPrice
=
_model
.
goods
.
tagPrice
;
}
self
.
productPriceLabe
.
text
=
[
NSString
stringWithFormat
:
@"¥%.2f"
,[
self
.
goodsNumbersLabe
.
text
integerValue
]
*
[
_model
.
costPrice
floatValue
]];;
}
}
#pragma mark -增加或者减少商品
#pragma mark -增加或者减少商品
...
...
Lighting/Class/Shoppingcart/ShoppingViewController.m
View file @
58637248
...
@@ -396,7 +396,7 @@
...
@@ -396,7 +396,7 @@
//保存成交价格
//保存成交价格
ShopcarModel
*
Newmodel
=
[
self
.
shopResponseArray
objectAtIndex_opple
:
cellindex
];
ShopcarModel
*
Newmodel
=
[
self
.
shopResponseArray
objectAtIndex_opple
:
cellindex
];
Newmodel
.
goods
.
costPrice
=
[
NSNumber
numberWithInteger
:
costprice
];
Newmodel
.
costPrice
=
[
NSNumber
numberWithInteger
:
costprice
];
// [self.shopResponseArray replaceObjectAtIndex:cellindex withObject:Newmodel];
// [self.shopResponseArray replaceObjectAtIndex:cellindex withObject:Newmodel];
[
self
CalculateSelectedGoodsAllprice
];
[
self
CalculateSelectedGoodsAllprice
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment