|
@@ -7,6 +7,16 @@
|
|
|
|
|
|
#import "ASJumpHandler.h"
|
|
#import "ASJumpHandler.h"
|
|
|
|
|
|
|
|
+#import "ASOrderListViewController.h"
|
|
|
|
+#import "Cart_MyCartC.h"
|
|
|
|
+#import "ASMessageListViewController.h"
|
|
|
|
+#import "ASProductListViewController.h"
|
|
|
|
+#import "ASGoodsDetailsViewController.h"
|
|
|
|
+#import "ASPointsHomeViewController.h"
|
|
|
|
+#import "ASVipCenterViewController.h"
|
|
|
|
+#import "ASCouponsListViewController.h"
|
|
|
|
+
|
|
|
|
+
|
|
@implementation ASJumpHandler
|
|
@implementation ASJumpHandler
|
|
|
|
|
|
static ASJumpHandler *jumpHandler = nil;
|
|
static ASJumpHandler *jumpHandler = nil;
|
|
@@ -20,5 +30,237 @@ static ASJumpHandler *jumpHandler = nil;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+- (void)handleMessage:(NSString *)title messageId:(NSString *)mid pushPara:(NSString *)push_para pushType:(NSInteger)type {
|
|
|
|
+
|
|
|
|
+ [self handleJumpWithTitle:title jumpData:push_para type:type];
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+- (void)handleJumpWithTitle:(NSString *)title jumpData:(NSString *)jumpData type:(NSInteger)type {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ UIViewController *topVC = topViewController();
|
|
|
|
+ /// 跳转类型 0:url 1:商品列表 2:订单列表 3:商品详情 4:购物车 5:消息列表
|
|
|
|
+ /// 2024-02-27新增: 6.explore首页 7.explore详情 8.我的积分 9.koc 10.vip Center 11.我的优惠券 12. 登录注册, 13.签到 14.首页
|
|
|
|
+ switch (type) {
|
|
|
|
+ case 0:
|
|
|
|
+ [Fuction_Tool push_BaseWebUrl:jumpData webTitle:title];
|
|
|
|
+ break;
|
|
|
|
+ case 1:
|
|
|
|
+ [self pushToProductList:title typeid:jumpData];
|
|
|
|
+ break;
|
|
|
|
+ case 2:
|
|
|
|
+ {
|
|
|
|
+ if (!ASUserInfoManager.shared.isLogin) {
|
|
|
|
+ [Fuction_Tool pop_toLoginVC];
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (![topVC isKindOfClass:[ASOrderListViewController class]]) {
|
|
|
|
+ ASOrderListViewController *orderC = [[ASOrderListViewController alloc] init];
|
|
|
|
+ [topVC.navigationController pushViewController:orderC animated:true];
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case 3:
|
|
|
|
+ [self goto_WKM_GoodsDetailsC:jumpData];
|
|
|
|
+ break;
|
|
|
|
+ case 4:
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ if (![topVC isKindOfClass:[Cart_MyCartC class]]) {
|
|
|
|
+ Cart_MyCartC *cartC = [[Cart_MyCartC alloc]init];
|
|
|
|
+ [topVC.navigationController pushViewController:cartC animated:true];
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case 5: {
|
|
|
|
+ if (!ASUserInfoManager.shared.isLogin) {
|
|
|
|
+ [Fuction_Tool pop_toLoginVC];
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (![topVC isKindOfClass:[ASMessageListViewController class]]) {
|
|
|
|
+ ASMessageListViewController *mesVC = [[ASMessageListViewController alloc]init];
|
|
|
|
+ [topVC.navigationController pushViewController:mesVC animated:true];
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case 6:// explore列表
|
|
|
|
+ {
|
|
|
|
+// [Fuction_Tool navPopRootToExpolerVC];
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case 7:// explore详情
|
|
|
|
+ {
|
|
|
|
+// [self goto_exploreDetailsC:push_para];
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case 8:// 积分
|
|
|
|
+ {
|
|
|
|
+ if (!ASUserInfoManager.shared.isLogin) {
|
|
|
|
+ [Fuction_Tool pop_toLoginVC];
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ [self to_pointsVc];
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case 9:// koc
|
|
|
|
+ {
|
|
|
|
+ if (!ASUserInfoManager.shared.isLogin) {
|
|
|
|
+ [Fuction_Tool pop_toLoginVC];
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ [self to_KocVc];
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case 10:// vip center
|
|
|
|
+ {
|
|
|
|
+ if (!ASUserInfoManager.shared.isLogin) {
|
|
|
|
+ [Fuction_Tool pop_toLoginVC];
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ [self to_vipCenter];
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case 11:// 我的优惠券
|
|
|
|
+ {
|
|
|
|
+ if (!ASUserInfoManager.shared.isLogin) {
|
|
|
|
+ [Fuction_Tool pop_toLoginVC];
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ NSInteger index = jumpData.integerValue;
|
|
|
|
+ [self to_couponsVc:index];
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case 12://登录注册
|
|
|
|
+ {
|
|
|
|
+ [Fuction_Tool pop_toLoginVC];
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case 13://签到
|
|
|
|
+ {
|
|
|
|
+ if (!ASUserInfoManager.shared.isLogin) {
|
|
|
|
+ [Fuction_Tool pop_toLoginVC];
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ [self to_checkInVc];
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case 14:// 首页
|
|
|
|
+ [Fuction_Tool popToHomeVc];
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ if (jumpData.isValidUrl) {
|
|
|
|
+ [Fuction_Tool push_BaseWebUrl:jumpData webTitle:title];
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+-(void)pushToProductList:(NSString *)name typeid:(NSString *)typeId {
|
|
|
|
+ if (typeId == nil || [typeId isEqualToString:@""]) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (name == nil || [name isEqualToString:@""]) {
|
|
|
|
+ name = @"Products";
|
|
|
|
+ }
|
|
|
|
+ ASProductListViewController *vc = [[ASProductListViewController alloc] init];
|
|
|
|
+ vc.titleName = name;
|
|
|
|
+ vc.type = typeId;
|
|
|
|
+ [[Current_normalTool topViewController].navigationController pushViewController:vc animated:YES];
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+-(void)goto_WKM_GoodsDetailsC:(NSString *)entity_id {
|
|
|
|
+ ASGoodsDetailsViewController *vc = [[ASGoodsDetailsViewController alloc]init];
|
|
|
|
+ vc.entity_id = entity_id;
|
|
|
|
+ [[Current_normalTool topViewController].navigationController pushViewController:vc animated:YES];
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//// 跳explore详情
|
|
|
|
+//-(void)goto_exploreDetailsC:(NSString *)entity_id {
|
|
|
|
+// UIViewController *topC = [Current_normalTool topViewController];
|
|
|
|
+// if ([topC isKindOfClass:AP_ExploreDetailsC.class]) {
|
|
|
|
+// return;
|
|
|
|
+// }
|
|
|
|
+// AP_ExploreDetailsC *vc = [[AP_ExploreDetailsC alloc]init];
|
|
|
|
+// ExploreListM *m = [[ExploreListM alloc] init];
|
|
|
|
+// m.listId = entity_id;
|
|
|
|
+// vc.listModel = m;
|
|
|
|
+// [[Current_normalTool topViewController].navigationController pushViewController:vc animated:YES];
|
|
|
|
+//
|
|
|
|
+//}
|
|
|
|
+
|
|
|
|
+- (void)to_pointsVc {
|
|
|
|
+ UIViewController *topC = [Current_normalTool topViewController];
|
|
|
|
+ if ([topC isKindOfClass:ASPointsHomeViewController.class]) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ ASPointsHomeViewController *vc = [[ASPointsHomeViewController alloc] init];
|
|
|
|
+ [topC.navigationController pushViewController:vc animated:true];
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+- (void)to_KocVc {
|
|
|
|
+// UIViewController *vc = [Current_normalTool topViewController];
|
|
|
|
+// if ([vc isKindOfClass:KWBrandAMBViewController.class] || [vc isKindOfClass:[APKocTotalViewController class]]) {
|
|
|
|
+// return;
|
|
|
|
+// }
|
|
|
|
+// UIWindow *w = UIApplication.sharedApplication.windows.firstObject;
|
|
|
|
+// [MBProgressHUD showHUDAddedTo:w animated:true];
|
|
|
|
+// __block BOOL hadPush = false;
|
|
|
|
+// [[KWBalanceInfoManager shareInstance] updateApplyStatus:^(BOOL flag) {
|
|
|
|
+// [MBProgressHUD hideHUDForView:w animated:true];
|
|
|
|
+// if (hadPush) {
|
|
|
|
+// return;
|
|
|
|
+// }
|
|
|
|
+// hadPush = true;
|
|
|
|
+// if (![KWBalanceInfoManager shareInstance].isApply) {
|
|
|
|
+// KWBrandAMBViewController *vc = [KWBrandAMBViewController new];
|
|
|
|
+// [[Current_normalTool topViewController].navigationController pushViewController:vc animated:true];
|
|
|
|
+// } else {
|
|
|
|
+// APKocTotalViewController *vc = [[APKocTotalViewController alloc] init];
|
|
|
|
+// [[Current_normalTool topViewController].navigationController pushViewController:vc animated:true];
|
|
|
|
+// }
|
|
|
|
+// }];
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+- (void)to_vipCenter {
|
|
|
|
+ UIViewController *vc = [Current_normalTool topViewController];
|
|
|
|
+// [MBProgressHUD showHUDAddedTo:vc.view animated:true];
|
|
|
|
+// __block BOOL hadPush = false;
|
|
|
|
+//
|
|
|
|
+// [KWLoginedManager.shareInstance getAllLevelInfo:^(bool flag) {
|
|
|
|
+// if (hadPush) {
|
|
|
|
+// return;
|
|
|
|
+// }
|
|
|
|
+// hadPush = true;
|
|
|
|
+// [MBProgressHUD hideHUDForView:vc.view animated:true];
|
|
|
|
+// ASVipCenterViewController *vc = [[ASVipCenterViewController alloc] init];
|
|
|
|
+// vc.currentLeave = KWLoginedManager.shareInstance.levelInfo.level;
|
|
|
|
+// [[Current_normalTool topViewController].navigationController pushViewController:vc animated:true];
|
|
|
|
+// }];
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ ASVipCenterViewController *vipCenterVC = [[ASVipCenterViewController alloc] init];
|
|
|
|
+// vipCenterVC.currentLeave = KWLoginedManager.shareInstance.levelInfo.level;
|
|
|
|
+ [vc.navigationController pushViewController:vipCenterVC animated:true];
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+- (void)to_couponsVc:(NSInteger)index {
|
|
|
|
+ ASCouponsListViewController *vc = [[ASCouponsListViewController alloc] init];
|
|
|
|
+ [[Current_normalTool topViewController].navigationController pushViewController:vc animated:true];
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+- (void)to_checkInVc {
|
|
|
|
+// WK_CheckPointsC *vc = [[WK_CheckPointsC alloc] init];
|
|
|
|
+// KWLoginedUserModel *m = [KWLoginedManager.shareInstance getCurrentLoginedUser];
|
|
|
|
+// vc.points = m.points;
|
|
|
|
+// [[Current_normalTool topViewController].navigationController pushViewController:vc animated:true];
|
|
|
|
+}
|
|
|
|
|
|
@end
|
|
@end
|