apple 6 年之前
父節點
當前提交
f1413d69e6

二進制
ios/JianYuIOS/JianYuIOS.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate


+ 19 - 3
ios/JianYuIOS/JianYuIOS.xcworkspace/xcuserdata/apple.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -20,14 +20,30 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "JianYuIOS/AppDelegate.m"
-            timestampString = "586855806.150555"
+            timestampString = "587370683.089795"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "392"
-            endingLineNumber = "392"
+            startingLineNumber = "367"
+            endingLineNumber = "367"
             landmarkName = "-application:handleOpenURL:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "JianYuIOS/AppDelegate.m"
+            timestampString = "587370683.090237"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "404"
+            endingLineNumber = "404"
+            landmarkName = "-application:openURL:sourceApplication:annotation:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 18 - 37
ios/JianYuIOS/JianYuIOS/AppDelegate.m

@@ -213,22 +213,19 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
         info = [[LXViewControllerManager shareViewControllerManager] dictionaryWithJsonString:userInfo[@"info"]];
     }
     if (info ) {
-        
         if (info[@"url"]) {
-            
-            
             // 跳转到该链接
-            
-            
-            
             if([userInfo[@"type"] isEqualToString:@"bid"]) {
                 //如果是订阅消息
                 NSLog(@"%@",userInfo);
                 [[NSNotificationCenter defaultCenter] postNotificationName:ClickSubNotiMethods object:userInfo userInfo:nil];
+            }else if([userInfo[@"type"] isEqualToString:@"titleMessage"]) {
+                //新增支付通知
+                [[NSNotificationCenter defaultCenter] postNotificationName:ClickPayMethods object:userInfo userInfo:nil];
             }else {
                 [[NSNotificationCenter defaultCenter] postNotificationName:kRequestWebViewWithUrl object:userInfo userInfo:nil];
             }
-            
+
             if(self.wakeUpBool) {
                 //刚启动
                 [[NSUserDefaults standardUserDefaults]setObject:userInfo forKey:@"NotiDict"];
@@ -265,16 +262,9 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
                     NSLog(@"error=%@",error);
                 }];
             }
-            
-            
-            
-            
-            
-            
-            
+  
         }
     }
-    
 }
 
 
@@ -287,26 +277,12 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
     if ([info isKindOfClass:[NSString class]]) {
         info = [[LXViewControllerManager shareViewControllerManager] dictionaryWithJsonString:userInfo[@"info"]];
     }
-    /*
-     {
-     descript = 5555;
-     extend =     {
-     linkType = external;
-     };
-     mid = 5b5bcd5d61fd00478411f0b1;
-     openid = "ocXeA0juxw7b7A_bjXVy0NSJF5f0";
-     title = "\U6d4b\U8bd5\U4e00";
-     url = "https://www.baidu.com";
-     }
-     */
     NSLog(@"info--新消息%@",info);
     if (info ) {
         if (info[@"url"]) {
             
             [[NSNotificationCenter defaultCenter] postNotificationName:kAfterReceiveNewMsg object:nil];
-            
-            
-            //
+
             if([userInfo[@"type"] isEqualToString:@"message"]) {
                 
                 NSDictionary * infoDic = @{@"url":info[@"url"],
@@ -331,18 +307,24 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
                 NSLog(@"收到订阅推送");
                 [[NSNotificationCenter defaultCenter] postNotificationName:JYNewsRedPoint object:nil userInfo:@{@"type":@"1",@"typeMsg":userInfo[@"type"],@"url":info[@"url"]}];
                 [GlobalData shareInstance].subIsRed = YES;
-            }else {
-                NSLog(@"不是订阅推送");
             }
+            
+        
             if([userInfo[@"type"] isEqualToString:@"message"]||[userInfo[@"type"] isEqualToString:@"feedback"]||[userInfo[@"type"] isEqualToString:@"project"]||[userInfo[@"type"] isEqualToString:@"entname"]) {
                 NSLog(@"收到我的推送");
                 //收到我的推送,展示红点
                 [[NSNotificationCenter defaultCenter] postNotificationName:JYNewsRedPoint object:nil userInfo:@{@"type":@"2",@"typeMsg":userInfo[@"type"],@"url":info[@"url"]}];
                 [GlobalData shareInstance].mineIsRed = YES;
-            }else {
-                NSLog(@"不是我的推送");
             }
             
+            
+            if([userInfo[@"type"] isEqualToString:@"titleMessage"]) {
+                NSLog(@"收到我的支付推送");
+                //收到推送,我的展示红点
+                [[NSNotificationCenter defaultCenter] postNotificationName:JYNewsRedPoint object:nil userInfo:@{@"type":@"2",@"typeMsg":userInfo[@"type"],@"url":info[@"url"]}];
+                [GlobalData shareInstance].mineIsRed = YES;
+            }
+
         }
     }
     // Required, iOS 7 Support
@@ -469,7 +451,7 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
 
 #pragma mark 微信支付代理方法
 -(void)onResp:(BaseResp*)resp{
-    
+    NSLog(@"收到 微信 回执");
     if ([resp isKindOfClass:[PayResp class]]){
         PayResp*response=(PayResp*)resp;
         NSString *paystatus =@"";
@@ -493,8 +475,7 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
         
         [[NSNotificationCenter defaultCenter] postNotificationName:AlipayWXpayStatus object:paystatus userInfo:nil];
     }
-    
-    NSLog(@"收到 微信 回执");
+
 }
 
 

+ 2 - 0
ios/JianYuIOS/JianYuIOS/BaseClass1/PrefixHeader.pch

@@ -94,6 +94,8 @@ _Pragma("clang diagnostic pop")\
 #define kNewsTable @"kNewsTable"
 //点击订阅通知
 #define ClickSubNotiMethods @"ClickSubNotiMethods"
+//点击支付相关通知
+#define ClickPayMethods @"ClickPayMethods"
 
 //支付回调通知
 #define AlipayWXpayStatus @"AlipayWXpayStatus"

+ 41 - 0
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYExpViewController.m

@@ -103,6 +103,11 @@ NSString *const AesKey_2 = @"mGlAgnIBB8bx2nch";
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(requestWebView:) name:kRequestWebViewWithUrl object:nil];
     //点击订阅通知
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(clickSubNotiMethods:) name:ClickSubNotiMethods object:nil];
+    //点击支付通知
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(clickPayMethods:) name:ClickPayMethods object:nil];
+    
+    //支付状态通知
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(alipayWXpayStatus:) name:AlipayWXpayStatus object:nil];
     
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateNotifyState) name:kUpdateNotifyState object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(afterReceiveNewMsg) name:kAfterReceiveNewMsg object:nil];
@@ -320,6 +325,42 @@ NSString *const AesKey_2 = @"mGlAgnIBB8bx2nch";
     }
 }
 
