最近2個月各種瑣事很忙,沒有時間寫文章,沒有時間研究各種東西,近期開始閒下來了。微信團隊釋出了新通知,關於《微信外部連結內容管理規範》的更新說明,正式開放電商類的外部連結,在聊天場景中可直接訪問電商連結,包括淘寶、京東等。
既然開放了,那麼相應的URL scheme應該就可以跳轉了,所以本人也嘗試去研究了微信跳轉支付寶、微信跳轉淘寶的相關操作。
微信跳轉支付寶App
近期朋友圈又冒出一堆支付寶賺賞金的紅包碼,確實不錯,額度大了就多人玩,本人因為工作性質也積累了不少的學生資源,微信好友資源,也在朋友圈發了2天,累積賺了2000多塊。
所以我猜想,這個能不能通過一個url點選進去跳轉到支付寶app並且自動領取。
方案1:跳轉到支付寶並自動聚焦到搜尋框
<a href="https://ulink.alipay.com/?scheme=alipayqr://platformapi/startapp?saId=20001003&keyword=730839274">跳轉到支付寶app搜尋框</a>
方案2:跳轉到支付寶並自動領取紅包
<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>
方案3:跳轉到支付寶並開啟掃碼
<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>
<!-- 開發者交流群:http://www.liketube.cn/ma/common/qun/redirect/?hmid=19122 -->
<!-- 作者部落格:https://segmentfault.com/u/tanking -->
<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>
demo:(請在微信內訪問體驗)http://www.likeyunba.com/demo...
微信跳轉淘寶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領券頁面了。
更多探索,敬請期待,歡迎關注我!
AuThor:TANKING
WeChat:sansure2016
加技術交流群:sansure2016(微信)