Authored by 陈峰

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

Feature/miniapp link

小程序链接跳转

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