1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- //
- // AdJumpManager.m
- // YouHuiProject
- //
- // Created by 小花 on 2018/5/31.
- // Copyright © 2018年 kuxuan. All rights reserved.
- //
- #import "AdJumpManager.h"
- #import "KBAdWebViewController.h"
- #import "KBGoodDetailViewController.h"
- #import "KBGoodDetailViewController.h"
- #import "KBGoodListViewController.h"
- #import "KBEventTool.h"
- #import "DetailRequestModel.h"
- #import <AlibcTradeSDK/AlibcTradeSDK.h>
- #import <AlibabaAuthSDK/ALBBSession.h>
- #import <AlibabaAuthSDK/ALBBSDK.h>
- @implementation AdJumpManager
- + (void)jumpToPageWithModel:(AdPopModel *)model ParentViewControll:(UIViewController *)parentVc {
- switch ([model.click_type integerValue]) {
- case 1:
- {
- KBAdWebViewController *web = [[KBAdWebViewController alloc] init];
- web.url = model.click_param;
- [parentVc.navigationController pushViewController:web animated:YES];
- }
-
- break;
- case 2:
- {
- KBGoodDetailViewController *detail = [[KBGoodDetailViewController alloc] init];
- DetailRequestModel *requestModel = [[DetailRequestModel alloc]
- initWithId:model.click_param
- is_coupon:model.is_coupon
- coupon_price:model.coupon_price price:model.price
- discount_price:model.discount_price
- commission_rate:model.commission_rate
- coupon_start_time:model.coupon_start_time
- coupon_end_time:model.coupon_end_time];
- detail.requestModel = requestModel;
- [parentVc.navigationController pushViewController:detail animated:YES];
- [KBEventTool eventWithEventType:0 origin:@"0" category_id:@"0" goods_id:model.click_param source:AdvertisingAction];
- }
-
- break;
- case 3:
- {
- KBGoodListViewController *list = [[KBGoodListViewController alloc] init];
- list.cate_id = model.click_param;
- list.name = model.groupTitle;
- [parentVc.navigationController pushViewController:list animated:YES];
-
- }
-
- break;
- case 4:
- {
- [self jumpToTaobaoWithUrl:model.click_param parentVc:parentVc];
- }
-
- break;
- default:
- break;
- }
- }
- + (void)jumpToTaobaoWithUrl:(NSString *)url parentVc:(UIViewController *)parentVc{
-
- id<AlibcTradePage> page = [AlibcTradePageFactory page:url];
- //淘客信息
- AlibcTradeTaokeParams *taoKeParams=[[AlibcTradeTaokeParams alloc] init];
- taoKeParams.pid= ALTK_PID;
- //打开方式
- AlibcTradeShowParams* showParam = [[AlibcTradeShowParams alloc] init];
-
- showParam.openType = AlibcOpenTypeAuto;
-
-
- [[AlibcTradeSDK sharedInstance].tradeService show:parentVc page:page showParams:showParam taoKeParams:taoKeParams trackParam:nil tradeProcessSuccessCallback:^(AlibcTradeResult * _Nullable result) {
-
- } tradeProcessFailedCallback:^(NSError * _Nullable error) {
-
- }];
- }
- @end
|