Commit 96b55162 authored by 郭志伟's avatar 郭志伟

fix(backtop): 添加中转页跳转逻辑

parent cb25117c
...@@ -5,6 +5,7 @@ const hostMap = { ...@@ -5,6 +5,7 @@ const hostMap = {
apiHost: `${protocol}//quantum-blocks-vcc2.liangkebang.net`, apiHost: `${protocol}//quantum-blocks-vcc2.liangkebang.net`,
kdspHost: `${protocol}//talos-test1.liangkebang.net`, kdspHost: `${protocol}//talos-test1.liangkebang.net`,
shenceUrl: `${protocol}//bn.xyqb.com/sa?project=default`, shenceUrl: `${protocol}//bn.xyqb.com/sa?project=default`,
mallHost: `${protocol}://mall-test1.liangkebang.net`,
test: true test: true
}; };
......
...@@ -4,5 +4,6 @@ export default { ...@@ -4,5 +4,6 @@ export default {
apiHost: `${protocol}//quantum-blocks.q-gp.com`, apiHost: `${protocol}//quantum-blocks.q-gp.com`,
kdspHost: `${protocol}//talos.q-gp.com`, kdspHost: `${protocol}//talos.q-gp.com`,
shenceUrl: `${protocol}//bn.xyqb.com/sa?project=production`, shenceUrl: `${protocol}//bn.xyqb.com/sa?project=production`,
mallHost: `${protocol}://mall.q-gp.com`,
test: false test: false
}; };
...@@ -5,6 +5,7 @@ const hostMap = { ...@@ -5,6 +5,7 @@ const hostMap = {
apiHost: `${protocol}//quantum-blocks-vcc2.liangkebang.net`, apiHost: `${protocol}//quantum-blocks-vcc2.liangkebang.net`,
kdspHost: `${protocol}//talos-test1.liangkebang.net`, kdspHost: `${protocol}//talos-test1.liangkebang.net`,
shenceUrl: `${protocol}//bn.xyqb.com/sa?project=default`, shenceUrl: `${protocol}//bn.xyqb.com/sa?project=default`,
mallHost: `${protocol}://mall-test1.liangkebang.net`,
test: true test: true
}; };
......
...@@ -11,10 +11,7 @@ ...@@ -11,10 +11,7 @@
</div> </div>
<template #reference>提示</template> <template #reference>提示</template>
</cr-popover> </cr-popover>
<div v-if="showShareOverlay" class="share-overlay" @click.self="onShareOverlayClick"> <div v-if="showShareOverlay" class="share-overlay" @click.self="onShareOverlayClick" />
<launch-weapp :jump-url="mpSchema" v-if="isWechat && shareOpenMethod === 1" />
<launch-app :jump-url="link" :app-schema="appSchema" v-if="isWechat && shareOpenMethod === 2" />
</div>
</div> </div>
</template> </template>
...@@ -23,24 +20,23 @@ import Bridge from '@qg/js-bridge'; ...@@ -23,24 +20,23 @@ import Bridge from '@qg/js-bridge';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { isApp, isWxMp, isWechat, isH5Normal } from '@/service/utils.service'; import { isApp, isWxMp, isWechat, isH5Normal } from '@/service/utils.service';
import api from '@/api/editor.api'; import api from '@/api/editor.api';
import cfg from '@/config/index';
import localStorage from '@/service/localStorage.service'; import localStorage from '@/service/localStorage.service';
import DisableTouchMixin from '../../../mixins/disableTouch.mixin'; import DisableTouchMixin from '../../../mixins/disableTouch.mixin';
import { navToDlApp } from '@qg/citrus-ui/src/helper/service/utils'; import { navToDlApp } from '@qg/citrus-ui/src/helper/service/utils';
import LaunchWeapp from './components/LaunchWeapp.vue';
import LaunchApp from './components/LaunchApp.vue';
const SHARE_CONFIG = { const SHARE_CONFIG = {
name: 'share', name: 'share',
txt: '', txt: '',
icon: 'share', icon: 'share',
url: '', url: '',
}; };
const WEAPP_PATH = 'pages/webview/webview';
const APP_PATH = 'xyqb://openHttp';
export default { export default {
name: 'BackTop', name: 'BackTop',
mixins: [DisableTouchMixin], mixins: [DisableTouchMixin],
components: {
LaunchWeapp,
LaunchApp
},
props: { props: {
showBackTop: Boolean showBackTop: Boolean
}, },
...@@ -73,7 +69,7 @@ export default { ...@@ -73,7 +69,7 @@ export default {
return []; return [];
}, },
appSchema() { appSchema() {
return `xyqb://openHttp?jumpUrl=${this.link}`; return `${APP_PATH}?jumpUrl=${this.link}`;
}, },
shareOpenMethod() { shareOpenMethod() {
return this.pageInfo.shareOpenMethod; return this.pageInfo.shareOpenMethod;
...@@ -83,7 +79,6 @@ export default { ...@@ -83,7 +79,6 @@ export default {
if (!EASY_ENV_IS_NODE) { if (!EASY_ENV_IS_NODE) {
this.renderTpl = true; this.renderTpl = true;
this.jsBridge = new Bridge(); this.jsBridge = new Bridge();
this.link = `${window.location.origin}${window.location.pathname}`;
this.getMpSchema(); this.getMpSchema();
this.initShareInfo(); this.initShareInfo();
} }
...@@ -93,7 +88,7 @@ export default { ...@@ -93,7 +88,7 @@ export default {
if (isH5Normal && EASY_ENV_IS_BROWSER) { if (isH5Normal && EASY_ENV_IS_BROWSER) {
try { try {
const [schema] = await api.getMpSchema({ const [schema] = await api.getMpSchema({
miniUrl: 'pages/webview/webview', miniUrl: WEAPP_PATH,
params: `url=${encodeURIComponent(JSON.stringify(this.link))}` params: `url=${encodeURIComponent(JSON.stringify(this.link))}`
}); });
this.mpSchema = schema; this.mpSchema = schema;
...@@ -109,6 +104,10 @@ export default { ...@@ -109,6 +104,10 @@ export default {
setTimeout(() => { setTimeout(() => {
this.shareOpenMethod === 2 && navToDlApp(); this.shareOpenMethod === 2 && navToDlApp();
}, 2000); }, 2000);
} else if (isWechat && !isWxMp) {
const { shareOpenMethod, link } = this;
const jumpUrl = shareOpenMethod === 1 ? WEAPP_PATH : APP_PATH;
window.location.href = `${cfg.mallHost}/common/launch?jumpUrl=${jumpUrl}&terminal=${shareOpenMethod}&extraInfo=${encodeURIComponent(JSON.stringify({ link }))}`;
} }
}, },
handleBackTopClick(e) { handleBackTopClick(e) {
...@@ -126,6 +125,7 @@ export default { ...@@ -126,6 +125,7 @@ export default {
if (EASY_ENV_IS_NODE) return; if (EASY_ENV_IS_NODE) return;
const { coverImage, pageName, pageDescribe, shareCoverImage } = this.pageInfo; const { coverImage, pageName, pageDescribe, shareCoverImage } = this.pageInfo;
const link = `${window.location.origin}${window.location.pathname}`; const link = `${window.location.origin}${window.location.pathname}`;
this.link = link;
this.shareInfo = { this.shareInfo = {
event: "showShareView", event: "showShareView",
data: { data: {
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
"passportHost": "https://passportapi-test1.liangkebang.net", "passportHost": "https://passportapi-test1.liangkebang.net",
"kdspHost": "https://talos-test1.liangkebang.net", "kdspHost": "https://talos-test1.liangkebang.net",
"loginUrl": "", "loginUrl": "",
"mallHost": "https://mall-test1.liangkebang.net",
"h5ShopHost": "https://tenet-test1.liangkebang.net/#" "h5ShopHost": "https://tenet-test1.liangkebang.net/#"
}, },
"mysql": { "mysql": {
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
"passportHost": "https://passportapi-test1.liangkebang.net", "passportHost": "https://passportapi-test1.liangkebang.net",
"kdspHost": "https://talos-test1.liangkebang.net", "kdspHost": "https://talos-test1.liangkebang.net",
"loginUrl": "", "loginUrl": "",
"mallHost": "https://mall-test1.liangkebang.net",
"h5ShopHost": "https://tenet-test1.liangkebang.net/#", "h5ShopHost": "https://tenet-test1.liangkebang.net/#",
"qiniuUpHost": "https://up-z0.qiniup.com", "qiniuUpHost": "https://up-z0.qiniup.com",
"qiniuHost": "https://appsync.lkbang.net" "qiniuHost": "https://appsync.lkbang.net"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment