| | |
| | | import android.net.Uri; |
| | | import android.util.Log; |
| | | import android.view.View; |
| | | import android.webkit.WebChromeClient; |
| | | import android.webkit.WebViewClient; |
| | | |
| | | import com.alibaba.baichuan.android.trade.AlibcTradeSDK; |
| | | import com.alibaba.baichuan.android.trade.model.AlibcShowParams; |
| | | import com.alibaba.baichuan.android.trade.model.OpenType; |
| | | import com.alibaba.baichuan.trade.biz.AlibcConstants; |
| | | import com.alibaba.baichuan.trade.biz.applink.adapter.AlibcFailModeType; |
| | | import com.alibaba.baichuan.trade.biz.core.taoke.AlibcTaokeParams; |
| | | import com.kepler.jd.Listener.OpenAppAction; |
| | | import com.kepler.jd.login.KeplerApiManager; |
| | | import com.kepler.jd.sdk.bean.KeplerAttachParameter; |
| | | import com.tejia.lijin.app.entity.TbPidInfo; |
| | | import com.tejia.lijin.app.entity.common.GoodsConvertLinkJumpLink; |
| | | import com.tejia.lijin.app.ui.invite.ShareBrowserActivity; |
| | | import com.tejia.lijin.app.util.baichuan.AlibcTradeUtil; |
| | | import com.tejia.lijin.app.util.downutil.StringUtils; |
| | | import com.tejia.lijin.app.util.goods.GoodsBuyUtil; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 去购买的跳转链接 |
| | | */ |
| | | public class GoodsBuyJumpUtil { |
| | | |
| | | |
| | | public static void jumpTB(Activity activity, TbPidInfo tInfo, String clickUrl, String couponUrl, final GoodsBuyUtil.IBuyGoodsResultListener buyGoodsResultListener) { |
| | | AlibcShowParams alibcShowParams = new AlibcShowParams(); |
| | | alibcShowParams.setOpenType(OpenType.Auto); |
| | | alibcShowParams.setBackUrl("alisdk://"); |
| | | alibcShowParams.setNativeOpenFailedMode(AlibcFailModeType.AlibcNativeFailModeJumpBROWER); |
| | | AlibcTaokeParams alibcTaokeParams = new AlibcTaokeParams("", "", ""); |
| | | if (tInfo != null) { |
| | | alibcTaokeParams = new AlibcTaokeParams("", "", ""); |
| | | alibcTaokeParams.setPid(tInfo.getPid()); |
| | | alibcTaokeParams.setAdzoneid(tInfo.getAdZoneId()); |
| | | alibcTaokeParams.pid = tInfo.getPid(); |
| | | alibcTaokeParams.adzoneid = tInfo.getAdZoneId(); |
| | | alibcTaokeParams.extraParams = new HashMap<>(); |
| | | alibcTaokeParams.extraParams.put("taokeAppkey", tInfo.getAppKey()); |
| | | } |
| | | Map<String, String> exParams = new HashMap<>(); |
| | | exParams.put(AlibcConstants.ISV_CODE, "appisvcode"); |
| | | exParams.put("alibaba", "阿里巴巴");//自定义参数部分,可任意增删改 |
| | | if (!com.wpc.library.util.common.StringUtils.isEmpty(clickUrl) || !com.wpc.library.util.common.StringUtils.isEmpty(couponUrl)) { |
| | | String url = (!com.wpc.library.util.common.StringUtils.isEmpty(couponUrl)) ? couponUrl : clickUrl; |
| | | AlibcTradeSDK.setTaokeParams(alibcTaokeParams); |
| | | buyGoodsResultListener.onJumpThirdAppStart(); |
| | | AlibcTradeUtil.openByUrl(activity, |
| | | url, null, new WebViewClient(), new WebChromeClient(), |
| | | alibcShowParams, alibcTaokeParams, null); |
| | | } |
| | | } |
| | | |
| | | |
| | | public static void jumpPDD(Context context, GoodsConvertLinkJumpLink link) { |
| | | if (context == null) |
| | | return; |