功能(网页):新增客户体验流程

This commit is contained in:
xiaowang
2026-05-23 21:56:18 +08:00
parent c2c985b2f8
commit 861eea933b
28 changed files with 2236 additions and 108 deletions
@@ -189,6 +189,20 @@
:rows="3"
/>
</a-form-item>
<a-form-item label="适合人群" name="targetAudience">
<a-textarea
v-model:value="formState.targetAudience"
placeholder="例如:短甲、通勤、婚礼跟妆、敏感肌需提前沟通"
:rows="3"
/>
</a-form-item>
<a-form-item label="注意事项" name="precautions">
<a-textarea
v-model:value="formState.precautions"
placeholder="例如:完成后 24 小时内避免长时间热水浸泡"
:rows="3"
/>
</a-form-item>
<a-form-item label="店铺" name="shopId">
<a-select
v-model:value="formState.shopId"
@@ -390,6 +404,20 @@
:disabled="true"
/>
</a-form-item>
<a-form-item label="适合人群">
<a-textarea
v-model:value="viewFormState.targetAudience"
:rows="3"
:disabled="true"
/>
</a-form-item>
<a-form-item label="注意事项">
<a-textarea
v-model:value="viewFormState.precautions"
:rows="3"
:disabled="true"
/>
</a-form-item>
<a-form-item label="店铺">
<a-select v-model:value="viewFormState.shopId" :disabled="true">
<a-select-option
@@ -698,6 +726,8 @@ const viewFormState = reactive({
shopId: undefined,
title: '',
description: '',
targetAudience: '',
precautions: '',
imageFileIds: '',
price: 0,
likeCount: 0,
@@ -729,6 +759,8 @@ const formState = reactive({
shopId: undefined,
title: '',
description: '',
targetAudience: '',
precautions: '',
imageFileIds: '',
price: 0,
likeCount: 0,
@@ -1084,6 +1116,8 @@ const showAddModal = async () => {
shopId: shopId,
title: '',
description: '',
targetAudience: '',
precautions: '',
imageFileIds: '',
price: 0,
likeCount: 0,
@@ -1112,6 +1146,8 @@ const showEditModal = async (record: Product | Record<string, any>) => {
const recordShopId = 'shopId' in record ? record.shopId : (record as any).shopId
const recordTitle = 'title' in record ? record.title : (record as any).title
const recordDescription = 'description' in record ? record.description : (record as any).description
const recordTargetAudience = 'targetAudience' in record ? record.targetAudience : (record as any).targetAudience
const recordPrecautions = 'precautions' in record ? record.precautions : (record as any).precautions
const recordImageFileIds = 'imageFileIds' in record ? record.imageFileIds : (record as any).imageFileIds
const recordPrice = 'price' in record ? record.price : (record as any).price
const recordLikeCount = 'likeCount' in record ? record.likeCount : (record as any).likeCount
@@ -1134,6 +1170,8 @@ const showEditModal = async (record: Product | Record<string, any>) => {
shopId: recordShopId,
title: recordTitle,
description: recordDescription,
targetAudience: recordTargetAudience || '',
precautions: recordPrecautions || '',
imageFileIds: recordImageFileIds,
price: recordPrice,
likeCount: normalizeInteractionCount(recordLikeCount),
@@ -1168,6 +1206,8 @@ const showViewModal = async (record: Product | Record<string, any>) => {
const recordShopId = 'shopId' in record ? record.shopId : (record as any).shopId
const recordTitle = 'title' in record ? record.title : (record as any).title
const recordDescription = 'description' in record ? record.description : (record as any).description
const recordTargetAudience = 'targetAudience' in record ? record.targetAudience : (record as any).targetAudience
const recordPrecautions = 'precautions' in record ? record.precautions : (record as any).precautions
const recordImageFileIds = 'imageFileIds' in record ? record.imageFileIds : (record as any).imageFileIds
const recordPrice = 'price' in record ? record.price : (record as any).price
const recordLikeCount = 'likeCount' in record ? record.likeCount : (record as any).likeCount
@@ -1190,6 +1230,8 @@ const showViewModal = async (record: Product | Record<string, any>) => {
shopId: recordShopId,
title: recordTitle,
description: recordDescription,
targetAudience: recordTargetAudience || '',
precautions: recordPrecautions || '',
imageFileIds: recordImageFileIds,
price: recordPrice,
likeCount: normalizeInteractionCount(recordLikeCount),
@@ -1252,6 +1294,8 @@ const buildDraftPayload = () => ({
shopId: formState.shopId,
title: formState.title,
description: formState.description,
targetAudience: formState.targetAudience,
precautions: formState.precautions,
imageFileIds: formState.imageFileIds,
price: formState.price,
likeCount: formState.likeCount,
+61 -7
View File
@@ -159,6 +159,18 @@
<a-form-item label="边框颜色" name="borderColor">
<el-color-picker v-model="formState.borderColor" />
</a-form-item>
<a-form-item label="场景分组" name="sceneGroup">
<a-input v-model:value="formState.sceneGroup" placeholder="如:风格、场合、季节" />
</a-form-item>
<a-form-item label="前台名称" name="displayName">
<a-input v-model:value="formState.displayName" placeholder="留空则使用标签名称" />
</a-form-item>
<a-form-item label="前台排序" name="sortOrder">
<a-input-number v-model:value="formState.sortOrder" :min="0" style="width: 100%" />
</a-form-item>
<a-form-item label="前台展示" name="frontVisible">
<a-switch v-model:checked="formState.frontVisible" :checked-value="1" :un-checked-value="0" />
</a-form-item>
<a-form-item label="预览">
<span
class="tag-preview"
@@ -210,6 +222,18 @@
<a-form-item label="边框颜色">
<el-color-picker v-model="viewFormState.borderColor" disabled />
</a-form-item>
<a-form-item label="场景分组">
<a-input v-model:value="viewFormState.sceneGroup" :disabled="true" />
</a-form-item>
<a-form-item label="前台名称">
<a-input v-model:value="viewFormState.displayName" :disabled="true" />
</a-form-item>
<a-form-item label="前台排序">
<a-input-number v-model:value="viewFormState.sortOrder" :disabled="true" style="width: 100%" />
</a-form-item>
<a-form-item label="前台展示">
<a-switch v-model:checked="viewFormState.frontVisible" :checked-value="1" :un-checked-value="0" disabled />
</a-form-item>
<a-form-item label="预览">
<span
class="tag-preview"
@@ -308,7 +332,11 @@ const viewFormState = reactive({
shopId: undefined as number | undefined,
textColor: '#333333',
bgColor: '#FFFFFF',
borderColor: '#E5E5E5'
borderColor: '#E5E5E5',
sceneGroup: '',
displayName: '',
sortOrder: 100,
frontVisible: 1
})
/**
@@ -346,7 +374,11 @@ const formState = reactive({
shopId: undefined as number | undefined,
textColor: '#333333',
bgColor: '#FFFFFF',
borderColor: '#E5E5E5'
borderColor: '#E5E5E5',
sceneGroup: '',
displayName: '',
sortOrder: 100,
frontVisible: 1
})
/** getDraftKey is a local helper used by this page script. */
@@ -358,7 +390,11 @@ const buildDraftPayload = () => ({
shopId: formState.shopId,
textColor: formState.textColor,
bgColor: formState.bgColor,
borderColor: formState.borderColor
borderColor: formState.borderColor,
sceneGroup: formState.sceneGroup,
displayName: formState.displayName,
sortOrder: formState.sortOrder,
frontVisible: formState.frontVisible
})
/** restoreDraft is a local helper used by this page script. */
@@ -409,6 +445,8 @@ const columns = [
{ title: '文字颜色', dataIndex: 'textColor', key: 'textColor', width: 120 },
{ title: '背景颜色', dataIndex: 'bgColor', key: 'bgColor', width: 120 },
{ title: '边框颜色', dataIndex: 'borderColor', key: 'borderColor', width: 120 },
{ title: '场景分组', dataIndex: 'sceneGroup', key: 'sceneGroup', width: 120 },
{ title: '前台名称', dataIndex: 'displayName', key: 'displayName', width: 120 },
{ title: '创建时间', dataIndex: 'createTime', key: 'createTime' },
{ title: '操作', key: 'actions', width: 150, fixed: 'right' as const }
]
@@ -487,7 +525,11 @@ const showAddModal = () => {
shopId: shopId,
textColor: '#333333',
bgColor: '#FFFFFF',
borderColor: '#E5E5E5'
borderColor: '#E5E5E5',
sceneGroup: '',
displayName: '',
sortOrder: 100,
frontVisible: 1
})
restoreDraft()
modalVisible.value = true
@@ -502,7 +544,11 @@ const showEditModal = (record: any) => {
shopId: record.shopId,
textColor: record.textColor,
bgColor: record.bgColor,
borderColor: record.borderColor
borderColor: record.borderColor,
sceneGroup: record.sceneGroup || '',
displayName: record.displayName || '',
sortOrder: record.sortOrder ?? 100,
frontVisible: record.frontVisible ?? 1
})
restoreDraft()
modalVisible.value = true
@@ -515,7 +561,11 @@ const showViewModal = (record: any) => {
shopId: record.shopId,
textColor: record.textColor,
bgColor: record.bgColor,
borderColor: record.borderColor
borderColor: record.borderColor,
sceneGroup: record.sceneGroup || '',
displayName: record.displayName || '',
sortOrder: record.sortOrder ?? 100,
frontVisible: record.frontVisible ?? 1
})
viewModalVisible.value = true
}
@@ -537,7 +587,11 @@ const handleModalOk = async () => {
shopId: formState.shopId,
textColor: formState.textColor,
bgColor: formState.bgColor,
borderColor: formState.borderColor
borderColor: formState.borderColor,
sceneGroup: formState.sceneGroup,
displayName: formState.displayName,
sortOrder: formState.sortOrder,
frontVisible: formState.frontVisible
}
if (isEdit.value && currentTag.value) {