Authored by 陈峰

Merge branch 'feature/links-to-other-miniapp' into 'release/6.9.0'

添加跳转其他小程序的规则



See merge request !1730
... ... @@ -3,8 +3,17 @@ import $ from 'yoho-jquery';
import tip from 'js/plugin/tip';
import {transToMiniappPath} from 'js/common/miniapp-path-rules';
/**
* go.limitpurchase = 限定频道
* go.limitpurchase (带参数lp:xxxxx) = 限定频道详情页
* go.collagehome = 福利团
* go.activitytemplate = 拼团列表
* go.productDetail (带有参数activity_type:groupPurchase) = 拼团商品详情页
* @type {[*]}
*/
const jumpAction = ['go.productDetail', 'go.list', 'go.h5', 'go.shop', 'go.poollist',
'go.activitytemplate', 'go.collagehome', 'go.bargainlist', 'go.activitytemplate'];
'go.activitytemplate', 'go.collagehome', 'go.bargainlist', 'go.limitpurchase',
'go.groupProductDetail', 'go.yoluckHome', 'go.yoluckDetail'];
class LinkHandle {
constructor() {
... ...
... ... @@ -43,8 +43,11 @@ const transToMiniappPath = (href) => {
switch (paramsObj.action) {
case 'go.productDetail': // 商品详情页
if (paramsObj.params && paramsObj.params.product_skn) {
if (paramsObj.params && paramsObj.params.product_skn &&
paramsObj.params.activity_type !== 'groupPurchase') {
path = `/pages/goodsDetail/goodsDetail?productSkn=${paramsObj.params.product_skn}&page_name=home`;
} else if (paramsObj.params.activity_type === 'groupPurchase') {
paramsObj.action = 'go.groupProductDetail';
}
break;
case 'go.list': // 列表页、专区
... ... @@ -55,7 +58,18 @@ const transToMiniappPath = (href) => {
break;
case 'go.h5':
if (paramsObj.params && paramsObj.params.url) {
path = `/pages/webview/webview?page_name=home&url=${paramsObj.params.url}${_qsStringfy(paramsObj.params.param)}`; // eslint-disable-line
let regHome = /yoluck\/index/;
let regDetail = /yoluck\/(\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':
... ...