|
@@ -34,8 +34,8 @@ function uuid() { |
|
@@ -34,8 +34,8 @@ function uuid() { |
34
|
for (i = 0; i < 36; i++) {
|
34
|
for (i = 0; i < 36; i++) {
|
35
|
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
|
35
|
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
|
36
|
}
|
36
|
}
|
37
|
- s[14] = '4'; // bits 12-15 of the time_hi_and_version field to 0010
|
|
|
38
|
- s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
|
37
|
+ s[14] = '4'; // bits 12-15 of the time_hi_and_version field to 0010
|
|
|
38
|
+ s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
|
39
|
s[8] = s[13] = s[18] = s[23] = '-';
|
39
|
s[8] = s[13] = s[18] = s[23] = '-';
|
40
|
|
40
|
|
41
|
id = s.join('');
|
41
|
id = s.join('');
|
|
@@ -64,13 +64,13 @@ if ($('.banner-swiper').find('li').size() > 1) { |
|
@@ -64,13 +64,13 @@ if ($('.banner-swiper').find('li').size() > 1) { |
64
|
// 获取url中的参数
|
64
|
// 获取url中的参数
|
65
|
function getUrlParam(name) {
|
65
|
function getUrlParam(name) {
|
66
|
|
66
|
|
67
|
- // 构造一个含有目标参数的正则表达式对象
|
67
|
+ // 构造一个含有目标参数的正则表达式对象
|
68
|
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
|
68
|
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
|
69
|
|
69
|
|
70
|
- // 匹配目标参数
|
70
|
+ // 匹配目标参数
|
71
|
var r = window.location.search.substr(1).match(reg);
|
71
|
var r = window.location.search.substr(1).match(reg);
|
72
|
|
72
|
|
73
|
- // 返回参数值
|
73
|
+ // 返回参数值
|
74
|
if (r !== null) {
|
74
|
if (r !== null) {
|
75
|
return r[2];
|
75
|
return r[2];
|
76
|
}
|
76
|
}
|
|
@@ -141,64 +141,64 @@ $('.on-lingqu', 'div.main-right-use').on('click', function() { |
|
@@ -141,64 +141,64 @@ $('.on-lingqu', 'div.main-right-use').on('click', function() { |
141
|
*/
|
141
|
*/
|
142
|
if (typeof wx !== 'undefined') {
|
142
|
if (typeof wx !== 'undefined') {
|
143
|
$.getJSON(_weChatInterface + '?pageurl=' +
|
143
|
$.getJSON(_weChatInterface + '?pageurl=' +
|
144
|
- encodeURIComponent(location.href.split('#')[0]) + '&callback=?',
|
|
|
145
|
- function(json) {
|
|
|
146
|
- var _appId,
|
|
|
147
|
- _timestamp,
|
|
|
148
|
- _nonceStr,
|
|
|
149
|
- _signature;
|
|
|
150
|
-
|
|
|
151
|
- if (json) {
|
|
|
152
|
- _appId = json.appId.toString();
|
|
|
153
|
- _timestamp = json.timestamp;
|
|
|
154
|
- _nonceStr = json.nonceStr.toString();
|
|
|
155
|
- _signature = json.signature.toString();
|
|
|
156
|
-
|
|
|
157
|
- wx.config({
|
|
|
158
|
- debug: false,
|
|
|
159
|
- appId: _appId,
|
|
|
160
|
- timestamp: _timestamp,
|
|
|
161
|
- nonceStr: _nonceStr,
|
|
|
162
|
- signature: _signature,
|
|
|
163
|
- jsApiList: [
|
|
|
164
|
- 'checkJsApi',
|
|
|
165
|
- 'onMenuShareTimeline',
|
|
|
166
|
- 'onMenuShareAppMessage',
|
|
|
167
|
- 'onMenuShareQQ',
|
|
|
168
|
- 'onMenuShareWeibo',
|
|
|
169
|
- 'hideMenuItems',
|
|
|
170
|
- 'showMenuItems',
|
|
|
171
|
- 'hideAllNonBaseMenuItem',
|
|
|
172
|
- 'showAllNonBaseMenuItem',
|
|
|
173
|
- 'translateVoice',
|
|
|
174
|
- 'startRecord',
|
|
|
175
|
- 'stopRecord',
|
|
|
176
|
- 'onRecordEnd',
|
|
|
177
|
- 'playVoice',
|
|
|
178
|
- 'pauseVoice',
|
|
|
179
|
- 'stopVoice',
|
|
|
180
|
- 'uploadVoice',
|
|
|
181
|
- 'downloadVoice',
|
|
|
182
|
- 'chooseImage',
|
|
|
183
|
- 'previewImage',
|
|
|
184
|
- 'uploadImage',
|
|
|
185
|
- 'downloadImage',
|
|
|
186
|
- 'getNetworkType',
|
|
|
187
|
- 'openLocation',
|
|
|
188
|
- 'getLocation',
|
|
|
189
|
- 'hideOptionMenu',
|
|
|
190
|
- 'showOptionMenu',
|
|
|
191
|
- 'closeWindow',
|
|
|
192
|
- 'scanQRCode',
|
|
|
193
|
- 'chooseWXPay',
|
|
|
194
|
- 'openProductSpecificView',
|
|
|
195
|
- 'addCard',
|
|
|
196
|
- 'chooseCard',
|
|
|
197
|
- 'openCard'
|
|
|
198
|
- ]
|
|
|
199
|
- });
|
|
|
200
|
- }
|
|
|
201
|
- });
|
144
|
+ encodeURIComponent(location.href.split('#')[0]) + '&callback=?',
|
|
|
145
|
+ function(json) {
|
|
|
146
|
+ var _appId,
|
|
|
147
|
+ _timestamp,
|
|
|
148
|
+ _nonceStr,
|
|
|
149
|
+ _signature;
|
|
|
150
|
+
|
|
|
151
|
+ if (json) {
|
|
|
152
|
+ _appId = json.appId.toString();
|
|
|
153
|
+ _timestamp = json.timestamp;
|
|
|
154
|
+ _nonceStr = json.nonceStr.toString();
|
|
|
155
|
+ _signature = json.signature.toString();
|
|
|
156
|
+
|
|
|
157
|
+ wx.config({
|
|
|
158
|
+ debug: false,
|
|
|
159
|
+ appId: _appId,
|
|
|
160
|
+ timestamp: _timestamp,
|
|
|
161
|
+ nonceStr: _nonceStr,
|
|
|
162
|
+ signature: _signature,
|
|
|
163
|
+ jsApiList: [
|
|
|
164
|
+ 'checkJsApi',
|
|
|
165
|
+ 'onMenuShareTimeline',
|
|
|
166
|
+ 'onMenuShareAppMessage',
|
|
|
167
|
+ 'onMenuShareQQ',
|
|
|
168
|
+ 'onMenuShareWeibo',
|
|
|
169
|
+ 'hideMenuItems',
|
|
|
170
|
+ 'showMenuItems',
|
|
|
171
|
+ 'hideAllNonBaseMenuItem',
|
|
|
172
|
+ 'showAllNonBaseMenuItem',
|
|
|
173
|
+ 'translateVoice',
|
|
|
174
|
+ 'startRecord',
|
|
|
175
|
+ 'stopRecord',
|
|
|
176
|
+ 'onRecordEnd',
|
|
|
177
|
+ 'playVoice',
|
|
|
178
|
+ 'pauseVoice',
|
|
|
179
|
+ 'stopVoice',
|
|
|
180
|
+ 'uploadVoice',
|
|
|
181
|
+ 'downloadVoice',
|
|
|
182
|
+ 'chooseImage',
|
|
|
183
|
+ 'previewImage',
|
|
|
184
|
+ 'uploadImage',
|
|
|
185
|
+ 'downloadImage',
|
|
|
186
|
+ 'getNetworkType',
|
|
|
187
|
+ 'openLocation',
|
|
|
188
|
+ 'getLocation',
|
|
|
189
|
+ 'hideOptionMenu',
|
|
|
190
|
+ 'showOptionMenu',
|
|
|
191
|
+ 'closeWindow',
|
|
|
192
|
+ 'scanQRCode',
|
|
|
193
|
+ 'chooseWXPay',
|
|
|
194
|
+ 'openProductSpecificView',
|
|
|
195
|
+ 'addCard',
|
|
|
196
|
+ 'chooseCard',
|
|
|
197
|
+ 'openCard'
|
|
|
198
|
+ ]
|
|
|
199
|
+ });
|
|
|
200
|
+ }
|
|
|
201
|
+ });
|
202
|
|
202
|
|
203
|
wx.ready(function() {
|
203
|
wx.ready(function() {
|
204
|
var shareData = {
|
204
|
var shareData = {
|
|
@@ -208,16 +208,16 @@ if (typeof wx !== 'undefined') { |
|
@@ -208,16 +208,16 @@ if (typeof wx !== 'undefined') { |
208
|
link: 'https://m.yohobuy.com/activity/student'
|
208
|
link: 'https://m.yohobuy.com/activity/student'
|
209
|
};
|
209
|
};
|
210
|
|
210
|
|
211
|
- // 分享给朋友
|
211
|
+ // 分享给朋友
|
212
|
wx.onMenuShareAppMessage(shareData);
|
212
|
wx.onMenuShareAppMessage(shareData);
|
213
|
|
213
|
|
214
|
- // 分享到朋友圈
|
214
|
+ // 分享到朋友圈
|
215
|
wx.onMenuShareTimeline(shareData);
|
215
|
wx.onMenuShareTimeline(shareData);
|
216
|
|
216
|
|
217
|
- // 分享到QQ
|
217
|
+ // 分享到QQ
|
218
|
wx.onMenuShareQQ(shareData);
|
218
|
wx.onMenuShareQQ(shareData);
|
219
|
|
219
|
|
220
|
- // 分享到微博
|
220
|
+ // 分享到微博
|
221
|
wx.onMenuShareWeibo(shareData);
|
221
|
wx.onMenuShareWeibo(shareData);
|
222
|
});
|
222
|
});
|
223
|
}
|
223
|
}
|
|
@@ -225,6 +225,7 @@ if (typeof wx !== 'undefined') { |
|
@@ -225,6 +225,7 @@ if (typeof wx !== 'undefined') { |
225
|
setTimeout(function() {
|
225
|
setTimeout(function() {
|
226
|
var len = $('.good-info', '.goods-list').length;
|
226
|
var len = $('.good-info', '.goods-list').length;
|
227
|
var ids = [];
|
227
|
var ids = [];
|
|
|
228
|
+ var check = location.pathname.indexOf('quanyi') === -1;
|
228
|
|
229
|
|
229
|
$('.good-info', '.goods-list').each(function() {
|
230
|
$('.good-info', '.goods-list').each(function() {
|
230
|
var goodids = $(this).find('.good-thumb').attr('href').match(/"product_skn":([^}]+)/, 'g');
|
231
|
var goodids = $(this).find('.good-thumb').attr('href').match(/"product_skn":([^}]+)/, 'g');
|
|
@@ -233,41 +234,55 @@ setTimeout(function() { |
|
@@ -233,41 +234,55 @@ setTimeout(function() { |
233
|
ids.push(goodid);
|
234
|
ids.push(goodid);
|
234
|
});
|
235
|
});
|
235
|
|
236
|
|
236
|
- if (window._yas && window._yas.sendCustomInfo) {
|
237
|
+ if (check && window._yas && window._yas.sendCustomInfo) {
|
237
|
window._yas.sendCustomInfo({
|
238
|
window._yas.sendCustomInfo({
|
238
|
op: 'YB_STUDENT_VIP_GDS_LIST',
|
239
|
op: 'YB_STUDENT_VIP_GDS_LIST',
|
239
|
- param: {
|
240
|
+ param: JSON.stringify({
|
240
|
C_ID: C_ID,
|
241
|
C_ID: C_ID,
|
241
|
PRD_NUM: len,
|
242
|
PRD_NUM: len,
|
242
|
PRD_ID: ids.join(','),
|
243
|
PRD_ID: ids.join(','),
|
243
|
ACTION_ID: 0,
|
244
|
ACTION_ID: 0,
|
244
|
SORT_TYPE: 4,
|
245
|
SORT_TYPE: 4,
|
245
|
REC_ID: uuid(40) + '0000'
|
246
|
REC_ID: uuid(40) + '0000'
|
246
|
- }
|
247
|
+ }),
|
247
|
}, true);
|
248
|
}, true);
|
248
|
}
|
249
|
}
|
249
|
if ($('.s-verify-fail').size()) {
|
250
|
if ($('.s-verify-fail').size()) {
|
250
|
if (window._yas && window._yas.sendCustomInfo) {
|
251
|
if (window._yas && window._yas.sendCustomInfo) {
|
251
|
window._yas.sendCustomInfo({
|
252
|
window._yas.sendCustomInfo({
|
252
|
op: 'YB_STUDENT_ATTCT_RESULT',
|
253
|
op: 'YB_STUDENT_ATTCT_RESULT',
|
253
|
- param: {
|
254
|
+ param: JSON.stringify({
|
254
|
C_ID: C_ID,
|
255
|
C_ID: C_ID,
|
255
|
SRC_ID: 5,
|
256
|
SRC_ID: 5,
|
256
|
- ATTCT_RES: 1,
|
|
|
257
|
- FAILURE_CAUSE: ''
|
|
|
258
|
- }
|
257
|
+ ATTCT_RES: 2,
|
|
|
258
|
+ FAILURE_CAUSE: $('.s-verify-fail').attr('prompt'),
|
|
|
259
|
+ }),
|
259
|
}, true);
|
260
|
}, true);
|
260
|
}
|
261
|
}
|
261
|
- } else {
|
|
|
262
|
- // 埋点 学生营销宣传首页
|
262
|
+ } else if ($('.s-verify-success').size()) {
|
263
|
if (window._yas && window._yas.sendCustomInfo) {
|
263
|
if (window._yas && window._yas.sendCustomInfo) {
|
264
|
window._yas.sendCustomInfo({
|
264
|
window._yas.sendCustomInfo({
|
265
|
- op: 'YB_STUDENT_HOME',
|
|
|
266
|
- param: {
|
|
|
267
|
- C_ID: C_ID
|
|
|
268
|
- }
|
265
|
+ op: 'YB_STUDENT_ATTCT_RESULT',
|
|
|
266
|
+ param: JSON.stringify({
|
|
|
267
|
+ C_ID: C_ID,
|
|
|
268
|
+ SRC_ID: 5,
|
|
|
269
|
+ ATTCT_RES: 1,
|
|
|
270
|
+ FAILURE_CAUSE: '',
|
|
|
271
|
+ ATTCT_INFO: '{{info}}',
|
|
|
272
|
+ }).replace('{{info}}', localStorage.STUDENTCOOKIES),
|
269
|
}, true);
|
273
|
}, true);
|
270
|
}
|
274
|
}
|
|
|
275
|
+ } else {
|
|
|
276
|
+
|
|
|
277
|
+ // 埋点 学生营销宣传首页
|
|
|
278
|
+ // if (window._yas && window._yas.sendCustomInfo) {
|
|
|
279
|
+ // window._yas.sendCustomInfo({
|
|
|
280
|
+ // op: 'YB_STUDENT_HOME',
|
|
|
281
|
+ // param: JSON.stringify({
|
|
|
282
|
+ // C_ID: C_ID
|
|
|
283
|
+ // }),
|
|
|
284
|
+ // }, true);
|
|
|
285
|
+ // }
|
271
|
}
|
286
|
}
|
272
|
|
287
|
|
273
|
}, 3000);
|
288
|
}, 3000);
|
|
@@ -284,14 +299,14 @@ $('.swiper-slide', '.banner-top').click(function() { |
|
@@ -284,14 +299,14 @@ $('.swiper-slide', '.banner-top').click(function() { |
284
|
|
299
|
|
285
|
options = {
|
300
|
options = {
|
286
|
op: 'YB_STUDENT_VIP_FLR',
|
301
|
op: 'YB_STUDENT_VIP_FLR',
|
287
|
- param: {
|
302
|
+ param: JSON.stringify({
|
288
|
C_ID: C_ID,
|
303
|
C_ID: C_ID,
|
289
|
F_ID: tid || 1,
|
304
|
F_ID: tid || 1,
|
290
|
F_NAME: '焦点图',
|
305
|
F_NAME: '焦点图',
|
291
|
- F_URL: url,
|
306
|
+ F_URL: encodeURIComponent(url),
|
292
|
F_INDEX: 1,
|
307
|
F_INDEX: 1,
|
293
|
I_INDEX: index
|
308
|
I_INDEX: index
|
294
|
- }
|
309
|
+ }),
|
295
|
};
|
310
|
};
|
296
|
if (window._yas && window._yas.sendCustomInfo) {
|
311
|
if (window._yas && window._yas.sendCustomInfo) {
|
297
|
window._yas.sendCustomInfo(options, true);
|
312
|
window._yas.sendCustomInfo(options, true);
|
|
@@ -299,24 +314,47 @@ $('.swiper-slide', '.banner-top').click(function() { |
|
@@ -299,24 +314,47 @@ $('.swiper-slide', '.banner-top').click(function() { |
299
|
|
314
|
|
300
|
// return false;
|
315
|
// return false;
|
301
|
});
|
316
|
});
|
302
|
-$('.s-activity', '.s-section').click(function() {
|
317
|
+
|
|
|
318
|
+// 学生活动页楼层埋点
|
|
|
319
|
+$('.s-activity, .main-left, .s-quan, .iconfont', '.s-section').click(function() {
|
303
|
var options;
|
320
|
var options;
|
304
|
var url = $(this).attr('href');
|
321
|
var url = $(this).attr('href');
|
305
|
var index = $(this).index();
|
322
|
var index = $(this).index();
|
306
|
var tid = $(this).parents('.s-section').data('template-id');
|
323
|
var tid = $(this).parents('.s-section').data('template-id');
|
|
|
324
|
+ var obj = {
|
|
|
325
|
+ 's-activity': {
|
|
|
326
|
+ fname: '学生专属活动',
|
|
|
327
|
+ findex: 4,
|
|
|
328
|
+ iindex: index,
|
|
|
329
|
+ },
|
|
|
330
|
+ 'more iconfont': {
|
|
|
331
|
+ fname: '领券中心',
|
|
|
332
|
+ findex: 3,
|
|
|
333
|
+ iindex: 0,
|
|
|
334
|
+ },
|
|
|
335
|
+ 'main-left': {
|
|
|
336
|
+ fname: '领券中心',
|
|
|
337
|
+ findex: 3,
|
|
|
338
|
+ iindex: $(this).parent().parent().index(),
|
|
|
339
|
+ },
|
|
|
340
|
+ 'more s-quan': {
|
|
|
341
|
+ fname: '学生权益',
|
|
|
342
|
+ findex: 2,
|
|
|
343
|
+ iindex: 0,
|
|
|
344
|
+ },
|
|
|
345
|
+ }[$(this).attr('class')];
|
307
|
|
346
|
|
308
|
options = {
|
347
|
options = {
|
309
|
op: 'YB_STUDENT_VIP_FLR',
|
348
|
op: 'YB_STUDENT_VIP_FLR',
|
310
|
- param: {
|
349
|
+ param: JSON.stringify({
|
311
|
C_ID: C_ID,
|
350
|
C_ID: C_ID,
|
312
|
F_ID: tid,
|
351
|
F_ID: tid,
|
313
|
- F_NAME: '学生专属活动',
|
|
|
314
|
- F_URL: url,
|
|
|
315
|
- F_INDEX: 3,
|
|
|
316
|
- I_INDEX: index
|
|
|
317
|
- }
|
352
|
+ F_NAME: obj.fname,
|
|
|
353
|
+ F_URL: encodeURIComponent(url),
|
|
|
354
|
+ F_INDEX: obj.findex,
|
|
|
355
|
+ I_INDEX: obj.iindex,
|
|
|
356
|
+ }),
|
318
|
};
|
357
|
};
|
319
|
-
|
|
|
320
|
if (window._yas && window._yas.sendCustomInfo) {
|
358
|
if (window._yas && window._yas.sendCustomInfo) {
|
321
|
window._yas.sendCustomInfo(options, true);
|
359
|
window._yas.sendCustomInfo(options, true);
|
322
|
}
|
360
|
}
|
|
@@ -330,14 +368,13 @@ $('.good-info', '.goods-list').click(function() { |
|
@@ -330,14 +368,13 @@ $('.good-info', '.goods-list').click(function() { |
330
|
|
368
|
|
331
|
options = {
|
369
|
options = {
|
332
|
op: 'YB_STUDENT_VIP_GDS_LIST',
|
370
|
op: 'YB_STUDENT_VIP_GDS_LIST',
|
333
|
- param: {
|
371
|
+ param: JSON.stringify({
|
334
|
C_ID: C_ID,
|
372
|
C_ID: C_ID,
|
335
|
PRD_NUM: index,
|
373
|
PRD_NUM: index,
|
336
|
PRD_ID: goodid,
|
374
|
PRD_ID: goodid,
|
337
|
ACTION_ID: 1,
|
375
|
ACTION_ID: 1,
|
338
|
- SORT_TYPE: 4,
|
|
|
339
|
REC_ID: uuid(40) + '0000'
|
376
|
REC_ID: uuid(40) + '0000'
|
340
|
- }
|
377
|
+ }),
|
341
|
};
|
378
|
};
|
342
|
if (window._yas && window._yas.sendCustomInfo) {
|
379
|
if (window._yas && window._yas.sendCustomInfo) {
|
343
|
window._yas.sendCustomInfo(options, true);
|
380
|
window._yas.sendCustomInfo(options, true);
|
|
@@ -345,16 +382,14 @@ $('.good-info', '.goods-list').click(function() { |
|
@@ -345,16 +382,14 @@ $('.good-info', '.goods-list').click(function() { |
345
|
});
|
382
|
});
|
346
|
$('.s-renzhen').click(function() {
|
383
|
$('.s-renzhen').click(function() {
|
347
|
var options = {
|
384
|
var options = {
|
348
|
- op: 'YB_STUDENT_ATTCT_SUBMIT',
|
|
|
349
|
- param: {
|
385
|
+ op: 'YB_STUDENT_ATTCT_INFO',
|
|
|
386
|
+ param: JSON.stringify({
|
350
|
C_ID: C_ID,
|
387
|
C_ID: C_ID,
|
351
|
SRC_ID: 1
|
388
|
SRC_ID: 1
|
352
|
- }
|
389
|
+ }),
|
353
|
};
|
390
|
};
|
354
|
|
391
|
|
355
|
if (window._yas && window._yas.sendCustomInfo) {
|
392
|
if (window._yas && window._yas.sendCustomInfo) {
|
356
|
window._yas.sendCustomInfo(options, true);
|
393
|
window._yas.sendCustomInfo(options, true);
|
357
|
}
|
394
|
}
|
358
|
}); |
395
|
}); |
359
|
-
|
|
|
360
|
- |
|
|