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
d662c6ea
Commit
d662c6ea
authored
Jul 28, 2016
by
曹云霄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug
parent
c7d75cd2
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
174 additions
and
184 deletions
+174
-184
AllCustomerViewController.m
Lighting/Class/AllCustomerViewController.m
+4
-2
ClientDetailsTableViewCell.m
Lighting/Class/ClientDetailsTableViewCell.m
+1
-1
ClientViewController.m
Lighting/Class/ClientViewController.m
+104
-125
ClientdetailsViewController.m
Lighting/Class/ClientdetailsViewController.m
+2
-1
CommodityListTableViewCell.m
Lighting/Class/CommodityListTableViewCell.m
+1
-1
CustomerOrderViewController.m
Lighting/Class/CustomerOrderViewController.m
+2
-1
ProductLibraryViewController.m
Lighting/Class/ProductLibraryViewController.m
+2
-1
SceneLibraryViewController.m
Lighting/Class/SceneLibraryViewController.m
+2
-1
ShoppingViewController.m
Lighting/Class/Shoppingcart/ShoppingViewController.m
+0
-1
CustomTabbarController.m
Lighting/Class/Tabbar/CustomTabbarController.m
+40
-43
Toolview.m
Lighting/Class/Tabbar/Toolview.m
+0
-1
Info.plist
Lighting/Lighting/Info.plist
+8
-0
BaseViewController.m
Lighting/Tools/BaseViewController.m
+3
-1
QRViewController.m
Lighting/Tools/QRViewController.m
+1
-3
SceneViewController.m
Lighting/Tools/SceneViewController.m
+4
-2
No files found.
Lighting/Class/AllCustomerViewController.m
View file @
d662c6ea
...
...
@@ -121,7 +121,6 @@
headerRefresh
.
lastUpdatedTimeLabel
.
hidden
=
YES
;
self
.
allCustomerTableview
.
mj_header
=
headerRefresh
;
[
self
.
allCustomerTableview
.
mj_header
beginRefreshing
];
self
.
allCustomerTableview
.
mj_footer
.
automaticallyHidden
=
YES
;
//上拉加载
self
.
allCustomerTableview
.
mj_footer
=
[
MJRefreshAutoNormalFooter
footerWithRefreshingBlock
:
^
{
...
...
@@ -136,6 +135,7 @@
[
self
getShoppersAssociatedCustomer
:
self
.
conditionModel
isRemove
:
NO
];
}
}];
self
.
allCustomerTableview
.
mj_footer
.
automaticallyHidden
=
YES
;
}
...
...
@@ -253,7 +253,9 @@
UIPopoverPresentationController
*
pop
=
datevc
.
popoverPresentationController
;
pop
.
permittedArrowDirections
=
UIPopoverArrowDirectionAny
;
pop
.
sourceView
=
datevc
.
view
;
[
self
presentViewController
:
datevc
animated
:
YES
completion
:
nil
];
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
self
presentViewController
:
datevc
animated
:
YES
completion
:
nil
];
});
}
...
...
Lighting/Class/ClientDetailsTableViewCell.m
View file @
d662c6ea
...
...
@@ -27,7 +27,7 @@
self
.
goodsCraneQuotation
.
text
=
[
NSString
stringWithFormat
:
@"¥%.2f"
,[
_model
.
goods
.
tagPrice
floatValue
]];
self
.
goodsSpecifications
.
text
=
_model
.
goods
.
size
;
self
.
clinchPrice
.
text
=
[
NSString
stringWithFormat
:
@"¥%.2f"
,[
_model
.
goods
.
costPrice
floatValue
]];
self
.
goodsNumber
.
text
=
[
NSString
stringWithFormat
:
@"%
d"
,
_model
.
goodsNum
];
self
.
goodsNumber
.
text
=
[
NSString
stringWithFormat
:
@"%
ld"
,(
long
)
_model
.
goodsNum
];
self
.
goodsPrice
.
text
=
[
NSString
stringWithFormat
:
@"¥%.2f"
,[
_model
.
goods
.
costPrice
floatValue
]
*
_model
.
goodsNum
];
...
...
Lighting/Class/ClientViewController.m
View file @
d662c6ea
...
...
@@ -29,6 +29,11 @@
*/
@property
(
nonatomic
,
assign
)
int
totalPages
;
/**
* 查询条件
*/
@property
(
nonatomic
,
strong
)
ConsumerQueryCondition
*
condition
;
@end
@implementation
ClientViewController
...
...
@@ -46,6 +51,14 @@
return
_CustomerresultArray
;
}
-
(
ConsumerQueryCondition
*
)
condition
{
if
(
!
_condition
)
{
_condition
=
[[
ConsumerQueryCondition
alloc
]
init
];
}
return
_condition
;
}
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
...
...
@@ -104,61 +117,61 @@
//清空当前客户数据
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
ChangeCustomerName
:
)
name
:
@"EMPTYCUSTOMERNAME"
object
:
nil
];
__weak
typeof
(
self
)
weakSelf
=
self
;
//下拉刷新
MjRefreshHeaderCustom
*
headerRefresh
=
[
MjRefreshHeaderCustom
headerWithRefreshingBlock
:
^
{
ConsumerQueryCondition
*
condition
=
[[
ConsumerQueryCondition
alloc
]
init
];
condition
.
resellerCodeEquals
=
[[
Shoppersmanager
manager
].
Shoppers
.
employee
.
currentDepart
orgCode
];
weakSelf
.
condition
.
resellerCodeEquals
=
[[
Shoppersmanager
manager
].
Shoppers
.
employee
.
currentDepart
orgCode
];
DataPage
*
page
=
[[
DataPage
alloc
]
init
];
page
.
page
=
1
;
condition
.
page
=
page
;
weakSelf
.
condition
.
page
=
page
;
page
.
rows
=
KROWS
;
s
elf
.
indexPage
=
1
;
[
s
elf
.
informationTableview
.
mj_footer
resetNoMoreData
];
[
self
getShoppersAssociatedCustomer
:
condition
isRemoveArray
:
YES
];
weakS
elf
.
indexPage
=
1
;
[
weakS
elf
.
informationTableview
.
mj_footer
resetNoMoreData
];
[
weakSelf
getShoppersAssociatedCustomer
:
weakSelf
.
condition
isRemoveArray
:
YES
];
}];
headerRefresh
.
stateLabel
.
hidden
=
YES
;
headerRefresh
.
lastUpdatedTimeLabel
.
hidden
=
YES
;
self
.
informationTableview
.
mj_header
=
headerRefresh
;
self
.
informationTableview
.
mj_footer
.
automaticallyHidden
=
YES
;
//进入刷新状态
[
self
.
informationTableview
.
mj_header
beginRefreshing
];
//上拉加载
self
.
informationTableview
.
mj_footer
=
[
MJRefreshAutoNormalFooter
footerWithRefreshingBlock
:
^
{
if
(
++
self
.
indexPage
>
s
elf
.
totalPages
)
{
[
s
elf
.
informationTableview
.
mj_footer
endRefreshingWithNoMoreData
];
if
(
++
weakSelf
.
indexPage
>
weakS
elf
.
totalPages
)
{
[
weakS
elf
.
informationTableview
.
mj_footer
endRefreshingWithNoMoreData
];
}
else
{
ConsumerQueryCondition
*
condition
=
[[
ConsumerQueryCondition
alloc
]
init
];
DataPage
*
page
=
[[
DataPage
alloc
]
init
];
page
.
page
=
s
elf
.
indexPage
;
page
.
page
=
weakS
elf
.
indexPage
;
page
.
rows
=
KROWS
;
condition
.
page
=
page
;
[
self
getShoppersAssociatedCustomer
:
condition
isRemoveArray
:
NO
];
weakSelf
.
condition
.
page
=
page
;
[
weakSelf
getShoppersAssociatedCustomer
:
weakSelf
.
condition
isRemoveArray
:
NO
];
}
}];
self
.
informationTableview
.
mj_footer
.
automaticallyHidden
=
YES
;
}
#pragma mark -获取导购关联客户
-
(
void
)
getShoppersAssociatedCustomer
:
(
ConsumerQueryCondition
*
)
condition
isRemoveArray
:
(
BOOL
)
remove
{
__weak
typeof
(
self
)
weakSelf
=
self
;
[
self
CreateMBProgressHUDLoding
];
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
GETSHOPPERSCONSUMER
)
WithRequestType
:
0
WithParameter
:
condition
WithReturnValueBlock
:^
(
id
returnValue
)
{
self
.
informationTableview
.
emptyDataSetSource
=
s
elf
;
self
.
informationTableview
.
emptyDataSetDelegate
=
s
elf
;
[
s
elf
RemoveMBProgressHUDLoding
];
[
self
endRefreshingForTableView
:
s
elf
.
informationTableview
];
weakSelf
.
informationTableview
.
emptyDataSetSource
=
weakS
elf
;
weakSelf
.
informationTableview
.
emptyDataSetDelegate
=
weakS
elf
;
[
weakS
elf
RemoveMBProgressHUDLoding
];
[
weakSelf
endRefreshingForTableView
:
weakS
elf
.
informationTableview
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
(
remove
)
{
[
s
elf
.
CustomerresultArray
removeAllObjects
];
[
weakS
elf
.
CustomerresultArray
removeAllObjects
];
}
NSDictionary
*
datas
=
returnValue
[
@"data"
];
ConsumerPageResult
*
Customerresult
=
[[
ConsumerPageResult
alloc
]
initWithDictionary
:
datas
error
:
nil
];
s
elf
.
totalPages
=
[
datas
[
@"totalpages"
]
intValue
];
weakS
elf
.
totalPages
=
[
datas
[
@"totalpages"
]
intValue
];
for
(
TOConsumerEntity
*
objc
in
Customerresult
.
results
)
{
MyclientEntityModel
*
myclientModel
=
[[
MyclientEntityModel
alloc
]
init
];
...
...
@@ -177,32 +190,32 @@
myclientModel
.
lastVisitedTime
=
objc
.
lastVisitedTime
;
myclientModel
.
company
=
objc
.
company
;
[
s
elf
.
CustomerresultArray
addObject
:
myclientModel
];
[
weakS
elf
.
CustomerresultArray
addObject
:
myclientModel
];
}
//刷新后添加选中状态
for
(
int
i
=
0
;
i
<
s
elf
.
CustomerresultArray
.
count
;
i
++
)
{
MyclientEntityModel
*
myclientModel
=
[
s
elf
.
CustomerresultArray
objectAtIndex_opple
:
i
];
for
(
int
i
=
0
;
i
<
weakS
elf
.
CustomerresultArray
.
count
;
i
++
)
{
MyclientEntityModel
*
myclientModel
=
[
weakS
elf
.
CustomerresultArray
objectAtIndex_opple
:
i
];
if
([[
Customermanager
manager
].
model
.
fid
isEqualToString
:
myclientModel
.
fid
])
{
InformationTableViewCell
*
cell
=
[
s
elf
.
informationTableview
cellForRowAtIndexPath
:[
NSIndexPath
indexPathForRow
:
i
inSection
:
0
]];
InformationTableViewCell
*
cell
=
[
weakS
elf
.
informationTableview
cellForRowAtIndexPath
:[
NSIndexPath
indexPathForRow
:
i
inSection
:
0
]];
myclientModel
.
selectedState
=
YES
;
cell
.
setCurrentCustomer
.
selected
=
YES
;
}
}
[
s
elf
.
informationTableview
reloadData
];
[
weakS
elf
.
informationTableview
reloadData
];
}
else
{
[
s
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
weakS
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
s
elf
promptCustomerWithString
:
@"网络连接已断开"
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
promptCustomerWithString
:
@"网络连接已断开"
];
}
WithFailureBlock
:^
(
id
error
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
self
endRefreshingForTableView
:
s
elf
.
informationTableview
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
[
weakSelf
endRefreshingForTableView
:
weakS
elf
.
informationTableview
];
}];
}
...
...
@@ -214,8 +227,9 @@
cell
.
indexNumber
=
indexPath
.
row
;
cell
.
model
=
[
self
.
CustomerresultArray
objectAtIndex_opple
:
indexPath
.
row
];
//清空其他选中状态
__weak
typeof
(
self
)
weakSelf
=
self
;
[
cell
setBlockSeletced
:
^
(
NSInteger
index
)
{
[
s
elf
SetCustomerButtonClick
:
index
];
[
weakS
elf
SetCustomerButtonClick
:
index
];
}];
return
cell
;
}
...
...
@@ -238,16 +252,17 @@
clientdetails
.
model
=
[
self
.
CustomerresultArray
objectAtIndex_opple
:
indexPath
.
row
];
clientdetails
.
cellindex
=
indexPath
.
row
;
//设置当前客户
__weak
typeof
(
self
)
weakSelf
=
self
;
[
clientdetails
setCurrentUserBlock
:
^
(
NSInteger
index
,
NSString
*
title
)
{
if
([
title
isEqualToString
:
@"设为当前客户"
])
{
InformationTableViewCell
*
cell
=
[
s
elf
.
informationTableview
cellForRowAtIndexPath
:[
NSIndexPath
indexPathForRow
:
index
inSection
:
0
]];
[
s
elf
SetCustomerButtonClick
:
index
];
InformationTableViewCell
*
cell
=
[
weakS
elf
.
informationTableview
cellForRowAtIndexPath
:[
NSIndexPath
indexPathForRow
:
index
inSection
:
0
]];
[
weakS
elf
SetCustomerButtonClick
:
index
];
cell
.
setCurrentCustomer
.
selected
=
YES
;
}
else
if
([
title
isEqualToString
:
@"退出当前客户"
])
{
[
s
elf
ExitCurrentCustomer
];
[
s
elf
.
addpersonInformationButton
setTitle
:
@"添加客户信息"
forState
:
UIControlStateNormal
];
[
weakS
elf
ExitCurrentCustomer
];
[
weakS
elf
.
addpersonInformationButton
setTitle
:
@"添加客户信息"
forState
:
UIControlStateNormal
];
}
}];
[
self
.
navigationController
pushViewController
:
clientdetails
animated
:
YES
];
...
...
@@ -350,7 +365,9 @@
if
([
UIImagePickerController
isSourceTypeAvailable
:
UIImagePickerControllerSourceTypeCamera
])
{
[
PcCamera
setSourceType
:
UIImagePickerControllerSourceTypeCamera
];
PcCamera
.
allowsEditing
=
YES
;
[
weakSelf
presentViewController
:
PcCamera
animated
:
YES
completion
:
nil
];
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
weakSelf
presentViewController
:
PcCamera
animated
:
YES
completion
:
nil
];
});
}
else
{
...
...
@@ -362,7 +379,9 @@
if
([
UIImagePickerController
isSourceTypeAvailable
:
UIImagePickerControllerSourceTypePhotoLibrary
])
{
[
PcCamera
setSourceType
:
UIImagePickerControllerSourceTypePhotoLibrary
];
PcCamera
.
allowsEditing
=
YES
;
[
weakSelf
presentViewController
:
PcCamera
animated
:
YES
completion
:
nil
];
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
weakSelf
presentViewController
:
PcCamera
animated
:
YES
completion
:
nil
];
});
}
else
{
...
...
@@ -372,7 +391,9 @@
[
alertView
addAction
:[
UIAlertAction
actionWithTitle
:
@"取消"
style
:
UIAlertActionStyleCancel
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
[
alertView
dismissViewControllerAnimated
:
YES
completion
:
nil
];
}]];
[
self
presentViewController
:
alertView
animated
:
YES
completion
:
nil
];
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
weakSelf
presentViewController
:
alertView
animated
:
YES
completion
:
nil
];
});
}
#pragma mark -拍照、从相册选择
...
...
@@ -387,12 +408,12 @@
[
self
uploadUserHeader
:
Headimage
completeBlock
:
^
(
NSString
*
string
)
{
weskSelf
.
customerHeader
.
image
=
Headimage
;
[
Customermanager
manager
].
model
.
picture
=
string
;
for
(
int
i
=
0
;
i
<
s
elf
.
CustomerresultArray
.
count
;
i
++
)
{
MyclientEntityModel
*
customerModel
=
(
MyclientEntityModel
*
)[
s
elf
.
CustomerresultArray
objectAtIndex_opple
:
i
];
for
(
int
i
=
0
;
i
<
weskS
elf
.
CustomerresultArray
.
count
;
i
++
)
{
MyclientEntityModel
*
customerModel
=
(
MyclientEntityModel
*
)[
weskS
elf
.
CustomerresultArray
objectAtIndex_opple
:
i
];
if
([
customerModel
.
fid
isEqualToString
:[
Customermanager
manager
].
model
.
fid
])
{
customerModel
.
picture
=
string
;
NSIndexPath
*
indexPath
=
[
NSIndexPath
indexPathForRow
:
i
inSection
:
0
];
[
s
elf
.
informationTableview
reloadRowsAtIndexPaths
:@[
indexPath
]
withRowAnimation
:
UITableViewRowAnimationBottom
];
[
weskS
elf
.
informationTableview
reloadRowsAtIndexPaths
:@[
indexPath
]
withRowAnimation
:
UITableViewRowAnimationBottom
];
break
;
}
}
...
...
@@ -448,21 +469,22 @@
MyclientEntityModel
*
customerEntity
=
[[
MyclientEntityModel
alloc
]
init
];
customerEntity
=
[
Customermanager
manager
].
model
;
customerEntity
.
picture
=
headerurl
;
__weak
typeof
(
self
)
weskSelf
=
self
;
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
ADDCONSUMER
)
WithRequestType
:
0
WithParameter
:
customerEntity
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weskS
elf
RemoveMBProgressHUDLoding
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
block
();
[
s
elf
SuccessMBProgressView
:
@"修改成功"
];
[
weskS
elf
SuccessMBProgressView
:
@"修改成功"
];
}
else
{
[
s
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
weskS
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weskS
elf
RemoveMBProgressHUDLoding
];
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weskS
elf
RemoveMBProgressHUDLoding
];
}];
}
...
...
@@ -487,6 +509,7 @@
#pragma mark -设置为当前用户请求、写入访问时间
-
(
void
)
SetupUserRequest
{
__weak
typeof
(
self
)
weskSelf
=
self
;
MyclientEntityModel
*
model
=
[
Customermanager
manager
].
model
;
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@"
,
SERVERREQUESTURL
(
SAVEVISITEDTIME
),
model
.
fid
]
WithRequestType
:
1
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
...
...
@@ -496,7 +519,7 @@
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
[
s
elf
promptCustomerWithString
:
@"网络连接已断开"
];
[
weskS
elf
promptCustomerWithString
:
@"网络连接已断开"
];
}
WithFailureBlock
:^
(
id
error
)
{
...
...
@@ -580,52 +603,52 @@
if
(
isChange
)
{
customerEntity
.
fid
=
[
Customermanager
manager
].
model
.
fid
;
}
__weak
typeof
(
self
)
weskSelf
=
self
;
[
self
CreateMBProgressHUDLoding
];
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
ADDCONSUMER
)
WithRequestType
:
0
WithParameter
:
customerEntity
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weskS
elf
RemoveMBProgressHUDLoding
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
//进入刷新状态
[
s
elf
.
informationTableview
.
mj_header
beginRefreshing
];
[
weskS
elf
.
informationTableview
.
mj_header
beginRefreshing
];
//新增保存ID
if
(
!
isChange
)
{
customerEntity
.
fid
=
returnValue
[
@"data"
];
[
Customermanager
manager
].
model
=
customerEntity
;
[
s
elf
SuccessMBProgressView
:
@"新增成功"
];
[
s
elf
addAddressInformationRequest
];
[
weskS
elf
SuccessMBProgressView
:
@"新增成功"
];
[
weskS
elf
addAddressInformationRequest
];
}
else
{
[
s
elf
SuccessMBProgressView
:
@"修改成功"
];
[
s
elf
.
changePersonInformationButton
setTitle
:
@"更改客户信息"
forState
:
UIControlStateNormal
];
[
weskS
elf
SuccessMBProgressView
:
@"修改成功"
];
[
weskS
elf
.
changePersonInformationButton
setTitle
:
@"更改客户信息"
forState
:
UIControlStateNormal
];
}
//保存客户信息
[
Customermanager
manager
].
model
=
customerEntity
;
[
Shoppersmanager
manager
].
currentCustomer
=
YES
;
[
s
elf
.
addpersonInformationButton
setTitle
:
@"退出当前客户"
forState
:
UIControlStateNormal
];
s
elf
.
changePersonInformationButton
.
hidden
=
NO
;
s
elf
.
customerNameField
.
enabled
=
NO
;
s
elf
.
customerAddress
.
enabled
=
NO
;
s
elf
.
phoneNumberField
.
enabled
=
NO
;
s
elf
.
companyNameField
.
enabled
=
NO
;
[
s
elf
SetupUserShoppingCarNumberRequest
];
[
s
elf
SetupUserRequest
];
[
s
elf
ChangeCustomerName
];
[
weskS
elf
.
addpersonInformationButton
setTitle
:
@"退出当前客户"
forState
:
UIControlStateNormal
];
weskS
elf
.
changePersonInformationButton
.
hidden
=
NO
;
weskS
elf
.
customerNameField
.
enabled
=
NO
;
weskS
elf
.
customerAddress
.
enabled
=
NO
;
weskS
elf
.
phoneNumberField
.
enabled
=
NO
;
weskS
elf
.
companyNameField
.
enabled
=
NO
;
[
weskS
elf
SetupUserShoppingCarNumberRequest
];
[
weskS
elf
SetupUserRequest
];
[
weskS
elf
ChangeCustomerName
];
}
else
{
[
s
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
weskS
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
s
elf
promptCustomerWithString
:
@"网络连接已断开"
];
[
weskS
elf
RemoveMBProgressHUDLoding
];
[
weskS
elf
promptCustomerWithString
:
@"网络连接已断开"
];
}
WithFailureBlock
:^
(
id
error
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weskS
elf
RemoveMBProgressHUDLoding
];
}];
}
...
...
@@ -640,7 +663,7 @@
address
.
name
=
self
.
customerNameField
.
text
;
address
.
miblephone
=
self
.
phoneNumberField
.
text
;
address
.
address
=
self
.
customerAddress
.
text
;
__weak
typeof
(
self
)
weskSelf
=
self
;
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
ADDADDRESS
)
WithRequestType
:
0
WithParameter
:
address
WithReturnValueBlock
:^
(
id
returnValue
)
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
...
...
@@ -649,12 +672,12 @@
}
else
{
[
s
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
weskS
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
[
s
elf
promptCustomerWithString
:
@"网络连接已断开"
];
[
weskS
elf
promptCustomerWithString
:
@"网络连接已断开"
];
}
WithFailureBlock
:^
(
id
error
)
{
...
...
@@ -700,62 +723,13 @@
-
(
void
)
searchCustomerInforMation
{
if
(
self
.
searchPersonInformationField
.
text
.
length
==
0
)
{
[
self
ErrorMBProgressView
:
@"搜索信息不能为空"
];
return
;
self
.
condition
.
nameEquals
=
nil
;
self
.
condition
.
mobileEquals
=
nil
;
}
else
{
self
.
condition
.
nameEquals
=
self
.
searchPersonInformationField
.
text
;
self
.
condition
.
mobileEquals
=
self
.
searchPersonInformationField
.
text
;
}
[
self
CreateMBProgressHUDLoding
];
ConsumerQueryCondition
*
searchCustomer
=
[[
ConsumerQueryCondition
alloc
]
init
];
DataPage
*
page
=
[[
DataPage
alloc
]
init
];
page
.
page
=
1
;
page
.
rows
=
10
;
searchCustomer
.
page
=
page
;
searchCustomer
.
nameEquals
=
self
.
searchPersonInformationField
.
text
;
searchCustomer
.
mobileEquals
=
self
.
searchPersonInformationField
.
text
;
//request
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
GETSHOPPERSCONSUMER
)
WithRequestType
:
0
WithParameter
:
searchCustomer
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
self
RemoveMBProgressHUDLoding
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
ConsumerPageResult
*
result
=
[[
ConsumerPageResult
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
[
self
.
CustomerresultArray
removeAllObjects
];
for
(
TOConsumerEntity
*
objc
in
result
.
results
)
{
MyclientEntityModel
*
myclientModel
=
[[
MyclientEntityModel
alloc
]
init
];
myclientModel
.
fid
=
objc
.
fid
;
myclientModel
.
createName
=
objc
.
createName
;
myclientModel
.
createBy
=
objc
.
createBy
;
myclientModel
.
createDate
=
objc
.
createDate
;
myclientModel
.
sysOrgCode
=
objc
.
sysOrgCode
;
myclientModel
.
name
=
objc
.
name
;
myclientModel
.
mobile
=
objc
.
mobile
;
myclientModel
.
province
=
objc
.
province
;
myclientModel
.
city
=
objc
.
city
;
myclientModel
.
country
=
objc
.
country
;
myclientModel
.
address
=
objc
.
address
;
myclientModel
.
picture
=
objc
.
picture
;
myclientModel
.
lastVisitedTime
=
objc
.
lastVisitedTime
;
[
self
.
CustomerresultArray
addObject
:
myclientModel
];
}
[
self
.
informationTableview
reloadData
];
}
else
{
[
self
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
[
self
RemoveMBProgressHUDLoding
];
[
self
promptCustomerWithString
:
@"网络连接已断开"
];
}
WithFailureBlock
:^
(
id
error
)
{
[
self
RemoveMBProgressHUDLoding
];
}];
[
self
.
informationTableview
.
mj_header
beginRefreshing
];
}
...
...
@@ -796,6 +770,11 @@
return
YES
;
}
-
(
CGFloat
)
verticalOffsetForEmptyDataSet
:
(
UIScrollView
*
)
scrollView
{
return
100
;
}
@end
Lighting/Class/ClientdetailsViewController.m
View file @
d662c6ea
...
...
@@ -156,7 +156,6 @@
headerRefresh
.
stateLabel
.
hidden
=
YES
;
headerRefresh
.
lastUpdatedTimeLabel
.
hidden
=
YES
;
self
.
ClientdetailsTableview
.
mj_header
=
headerRefresh
;
self
.
ClientdetailsTableview
.
mj_footer
.
automaticallyHidden
=
YES
;
//进入刷新状态
[
self
.
ClientdetailsTableview
.
mj_header
beginRefreshing
];
//上拉加载
...
...
@@ -195,6 +194,8 @@
}
}
}];
self
.
ClientdetailsTableview
.
mj_footer
.
automaticallyHidden
=
YES
;
}
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
...
...
Lighting/Class/CommodityListTableViewCell.m
View file @
d662c6ea
...
...
@@ -24,7 +24,7 @@
self
.
goodsName
.
text
=
_model
.
goods
.
name
;
self
.
specifications
.
text
=
_model
.
goods
.
size
;
self
.
goodsCode
.
text
=
_model
.
goods
.
code
;
self
.
goodsNumber
.
text
=
[
NSString
stringWithFormat
:
@"数量 X%
d"
,
_model
.
goodsNum
];
self
.
goodsNumber
.
text
=
[
NSString
stringWithFormat
:
@"数量 X%
ld"
,(
long
)
_model
.
goodsNum
];
self
.
clinchPrice
.
text
=
[
NSString
stringWithFormat
:
@"成交价 ¥%.2f"
,[
_model
.
costPrice
floatValue
]];
//计算总价格
NSInteger
number
=
_model
.
goodsNum
;
...
...
Lighting/Class/CustomerOrderViewController.m
View file @
d662c6ea
...
...
@@ -111,7 +111,6 @@
headerRefresh
.
lastUpdatedTimeLabel
.
hidden
=
YES
;
self
.
customerOrderTableView
.
mj_header
=
headerRefresh
;
[
self
.
customerOrderTableView
.
mj_header
beginRefreshing
];
self
.
customerOrderTableView
.
mj_footer
.
automaticallyHidden
=
YES
;
//上拉加载
self
.
customerOrderTableView
.
mj_footer
=
[
MJRefreshAutoNormalFooter
footerWithRefreshingBlock
:
^
{
...
...
@@ -126,6 +125,8 @@
[
weakSelf
getGuideAllcustomerOrder
:
NO
WithorderBill
:
weakSelf
.
model
];
}
}];
self
.
customerOrderTableView
.
mj_footer
.
automaticallyHidden
=
YES
;
}
...
...
Lighting/Class/ProductLibraryViewController.m
View file @
d662c6ea
...
...
@@ -284,7 +284,6 @@
headerRefresh
.
lastUpdatedTimeLabel
.
hidden
=
YES
;
self
.
productCollectionView
.
mj_header
=
headerRefresh
;
[
self
.
productCollectionView
.
mj_header
beginRefreshing
];
self
.
productCollectionView
.
mj_footer
.
automaticallyHidden
=
YES
;
//上拉加载
self
.
productCollectionView
.
mj_footer
=
[
MJRefreshAutoNormalFooter
footerWithRefreshingBlock
:
^
{
...
...
@@ -344,6 +343,8 @@
}
}
}];
self
.
productCollectionView
.
mj_footer
.
automaticallyHidden
=
YES
;
}
...
...
Lighting/Class/SceneLibraryViewController.m
View file @
d662c6ea
...
...
@@ -144,7 +144,6 @@
headerRefresh
.
lastUpdatedTimeLabel
.
hidden
=
YES
;
self
.
seceneLibararyCollectionView
.
mj_header
=
headerRefresh
;
[
self
.
seceneLibararyCollectionView
.
mj_header
beginRefreshing
];
self
.
seceneLibararyCollectionView
.
mj_footer
.
automaticallyHidden
=
YES
;
//上拉加载
self
.
seceneLibararyCollectionView
.
mj_footer
=
[
MJRefreshAutoNormalFooter
footerWithRefreshingBlock
:
^
{
...
...
@@ -160,6 +159,8 @@
[
self
getSceneLibrarydatas
:
self
.
conditionModel
isRemove
:
NO
];
}
}];
self
.
seceneLibararyCollectionView
.
mj_footer
.
automaticallyHidden
=
YES
;
}
#pragma mark -获取场景筛选数据
...
...
Lighting/Class/Shoppingcart/ShoppingViewController.m
View file @
d662c6ea
...
...
@@ -187,7 +187,6 @@
{
ProductDetailsViewController
*
productDetails
=
[[
self
getStoryboardWithName
]
instantiateViewControllerWithIdentifier
:
@"productdetails"
];
productDetails
.
goodsID
=
[[
self
.
shopResponseArray
objectAtIndex_opple
:
indexPath
.
row
]
goodsId
];
// productDetails.inventory = [[self.shopResponseArray objectAtIndex_opple:indexPath.row] inv];
[
self
.
navigationController
pushViewController
:
productDetails
animated
:
YES
];
}
...
...
Lighting/Class/Tabbar/CustomTabbarController.m
View file @
d662c6ea
...
...
@@ -22,6 +22,7 @@
#import "BaseViewController.h"
#import "QRViewController.h"
#import "ExperienceCentreViewController.h"
#import <AVFoundation/AVFoundation.h>
@interface
CustomTabbarController
()
<
TabbarButtonClickdelegate
,
ChangpasswordDelegate
,
CancelButtondelegate
,
UITextFieldDelegate
>
...
...
@@ -37,6 +38,11 @@
*/
@property
(
nonatomic
,
strong
)
NSArray
*
vcArray
;
/**
* 工具栏
*/
@property
(
nonatomic
,
strong
)
Toolview
*
toolview
;
@end
@implementation
CustomTabbarController
...
...
@@ -94,12 +100,11 @@
-
(
void
)
uiConfigAction
{
self
.
tabBar
.
frame
=
CGRectMake
(
Zero
,
Zero
,
ScreenWidth
,
NavigationHeight
);
Toolview
*
toolview
=
[[
Toolview
alloc
]
initWithFrame
:
CGRectMake
(
Zero
,
Zero
,
ScreenWidth
,
NavigationHeight
)];
toolview
.
delegate
=
self
;
toolview
.
inputField
.
delegate
=
self
;
self
.
toolview
=
[[
Toolview
alloc
]
initWithFrame
:
CGRectMake
(
Zero
,
Zero
,
ScreenWidth
,
NavigationHeight
)];
self
.
toolview
.
delegate
=
self
;
self
.
toolview
.
inputField
.
delegate
=
self
;
self
.
delegate
=
self
;
[
self
.
tabBar
addSubview
:
toolview
];
[
self
.
tabBar
addSubview
:
self
.
toolview
];
//显示体验中心
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
ShowFollowHeart
:
)
name
:
@"FollowHeartVC"
object
:
nil
];
}
...
...
@@ -113,7 +118,6 @@
SearchViewController
*
searchVC
=
[
storyboard
instantiateViewControllerWithIdentifier
:[
self
.
identifierArray
objectAtIndex_opple
:
0
]];
ShoppingViewController
*
shoppingVC
=
[
storyboard
instantiateViewControllerWithIdentifier
:[
self
.
identifierArray
objectAtIndex_opple
:
1
]];
ClientViewController
*
clientVC
=
[
storyboard
instantiateViewControllerWithIdentifier
:[
self
.
identifierArray
objectAtIndex_opple
:
2
]];
SceneLibraryViewController
*
sceneVC
=
[
storyboard
instantiateViewControllerWithIdentifier
:[
self
.
identifierArray
objectAtIndex_opple
:
4
]];
ProductLibraryViewController
*
productVC
=
[
storyboard
instantiateViewControllerWithIdentifier
:[
self
.
identifierArray
objectAtIndex_opple
:
5
]];
CustomerManagementViewController
*
customerVC
=
[
storyboard
instantiateViewControllerWithIdentifier
:[
self
.
identifierArray
objectAtIndex_opple
:
6
]];
...
...
@@ -142,9 +146,7 @@
#pragma mark -移除系统自带的UITabBarButton
-
(
void
)
viewWillLayoutSubviews
{
[
super
viewWillLayoutSubviews
];
for
(
UIView
*
view
in
self
.
tabBar
.
subviews
)
{
if
([
view
isKindOfClass
:
NSClassFromString
(
@"UITabBarButton"
)])
{
[
view
removeFromSuperview
];
}
...
...
@@ -155,13 +157,14 @@
#pragma amrk -TabbarButtonClickdelegate代理
-
(
void
)
ButtonClickAction
:
(
NSInteger
)
Buttontag
withButton
:
(
UIButton
*
)
button
{
[
self
.
toolview
.
inputField
resignFirstResponder
];
[
self
dismissViewControllerAnimated
:
NO
completion
:
nil
];
_Newbutton
=
button
;
switch
(
Buttontag
)
{
//右侧视图
case
100
:
[
self
dismissViewControllerAnimated
:
YES
completion
:
nil
];
[
SHARED_APPDELEGATE
.
mmdrawer
toggleDrawerSide
:
MMDrawerSideRight
animated
:
YES
completion
:
nil
];
break
;
...
...
@@ -185,7 +188,6 @@
//我的客户
case
102
:
[
self
dismissViewControllerAnimated
:
YES
completion
:
nil
];
self
.
selectedIndex
=
6
;
break
;
...
...
@@ -193,7 +195,6 @@
//购物车
case
103
:
[
self
dismissViewControllerAnimated
:
YES
completion
:
nil
];
//必须设置当前客户才能跳转到购物车
if
(
!
[
Shoppersmanager
manager
].
currentCustomer
)
{
...
...
@@ -255,21 +256,38 @@
}];
}
#pragma mark -二维码扫描
-
(
void
)
QrcodeButtonClick
{
QRViewController
*
qrVC
=
[[
QRViewController
alloc
]
initWithScanCompleteHandler
:
^
(
NSString
*
url
)
{
[
self
dismissViewControllerAnimated
:
YES
completion
:
^
{
ProductLibraryViewController
*
product
=
[
SHARED_APPDELEGATE
.
allControllerArray
objectAtIndex_opple
:
4
];
product
.
barcode
=
url
;
self
.
selectedIndex
=
4
;
__weak
typeof
(
self
)
weakSelf
=
self
;
//判断权限
AVAuthorizationStatus
status
=
[
AVCaptureDevice
authorizationStatusForMediaType
:
AVMediaTypeVideo
];
if
(
status
!=
AVAuthorizationStatusAuthorized
)
{
UIAlertController
*
alertVC
=
[
UIAlertController
alertControllerWithTitle
:
@"提示"
message
:
@"请在iPad的“设置-隐私-相机”选项中,允许欧立方访问你的相机"
preferredStyle
:
UIAlertControllerStyleAlert
];
[
alertVC
addAction
:[
UIAlertAction
actionWithTitle
:
@"去设置"
style
:
UIAlertActionStyleDestructive
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
NSURL
*
url
=
[
NSURL
URLWithString
:
@"prefs:root=com.gomore.opple"
];
dispatch_after
(
0
.
2
,
dispatch_get_main_queue
(),
^
{
[[
UIApplication
sharedApplication
]
openURL
:
url
];
});
}]];
[
alertVC
addAction
:[
UIAlertAction
actionWithTitle
:
@"知道了"
style
:
UIAlertActionStyleCancel
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
[
weakSelf
dismissViewControllerAnimated
:
YES
completion
:
nil
];
}]];
[
self
presentViewController
:
alertVC
animated
:
YES
completion
:
nil
];
}
else
{
QRViewController
*
qrVC
=
[[
QRViewController
alloc
]
initWithScanCompleteHandler
:
^
(
NSString
*
url
)
{
[
self
dismissViewControllerAnimated
:
YES
completion
:
^
{
ProductLibraryViewController
*
product
=
[
SHARED_APPDELEGATE
.
allControllerArray
objectAtIndex_opple
:
4
];
product
.
barcode
=
url
;
self
.
selectedIndex
=
4
;
}];
}];
}];
[
self
presentViewController
:
qrVC
animated
:
YES
completion
:
nil
];
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
weakSelf
presentViewController
:
qrVC
animated
:
YES
completion
:
nil
];
});
}
}
...
...
@@ -287,7 +305,6 @@
#pragma mark -Search按钮
-
(
BOOL
)
textFieldShouldReturn
:
(
UITextField
*
)
textField
{
//搜索
if
(
textField
.
text
.
length
!=
0
)
{
...
...
@@ -340,28 +357,8 @@
UIPopoverPresentationController
*
popover
=
ExperienceCenter
.
popoverPresentationController
;
popover
.
sourceView
=
ExperienceCenter
.
view
;
[
self
presentViewController
:
ExperienceCenter
animated
:
YES
completion
:
nil
];
// FollowHeartViewController *followVC = [storyboard instantiateViewControllerWithIdentifier:[self.identifierArray objectAtIndex_opple:3]];
// [self presentViewController:followVC animated:YES completion:nil];
}
}
#pragma mark -禁止跳转
//- (void)
-
(
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
Lighting/Class/Tabbar/Toolview.m
View file @
d662c6ea
...
...
@@ -184,7 +184,6 @@
}
}
//点击代理
if
([
self
.
delegate
respondsToSelector
:
@selector
(
ButtonClickAction
:
withButton
:
)])
{
...
...
Lighting/Lighting/Info.plist
View file @
d662c6ea
...
...
@@ -40,6 +40,14 @@
<
string
>
wb1111393286
<
/string
>
<
/
a
rr
a
y
>
<
/
d
i
c
t
>
<
d
i
c
t
>
<
k
e
y
>
CFBundleTypeRole
<
/k
e
y
>
<
string
>
Editor
<
/string
>
<
k
e
y
>
CFBundleURLSchemes
<
/k
e
y
>
<
a
rr
a
y
>
<
string
>
prefs
<
/string
>
<
/
a
rr
a
y
>
<
/
d
i
c
t
>
<
/
a
rr
a
y
>
<
k
e
y
>
LSApplicationQueriesSchemes
<
/k
e
y
>
<
a
rr
a
y
>
...
...
Lighting/Tools/BaseViewController.m
View file @
d662c6ea
...
...
@@ -487,7 +487,9 @@
[
self
dismissViewControllerAnimated
:
YES
completion
:
nil
];
}]];
[
self
presentViewController
:
alertVC
animated
:
YES
completion
:
nil
];
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
self
presentViewController
:
alertVC
animated
:
YES
completion
:
nil
];
});
}
...
...
Lighting/Tools/QRViewController.m
View file @
d662c6ea
...
...
@@ -132,12 +132,10 @@
-
(
void
)
startRunning
{
_device
=
[
AVCaptureDevice
defaultDeviceWithMediaType
:
AVMediaTypeVideo
];
// Input
_input
=
[
AVCaptureDeviceInput
deviceInputWithDevice
:
self
.
device
error
:
nil
];
// Output
_output
=
[[
AVCaptureMetadataOutput
alloc
]
init
];
[
_output
setMetadataObjectsDelegate
:
self
queue
:
dispatch_get_main_queue
()];
...
...
Lighting/Tools/SceneViewController.m
View file @
d662c6ea
...
...
@@ -289,7 +289,6 @@
headerRefresh
.
lastUpdatedTimeLabel
.
hidden
=
YES
;
self
.
sceneOrProductClollectionView
.
mj_header
=
headerRefresh
;
[
self
.
sceneOrProductClollectionView
.
mj_header
beginRefreshing
];
self
.
sceneOrProductClollectionView
.
mj_footer
.
automaticallyHidden
=
YES
;
//上拉加载
self
.
sceneOrProductClollectionView
.
mj_footer
=
[
MJRefreshAutoNormalFooter
footerWithRefreshingBlock
:
^
{
...
...
@@ -306,6 +305,8 @@
[
weakSelf
getSceneLibrarydatas
:
weakSelf
.
conditionModel
isRemove
:
NO
];
}
}];
self
.
sceneOrProductClollectionView
.
mj_footer
.
automaticallyHidden
=
YES
;
}
...
...
@@ -382,7 +383,6 @@
headerRefresh
.
lastUpdatedTimeLabel
.
hidden
=
YES
;
self
.
sceneOrProductClollectionView
.
mj_header
=
headerRefresh
;
[
self
.
sceneOrProductClollectionView
.
mj_header
beginRefreshing
];
self
.
sceneOrProductClollectionView
.
mj_footer
.
automaticallyHidden
=
YES
;
//上拉加载
self
.
sceneOrProductClollectionView
.
mj_footer
=
[
MJRefreshAutoNormalFooter
footerWithRefreshingBlock
:
^
{
...
...
@@ -399,6 +399,8 @@
[
weakSelf
getGoodsListDatasisRemove
:
NO
Withobject
:
weakSelf
.
goodsModel
];
}
}];
self
.
sceneOrProductClollectionView
.
mj_footer
.
automaticallyHidden
=
YES
;
}
...
...
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