《如何在手机浏览器中打开微信APP、淘宝APP、京东APP并跳转到指定详情页》要点:
本文介绍了如何在手机浏览器中打开微信APP、淘宝APP、京东APP并跳转到指定详情页,希望对您有用。如果有疑问,可以联系我们。
相关主题:html5和webapp
在手机浏览器上打开京东APP很麻烦,不像微信和淘宝那么简单,
先看看调用淘宝和微信的APP代码:
<a href="weixin://">打开微信 weixin://</a>
<a href="weixin://dl/businessWebview/link/?appid=wx707c5fa91ef0a58c&url=http://baidu.com">在微信中跳转到URL</a>
打开淘宝也很简单:
<a href="taobao://item.taobao.com/item.htm?id=534300346025">淘宝</a>
而打开京东,我们找了一个京东的网址测试:本实例IOS和安卓测试成功,但是要是没安装京东APP,就没反应。
<a href='openApp.jdMobile://virtual?params={"category":"jump","des":"jshopMain","shopId":"51916","sourceType":"M_sourceFrom","sourceValue":"dp"}'>京东-店铺51916</a>
<a href='openApp.jdMobile://virtual?params={"category":"jump","des":"productDetail","skuId":"14113990053","sourceType":"JSHOP_SOURCE_TYPE","sourceValue":"JSHOP_SOURCE_VALUE"}'>>京东-详情页</a>
这上面是不带参数的,比如你是做京东推广,需要带一些URL参数,请参考下面试试。小编没试过带参数的。
参考这个网址:
其中的代码很复杂,复制如下:
openApp.jdMobile://virtual?params={"sourceType":"sale-act","sourceValue":"Sale","category":"jump","des":"DM","dmurl":"https://sale.jd.com/app/act/zQ1hbkYdU4i.html","M_sourceFrom":"jshopauto","msf_type":"auto","m_param":{"m_source":"0","event_series":{},"jda":"122270672.1510218691064839909993.NaN.1523957039.1524099136.33","usc":"kong","ucp":"t_2011156376_","umd":"tuiguang","utr":"ac9ffcdcb24d4b338f76fa559b8bb171","jdv":"122270672%7Ckong%7Ct_2011156376_%7Ctuiguang%7Cac9ffcdcb24d4b338f76fa559b8bb171%7C1524099136786","ref":"https%3A%2F%2Fsale.jd.com%2Fm%2Fact%2FzQ1hbkYdU4i.html%3Fcu%3Dtrue%26utm_source%3Dkong%26utm_medium%3Dtuiguang%26utm_campaign%3Dt_2011156376_%26utm_term%3Dac9ffcdcb24d4b338f76fa559b8bb171%26abt%3D3","psn":"1510218691064839909993|33","psq":1,"unpl":"V2_bzNtbUFWQUd3X08GKEwIB2ICFQkSVhNGIgATXSgZCA1hVBZYclRCFXwUR1FnGVoUZwUZXkVcQRZFCEdkeylUA2MKG1xyVkJnKF1PACkdVFEzVBVZEFZLFSU4RVRLEWwFYwMTXkJeRB11CUFRchtUDWYLGlVAZ3MSRTiT3%252fXA2IOzvbJtRVJEEHAJR1dLGGwEV0h8XA9XRxV0C0ZdfBFcBGAGG19KX0IdfQBEZHopXw%253d%253d","pc_source":"","mba_muid":"1510218691064839909993","mba_sid":"15240991367899249895400127850","mt_xid":"V2_52007VwMWUlxbUlMYQRldAmIKEFpVWVpSF0spXgNjBUZXDQ9ODhsdHEAAYVFGTlQNBloDHR1dAjVWGlUKCgUPL0oYXAx7AhdOXV1DWR9CGVsOZAAiUm1YYloXQBhdBWYLF2JeW1tc","mt_subsite":""},"SE":{"mt_subsite":"","__jdv":"122270672%7Ckong%7Ct_2011156376_%7Ctuiguang%7Cac9ffcdcb24d4b338f76fa559b8bb171%7C1524099136786","unpl":"V2_bzNtbUFWQUd3X08GKEwIB2ICFQkSVhNGIgATXSgZCA1hVBZYclRCFXwUR1FnGVoUZwUZXkVcQRZFCEdkeylUA2MKG1xyVkJnKF1PACkdVFEzVBVZEFZLFSU4RVRLEWwFYwMTXkJeRB11CUFRchtUDWYLGlVAZ3MSRTiT3%252fXA2IOzvbJtRVJEEHAJR1dLGGwEV0h8XA9XRxV0C0ZdfBFcBGAGG19KX0IdfQBEZHopXw%253d%253d","__jda":"122270672.1510218691064839909993.NaN.1523957039.1524099136.33"}}
解码后
openApp.jdMobile://virtual?params={"sourceType":"sale-act","sourceValue":"Sale","category":"jump","des":"DM","dmurl":"https://sale.jd.com/app/act/zQ1hbkYdU4i.html","M_sourceFrom":"jshopauto","msf_type":"auto","m_param":{"m_source":"0","event_series":{},"jda":"122270672.1510218691064839909993.NaN.1523957039.1524099136.33","usc":"kong","ucp":"t_2011156376_","umd":"tuiguang","utr":"ac9ffcdcb24d4b338f76fa559b8bb171","jdv":"122270672%7Ckong%7Ct_2011156376_%7Ctuiguang%7Cac9ffcdcb24d4b338f76fa559b8bb171%7C1524099136786","ref":"https%3A%2F%2Fsale.jd.com%2Fm%2Fact%2FzQ1hbkYdU4i.html%3Fcu%3Dtrue%26utm_source%3Dkong%26utm_medium%3Dtuiguang%26utm_campaign%3Dt_2011156376_%26utm_term%3Dac9ffcdcb24d4b338f76fa559b8bb171%26abt%3D3","psn":"1510218691064839909993|33","psq":1,"unpl":"V2_bzNtbUFWQUd3X08GKEwIB2ICFQkSVhNGIgATXSgZCA1hVBZYclRCFXwUR1FnGVoUZwUZXkVcQRZFCEdkeylUA2MKG1xyVkJnKF1PACkdVFEzVBVZEFZLFSU4RVRLEWwFYwMTXkJeRB11CUFRchtUDWYLGlVAZ3MSRTiT3%252fXA2IOzvbJtRVJEEHAJR1dLGGwEV0h8XA9XRxV0C0ZdfBFcBGAGG19KX0IdfQBEZHopXw%253d%253d","pc_source":"","mba_muid":"1510218691064839909993","mba_sid":"15240991367899249895400127850","mt_xid":"V2_52007VwMWUlxbUlMYQRldAmIKEFpVWVpSF0spXgNjBUZXDQ9ODhsdHEAAYVFGTlQNBloDHR1dAjVWGlUKCgUPL0oYXAx7AhdOXV1DWR9CGVsOZAAiUm1YYloXQBhdBWYLF2JeW1tc","mt_subsite":""},"SE":{"mt_subsite":"","__jdv":"122270672%7Ckong%7Ct_2011156376_%7Ctuiguang%7Cac9ffcdcb24d4b338f76fa559b8bb171%7C1524099136786","unpl":"V2_bzNtbUFWQUd3X08GKEwIB2ICFQkSVhNGIgATXSgZCA1hVBZYclRCFXwUR1FnGVoUZwUZXkVcQRZFCEdkeylUA2MKG1xyVkJnKF1PACkdVFEzVBVZEFZLFSU4RVRLEWwFYwMTXkJeRB11CUFRchtUDWYLGlVAZ3MSRTiT3%252fXA2IOzvbJtRVJEEHAJR1dLGGwEV0h8XA9XRxV0C0ZdfBFcBGAGG19KX0IdfQBEZHopXw%253d%253d","__jda":"122270672.1510218691064839909993.NaN.1523957039.1524099136.33"}}
把你的参数换入,不要有换行和空格。参考:http://www.vephp.com/jiaocheng/14669.html
再把整段加入链接的href中。
<a href="openApp.jdMobile://......}}">京东</a>