增加公共分享组件

This commit is contained in:
2026-01-21 10:26:05 +08:00
parent 67ae138033
commit 654ed39854
6 changed files with 57 additions and 18 deletions

View File

@@ -63,8 +63,8 @@ export function wxShare(par) {
}
export async function returnQuery(query) {
const shopId = uni.cache.get('shopId')
const shopUserInfo = uni.cache.get('shopUserInfo')
const shopInfo = uni.cache.get('shopInfo')
@@ -72,13 +72,13 @@ export async function returnQuery(query) {
shopId: shopId,
shopUserId: shopUserInfo.id
})
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
const currentPath = currentPage.route;
const currentOptions = currentPage.options;
let sharePath = `/${currentPath}`;
const queryJson = {
inviteCode: (inviteCode && inviteCode !== true) ? inviteCode : null,
@@ -94,7 +94,7 @@ export async function returnQuery(query) {
queryJson.shopId = shopId
queryJson.inviteCode = (inviteCode && inviteCode !== true) ? inviteCode : null
queryJson.shopUserId = shopUserInfo.id
let result = ''
for (let key in queryJson) {
if (queryJson[key]) {
@@ -240,10 +240,10 @@ export const shareMixin = {
...defaultShareConfig,
...pageShareConfig
})
return {
return wxShare({
...defaultShareConfig,
...pageShareConfig
};
});
},
@@ -289,9 +289,9 @@ export const shareMixin = {
};
const pageTimelineConfig = this.$options.shareTimelineConfig || {};
return {
return wxShare({
...defaultTimelineConfig,
...pageTimelineConfig
};
});
}
};