mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2026-02-05 00:49:49 +08:00
【修复】(首页模块快):修复购买记录组件报错
This commit is contained in:
@@ -89,7 +89,7 @@
|
|||||||
<text class="price">¥{{ state.cartMoney }}</text>
|
<text class="price">¥{{ state.cartMoney }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="btn-buy" @click="handleRouteSwitchTab(RouteSwitchTabEnum.cart)">
|
<view class="btn-buy" @click="handleGoPay">
|
||||||
去结算
|
去结算
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -124,6 +124,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive, watch, ref, onMounted, getCurrentInstance, nextTick } from 'vue';
|
import { reactive, watch, ref, onMounted, getCurrentInstance, nextTick } from 'vue';
|
||||||
|
import { onShow } from '@dcloudio/uni-app';
|
||||||
import { advertPosition, UserToken } from '@/core/consts';
|
import { advertPosition, UserToken } from '@/core/consts';
|
||||||
import { queryGoodsPageList, queryCartNumAndMoney, queryGoodsDetailByToken, queryGoodsDetail, queryAddCart } from '@/core/api';
|
import { queryGoodsPageList, queryCartNumAndMoney, queryGoodsDetailByToken, queryGoodsDetail, queryAddCart } from '@/core/api';
|
||||||
import type { CategoriesType, Response, GoodsListType, GoodsType } from '@/core/models';
|
import type { CategoriesType, Response, GoodsListType, GoodsType } from '@/core/models';
|
||||||
@@ -201,11 +202,7 @@
|
|||||||
state.rightTabList = state.classifyData[0]?.child[0]?.child;
|
state.rightTabList = state.classifyData[0]?.child[0]?.child;
|
||||||
|
|
||||||
state.catId = state.classifyData[0].child[0]?.id;
|
state.catId = state.classifyData[0].child[0]?.id;
|
||||||
getGoodsPageList();
|
getGoodsPageList();
|
||||||
|
|
||||||
if (uni.getStorageSync(UserToken)) {
|
|
||||||
getCartNumAndMoney();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -218,7 +215,13 @@
|
|||||||
}, 100)
|
}, 100)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
onShow(()=>{
|
||||||
|
if (uni.getStorageSync(UserToken)) {
|
||||||
|
getCartNumAndMoney();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// 获取商品列表数据
|
// 获取商品列表数据
|
||||||
const getGoodsPageList = async () => {
|
const getGoodsPageList = async () => {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
@@ -258,7 +261,16 @@
|
|||||||
state.goodsDetailData = goodsDetail.data;
|
state.goodsDetailData = goodsDetail.data;
|
||||||
state.showSku = true;
|
state.showSku = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 底部按钮去结算 */
|
||||||
|
const handleGoPay = () => {
|
||||||
|
if (!uni.getStorageSync(UserToken)) {
|
||||||
|
emits('handleShowLoginPopup');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
handleRouteSwitchTab(RouteSwitchTabEnum.cart);
|
||||||
|
}
|
||||||
|
|
||||||
/** 添加购物车 */
|
/** 添加购物车 */
|
||||||
const handleAddCart = async ({ productId, nums } : any) => {
|
const handleAddCart = async ({ productId, nums } : any) => {
|
||||||
if (!uni.getStorageSync(UserToken)) {
|
if (!uni.getStorageSync(UserToken)) {
|
||||||
|
|||||||
@@ -60,7 +60,7 @@
|
|||||||
<text class="price">¥{{ state.cartMoney }}</text>
|
<text class="price">¥{{ state.cartMoney }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="btn-buy" @click="handleRouteSwitchTab(RouteSwitchTabEnum.cart)">
|
<view class="btn-buy" @click="handleGoPay">
|
||||||
去结算
|
去结算
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -76,6 +76,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive, watch } from 'vue';
|
import { reactive, watch } from 'vue';
|
||||||
|
import { onShow } from '@dcloudio/uni-app';
|
||||||
import { advertPosition } from '@/core/consts';
|
import { advertPosition } from '@/core/consts';
|
||||||
import { queryGoodsPageList, queryCartNumAndMoney, queryGoodsDetailByToken, queryGoodsDetail, queryAddCart } from '@/core/api';
|
import { queryGoodsPageList, queryCartNumAndMoney, queryGoodsDetailByToken, queryGoodsDetail, queryAddCart } from '@/core/api';
|
||||||
import type { CategoriesType, Response, GoodsListType, GoodsType } from '@/core/models';
|
import type { CategoriesType, Response, GoodsListType, GoodsType } from '@/core/models';
|
||||||
@@ -117,9 +118,9 @@
|
|||||||
showSku: false,
|
showSku: false,
|
||||||
goodsDetailData: {},
|
goodsDetailData: {},
|
||||||
});
|
});
|
||||||
|
|
||||||
const emits = defineEmits(['handleShowLoginPopup']);
|
const emits = defineEmits(['handleShowLoginPopup']);
|
||||||
|
|
||||||
watch(() => props.data, (newVal : Array<CategoriesType>) => {
|
watch(() => props.data, (newVal : Array<CategoriesType>) => {
|
||||||
if (newVal) {
|
if (newVal) {
|
||||||
state.classifyData = newVal.map((item : CategoriesType) => {
|
state.classifyData = newVal.map((item : CategoriesType) => {
|
||||||
@@ -135,13 +136,15 @@
|
|||||||
state.rightTabList = state.classifyData[0]?.child;
|
state.rightTabList = state.classifyData[0]?.child;
|
||||||
|
|
||||||
getGoodsPageList();
|
getGoodsPageList();
|
||||||
|
|
||||||
if (uni.getStorageSync(UserToken)) {
|
|
||||||
getCartNumAndMoney();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
onShow(() => {
|
||||||
|
if (uni.getStorageSync(UserToken)) {
|
||||||
|
getCartNumAndMoney();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
/** 获取商品列表数据 */
|
/** 获取商品列表数据 */
|
||||||
const getGoodsPageList = async () => {
|
const getGoodsPageList = async () => {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
@@ -182,6 +185,15 @@
|
|||||||
state.showSku = true;
|
state.showSku = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 底部按钮去结算 */
|
||||||
|
const handleGoPay = () => {
|
||||||
|
if (!uni.getStorageSync(UserToken)) {
|
||||||
|
emits('handleShowLoginPopup');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
handleRouteSwitchTab(RouteSwitchTabEnum.cart);
|
||||||
|
}
|
||||||
|
|
||||||
/** 添加购物车 */
|
/** 添加购物车 */
|
||||||
const handleAddCart = async ({ productId, nums } : any) => {
|
const handleAddCart = async ({ productId, nums } : any) => {
|
||||||
if (!uni.getStorageSync(UserToken)) {
|
if (!uni.getStorageSync(UserToken)) {
|
||||||
|
|||||||
@@ -69,27 +69,25 @@
|
|||||||
height: 0,
|
height: 0,
|
||||||
keyWord: "",
|
keyWord: "",
|
||||||
showLoginModal: false,
|
showLoginModal: false,
|
||||||
})
|
})
|
||||||
const getAllCategories = async () => {
|
|
||||||
const allCategories : Response<Array<CategoriesType>> = await queryAllCategories();
|
onMounted(async () => {
|
||||||
state.categoriesList = allCategories.data || [];
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(async () => {
|
|
||||||
getAllCategories();
|
getAllCategories();
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
// 屏幕总高度 - 顶部tab栏高度 - 顶部安全高度 - 底部安全高度 - 底部tabBar的默认高度50(如果修改了配置高度这里也要同步修改)
|
// 屏幕总高度 - 顶部tab栏高度 - 顶部安全高度 - 底部安全高度 - 底部tabBar的默认高度50(如果修改了配置高度这里也要同步修改)
|
||||||
state.height = systemInfo.value.screenHeight - systemInfo.value.statusBarHeight - (systemInfo.value.system?.includes('iOS') ? 44 : 48) - systemInfo.value.safeAreaInsets?.bottom - 50;
|
state.height = systemInfo.value.screenHeight - systemInfo.value.statusBarHeight - (systemInfo.value.system?.includes('iOS') ? 44 : 48) - systemInfo.value.safeAreaInsets?.bottom - 50;
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/** 获取购物车数量价格 */
|
||||||
|
const getAllCategories = async () => {
|
||||||
|
const allCategories : Response<Array<CategoriesType>> = await queryAllCategories();
|
||||||
|
state.categoriesList = allCategories.data || [];
|
||||||
|
}
|
||||||
|
|
||||||
/** 搜索 */
|
/** 搜索 */
|
||||||
const handleSearch = () => {
|
const handleSearch = () => {
|
||||||
if (state.keyWord) {
|
handleRouteNavigateTo(`/pages/subpackage/category/category?key=${state.keyWord}`);
|
||||||
handleRouteNavigateTo(`/pages/subpackage/category/category?key=${state.keyWord}`);
|
|
||||||
} else {
|
|
||||||
handleShowToast('请输入搜索内容');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 显示登录弹框 */
|
/** 显示登录弹框 */
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<view class="title-icon">
|
<view class="title-icon">
|
||||||
<text class="tit">{{ props.data.list[0].title }}</text>
|
<text class="tit">{{ props.data.list[0].title }}</text>
|
||||||
</view>
|
</view>
|
||||||
<coreshop-view-more @hanldeClickViewMore="hanldeClickViewMore" />
|
<coreshop-view-more @hanldeClickViewMore="hanldeClickViewMore" title="查看详情" />
|
||||||
</view>
|
</view>
|
||||||
<view class="m-t-25" v-for="item, index in props.data.list" :key="index">
|
<view class="m-t-25" v-for="item, index in props.data.list" :key="index">
|
||||||
<coreshop-article :data="hanldeCombinationArticleData(item)"
|
<coreshop-article :data="hanldeCombinationArticleData(item)"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<coreshop-view-more @hanldeClickViewMore="hanldeClickViewMore"></coreshop-view-more>
|
<coreshop-view-more @hanldeClickViewMore="hanldeClickViewMore"></coreshop-view-more>
|
||||||
</view>
|
</view>
|
||||||
<view class="coupon-card-box">
|
<view class="coupon-card-box">
|
||||||
<scroll-view :scroll-x="true" enable-flex class="scroll-box">
|
<scroll-view :scroll-x="true" class="scroll-box" :enable-flex="true">
|
||||||
<view class="card-box" v-for="item, index in props.data?.list?.slice(0, props.data.limit)"
|
<view class="card-box" v-for="item, index in props.data?.list?.slice(0, props.data.limit)"
|
||||||
:key="index">
|
:key="index">
|
||||||
<image class="coupon-bg" :src="handleStaticResources('/static/images/coupon-bg.jpg')"></image>
|
<image class="coupon-bg" :src="handleStaticResources('/static/images/coupon-bg.jpg')"></image>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<template v-if="props.data?.style != 0">
|
<template v-if="props.data?.style != 0">
|
||||||
<view :class="['img-box', `img-box-${props.data?.style}`]">
|
<view :class="['img-box', `img-box-${props.data?.style}`]">
|
||||||
<view class="img-item" v-for="item, index in props.data.list" :key="index"
|
<view class="img-item" v-for="item, index in props.data.list" :key="index"
|
||||||
:style="{ 'padding': `${props.data.margin / 2}px` }">
|
:style="{ 'padding': `${props.data.margin / 2}px` }" @click="handleAdvertiseDetail(item?.linkType, item?.linkValue)">
|
||||||
<image class="img" :src="item.image || handleStaticResources('/static/images/common/empty.png')"
|
<image class="img" :src="item.image || handleStaticResources('/static/images/common/empty.png')"
|
||||||
mode="widthFix"></image>
|
mode="widthFix"></image>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.pintuan-box {
|
.pintuan-list {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<coreshop-view-more @hanldeClickViewMore="hanldeClickViewMore" color="#fff"
|
<coreshop-view-more @hanldeClickViewMore="hanldeClickViewMore" color="#fff"
|
||||||
:icon="handleStaticResources('/static/images/icon/icon-rigth-fff.png')" />
|
:icon="handleStaticResources('/static/images/icon/icon-rigth-fff.png')" />
|
||||||
</view>
|
</view>
|
||||||
<scroll-view :scroll-x="true" enable-flex class="m-t-25 pintuan-box">
|
<scroll-view :scroll-x="true" class="m-t-25 pintuan-list" :enable-flex="true">
|
||||||
<view v-for="item, index in props.data.list" :key="index" class="card-box">
|
<view v-for="item, index in props.data.list" :key="index" class="card-box">
|
||||||
<coreshop-goods-card imgWidth="290rpx" imgHeight="290rpx" type="vertical"
|
<coreshop-goods-card imgWidth="290rpx" imgHeight="290rpx" type="vertical"
|
||||||
:goodsData="hanldeCombinationGoodsData(item)" @hanldeClickGoods="hanldeClickGoods">
|
:goodsData="hanldeCombinationGoodsData(item)" @hanldeClickGoods="hanldeClickGoods">
|
||||||
|
|||||||
@@ -81,7 +81,8 @@
|
|||||||
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 { UserToken } from '@/core/consts'
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
goodsDetailData : any,
|
goodsDetailData : any,
|
||||||
isActivityGoods : boolean,
|
isActivityGoods : boolean,
|
||||||
@@ -99,7 +100,9 @@
|
|||||||
isFav: false,
|
isFav: false,
|
||||||
showShare: false,
|
showShare: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const emits = defineEmits(['handleShowLoginPopup']);
|
||||||
|
|
||||||
watch(() => props.goodsDetailData, (newVla : any) => {
|
watch(() => props.goodsDetailData, (newVla : any) => {
|
||||||
if (newVla) {
|
if (newVla) {
|
||||||
state.isFav = newVla.isFav;
|
state.isFav = newVla.isFav;
|
||||||
@@ -107,6 +110,11 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
const handleToggleGoodsCollection = async () => {
|
const handleToggleGoodsCollection = async () => {
|
||||||
|
if (!uni.getStorageSync(UserToken)) {
|
||||||
|
emits('handleShowLoginPopup');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const goodsCollection = await queryGoodsCollection({ id: props.goodsDetailData.id });
|
const goodsCollection = await queryGoodsCollection({ id: props.goodsDetailData.id });
|
||||||
if (goodsCollection.status) {
|
if (goodsCollection.status) {
|
||||||
state.isFav = !state.isFav;
|
state.isFav = !state.isFav;
|
||||||
@@ -118,6 +126,10 @@
|
|||||||
|
|
||||||
/** 分享弹框显示与否 */
|
/** 分享弹框显示与否 */
|
||||||
const handleToggleShowShare = () => {
|
const handleToggleShowShare = () => {
|
||||||
|
if (!uni.getStorageSync(UserToken)) {
|
||||||
|
emits('handleShowLoginPopup');
|
||||||
|
return;
|
||||||
|
}
|
||||||
state.showShare = !state.showShare;
|
state.showShare = !state.showShare;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -116,10 +116,12 @@
|
|||||||
const handleChangeNumberVal = (e : any) => {
|
const handleChangeNumberVal = (e : any) => {
|
||||||
state.numberVal = e.value;
|
state.numberVal = e.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** sku弹框显示或者隐藏 */
|
/** sku弹框显示或者隐藏 */
|
||||||
const handleChangePopup = (e : any) => {
|
const handleChangePopup = (e : any) => {
|
||||||
emits('handleChangePopup', e.show)
|
emits('handleChangePopup', e.show)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** sku选择 */
|
/** sku选择 */
|
||||||
const handleChooseSku = (index : number, sku : GoodsSpecListType) => {
|
const handleChooseSku = (index : number, sku : GoodsSpecListType) => {
|
||||||
let chooseSku : GoodsSkuListType = {}; // 选中的sku
|
let chooseSku : GoodsSkuListType = {}; // 选中的sku
|
||||||
@@ -161,6 +163,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 立即购买 */
|
/** 立即购买 */
|
||||||
const handleBuyNow = () => {
|
const handleBuyNow = () => {
|
||||||
if (!handleHaveStock()) {
|
if (!handleHaveStock()) {
|
||||||
@@ -171,6 +174,7 @@
|
|||||||
nums: state.numberVal,
|
nums: state.numberVal,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 判断库存 */
|
/** 判断库存 */
|
||||||
const handleHaveStock = () => {
|
const handleHaveStock = () => {
|
||||||
if (state.chooseSku.stock === 0) {
|
if (state.chooseSku.stock === 0) {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<slot name="tip"></slot>
|
<slot name="tip"></slot>
|
||||||
|
|
||||||
<!-- 商品信息 价格名字之类的 -->
|
<!-- 商品信息 价格名字之类的 -->
|
||||||
<GoodsDetailInfo :goodsDetailData="props.goodsDetailData" :shareType="props.shareType"
|
<GoodsDetailInfo :goodsDetailData="props.goodsDetailData" :shareType="props.shareType" @handleShowLoginPopup="handleShowLoginPopup"
|
||||||
:isActivityGoods="props.isActivityGoods" @handleToggleGoodsCollection="handleToggleGoodsCollection">
|
:isActivityGoods="props.isActivityGoods" @handleToggleGoodsCollection="handleToggleGoodsCollection">
|
||||||
<template #countDown>
|
<template #countDown>
|
||||||
<slot name="countDown"></slot>
|
<slot name="countDown"></slot>
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
shareType: ShareEnum.index, /** 分享类型 - 默认分享首页 */
|
shareType: ShareEnum.index, /** 分享类型 - 默认分享首页 */
|
||||||
});
|
});
|
||||||
|
|
||||||
const emits = defineEmits(['hanldeShowGoodSku', 'handleToggleGoodsCollection']);
|
const emits = defineEmits(['hanldeShowGoodSku', 'handleToggleGoodsCollection','handleShowLoginPopup']);
|
||||||
|
|
||||||
const state = reactive<{
|
const state = reactive<{
|
||||||
commonQuestion : Array<CommonQuestionServiceType>;
|
commonQuestion : Array<CommonQuestionServiceType>;
|
||||||
@@ -170,6 +170,11 @@
|
|||||||
const handleToggleGoodsCollection = () => {
|
const handleToggleGoodsCollection = () => {
|
||||||
emits('handleToggleGoodsCollection')
|
emits('handleToggleGoodsCollection')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 显示登录弹框 */
|
||||||
|
const handleShowLoginPopup = ()=>{
|
||||||
|
emits('handleShowLoginPopup')
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped></style>
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
<GoodsDetail :goodsId="state.goodsDetailData?.id" :goodsDetailData="state.goodsDetailData"
|
<GoodsDetail :goodsId="state.goodsDetailData?.id" :goodsDetailData="state.goodsDetailData"
|
||||||
:swiperBanner="state.swiperBanner" :spesDesc="state.spesDesc"
|
:swiperBanner="state.swiperBanner" :spesDesc="state.spesDesc"
|
||||||
:goodsDetailContent="state.goodsDetailContent" :isActivityGoods="true" :shareType="ShareEnum.group"
|
:goodsDetailContent="state.goodsDetailContent" :isActivityGoods="true" :shareType="ShareEnum.group"
|
||||||
@hanldeShowGoodSku="hanldeShowGoodSku">
|
@hanldeShowGoodSku="hanldeShowGoodSku" @handleShowLoginPopup="handleShowLoginPopup">
|
||||||
<template #tip>
|
<template #tip>
|
||||||
<view class="tip-box" v-if="state.showTip && state.goodsDetailData.groupPromotionResult">
|
<view class="tip-box" v-if="state.showTip && state.goodsDetailData.groupPromotionResult">
|
||||||
<view class="title">当前团购活动规则:</view>
|
<view class="title">当前团购活动规则:</view>
|
||||||
@@ -199,7 +199,12 @@
|
|||||||
handleShowToast(addCart.msg);
|
handleShowToast(addCart.msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 显示登录弹框 */
|
||||||
|
const handleShowLoginPopup = () => {
|
||||||
|
state.showLoginModal = true;
|
||||||
|
}
|
||||||
|
|
||||||
/** 打开获取关闭login弹框 */
|
/** 打开获取关闭login弹框 */
|
||||||
const handleChangeLoginPopup = (isShow : boolean) => {
|
const handleChangeLoginPopup = (isShow : boolean) => {
|
||||||
state.showLoginModal = isShow;
|
state.showLoginModal = isShow;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<view class="goods-detail">
|
<view class="goods-detail">
|
||||||
<!-- 商品详情 -->
|
<!-- 商品详情 -->
|
||||||
<GoodsDetail :goodsId="state.goodsDetailData?.id" :goodsDetailData="state.goodsDetailData"
|
<GoodsDetail :goodsId="state.goodsDetailData?.id" :goodsDetailData="state.goodsDetailData"
|
||||||
:swiperBanner="state.swiperBanner" :shareType="ShareEnum.pinTuan"
|
:swiperBanner="state.swiperBanner" :shareType="ShareEnum.pinTuan" @handleShowLoginPopup="handleShowLoginPopup"
|
||||||
:goodsDetailContent="state.goodsDetailContent" :isActivityGoods="true">
|
:goodsDetailContent="state.goodsDetailContent" :isActivityGoods="true">
|
||||||
<template #activityGoodsOtheService>
|
<template #activityGoodsOtheService>
|
||||||
<view class="pinTuan-record" v-if="state.goodsDetailData?.pinTuanRecord?.length > 0">
|
<view class="pinTuan-record" v-if="state.goodsDetailData?.pinTuanRecord?.length > 0">
|
||||||
@@ -272,7 +272,12 @@
|
|||||||
handleShowToast(addCart.msg);
|
handleShowToast(addCart.msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 显示登录弹框 */
|
||||||
|
const handleShowLoginPopup = () => {
|
||||||
|
state.showLoginModal = true;
|
||||||
|
}
|
||||||
|
|
||||||
/** 打开获取关闭login弹框 */
|
/** 打开获取关闭login弹框 */
|
||||||
const handleChangeLoginPopup = (isShow : boolean) => {
|
const handleChangeLoginPopup = (isShow : boolean) => {
|
||||||
state.showLoginModal = isShow;
|
state.showLoginModal = isShow;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<view class="goods-detail">
|
<view class="goods-detail">
|
||||||
<!-- 商品详情 -->
|
<!-- 商品详情 -->
|
||||||
<GoodsDetail :goodsId="state.goodsDetailData?.id" :goodsDetailData="state.goodsDetailData"
|
<GoodsDetail :goodsId="state.goodsDetailData?.id" :goodsDetailData="state.goodsDetailData"
|
||||||
:swiperBanner="state.swiperBanner" :spesDesc="state.spesDesc"
|
:swiperBanner="state.swiperBanner" :spesDesc="state.spesDesc" @handleShowLoginPopup="handleShowLoginPopup"
|
||||||
:goodsDetailContent="state.goodsDetailContent" :isActivityGoods="true" :shareType="ShareEnum.seckill"
|
:goodsDetailContent="state.goodsDetailContent" :isActivityGoods="true" :shareType="ShareEnum.seckill"
|
||||||
@hanldeShowGoodSku="hanldeShowGoodSku">
|
@hanldeShowGoodSku="hanldeShowGoodSku">
|
||||||
<template #tip>
|
<template #tip>
|
||||||
@@ -199,7 +199,12 @@
|
|||||||
handleShowToast(addCart.msg);
|
handleShowToast(addCart.msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 显示登录弹框 */
|
||||||
|
const handleShowLoginPopup = () => {
|
||||||
|
state.showLoginModal = true;
|
||||||
|
}
|
||||||
|
|
||||||
/** 打开获取关闭login弹框 */
|
/** 打开获取关闭login弹框 */
|
||||||
const handleChangeLoginPopup = (isShow : boolean) => {
|
const handleChangeLoginPopup = (isShow : boolean) => {
|
||||||
state.showLoginModal = isShow;
|
state.showLoginModal = isShow;
|
||||||
|
|||||||
@@ -207,6 +207,10 @@
|
|||||||
|
|
||||||
/**立即购买 */
|
/**立即购买 */
|
||||||
const handleBuyNow = () => {
|
const handleBuyNow = () => {
|
||||||
|
if (!uni.getStorageSync(UserToken)) {
|
||||||
|
state.showLoginModal = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (state.totalprice == 0) {
|
if (state.totalprice == 0) {
|
||||||
handleShowToast('请先选择商品');
|
handleShowToast('请先选择商品');
|
||||||
return;
|
return;
|
||||||
@@ -235,12 +239,7 @@
|
|||||||
phoneNumber: shopConfigStore?.config?.shopMobile
|
phoneNumber: shopConfigStore?.config?.shopMobile
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 显示登录弹框 */
|
|
||||||
const handleShowLoginPopup = () => {
|
|
||||||
state.showLoginModal = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 打开获取关闭login弹框 */
|
/** 打开获取关闭login弹框 */
|
||||||
const handleChangeLoginPopup = (isShow : boolean) => {
|
const handleChangeLoginPopup = (isShow : boolean) => {
|
||||||
@@ -281,6 +280,10 @@
|
|||||||
|
|
||||||
/** 分享弹框显示与否 */
|
/** 分享弹框显示与否 */
|
||||||
const handleToggleShowShare = () => {
|
const handleToggleShowShare = () => {
|
||||||
|
if (!uni.getStorageSync(UserToken)) {
|
||||||
|
state.showLoginModal = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
state.showShare = !state.showShare;
|
state.showShare = !state.showShare;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
:swiperBanner="state.swiperBanner" :goodsDetailContent="state.goodsDetailContent"
|
:swiperBanner="state.swiperBanner" :goodsDetailContent="state.goodsDetailContent"
|
||||||
:userAgentGrade="state.userAgentGrade" :agentProductsList="state.agentProductsList"
|
:userAgentGrade="state.userAgentGrade" :agentProductsList="state.agentProductsList"
|
||||||
:goodsPromotionList="state.goodsPromotionList" :spesDesc="state.spesDesc"
|
:goodsPromotionList="state.goodsPromotionList" :spesDesc="state.spesDesc"
|
||||||
@hanldeShowGoodSku="hanldeShowGoodSku">
|
@hanldeShowGoodSku="hanldeShowGoodSku" @handleShowLoginPopup="handleShowLoginPopup">
|
||||||
</GoodsDetail>
|
</GoodsDetail>
|
||||||
|
|
||||||
<!-- 为您推荐 -->
|
<!-- 为您推荐 -->
|
||||||
|
|||||||
Reference in New Issue
Block a user