From c3ad5e7a21da3fefc6efca80d9559708d1ca0a17 Mon Sep 17 00:00:00 2001 From: wangfukang <15630117759@163.com> Date: Thu, 20 Aug 2026 17:51:09 +0800 Subject: [PATCH] 1 --- package2/myCenter/addGoods.vue | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/package2/myCenter/addGoods.vue b/package2/myCenter/addGoods.vue index 49d7138..77257e2 100644 --- a/package2/myCenter/addGoods.vue +++ b/package2/myCenter/addGoods.vue @@ -436,6 +436,7 @@ submit() { let that = this; this.syncLunchBoxByMoreBuy() + this.normalizeGroupBuyPrices() if (!this.validateProductSpecs()) { return } @@ -531,6 +532,17 @@ } return true }, + normalizeGroupBuyPrices() { + if (!Array.isArray(this.formData.productGroupBuyPrices)) { + this.formData.productGroupBuyPrices = [] + return + } + this.formData.productGroupBuyPrices = this.formData.productGroupBuyPrices.filter((item) => { + const groupCount = item && item.groupCount !== undefined && item.groupCount !== null ? String(item.groupCount).trim() : '' + const groupPrice = item && item.groupPrice !== undefined && item.groupPrice !== null ? String(item.groupPrice).trim() : '' + return groupCount !== '' || groupPrice !== '' + }) + }, isValidPrice(value) { return /^\d+(\.\d{1,2})?$/.test(value) && Number(value) > 0 },