Commit 62723cca authored by 郭志伟's avatar 郭志伟

fix(backtop): 获取分享地址判断调整

parent a3fd3b6a
...@@ -8,9 +8,10 @@ export default { ...@@ -8,9 +8,10 @@ export default {
getShopCartCount() { getShopCartCount() {
return http.get(`${config.kdspHost}/api/kdsp/shop-cart/count`); return http.get(`${config.kdspHost}/api/kdsp/shop-cart/count`);
}, },
getMpSchema(params, appId) { getMpSchema(params, appId, tenantId) {
return http.post(`${config.kdspHost}/api/kdsp/ka/info/getShareMiniUrl`, params, { emulateJSON: true, headers: { return http.post(`${config.kdspHost}/api/kdsp/ka/info/getShareMiniUrl`, params, { emulateJSON: true, headers: {
'mini-app-id': appId 'mini-app-id': appId,
'qg-tenant-id': tenantId
} }); } });
}, },
getWxConfig(url = window.location.href.split('#')[0]) { getWxConfig(url = window.location.href.split('#')[0]) {
......
...@@ -48,13 +48,15 @@ export default { ...@@ -48,13 +48,15 @@ export default {
mpSchema: '', mpSchema: '',
link: '', link: '',
shareInfo: {}, shareInfo: {},
wxAppId: cfg.appIdMap[+localStorage.get('tenantId')],
showShareOverlay: ((isWechat && !isWxMp) || isH5Normal) && !(localStorage.get('vccChannel') || localStorage.get('tenantId')), showShareOverlay: ((isWechat && !isWxMp) || isH5Normal) && !(localStorage.get('vccChannel') || localStorage.get('tenantId')),
isWechat isWechat
}; };
}, },
computed: { computed: {
...mapGetters(['pageData', 'pageInfo']), ...mapGetters(['pageData', 'pageInfo']),
wxAppId() {
return cfg.appIdMap[this.pageInfo.tenantId] || '';
},
backTopList() { backTopList() {
const btAttachVal = this.pageData.props?.btAttachVal || []; const btAttachVal = this.pageData.props?.btAttachVal || [];
if (isDef(this.cartIndex) && this.cartIndex !== -1 && btAttachVal.length) { if (isDef(this.cartIndex) && this.cartIndex !== -1 && btAttachVal.length) {
...@@ -108,10 +110,11 @@ export default { ...@@ -108,10 +110,11 @@ export default {
async getMpSchema() { async getMpSchema() {
if (isH5Normal && EASY_ENV_IS_BROWSER && this.wxAppId) { if (isH5Normal && EASY_ENV_IS_BROWSER && this.wxAppId) {
try { try {
console.log(this.pageInfo.tenantId);
const [schema] = await api.getMpSchema({ const [schema] = await api.getMpSchema({
miniUrl: WEAPP_PATH, miniUrl: WEAPP_PATH,
params: `url=${encodeURIComponent(JSON.stringify(this.link))}` params: `url=${encodeURIComponent(JSON.stringify(this.link))}`
}, this.wxAppId); }, this.wxAppId, this.pageInfo.tenantId);
this.mpSchema = schema; this.mpSchema = schema;
} catch (error) { } catch (error) {
......
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