Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
ALand
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
张杰
ALand
Commits
b9460043
Commit
b9460043
authored
8 years ago
by
Sandy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单列表支付功能
parent
1c201bb3
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
119 additions
and
8 deletions
+119
-8
project.pbxproj
ALand.xcodeproj/project.pbxproj
+6
-0
OrderDetailViewController.m
...ass/Home/ViewController/Order/OrderDetailViewController.m
+2
-1
OrderWebViewController.h
...eClass/Home/ViewController/Order/OrderWebViewController.h
+13
-0
OrderWebViewController.m
...eClass/Home/ViewController/Order/OrderWebViewController.m
+87
-0
WebViewController.h
ALand/CodeClass/Home/WebViewController.h
+7
-3
WebViewController.m
ALand/CodeClass/Home/WebViewController.m
+3
-4
PayView.m
ALand/Global/pay/PayView.m
+1
-0
No files found.
ALand.xcodeproj/project.pbxproj
View file @
b9460043
...
...
@@ -329,6 +329,7 @@
19DCCBFB1C9AA2180072C3BF
/* UIAlertView+Blocks.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
19DCCBF81C9AA2180072C3BF
/* UIAlertView+Blocks.m */
;
};
19DCCBFE1C9AA2A90072C3BF
/* ICRDataBaseController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
19DCCBFD1C9AA2A90072C3BF
/* ICRDataBaseController.m */
;
};
2729456D08033910EB3A7F89
/* libPods.a in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F32A640135BB4E1F47CB0E21
/* libPods.a */
;
};
8F1E2CE41D7042A5002CCC76
/* OrderWebViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8F1E2CE31D7042A5002CCC76
/* OrderWebViewController.m */
;
};
8F59F0241D6D725500C9A564
/* NoPaymentTableViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8F59F0231D6D725500C9A564
/* NoPaymentTableViewController.m */
;
};
8F8D99431D6706E50080ECC1
/* PayView.xib in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8F8D99421D6706E50080ECC1
/* PayView.xib */
;
};
8F8D994B1D670F3B0080ECC1
/* PayView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8F8D994A1D670F3B0080ECC1
/* PayView.m */
;
};
...
...
@@ -949,6 +950,8 @@
19DCCBF81C9AA2180072C3BF
/* UIAlertView+Blocks.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
"UIAlertView+Blocks.m"
;
sourceTree
=
"<group>"
;
};
19DCCBFC1C9AA2A90072C3BF
/* ICRDataBaseController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
ICRDataBaseController.h
;
sourceTree
=
"<group>"
;
};
19DCCBFD1C9AA2A90072C3BF
/* ICRDataBaseController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
ICRDataBaseController.m
;
sourceTree
=
"<group>"
;
};
8F1E2CE21D7042A5002CCC76
/* OrderWebViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
OrderWebViewController.h
;
sourceTree
=
"<group>"
;
};
8F1E2CE31D7042A5002CCC76
/* OrderWebViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
OrderWebViewController.m
;
sourceTree
=
"<group>"
;
};
8F59F0221D6D725500C9A564
/* NoPaymentTableViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
NoPaymentTableViewController.h
;
sourceTree
=
"<group>"
;
};
8F59F0231D6D725500C9A564
/* NoPaymentTableViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
NoPaymentTableViewController.m
;
sourceTree
=
"<group>"
;
};
8F8D99421D6706E50080ECC1
/* PayView.xib */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
file.xib
;
path
=
PayView.xib
;
sourceTree
=
"<group>"
;
};
...
...
@@ -1498,6 +1501,8 @@
197975501CAB6F5D00407E3F
/* OrderViewController.m */
,
199B4D661CABBCF600451E0E
/* OrderDetailViewController.h */
,
199B4D671CABBCF600451E0E
/* OrderDetailViewController.m */
,
8F1E2CE21D7042A5002CCC76
/* OrderWebViewController.h */
,
8F1E2CE31D7042A5002CCC76
/* OrderWebViewController.m */
,
);
name
=
"Order(订单)"
;
path
=
Order
;
...
...
@@ -2537,6 +2542,7 @@
191AEE611CBCC6D100F5E535
/* OperCtx.m in Sources */
,
19DCCBC91C9AA0450072C3BF
/* NSNull+OVNatural.m in Sources */
,
19DC6B131CC0ACDE0064A9FD
/* MyteamTopView.m in Sources */
,
8F1E2CE41D7042A5002CCC76
/* OrderWebViewController.m in Sources */
,
195EB1E01CA5292600E298BB
/* AddCommodityFooterCollectionReusableView.m in Sources */
,
194FB0B21CE2E95B0089A3D5
/* UserInfoOperator.m in Sources */
,
190A46611CE045EB006037CB
/* FeedBackViewController.m in Sources */
,
...
...
This diff is collapsed.
Click to expand it.
ALand/CodeClass/Home/ViewController/Order/OrderDetailViewController.m
View file @
b9460043
...
...
@@ -15,6 +15,7 @@
#import "CommodityDetailViewController.h"
#import "CommodityListModel/CommotityListModel.h"
#import "WebViewController.h"
#import "OrderWebViewController.h"
#define kCellId @"OrderDetailTableViewCell.h"
@interface
OrderDetailViewController
()
<
UITableViewDelegate
,
UITableViewDataSource
>
@property
(
nonatomic
,
strong
)
UITableView
*
tableView
;
...
...
@@ -66,7 +67,7 @@
}
-
(
void
)
actionPay
{
WebViewController
*
payVC
=
[[
WebViewController
alloc
]
init
];
OrderWebViewController
*
payVC
=
[[
Order
WebViewController
alloc
]
init
];
UserInfo
*
user
=
[
UserInfo
shareInstance
];
NSString
*
url
=
[
NSString
stringWithFormat
:
@"%@Wap/orderDetail/id/%@/shop_id/%@/mobile/%@.html"
,
user
.
appConfig
.
webShopBaseUrl
,
self
.
model
.
billNumber
,
self
.
model
.
shop
.
uuid
,
user
.
reseller
.
mobilephone
];
payVC
.
URL
=
url
;
...
...
This diff is collapsed.
Click to expand it.
ALand/CodeClass/Home/ViewController/Order/OrderWebViewController.h
0 → 100644
View file @
b9460043
//
// OrderWebViewController.h
// ALand
//
// Created by Javen on 16/8/26.
// Copyright © 2016年 Z. All rights reserved.
//
#import "WebViewController.h"
@interface
OrderWebViewController
:
WebViewController
@end
This diff is collapsed.
Click to expand it.
ALand/CodeClass/Home/ViewController/Order/OrderWebViewController.m
0 → 100644
View file @
b9460043
//
// OrderWebViewController.m
// ALand
//
// Created by Javen on 16/8/26.
// Copyright © 2016年 Z. All rights reserved.
//
#import "OrderWebViewController.h"
#import "OrderViewController.h"
@interface
OrderWebViewController
()
@end
@implementation
OrderWebViewController
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
// Do any additional setup after loading the view.
}
-
(
void
)
userContentController
:
(
WKUserContentController
*
)
userContentController
didReceiveScriptMessage
:
(
WKScriptMessage
*
)
message
{
if
([
message
.
name
isEqualToString
:
@"AppModel"
])
{
// 打印所传过来的参数,只支持NSNumber, NSString, NSDate, NSArray,
// NSDictionary, and NSNull类型
/**
* body = 000100012016080100012;
*/
NSString
*
billNumber
=
message
.
body
;
NSDictionary
*
dic
=
billNumber
.
mj_keyValues
;
self
.
payView
=
[
PayView
viewWithNibName
:
@"PayView"
];
self
.
payView
.
billUuid
=
dic
[
@"body"
];
WS
(
weakSelf
);
[
self
.
payView
show
];
self
.
payView
.
completion
=
^
(
NSString
*
result
,
PingppError
*
error
)
{
[
weakSelf
.
payView
hide
];
if
(
result
)
{
NSString
*
info
;
if
([
result
isEqualToString
:
@"cancel"
])
{
info
=
@"支付未完成"
;
}
else
if
([
result
isEqualToString
:
@"success"
]){
info
=
@"支付成功"
;
}
else
if
([
result
isEqualToString
:
@"fail"
]){
info
=
@"支付失败"
;
}
UIAlertController
*
alert
=
[
UIAlertController
alertControllerWithTitle
:
info
message
:
@"订单可在订单管理中查看"
preferredStyle
:
UIAlertControllerStyleAlert
];
UIAlertAction
*
toOrders
=
[
UIAlertAction
actionWithTitle
:
@"查看订单"
style
:
UIAlertActionStyleDefault
handler
:^
(
UIAlertAction
*
_Nonnull
action
)
{
for
(
id
vc
in
weakSelf
.
navigationController
.
viewControllers
)
{
if
([
vc
isKindOfClass
:[
OrderViewController
class
]])
{
[
weakSelf
.
navigationController
popToViewController
:
vc
animated
:
YES
];
}
}
}];
[
alert
addAction
:
toOrders
];
UIAlertAction
*
continueBuy
=
[
UIAlertAction
actionWithTitle
:
@"重试"
style
:
UIAlertActionStyleDefault
handler
:^
(
UIAlertAction
*
_Nonnull
action
)
{
[
weakSelf
.
webView
loadRequest
:[
NSURLRequest
requestWithURL
:[
NSURL
URLWithString
:
weakSelf
.
URL
]]];
}];
[
alert
addAction
:
continueBuy
];
[
weakSelf
.
navigationController
PresentModalViewController
:
alert
animated
:
YES
];
}
};
NSLog
(
@"%@"
,
message
.
body
);
}
}
-
(
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
This diff is collapsed.
Click to expand it.
ALand/CodeClass/Home/WebViewController.h
View file @
b9460043
...
...
@@ -7,8 +7,12 @@
//
#import "IBTUIViewController.h"
@interface
WebViewController
:
IBTUIViewController
#import <WebKit/WebKit.h>
#import "PayView.h"
@interface
WebViewController
:
IBTUIViewController
<
WKNavigationDelegate
,
WKUIDelegate
,
WKScriptMessageHandler
>
@property
(
nonatomic
,
copy
)
NSString
*
URL
;
@property
(
nonatomic
,
strong
)
PayView
*
payView
;
@property
(
nonatomic
,
weak
)
WKWebView
*
webView
;
-
(
void
)
userContentController
:(
WKUserContentController
*
)
userContentController
didReceiveScriptMessage
:(
WKScriptMessage
*
)
message
;
@end
This diff is collapsed.
Click to expand it.
ALand/CodeClass/Home/WebViewController.m
View file @
b9460043
...
...
@@ -13,11 +13,10 @@
#import "Pingpp.h"
#import "PayView.h"
#import "OrderViewController.h"
@interface
WebViewController
()
<
WKNavigationDelegate
,
WKUIDelegate
,
WKScriptMessageHandler
>
@property
(
nonatomic
,
weak
)
WKWebView
*
webView
;
@interface
WebViewController
()
@property
(
nonatomic
,
weak
)
UIButton
*
backItem
;
@property
(
nonatomic
,
weak
)
UIButton
*
closeItem
;
@property
(
nonatomic
,
strong
)
PayView
*
payView
;
@end
...
...
@@ -83,8 +82,8 @@
[
self
.
navigationController
PresentModalViewController
:
alertVC
animated
:
YES
];
self
.
payView
.
completion
=
^
(
NSString
*
result
,
PingppError
*
error
)
{
[
weakSelf
.
payView
hide
];
if
(
result
)
{
[
weakSelf
.
payView
hide
];
NSString
*
info
;
if
([
result
isEqualToString
:
@"cancel"
])
{
info
=
@"支付未完成"
;
...
...
This diff is collapsed.
Click to expand it.
ALand/Global/pay/PayView.m
View file @
b9460043
...
...
@@ -48,6 +48,7 @@ typedef NS_ENUM(NSInteger, payType) {
WS
(
weakSelf
)
self
.
cover
.
tapAction
=
^
{
weakSelf
.
completion
(
nil
,
nil
);
[
weakSelf
hide
];
};
}
...
...
This diff is collapsed.
Click to expand it.
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