【功能修复】拼团:未开启拼团的 SKU 需要禁用选择

pull/75/MERGE
YunaiV 2024-08-10 11:36:02 +08:00
parent 51ba185e81
commit 5feab41b3d
2 changed files with 15 additions and 2 deletions

View File

@ -199,6 +199,7 @@
/** /**
* 去参团 * 去参团
*
* @param record 团长的团购记录 * @param record 团长的团购记录
*/ */
function onJoinGroupon(record) { function onJoinGroupon(record) {
@ -227,7 +228,6 @@
} }
// //
// TODO @
const shareInfo = computed(() => { const shareInfo = computed(() => {
if (isEmpty(state.activity)) return {}; if (isEmpty(state.activity)) return {};
return sheep.$platform.share.getShareInfo( return sheep.$platform.share.getShareInfo(
@ -262,9 +262,21 @@
// //
const { data: spu } = await SpuApi.getSpuDetail(activity.spuId); const { data: spu } = await SpuApi.getSpuDetail(activity.spuId);
state.goodsId = spu.id; state.goodsId = spu.id;
//
activity.products.forEach((product) => { activity.products.forEach((product) => {
spu.price = Math.min(spu.price, product.combinationPrice); // SPU spu.price = Math.min(spu.price, product.combinationPrice); // SPU
}); });
// 使
spu.skus.forEach((sku) => {
const product = activity.products.find((product) => product.skuId === sku.id);
if (product) {
sku.price = product.combinationPrice;
} else {
//
sku.stock = 0;
}
});
// //
state.skeletonLoading = false; state.skeletonLoading = false;
if (code === 0) { if (code === 0) {

View File

@ -220,6 +220,7 @@
const activity = ref(); const activity = ref();
const timeStatusEnum = ref(''); const timeStatusEnum = ref('');
// //
const getActivity = async (id) => { const getActivity = async (id) => {
const { data } = await SeckillApi.getSeckillActivity(id); const { data } = await SeckillApi.getSeckillActivity(id);
@ -230,9 +231,9 @@
await getSpu(data.spuId); await getSpu(data.spuId);
}; };
//
const getSpu = async (id) => { const getSpu = async (id) => {
const { data } = await SpuApi.getSpuDetail(id); const { data } = await SpuApi.getSpuDetail(id);
//
data.activity_type = 'seckill'; data.activity_type = 'seckill';
state.goodsInfo = data; state.goodsInfo = data;
// //