+//点击支付通知
+-(void)clickPayMethods:(NSNotification *)notification{
+    NSDictionary * infoDict = [notification object][@"info"];
+    if (!infoDict) {
+        return;
+    }
+    NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
+    NSArray * array = [urlStr componentsSeparatedByString:@"=="];
+    urlStr =  [array.firstObject stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    NSString * titleStr = @"消息通知";
+    titleStr = [NSString stringWithFormat:@"%@",infoDict[@"title"]];
+    if (urlStr) {
+        if(self.tabBarController.selectedIndex == 2) {
+            [self jsOpenExternalLink:urlStr title:titleStr];
+        }
+    }
+}
+
+#pragma mark  收到z支付通知
+-(void)alipayWXpayStatus:(NSNotification *)notification{
+    
+    NSString * status = [notification object];
+    [self performSelector:@selector(payStatus:) withObject:status afterDelay:2];
+}
+
+-(void)payStatus:(NSString *)status
+{
+    //目前延时两秒
+    NSLog(@"支付状态:%@",status);
+    JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    NSString * textJS1 = [NSString stringWithFormat:@"payCallBack('%@')", status];
+    [context evaluateScript:textJS1];
+}
+
+
+
 -(void)pushDY:(NSDictionary *)infoDict
 {
     [[NSNotificationCenter defaultCenter] postNotificationName:@"refreshDY" object:nil userInfo:infoDict];

+ 111 - 39
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYMineViewController.m

@@ -49,8 +49,10 @@ JSExportAs(backUrl, -(void)jsBackUrl:(NSString*)str);
 
 
 
-//测试支付
-JSExportAs(payment, -(void)jsPayment:(NSString*)str);
+//支付相关
+JSExportAs(wxPay, -(void)jsWxPay:(NSString *)jsonString);
+JSExportAs(aliPay, -(void)jsAliPay:(NSString*)str);
+
 
 
 JSExportAs(clearPushMessage, -(void)jsClearPushMessage:(NSString*)type);
@@ -117,6 +119,11 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(requestWebView:) name:kRequestWebViewWithUrl object:nil];
     //点击订阅通知
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(clickSubNotiMethods:) name:ClickSubNotiMethods object:nil];
+    //点击支付通知
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(clickPayMethods:) name:ClickPayMethods object:nil];
+    
+    //支付状态通知
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(alipayWXpayStatus:) name:AlipayWXpayStatus object:nil];
     
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateNotifyState) name:kUpdateNotifyState object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(afterReceiveNewMsg) name:kAfterReceiveNewMsg object:nil];
@@ -355,6 +362,41 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
     }
 }
 
+//点击支付通知
+-(void)clickPayMethods:(NSNotification *)notification{
+    NSDictionary * infoDict = [notification object][@"info"];
+    if (!infoDict) {
+        return;
+    }
+    NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
+    NSArray * array = [urlStr componentsSeparatedByString:@"=="];
+    urlStr =  [array.firstObject stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    NSString * titleStr = @"消息通知";
+    titleStr = [NSString stringWithFormat:@"%@",infoDict[@"title"]];
+    if (urlStr) {
+        if(self.tabBarController.selectedIndex == 3) {
+            [self jsOpenExternalLink:urlStr title:titleStr];
+        }
+    }
+}
+
+#pragma mark  收到z支付通知
+-(void)alipayWXpayStatus:(NSNotification *)notification{
+    
+    NSString * status = [notification object];
+    [self performSelector:@selector(payStatus:) withObject:status afterDelay:2];
+}
+
+-(void)payStatus:(NSString *)status
+{
+    //目前延时两秒
+    NSLog(@"支付状态:%@",status);
+    JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    NSString * textJS1 = [NSString stringWithFormat:@"payCallBack('%@')", status];
+    [context evaluateScript:textJS1];
+}
+
+
 -(void)pushDY:(NSDictionary *)infoDict
 {
     [[NSNotificationCenter defaultCenter] postNotificationName:@"refreshDY" object:nil userInfo:infoDict];
@@ -941,43 +983,6 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
 }
 
 
--(void)jsPayment:(NSString*)str
-{
-    NSLog(@"支付");
-    return;
-    NSDictionary *data = @{ @"appId":@"wx0e6a5b18f4cfd10d",
-                            @"nonceStr":@"ZMZqGVibnrQSGlmq",
-                            @"partnerid":@"1513535801",
-                            @"paySign":@"046AFF278351BD5B685F153057B61CF9",
-                            @"prepay_id":@"wx241022000493643eb8db09901655699181",
-                            @"timeStamp":@"1543026120",
-                            };
-    
-    
-    /*
-     {
-     appId = wx0666de5698bc8d59;
-     nonceStr = ZMZqGVibnrQSGlmq;
-     "order_no" = AB24261197794989;
-     partnerid = 1513535801;
-     paySign = 046AFF278351BD5B685F153057B61CF9;
-     "prepay_id" = wx241022000493643eb8db09901655699181;
-     timeStamp = 1543026120;
-     }
-     */
-    
-    //吊起微信
-    //    PayReq *request = [[PayReq alloc] init] ;
-    //    request.package = @"Sign=WXPay";
-    //    request.nonceStr= data[@"nonceStr"];
-    //    request.partnerId = data[@"partnerid"];
-    //    request.sign= data[@"paySign"];
-    //    request.timeStamp= [data[@"timeStamp"] intValue];
-    //    request.openID = data[@"appId"];
-    //    request.prepayId= data[@"prepay_id"];
-    //    [WXApi sendReq:request];
-}
-
 
 
 -(void)jsHideRedSpotOnMenu:(NSString*)str
@@ -1024,6 +1029,73 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
     });
 }
 
