最近看到好多人都在发支付宝的红包码

早在几年前那时候邀请给的红包还是很大的 测试最近的红包只给邀请人1块钱左右 不知道是不是之前弄的多了

之前搞过微信QQ打开直接跳转支付宝达到自动领取的代码 现在看好多人都还在发二维码 这样很慢 索性直接发出来 大家自行部署吧 HTML+CSS+JS 很简单 (目前看IOS微信可以直接跳 没有安卓设备就不测了 大家可以自行测试 我只能说IOS微信可以使用)

1
2
3
4
5
var CONFIG = {
shareId: "账号ID",
token: "红包码",
code: "复制的码"
};

注意代码中的这一段 需要配置一下才能使用
1.shareId 需要使用支付宝扫码来获取

alt text

这就是一个获取id的demo 不是我做的 我只不过一直在用 (叠甲
2.token 是需要微信识别你自己的红包码 会返回一段字符 如果是有XXXX196XXXX开头的
从196往后都要 前面的几位字符不需要
3.code就是 原本支付宝分享的口令 大概是这样的

alt text

把emojo去掉再填入

貌似之前是一串数字 如果是数字的口令直接用数字就好了

配置完毕就可以上传你的服务器了

原理就是 利用本身支付宝在微信中的跳转白名单替换参数 进行跳转
核心就是:这一串

1
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%253D

完整版代码(记得修改配置)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<title>支付宝每日拼手气红包!</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
* {
margin: 0;
padding: 0;
}
.container {
width: 100%;
height: 100%;
position: fixed;
top: 0;
}
.container img {
width: 100%;
height: 100%;
}
.tip-box {
width: 77%;
margin: 30px auto 0;
padding: 15px;
background: #eee;
font-size: 17px;
line-height: 23px;
text-align: justify;
border-radius: 10px;
color: #666;
}
.code-display {
text-align: center;
margin: 20px auto 0;
color: #f00;
}
.copy-btn {
margin: 20px auto 0;
padding: 10px 18px;
font-size: 16px;
display: block;
outline: none;
border: none;
border-radius: 100px;
background: #006eff;
color: #fff;
cursor: pointer;
}
.guide-image {
width: calc(77% + 30px);
margin: 30px auto 0;
border: 1px solid #ccc;
border-radius: 20px;
overflow: hidden;
}
.guide-image img {
display: block;
border-radius: 20px;
}
</style>
</head>
<body>
<div id="container" class="container">
<a id="main-link" href="#"><img src="https://img.alicdn.com/imgextra/i1/2213614846611/O1CN01ujaMfD1yhtDuS7x9s_!!2213614846611.gif" alt="红包"></a>
</div>

<script>
// ============ 配置参数 ============
var CONFIG = {
shareId: "账号ID",
token: "红包码",
code: "复制的码"
};

// ============ 工具函数 ============
function buildAlipayUrl(shareId, token) {
return '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%253D' + shareId + '%2526token%253D' + token + '%2526campStr%253DkPPFvOxaCL3f85TiKss2wsBZgIjulHjG%2526sign%253DqsiVOoa7TuphryWxyBdONXsMTnE3jiIBvWeUs3yV1sw%253D%2526chInfo%253DDingtalk%2526c_stype%253Dsearch_pwd';
}

function detectPlatform() {
var ua = navigator.userAgent;
var uaLower = ua.toLowerCase();
return {
isAndroid: ua.indexOf('Android') > -1 || ua.indexOf('Linux') > -1,
isIOS: !!ua.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
isQQ: uaLower.indexOf('qq') > -1,
isWeChat: uaLower.indexOf('micromessenger') > -1
};
}

function copyToClipboard(text) {
var textArea = document.createElement('textarea');
textArea.value = text;
textArea.style.position = 'fixed';
textArea.style.opacity = '0';
document.body.appendChild(textArea);
textArea.select();
document.execCommand('copy');
document.body.removeChild(textArea);
alert('已复制红包码,请打开支付宝App粘贴搜索!');
}

function showManualCopyPage() {
var container = document.getElementById('container');
container.innerHTML =
'<p class="tip-box">点击下方按钮,复制红包码,再打开支付宝App,粘贴至搜索框,再进行领取红包!</p>' +
'<h2 id="red-packet-code" class="code-display">' + CONFIG.code + '</h2>' +
'<button id="copy-btn" class="copy-btn">一键复制</button>' +
'<div class="guide-image"><img src="https://g.gtimg.cn/music/photo_new/T053XD001004VWLtU2IQg4e.jpg" width="100%"></div>';

document.getElementById('copy-btn').addEventListener('click', function() {
copyToClipboard(CONFIG.code);
});
}

// ============ 主逻辑 ============
window.onload = function() {
var alipayUrl = buildAlipayUrl(CONFIG.shareId, CONFIG.token);
var platform = detectPlatform();

// 设置默认链接
document.getElementById('main-link').href = alipayUrl;

// 在 QQ/微信 内置浏览器中显示手动复制页面
var needManualCopy = (platform.isAndroid && platform.isQQ) ||
(platform.isAndroid && platform.isWeChat) ||
(platform.isIOS && platform.isQQ);

if (needManualCopy) {
showManualCopyPage();
} else {
window.location = alipayUrl;
}
};
</script>
</body>
</html>