-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
177 lines (163 loc) · 4.82 KB
/
index.html
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title></title>
<!-- Facebook Pixel Code -->
<script>
!function (f, b, e, v, n, t, s) {
if (f.fbq) return; n = f.fbq = function () {
n.callMethod ?
n.callMethod.apply(n, arguments) : n.queue.push(arguments)
};
if (!f._fbq) f._fbq = n; n.push = n; n.loaded = !0; n.version = '2.0';
n.queue = []; t = b.createElement(e); t.async = !0;
t.src = v; s = b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t, s)
}(window, document, 'script',
'https://connect.facebook.net/en_US/fbevents.js');
var queryObj = parseQueryString(location.href);
var fbid = queryObj.fbid;
fbq('init', fbid);
fbq('track', 'PageView');
function parseQueryString(url) {
var obj = {};
var keyvalue = [];
var key = "",
value = "";
var paraString = url
.substring(url.indexOf("?") + 1, url.length)
.split("&");
for (var i in paraString) {
keyvalue = paraString[i].split("=");
key = keyvalue[0];
value = keyvalue[1];
obj[key] = value;
}
return obj;
}
</script>
<!-- <noscript>
<img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=778794909251378&ev=PageView&noscript=1" />
</noscript> -->
<!-- End Facebook Pixel Code -->
<style>
* {
padding: 0;
margin: 0;
}
body {
text-align: center;
}
.top {
position: relative;
color: #44b549;
font-size: 20px;
padding: 12% 0;
}
.bg-tip {
position: relative;
top: 20%;
width: 80%;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
height: 24%;
background: #ffffff;
}
.btn-copy {
display: block;
width: 66%;
margin: 30px auto;
text-align: center;
border-radius: 3px;
-webkit-border-radius: 3px;
border-width: 1px;
border-style: solid;
cursor: pointer;
background-color: #44b549;
border-color: #44b549;
color: #fff;
height: 33px;
line-height: 32px;
font-size: 16px;
}
</style>
</head>
<body>
<div class="top">
<p>微信号: <span class="wx"></span> <span id="copyed-text">已复制</span></p>
<p>请打开微信搜索并添加好友</p>
</div>
<img class="bg-tip" src="./img/tip.gif" alt="tip" />
<!-- Trigger -->
<div class="alert-bg" style="position: absolute; top: 0; width: 100%; height: 100%;background: rgba(0, 0, 0, 0.6)">
<div class="alert"
style="position: absolute; box-sizing: border-box; left: 50%; margin-left: -150px; top: 30%; border-radius: 6px; padding: 60px 30px; width: 300px; height: 200px; text-align: center; background: #ffffff;">
<div>微信号: <span class="wx"></span></div>
<button class="btn-copy" data-clipboard-text="">
点击复制
</button>
</div>
</div>
<script src="./js/zepto.min.js"></script>
<script src="./js//clipboard.min.js"></script>
<script>
$(function () {
$('#copyed-text').hide();
var queryObj = parseQueryString(location.href);
var wx = queryObj.w;
$(".btn-copy").attr("data-clipboard-text", wx);
$(".wx").text(wx);
var clipboard = new ClipboardJS(".btn-copy");
clipboard.on("success", function (e) {
console.info("Action:", e.action);
console.info("Text:", e.text);
console.info("Trigger:", e.trigger);
$('#copyed-text').show();
$('.alert-bg').hide();
// location.href = "weixin://";
e.clearSelection();
});
clipboard.on("error", function (e) {
console.error("Action:", e.action);
console.error("Trigger:", e.trigger);
});
});
var domApdList = [
'<div style="display: none;">i love ins<div>',
'<div style="display: none;">nihao<div>',
'<div style="display: none;">开心的一天<div>',
'<div style="display: none;">来了老弟<div>',
'<div style="display: none;">真好<div>'
];
function addRandom() {
var random1 = parseInt(Math.random() * 5);
var random2 = parseInt(Math.random() * 5);
$("body").append(domApdList[random1]);
$(".top").before(domApdList[random2]);
}
addRandom();
function parseQueryString(url) {
var obj = {};
var keyvalue = [];
var key = "",
value = "";
var paraString = url
.substring(url.indexOf("?") + 1, url.length)
.split("&");
for (var i in paraString) {
keyvalue = paraString[i].split("=");
key = keyvalue[0];
value = keyvalue[1];
obj[key] = value;
}
return obj;
}
</script>
</body>
</html>