经验分享

支付宝 淘宝超链接跳转示例代码

精准像素 2021-12-07 人阅读

以下操作仅限iOS系统,其他系统请自行测试,2021年12月7日测试可以,如果不行可能就是失效了。

跳转到支付宝并自动聚焦到搜索框

<a href="https://ulink.alipay.com/?scheme=alipayqr://platformapi/startapp?saId=20001003&keyword=730839274">跳转到支付宝app搜索框</a>

跳转到支付宝并自动领取红包

<a href="https://ulink.alipay.com/?scheme=alipays%3A%2F%2Fplatformapi%2Fstartapp%3FsaId%3D10000007%26clientVersion%3D3.7.0.0718%26qrcode%3Dhttps%253A%252F%252Frender.alipay.com%252Fp%252Fc%252Falipay-red-qrcode%252Fshared.html%253Fchannel%253Dsearch_pwd%2526shareId%253D2088032456623223%2526token%253D19618032mpaq72dzh7kix02okl%2526campStr%253DkPPFvOxaCL3f85TiKss2wsBZgIjulHjG%2526sign%253DqsiVOoa7TuphryWxyBdONXsMTnE3jiIBvWeUs3yV1sw%253D%2526chInfo%253DDingtalk%2526c_stype%253Dsearch_pwd">跳转到支付宝并自动领取红包</a>

跳转到支付宝并打开扫码

<a href="https://ulink.alipay.com/?scheme=alipays://platformapi/startapp?saId=10000007&qrcode=">跳转到支付宝app扫码</a>

完整demo页面代码

<!DOCTYPE html>
<html>
<head>
<title>微信跳转支付宝领红包</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
/*里客云科技开发*/
*{
margin:0;
padding:0;
}
#copy1{
background: #1476FE;
font-size: 16px;
border-radius: 5px;
text-decoration: none;
color: #fff;
display: block;
margin:50px auto 0;
width: 230px;
height: 55px;
line-height: 55px;
text-align: center;
font-weight: bold;
}
#copy2{
background: #1476FE;
font-size: 16px;
border-radius: 5px;
text-decoration: none;
color: #fff;
display: block;
margin:30px auto 0;
width: 250px;
height: 55px;
line-height: 55px;
text-align: center;
font-weight: bold;
}
</style>
</head>
<body>
<!-- 开发者交流群:[url=http://www.liketube.cn/ma/common/qun/redirect/?hmid=19122]http://www.liketube.cn/ma/common/qun/redirect/?hmid=19122[/url] -->
<!-- 作者博客:[url=https://segmentfault.com/u/tanking]https://segmentfault.com/u/tanking[/url] -->
<p id="hbm" style="opacity: 0;">730839274</p>
<a href="https://ulink.alipay.com/?scheme=alipayqr://platformapi/startapp?saId=20001003&keyword=730839274" id="copy1">跳转到支付宝app搜索框</a>
<a href="https://ulink.alipay.com/?scheme=alipays%3A%2F%2Fplatformapi%2Fstartapp%3FsaId%3D10000007%26clientVersion%3D3.7.0.0718%26qrcode%3Dhttps%253A%252F%252Frender.alipay.com%252Fp%252Fc%252Falipay-red-qrcode%252Fshared.html%253Fchannel%253Dsearch_pwd%2526shareId%253D2088032456623223%2526token%253D19618032mpaq72dzh7kix02okl%2526campStr%253DkPPFvOxaCL3f85TiKss2wsBZgIjulHjG%2526sign%253DqsiVOoa7TuphryWxyBdONXsMTnE3jiIBvWeUs3yV1sw%253D%2526chInfo%253DDingtalk%2526c_stype%253Dsearch_pwd" id="copy2">跳转到支付宝app并自动领取</a>
<a href="https://ulink.alipay.com/?scheme=alipays://platformapi/startapp?saId=10000007&qrcode=" id="copy2">跳转到支付宝app扫码</a>
</body>
<script type="text/javascript">
function copyArticle(event){
const range = document.createRange();
range.selectNode(document.getElementById('hbm'));
const selection = window.getSelection();
if(selection.rangeCount > 0) selection.removeAllRanges();
selection.addRange(range);
document.execCommand('copy');
}
window.onload = function () {
var obt = document.getElementById("copy1");
obt.addEventListener('click', copyArticle, false);
}
</script>
</html>

微信跳转淘宝App

这里就以微信跳转淘宝app领取优惠券为例,这有助于我们更好地做淘客。

<a href="https://s.tb.cn/h.fiXef2Q" style="text-decoration: none;width: 200px;height: 50px;background: #ff283b;border-radius: 100px;margin:80px auto 20px;color: #fff;display: block;line-height: 50px;text-align: center;font-weight: bold;font-size: 16px;">打开淘宝app领券</a>

根据以上代码可知,其实就是一个超链接,链接是https://s.tb.cn/h.fiXef2Q其实简单来说,只需要替换后面的参数h.fiXef2Q就可以了,那么这个参数在哪可以得到呢?

1、打开淘宝联盟app

2、找到你要推广的商品

3、复制文案,发送到微信,点击文案的链接

4、右上角【···】复制链接

5、获得长链接后,找到short_name=后面就是参数了

就这么简单,就实现了微信跳转到淘宝app领券页面了。更多探索,敬请期待,欢迎关注我!