Commit 054aa15d8d7991e5f4f4a30822eedf94295ab7ab
1 parent
c42c0aac
no message
Showing
1 changed file
with
33 additions
and
22 deletions
metaCode/Classes/Main/HomePage/Controller/WebController/CNWebView.swift
| ... | ... | @@ -12,6 +12,7 @@ import CNLiveShareToolKit |
| 12 | 12 | import CommonCrypto |
| 13 | 13 | import CNLiveBusinessTools |
| 14 | 14 | import SKPhotoBrowser |
| 15 | +import CNLivePayCostModule | |
| 15 | 16 | |
| 16 | 17 | //返回 Web控制器回调 |
| 17 | 18 | typealias cnWebControllerBackNavBlock = ()->Void |
| ... | ... | @@ -278,32 +279,42 @@ class CNWebView:UIView,WKNavigationDelegate, WKScriptMessageHandler{ |
| 278 | 279 | |
| 279 | 280 | //h5拉起原生跳转苹果内购 |
| 280 | 281 | self.bridge?.registerHandler("wjjHtmlPullApplePay", handler: { data, responseCallback in |
| 281 | -// print("js call oc\(data)") | |
| 282 | -// let dataDic = data as! Dictionary<String, Any> | |
| 283 | -// let body = dataDic["body"] as? String | |
| 284 | -// let notify_url = dataDic["notify_url"] as? String | |
| 285 | -// let orderId = dataDic["orderId"] as? String | |
| 286 | -// let prdId = dataDic["prdId"] as? String | |
| 287 | -// let total_fee = dataDic["total_fee"] as? Int | |
| 288 | -// print("拉起苹果内购") | |
| 282 | + print("js call oc\(data)") | |
| 283 | + let dataDic = data as! Dictionary<String, Any> | |
| 284 | + let body = dataDic["body"] as? String | |
| 285 | + let notify_url = dataDic["notify_url"] as? String | |
| 286 | + let orderId = dataDic["orderId"] as? String | |
| 287 | + let prdId = dataDic["prdId"] as? String | |
| 288 | + let total_fee = dataDic["total_fee"] as? Int | |
| 289 | + print("拉起苹果内购") | |
| 290 | + | |
| 291 | + //苹果内购暂时报错 应用packet无效 | |
| 292 | +// CNLivePayCostModule.showApplePayViw(withParamDict: dataDic, fromVC: currentViewController()!) {[weak self] result in | |
| 293 | +// if result == CNLivePayCostTypeResultSucc{ | |
| 294 | +// self?.bridge?.callHandler("wjjHtmlPullAppPayCallback", data: ["orderId":orderId,"payStatus":"0"], responseCallback: { responseData in | |
| 295 | +// print("succ") | |
| 296 | +// }) | |
| 297 | +// } | |
| 298 | +// | |
| 299 | +// } | |
| 289 | 300 | |
| 290 | 301 | }) |
| 291 | 302 | |
| 292 | 303 | //h5拉起原生支付(iOS不加,虚拟付费视频都内购) |
| 293 | -// self.bridge?.registerHandler("wjjHtmlPullAppPay", handler: { data, responseCallback in | |
| 294 | -// print("js call oc\(data)") | |
| 295 | -// let dic = data as! Dictionary<String, Any> | |
| 296 | -// | |
| 297 | -//// [CNLivePayCostModule showDefaultPayViwWithParamDict:htmlDict PayCostType:CNLivePayCostTypeHtml FromVC:formVC ResultBlock:^(CNLivePayCostTypeResult resultType) { | |
| 298 | -//// if (resultType == CNLivePayCostTypeResultSucc) { | |
| 299 | -//// NSString * orderId = [resultParam stringValueForKey:@"orderId" default:@""]; | |
| 300 | -//// [weakSelf.bridge callHandler:@"wjjHtmlPullAppPayCallback" data:@{@"orderId":orderId,@"payStatus":payResult == CNLiveContentPayResultSucc?@"0":@"1"} responseCallback:^(id responseData) { | |
| 301 | -//// NSLog(@"成功"); | |
| 302 | -//// }]; | |
| 303 | -// // } | |
| 304 | -//// }]; | |
| 305 | -// | |
| 306 | -// }) | |
| 304 | + self.bridge?.registerHandler("wjjHtmlPullAppPay", handler: { data, responseCallback in | |
| 305 | + print("js call oc\(data)") | |
| 306 | + let dic = data as! Dictionary<String, Any> | |
| 307 | + | |
| 308 | +// [CNLivePayCostModule showDefaultPayViwWithParamDict:htmlDict PayCostType:CNLivePayCostTypeHtml FromVC:formVC ResultBlock:^(CNLivePayCostTypeResult resultType) { | |
| 309 | +// if (resultType == CNLivePayCostTypeResultSucc) { | |
| 310 | +// NSString * orderId = [resultParam stringValueForKey:@"orderId" default:@""]; | |
| 311 | +// [weakSelf.bridge callHandler:@"wjjHtmlPullAppPayCallback" data:@{@"orderId":orderId,@"payStatus":payResult == CNLiveContentPayResultSucc?@"0":@"1"} responseCallback:^(id responseData) { | |
| 312 | +// NSLog(@"成功"); | |
| 313 | +// }]; | |
| 314 | +// } | |
| 315 | +// }]; | |
| 316 | + | |
| 317 | + }) | |
| 307 | 318 | |
| 308 | 319 | } |
| 309 | 320 | ... | ... |