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

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

parent cb25117c
......@@ -5,6 +5,7 @@ const hostMap = {
apiHost: `${protocol}//quantum-blocks-vcc2.liangkebang.net`,
kdspHost: `${protocol}//talos-test1.liangkebang.net`,
shenceUrl: `${protocol}//bn.xyqb.com/sa?project=default`,
mallHost: `${protocol}://mall-test1.liangkebang.net`,
test: true
};
......
......@@ -4,5 +4,6 @@ export default {
apiHost: `${protocol}//quantum-blocks.q-gp.com`,
kdspHost: `${protocol}//talos.q-gp.com`,
shenceUrl: `${protocol}//bn.xyqb.com/sa?project=production`,
mallHost: `${protocol}://mall.q-gp.com`,
test: false
};
......@@ -5,6 +5,7 @@ const hostMap = {
apiHost: `${protocol}//quantum-blocks-vcc2.liangkebang.net`,
kdspHost: `${protocol}//talos-test1.liangkebang.net`,
shenceUrl: `${protocol}//bn.xyqb.com/sa?project=default`,
mallHost: `${protocol}://mall-test1.liangkebang.net`,
test: true
};
......
......@@ -11,10 +11,7 @@
</div>
<template #reference>提示</template>
</cr-popover>
<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 v-if="showShareOverlay" class="share-overlay" @click.self="onShareOverlayClick" />
</div>
</template>
......@@ -23,24 +20,23 @@ import Bridge from '@qg/js-bridge';
import { mapGetters } from 'vuex';
import { isApp, isWxMp, isWechat, isH5Normal } from '@/service/utils.service';
import api from '@/api/editor.api';
import cfg from '@/config/index';
import localStorage from '@/service/localStorage.service';
import DisableTouchMixin from '../../../mixins/disableTouch.mixin';
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 = {
name: 'share',
txt: '',
icon: 'share',
url: '',
};
const WEAPP_PATH = 'pages/webview/webview';
const APP_PATH = 'xyqb://openHttp';
export default {
name: 'BackTop',
mixins: [DisableTouchMixin],
components: {
LaunchWeapp,
LaunchApp
},
props: {
showBackTop: Boolean
},
......@@ -73,7 +69,7 @@ export default {
return [];
},
appSchema() {
return `xyqb://openHttp?jumpUrl=${this.link}`;
return `${APP_PATH}?jumpUrl=${this.link}`;
},
shareOpenMethod() {
return this.pageInfo.shareOpenMethod;
......@@ -83,7 +79,6 @@ export default {
if (!EASY_ENV_IS_NODE) {
this.renderTpl = true;
this.jsBridge = new Bridge();
this.link = `${window.location.origin}${window.location.pathname}`;
this.getMpSchema();
this.initShareInfo();
}
......@@ -93,7 +88,7 @@ export default {
if (isH5Normal && EASY_ENV_IS_BROWSER) {
try {
const [schema] = await api.getMpSchema({
miniUrl: 'pages/webview/webview',
miniUrl: WEAPP_PATH,
params: `url=${encodeURIComponent(JSON.stringify(this.link))}`
});
this.mpSchema = schema;
......@@ -109,6 +104,10 @@ export default {
setTimeout(() => {
this.shareOpenMethod === 2 && navToDlApp();
}, 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) {
......@@ -126,6 +125,7 @@ export default {
if (EASY_ENV_IS_NODE) return;
const { coverImage, pageName, pageDescribe, shareCoverImage } = this.pageInfo;
const link = `${window.location.origin}${window.location.pathname}`;
this.link = link;
this.shareInfo = {
event: "showShareView",
data: {
......
......@@ -6,6 +6,7 @@
"passportHost": "https://passportapi-test1.liangkebang.net",
"kdspHost": "https://talos-test1.liangkebang.net",
"loginUrl": "",
"mallHost": "https://mall-test1.liangkebang.net",
"h5ShopHost": "https://tenet-test1.liangkebang.net/#"
},
"mysql": {
......
......@@ -5,6 +5,7 @@
"passportHost": "https://passportapi-test1.liangkebang.net",
"kdspHost": "https://talos-test1.liangkebang.net",
"loginUrl": "",
"mallHost": "https://mall-test1.liangkebang.net",
"h5ShopHost": "https://tenet-test1.liangkebang.net/#",
"qiniuUpHost": "https://up-z0.qiniup.com",
"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