Commit a048f448 by lee

u

parent 39541fe2
...@@ -32,5 +32,6 @@ pod 'YYWebImage' ...@@ -32,5 +32,6 @@ pod 'YYWebImage'
pod 'MagicalRecord','~> 2.2' pod 'MagicalRecord','~> 2.2'
pod 'Mobile-Buy-SDK',:git => 'https://github.com/houweibin/mobile-buy-sdk-ios' pod 'Mobile-Buy-SDK',:git => 'https://github.com/houweibin/mobile-buy-sdk-ios'
#pod 'Mobile-Buy-SDK',:path => '../Pods/mobile-buy-sdk-ios' #pod 'Mobile-Buy-SDK',:path => '../Pods/mobile-buy-sdk-ios'
pod 'JLRoutes'
end end
...@@ -315,6 +315,7 @@ ...@@ -315,6 +315,7 @@
C0F5869D1E25D3B6001248E2 /* KWMProductDetailView.xib in Resources */ = {isa = PBXBuildFile; fileRef = C0F5869C1E25D3B6001248E2 /* KWMProductDetailView.xib */; }; C0F5869D1E25D3B6001248E2 /* KWMProductDetailView.xib in Resources */ = {isa = PBXBuildFile; fileRef = C0F5869C1E25D3B6001248E2 /* KWMProductDetailView.xib */; };
C0F586AE1E279574001248E2 /* KWMBottomView.xib in Resources */ = {isa = PBXBuildFile; fileRef = C0F586AD1E279574001248E2 /* KWMBottomView.xib */; }; C0F586AE1E279574001248E2 /* KWMBottomView.xib in Resources */ = {isa = PBXBuildFile; fileRef = C0F586AD1E279574001248E2 /* KWMBottomView.xib */; };
C0FC278E1D9B73B000C5CFFE /* KWMGiftCardCell.m in Sources */ = {isa = PBXBuildFile; fileRef = C0FC278D1D9B73B000C5CFFE /* KWMGiftCardCell.m */; }; C0FC278E1D9B73B000C5CFFE /* KWMGiftCardCell.m in Sources */ = {isa = PBXBuildFile; fileRef = C0FC278D1D9B73B000C5CFFE /* KWMGiftCardCell.m */; };
DAB6431A1F04CFE5002CD7FE /* AppDelegate+Deeplink.m in Sources */ = {isa = PBXBuildFile; fileRef = DAB643191F04CFE5002CD7FE /* AppDelegate+Deeplink.m */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */ /* Begin PBXContainerItemProxy section */
...@@ -876,6 +877,8 @@ ...@@ -876,6 +877,8 @@
C0F586AD1E279574001248E2 /* KWMBottomView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = KWMBottomView.xib; sourceTree = "<group>"; }; C0F586AD1E279574001248E2 /* KWMBottomView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = KWMBottomView.xib; sourceTree = "<group>"; };
C0FC278C1D9B73B000C5CFFE /* KWMGiftCardCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KWMGiftCardCell.h; sourceTree = "<group>"; }; C0FC278C1D9B73B000C5CFFE /* KWMGiftCardCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KWMGiftCardCell.h; sourceTree = "<group>"; };
C0FC278D1D9B73B000C5CFFE /* KWMGiftCardCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KWMGiftCardCell.m; sourceTree = "<group>"; }; C0FC278D1D9B73B000C5CFFE /* KWMGiftCardCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KWMGiftCardCell.m; sourceTree = "<group>"; };
DAB643181F04CFE5002CD7FE /* AppDelegate+Deeplink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "AppDelegate+Deeplink.h"; sourceTree = "<group>"; };
DAB643191F04CFE5002CD7FE /* AppDelegate+Deeplink.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "AppDelegate+Deeplink.m"; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
...@@ -1209,6 +1212,8 @@ ...@@ -1209,6 +1212,8 @@
80ED0A3D1D93B4CF00B28DF2 /* CoreData */, 80ED0A3D1D93B4CF00B28DF2 /* CoreData */,
9B0F56B61ECD3424009FC5FE /* UIViewController+AppearLog.h */, 9B0F56B61ECD3424009FC5FE /* UIViewController+AppearLog.h */,
9B0F56B71ECD3424009FC5FE /* UIViewController+AppearLog.m */, 9B0F56B71ECD3424009FC5FE /* UIViewController+AppearLog.m */,
DAB643181F04CFE5002CD7FE /* AppDelegate+Deeplink.h */,
DAB643191F04CFE5002CD7FE /* AppDelegate+Deeplink.m */,
); );
path = Class; path = Class;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -2448,6 +2453,7 @@ ...@@ -2448,6 +2453,7 @@
C066650F1D7675FC00F02EF4 /* KWMAboutUsVC.m in Sources */, C066650F1D7675FC00F02EF4 /* KWMAboutUsVC.m in Sources */,
807AF4A31DC984950000A326 /* KWMBlogResult.m in Sources */, 807AF4A31DC984950000A326 /* KWMBlogResult.m in Sources */,
C0CC14081D7823B0007B5986 /* KWMSizeCell.m in Sources */, C0CC14081D7823B0007B5986 /* KWMSizeCell.m in Sources */,
DAB6431A1F04CFE5002CD7FE /* AppDelegate+Deeplink.m in Sources */,
C06665121D767A0A00F02EF4 /* KWMContactUsVC.m in Sources */, C06665121D767A0A00F02EF4 /* KWMContactUsVC.m in Sources */,
C034E6CF1D6AEE39006EE129 /* KWMUserDao.m in Sources */, C034E6CF1D6AEE39006EE129 /* KWMUserDao.m in Sources */,
C0DD530F1EE54A9E002D1E0C /* KWMBarandSelectView.m in Sources */, C0DD530F1EE54A9E002D1E0C /* KWMBarandSelectView.m in Sources */,
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#import "KWMLoginVC.h" #import "KWMLoginVC.h"
#import "KWMUserModel.h" #import "KWMUserModel.h"
#import <AlipaySDK/AlipaySDK.h> #import <AlipaySDK/AlipaySDK.h>
#import "AppDelegate+Deeplink.h"
@interface AppDelegate () @interface AppDelegate ()
...@@ -76,6 +77,7 @@ ...@@ -76,6 +77,7 @@
}else{ }else{
[self toMain]; [self toMain];
} }
[self registerRouter];
[WXApi registerApp:WechatAppKey]; [WXApi registerApp:WechatAppKey];
return YES; return YES;
...@@ -110,6 +112,10 @@ ...@@ -110,6 +112,10 @@
//支付宝 NOTE: 9.0以后使用新API接口 //支付宝 NOTE: 9.0以后使用新API接口
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options
{ {
if ([self handleURL:url]) {
NSLog(@"trace openURL 9.0:%@",url);
return YES;
}
if ([url.host isEqualToString:@"safepay"]) { if ([url.host isEqualToString:@"safepay"]) {
//跳转支付宝钱包进行支付,处理支付结果 //跳转支付宝钱包进行支付,处理支付结果
[[AlipaySDK defaultService] processOrderWithPaymentResult:url standbyCallback:^(NSDictionary *resultDic) { [[AlipaySDK defaultService] processOrderWithPaymentResult:url standbyCallback:^(NSDictionary *resultDic) {
...@@ -127,10 +133,18 @@ ...@@ -127,10 +133,18 @@
//微信需要重写 //微信需要重写
-(BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url{ -(BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url{
if ([self handleURL:url]) {
NSLog(@"trace handleOpenURL:%@",url);
return YES;
}
return [WXApi handleOpenURL:url delegate:self]; return [WXApi handleOpenURL:url delegate:self];
} }
-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation{ -(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation{
if ([self handleURL:url]) {
NSLog(@"trace openURL 8.0:%@",url);
return YES;
}
return [WXApi handleOpenURL:url delegate:self]; return [WXApi handleOpenURL:url delegate:self];
} }
......
//
// AppDelegate+Deeplink.h
// iCemarose
//
// Created by Sanchew on 2017/6/29.
// Copyright © 2017年 kollway. All rights reserved.
//
#import "AppDelegate.h"
@interface AppDelegate (Deeplink)
- (void) registerRouter;
- (BOOL) handleURL:(NSURL *) url;
@end
//
// AppDelegate+Deeplink.m
// iCemarose
//
// Created by Sanchew on 2017/6/29.
// Copyright © 2017年 kollway. All rights reserved.
//
#import "AppDelegate+Deeplink.h"
#import <JLRoutes/JLRoutes.h>
@implementation AppDelegate (Deeplink)
- (void)registerRouter {
JLRoutes *routes = [JLRoutes routesForScheme:@"cemarose"];
[routes addRoute:@"/collections/*" handler:^BOOL(NSDictionary<NSString *,id> * _Nonnull parameters) {
NSArray *tags = parameters[JLRouteWildcardComponentsKey];
NSLog(@"trace tags %@",[tags componentsJoinedByString:@","]);
return YES;
}];
[routes addRoute:@"/products/:id" handler:^BOOL(NSDictionary<NSString *,id> * _Nonnull parameters) {
NSLog(@"product id %@",parameters[@"id"]);
return YES;
}];
}
- (BOOL)handleURL:(NSURL *)url {
return [JLRoutes routeURL:url];
}
@end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment