From 9960cbe499ae69f873d16eb3f472b15967e5da1a Mon Sep 17 00:00:00 2001 From: dzc <2388224167@qq.com> Date: Tue, 15 Jul 2025 13:45:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:0=E5=85=83=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.local | 3 ++- src/views/mall/product/containergoods/form/SkuForm.vue | 3 ++- src/views/mall/product/spu/components/SkuList.vue | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.env.local b/.env.local index a5ba9da2..6464462f 100644 --- a/.env.local +++ b/.env.local @@ -2,7 +2,8 @@ NODE_ENV=development VITE_DEV=true # 请求路径 -VITE_BASE_URL= http://116.148.200.224:48089 +# VITE_BASE_URL= http://116.148.200.224:48089 +VITE_BASE_URL= http://127.0.0.1:8089 # 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务 VITE_UPLOAD_TYPE=server diff --git a/src/views/mall/product/containergoods/form/SkuForm.vue b/src/views/mall/product/containergoods/form/SkuForm.vue index 18cd0296..80bccae9 100644 --- a/src/views/mall/product/containergoods/form/SkuForm.vue +++ b/src/views/mall/product/containergoods/form/SkuForm.vue @@ -85,7 +85,8 @@ const ruleConfig: RuleConfig[] = [ }, { name: 'price', - rule: (arg) => arg >= 0.01, + // rule: (arg) => arg >= 0.01, + rule: (arg) => arg >= 0, message: '商品销售价格必须大于等于 0.01 元!!!' }, { diff --git a/src/views/mall/product/spu/components/SkuList.vue b/src/views/mall/product/spu/components/SkuList.vue index 98580d75..c33c0e7e 100644 --- a/src/views/mall/product/spu/components/SkuList.vue +++ b/src/views/mall/product/spu/components/SkuList.vue @@ -401,6 +401,8 @@ const tableHeaders = ref<{ prop: string; label: string }[]>([]) // 多属性表 */ const validateSku = () => { validateProperty() + console.log(props?.ruleConfig,"props?.ruleConfig"); + let warningInfo = '请检查商品各行相关属性配置,' let validate = true // 默认通过 for (const sku of formData.value!.skus!) { @@ -408,6 +410,7 @@ const validateSku = () => { for (const rule of props?.ruleConfig) { const arg = getValue(sku, rule.name) if (!rule.rule(arg)) { + debugger validate = false // 只要有一个不通过则直接不通过 warningInfo += rule.message break