...
|
...
|
@@ -34,8 +34,8 @@ function uuid() { |
|
|
for (i = 0; i < 36; i++) {
|
|
|
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
|
|
|
}
|
|
|
s[14] = '4'; // bits 12-15 of the time_hi_and_version field to 0010
|
|
|
s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
|
|
|
s[14] = '4'; // bits 12-15 of the time_hi_and_version field to 0010
|
|
|
s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
|
|
|
s[8] = s[13] = s[18] = s[23] = '-';
|
|
|
|
|
|
id = s.join('');
|
...
|
...
|
@@ -64,13 +64,13 @@ if ($('.banner-swiper').find('li').size() > 1) { |
|
|
// 获取url中的参数
|
|
|
function getUrlParam(name) {
|
|
|
|
|
|
// 构造一个含有目标参数的正则表达式对象
|
|
|
// 构造一个含有目标参数的正则表达式对象
|
|
|
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
|
|
|
|
|
|
// 匹配目标参数
|
|
|
// 匹配目标参数
|
|
|
var r = window.location.search.substr(1).match(reg);
|
|
|
|
|
|
// 返回参数值
|
|
|
// 返回参数值
|
|
|
if (r !== null) {
|
|
|
return r[2];
|
|
|
}
|
...
|
...
|
@@ -141,64 +141,64 @@ $('.on-lingqu', 'div.main-right-use').on('click', function() { |
|
|
*/
|
|
|
if (typeof wx !== 'undefined') {
|
|
|
$.getJSON(_weChatInterface + '?pageurl=' +
|
|
|
encodeURIComponent(location.href.split('#')[0]) + '&callback=?',
|
|
|
function(json) {
|
|
|
var _appId,
|
|
|
_timestamp,
|
|
|
_nonceStr,
|
|
|
_signature;
|
|
|
|
|
|
if (json) {
|
|
|
_appId = json.appId.toString();
|
|
|
_timestamp = json.timestamp;
|
|
|
_nonceStr = json.nonceStr.toString();
|
|
|
_signature = json.signature.toString();
|
|
|
|
|
|
wx.config({
|
|
|
debug: false,
|
|
|
appId: _appId,
|
|
|
timestamp: _timestamp,
|
|
|
nonceStr: _nonceStr,
|
|
|
signature: _signature,
|
|
|
jsApiList: [
|
|
|
'checkJsApi',
|
|
|
'onMenuShareTimeline',
|
|
|
'onMenuShareAppMessage',
|
|
|
'onMenuShareQQ',
|
|
|
'onMenuShareWeibo',
|
|
|
'hideMenuItems',
|
|
|
'showMenuItems',
|
|
|
'hideAllNonBaseMenuItem',
|
|
|
'showAllNonBaseMenuItem',
|
|
|
'translateVoice',
|
|
|
'startRecord',
|
|
|
'stopRecord',
|
|
|
'onRecordEnd',
|
|
|
'playVoice',
|
|
|
'pauseVoice',
|
|
|
'stopVoice',
|
|
|
'uploadVoice',
|
|
|
'downloadVoice',
|
|
|
'chooseImage',
|
|
|
'previewImage',
|
|
|
'uploadImage',
|
|
|
'downloadImage',
|
|
|
'getNetworkType',
|
|
|
'openLocation',
|
|
|
'getLocation',
|
|
|
'hideOptionMenu',
|
|
|
'showOptionMenu',
|
|
|
'closeWindow',
|
|
|
'scanQRCode',
|
|
|
'chooseWXPay',
|
|
|
'openProductSpecificView',
|
|
|
'addCard',
|
|
|
'chooseCard',
|
|
|
'openCard'
|
|
|
]
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
encodeURIComponent(location.href.split('#')[0]) + '&callback=?',
|
|
|
function(json) {
|
|
|
var _appId,
|
|
|
_timestamp,
|
|
|
_nonceStr,
|
|
|
_signature;
|
|
|
|
|
|
if (json) {
|
|
|
_appId = json.appId.toString();
|
|
|
_timestamp = json.timestamp;
|
|
|
_nonceStr = json.nonceStr.toString();
|
|
|
_signature = json.signature.toString();
|
|
|
|
|
|
wx.config({
|
|
|
debug: false,
|
|
|
appId: _appId,
|
|
|
timestamp: _timestamp,
|
|
|
nonceStr: _nonceStr,
|
|
|
signature: _signature,
|
|
|
jsApiList: [
|
|
|
'checkJsApi',
|
|
|
'onMenuShareTimeline',
|
|
|
'onMenuShareAppMessage',
|
|
|
'onMenuShareQQ',
|
|
|
'onMenuShareWeibo',
|
|
|
'hideMenuItems',
|
|
|
'showMenuItems',
|
|
|
'hideAllNonBaseMenuItem',
|
|
|
'showAllNonBaseMenuItem',
|
|
|
'translateVoice',
|
|
|
'startRecord',
|
|
|
'stopRecord',
|
|
|
'onRecordEnd',
|
|
|
'playVoice',
|
|
|
'pauseVoice',
|
|
|
'stopVoice',
|
|
|
'uploadVoice',
|
|
|
'downloadVoice',
|
|
|
'chooseImage',
|
|
|
'previewImage',
|
|
|
'uploadImage',
|
|
|
'downloadImage',
|
|
|
'getNetworkType',
|
|
|
'openLocation',
|
|
|
'getLocation',
|
|
|
'hideOptionMenu',
|
|
|
'showOptionMenu',
|
|
|
'closeWindow',
|
|
|
'scanQRCode',
|
|
|
'chooseWXPay',
|
|
|
'openProductSpecificView',
|
|
|
'addCard',
|
|
|
'chooseCard',
|
|
|
'openCard'
|
|
|
]
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
|
|
|
wx.ready(function() {
|
|
|
var shareData = {
|
...
|
...
|
@@ -208,16 +208,16 @@ if (typeof wx !== 'undefined') { |
|
|
link: 'https://m.yohobuy.com/activity/student'
|
|
|
};
|
|
|
|
|
|
// 分享给朋友
|
|
|
// 分享给朋友
|
|
|
wx.onMenuShareAppMessage(shareData);
|
|
|
|
|
|
// 分享到朋友圈
|
|
|
// 分享到朋友圈
|
|
|
wx.onMenuShareTimeline(shareData);
|
|
|
|
|
|
// 分享到QQ
|
|
|
// 分享到QQ
|
|
|
wx.onMenuShareQQ(shareData);
|
|
|
|
|
|
// 分享到微博
|
|
|
// 分享到微博
|
|
|
wx.onMenuShareWeibo(shareData);
|
|
|
});
|
|
|
}
|
...
|
...
|
@@ -225,6 +225,7 @@ if (typeof wx !== 'undefined') { |
|
|
setTimeout(function() {
|
|
|
var len = $('.good-info', '.goods-list').length;
|
|
|
var ids = [];
|
|
|
var check = location.pathname.indexOf('quanyi') === -1;
|
|
|
|
|
|
$('.good-info', '.goods-list').each(function() {
|
|
|
var goodids = $(this).find('.good-thumb').attr('href').match(/"product_skn":([^}]+)/, 'g');
|
...
|
...
|
@@ -233,41 +234,55 @@ setTimeout(function() { |
|
|
ids.push(goodid);
|
|
|
});
|
|
|
|
|
|
if (window._yas && window._yas.sendCustomInfo) {
|
|
|
if (check && window._yas && window._yas.sendCustomInfo) {
|
|
|
window._yas.sendCustomInfo({
|
|
|
op: 'YB_STUDENT_VIP_GDS_LIST',
|
|
|
param: {
|
|
|
param: JSON.stringify({
|
|
|
C_ID: C_ID,
|
|
|
PRD_NUM: len,
|
|
|
PRD_ID: ids.join(','),
|
|
|
ACTION_ID: 0,
|
|
|
SORT_TYPE: 4,
|
|
|
REC_ID: uuid(40) + '0000'
|
|
|
}
|
|
|
}),
|
|
|
}, true);
|
|
|
}
|
|
|
if ($('.s-verify-fail').size()) {
|
|
|
if (window._yas && window._yas.sendCustomInfo) {
|
|
|
window._yas.sendCustomInfo({
|
|
|
op: 'YB_STUDENT_ATTCT_RESULT',
|
|
|
param: {
|
|
|
param: JSON.stringify({
|
|
|
C_ID: C_ID,
|
|
|
SRC_ID: 5,
|
|
|
ATTCT_RES: 1,
|
|
|
FAILURE_CAUSE: ''
|
|
|
}
|
|
|
ATTCT_RES: 2,
|
|
|
FAILURE_CAUSE: $('.s-verify-fail').attr('prompt'),
|
|
|
}),
|
|
|
}, true);
|
|
|
}
|
|
|
} else {
|
|
|
// 埋点 学生营销宣传首页
|
|
|
} else if ($('.s-verify-success').size()) {
|
|
|
if (window._yas && window._yas.sendCustomInfo) {
|
|
|
window._yas.sendCustomInfo({
|
|
|
op: 'YB_STUDENT_HOME',
|
|
|
param: {
|
|
|
C_ID: C_ID
|
|
|
}
|
|
|
op: 'YB_STUDENT_ATTCT_RESULT',
|
|
|
param: JSON.stringify({
|
|
|
C_ID: C_ID,
|
|
|
SRC_ID: 5,
|
|
|
ATTCT_RES: 1,
|
|
|
FAILURE_CAUSE: '',
|
|
|
ATTCT_INFO: '{{info}}',
|
|
|
}).replace('{{info}}', localStorage.STUDENTCOOKIES),
|
|
|
}, true);
|
|
|
}
|
|
|
} else {
|
|
|
|
|
|
// 埋点 学生营销宣传首页
|
|
|
// if (window._yas && window._yas.sendCustomInfo) {
|
|
|
// window._yas.sendCustomInfo({
|
|
|
// op: 'YB_STUDENT_HOME',
|
|
|
// param: JSON.stringify({
|
|
|
// C_ID: C_ID
|
|
|
// }),
|
|
|
// }, true);
|
|
|
// }
|
|
|
}
|
|
|
|
|
|
}, 3000);
|
...
|
...
|
@@ -284,14 +299,14 @@ $('.swiper-slide', '.banner-top').click(function() { |
|
|
|
|
|
options = {
|
|
|
op: 'YB_STUDENT_VIP_FLR',
|
|
|
param: {
|
|
|
param: JSON.stringify({
|
|
|
C_ID: C_ID,
|
|
|
F_ID: tid || 1,
|
|
|
F_NAME: '焦点图',
|
|
|
F_URL: url,
|
|
|
F_URL: encodeURIComponent(url),
|
|
|
F_INDEX: 1,
|
|
|
I_INDEX: index
|
|
|
}
|
|
|
}),
|
|
|
};
|
|
|
if (window._yas && window._yas.sendCustomInfo) {
|
|
|
window._yas.sendCustomInfo(options, true);
|
...
|
...
|
@@ -299,24 +314,47 @@ $('.swiper-slide', '.banner-top').click(function() { |
|
|
|
|
|
// return false;
|
|
|
});
|
|
|
$('.s-activity', '.s-section').click(function() {
|
|
|
|
|
|
// 学生活动页楼层埋点
|
|
|
$('.s-activity, .main-left, .s-quan, .iconfont', '.s-section').click(function() {
|
|
|
var options;
|
|
|
var url = $(this).attr('href');
|
|
|
var index = $(this).index();
|
|
|
var tid = $(this).parents('.s-section').data('template-id');
|
|
|
var obj = {
|
|
|
's-activity': {
|
|
|
fname: '学生专属活动',
|
|
|
findex: 4,
|
|
|
iindex: index,
|
|
|
},
|
|
|
'more iconfont': {
|
|
|
fname: '领券中心',
|
|
|
findex: 3,
|
|
|
iindex: 0,
|
|
|
},
|
|
|
'main-left': {
|
|
|
fname: '领券中心',
|
|
|
findex: 3,
|
|
|
iindex: $(this).parent().parent().index(),
|
|
|
},
|
|
|
'more s-quan': {
|
|
|
fname: '学生权益',
|
|
|
findex: 2,
|
|
|
iindex: 0,
|
|
|
},
|
|
|
}[$(this).attr('class')];
|
|
|
|
|
|
options = {
|
|
|
op: 'YB_STUDENT_VIP_FLR',
|
|
|
param: {
|
|
|
param: JSON.stringify({
|
|
|
C_ID: C_ID,
|
|
|
F_ID: tid,
|
|
|
F_NAME: '学生专属活动',
|
|
|
F_URL: url,
|
|
|
F_INDEX: 3,
|
|
|
I_INDEX: index
|
|
|
}
|
|
|
F_NAME: obj.fname,
|
|
|
F_URL: encodeURIComponent(url),
|
|
|
F_INDEX: obj.findex,
|
|
|
I_INDEX: obj.iindex,
|
|
|
}),
|
|
|
};
|
|
|
|
|
|
if (window._yas && window._yas.sendCustomInfo) {
|
|
|
window._yas.sendCustomInfo(options, true);
|
|
|
}
|
...
|
...
|
@@ -330,14 +368,13 @@ $('.good-info', '.goods-list').click(function() { |
|
|
|
|
|
options = {
|
|
|
op: 'YB_STUDENT_VIP_GDS_LIST',
|
|
|
param: {
|
|
|
param: JSON.stringify({
|
|
|
C_ID: C_ID,
|
|
|
PRD_NUM: index,
|
|
|
PRD_ID: goodid,
|
|
|
ACTION_ID: 1,
|
|
|
SORT_TYPE: 4,
|
|
|
REC_ID: uuid(40) + '0000'
|
|
|
}
|
|
|
}),
|
|
|
};
|
|
|
if (window._yas && window._yas.sendCustomInfo) {
|
|
|
window._yas.sendCustomInfo(options, true);
|
...
|
...
|
@@ -345,16 +382,14 @@ $('.good-info', '.goods-list').click(function() { |
|
|
});
|
|
|
$('.s-renzhen').click(function() {
|
|
|
var options = {
|
|
|
op: 'YB_STUDENT_ATTCT_SUBMIT',
|
|
|
param: {
|
|
|
op: 'YB_STUDENT_ATTCT_INFO',
|
|
|
param: JSON.stringify({
|
|
|
C_ID: C_ID,
|
|
|
SRC_ID: 1
|
|
|
}
|
|
|
}),
|
|
|
};
|
|
|
|
|
|
if (window._yas && window._yas.sendCustomInfo) {
|
|
|
window._yas.sendCustomInfo(options, true);
|
|
|
}
|
|
|
}); |
|
|
|
|
|
|
...
|
...
|
|