apple před 5 roky
rodič
revize
ab8e8c6e72

binární
ios/JianYuIOS/JianYuIOS.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate


+ 5 - 9
ios/JianYuIOS/JianYuIOS.xcworkspace/xcuserdata/apple.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -5,19 +5,15 @@
    version = "2.0">
    <Breakpoints>
       <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
          <BreakpointContent
-            uuid = "D69C30DA-0081-4E31-BDAE-38B6B17409A3"
+            uuid = "6427B66F-69A1-457E-A629-55DF1BC8FAC6"
             shouldBeEnabled = "Yes"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "JianYuIOS/Classes&#xff08;&#x6a21;&#x5757;&#xff09;/JYSearchViewController.m"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "640"
-            endingLineNumber = "640"
-            landmarkName = "-hideTabBar"
-            landmarkType = "7">
+            breakpointStackSelectionBehavior = "1"
+            scope = "1"
+            stopOnStyle = "0">
          </BreakpointContent>
       </BreakpointProxy>
    </Breakpoints>

+ 6 - 1
ios/JianYuIOS/JianYuIOS/BaseClass1/PrefixHeader.pch

@@ -124,6 +124,9 @@ _Pragma("clang diagnostic pop")\
 #import "WXApi.h"
 //支付宝支付头文件
 #import <AlipaySDK/AlipaySDK.h>
+//内购
+#import <StoreKit/StoreKit.h>
+
 
 #import "UIView+Extension.h"
 #import "GlobalData.h"
@@ -147,6 +150,8 @@ _Pragma("clang diagnostic pop")\
 
 //#define kHost @"http://web-jydev-xzh.jianyu360.cn/" //徐志恒
 
+#define kHost @"http://web-jydev-zyx.jianyu360.cn/" 
+
 //#define kHost @"https://app-jytest.jianyu360.cn/"  //老测试
 //#define kHost @"http://anti.jianyu360.cn/"         //新测试
 //#define kHost @"https://app3-jytest.jianyu360.cn/" //app3测试
@@ -158,7 +163,7 @@ _Pragma("clang diagnostic pop")\
 //#define kHost @"http://app2-jytest.jianyu360.cn/"  //测试http
 //#define kHost @"https://app2-jytest.jianyu360.cn/" //测试https
 
-#define kHost @"http://app-i1.jianyu360.com/"   //新正式
+//#define kHost @"http://app-i1.jianyu360.com/"   //新正式
 
 
 

+ 2 - 0
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYNewExpViewController.m

@@ -80,6 +80,8 @@ NSString *const new_AesKey_3 = @"mGlAgnIBB8bx2nch";
                            @"skipCamera",
                            @"skipAlbum",
                            @"openActivityPage",