+
+
+#pragma mark  支付相关
+
+-(void)jsWxPay:(NSString *)jsonString
+{
+    /*
+     {"Prepayid":"wx31091637721432c596f288011332866700","PackageStr":"Sign=WXPay","Noncestr":"3672278166105353OSDXVDiJqjdsBQzz","Timestamp":"1564535754","Sign":"C1A3579B264B8BC984576DFF083AE7C8"}
+     */
+    
+    //    NSDictionary *Object=[NSJSONSerialization JSONObjectWithData:dict options:NSJSONReadingMutableLeaves error:nil];
+    
+    NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
+    
+    NSError *err;
+    
+    NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonData
+                         
+                                                        options:NSJSONReadingMutableContainers
+                         
+                                                          error:&err];
+    
+    NSLog(@"%@",dic);
+    
+    if(err) {
+        
+        NSLog(@"json解析失败:%@",err);
+        
+        return;
+        
+    }
+    
+    
+    
+    //吊起微信
+    PayReq *request = [[PayReq alloc] init] ;
+    request.openID = dic[@"Appid"];
+    
+    
+    request.partnerId = dic[@"Partnerid"];
+    request.prepayId= dic[@"Prepayid"];
+    request.package = @"Sign=WXPay";
+    request.nonceStr= dic[@"Noncestr"];
+    request.timeStamp= [dic[@"Timestamp"] intValue];
+    request.sign= dic[@"Sign"];
+    
+    
+    
+    kMainQueue(^{
+        [WXApi sendReq:request];
+    });
+    
+    
+    
+    
+    
+}
+-(void)jsAliPay:(NSString*)str
+{
+    kMainQueue(^{
+        [[AlipaySDK defaultService] payOrder:str fromScheme:@"jianyuiosapp" callback:nil];
+    });
+    
+    
+}
+
+
 /*
  #pragma mark - Navigation
  

+ 24 - 3
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYSearchViewController.m

@@ -125,6 +125,11 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(requestWebView:) name:kRequestWebViewWithUrl object:nil];
     //点击订阅通知
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(clickSubNotiMethods:) name:ClickSubNotiMethods object:nil];
+    //点击支付通知
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(clickPayMethods:) name:ClickPayMethods object:nil];
+    //支付状态通知
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(alipayWXpayStatus:) name:AlipayWXpayStatus object:nil];
+    
     
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateNotifyState) name:kUpdateNotifyState object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(afterReceiveNewMsg) name:kAfterReceiveNewMsg object:nil];
@@ -134,8 +139,7 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
     [[AFNetworkReachabilityManager sharedManager] startMonitoring];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(netReachChanged:) name:AFNetworkingReachabilityDidChangeNotification object:nil];
     
-    //d支付通知
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(alipayWXpayStatus:) name:AlipayWXpayStatus object:nil];
+    
     
     
     //前往登录通知-tabbar
@@ -479,13 +483,30 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
     }
 }
 
+//点击支付通知
+-(void)clickPayMethods:(NSNotification *)notification{
+    NSDictionary * infoDict = [notification object][@"info"];
+    if (!infoDict) {
+        return;
+    }
+    NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
+    NSArray * array = [urlStr componentsSeparatedByString:@"=="];
+    urlStr =  [array.firstObject stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    NSString * titleStr = @"消息通知";
+    titleStr = [NSString stringWithFormat:@"%@",infoDict[@"title"]];
+    if (urlStr) {
+        if(self.tabBarController.selectedIndex == 0) {
+            [self jsOpenExternalLink:urlStr title:titleStr];
+        }
+    }
+}
+
 -(void)pushDY:(NSDictionary *)infoDict
 {
     [[NSNotificationCenter defaultCenter] postNotificationName:@"refreshDY" object:nil userInfo:infoDict];
 }
 
 #pragma mark  收到z支付通知
-
 -(void)alipayWXpayStatus:(NSNotification *)notification{
     
     NSString * status = [notification object];

+ 38 - 0
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYSubViewController.m

@@ -105,6 +105,11 @@ NSString *const AesKey_1 = @"mGlAgnIBB8bx2nch";
     
     //点击订阅通知
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(clickSubNotiMethods:) name:ClickSubNotiMethods object:nil];
+    //点击支付通知
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(clickPayMethods:) name:ClickPayMethods object:nil];
+    
+    //支付状态通知
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(alipayWXpayStatus:) name:AlipayWXpayStatus object:nil];
     
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateNotifyState) name:kUpdateNotifyState object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(afterReceiveNewMsg) name:kAfterReceiveNewMsg object:nil];
@@ -325,7 +330,40 @@ NSString *const AesKey_1 = @"mGlAgnIBB8bx2nch";
     }
 }
 
+//点击支付通知
+-(void)clickPayMethods:(NSNotification *)notification{
+    NSDictionary * infoDict = [notification object][@"info"];
+    if (!infoDict) {
+        return;
+    }
+    NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
+    NSArray * array = [urlStr componentsSeparatedByString:@"=="];
+    urlStr =  [array.firstObject stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    NSString * titleStr = @"消息通知";
+    titleStr = [NSString stringWithFormat:@"%@",infoDict[@"title"]];
+    if (urlStr) {
+        if(self.tabBarController.selectedIndex == 1) {
+            [self jsOpenExternalLink:urlStr title:titleStr];
+        }
+    }
+}
+
 
+#pragma mark  收到z支付通知
+-(void)alipayWXpayStatus:(NSNotification *)notification{
+    
+    NSString * status = [notification object];
+    [self performSelector:@selector(payStatus:) withObject:status afterDelay:2];
+}
+
+-(void)payStatus:(NSString *)status
+{
+    //目前延时两秒
+    NSLog(@"支付状态:%@",status);
+    JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    NSString * textJS1 = [NSString stringWithFormat:@"payCallBack('%@')", status];
+    [context evaluateScript:textJS1];
+}
 
 
 

+ 2 - 2
ios/JianYuIOS/JianYuIOS/Info.plist

@@ -5,7 +5,7 @@
 	<key>CFBundleDevelopmentRegion</key>
 	<string>$(DEVELOPMENT_LANGUAGE)</string>
 	<key>CFBundleDisplayName</key>
-	<string>剑鱼招标订阅</string>
+	<string>剑鱼标讯</string>
 	<key>CFBundleExecutable</key>
 	<string>$(EXECUTABLE_NAME)</string>
 	<key>CFBundleIdentifier</key>
@@ -56,7 +56,7 @@
 		</dict>
 	</array>
 	<key>CFBundleVersion</key>
-	<string>19</string>
+	<string>25</string>
 	<key>LSApplicationQueriesSchemes</key>
 	<array>
 		<string>wtloginmqq2</string>

+ 111 - 5
ios/JianYuIOS/JianYuIOS/NewWebController.m

@@ -8,7 +8,20 @@
 
 #import "NewWebController.h"
 
-@interface NewWebController ()<UIWebViewDelegate>
+@protocol JYNewWebControllerJSExport<JSExport>
+
+
+
+//支付相关
+JSExportAs(wxPay, -(void)jsWxPay:(NSString *)jsonString);
+
+JSExportAs(aliPay, -(void)jsAliPay:(NSString*)str);
+
+@end
+
+
+
+@interface NewWebController ()<UIWebViewDelegate,JYNewWebControllerJSExport>
 
 @property (weak, nonatomic) IBOutlet UIWebView *webView;
 @property (weak, nonatomic) IBOutlet UIButton *backBtn;
@@ -28,10 +41,6 @@
 - (void)viewDidLoad {
     [super viewDidLoad];
     // Do any additional setup after loading the view from its nib.
-//    if ([[UIDevice currentDevice].systemVersion floatValue] >= 11.0) {
-//        self.topC.constant = -20;
-//        [self.webView updateConstraints];
-//    }
     if (IphonexAboveScreen) {
         self.topC.constant = 44;
         [self.view updateConstraints];
@@ -70,6 +79,9 @@
 //    [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
     [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.url]]];
     
+    //支付状态通知
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(alipayWXpayStatus:) name:AlipayWXpayStatus object:nil];
+    
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(dismissSelf) name:@"kNewWebControllerDismiss" object:nil];
 }
 
@@ -79,17 +91,111 @@
     });
 }
 
+
+#pragma mark  收到z支付通知
+-(void)alipayWXpayStatus:(NSNotification *)notification{
+    
+    NSString * status = [notification object];
+    [self performSelector:@selector(payStatus:) withObject:status afterDelay:2];
+}
+
+-(void)payStatus:(NSString *)status
+{
+    //目前延时两秒
+    NSLog(@"支付状态:%@",status);
+    JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    NSString * textJS1 = [NSString stringWithFormat:@"payCallBack('%@')", status];
+    [context evaluateScript:textJS1];
+}
+
+
+#pragma mark  支付相关
+
+-(void)jsWxPay:(NSString *)jsonString
+{
+
+    NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
+    
+    NSError *err;
+    
+    NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonData
+                         
+                                                        options:NSJSONReadingMutableContainers
+                         
+                                                          error:&err];
+    
+    NSLog(@"%@",dic);
+    
+    if(err) {
+        
+        NSLog(@"json解析失败:%@",err);
+        
+        return;
+        
+    }
+    
+    
+    
+    //吊起微信
+    PayReq *request = [[PayReq alloc] init] ;
+    request.openID = dic[@"Appid"];
+    
+    
+    request.partnerId = dic[@"Partnerid"];
+    request.prepayId= dic[@"Prepayid"];
+    request.package = @"Sign=WXPay";
+    request.nonceStr= dic[@"Noncestr"];
+    request.timeStamp= [dic[@"Timestamp"] intValue];
+    request.sign= dic[@"Sign"];
+    
+    
+    
+    kMainQueue(^{
+        [WXApi sendReq:request];
+    });
+    
+    
+    
+    
+    
+}
+-(void)jsAliPay:(NSString*)str
+{
+    kMainQueue(^{
+        [[AlipaySDK defaultService] payOrder:str fromScheme:@"jianyuiosapp" callback:nil];
+    });
+    
+    
+}
+
+
+
+
 #pragma mark  webView代理方法
 -(void)webViewDidFinishLoad:(UIWebView *)webView{
 //    [[LXViewControllerManager shareViewControllerManager] hideHud];
     [self removeProgresView];
     // Disable user selection
+
+
+    [[LXViewControllerManager shareViewControllerManager] hideHud];
+    
+    
+    JSContext *context = [webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    // Disable user selection
     [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitUserSelect='none';"];
     // Disable callout
     [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitTouchCallout='none';"];
+    
+    context[@"JyObj"] = self;
+    [context evaluateScript:@"afterPageInit()"];
 }
 
 
+
+
+
+
 -(void)webViewDidStartLoad:(UIWebView *)webView{
     if (!self.titleShow) {
         [self addProgressView];