...
|
...
|
@@ -3,6 +3,9 @@ import $ from 'yoho-jquery'; |
|
|
import tip from 'js/plugin/tip';
|
|
|
import {transToMiniappPath} from 'js/common/miniapp-path-rules';
|
|
|
|
|
|
const jumpAction = ['go.productDetail', 'go.list', 'go.shop', 'go.poollist',
|
|
|
'go.activitytemplate', 'go.collagehome', 'go.bargainlist', 'go.activitytemplate'];
|
|
|
|
|
|
class LinkHandle {
|
|
|
constructor() {
|
|
|
$(document).delegate('a:not(.yoho-coin, .yoho-conpon)', 'click', event => {
|
...
|
...
|
@@ -14,9 +17,18 @@ class LinkHandle { |
|
|
}
|
|
|
|
|
|
if (href.indexOf('#') !== 0) {
|
|
|
let path = this.transToPath(href);
|
|
|
// let path = this.transToPath(href);
|
|
|
|
|
|
// this.goMiniProgram(path);
|
|
|
|
|
|
let transData = transToMiniappPath(href);
|
|
|
|
|
|
this.goMiniProgram(path);
|
|
|
if (jumpAction.indexOf(transData.action) >= 0) {
|
|
|
// 跳转至小程序公共处理页
|
|
|
this.goMiniProgram(`/pages/common/webback?url=${encodeURIComponent(href)}`);
|
|
|
} else {
|
|
|
tip.show('暂不支持,请使用Yoho!buy有货APP选购');
|
|
|
}
|
|
|
|
|
|
event.preventDefault();
|
|
|
}
|
...
|
...
|
|