mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-11-11 03:18:56 +08:00
refactor(goods): 重构分类页面装修,使用图片预览替代CSS示意图
- 将"货号"统一重命名为"SKU编码" - 重构分类页面装修,使用图片预览替代CSS示意图 - 修复商家端主容器横向溢出隐藏问题
This commit is contained in:
@@ -70,35 +70,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- 商品原价 -->
|
<!-- 商品原价 -->
|
||||||
<div class="item-price-row" v-else>
|
<div class="item-price-row" v-else>
|
||||||
<!-- 批发价格 -->
|
<span class="item-price">{{ $filters.unitPrice(skuDetail.price, "¥") }}</span>
|
||||||
<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>
|
|
||||||
</div>
|
</div>
|
||||||
<!-- 优惠券展示 -->
|
<!-- 优惠券展示 -->
|
||||||
<div class="item-price-coupon-row" v-if="promotionMap['COUPON'].length">
|
<div class="item-price-coupon-row" v-if="promotionMap['COUPON'].length">
|
||||||
@@ -364,7 +336,6 @@ const router = useRouter();
|
|||||||
|
|
||||||
const showGoodsVideo = ref(false);
|
const showGoodsVideo = ref(false);
|
||||||
const goodsVideo = ref("");
|
const goodsVideo = ref("");
|
||||||
const wholesaleList = ref([]);
|
|
||||||
const count = ref(1); // 商品数量
|
const count = ref(1); // 商品数量
|
||||||
const imgIndex = ref(0); // 展示图片下标
|
const imgIndex = ref(0); // 展示图片下标
|
||||||
const currentSelceted = ref([]); // 当前商品sku
|
const currentSelceted = ref([]); // 当前商品sku
|
||||||
@@ -389,21 +360,6 @@ const currentImg = computed(() => {
|
|||||||
return item ? item.url || item : "";
|
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 起支持促销) */
|
/** 卡密商品:禁加购,仅立即购买;库存读 quantity(M-02 起支持促销) */
|
||||||
const isECouponGoods = computed(() => {
|
const isECouponGoods = computed(() => {
|
||||||
@@ -436,7 +392,6 @@ watch(
|
|||||||
() => props.detail,
|
() => props.detail,
|
||||||
(val) => {
|
(val) => {
|
||||||
skuDetail.value = val.data;
|
skuDetail.value = val.data;
|
||||||
wholesaleList.value = val.wholesaleList;
|
|
||||||
syncCountWithQuantity();
|
syncCountWithQuantity();
|
||||||
promotion();
|
promotion();
|
||||||
swiperGoodsImg();
|
swiperGoodsImg();
|
||||||
@@ -472,10 +427,6 @@ function syncCountWithQuantity() {
|
|||||||
count.value = 1;
|
count.value = 1;
|
||||||
return;
|
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;
|
const max = isECouponGoods.value ? getECouponMaxBuyNum(skuDetail.value) : qty;
|
||||||
if (count.value > max) {
|
if (count.value > max) {
|
||||||
count.value = max;
|
count.value = max;
|
||||||
@@ -484,14 +435,7 @@ function syncCountWithQuantity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeCount(val) {
|
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 select(index, value) {
|
function select(index, value) {
|
||||||
// 选择规格
|
// 选择规格
|
||||||
|
|||||||
@@ -118,13 +118,6 @@
|
|||||||
<p>
|
<p>
|
||||||
{{ goods.goodsSku.goodsName }}
|
{{ goods.goodsSku.goodsName }}
|
||||||
</p>
|
</p>
|
||||||
<p><el-tag
|
|
||||||
v-if="goods.goodsSku.salesModel === 'WHOLESALE'"
|
|
||||||
class="goods-show-tag"
|
|
||||||
color="purple"
|
|
||||||
>
|
|
||||||
批发商品
|
|
||||||
</el-tag></p>
|
|
||||||
<template
|
<template
|
||||||
v-for="(promotion, promotionIndex) in goods.promotions"
|
v-for="(promotion, promotionIndex) in goods.promotions"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -56,12 +56,6 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="goods-show-detail">
|
<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>
|
<span>{{ item.goodsName }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="goods-show-num">
|
<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 {
|
.goods-show-seller {
|
||||||
|
|||||||
@@ -87,10 +87,6 @@
|
|||||||
<span class="seckill-price text-danger">{{ $filters.unitPrice(item.price, "¥") }}</span>
|
<span class="seckill-price text-danger">{{ $filters.unitPrice(item.price, "¥") }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="goods-show-detail">
|
<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>
|
<span>{{ item.goodsName }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="goods-show-num">
|
<div class="goods-show-num">
|
||||||
@@ -719,15 +715,6 @@ window.onscroll = () => {
|
|||||||
color: #fff;
|
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 {
|
.goods-page {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
|
|||||||
@@ -115,54 +115,6 @@ const member = [{
|
|||||||
// display: true
|
// 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 = []
|
let menuList = []
|
||||||
menuList.push(order[0], member[0])
|
menuList.push(order[0], member[0])
|
||||||
|
|
||||||
|
|||||||
@@ -33,17 +33,6 @@
|
|||||||
style="width: 240px"
|
style="width: 240px"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="销售模式" prop="salesModel">
|
|
||||||
<el-select
|
|
||||||
v-model="searchForm.salesModel"
|
|
||||||
placeholder="请选择"
|
|
||||||
clearable
|
|
||||||
style="width: 240px"
|
|
||||||
>
|
|
||||||
<el-option label="零售" value="RETAIL" />
|
|
||||||
<el-option label="批发" value="WHOLESALE" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="商品类型" prop="goodsType">
|
<el-form-item label="商品类型" prop="goodsType">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="searchForm.goodsType"
|
v-model="searchForm.goodsType"
|
||||||
@@ -159,11 +148,6 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="buyCount" label="销量" width="150" />
|
<el-table-column prop="buyCount" label="销量" width="150" />
|
||||||
<el-table-column prop="quantity" label="库存" width="150" />
|
<el-table-column prop="quantity" label="库存" width="150" />
|
||||||
<el-table-column label="销售模式" width="150">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<span v-if="row">{{ salesModelText(row.salesModel) }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="商品类型" width="150">
|
<el-table-column label="商品类型" width="150">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<span v-if="row">{{ goodsTypeText(row.goodsType) }}</span>
|
<span v-if="row">{{ goodsTypeText(row.goodsType) }}</span>
|
||||||
@@ -344,7 +328,6 @@ const { loading, data, total, searchForm, getDataList, handleSearch, resetSearch
|
|||||||
goodsName: "",
|
goodsName: "",
|
||||||
id: "",
|
id: "",
|
||||||
storeName: "",
|
storeName: "",
|
||||||
salesModel: "",
|
|
||||||
goodsType: "",
|
goodsType: "",
|
||||||
groupId: "",
|
groupId: "",
|
||||||
},
|
},
|
||||||
@@ -403,11 +386,6 @@ function onStatusTabClick(tab) {
|
|||||||
const status = tab.paneName ?? tab.props?.name;
|
const status = tab.paneName ?? tab.props?.name;
|
||||||
goodsStatusClick(status);
|
goodsStatusClick(status);
|
||||||
}
|
}
|
||||||
function salesModelText(v) {
|
|
||||||
if (v === "RETAIL") return "零售";
|
|
||||||
if (v === "WHOLESALE") return "批发";
|
|
||||||
return "其他类型";
|
|
||||||
}
|
|
||||||
function goodsTypeText(v) {
|
function goodsTypeText(v) {
|
||||||
if (v === "PHYSICAL_GOODS") return "实物商品";
|
if (v === "PHYSICAL_GOODS") return "实物商品";
|
||||||
if (v === "VIRTUAL_GOODS") return "虚拟商品";
|
if (v === "VIRTUAL_GOODS") return "虚拟商品";
|
||||||
|
|||||||
@@ -246,37 +246,23 @@
|
|||||||
<span class="goods-section-index">{{ sectionNo("price") }}</span>
|
<span class="goods-section-index">{{ sectionNo("price") }}</span>
|
||||||
<div class="goods-section-hd-text">
|
<div class="goods-section-hd-text">
|
||||||
<h3>价格库存</h3>
|
<h3>价格库存</h3>
|
||||||
<p>销售模式、规格与库存</p>
|
<p>商品规格与库存</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="goods-section-bd">
|
<div class="goods-section-bd">
|
||||||
<el-form-item label="销售模式">
|
|
||||||
<span class="detail-value">{{ salesModelDisplayText }}</span>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item v-if="goods.salesModel === 'WHOLESALE'" label="销售规则">
|
|
||||||
<el-table border :data="wholesaleData" style="width: 100%">
|
|
||||||
<el-table-column label="销售规则" min-width="320">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<span v-if="row">
|
|
||||||
当商品购买数量 ≥ {{ row.num }} 时,售价为 ¥{{ row.price }} / {{ goods.goodsUnit || "件" }}
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</el-form-item>
|
|
||||||
<div class="goods-submodule">
|
<div class="goods-submodule">
|
||||||
<div class="goods-submodule-hd">SKU 规格</div>
|
<div class="goods-submodule-hd">SKU 规格</div>
|
||||||
<el-table :data="skuData" border style="width: 100%">
|
<el-table :data="skuData" border style="width: 100%">
|
||||||
<el-table-column prop="id" label="SKU ID" min-width="180" show-overflow-tooltip />
|
<el-table-column prop="id" label="SKU ID" min-width="180" show-overflow-tooltip />
|
||||||
<el-table-column prop="specs" label="规格" min-width="160" show-overflow-tooltip />
|
<el-table-column prop="specs" label="规格" min-width="160" show-overflow-tooltip />
|
||||||
<el-table-column prop="sn" label="货号" min-width="120" show-overflow-tooltip />
|
<el-table-column prop="sn" label="SKU编码" min-width="120" show-overflow-tooltip />
|
||||||
<el-table-column v-if="goods.salesModel !== 'WHOLESALE'" label="价格" width="120">
|
<el-table-column label="价格" width="120">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<priceColorScheme v-if="row" :value="row.price" :color="$mainColor" />
|
<priceColorScheme v-if="row" :value="row.price" :color="$mainColor" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="!isAppointmentGoods && goods.salesModel !== 'WHOLESALE'"
|
v-if="!isAppointmentGoods"
|
||||||
prop="quantity"
|
prop="quantity"
|
||||||
label="库存"
|
label="库存"
|
||||||
width="90"
|
width="90"
|
||||||
@@ -392,7 +378,6 @@ const goods = ref({});
|
|||||||
const brandList = ref([]);
|
const brandList = ref([]);
|
||||||
const previewGoodsPicture = ref("");
|
const previewGoodsPicture = ref("");
|
||||||
const goodsPictureVisible = ref(false);
|
const goodsPictureVisible = ref(false);
|
||||||
const wholesaleData = ref([]);
|
|
||||||
const skuData = ref([]);
|
const skuData = ref([]);
|
||||||
const activeTab = ref("basic");
|
const activeTab = ref("basic");
|
||||||
const slotCapacityVisible = ref(false);
|
const slotCapacityVisible = ref(false);
|
||||||
@@ -409,16 +394,6 @@ const isAppointmentGoods = computed(() => {
|
|||||||
const needsLogistics = computed(() => {
|
const needsLogistics = computed(() => {
|
||||||
return goods.value.goodsType === "PHYSICAL_GOODS";
|
return goods.value.goodsType === "PHYSICAL_GOODS";
|
||||||
});
|
});
|
||||||
const salesModelDisplayText = computed(() => {
|
|
||||||
const type = goods.value.goodsType;
|
|
||||||
const model = goods.value.salesModel;
|
|
||||||
if (type === "APPOINTMENT_GOODS") return "预约型";
|
|
||||||
if (type === "E_COUPON") return "电子卡券";
|
|
||||||
if (type === "VIRTUAL_GOODS") return "虚拟型";
|
|
||||||
if (model === "WHOLESALE") return "批发型";
|
|
||||||
if (model === "RETAIL") return "零售型";
|
|
||||||
return model || "—";
|
|
||||||
});
|
|
||||||
const sectionTabs = computed(() => {
|
const sectionTabs = computed(() => {
|
||||||
const tabs = [
|
const tabs = [
|
||||||
{ name: "basic", label: "基础信息" },
|
{ name: "basic", label: "基础信息" },
|
||||||
@@ -568,7 +543,6 @@ function initGoods(id) {
|
|||||||
quantity: sku.quantity,
|
quantity: sku.quantity,
|
||||||
slotCapacities: sku.slotCapacities,
|
slotCapacities: sku.slotCapacities,
|
||||||
}));
|
}));
|
||||||
wholesaleData.value = res.result?.wholesaleList || [];
|
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
|
|||||||
@@ -25,10 +25,10 @@
|
|||||||
style="width: 240px"
|
style="width: 240px"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="SKU货号" prop="sn">
|
<el-form-item label="SKU编码" prop="sn">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="searchForm.sn"
|
v-model="searchForm.sn"
|
||||||
placeholder="请输入SKU货号"
|
placeholder="请输入SKU编码"
|
||||||
clearable
|
clearable
|
||||||
style="width: 240px"
|
style="width: 240px"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,101 +1,85 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="category-setting" v-loading="loading">
|
<div class="category-setting-page" v-loading="loading">
|
||||||
<el-card shadow="never" class="panel">
|
<div class="setting-container">
|
||||||
<div class="section-title">分类导航</div>
|
<!-- 分类导航模块 -->
|
||||||
<div class="section-sub">选择模板</div>
|
<section class="cate-setting-section">
|
||||||
<div class="template-list">
|
<h2 class="cate-setting-main-title">分类导航</h2>
|
||||||
<div
|
<h3 class="cate-setting-section-title">选择模板</h3>
|
||||||
v-for="tpl in templates"
|
|
||||||
:key="tpl.value"
|
<div class="cate-setting-templates">
|
||||||
class="template-card"
|
<div
|
||||||
:class="{ active: form.template === tpl.value }"
|
v-for="tpl in templates"
|
||||||
@click="form.template = tpl.value"
|
:key="tpl.value"
|
||||||
>
|
class="cate-setting-template-card"
|
||||||
<!-- 纯 CSS 示意图 -->
|
:class="{ active: form.template === tpl.value }"
|
||||||
<div class="mini-phone">
|
:title="tpl.name"
|
||||||
<div class="mini-search"></div>
|
@click="form.template = tpl.value"
|
||||||
<!-- 模板1:左栏 + 宫格 -->
|
>
|
||||||
<template v-if="tpl.value === 1">
|
<div class="cate-setting-template-thumb">
|
||||||
<div class="mini-body">
|
<img :src="tpl.img" :alt="tpl.name" class="cate-setting-template-img" />
|
||||||
<div class="mini-side">
|
</div>
|
||||||
<i v-for="n in 6" :key="n" :class="{ on: n === 1 }"></i>
|
|
||||||
</div>
|
|
||||||
<div class="mini-grid">
|
|
||||||
<div class="mini-grid-title"></div>
|
|
||||||
<div class="mini-grid-cells">
|
|
||||||
<i v-for="n in 6" :key="n"></i>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<!-- 模板2:顶部图标横排 + 标签行 + 左竖列 + 单列商品 -->
|
|
||||||
<template v-else-if="tpl.value === 2">
|
|
||||||
<div class="mini-icon-row">
|
|
||||||
<i v-for="n in 5" :key="n" :class="{ on: n === 1 }"></i>
|
|
||||||
</div>
|
|
||||||
<div class="mini-tag-row">
|
|
||||||
<i v-for="n in 4" :key="n" :class="{ on: n === 1 }"></i>
|
|
||||||
</div>
|
|
||||||
<div class="mini-body">
|
|
||||||
<div class="mini-side">
|
|
||||||
<i v-for="n in 5" :key="n" :class="{ on: n === 2 }"></i>
|
|
||||||
</div>
|
|
||||||
<div class="mini-goods">
|
|
||||||
<i v-for="n in 3" :key="n"></i>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<!-- 模板3:顶部图标横排 + 左竖列 + 单列商品(无标签行) -->
|
|
||||||
<template v-else-if="tpl.value === 3">
|
|
||||||
<div class="mini-icon-row">
|
|
||||||
<i v-for="n in 5" :key="n" :class="{ on: n === 1 }"></i>
|
|
||||||
</div>
|
|
||||||
<div class="mini-body">
|
|
||||||
<div class="mini-side">
|
|
||||||
<i v-for="n in 5" :key="n" :class="{ on: n === 1 }"></i>
|
|
||||||
</div>
|
|
||||||
<div class="mini-goods">
|
|
||||||
<i v-for="n in 3" :key="n"></i>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<!-- 模板4:左竖列(一级) + 右上文字横排(二级) + 单列商品 -->
|
|
||||||
<template v-else>
|
|
||||||
<div class="mini-body">
|
|
||||||
<div class="mini-side">
|
|
||||||
<i v-for="n in 5" :key="n" :class="{ on: n === 1 }"></i>
|
|
||||||
</div>
|
|
||||||
<div class="mini-right">
|
|
||||||
<div class="mini-tag-row">
|
|
||||||
<i v-for="n in 4" :key="n" :class="{ on: n === 1 }"></i>
|
|
||||||
</div>
|
|
||||||
<div class="mini-goods">
|
|
||||||
<i v-for="n in 3" :key="n"></i>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="template-name">{{ tpl.name }}</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</section>
|
||||||
|
|
||||||
<div class="section-title">页面设置</div>
|
<!-- 页面设置模块(仅模板2/3/4展示商品列表字段开关,模板1为分类宫格无需配置) -->
|
||||||
<div class="section-sub">商品列表展示字段</div>
|
<transition name="fade">
|
||||||
<div class="field-list">
|
<section v-if="form.template !== 1" class="cate-setting-section">
|
||||||
<el-checkbox model-value :disabled="true">商品名称</el-checkbox>
|
<h2 class="cate-setting-main-title">页面设置</h2>
|
||||||
<el-checkbox
|
<p class="cate-setting-section-desc">商品列表展示字段:</p>
|
||||||
v-for="f in fieldOptions"
|
|
||||||
:key="f.key"
|
<div class="cate-setting-columns">
|
||||||
v-model="form.showFields[f.key]"
|
<!-- 左列 -->
|
||||||
>{{ f.label }}</el-checkbox
|
<div class="cate-setting-column-block">
|
||||||
|
<div
|
||||||
|
v-for="item in columnLeft"
|
||||||
|
:key="item.key"
|
||||||
|
class="cate-setting-check-row"
|
||||||
|
>
|
||||||
|
<el-checkbox
|
||||||
|
v-if="item.disabled"
|
||||||
|
:model-value="true"
|
||||||
|
:disabled="true"
|
||||||
|
>
|
||||||
|
{{ item.label }}
|
||||||
|
</el-checkbox>
|
||||||
|
<el-checkbox
|
||||||
|
v-else
|
||||||
|
v-model="form.showFields[item.key]"
|
||||||
|
>
|
||||||
|
{{ item.label }}
|
||||||
|
</el-checkbox>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 右列 -->
|
||||||
|
<div class="cate-setting-column-block">
|
||||||
|
<div
|
||||||
|
v-for="item in columnRight"
|
||||||
|
:key="item.key"
|
||||||
|
class="cate-setting-check-row"
|
||||||
|
>
|
||||||
|
<el-checkbox v-model="form.showFields[item.key]">
|
||||||
|
{{ item.label }}
|
||||||
|
</el-checkbox>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</transition>
|
||||||
|
|
||||||
|
<!-- 底部保存按钮 -->
|
||||||
|
<div class="bar-button">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
class="save-btn"
|
||||||
|
:loading="saveLoading"
|
||||||
|
@click="submit"
|
||||||
>
|
>
|
||||||
|
保存设置
|
||||||
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<el-button type="primary" :loading="saveLoading" class="save-btn" @click="submit"
|
|
||||||
>保存设置</el-button
|
|
||||||
>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -109,23 +93,27 @@ defineOptions({ name: "category-setting" });
|
|||||||
const SETTING_KEY = "CATEGORY_PAGE_SETTING";
|
const SETTING_KEY = "CATEGORY_PAGE_SETTING";
|
||||||
|
|
||||||
const templates = [
|
const templates = [
|
||||||
{ value: 1, name: "模板一:左树右宫格" },
|
{ value: 1, name: "模板一: 左树右宫格", img: "https://lilishop-wechat.oss-cn-beijing.aliyuncs.com/tpl-1.png" },
|
||||||
{ value: 2, name: "模板二:图标导航+三级标签" },
|
{ value: 2, name: "模板二: 图标导航+三级标签", img: "https://lilishop-wechat.oss-cn-beijing.aliyuncs.com/tpl-2.png" },
|
||||||
{ value: 3, name: "模板三:图标导航" },
|
{ value: 3, name: "模板三: 图标导航", img: "https://lilishop-wechat.oss-cn-beijing.aliyuncs.com/tpl-3.png" },
|
||||||
{ value: 4, name: "模板四:侧栏一级+二级横滑" },
|
{ value: 4, name: "模板四: 侧栏一级+二级横滑", img: "https://lilishop-wechat.oss-cn-beijing.aliyuncs.com/tpl-4.png" },
|
||||||
];
|
];
|
||||||
|
|
||||||
const fieldOptions = [
|
// 左列展示字段配置(商品名称 规格值固定必选置灰)
|
||||||
{ key: "subTitle", label: "商品副标题" },
|
const columnLeft = [
|
||||||
{ key: "spec", label: "规格值" },
|
{ key: "spuName", label: "商品名称 规格值", disabled: true },
|
||||||
{ key: "tags", label: "标签" },
|
|
||||||
{ key: "selfTag", label: "自营标签" },
|
{ key: "selfTag", label: "自营标签" },
|
||||||
{ key: "price", label: "价格(市场价/会员价)" },
|
|
||||||
{ key: "linePrice", label: "划线价" },
|
|
||||||
{ key: "sales", label: "销量/好评/好评率" },
|
|
||||||
{ key: "cart", label: "购物车" },
|
{ key: "cart", label: "购物车" },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// 右列展示字段配置
|
||||||
|
const columnRight = [
|
||||||
|
{ key: "subTitle", label: "商品副标题" },
|
||||||
|
{ key: "tags", label: "标签" },
|
||||||
|
{ key: "price", label: "价格(会员价)" },
|
||||||
|
{ key: "sales", label: "销量/好评/好评率" },
|
||||||
|
];
|
||||||
|
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const saveLoading = ref(false);
|
const saveLoading = ref(false);
|
||||||
|
|
||||||
@@ -138,7 +126,7 @@ function defaultForm() {
|
|||||||
tags: true,
|
tags: true,
|
||||||
selfTag: true,
|
selfTag: true,
|
||||||
price: true,
|
price: true,
|
||||||
linePrice: true,
|
linePrice: false,
|
||||||
sales: true,
|
sales: true,
|
||||||
cart: true,
|
cart: true,
|
||||||
},
|
},
|
||||||
@@ -172,6 +160,8 @@ function loadSetting() {
|
|||||||
|
|
||||||
function submit() {
|
function submit() {
|
||||||
saveLoading.value = true;
|
saveLoading.value = true;
|
||||||
|
form.value.showFields.spec = true;
|
||||||
|
form.value.showFields.linePrice = false;
|
||||||
setSetting(SETTING_KEY, form.value)
|
setSetting(SETTING_KEY, form.value)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
@@ -187,163 +177,150 @@ function submit() {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.category-setting {
|
.category-setting-page {
|
||||||
padding: 16px;
|
padding: 0;
|
||||||
|
min-height: 100%;
|
||||||
}
|
}
|
||||||
.panel {
|
|
||||||
max-width: 960px;
|
.setting-container {
|
||||||
|
background: #ffffff;
|
||||||
|
padding: 20px 28px 80px 28px;
|
||||||
|
min-height: calc(100vh - 126px);
|
||||||
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
.section-title {
|
|
||||||
|
/* 模块区域 */
|
||||||
|
.cate-setting-section {
|
||||||
|
margin-bottom: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cate-setting-main-title {
|
||||||
|
margin: 0 0 16px 0;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
margin: 8px 0;
|
color: #333333;
|
||||||
|
line-height: 22px;
|
||||||
}
|
}
|
||||||
.section-sub {
|
|
||||||
|
.cate-setting-section-title {
|
||||||
|
margin: 0 0 16px 0;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #333333;
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cate-setting-section-desc {
|
||||||
|
margin: 0 0 16px 0;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
color: #666;
|
color: #888888;
|
||||||
margin-bottom: 12px;
|
line-height: 20px;
|
||||||
}
|
}
|
||||||
.template-list {
|
|
||||||
|
/* 模板预览卡片列表 */
|
||||||
|
.cate-setting-templates {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
gap: 16px;
|
gap: 16px;
|
||||||
flex-wrap: wrap;
|
|
||||||
margin-bottom: 24px;
|
|
||||||
}
|
}
|
||||||
.template-card {
|
|
||||||
width: 150px;
|
.cate-setting-template-card {
|
||||||
|
padding: 0;
|
||||||
|
border: 2px solid #e8e8e8;
|
||||||
|
border-radius: 4px;
|
||||||
|
background: #ffffff;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border: 2px solid #e4e7ed;
|
|
||||||
border-radius: 8px;
|
|
||||||
padding: 8px;
|
|
||||||
transition: border-color 0.2s;
|
|
||||||
&.active {
|
|
||||||
border-color: var(--el-color-primary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.template-name {
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 12px;
|
transition: border-color 0.2s, box-shadow 0.2s;
|
||||||
color: #333;
|
width: 250px;
|
||||||
margin-top: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ---- 示意图 ---- */
|
|
||||||
.mini-phone {
|
|
||||||
background: #f5f6f8;
|
|
||||||
border-radius: 4px;
|
|
||||||
padding: 4px;
|
|
||||||
height: 180px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 4px;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
box-sizing: border-box;
|
||||||
.mini-search {
|
|
||||||
height: 8px;
|
&:hover {
|
||||||
background: #e4e7ed;
|
border-color: #ffb366;
|
||||||
border-radius: 4px;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
.mini-body {
|
|
||||||
display: flex;
|
|
||||||
gap: 4px;
|
|
||||||
flex: 1;
|
|
||||||
min-height: 0;
|
|
||||||
}
|
|
||||||
.mini-right {
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 4px;
|
|
||||||
min-width: 0;
|
|
||||||
}
|
|
||||||
.mini-side {
|
|
||||||
width: 26px;
|
|
||||||
flex-shrink: 0;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 3px;
|
|
||||||
i {
|
|
||||||
height: 14px;
|
|
||||||
background: #e4e7ed;
|
|
||||||
border-radius: 2px;
|
|
||||||
&.on {
|
|
||||||
background: var(--el-color-primary);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
.mini-icon-row {
|
&.active {
|
||||||
display: flex;
|
border-color: #ff6600;
|
||||||
gap: 4px;
|
box-shadow: 0 0 0 1px rgba(255, 102, 0, 0.2);
|
||||||
flex-shrink: 0;
|
|
||||||
i {
|
|
||||||
width: 16px;
|
|
||||||
height: 16px;
|
|
||||||
border-radius: 50%;
|
|
||||||
background: #e4e7ed;
|
|
||||||
&.on {
|
|
||||||
background: var(--el-color-primary);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
.mini-tag-row {
|
.cate-setting-template-thumb {
|
||||||
display: flex;
|
background: #f5f5f5;
|
||||||
gap: 3px;
|
line-height: 0;
|
||||||
flex-shrink: 0;
|
|
||||||
i {
|
|
||||||
width: 18px;
|
|
||||||
height: 7px;
|
|
||||||
border-radius: 3px;
|
|
||||||
background: #e4e7ed;
|
|
||||||
&.on {
|
|
||||||
background: var(--el-color-primary);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
.mini-grid {
|
.cate-setting-template-img {
|
||||||
flex: 1;
|
display: block;
|
||||||
display: flex;
|
width: 250px;
|
||||||
flex-direction: column;
|
max-width: 100%;
|
||||||
gap: 4px;
|
height: auto;
|
||||||
}
|
user-select: none;
|
||||||
.mini-grid-title {
|
-webkit-user-drag: none;
|
||||||
height: 7px;
|
|
||||||
width: 40%;
|
|
||||||
background: #dcdfe6;
|
|
||||||
border-radius: 3px;
|
|
||||||
}
|
|
||||||
.mini-grid-cells {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 4px;
|
|
||||||
i {
|
|
||||||
width: 22px;
|
|
||||||
height: 22px;
|
|
||||||
background: #e4e7ed;
|
|
||||||
border-radius: 2px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.mini-goods {
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 4px;
|
|
||||||
i {
|
|
||||||
height: 30px;
|
|
||||||
background: #e4e7ed;
|
|
||||||
border-radius: 2px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.field-list {
|
/* 商品展示字段两列排布 */
|
||||||
|
.cate-setting-columns {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
margin-bottom: 24px;
|
gap: 24px 60px;
|
||||||
.el-checkbox {
|
max-width: 720px;
|
||||||
width: 220px;
|
}
|
||||||
|
|
||||||
|
.cate-setting-column-block {
|
||||||
|
min-width: 200px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cate-setting-check-row {
|
||||||
|
margin-bottom: 14px;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 底部操作条与保存按钮 */
|
||||||
|
.bar-button {
|
||||||
|
margin-top: 36px;
|
||||||
|
padding-top: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
.save-btn {
|
.save-btn {
|
||||||
min-width: 140px;
|
min-width: 104px;
|
||||||
|
height: 36px;
|
||||||
|
padding: 0 20px;
|
||||||
|
font-size: 14px;
|
||||||
|
background-color: #ff6600 !important;
|
||||||
|
border-color: #ff6600 !important;
|
||||||
|
border-radius: 4px;
|
||||||
|
color: #ffffff !important;
|
||||||
|
font-weight: 500;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.2s;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: #ff8533 !important;
|
||||||
|
border-color: #ff8533 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
background-color: #e65c00 !important;
|
||||||
|
border-color: #e65c00 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 淡入淡出过渡动画 */
|
||||||
|
.fade-enter-active,
|
||||||
|
.fade-leave-active {
|
||||||
|
transition: opacity 0.2s ease, transform 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fade-enter-from,
|
||||||
|
.fade-leave-to {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(-6px);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -24,8 +24,8 @@
|
|||||||
style="width: 200px"
|
style="width: 200px"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="货号" prop="sn">
|
<el-form-item label="SKU编码" prop="sn">
|
||||||
<el-input v-model="searchForm.sn" placeholder="请输入货号" clearable style="width: 200px" />
|
<el-input v-model="searchForm.sn" placeholder="请输入SKU编码" clearable style="width: 200px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" class="search-btn" @click="handleSearch">搜索</el-button>
|
<el-button type="primary" class="search-btn" @click="handleSearch">搜索</el-button>
|
||||||
|
|||||||
@@ -24,8 +24,8 @@
|
|||||||
style="width: 200px"
|
style="width: 200px"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="货号" prop="sn">
|
<el-form-item label="SKU编码" prop="sn">
|
||||||
<el-input v-model="searchForm.sn" placeholder="请输入货号" clearable style="width: 200px" />
|
<el-input v-model="searchForm.sn" placeholder="请输入SKU编码" clearable style="width: 200px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" class="search-btn" @click="handleSearch">搜索</el-button>
|
<el-button type="primary" class="search-btn" @click="handleSearch">搜索</el-button>
|
||||||
|
|||||||
@@ -24,10 +24,10 @@
|
|||||||
clearable
|
clearable
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="SKU货号" prop="skuSn">
|
<el-form-item label="SKU编码" prop="skuSn">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="searchForm.skuSn"
|
v-model="searchForm.skuSn"
|
||||||
placeholder="请输入SKU货号"
|
placeholder="请输入SKU编码"
|
||||||
clearable
|
clearable
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ const selectGoodsType = ref(false);
|
|||||||
const goodsTypeWay = ref([
|
const goodsTypeWay = ref([
|
||||||
{
|
{
|
||||||
title: "实物商品",
|
title: "实物商品",
|
||||||
desc: "零售批发,物流配送",
|
desc: "标准实物,物流配送",
|
||||||
type: "PHYSICAL_GOODS",
|
type: "PHYSICAL_GOODS",
|
||||||
icon: markRaw(Box),
|
icon: markRaw(Box),
|
||||||
tone: "tone-physical",
|
tone: "tone-physical",
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -244,7 +244,6 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
overflow-x: hidden;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user