index.html
8.79 KB
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
<!DOCTYPE html>
<html style="">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>潮流顾问</title>
<meta name="keywords" content="潮流,时尚潮流,潮流服饰,潮流购物网,潮流网站">
<meta name="description"
content="【YOHO!BUY有货】,年轻人潮流购物中心,中国潮流商品购物网站。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和国内流行商品,★全场品牌正品保证,支持货到付款★">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, viewport-fit=cover">
<meta http-equiv="X-UA-Compatible" content="chrome=1,IE=edge">
<style type="text/css">
body {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
background: #fece00;
user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
-webkit-touch-callout: none;
-webkit-text-size-adjust: none;
-webkit-tap-highlight-color: transparent;
-webkit-user-select: none;
}
.consultant-index-page {
background: url("//img01.yohoboys.com/o_1co9slp281tjhgg7qljdbtoiq8.jpg") no-repeat;
height: 33.6rem;
width: 100%;
background-size: cover;
position: relative;
}
.consultant-index-page .consultant-add {
width: 10.6rem;
position: absolute;
top: 27.3rem;
height: 3.4rem;
left: 4rem;
z-index: 10;
}
.consultant-index-page .info p:last-child {
margin-left: -1rem;
}
.consultant-dialog.dialog-box {
background: white;
}
.dialog-wrapper {
background: rgba(0, 0, 0, 0.5);
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
display: none;
z-index: 2;
}
.dialog-wrapper .dialog-box {
width: 13.5rem;
border-radius: 0.5rem;
background: rgba(255, 255, 255, 1);
position: absolute;
left: 50%;
margin-left: -6.75rem;
font-size: 0.75rem;
text-align: center;
color: #000;
}
.dialog-wrapper .dialog-content {
padding: 1.5rem 0.75rem;
font-size: 0.7rem;
}
.dialog-wrapper .dialog-header {
padding: 1.25rem 0 1rem;
font-size: 0.85rem;
text-align: center;
font-weight: bold;
}
.dialog-wrapper .dialog-footer {
font-size: 0.9rem;
height: 2.2rem;
text-align: center;
line-height: 2.2rem;
}
.dialog-wrapper .dialog-footer > span {
display: block;
height: 100%;
box-sizing: border-box;
}
.dialog-wrapper .dialog-footer > span:nth-last-of-type(1) {
border-left: 1px solid #ccc;
color: #d0021b;
}
.dialog-wrapper .dialog-footer > span:active {
background-color: #ccc;
}
.dialog-wrapper .dialog-footer > span.dialog-center-btn {
width: 100%;
border: none;
text-align: center;
}
.dialog-wrapper .dialog-footer:before {
content: "";
position: absolute;
left: 0;
width: 200%;
height: 0;
border-top: 1px solid #ccc;
-webkit-transform-origin: left top;
transform-origin: left top;
-webkit-transform: scale3d(0.5, 0.5, 0.5);
transform: scale3d(0.5, 0.5, 0.5);
}
</style>
<script type="text/javascript">
(function (d, c) {
var e = d.documentElement, a = "orientationchange" in window ? "orientationchange" : "resize",
b = function () {
var f = e.clientWidth;
if (!f) {
return
}
if (f >= 750) {
e.style.fontSize = "40px"
} else {
e.style.fontSize = 40 * (f / 750) + "px"
}
};
if (!d.addEventListener) {
return
}
b();
c.addEventListener(a, b, false);
d.addEventListener("DOMContentLoaded", b, false)
})(document, window);
</script>
</head>
<body>
<div class="consultant-index-page">
<div class="consultant-add"></div>
</div>
<div id="dialog-wrapper" class="dialog-wrapper" style="display: none;">
<div class="dialog-box consultant-dialog" style="top: 50%; margin-top: -81.5px;">
<div class="dialog-content"></div>
<div class="dialog-footer">
<span class="dialog-left-btn tap-hightlight">我知道了</span>
</div>
</div>
</div>
<script type="text/javascript" src="./jq.js">
</script>
<script type="text/javascript" src="./clip.js">
</script>
<script type="text/javascript" src="./sdk.js">
</script>
<script type="text/javascript">
var _hmt = _hmt || [];
(function () {
var hm = document.createElement('script');
hm.src = 'https://hm.baidu.com/hm.js?d219c673993469aaaf220606d8826957';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(hm, s);
})();
function trace_baidu(eventName, eventDesc) {
var category = '潮流顾问';
_hmt.push(['_trackEvent', category, eventName, eventDesc]);
}
var Consultant = {
dialog: function ($dialogWrapper) {
$dialogWrapper.show();
},
queryString: function () {
var vars = [],
hash,
i;
var hashes = window.location.search.slice(1).split('&');
for (i = 0; i < hashes.length; i++) {
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
},
getCookie: function (name) {
var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
if (arr = document.cookie.match(reg)) {
return unescape(arr[2]);
} else {
return null;
}
}
};
var $dialogWrapper = $('.dialog-wrapper');
var text = '';
var urlParam = Consultant.queryString();
window.yo_sdk.getUid(function (uid) {
if (uid) {
$.ajax({
method: 'post',
url: 'https://action.yoho.cn/api/getWechatCs',
data: {
uid: urlParam.uid || Consultant.getCookie('app_uid'),
sessionKey: urlParam.session_key || Consultant.getCookie('app_session_key'),
appVersion: urlParam.app_version || Consultant.getCookie('app_version'),
sessionType: urlParam.client_type || Consultant.getCookie('app_client_type')
},
success: function (result) {
text = result.data && result.data.wechatCode;
console.log(result, '======');
},
error: function (err) {
console.log(err, '===-----');
}
});
}
$('.consultant-add').click(function () {
trace_baidu('click', '点击微信客服绑定');
if (uid) {
if (text) {
$('.dialog-content').html('微信号(' + text + ')已复制</br>请按步骤添加微信号:打开微信-通讯录-新的朋友-粘贴');
var clipboard = new ClipboardJS('.consultant-add', {
text: function (trigger) {
return text;
}
});
clipboard.on('success', function (e) {
e.clearSelection();
Consultant.dialog($dialogWrapper, text);
});
clipboard.on('error', function (e) {
console.error('Action:', e.action);
console.error('Trigger:', e.trigger);
});
} else {
$('.dialog-content').html('您已添加潮流顾问,可以微信直接私聊我们的小哥哥小姐姐,小哥哥小姐姐随时为您服务');
Consultant.dialog($dialogWrapper, text);
}
} else {
window.yo_sdk.goLogin();
}
});
})
$('.dialog-left-btn').click(function () {
$dialogWrapper.hide();
});
</script>
</body>
</html>