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