Skip to content

Commit 88677ee

Browse files
committed
product:优化商品发布页
1 parent 3a9668d commit 88677ee

File tree

3 files changed

+17
-32
lines changed

3 files changed

+17
-32
lines changed

src/router/modules/remaining.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
346346
hidden: true,
347347
canTo: true,
348348
icon: 'ep:edit',
349-
title: '添加商品',
349+
title: '商品添加',
350350
activeMenu: '/mall/product/spu'
351351
}
352352
},
@@ -359,7 +359,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
359359
hidden: true,
360360
canTo: true,
361361
icon: 'ep:edit',
362-
title: '编辑商品',
362+
title: '商品编辑',
363363
activeMenu: '/mall/product/spu'
364364
}
365365
},

src/views/mall/product/spu/form/BasicInfoForm.vue

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,14 @@
1515
</el-col>
1616
<el-col :span="12">
1717
<el-form-item label="商品分类" prop="categoryId">
18-
<el-tree-select
18+
<el-cascader
1919
v-model="formData.categoryId"
20-
:data="categoryList"
20+
:options="categoryList"
2121
:props="defaultProps"
22-
check-strictly
2322
class="w-1/1"
24-
node-key="id"
23+
clearable
2524
placeholder="请选择商品分类"
26-
@change="categoryNodeClick"
25+
filterable
2726
/>
2827
</el-form-item>
2928
</el-col>
@@ -74,8 +73,6 @@
7473
:value="item.id"
7574
/>
7675
</el-select>
77-
<!-- TODO 可能情况:善品录入后选择运费发现下拉选择中没有对应的模版 这里需不需要做添加运费模版后选择的功能 -->
78-
<!-- <el-button class="ml-20px">运费模板</el-button>-->
7976
</el-form-item>
8077
</el-col>
8178
<el-col :span="12">
@@ -102,7 +99,7 @@
10299
<el-form-item label="分销类型" props="subCommissionType">
103100
<el-radio-group v-model="formData.subCommissionType" @change="changeSubCommissionType">
104101
<el-radio :label="false">默认设置</el-radio>
105-
<el-radio :label="true" class="radio">自行设置</el-radio>
102+
<el-radio :label="true" class="radio">单独设置</el-radio>
106103
</el-radio-group>
107104
</el-form-item>
108105
</el-col>
@@ -117,7 +114,7 @@
117114
/>
118115
</el-form-item>
119116
<el-form-item v-if="formData.specType" label="商品属性">
120-
<el-button class="mb-10px mr-15px" @click="attributesAddFormRef.open">添加规格</el-button>
117+
<el-button class="mb-10px mr-15px" @click="attributesAddFormRef.open">添加属性</el-button>
121118
<ProductAttributes :propertyList="propertyList" @success="generateSkus" />
122119
</el-form-item>
123120
<template v-if="formData.specType && propertyList.length > 0">
@@ -139,7 +136,7 @@
139136

140137
<!-- 情况二:详情 -->
141138
<Descriptions v-if="isDetail" :data="formData" :schema="allSchemas.detailSchema">
142-
<template #categoryId="{ row }"> {{ categoryString(row.categoryId) }}</template>
139+
<template #categoryId="{ row }"> {{ formatCategoryName(row.categoryId) }}</template>
143140
<template #brandId="{ row }">
144141
{{ brandList.find((item) => item.id === row.brandId)?.name }}
145142
</template>
@@ -150,7 +147,7 @@
150147
{{ row.specType ? '多规格' : '单规格' }}
151148
</template>
152149
<template #subCommissionType="{ row }">
153-
{{ row.subCommissionType ? '自行设置' : '默认设置' }}
150+
{{ row.subCommissionType ? '单独设置' : '默认设置' }}
154151
</template>
155152
<template #picUrl="{ row }">
156153
<el-image :src="row.picUrl" class="h-60px w-60px" @click="imagePreview(row.picUrl)" />
@@ -206,17 +203,17 @@ const ruleConfig: RuleConfig[] = [
206203
{
207204
name: 'price',
208205
rule: (arg) => arg >= 0.01,
209-
message: '商品销售价格必须大于等于 0.01 !!!'
206+
message: '商品销售价格必须大于等于 0.01 !!!'
210207
},
211208
{
212209
name: 'marketPrice',
213210
rule: (arg) => arg >= 0.01,
214-
message: '商品市场价格必须大于等于 0.01 !!!'
211+
message: '商品市场价格必须大于等于 0.01 !!!'
215212
},
216213
{
217214
name: 'costPrice',
218215
rule: (arg) => arg >= 0.01,
219-
message: '商品成本价格必须大于等于 0.01 !!!'
216+
message: '商品成本价格必须大于等于 0.01 !!!'
220217
}
221218
]
222219
@@ -359,23 +356,11 @@ const onChangeSpec = () => {
359356
}
360357
361358
const categoryList = ref([]) // 分类树
362-
/**
363-
* 选择分类时触发校验
364-
*/
365-
const categoryNodeClick = () => {
366-
if (!checkSelectedNode(categoryList.value, formData.categoryId)) {
367-
formData.categoryId = null
368-
message.warning('必须选择二级及以下节点!!')
369-
}
370-
}
371-
/**
372-
* 获取分类的节点的完整结构
373-
*
374-
* @param categoryId 分类id
375-
*/
376-
const categoryString = (categoryId) => {
359+
/** 获取分类的节点的完整结构 */
360+
const formatCategoryName = (categoryId) => {
377361
return treeToString(categoryList.value, categoryId)
378362
}
363+
379364
const brandList = ref([]) // 精简商品品牌列表
380365
const deliveryTemplateList = ref([]) // 运费模版
381366
onMounted(async () => {

src/views/mall/product/spu/form/OtherSettingsForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
</el-form-item>
4242
</el-col>
4343
<el-col :span="24">
44-
<!-- TODO tag展示暂时不考虑排序 -->
44+
<!-- TODO @puhui999:tag展示暂时不考虑排序;支持拖动排序 -->
4545
<el-form-item label="活动优先级">
4646
<el-tag>默认</el-tag>
4747
<el-tag class="ml-2" type="success">秒杀</el-tag>

0 commit comments

Comments
 (0)