+                           @"callPhone",
+                           @"inPurchasingVip",
         ];
         for (NSString*jsName in jsArr) {
             [config.userContentController addScriptMessageHandler:self name:jsName];

+ 2 - 0
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYNewMineViewController.m

@@ -93,6 +93,8 @@ NSString *const new_AesKey_4 = @"mGlAgnIBB8bx2nch";
                            @"skipCamera",
                            @"skipAlbum",
                            @"openActivityPage",
+                           @"callPhone",
+                           @"inPurchasingVip",
         ];
         for (NSString*jsName in jsArr) {
             [config.userContentController addScriptMessageHandler:self name:jsName];

+ 127 - 4
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYNewSearchViewController.m

@@ -11,7 +11,7 @@
 #import "JYTabBarController.h"
 #import <CoreLocation/CoreLocation.h>
 
-@interface JYNewSearchViewController ()<WKNavigationDelegate,WKUIDelegate,WKScriptMessageHandler,CLLocationManagerDelegate,UINavigationControllerDelegate,UIImagePickerControllerDelegate,CLLocationManagerDelegate>
+@interface JYNewSearchViewController ()<WKNavigationDelegate,WKUIDelegate,WKScriptMessageHandler,CLLocationManagerDelegate,UINavigationControllerDelegate,UIImagePickerControllerDelegate,CLLocationManagerDelegate,SKProductsRequestDelegate,SKPaymentTransactionObserver>
 {
     NSInteger _timeTick;
     NSInteger _time;
@@ -95,6 +95,8 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
                            @"skipCamera",
                            @"skipAlbum",
                            @"openActivityPage",
+                           @"callPhone",
+                           @"inPurchasingVip",
         ];
         for (NSString*jsName in jsArr) {
             [config.userContentController addScriptMessageHandler:self name:jsName];
@@ -252,7 +254,7 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
 
 - (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message{
     //   message.body  --  Allowed types are NSNumber, NSString, NSDate, NSArray,NSDictionary, and NSNull.
-//    NSLog(@"原生收到了js发送过来的消息message.name = %@ message.body = %@",message.name,message.body);
+    NSLog(@"原生收到了js发送过来的消息message.name = %@ message.body = %@",message.name,message.body);
     if ([message.name isEqualToString:@"loginByWeixin"]) {
         [self jsLoginByWeixin:message.body];
     }else if ([message.name isEqualToString:@"share"]) {
@@ -293,6 +295,10 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
        [self jsSkipAlbum:message.body];
     }else if ([message.name isEqualToString:@"openActivityPage"]) {
        [self jsOpenActivityPage:message.body];
+    }else if ([message.name isEqualToString:@"callPhone"]) {
+       [self jsCallPhone:message.body];
+    }else if ([message.name isEqualToString:@"inPurchasingVip"]) {
+       [self jsInPurchasingVip:message.body];
     }else {
         
     }
@@ -304,7 +310,7 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
     NSError *err = nil;
     NSData *dataFromString = [prompt dataUsingEncoding:NSUTF8StringEncoding];
     NSDictionary *paramdict = [NSJSONSerialization JSONObjectWithData:dataFromString options:NSJSONReadingMutableContainers error:&err];
-//    NSLog(@"拦截prompt:%@",paramdict);
+    NSLog(@"拦截prompt:%@",paramdict);
     if (!err){
         NSString *type = [paramdict objectForKey:@"jsName"];
         if (type && [type isEqualToString:@"getUserToken"]) {
@@ -445,7 +451,11 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
         }];
     });
 }
-
+- (void)viewDidUnload {
+    NSLog(@"viewDidUnload\nviewDidUnload\nviewDidUnload\nviewDidUnload\nviewDidUnload\nviewDidUnload\nviewDidUnload\nviewDidUnload\nviewDidUnload\nviewDidUnload\n");
+    [super viewDidUnload];
+    [[SKPaymentQueue defaultQueue] removeTransactionObserver:self];
+}
 - (void)viewDidLoad {
     [super viewDidLoad];
     // Do any additional setup after loading the view.
@@ -474,8 +484,12 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
     [NSTimer scheduledTimerWithTimeInterval:3 target:self selector:@selector(bottomOneListening) userInfo:nil repeats:YES];
     
     
+    //监听购买结果
+    [[SKPaymentQueue defaultQueue] addTransactionObserver:self];
 }
 
+
+
 -(void)bottomOneListening {
     if(self.tabBarController.selectedIndex == 0) {
         [self judgeIsHiddenBottom];
@@ -1010,6 +1024,7 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
     });
 }
 
