Authored by 陈峰

Merge branch 'feature/miniappLink' into 'release/6.8.5'

Feature/miniapp link

小程序链接跳转

See merge request !1675
... ... @@ -131,7 +131,7 @@ module.exports = {
notifyUrl: domains.service + 'payment/weixin_notify',
},
geetestJs: '//static.geetest.com/static/tools/gt.js',
jsSdk: '//cdn.yoho.cn/js-sdk/1.3.16/jssdk.js',
jsSdk: '//cdn.yoho.cn/js-sdk/1.3.17/jssdk.js',
redis: {
connect: {
host: '192.168.102.49',
... ...
... ... @@ -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();
}
... ...