Authored by 沈志敏

修改 下载链接,添加百度统计

{
"name": "yas-jssdk",
"version": "2.2.4",
"version": "2.2.5",
"description": "YOHO!采集系统的前端js的开发包",
"keywords": [
"YOHO!",
... ...
... ... @@ -244,11 +244,11 @@ exports.getDownloadStr = function(isWechat, mktc) {
str += '" id="top-downloadbar"><a href="javascript:void(0);" class="download-close" id="download-close"></a>\
<span class="download-icon"></span><span class="download-text">Yoho!Buy有货</span>';
if (isWechat) {
str += '<a class="download-go-wechat" id="download-go" href="http://union.yoho.cn/union/downapp.html' + (mktc ? '?union_type=' + mktc : '') +'">立即打开</a>';
str += '<a class="download-go-wechat" id="download-go" href="https://union.yoho.cn/union/app-downloads.html' + (mktc ? '?union_type=' + mktc : '') +'">立即打开</a>';
str += '<a class="download-wechat" id="download-wechat" href="https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MjM5MzI3MDkwNg==&scene=110#wechat_redirect">加关注</a></div>';
} else {
str += '<p class="download-text-desc">新用户送惊喜礼包</p>';
str += '<a class="download-go" id="download-go" href="//m.yohobuy.com/activity/app-downloads' + (mktc ? '?union_type=' + mktc : '') + '">立即打开</a></div>';
str += '<a class="download-go" id="download-go" href="https://union.yoho.cn/union/app-downloads.html' + (mktc ? '?union_type=' + mktc : '') + '">立即打开</a></div>';
}
return str;
}
\ No newline at end of file
... ...
... ... @@ -373,7 +373,7 @@ function setUnionType() {
for (var i = 0; i < aDom.length; i++) {
var href = aDom[i].getAttribute('href') || '';
if (href.indexOf('union.yoho.cn/union/downapp.html') > -1) {
if (href.indexOf('union.yoho.cn/union/app-downloads.html') > -1) {
if (mktc && href.indexOf('union_type') === -1) {
href += '?union_type=' + mktc;
aDom[i].setAttribute('href', href);
... ... @@ -432,16 +432,28 @@ function setDownloadBar() {
});
cross.downloadSend('//m.yohobuy.com/activitylog.json?close', '');
downloadDom.style.display = 'none';
if (_hmt && _hmt.push) {
_hmt.push(['_trackEvent', '顶部下载条目', '点击关闭Banner']);
}
});
var goDom = document.getElementById('download-go');
ev.addEventHandler(goDom, 'click', function(){
ev.addEventHandler(goDom, 'click', function(e){
cross.downloadSend('//m.yohobuy.com/activitylog.json?download', '');
if (_hmt && _hmt.push) {
_hmt.push(['_trackEvent', '顶部下载条目', '所有打开和下载', encodeURIComponent(e.currentTarget.getAttribute('href'))]);
}
});
var wechatDom = document.getElementById('download-wechat');
ev.addEventHandler(wechatDom, 'click', function(){
cross.downloadSend('//m.yohobuy.com/activitylog.json?attenion', '');
if (_hmt && _hmt.push) {
_hmt.push(['_trackEvent', '顶部下载条目', '微信里面关注']);
}
});
}
}
... ...