修复分享问题

This commit is contained in:
2026-01-22 11:36:49 +08:00
parent 2afc2f9fab
commit 9037e205a0
7 changed files with 109 additions and 81 deletions

View File

@@ -70,7 +70,7 @@
v-else-if="item1.isTemporary &&item1.productName=='签子'"
src="https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/5/b97054debd83486ab7ad8e20ca6a360a.png"
></u-image>
<u-image width="112" height="112" radius="20"
<u-image width="56" height="56" radius="10"
:src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/table.png'"
mode="heightFix" v-else></u-image>
<text class="productName"> {{ item1.productName }} </text>
@@ -151,7 +151,7 @@
uni.cache.set("shopId", item.shopId);
uni.navigateTo({
url: "/pages/product/index?type=beforehand&order_id=" + item.id +
'&one_more_order=1',
'&one_more_order=1&shopId='+item.shopId,
});
}
})

View File

@@ -2456,10 +2456,10 @@
shareMixin,
handleMixinOnLoad,
returnQuery,
jsonToUrl,wxShare,
jsonToUrl,
wxShare,
returnCommonQuery
} from '@/utils/share.js'
import { onShareTimeline } from '@dcloudio/uni-app';
// defineOptions({
// mixins: [shareMixin],
// });
@@ -2470,21 +2470,22 @@ import { onShareTimeline } from '@dcloudio/uni-app';
function shareClick() {
isGoodsShare.value = true
}
async function onShare(){
async function onShare() {
const queryJson = await returnCommonQuery()
let query = jsonToUrl(queryJson)
query += '&type=beforehand'
let json={}
let json = {}
const shopName = uni.cache.get('shopInfo').shopName || ''
if (goodsModalList.value.length && isGoodsShare.value) {
const goods = goodsModalList.value[goodsModalList.value.length - 1].goods
query += '&showGoodsId=' + goods.id
json.title = goods.name
json.title = goods.name + (shopName ? `-${shopName}` : '')
json.imageUrl = goods.coverImg
json.showGoodsId = goods.id
}else{
json.title=uni.cache.get('shopInfo').shopName||''
json.imageUrl=uni.cache.get('shopInfo').logo||''
} else {
json.title = shopName
json.imageUrl = uni.cache.get('shopInfo').logo || ''
}
console.log('onShareAppMessage', {
query,
@@ -2497,9 +2498,9 @@ import { onShareTimeline } from '@dcloudio/uni-app';
path: '/pages/product/index' + '?' + query
})
}
onShareAppMessage(onShare)
onShareTimeline(onShare)
const pageOptions = reactive({})
@@ -2513,7 +2514,6 @@ import { onShareTimeline } from '@dcloudio/uni-app';
shopId: e.shopId || uni.cache.get('shopId')
})
const userInfo = userStore.userInfo
const shopInfoRes = userStore.shopInfo
// //获取用户信息
// const userInfo = await APIshopUserInfo({
// shopId: uni.cache.get('shopId')
@@ -2522,9 +2522,7 @@ import { onShareTimeline } from '@dcloudio/uni-app';
// const shopInfoRes = await APIusershopInfodetail({
// shopId: uni.cache.get('shopId')
// });
if (shopInfoRes && shopInfoRes.shopInfo) {
Object.assign(shopInfo, shopInfoRes.shopInfo);
}
Object.assign(shopInfo, userStore.shopInfo);
if (userInfo && typeof userInfo === 'object') {
@@ -2661,7 +2659,7 @@ import { onShareTimeline } from '@dcloudio/uni-app';
useSocket.setOnMessage(() => {});
}
onHide(() => {
isGoodsShare.value=false
isGoodsShare.value = false
closeSocket();
});
onUnload(() => {