Authored by 邱骏

增加yoluck规则

... ... @@ -13,7 +13,7 @@ import {transToMiniappPath} from 'js/common/miniapp-path-rules';
*/
const jumpAction = ['go.productDetail', 'go.list', 'go.h5', 'go.shop', 'go.poollist',
'go.activitytemplate', 'go.collagehome', 'go.bargainlist', 'go.limitpurchase',
'go.groupProductDetail'];
'go.groupProductDetail', 'go.yoluckHome', 'go.yoluckDetail'];
class LinkHandle {
constructor() {
... ... @@ -32,6 +32,8 @@ class LinkHandle {
let transData = transToMiniappPath(href);
console.log(transData);
if (jumpAction.indexOf(transData.action) >= 0) {
// 跳转至小程序公共处理页
this.goMiniProgram(`/pages/common/webback?url=${encodeURIComponent(href)}`);
... ...
... ... @@ -58,8 +58,19 @@ const transToMiniappPath = (href) => {
break;
case 'go.h5':
if (paramsObj.params && paramsObj.params.url) {
let regHome = /yoluck\/index/;
let regDetail = /yoluck\/([0-9]\d).html/;
let detailMatchResult = paramsObj.params.url.match(regDetail);
if (regHome.test(paramsObj.params.url)) {
paramsObj.action = 'go.yoluckHome';
} else if (detailMatchResult && detailMatchResult[1]) {
paramsObj.action = 'go.yoluckDetail';
paramsObj.params.param.id = detailMatchResult[1];
} else {
path = `/pages/webview/webview?page_name=home&url=${paramsObj.params.url}${_qsStringfy(paramsObj.params.param)}`; // eslint-disable-line
}
}
break;
case 'go.shop':
path = `/pages/goodsList/brandStore?shopId=${paramsObj.params.shop_id}`;
... ...