Showing
2 changed files
with
15 additions
and
2 deletions
@@ -13,7 +13,7 @@ import {transToMiniappPath} from 'js/common/miniapp-path-rules'; | @@ -13,7 +13,7 @@ import {transToMiniappPath} from 'js/common/miniapp-path-rules'; | ||
13 | */ | 13 | */ |
14 | const jumpAction = ['go.productDetail', 'go.list', 'go.h5', 'go.shop', 'go.poollist', | 14 | const jumpAction = ['go.productDetail', 'go.list', 'go.h5', 'go.shop', 'go.poollist', |
15 | 'go.activitytemplate', 'go.collagehome', 'go.bargainlist', 'go.limitpurchase', | 15 | 'go.activitytemplate', 'go.collagehome', 'go.bargainlist', 'go.limitpurchase', |
16 | - 'go.groupProductDetail']; | 16 | + 'go.groupProductDetail', 'go.yoluckHome', 'go.yoluckDetail']; |
17 | 17 | ||
18 | class LinkHandle { | 18 | class LinkHandle { |
19 | constructor() { | 19 | constructor() { |
@@ -32,6 +32,8 @@ class LinkHandle { | @@ -32,6 +32,8 @@ class LinkHandle { | ||
32 | 32 | ||
33 | let transData = transToMiniappPath(href); | 33 | let transData = transToMiniappPath(href); |
34 | 34 | ||
35 | + console.log(transData); | ||
36 | + | ||
35 | if (jumpAction.indexOf(transData.action) >= 0) { | 37 | if (jumpAction.indexOf(transData.action) >= 0) { |
36 | // 跳转至小程序公共处理页 | 38 | // 跳转至小程序公共处理页 |
37 | this.goMiniProgram(`/pages/common/webback?url=${encodeURIComponent(href)}`); | 39 | this.goMiniProgram(`/pages/common/webback?url=${encodeURIComponent(href)}`); |
@@ -58,7 +58,18 @@ const transToMiniappPath = (href) => { | @@ -58,7 +58,18 @@ const transToMiniappPath = (href) => { | ||
58 | break; | 58 | break; |
59 | case 'go.h5': | 59 | case 'go.h5': |
60 | if (paramsObj.params && paramsObj.params.url) { | 60 | if (paramsObj.params && paramsObj.params.url) { |
61 | - path = `/pages/webview/webview?page_name=home&url=${paramsObj.params.url}${_qsStringfy(paramsObj.params.param)}`; // eslint-disable-line | 61 | + let regHome = /yoluck\/index/; |
62 | + let regDetail = /yoluck\/([0-9]\d).html/; | ||
63 | + let detailMatchResult = paramsObj.params.url.match(regDetail); | ||
64 | + | ||
65 | + if (regHome.test(paramsObj.params.url)) { | ||
66 | + paramsObj.action = 'go.yoluckHome'; | ||
67 | + } else if (detailMatchResult && detailMatchResult[1]) { | ||
68 | + paramsObj.action = 'go.yoluckDetail'; | ||
69 | + paramsObj.params.param.id = detailMatchResult[1]; | ||
70 | + } else { | ||
71 | + path = `/pages/webview/webview?page_name=home&url=${paramsObj.params.url}${_qsStringfy(paramsObj.params.param)}`; // eslint-disable-line | ||
72 | + } | ||
62 | } | 73 | } |
63 | break; | 74 | break; |
64 | case 'go.shop': | 75 | case 'go.shop': |
-
Please register or login to post a comment