| | |
| | | |
| | | import com.alibaba.baichuan.android.trade.AlibcTrade; |
| | | import com.alibaba.baichuan.android.trade.AlibcTradeSDK; |
| | | import com.alibaba.baichuan.android.trade.callback.AlibcTradeCallback; |
| | | import com.alibaba.baichuan.android.trade.model.AlibcShowParams; |
| | | import com.alibaba.baichuan.android.trade.model.OpenType; |
| | | import com.alibaba.baichuan.android.trade.page.AlibcDetailPage; |
| | | import com.alibaba.baichuan.trade.biz.AlibcConstants; |
| | | import com.alibaba.baichuan.trade.biz.AlibcTradeCallback; |
| | | import com.alibaba.baichuan.trade.biz.applink.adapter.AlibcFailModeType; |
| | | import com.alibaba.baichuan.trade.biz.context.AlibcTradeResult; |
| | | import com.alibaba.baichuan.trade.biz.core.taoke.AlibcTaokeParams; |
| | |
| | | import com.tencent.mm.opensdk.modelbiz.WXLaunchMiniProgram; |
| | | import com.tencent.mm.opensdk.openapi.IWXAPI; |
| | | import com.tencent.mm.opensdk.openapi.WXAPIFactory; |
| | | import com.weikou.beibeivideo.BeibeiVideoApplication; |
| | | import com.weikou.beibeivideo.entity.JumpDetail; |
| | | import com.weikou.beibeivideo.entity.VideoType; |
| | | import com.weikou.beibeivideo.entity.ad.RewardVideoAdContainer; |
| | | import com.weikou.beibeivideo.ui.category.MVideosActivity; |
| | | import com.weikou.beibeivideo.ui.dialog.LoadingDialogUtil; |
| | | import com.weikou.beibeivideo.ui.login.LoginActivity; |
| | | import com.weikou.beibeivideo.ui.mine.BrowserActivity; |
| | | import com.weikou.beibeivideo.util.ad.AdUtil; |
| | | import com.weikou.beibeivideo.util.ad.RewardVideoAdManager; |
| | | import com.weikou.beibeivideo.util.ad.RewardVideoAdUtil; |
| | | import com.weikou.beibeivideo.util.goldcorn.GoldCornUtil; |
| | | |
| | | import org.json.JSONException; |
| | | |
| | |
| | | |
| | | break; |
| | | |
| | | case "web": |
| | | if (params == null) |
| | | return; |
| | | { |
| | | String webUrl = params.getString("url").toString(); |
| | | String title = params.getString("title"); |
| | | String close = params.getString("close"); |
| | | context.startActivity(new Intent(context, BrowserActivity.class).putExtra("url", webUrl).putExtra("title", title).putExtra("close", close)); |
| | | } |
| | | |
| | | |
| | | break; |
| | | |
| | | case "rewardVideo": { |
| | | LoadingDialogUtil.show(context); |
| | | AdUtil.AD_TYPE adType = AdUtil.AD_TYPE.valueOf(params.getString("adType")); |
| | | String pid = params.getString("pid"); |
| | | |
| | | RewardVideoAdManager.IAdShowListener showListener = new RewardVideoAdManager.IAdShowListener() { |
| | | |
| | | @Override |
| | | public void onShow() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onReward() { |
| | | String code = params.getString("goldcorn"); |
| | | if (!StringUtils.isEmpty(code)) { |
| | | GoldCornUtil.makeGoldCorn(code, null, null, null); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onError(String msg) { |
| | | LoadingDialogUtil.dismiss(); |
| | | } |
| | | |
| | | @Override |
| | | public void onClose() { |
| | | LoadingDialogUtil.dismiss(); |
| | | } |
| | | }; |
| | | |
| | | RewardVideoAdUtil.showAd(context, adType, pid, new RewardVideoAdManager.IAdLoadListener() { |
| | | |
| | | @Override |
| | | public void onSuccess(RewardVideoAdContainer ad) { |
| | | LoadingDialogUtil.dismiss(); |
| | | if (context != null) |
| | | context.runOnUiThread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | LoadingDialogUtil.dismiss(); |
| | | RewardVideoAdManager.showAd(context, ad, showListener); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | | public void onError(String msg) { |
| | | LoadingDialogUtil.dismiss(); |
| | | } |
| | | }, showListener); |
| | | } |
| | | break; |
| | | |
| | | default: { |
| | | try { |
| | | Intent intent = new Intent(context, Class.forName(JumpActivityUtil.filterActivityName(detail.getActivity()))); |
| | | if (params != null) |
| | | for (Iterator<String> keys = params.keySet().iterator(); keys.hasNext(); ) { |
| | | String key = keys.next(); |
| | | intent.putExtra(key, params.getString(key)); |
| | | if (params != null) { |
| | | //特殊处理 |
| | | if (MVideosActivity.class.getName().equalsIgnoreCase(JumpActivityUtil.filterActivityName(detail.getActivity())) && !StringUtils.isEmpty(params.getString("Id"))) { |
| | | VideoType videoType = new VideoType(); |
| | | videoType.setId(params.getString("Id")); |
| | | videoType.setName(params.getString("Name")); |
| | | intent.putExtra("video_type", videoType); |
| | | } else { |
| | | for (Iterator<String> keys = params.keySet().iterator(); keys.hasNext(); ) { |
| | | String key = keys.next(); |
| | | intent.putExtra(key, params.getString(key)); |
| | | } |
| | | } |
| | | } |
| | | context.startActivity(intent); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | return activity; |
| | | } |
| | | |
| | | public static JSONObject getParamsJSON(String params) { |
| | | if (params == null || StringUtils.isEmpty(params)) |
| | | return null; |
| | | String fparams = params.replace( |
| | | "\\" + "\"", "\""); |
| | | try { |
| | | return JSONObject.parseObject(fparams); |
| | | } catch (Exception e) { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | } |