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
2691c8bf
Commit
2691c8bf
authored
May 24, 2016
by
勾芒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug
parent
0bac9789
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
318 additions
and
161 deletions
+318
-161
AllCustomerViewController.m
Lighting/Class/AllCustomerViewController.m
+20
-8
AllpriceTableViewCell.m
Lighting/Class/AllpriceTableViewCell.m
+6
-6
ClientViewController.m
Lighting/Class/ClientViewController.m
+36
-34
ClientdetailsViewController.m
Lighting/Class/ClientdetailsViewController.m
+0
-1
CommodityListTableViewCell.h
Lighting/Class/CommodityListTableViewCell.h
+9
-0
CommodityListTableViewCell.m
Lighting/Class/CommodityListTableViewCell.m
+10
-9
CustomerOrderTableViewCell.m
Lighting/Class/CustomerOrderTableViewCell.m
+2
-1
CustomerOrderViewController.m
Lighting/Class/CustomerOrderViewController.m
+18
-7
OrderdetailsViewController.m
Lighting/Class/OrderdetailsViewController.m
+0
-3
ProductCollectionViewCell.h
Lighting/Class/ProductCollectionViewCell.h
+11
-0
ProductDetailsHeaderView.xib
Lighting/Class/ProductDetailsHeaderView.xib
+2
-2
ProductDetailsTableViewCell.m
Lighting/Class/ProductDetailsTableViewCell.m
+1
-0
ProductDetailsViewController.m
Lighting/Class/ProductDetailsViewController.m
+3
-3
ProductLibraryViewController.m
Lighting/Class/ProductLibraryViewController.m
+3
-1
SearchViewController.m
Lighting/Class/SearchViewController.m
+8
-1
SettlementViewController.m
Lighting/Class/SettlementViewController.m
+6
-4
SettlementViewController.xib
Lighting/Class/SettlementViewController.xib
+1
-2
GenerateOrdersViewController.m
Lighting/Class/Shoppingcart/GenerateOrdersViewController.m
+30
-4
ShoppingTableViewCell.h
Lighting/Class/Shoppingcart/ShoppingTableViewCell.h
+6
-0
ShoppingTableViewCell.m
Lighting/Class/Shoppingcart/ShoppingTableViewCell.m
+14
-12
ShoppingViewController.m
Lighting/Class/Shoppingcart/ShoppingViewController.m
+6
-5
AppDelegate.m
Lighting/Lighting/AppDelegate.m
+1
-1
Contents.json
...g/Lighting/Images.xcassets/矩形-3-副本.imageset/Contents.json
+23
-0
矩形-3-副本.png
...ing/Lighting/Images.xcassets/矩形-3-副本.imageset/矩形-3-副本.png
+0
-0
矩形-3-副本@2x.png
.../Lighting/Images.xcassets/矩形-3-副本.imageset/矩形-3-副本@2x.png
+0
-0
StoryboardwithCYX.storyboard
Lighting/Lighting/StoryboardwithCYX.storyboard
+81
-57
BaseViewController.h
Lighting/Tools/BaseViewController.h
+6
-0
BaseViewController.m
Lighting/Tools/BaseViewController.m
+15
-0
No files found.
Lighting/Class/AllCustomerViewController.m
View file @
2691c8bf
...
...
@@ -276,30 +276,29 @@
ConsumerQueryCondition
*
searchCustomer
=
[[
ConsumerQueryCondition
alloc
]
init
];
DataPage
*
page
=
[[
DataPage
alloc
]
init
];
page
.
page
=
1
;
page
.
rows
=
10
;
page
.
rows
=
99999
;
searchCustomer
.
page
=
page
;
//比较两个NSDate的大小
switch
(
result
)
{
case
-
1
:
//start < end
{
[
formater
setDateFormat
:
@"yyyy-MM-dd HH:dd:ss"
];
searchCustomer
.
createTimeBegin
=
[
formater
stringFromDate
:
date
];
searchCustomer
.
createTimeEnd
=
[
formater
stringFromDate
:
date1
];
searchCustomer
.
createTimeBegin
=
[
formater
stringFromDate
:
[
self
ReturnZeroTime
:
date
]
];
searchCustomer
.
createTimeEnd
=
[
formater
stringFromDate
:
[
self
ReturnZeroTime
:
date1
]
];
}
break
;
case
0
:
//start == end
{
[
formater
setDateFormat
:
@"yyyy-MM-dd HH:dd:ss"
];
searchCustomer
.
createTimeBegin
=
[
formater
stringFromDate
:
date
];
searchCustomer
.
createTimeEnd
=
[
formater
stringFromDate
:
date1
];
searchCustomer
.
createTimeBegin
=
[
formater
stringFromDate
:
[
self
ReturnZeroTime
:
date
]
];
searchCustomer
.
createTimeEnd
=
[
formater
stringFromDate
:
[
self
ReturnZeroTime
:
date1
]
];
}
break
;
case
1
:
//start > end
{
[
formater
setDateFormat
:
@"yyyy-MM-dd HH:dd:ss"
];
searchCustomer
.
createTimeBegin
=
[
formater
stringFromDate
:
date1
];
searchCustomer
.
createTimeEnd
=
[
formater
stringFromDate
:
date
];
searchCustomer
.
createTimeBegin
=
[
formater
stringFromDate
:
[
self
ReturnZeroTime
:
date1
]
];
searchCustomer
.
createTimeEnd
=
[
formater
stringFromDate
:
[
self
ReturnZeroTime
:
date
]
];
}
break
;
...
...
@@ -311,6 +310,19 @@
}
#pragma mark -返回某天零时的时间
-
(
NSDate
*
)
ReturnZeroTime
:
(
NSDate
*
)
date
{
NSCalendar
*
calendar
=
[
NSCalendar
currentCalendar
];
NSDateComponents
*
components
=
[
calendar
components
:
NSUIntegerMax
fromDate
:
date
];
components
.
hour
=
8
;
components
.
minute
=
0
;
components
.
second
=
0
;
NSTimeInterval
ts
=
(
double
)(
int
)[[
calendar
dateFromComponents
:
components
]
timeIntervalSince1970
];
return
[
NSDate
dateWithTimeIntervalSince1970
:
ts
];
}
#pragma mark -比较两个NSDate的大小
-
(
int
)
compareOneDay
:
(
NSDate
*
)
oneDay
withAnotherDay
:
(
NSDate
*
)
anotherDay
{
...
...
Lighting/Class/AllpriceTableViewCell.m
View file @
2691c8bf
...
...
@@ -23,14 +23,14 @@
_goodsAllprice
=
goodsAllprice
;
NSUInteger
allNumber
=
0
;
NSInteger
allPrice
=
0
;
CGFloat
allPrice
=
0
;
for
(
ShopcarModel
*
model
in
_goodsAllprice
)
{
allNumber
+=
model
.
goodsNum
;
allPrice
+=
[
model
.
goods
.
costPrice
integer
Value
]
*
model
.
goodsNum
;
allPrice
+=
[
model
.
goods
.
costPrice
float
Value
]
*
model
.
goodsNum
;
}
self
.
goodsAllNumber
.
text
=
[
NSString
stringWithFormat
:
@"%ld"
,
allNumber
];
self
.
goodsAllPrice
.
text
=
[
NSString
stringWithFormat
:
@"
%ld
"
,
allPrice
];
self
.
goodsAllPrice
.
text
=
[
NSString
stringWithFormat
:
@"
¥%.2f
"
,
allPrice
];
}
...
...
@@ -43,15 +43,15 @@
_goodsArray
=
goodsArray
;
NSInteger
allNumber
=
0
;
//总数量
NSInteger
allPrice
=
0
;
//总价格
CGFloat
allPrice
=
0
;
//总价格
for
(
TOOrderdetailEntity
*
model
in
_goodsArray
)
{
allNumber
+=
[
model
.
goodsNum
integerValue
];
allPrice
+=
[
model
.
goodsPrice
integer
Value
]
*
[
model
.
goodsNum
intValue
];
allPrice
+=
[
model
.
goodsPrice
float
Value
]
*
[
model
.
goodsNum
intValue
];
}
self
.
goodsAllNumber
.
text
=
[
NSString
stringWithFormat
:
@"%ld"
,
allNumber
];
self
.
goodsAllPrice
.
text
=
[
NSString
stringWithFormat
:
@"¥%
ld
"
,
allPrice
];
self
.
goodsAllPrice
.
text
=
[
NSString
stringWithFormat
:
@"¥%
.2f
"
,
allPrice
];
}
...
...
Lighting/Class/ClientViewController.m
View file @
2691c8bf
...
...
@@ -63,40 +63,6 @@
if
([
self
.
navigationController
respondsToSelector
:
@selector
(
interactivePopGestureRecognizer
)])
{
self
.
navigationController
.
interactivePopGestureRecognizer
.
enabled
=
NO
;
}
//下拉刷新
MjRefreshHeaderCustom
*
headerRefresh
=
[
MjRefreshHeaderCustom
headerWithRefreshingBlock
:
^
{
ConsumerQueryCondition
*
condition
=
[[
ConsumerQueryCondition
alloc
]
init
];
condition
.
resellerCodeEquals
=
[[
Shoppersmanager
manager
].
Shoppers
.
employee
.
currentDepart
orgCode
];
DataPage
*
page
=
[[
DataPage
alloc
]
init
];
page
.
page
=
1
;
condition
.
page
=
page
;
page
.
rows
=
10
;
self
.
indexPage
=
1
;
[
self
.
informationTableview
.
mj_footer
resetNoMoreData
];
[
self
getShoppersAssociatedCustomer
:
condition
isRemoveArray
:
YES
];
}];
headerRefresh
.
stateLabel
.
hidden
=
YES
;
headerRefresh
.
lastUpdatedTimeLabel
.
hidden
=
YES
;
self
.
informationTableview
.
mj_header
=
headerRefresh
;
//进入刷新状态
[
self
.
informationTableview
.
mj_header
beginRefreshing
];
//上拉加载
self
.
informationTableview
.
mj_footer
=
[
MJRefreshAutoNormalFooter
footerWithRefreshingBlock
:
^
{
if
(
self
.
indexPage
++
>
self
.
totalPages
)
{
[
self
.
informationTableview
.
mj_footer
endRefreshingWithNoMoreData
];
}
else
{
ConsumerQueryCondition
*
condition
=
[[
ConsumerQueryCondition
alloc
]
init
];
DataPage
*
page
=
[[
DataPage
alloc
]
init
];
page
.
page
=
self
.
indexPage
++
;
page
.
rows
=
10
;
condition
.
page
=
page
;
[
self
getShoppersAssociatedCustomer
:
condition
isRemoveArray
:
NO
];
}
}];
}
-
(
void
)
viewWillDisappear
:
(
BOOL
)
animated
...
...
@@ -137,6 +103,42 @@
self
.
searchPersonInformationField
.
delegate
=
self
;
//监听键盘落下的通知
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
KeyboadrDismiss
)
name
:
UIKeyboardWillHideNotification
object
:
nil
];
//下拉刷新
MjRefreshHeaderCustom
*
headerRefresh
=
[
MjRefreshHeaderCustom
headerWithRefreshingBlock
:
^
{
ConsumerQueryCondition
*
condition
=
[[
ConsumerQueryCondition
alloc
]
init
];
condition
.
resellerCodeEquals
=
[[
Shoppersmanager
manager
].
Shoppers
.
employee
.
currentDepart
orgCode
];
DataPage
*
page
=
[[
DataPage
alloc
]
init
];
page
.
page
=
1
;
condition
.
page
=
page
;
page
.
rows
=
10
;
self
.
indexPage
=
1
;
[
self
.
informationTableview
.
mj_footer
resetNoMoreData
];
[
self
getShoppersAssociatedCustomer
:
condition
isRemoveArray
:
YES
];
}];
headerRefresh
.
stateLabel
.
hidden
=
YES
;
headerRefresh
.
lastUpdatedTimeLabel
.
hidden
=
YES
;
self
.
informationTableview
.
mj_header
=
headerRefresh
;
//进入刷新状态
[
self
.
informationTableview
.
mj_header
beginRefreshing
];
//上拉加载
self
.
informationTableview
.
mj_footer
=
[
MJRefreshAutoNormalFooter
footerWithRefreshingBlock
:
^
{
if
(
self
.
indexPage
++
>
self
.
totalPages
)
{
[
self
.
informationTableview
.
mj_footer
endRefreshingWithNoMoreData
];
}
else
{
ConsumerQueryCondition
*
condition
=
[[
ConsumerQueryCondition
alloc
]
init
];
DataPage
*
page
=
[[
DataPage
alloc
]
init
];
page
.
page
=
self
.
indexPage
++
;
page
.
rows
=
10
;
condition
.
page
=
page
;
[
self
getShoppersAssociatedCustomer
:
condition
isRemoveArray
:
NO
];
}
}];
}
...
...
Lighting/Class/ClientdetailsViewController.m
View file @
2691c8bf
...
...
@@ -165,7 +165,6 @@
{
UIStoryboard
*
storyboard
=
[
UIStoryboard
storyboardWithName
:
@"StoryboardwithCYX"
bundle
:
nil
];
OrderdetailsViewController
*
orderdetails
=
[
storyboard
instantiateViewControllerWithIdentifier
:
@"orderdetails"
];
TOOrderEntity
*
model
=
[[
self
.
orderRecordArray
objectAtIndex_opple
:
indexPath
.
row
]
order
];
orderdetails
.
orderCode
=
model
.
orderNumber
;
orderdetails
.
sectionTitle
=
@[
@"订单信息"
,
@"客户信息"
,
@"收货信息"
,
@"商品信息"
,
@"附件信息"
];
...
...
Lighting/Class/CommodityListTableViewCell.h
View file @
2691c8bf
...
...
@@ -47,6 +47,15 @@
* 订单详情商品数据源
*/
@property
(
nonatomic
,
strong
)
TOOrderdetailEntity
*
orderDetailslist
;
/**
* 规格
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
specifications
;
@end
Lighting/Class/CommodityListTableViewCell.m
View file @
2691c8bf
...
...
@@ -19,15 +19,16 @@
-
(
void
)
setModel
:
(
ShopcarModel
*
)
model
{
_model
=
model
;
[
self
.
goodsHeader
sd_setImageWithURL
:[
NSURL
URLWithString
:
_model
.
goods
.
pictures
]
placeholderImage
:
R
eplaceImage
];
[
self
.
goodsHeader
sd_setImageWithURL
:[
NSURL
URLWithString
:
_model
.
goods
.
pictures
]
placeholderImage
:
R
EPLACEIMAGE
];
self
.
goodsName
.
text
=
_model
.
goods
.
name
;
self
.
goodsNumber
.
text
=
[
NSString
stringWithFormat
:
@"数量 X%d"
,
_model
.
goodsNum
];
self
.
clinchPrice
.
text
=
[
NSString
stringWithFormat
:
@"成交价 ¥%@"
,[
_model
.
goods
.
costPrice
stringValue
]];
self
.
specifications
.
text
=
[
NSString
stringWithFormat
:
@"%@(%@)"
,
_model
.
goods
.
productProfile
,
_model
.
goods
.
spec
];
self
.
goodsNumber
.
text
=
[
NSString
stringWithFormat
:
@"数量 X%d"
,
_model
.
goodsNum
];
self
.
clinchPrice
.
text
=
[
NSString
stringWithFormat
:
@"成交价 ¥%.2f"
,[
_model
.
goods
.
costPrice
floatValue
]];
//计算总价格
NSInteger
number
=
_model
.
goodsNum
;
NSInteger
price
=
[
_model
.
goods
.
costPrice
integer
Value
];
NSInteger
allPrice
=
number
*
price
;
self
.
totalPrice
.
text
=
[
NSString
stringWithFormat
:
@"
%ld
"
,
allPrice
];
CGFloat
price
=
[
_model
.
goods
.
costPrice
float
Value
];
CGFloat
allPrice
=
number
*
price
;
self
.
totalPrice
.
text
=
[
NSString
stringWithFormat
:
@"
¥%.2f
"
,
allPrice
];
}
...
...
@@ -38,10 +39,10 @@
_orderDetailslist
=
orderDetailslist
;
[
self
.
goodsHeader
sd_setImageWithURL
:[
NSURL
URLWithString
:
_orderDetailslist
.
goodsBrand
]
placeholderImage
:
ReplaceImage
];
self
.
goodsNumber
.
text
=
[
NSString
stringWithFormat
:
@"数量 X%@"
,
_orderDetailslist
.
goodsNum
];
self
.
clinchPrice
.
text
=
[
NSString
stringWithFormat
:
@"成交价 ¥%
@"
,[
_orderDetailslist
.
goodsPrice
string
Value
]];
self
.
clinchPrice
.
text
=
[
NSString
stringWithFormat
:
@"成交价 ¥%
.2f"
,[
_orderDetailslist
.
goodsPrice
float
Value
]];
//小计
NSInteger
totalPrice
=
[
_orderDetailslist
.
goodsNum
integerValue
]
*
[
_orderDetailslist
.
goodsPrice
integer
Value
];
self
.
totalPrice
.
text
=
[
NSString
stringWithFormat
:
@"¥%
ld
"
,
totalPrice
];
CGFloat
totalPrice
=
[
_orderDetailslist
.
goodsNum
integerValue
]
*
[
_orderDetailslist
.
goodsPrice
float
Value
];
self
.
totalPrice
.
text
=
[
NSString
stringWithFormat
:
@"¥%
.2f
"
,
totalPrice
];
self
.
goodsName
.
text
=
_orderDetailslist
.
goodsSpec
;
...
...
Lighting/Class/CustomerOrderTableViewCell.m
View file @
2691c8bf
...
...
@@ -29,9 +29,10 @@
[
self
.
consigneeNumber
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
equalTo
(
self
.
orderAll
.
mas_left
).
offset
(
13
);
make
.
right
.
equalTo
(
self
.
orderAll
.
mas_right
).
offset
(
14
);
make
.
top
.
equalTo
(
self
.
orderAll
.
mas_bottom
).
offset
(
10
);
}];
}
#pragma mark -赋值
...
...
Lighting/Class/CustomerOrderViewController.m
View file @
2691c8bf
...
...
@@ -334,30 +334,41 @@
*/
-
(
void
)
undoOrderButtonClick
:
(
NSInteger
)
cellindex
{
__weak
typeof
(
self
)
weakSelf
=
self
;
UIAlertController
*
alertVC
=
[
UIAlertController
alertControllerWithTitle
:
@"提示"
message
:
@"请确认是否撤销订单"
preferredStyle
:
UIAlertControllerStyleAlert
];
[
alertVC
addAction
:[
UIAlertAction
actionWithTitle
:
@"取消"
style
:
UIAlertActionStyleCancel
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
[
weakSelf
dismissViewControllerAnimated
:
YES
completion
:
nil
];
}]];
[
self
CreateMBProgressHUDLoding
];
OrderBill
*
model
=
[
self
.
datasArray
objectAtIndex_opple
:
cellindex
];
[
alertVC
addAction
:[
UIAlertAction
actionWithTitle
:
@"确认"
style
:
UIAlertActionStyleDestructive
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
[
weakSelf
CreateMBProgressHUDLoding
];
OrderBill
*
model
=
[
weakSelf
.
datasArray
objectAtIndex_opple
:
cellindex
];
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@%@/%@/%@"
,
ServerAddress
,
@"/order/updateOrderState/"
,
model
.
order
.
orderNumber
,
model
.
order
.
orderState
,
@"005"
]
WithRequestType
:
1
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
self
RemoveMBProgressHUDLoding
];
[
weakSelf
dismissViewControllerAnimated
:
YES
completion
:
nil
];
[
weakSelf
RemoveMBProgressHUDLoding
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
[
s
elf
SuccessMBProgressView
:
@"撤销成功"
];
[
weakS
elf
SuccessMBProgressView
:
@"撤销成功"
];
model
.
order
.
orderState
=
@"005"
;
NSIndexPath
*
indexapath
=
[
NSIndexPath
indexPathForRow
:
cellindex
inSection
:
0
];
[
s
elf
.
customerOrderTableView
reloadRowsAtIndexPaths
:@[
indexapath
]
withRowAnimation
:
UITableViewRowAnimationLeft
];
[
weakS
elf
.
customerOrderTableView
reloadRowsAtIndexPaths
:@[
indexapath
]
withRowAnimation
:
UITableViewRowAnimationLeft
];
}
else
{
[
s
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
weakS
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithFailureBlock
:^
(
id
error
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
}];
}]];
[
self
presentViewController
:
alertVC
animated
:
YES
completion
:
nil
];
}
...
...
Lighting/Class/OrderdetailsViewController.m
View file @
2691c8bf
...
...
@@ -159,7 +159,6 @@
#pragma mark -调出支付框
-
(
void
)
PayButtonClick
{
SettlementViewController
*
settlement
=
[[
SettlementViewController
alloc
]
init
];
//支付成功
[
settlement
setPaySuccessReturnBlock
:
^
{
...
...
@@ -172,14 +171,12 @@
self
.
DelecteAndPayButtonBlock
(
_cellindex
,
@"002"
);
}
}];
settlement
.
preferredContentSize
=
CGSizeMake
(
380
,
500
);
settlement
.
goodsArray
=
self
.
orderDetails
.
orderdetailList
;
settlement
.
orderCode
=
_orderCode
;
settlement
.
modalPresentationStyle
=
UIModalPresentationFormSheet
;
UIPopoverPresentationController
*
pop
=
settlement
.
popoverPresentationController
;
pop
.
sourceView
=
settlement
.
view
;
pop
.
permittedArrowDirections
=
UIPopoverArrowDirectionAny
;
[
self
presentViewController
:
settlement
animated
:
YES
completion
:
nil
];
}
...
...
Lighting/Class/ProductCollectionViewCell.h
View file @
2691c8bf
...
...
@@ -42,4 +42,15 @@
* 传入cell下标
*/
@property
(
nonatomic
,
assign
)
NSInteger
cellindex
;
/**
* 产品规格
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
specifications
;
@end
Lighting/Class/ProductDetailsHeaderView.xib
View file @
2691c8bf
...
...
@@ -139,7 +139,7 @@
<button
opaque=
"NO"
tag=
"101"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
lineBreakMode=
"middleTruncation"
id=
"tM7-hf-9rp"
>
<rect
key=
"frame"
x=
"398"
y=
"328"
width=
"50"
height=
"50"
/>
<autoresizingMask
key=
"autoresizingMask"
flexibleMinX=
"YES"
flexibleMaxX=
"YES"
flexibleMinY=
"YES"
/>
<state
key=
"normal"
image=
"
down_arr
"
/>
<state
key=
"normal"
image=
"
矩形-3-副本
"
/>
</button>
<button
opaque=
"NO"
tag=
"101"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
lineBreakMode=
"middleTruncation"
id=
"0ee-HS-ilS"
>
<rect
key=
"frame"
x=
"398"
y=
"9"
width=
"50"
height=
"50"
/>
...
...
@@ -173,8 +173,8 @@
<image
name=
"140046029-MX260-D112-03-星冠-5700K(4)"
width=
"600"
height=
"450"
/>
<image
name=
"2"
width=
"45"
height=
"45"
/>
<image
name=
"add"
width=
"49"
height=
"45"
/>
<image
name=
"down_arr"
width=
"22"
height=
"12"
/>
<image
name=
"icon-2"
width=
"25"
height=
"15"
/>
<image
name=
"reduce"
width=
"49"
height=
"45"
/>
<image
name=
"矩形-3-副本"
width=
"20"
height=
"11"
/>
</resources>
</document>
Lighting/Class/ProductDetailsTableViewCell.m
View file @
2691c8bf
...
...
@@ -20,6 +20,7 @@
-
(
void
)
setDatas
:
(
TOGoodsEntity
*
)
datas
{
_datas
=
datas
;
self
.
brandLabe
.
text
=
_datas
.
company
;
self
.
specificationsLabe
.
text
=
_datas
.
spec
;
self
.
materialLabe
.
text
=
_datas
.
material
;
self
.
temperatureLabe
.
text
=
_datas
.
colorTemperature
;
...
...
Lighting/Class/ProductDetailsViewController.m
View file @
2691c8bf
...
...
@@ -130,10 +130,10 @@
#pragma mark -header赋值
-
(
void
)
HeaderViewAssignment
{
self
.
headerView
.
serialNumber
.
text
=
self
.
entity
.
series
;
self
.
headerView
.
serialNumber
.
text
=
self
.
entity
.
code
;
self
.
headerView
.
nameLabe
.
text
=
self
.
entity
.
name
;
self
.
headerView
.
brandName
.
text
=
self
.
entity
.
brandId
;
self
.
headerView
.
dorpPriceLabe
.
text
=
[
self
.
entity
.
tagPrice
stringValue
];
self
.
headerView
.
brandName
.
text
=
self
.
entity
.
company
;
self
.
headerView
.
dorpPriceLabe
.
text
=
[
NSString
stringWithFormat
:
@"%.2f"
,[
self
.
entity
.
tagPrice
floatValue
]
];
self
.
imagesArray
=
[
NSMutableArray
arrayWithArray
:[
self
.
entity
.
pictures
componentsSeparatedByString
:
@","
]];
[
self
.
headerView
.
goodsImageview
sd_setImageWithURL
:[
self
.
imagesArray
firstObject
]
placeholderImage
:
REPLACEIMAGE
];
//商品小图
...
...
Lighting/Class/ProductLibraryViewController.m
View file @
2691c8bf
...
...
@@ -317,7 +317,9 @@
[
cell
.
productImageView
sd_setImageWithURL
:[
NSURL
URLWithString
:[
imageArray
firstObject
]]
placeholderImage
:
REPLACEIMAGE
];
cell
.
productPrice
.
text
=
[
NSString
stringWithFormat
:
@"¥%@"
,[[[
self
.
datasArray
objectAtIndex_opple
:
indexPath
.
item
]
guidePrice
]
stringValue
]];
cell
.
cellindex
=
indexPath
.
item
;
cell
.
productParameter
.
text
=
[[
self
.
datasArray
objectAtIndex_opple
:
indexPath
.
item
]
spec
];
cell
.
productParameter
.
text
=
[[
self
.
datasArray
objectAtIndex_opple
:
indexPath
.
item
]
productProfile
];
cell
.
specifications
.
text
=
[
NSString
stringWithFormat
:
@"%@(%@)"
,[[
self
.
datasArray
objectAtIndex_opple
:
indexPath
.
item
]
series
],[[
self
.
datasArray
objectAtIndex_opple
:
indexPath
.
item
]
spec
]];
//加入购物车
__weak
typeof
(
self
)
weakSelf
=
self
;
__weak
typeof
(
ProductCollectionViewCell
*
)
weakCell
=
cell
;
...
...
Lighting/Class/SearchViewController.m
View file @
2691c8bf
...
...
@@ -191,7 +191,14 @@
//调用商品控制器
ProductLibraryViewController
*
productVC
=
[[
self
getStoryboardWithName
]
instantiateViewControllerWithIdentifier
:
@"productlibrary"
];
productVC
.
selectedCode
=
[[
self
.
response
.
list
objectAtIndex_opple
:
indexPath
.
item
]
fid
];
[
self
.
navigationController
pushViewController
:
productVC
animated
:
YES
];
[
self
.
navigationController
pushViewController
:
productVC
animated
:
NO
];
}
else
if
([
collectionView
isEqual
:
self
.
historyCollectionView
])
{
//调用商品控制器
ProductLibraryViewController
*
productVC
=
[[
self
getStoryboardWithName
]
instantiateViewControllerWithIdentifier
:
@"productlibrary"
];
productVC
.
selectedCode
=
[
self
.
localSearchArray
objectAtIndex_opple
:
indexPath
.
item
];
[
self
.
navigationController
pushViewController
:
productVC
animated
:
NO
];
}
}
...
...
Lighting/Class/SettlementViewController.m
View file @
2691c8bf
...
...
@@ -71,13 +71,13 @@
-
(
void
)
setGoodsArray
{
NSInteger
goodsAllNumber
=
0
;
//总数量
NSInteger
goodAllprice
=
0
;
//总价格
CGFloat
goodAllprice
=
0
;
//总价格
for
(
TOOrderdetailEntity
*
model
in
_goodsArray
)
{
goodsAllNumber
+=
[
model
.
goodsNum
integerValue
];
goodAllprice
+=
[
model
.
goodsPrice
integer
Value
];
goodAllprice
+=
[
model
.
goodsPrice
float
Value
];
}
self
.
goodsAllNumber
.
text
=
[
NSString
stringWithFormat
:
@"%ld"
,
goodsAllNumber
];
self
.
goodsAllPrice
.
text
=
[
NSString
stringWithFormat
:
@"%
ld元"
,
goodAllprice
];
self
.
goodsAllPrice
.
text
=
[
NSString
stringWithFormat
:
@"%
.2f元"
,(
goodAllprice
*
goodsAllNumber
)
];
}
...
...
@@ -147,6 +147,7 @@
sender
.
selected
=
!
sender
.
selected
;
if
(
sender
.
selected
)
{
[
self
.
showPayQrCodeImageView
sd_setImageWithURL
:[
NSURL
URLWithString
:
self
.
weiXinLabe
]
placeholderImage
:
REPLACEIMAGE
];
self
.
payTreasureButton
.
selected
=
NO
;
[
self
.
payTypeButton
setTitle
:
@"现金、支票、转账、刷卡"
forState
:
UIControlStateNormal
];
}
...
...
@@ -159,6 +160,7 @@
sender
.
selected
=
!
sender
.
selected
;
if
(
sender
.
selected
)
{
[
self
.
showPayQrCodeImageView
sd_setImageWithURL
:[
NSURL
URLWithString
:
self
.
zhiFubaoLabe
]
placeholderImage
:
REPLACEIMAGE
];
self
.
WeixiPayButton
.
selected
=
NO
;
[
self
.
payTypeButton
setTitle
:
@"现金、支票、转账、刷卡"
forState
:
UIControlStateNormal
];
}
...
...
@@ -242,10 +244,10 @@
{
OrderPayRequest
*
order
=
[[
OrderPayRequest
alloc
]
init
];
order
.
isbill
=
self
.
ISinvoiceButton
.
currentTitle
;
order
.
orderNumber
=
_orderCode
;
order
.
fnewstate
=
@"002"
;
order
.
oldstate
=
@"001"
;
order
.
billTitle
=
self
.
invoiceHeader
.
text
;
//支付类型
if
(
self
.
payTreasureButton
.
selected
)
{
...
...
Lighting/Class/SettlementViewController.xib
View file @
2691c8bf
...
...
@@ -178,7 +178,7 @@
<action
selector=
"invoiceTypeButtonClick:"
destination=
"-1"
eventType=
"touchUpInside"
id=
"glI-Tn-twP"
/>
</connections>
</button>
<imageView
userInteractionEnabled=
"NO"
contentMode=
"scaleToFill"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
i
mage=
"05产品库-详情_03"
i
d=
"evA-uJ-YEb"
>
<imageView
userInteractionEnabled=
"NO"
contentMode=
"scaleToFill"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
id=
"evA-uJ-YEb"
>
<rect
key=
"frame"
x=
"255"
y=
"143.5"
width=
"100"
height=
"100"
/>
<autoresizingMask
key=
"autoresizingMask"
flexibleMinX=
"YES"
flexibleMinY=
"YES"
flexibleMaxY=
"YES"
/>
</imageView>
...
...
@@ -227,7 +227,6 @@
</view>
</objects>
<resources>
<image
name=
"05产品库-详情_03"
width=
"500"
height=
"375"
/>
<image
name=
"down_arr"
width=
"22"
height=
"12"
/>
<image
name=
"wechat1"
width=
"175"
height=
"30"
/>
<image
name=
"图层-1"
width=
"175"
height=
"30"
/>
...
...
Lighting/Class/Shoppingcart/GenerateOrdersViewController.m
View file @
2691c8bf
...
...
@@ -339,6 +339,11 @@
//收货地址
TOOrderEntity
*
orderReceiver
=
[[
TOOrderEntity
alloc
]
init
];
NSArray
*
Adressarr
=
[
self
.
datasArray
objectAtIndex_opple
:
1
];
//总价格
CGFloat
allPrice
=
0
;
//总数量
NSInteger
allNumber
=
0
;
for
(
int
i
=
0
;
i
<
Adressarr
.
count
;
i
++
)
{
if
([[
Adressarr
objectAtIndex_opple
:
i
]
isKindOfClass
:[
AddressModel
class
]])
{
...
...
@@ -348,6 +353,7 @@
//收货人信息
orderReceiver
.
receiverName
=
model
.
name
;
orderReceiver
.
orderTime
=
[
self
GetCurrenttime
];
orderReceiver
.
receiverMobile
=
model
.
miblephone
;
orderReceiver
.
receiverAddress
=
model
.
address
;
order
.
order
=
orderReceiver
;
...
...
@@ -372,12 +378,16 @@
orderGoods
.
goodsUnit
=
model
.
goods
.
unit
;
//总价
NSInteger
allprice
=
model
.
goodsNum
*
[
model
.
goods
.
costPrice
integerValue
];
orderGoods
.
goodsTotalPrice
=
[
NSNumber
numberWithInteger
:
allprice
];
orderReceiver
.
orderPrice
=
[
NSNumber
numberWithInteger
:
allprice
];
allPrice
+=
model
.
goodsNum
*
[
model
.
goods
.
costPrice
floatValue
];
//总数量
allNumber
+=
model
.
goodsNum
;
orderGoods
.
goodsTotalPrice
=
[
NSNumber
numberWithFloat
:
model
.
goodsNum
*
[
model
.
goods
.
costPrice
floatValue
]];
[
goodidArr
addObject
:
orderGoods
];
}
//总价
orderReceiver
.
orderPrice
=
[
NSNumber
numberWithFloat
:
allPrice
];
//总数量
orderReceiver
.
goodsNum
=
[
NSString
stringWithFormat
:
@"%ld"
,
allNumber
];
order
.
orderdetailList
=
(
NSArray
<
TOOrderdetailEntity
>
*
)
goodidArr
;
[
self
CreateMBProgressHUDLoding
];
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@"
,
ServerAddress
,
@"/order/save"
]
WithRequestType
:
0
WithParameter
:
order
WithReturnValueBlock
:^
(
id
returnValue
)
{
...
...
@@ -419,6 +429,22 @@
}
#pragma mark -获取当前日期
-
(
NSString
*
)
GetCurrenttime
{
NSDate
*
date
=
[[
NSDate
alloc
]
init
];
//获取一下当前的时区
NSTimeZone
*
zone
=
[
NSTimeZone
timeZoneWithName
:
@"UTC"
];
//根据对应的时区,获取和0时区相差的秒数
NSInteger
seconds
=
[
zone
secondsFromGMTForDate
:
date
];
//获取当前的时间
NSDate
*
localDate
=
[
NSDate
dateWithTimeIntervalSinceNow
:
seconds
];
NSDateFormatter
*
formatter
=
[[
NSDateFormatter
alloc
]
init
];
[
formatter
setDateFormat
:
@"yyyy-MM-dd HH:mm:ss"
];
NSString
*
datetime
=
[
formatter
stringFromDate
:
localDate
];
return
datetime
;
}
#pragma mark -返回购物车
-
(
IBAction
)
BackShoppingBagsButtonClick
:
(
UIButton
*
)
sender
{
...
...
Lighting/Class/Shoppingcart/ShoppingTableViewCell.h
View file @
2691c8bf
...
...
@@ -100,4 +100,10 @@
*/
@property
(
nonatomic
,
copy
)
void
(
^
promptStringBlock
)(
NSString
*
string
);
/**
* 商品规格
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
specifications
;
@end
Lighting/Class/Shoppingcart/ShoppingTableViewCell.m
View file @
2691c8bf
...
...
@@ -31,12 +31,13 @@
{
_model
=
model
;
self
.
selectedButton
.
selected
=
_model
.
isSelected
;
[
self
.
goodsImageView
sd_setImageWithURL
:[
NSURL
URLWithString
:
_model
.
goods
.
pictures
]
placeholderImage
:
R
eplaceImage
];
[
self
.
goodsImageView
sd_setImageWithURL
:[
NSURL
URLWithString
:
_model
.
goods
.
pictures
]
placeholderImage
:
R
EPLACEIMAGE
];
self
.
goodsInformationLabe
.
text
=
_model
.
goods
.
name
;
self
.
specifications
.
text
=
[
NSString
stringWithFormat
:
@"%@(%@)"
,
_model
.
goods
.
productProfile
,
_model
.
goods
.
spec
];
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
=
[
NSString
stringWithFormat
:
@"¥%
ld"
,[
self
.
goodsNumbersLabe
.
text
integerValue
]
*
[
_model
.
goods
.
costPrice
integer
Value
]];;
self
.
productPriceLabe
.
text
=
[
NSString
stringWithFormat
:
@"¥%
.2f"
,[
self
.
goodsNumbersLabe
.
text
floatValue
]
*
[
_model
.
goods
.
costPrice
float
Value
]];;
}
#pragma mark -增加或者减少商品
...
...
@@ -109,24 +110,25 @@
if
(
!
[
self
isPureInt
:
textField
.
text
])
{
if
(
self
.
promptStringBlock
)
{
self
.
promptStringBlock
(
@"输入格式错误"
);
return
NO
;
}
}
//改变价格
self
.
productPriceLabe
.
text
=
[
NSString
stringWithFormat
:
@"¥%ld"
,[
self
.
goodsNumbersLabe
.
text
integerValue
]
*
[
textField
.
text
integerValue
]];
if
([
self
.
delegate
respondsToSelector
:
@selector
(
ChangeGoodsNumber
:
WithcostPrice
:
Withcellindex
:
)])
{
[
self
.
delegate
ChangeGoodsNumber
:[
self
.
goodsNumbersLabe
.
text
intValue
]
WithcostPrice
:[
self
.
clinchTextfield
.
text
intValue
]
Withcellindex
:
_cellindex
];
}
else
{
//改变价格
self
.
productPriceLabe
.
text
=
[
NSString
stringWithFormat
:
@"¥%ld"
,[
self
.
goodsNumbersLabe
.
text
integerValue
]
*
[
textField
.
text
integerValue
]];
if
([
self
.
delegate
respondsToSelector
:
@selector
(
ChangeGoodsNumber
:
WithcostPrice
:
Withcellindex
:
)])
{
[
self
.
delegate
ChangeGoodsNumber
:[
self
.
goodsNumbersLabe
.
text
intValue
]
WithcostPrice
:[
self
.
clinchTextfield
.
text
intValue
]
Withcellindex
:
_cellindex
];
}
}
return
YES
;
}
#pragma mark - 判断是否是
纯数字
#pragma mark - 判断是否是
浮点数
-
(
BOOL
)
isPureInt
:
(
NSString
*
)
string
{
NSScanner
*
scan
=
[
NSScanner
scannerWithString
:
string
];
in
t
val
;
return
[
scan
scan
In
t
:
&
val
]
&&
[
scan
isAtEnd
];
floa
t
val
;
return
[
scan
scan
Floa
t
:
&
val
]
&&
[
scan
isAtEnd
];
}
...
...
Lighting/Class/Shoppingcart/ShoppingViewController.m
View file @
2691c8bf
...
...
@@ -162,13 +162,14 @@
cell
.
delegate
=
self
;
cell
.
cellindex
=
indexPath
.
row
;
//cell选中回调
__weak
typeof
(
self
)
weakSelf
=
self
;
[
cell
setReturnCellblock
:
^
(
NSInteger
index
)
{
[
s
elf
setSelectedButton
:
index
];
[
weakS
elf
setSelectedButton
:
index
];
}];
//提示框回调
[
cell
setPromptStringBlock
:
^
(
NSString
*
string
)
{
[
self
ErrorMBProgressView
:
string
];
[
weakSelf
promptCustomerWithString
:
@"格式不正确"
];
}];
return
cell
;
}
...
...
@@ -313,13 +314,13 @@
#pragma mark -计算选中后的商品总金额
-
(
void
)
CalculateSelectedGoodsAllprice
{
NSInteger
allPrice
=
0
;
CGFloat
allPrice
=
0
;
for
(
ShopcarModel
*
model
in
self
.
shopResponseArray
)
{
if
(
model
.
isSelected
)
{
allPrice
+=
[
model
.
goods
.
costPrice
integer
Value
]
*
model
.
goodsNum
;
allPrice
+=
[
model
.
goods
.
costPrice
float
Value
]
*
model
.
goodsNum
;
}
}
self
.
totalpriceLabe
.
text
=
[
NSString
stringWithFormat
:
@"¥%
ld
"
,
allPrice
];
self
.
totalpriceLabe
.
text
=
[
NSString
stringWithFormat
:
@"¥%
.2f
"
,
allPrice
];
}
...
...
Lighting/Lighting/AppDelegate.m
View file @
2691c8bf
...
...
@@ -41,7 +41,7 @@
IQKeyboardManager
*
manager
=
[
IQKeyboardManager
sharedManager
];
manager
.
enable
=
YES
;
manager
.
shouldResignOnTouchOutside
=
YES
;
manager
.
enableAutoToolbar
=
YES
;
manager
.
enableAutoToolbar
=
NO
;
}
...
...
Lighting/Lighting/Images.xcassets/矩形-3-副本.imageset/Contents.json
0 → 100644
View file @
2691c8bf
{
"images"
:
[
{
"idiom"
:
"universal"
,
"filename"
:
"矩形-3-副本.png"
,
"scale"
:
"1x"
},
{
"idiom"
:
"universal"
,
"filename"
:
"矩形-3-副本@2x.png"
,
"scale"
:
"2x"
},
{
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"version"
:
1
,
"author"
:
"xcode"
}
}
\ No newline at end of file
Lighting/Lighting/Images.xcassets/矩形-3-副本.imageset/矩形-3-副本.png
0 → 100644
View file @
2691c8bf
1.11 KB
Lighting/Lighting/Images.xcassets/矩形-3-副本.imageset/矩形-3-副本@2x.png
0 → 100644
View file @
2691c8bf
1.41 KB
Lighting/Lighting/StoryboardwithCYX.storyboard
View file @
2691c8bf
This diff is collapsed.
Click to expand it.
Lighting/Tools/BaseViewController.h
View file @
2691c8bf
...
...
@@ -95,4 +95,10 @@
*/
-
(
void
)
QueryShoppingCarNumber
;
/**
* 系统提示框
*/
-
(
void
)
promptCustomerWithString
:(
NSString
*
)
message
;
@end
Lighting/Tools/BaseViewController.m
View file @
2691c8bf
...
...
@@ -393,6 +393,21 @@
#pragma mark -系统提示框
-
(
void
)
promptCustomerWithString
:
(
NSString
*
)
message
{
UIAlertController
*
alertVC
=
[
UIAlertController
alertControllerWithTitle
:
@"提示"
message
:
message
preferredStyle
:
UIAlertControllerStyleAlert
];
[
alertVC
addAction
:[
UIAlertAction
actionWithTitle
:
@"我知道了"
style
:
UIAlertActionStyleDefault
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
[
self
dismissViewControllerAnimated
:
YES
completion
:
nil
];
}]];
[
self
presentViewController
:
alertVC
animated
:
YES
completion
:
nil
];
}
...
...
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