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
caf061a8
Commit
caf061a8
authored
Nov 23, 2016
by
曹云霄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改项说明:微信卡劵扫描错误处理、支付框增加价格计算方式
parent
a3e5a2ea
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
159 additions
and
54 deletions
+159
-54
OrderdetailsViewController.m
Class/OrderdetailsViewController.m
+19
-3
PromotionChooseViewController.m
Class/PromotionChooseViewController.m
+6
-1
SettlementViewController.m
Class/SettlementViewController.m
+18
-5
SettlementViewController.xib
Class/SettlementViewController.xib
+59
-44
Contents.json
Lighting/Images.xcassets/question.imageset/Contents.json
+23
-0
question.png
Lighting/Images.xcassets/question.imageset/question.png
+0
-0
question@2x.png
Lighting/Images.xcassets/question.imageset/question@2x.png
+0
-0
question@3x.png
Lighting/Images.xcassets/question.imageset/question@3x.png
+0
-0
Info.plist
Lighting/Info.plist
+1
-1
BaseViewController.h
Tools/BaseViewController.h
+10
-0
BaseViewController.m
Tools/BaseViewController.m
+23
-0
No files found.
Class/OrderdetailsViewController.m
View file @
caf061a8
...
...
@@ -84,6 +84,11 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
*/
@property
(
nonatomic
,
strong
)
WeChatCardModel
*
weChatModel
;
/**
扫描微信卡劵(重试)
*/
@property
(
nonatomic
,
strong
)
PromotionWeChatCardModel
*
tempWeChatModel
;
...
...
@@ -517,6 +522,7 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
-
(
void
)
scanWeChatCardNumber
:
(
PromotionWeChatCardModel
*
)
weChatModel
{
WS
(
weakSelf
);
self
.
tempWeChatModel
=
weChatModel
;
QRViewController
*
scanVC
=
[[
QRViewController
alloc
]
initWithScanCompleteHandler
:
^
(
NSString
*
url
)
{
[
weakSelf
dismissViewControllerAnimated
:
YES
completion
:
^
{
weakSelf
.
weChatModel
.
wxcardNumber
=
url
;
...
...
@@ -529,6 +535,11 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
[
weakSelf
.
promotionInformationArray
removeObject
:
model
];
break
;
}
}
if
(
!
weakSelf
.
promotionInformationArray
.
count
)
{
if
([
weakSelf
.
sectionTitle
containsObject
:
@"促销信息"
])
{
[
weakSelf
.
sectionTitle
removeLastObject
];
}
}
[
weakSelf
promotionInformationExecutionOrder
];
}];
dispatch_async
(
dispatch_get_main_queue
(),
^
{
...
...
@@ -553,11 +564,16 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
weChatModel
.
total
=
weakSelf
.
weChatModel
.
wxcardDenomation
;
break
;
}
}
[
weakSelf
SHOWPrompttext
:
@"微信卡劵使用成功"
ComcpleteBlock
:
nil
];
[
weakSelf
SHOWPrompttext
:[
NSString
stringWithFormat
:
@"微信卡劵(%ld元)使用成功"
,
weakSelf
.
weChatModel
.
wxcardDenomation
]
ComcpleteBlock
:
^
{
[
weakSelf
promotionInformationExecutionOrder
];
}];
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"msg"
]];
[
weakSelf
promptBoxWithMessage
:[
NSString
stringWithFormat
:
@"微信卡劵使用失败:(%@),是否重试?"
,
returnValue
[
@"msg"
]]
cancelBlock
:
^
{
[
weakSelf
promotionInformationExecutionOrder
];
}
sureBlock
:^
{
[
weakSelf
scanWeChatCardNumber
:
weakSelf
.
tempWeChatModel
];
}];
}
[
weakSelf
promotionInformationExecutionOrder
];
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
...
...
Class/PromotionChooseViewController.m
View file @
caf061a8
...
...
@@ -122,7 +122,12 @@
#pragma mark - 退出促销条件选择
-
(
IBAction
)
dismissPromotionChooseNavigation
:
(
UIBarButtonItem
*
)
sender
{
[
self
dismissViewControllerAnimated
:
YES
completion
:
nil
];
WS
(
weakSelf
);
[
self
promptBoxWithMessage
:
@"退出后此单将不在享受促销"
cancelBlock
:
^
{
}
sureBlock
:^
{
[
weakSelf
dismissViewControllerAnimated
:
YES
completion
:
nil
];
}];
}
#pragma mark - 确认促销条件选择
...
...
Class/SettlementViewController.m
View file @
caf061a8
...
...
@@ -31,6 +31,11 @@
*/
@property
(
nonatomic
,
strong
)
PayViewController
*
payController
;
/**
总金额来源
*/
@property
(
nonatomic
,
copy
)
NSString
*
totalAmountSource
;
@end
...
...
@@ -50,7 +55,7 @@
[
super
viewDidLoad
];
[
self
uiConfigAction
];
[
self
setGoodsArray
];
[
self
calculateGoodsTotalAmountAndTotalNumber
];
[
self
getPayQrCode
];
}
...
...
@@ -84,7 +89,7 @@
#pragma mark -支付总金额,商品总数量
-
(
void
)
setGoodsArray
-
(
void
)
calculateGoodsTotalAmountAndTotalNumber
{
NSInteger
goodsAllNumber
=
0
;
//总数量
for
(
TOOrderdetailEntity
*
model
in
_goodsArray
)
{
...
...
@@ -149,18 +154,22 @@
}];
//计算促销后的价格
CGFloat
newPrice
=
allPrice
;
NSMutableString
*
priceString
=
[
NSMutableString
stringWithFormat
:
@"原价 %.2f元"
,
allPrice
];
for
(
NSDictionary
*
dict
in
chooseArray
)
{
if
([
dict
isEqual
:
deductionPrice
])
{
CGFloat
deduction
=
[
dict
[
@"price"
]
floatValue
];
newPrice
=
newPrice
-
deduction
;
[
priceString
appendString
:[
NSString
stringWithFormat
:
@" - 抵扣促销 %.2f元"
,
deduction
]];
}
else
if
([
dict
isEqual
:
weChatPrice
]){
CGFloat
weChat
=
[
dict
[
@"price"
]
floatValue
];
newPrice
=
newPrice
-
weChat
;
[
priceString
appendString
:[
NSString
stringWithFormat
:
@" - 微信卡劵 %.2f元"
,
weChat
]];
}
else
if
([
dict
isEqual
:
drawPrice
]){
CGFloat
draw
=
[
self
.
resultModel
.
number
floatValue
]
/
100
.
0
;
newPrice
=
newPrice
*
draw
;
[
priceString
appendString
:[
NSString
stringWithFormat
:
@" X 转盘抽奖 %@"
,
self
.
resultModel
.
descriptionString
]];
}
}
//判断促销是否为空
...
...
@@ -168,7 +177,9 @@
if
(
newPrice
<
0
)
{
newPrice
=
0
;
}
[
priceString
appendString
:[
NSString
stringWithFormat
:
@" = %.2f元"
,
newPrice
]];
}
self
.
totalAmountSource
=
priceString
;
return
newPrice
;
}
...
...
@@ -527,10 +538,12 @@
self
.
myScrollView
.
contentOffset
=
CGPointMake
(
0
,
0
);
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
// Dispose of any resources that can be recreated.
#pragma mark - 价格疑问
-
(
IBAction
)
priceQuestionButtonClickAction
:
(
UIButton
*
)
sender
{
[
self
promptCustomerTitle
:
@"我知道了"
withMessage
:
self
.
totalAmountSource
finish
:
nil
];
}
@end
Class/SettlementViewController.xib
View file @
caf061a8
This diff is collapsed.
Click to expand it.
Lighting/Images.xcassets/question.imageset/Contents.json
0 → 100644
View file @
caf061a8
{
"images"
:
[
{
"idiom"
:
"universal"
,
"filename"
:
"question.png"
,
"scale"
:
"1x"
},
{
"idiom"
:
"universal"
,
"filename"
:
"question@2x.png"
,
"scale"
:
"2x"
},
{
"idiom"
:
"universal"
,
"filename"
:
"question@3x.png"
,
"scale"
:
"3x"
}
],
"info"
:
{
"version"
:
1
,
"author"
:
"xcode"
}
}
\ No newline at end of file
Lighting/Images.xcassets/question.imageset/question.png
0 → 100644
View file @
caf061a8
606 Bytes
Lighting/Images.xcassets/question.imageset/question@2x.png
0 → 100644
View file @
caf061a8
941 Bytes
Lighting/Images.xcassets/question.imageset/question@3x.png
0 → 100644
View file @
caf061a8
1.2 KB
Lighting/Info.plist
View file @
caf061a8
...
...
@@ -15,7 +15,7 @@
<
k
e
y
>
CFBundleName
<
/k
e
y
>
<
string
>
欧立方
<
/string
>
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
<
string
>
1.2.
5
<
/string
>
<
string
>
1.2.
6
<
/string
>
<
k
e
y
>
CFBundleURLTypes
<
/k
e
y
>
<
a
rr
a
y
>
<
d
i
c
t
>
...
...
Tools/BaseViewController.h
View file @
caf061a8
...
...
@@ -143,5 +143,15 @@
*/
+
(
BOOL
)
isBlankString
:(
NSString
*
)
string
;
/**
选择框
@param message 文本
@param cancel 取消
@param sure 确认
*/
-
(
void
)
promptBoxWithMessage
:(
NSString
*
)
message
cancelBlock
:(
void
(
^
)())
cancel
sureBlock
:(
void
(
^
)())
sure
;
@end
Tools/BaseViewController.m
View file @
caf061a8
...
...
@@ -531,6 +531,29 @@
return
NO
;
}
/**
选择框
@param message 文本
@param cancel 取消
@param sure 确认
*/
-
(
void
)
promptBoxWithMessage
:
(
NSString
*
)
message
cancelBlock
:
(
void
(
^
)())
cancel
sureBlock
:
(
void
(
^
)())
sure
{
UIAlertController
*
alertVC
=
[
UIAlertController
alertControllerWithTitle
:
@"提示"
message
:
message
preferredStyle
:
UIAlertControllerStyleAlert
];
[
alertVC
addAction
:[
UIAlertAction
actionWithTitle
:
@"取消"
style
:
UIAlertActionStyleCancel
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
if
(
cancel
)
{
cancel
();
}
}]];
[
alertVC
addAction
:[
UIAlertAction
actionWithTitle
:
@"确认"
style
:
UIAlertActionStyleDestructive
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
if
(
sure
)
{
sure
();
}
}]];
[
self
presentViewController
:
alertVC
animated
:
YES
completion
:
nil
];
}
-
(
void
)
dealloc
{
...
...
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