Authored by 沈志敏

新增 下载链接

1 { 1 {
2 "name": "yas-jssdk", 2 "name": "yas-jssdk",
3 - "version": "2.3.0", 3 + "version": "2.3.1",
4 "description": "YOHO!采集系统的前端js的开发包", 4 "description": "YOHO!采集系统的前端js的开发包",
5 "keywords": [ 5 "keywords": [
6 "YOHO!", 6 "YOHO!",
@@ -45,7 +45,7 @@ var appInfo = { @@ -45,7 +45,7 @@ var appInfo = {
45 apf: window.location.search.indexOf('app_version=') >= 0 ? 'Y' : 'N' 45 apf: window.location.search.indexOf('app_version=') >= 0 ? 'Y' : 'N'
46 }; 46 };
47 47
48 -var isApp = navigator.userAgent.indexOf('app_version=') > -1 || window.location.search.indexOf('app_version=') > -1 || !!window.yohoInterface; 48 +var isApp = /yohobuy/i.test(navigator.userAgent) || /app_version=/i.test(window.location.search) || !!window.yohoInterface;
49 var isMobile = /(iPhone|Android|iPad|iPod|iOS)/i.test(navigator.userAgent); 49 var isMobile = /(iPhone|Android|iPad|iPod|iOS)/i.test(navigator.userAgent);
50 var isWechat = /micromessenger/i.test(navigator.userAgent); 50 var isWechat = /micromessenger/i.test(navigator.userAgent);
51 var ismyhbuy = /m\.yohobuy\.com/i.test(document.domain); 51 var ismyhbuy = /m\.yohobuy\.com/i.test(document.domain);
@@ -374,7 +374,9 @@ function setUnionType() { @@ -374,7 +374,9 @@ function setUnionType() {
374 for (var i = 0; i < aDom.length; i++) { 374 for (var i = 0; i < aDom.length; i++) {
375 var href = aDom[i].getAttribute('href') || ''; 375 var href = aDom[i].getAttribute('href') || '';
376 376
377 - if (href.indexOf('union.yoho.cn/union/app-downloads.html') > -1) { 377 + if (href.indexOf('union.yoho.cn/union/downapp.html') > -1
  378 + || href.indexOf('union.yoho.cn/union/app-downloads.html') > -1
  379 + || href.indexOf('union.yoho.cn/union/ClickUnionRest/addUnion4Jump') > -1) {
378 if (mktc && href.indexOf('union_type') === -1) { 380 if (mktc && href.indexOf('union_type') === -1) {
379 href += '?union_type=' + mktc; 381 href += '?union_type=' + mktc;
380 aDom[i].setAttribute('href', href); 382 aDom[i].setAttribute('href', href);