...
|
...
|
@@ -15,6 +15,21 @@ import tip from 'common/tip'; |
|
|
/* 空方法 */
|
|
|
const nullFun = () => {};
|
|
|
|
|
|
let isYohoBuy = /YohoBuy/i.test(navigator.userAgent || '');
|
|
|
|
|
|
let $appLink = document.querySelector('#yoho-app-link');
|
|
|
|
|
|
if (isYohoBuy && !$appLink) {
|
|
|
let body = document.querySelector('body');
|
|
|
|
|
|
$appLink = document.createElement('a');
|
|
|
$appLink.id = 'yoho-app-link';
|
|
|
$appLink.href = 'javascript:;';
|
|
|
$appLink.style.display = 'none';
|
|
|
|
|
|
body.appendChild($appLink);
|
|
|
}
|
|
|
|
|
|
/* 提示信息 */
|
|
|
const tipInfo = '暂不支持,请在BLK应用中打开';
|
|
|
const yoho = {
|
...
|
...
|
@@ -24,7 +39,7 @@ const yoho = { |
|
|
isApp: /yh_blk/i.test(navigator.userAgent || '') || /YH_BLK/i.test(navigator.userAgent || ''),
|
|
|
isiOS: /\(i[^;]+;( U;)? CPU.+Mac OS X/i.test(navigator.userAgent || ''),
|
|
|
isAndroid: /Android/i.test(navigator.userAgent || ''),
|
|
|
isYohoBuy: /YohoBuy/i.test(navigator.userAgent || ''),
|
|
|
isYohoBuy: isYohoBuy,
|
|
|
|
|
|
/**
|
|
|
* store
|
...
|
...
|
@@ -190,6 +205,24 @@ const yoho = { |
|
|
method: 'go.newPage',
|
|
|
arguments: args
|
|
|
});
|
|
|
} if (this.isYohoBuy) {
|
|
|
let url = args.url;
|
|
|
|
|
|
// if (url.indexOf('openby:') < 0) {
|
|
|
// delete args.url;
|
|
|
// url += '&openby:yohobuy=' + JSON.stringify({
|
|
|
// action: 'go.h5',
|
|
|
// params: {
|
|
|
// islogin: 'N',
|
|
|
// type: 0,
|
|
|
// updateflag: Date.now() + '',
|
|
|
// url: args.url,
|
|
|
// param: args
|
|
|
// }
|
|
|
// });
|
|
|
// }
|
|
|
$appLink.attr('href', url);
|
|
|
$appLink[0].click();
|
|
|
} else {
|
|
|
if (args.url) {
|
|
|
window.open(args.url);
|
...
|
...
|
@@ -437,4 +470,5 @@ const yoho = { |
|
|
}
|
|
|
};
|
|
|
|
|
|
|
|
|
export default yoho; |
...
|
...
|
|