修复【uniapp】:商品详情页面,如果未登录状态下,也可以进行分享

This commit is contained in:
21世纪小八路
2024-12-08 17:11:17 +08:00
parent a2517f7fcc
commit 47a81a5f0a

View File

@@ -26,7 +26,8 @@
</view> </view>
<!-- 积分兑换价格 --> <!-- 积分兑换价格 -->
<Point v-if="!props.isActivityGoods" :flex="true" :data="props.goodsDetailData?.product" fontSize="24rpx"></Point> <Point v-if="!props.isActivityGoods" :flex="true" :data="props.goodsDetailData?.product" fontSize="24rpx">
</Point>
<view class="name-box" v-if="props.goodsDetailData?.name || props.goodsDetailData?.brief"> <view class="name-box" v-if="props.goodsDetailData?.name || props.goodsDetailData?.brief">
<view class="name">{{ props.goodsDetailData?.name }}</view> <view class="name">{{ props.goodsDetailData?.name }}</view>
@@ -80,7 +81,7 @@
import { ShareEnum } from '@/core/enum'; import { ShareEnum } from '@/core/enum';
import Point from '@/pages/components/custom-page/components/home-goods/point.vue'; import Point from '@/pages/components/custom-page/components/home-goods/point.vue';
import { handleShowToast } from '@/core/utils'; import { handleShowToast } from '@/core/utils';
import CoreshopShare from '@/components/coreshop-share/coreshop-share.vue'; import CoreshopShare from '@/components/coreshop-share/coreshop-share.vue';
import { useLoginStore } from '@/core/store'; import { useLoginStore } from '@/core/store';
/** 登录store */ /** 登录store */
@@ -102,7 +103,7 @@
}>({ }>({
isFav: false, isFav: false,
showShare: false, showShare: false,
}); });
watch(() => props.goodsDetailData, (newVla : any) => { watch(() => props.goodsDetailData, (newVla : any) => {
if (newVla) { if (newVla) {
@@ -124,9 +125,7 @@
/** 分享弹框显示与否 */ /** 分享弹框显示与否 */
const handleToggleShowShare = () => { const handleToggleShowShare = () => {
_useLoginStore.checkLogin(() => { state.showShare = !state.showShare;
state.showShare = !state.showShare;
});
} }
</script> </script>