+//统计点击推送
 -(void)jsOpenActivityPage:(NSDictionary *)dict {
     NSDictionary * infoDic = @{@"url":[NSString stringWithFormat:@"%@",dict[@"url"]],
                                @"rectype":[NSString stringWithFormat:@"%@",dict[@"rectype"]],
@@ -1032,6 +1047,114 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
 }
 
 
+//拨打电话
+-(void)jsCallPhone:(NSDictionary *)dict {
+    NSString *phone = [NSString stringWithFormat:@"%@",dict[@"phone"]];
+    NSMutableString *tel = [[NSMutableString alloc]initWithFormat:@"telprompt://%@",phone];
+    dispatch_async(dispatch_get_main_queue(), ^{
+        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:tel]];
+    });
+}
+
+//内购VIP
+-(void)jsInPurchasingVip:(NSDictionary *)dict {
+    NSString *productid = [NSString stringWithFormat:@"%@",dict[@"productid"]];
+    //产品id
+    if ([productid isEqualToString:@""]) {
+        NSLog(@"订单号 有问题");
+        [[LXDataBaseManager shareDataBaseManager]showHudOnlyText:@"订单号异常" delay:1];
+        return;
+    }
+    [[LXViewControllerManager shareViewControllerManager] showHudText:@"苹果支付中"];
+    //监听购买结果
+    if([SKPaymentQueue canMakePayments]){
+        [self requestProductData:@"com.topnet.vip.000001"];
+    }else{
+        NSLog(@"不允许程序内付费");
+        [[LXViewControllerManager shareViewControllerManager]showHudOnlyText:@"不允许程序内付费" delay:1];
+    }
+}
+
+//去苹果服务器请求商品
+- (void)requestProductData:(NSString *)type {
+    NSArray *product = [[NSArray alloc] initWithObjects:type,nil];
+    NSSet *nsset = [NSSet setWithArray:product];
+    SKProductsRequest *request = [[SKProductsRequest alloc] initWithProductIdentifiers:nsset];
+    request.delegate = self;
+    [request start];
+}
+- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response {
+    NSArray *myProduct = response.products;
+    if (myProduct.count == 0) {
+        NSLog(@"无法获取产品信息,购买失败。");
+        [[LXViewControllerManager shareViewControllerManager]showHudOnlyText:@"无法获取产品信息,购买失败。" delay:1];
+        return;
+    }
+    SKPayment * payment = [SKPayment paymentWithProduct:myProduct[0]];
+    [[SKPaymentQueue defaultQueue] addPayment:payment];
+}
+ 
+//监听购买结果
+- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions {
+    for (SKPaymentTransaction *transaction in transactions) {
+        switch (transaction.transactionState) {
+            case SKPaymentTransactionStatePurchased://交易完成
+                NSLog(@"购买成功transactionIdentifier = %@", transaction.transactionIdentifier);
+                [self completeTransaction:transaction];
+                break;
+            case SKPaymentTransactionStateFailed://交易失败
+                [self failedTransaction:transaction];
+                break;
+            case SKPaymentTransactionStateRestored://已经购买过该商品
+                [self restoreTransaction:transaction];
+                break;
+            case SKPaymentTransactionStatePurchasing://商品添加进列表
+                NSLog(@"商品添加进列表");
+                break;
+            default:
+                break;
+        }
+    }
+}
+ - (void)completeTransaction:(SKPaymentTransaction *)transaction {
+     // Your application should implement these two methods.
+     
+     [[LXViewControllerManager shareViewControllerManager] hideHud];
+     NSString * productIdentifier = transaction.payment.productIdentifier;
+//     NSString * receipt = [transaction.transactionReceipt base64EncodedString];
+     if ([productIdentifier length] > 0) {
+         // 向自己的服务器验证购买凭证
+         
+         
+         
+     }
+     // Remove the transaction from the payment queue.
+     [[SKPaymentQueue defaultQueue] finishTransaction: transaction];
+  
+ }
+ - (void)failedTransaction:(SKPaymentTransaction *)transaction {
+     [[LXViewControllerManager shareViewControllerManager] hideHud];
+     if(transaction.error.code != SKErrorPaymentCancelled) {
+         NSLog(@"购买失败");
+         [[LXViewControllerManager shareViewControllerManager]showHudOnlyText:@"购买失败,请重新尝试。" delay:1];
+     } else {
+         NSLog(@"用户取消交易");
+         [[LXViewControllerManager shareViewControllerManager]showHudOnlyText:@"取消交易" delay:1];
+     }
+     [[SKPaymentQueue defaultQueue] finishTransaction: transaction];
+ }
+ - (void)restoreTransaction:(SKPaymentTransaction *)transaction {\
+   // 对于已购商品,处理恢复购买的逻辑
+     NSLog(@"对于已购商品,处理恢复购买的逻辑");
+     [[LXViewControllerManager shareViewControllerManager] hideHud];
+     [[SKPaymentQueue defaultQueue] finishTransaction: transaction];
+ }
+
+
+
+
+
+
 
 // web是否可退回上页面
 -(int)jsIsCanBack:(NSString *)str{

+ 2 - 0
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYNewSubViewController.m

@@ -88,6 +88,8 @@ NSString *const new_AesKey_2 = @"mGlAgnIBB8bx2nch";
                            @"skipCamera",
                            @"skipAlbum",
                            @"openActivityPage",
+                           @"callPhone",
+                           @"inPurchasingVip",
         ];
         for (NSString*jsName in jsArr) {
             [config.userContentController addScriptMessageHandler:self name:jsName];

+ 14 - 0
ios/JianYuIOS/JianYuIOS/Info.plist

@@ -109,6 +109,13 @@
 				<key>NSIncludesSubdomains</key>
 				<true/>
 			</dict>
+			<key>web-jydev-wcj.jianyu360.cn</key>
+			<dict>
+				<key>NSExceptionAllowsInsecureHTTPLoads</key>
+				<true/>
+				<key>NSIncludesSubdomains</key>
+				<true/>
+			</dict>
 			<key>web-jydev-wky.jianyu360.cn</key>
 			<dict>
 				<key>NSExceptionAllowsInsecureHTTPLoads</key>
@@ -137,6 +144,13 @@
 				<key>NSIncludesSubdomains</key>
 				<true/>
 			</dict>
+			<key>web-jydev-zyx.jianyu360.cn</key>
+			<dict>
+				<key>NSExceptionAllowsInsecureHTTPLoads</key>
+				<true/>
+				<key>NSIncludesSubdomains</key>
+				<true/>
+			</dict>
 		</dict>
 	</dict>
 	<key>NSCameraUsageDescription</key>