Kaynağa Gözat

打开支付相关功能

zhengkun 2 ay önce
ebeveyn
işleme
dc78a31cc1

BIN
ios/JianYuIOS/JianYuIOS.xcworkspace/xcuserdata/zhengkun.xcuserdatad/UserInterfaceState.xcuserstate


+ 28 - 27
ios/JianYuIOS/JianYuIOS/AppDelegate.m

@@ -105,13 +105,14 @@
     
     
 
+    //@"http://mobile.umeng.com/social"
+    [[UMSocialManager defaultManager] setPlaform:UMSocialPlatformType_WechatSession appKey:@"wx0e6a5b18f4cfd10d" appSecret:@"b9a93038b7481278f7a0e048c0d81770" redirectURL:nil];
     
-    [[UMSocialManager defaultManager] setPlaform:UMSocialPlatformType_WechatSession appKey:@"wx0e6a5b18f4cfd10d" appSecret:@"b9a93038b7481278f7a0e048c0d81770" redirectURL:@"http://mobile.umeng.com/social"];
-    
-    //MYFVJZhtygWy5hzh  秘钥 1106703118
-    [[UMSocialManager defaultManager] setPlaform:UMSocialPlatformType_QQ appKey:@"1106734232"/*设置QQ平台的appID*/  appSecret:nil redirectURL:@"http://mobile.umeng.com/social"];
+    //MYFVJZhtygWy5hzh  秘钥 1106703118 @"http://mobile.umeng.com/social"
+    [[UMSocialManager defaultManager] setPlaform:UMSocialPlatformType_QQ appKey:@"1106734232"/*设置QQ平台的appID*/  appSecret:nil redirectURL:nil];
     
     
+    //微信平台
     [WXApi registerApp:@"wx0e6a5b18f4cfd10d" universalLink:@"https://www.jianyu360.cn/"];
 
 }
@@ -478,29 +479,29 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken{
 #pragma mark 微信支付代理方法
 -(void)onResp:(BaseResp*)resp{
     NSLog(@"收到 微信 回执");
-//    if ([resp isKindOfClass:[PayResp class]]){
-//        PayResp*response=(PayResp*)resp;
-//        NSString *paystatus =@"";
-//        switch(response.errCode){
-//            case WXSuccess:
-//                paystatus = @"1";
-//                NSLog(@"微信支付成功");
-//                break;
-//
-//            case WXErrCodeUserCancel:
-//                paystatus = @"0";
-//                NSLog(@"微信支付取消");
-//                break;
-//
-//            default:
-//                paystatus = @"-1";
-//                NSLog(@"微信支付失败");
-//                break;
-//        }
-//
-//
-//        [[NSNotificationCenter defaultCenter] postNotificationName:AlipayWXpayStatus object:paystatus userInfo:nil];
-//    }
+    if ([resp isKindOfClass:[PayResp class]]){
+        PayResp*response=(PayResp*)resp;
+        NSString *paystatus =@"";
+        switch(response.errCode){
+            case WXSuccess:
+                paystatus = @"1";
+                NSLog(@"微信支付成功");
+                break;
+
+            case WXErrCodeUserCancel:
+                paystatus = @"0";
+                NSLog(@"微信支付取消");
+                break;
+
+            default:
+                paystatus = @"-1";
+                NSLog(@"微信支付失败");
+                break;
+        }
+
+
+        [[NSNotificationCenter defaultCenter] postNotificationName:AlipayWXpayStatus object:paystatus userInfo:nil];
+    }
 
 }
 

+ 14 - 14
ios/JianYuIOS/JianYuIOS/Classes(新模块)/JYBaseViewController.m

@@ -891,20 +891,20 @@ NSString *const new_AesKey = @"mGlAgnIBB8bx2nch";
         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 completion:^(BOOL success) {
-//            
-//        }];
-//    });
+    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 completion:^(BOOL success) {
+            
+        }];
+    });
 }
 -(void)jsAliPay:(NSDictionary *)dict {
     if (![LXUserDefaults isInstallAli]) {

+ 7 - 1
ios/JianYuIOS/JianYuIOS/Info.plist

@@ -21,6 +21,8 @@
 	<key>CFBundleURLTypes</key>
 	<array>
 		<dict>
+			<key>CFBundleURLName</key>
+			<string>wechat</string>
 			<key>CFBundleTypeRole</key>
 			<string>Editor</string>
 			<key>CFBundleURLSchemes</key>
@@ -29,6 +31,8 @@
 			</array>
 		</dict>
 		<dict>
+			<key>CFBundleURLName</key>
+			<string>tencent</string>
 			<key>CFBundleTypeRole</key>
 			<string>Editor</string>
 			<key>CFBundleURLSchemes</key>
@@ -37,11 +41,13 @@
 			</array>
 		</dict>
 		<dict>
+			<key>CFBundleURLName</key>
+			<string>qq</string>
 			<key>CFBundleTypeRole</key>
 			<string>Editor</string>
 			<key>CFBundleURLSchemes</key>
 			<array>
-				<string>QQ41f76c98</string>
+				<string>QQ41F76C98</string>
 			</array>
 		</dict>
 		<dict>