From e1888f55d4bdea8e21a248efe675a93134512622 Mon Sep 17 00:00:00 2001
From: dzq <dzq@ys.com>
Date: Tue, 20 May 2025 16:12:15 +0800
Subject: [PATCH] =?UTF-8?q?feat(=E5=95=86=E5=93=81=E7=AE=A1=E7=90=86):=20?=
 =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=95=86=E5=93=81=E4=BD=BF=E7=94=A8=E8=AF=B4?=
 =?UTF-8?q?=E6=98=8E=E5=AD=97=E6=AE=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

在商品DTO、请求参数及表单中添加`usageInstruction`字段,以便用户输入商品使用说明
---
 src/api/shop/goods.ts                     | 4 ++++
 src/views/shop/goods/goods-edit-modal.vue | 6 +++++-
 src/views/shop/goods/goods-form-modal.vue | 6 +++++-
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/api/shop/goods.ts b/src/api/shop/goods.ts
index 6e5ea7a..51724d8 100644
--- a/src/api/shop/goods.ts
+++ b/src/api/shop/goods.ts
@@ -48,6 +48,8 @@ export interface GoodsDTO {
   cellNoStr?: string;
   /** 总库存量(含所有仓库) */
   totalStock?: number;
+  /** 商品使用说明 */
+  usageInstruction?: string;
 }
 
 /** 商品请求参数 */
@@ -61,6 +63,8 @@ export interface GoodsRequest {
   coverImg?: string;
   goodsDetail: string;
   remark?: string;
+  /** 商品使用说明 */
+  usageInstruction?: string;
 }
 
 /** 获取商品列表 */
diff --git a/src/views/shop/goods/goods-edit-modal.vue b/src/views/shop/goods/goods-edit-modal.vue
index 29a1536..f7fa836 100644
--- a/src/views/shop/goods/goods-edit-modal.vue
+++ b/src/views/shop/goods/goods-edit-modal.vue
@@ -33,7 +33,8 @@ const formData = reactive<GoodsDTO>({
   autoApproval: 0,
   categoryId: 0,
   goodsDetail: "",
-  coverImg: ""
+  coverImg: "",
+  usageInstruction: ""
 });
 
 const rules = reactive<FormRules>({
@@ -176,6 +177,9 @@ const handleDelete = async () => {
           <el-radio :label="2">下架</el-radio>
         </el-radio-group>
       </el-form-item>
+      <el-form-item label="使用说明" prop="usageInstruction">
+        <el-input v-model="formData.usageInstruction" type="textarea" :rows="3" placeholder="请输入商品使用说明" />
+      </el-form-item>
       <el-form-item label="操作">
         <el-popconfirm :title="`确认删除【${row.goodsName}】?`" @confirm="handleDelete()">
           <template #reference>
diff --git a/src/views/shop/goods/goods-form-modal.vue b/src/views/shop/goods/goods-form-modal.vue
index 3ab7baa..852141c 100644
--- a/src/views/shop/goods/goods-form-modal.vue
+++ b/src/views/shop/goods/goods-form-modal.vue
@@ -26,7 +26,8 @@ const formData = reactive<GoodsDTO>({
   autoApproval: 0,
   categoryId: 0,
   goodsDetail: "",
-  coverImg: ""
+  coverImg: "",
+  usageInstruction: ""
 });
 
 const rules = reactive<FormRules>({
@@ -135,6 +136,9 @@ const beforeAvatarUpload = (rawFile) => {
           <el-radio :label="2">下架</el-radio>
         </el-radio-group>
       </el-form-item>
+      <el-form-item label="使用说明" prop="usageInstruction">
+        <el-input v-model="formData.usageInstruction" type="textarea" :rows="3" placeholder="请输入商品使用说明" />
+      </el-form-item>
     </el-form>
 
     <template #footer>