mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-11-08 01:48:56 +08:00
refactor(goods): 重构分类页面装修,使用图片预览替代CSS示意图
- 将"货号"统一重命名为"SKU编码" - 重构分类页面装修,使用图片预览替代CSS示意图 - 修复商家端主容器横向溢出隐藏问题
This commit is contained in:
@@ -70,35 +70,7 @@
|
||||
</div>
|
||||
<!-- 商品原价 -->
|
||||
<div class="item-price-row" v-else>
|
||||
<!-- 批发价格 -->
|
||||
<div v-if="!isECouponGoods && wholesaleNum && wholesaleNum.length">
|
||||
<div class="flex">
|
||||
<div class="item-price-title"></div>
|
||||
|
||||
<div
|
||||
v-for="(item, index) in wholesalePrice"
|
||||
:key="index"
|
||||
class="item-price item-num"
|
||||
>
|
||||
{{ $filters.unitPrice(item, "¥") }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div class="item-price-title">起批量</div>
|
||||
<div
|
||||
v-for="(item, index) in wholesaleNum"
|
||||
:key="index"
|
||||
class="item-num item-price-num"
|
||||
>
|
||||
{{ item }}{{ skuDetail.goodsUnit }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 普通价格 -->
|
||||
<div v-else>
|
||||
<span class="item-price">{{ $filters.unitPrice(skuDetail.price, "¥") }}</span>
|
||||
</div>
|
||||
<span class="item-price">{{ $filters.unitPrice(skuDetail.price, "¥") }}</span>
|
||||
</div>
|
||||
<!-- 优惠券展示 -->
|
||||
<div class="item-price-coupon-row" v-if="promotionMap['COUPON'].length">
|
||||
@@ -364,7 +336,6 @@ const router = useRouter();
|
||||
|
||||
const showGoodsVideo = ref(false);
|
||||
const goodsVideo = ref("");
|
||||
const wholesaleList = ref([]);
|
||||
const count = ref(1); // 商品数量
|
||||
const imgIndex = ref(0); // 展示图片下标
|
||||
const currentSelceted = ref([]); // 当前商品sku
|
||||
@@ -389,21 +360,6 @@ const currentImg = computed(() => {
|
||||
return item ? item.url || item : "";
|
||||
});
|
||||
|
||||
const wholesalePrice = computed(() => {
|
||||
return wholesaleList.value.length
|
||||
? wholesaleList.value.map((item) => {
|
||||
return item.price;
|
||||
})
|
||||
: [];
|
||||
});
|
||||
|
||||
const wholesaleNum = computed(() => {
|
||||
return wholesaleList.value.length
|
||||
? wholesaleList.value.map((item) => {
|
||||
return item.num;
|
||||
})
|
||||
: [];
|
||||
});
|
||||
|
||||
/** 卡密商品:禁加购,仅立即购买;库存读 quantity(M-02 起支持促销) */
|
||||
const isECouponGoods = computed(() => {
|
||||
@@ -436,7 +392,6 @@ watch(
|
||||
() => props.detail,
|
||||
(val) => {
|
||||
skuDetail.value = val.data;
|
||||
wholesaleList.value = val.wholesaleList;
|
||||
syncCountWithQuantity();
|
||||
promotion();
|
||||
swiperGoodsImg();
|
||||
@@ -472,10 +427,6 @@ function syncCountWithQuantity() {
|
||||
count.value = 1;
|
||||
return;
|
||||
}
|
||||
if (!isECouponGoods.value && wholesaleList.value && wholesaleList.value.length > 0) {
|
||||
count.value = Math.min(Math.max(wholesaleList.value[0].num, 1), qty);
|
||||
return;
|
||||
}
|
||||
const max = isECouponGoods.value ? getECouponMaxBuyNum(skuDetail.value) : qty;
|
||||
if (count.value > max) {
|
||||
count.value = max;
|
||||
@@ -484,14 +435,7 @@ function syncCountWithQuantity() {
|
||||
}
|
||||
}
|
||||
|
||||
function changeCount(val) {
|
||||
if (wholesaleList.value && wholesaleList.value.length > 0) {
|
||||
if (count.value <= wholesaleList.value[0].num) {
|
||||
Message.warning("批发商品购买数量不能小于起批数量");
|
||||
count.value = wholesaleList.value[0].num;
|
||||
}
|
||||
}
|
||||
}
|
||||
function changeCount(val) {}
|
||||
|
||||
function select(index, value) {
|
||||
// 选择规格
|
||||
|
||||
@@ -118,13 +118,6 @@
|
||||
<p>
|
||||
{{ goods.goodsSku.goodsName }}
|
||||
</p>
|
||||
<p><el-tag
|
||||
v-if="goods.goodsSku.salesModel === 'WHOLESALE'"
|
||||
class="goods-show-tag"
|
||||
color="purple"
|
||||
>
|
||||
批发商品
|
||||
</el-tag></p>
|
||||
<template
|
||||
v-for="(promotion, promotionIndex) in goods.promotions"
|
||||
>
|
||||
|
||||
@@ -56,12 +56,6 @@
|
||||
</span>
|
||||
</div>
|
||||
<div class="goods-show-detail">
|
||||
<el-tag
|
||||
v-if="item.salesModel === 'WHOLESALE'"
|
||||
class="goods-show-tag goods-show-tag-wholesale"
|
||||
>
|
||||
批发
|
||||
</el-tag>
|
||||
<span>{{ item.goodsName }}</span>
|
||||
</div>
|
||||
<div class="goods-show-num">
|
||||
@@ -351,15 +345,6 @@ getGoodsList();
|
||||
}
|
||||
}
|
||||
|
||||
.goods-show-tag-wholesale {
|
||||
margin-right: 5px;
|
||||
background-color: #f9f0ff;
|
||||
border-color: #d3adf7;
|
||||
color: #9254de;
|
||||
|
||||
:deep(.el-tag__content) {
|
||||
color: #9254de;
|
||||
}
|
||||
}
|
||||
|
||||
.goods-show-seller {
|
||||
|
||||
@@ -87,10 +87,6 @@
|
||||
<span class="seckill-price text-danger">{{ $filters.unitPrice(item.price, "¥") }}</span>
|
||||
</div>
|
||||
<div class="goods-show-detail">
|
||||
<el-tag
|
||||
v-if="item.salesModel === 'WHOLESALE'"
|
||||
class="goods-show-tag goods-show-tag-wholesale"
|
||||
>批发</el-tag>
|
||||
<span>{{ item.goodsName }}</span>
|
||||
</div>
|
||||
<div class="goods-show-num">
|
||||
@@ -719,15 +715,6 @@ window.onscroll = () => {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.goods-show-tag-wholesale {
|
||||
--el-tag-bg-color: #f9f0ff;
|
||||
--el-tag-border-color: #d3adf7;
|
||||
--el-tag-text-color: #9254de;
|
||||
background-color: #f9f0ff;
|
||||
border-color: #d3adf7;
|
||||
color: #9254de;
|
||||
}
|
||||
|
||||
.goods-page {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
|
||||
@@ -115,54 +115,6 @@ const member = [{
|
||||
// display: true
|
||||
// }]
|
||||
|
||||
// 批发中心
|
||||
// const wholesale = [
|
||||
// {
|
||||
// icon: '',
|
||||
// title: '批发中心',
|
||||
// menus: [
|
||||
// {
|
||||
// icon: '',
|
||||
// title: '我的采购单',
|
||||
// path: 'MyOrder',
|
||||
// },
|
||||
// {
|
||||
// icon: '',
|
||||
// title: '采购退货单',
|
||||
// path: 'MyOrder',
|
||||
// },
|
||||
// {
|
||||
// icon: '',
|
||||
// title: '我的求购单',
|
||||
// path: 'MyOrder',
|
||||
// },
|
||||
//
|
||||
// ],
|
||||
// display: true
|
||||
// }
|
||||
// ]
|
||||
|
||||
// 店铺
|
||||
// const shop = [
|
||||
// {
|
||||
// icon: '',
|
||||
// title: '店铺管理',
|
||||
// menus: [
|
||||
// {
|
||||
// icon: '',
|
||||
// title: '店铺后台',
|
||||
// path: 'MyOrder',
|
||||
// },
|
||||
// {
|
||||
// icon: '',
|
||||
// title: '商家等级',
|
||||
// path: 'MyOrder',
|
||||
// },
|
||||
// ],
|
||||
// display: true
|
||||
// }
|
||||
// ]
|
||||
// wholesale[0], shop[0]
|
||||
let menuList = []
|
||||
menuList.push(order[0], member[0])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user