shinnosuke
2026-08-03 d8a8e56c99adef31b10e5199b623c7ae665ceaad
fix: refine group-buy product form validation
4个文件已修改
42 ■■■■■ 已修改文件
talent-card-admin/src/style.css 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
talent-card-admin/src/views/MerchantCreateView.vue 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
talent-card-server/src/main/java/com/talentcard/server/business/admin/ProductCreateRequest.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
talent-card-server/src/main/java/com/talentcard/server/business/admin/ProductUpdateRequest.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
talent-card-admin/src/style.css
@@ -1193,9 +1193,16 @@
.product-form-grid {
  display: grid;
  grid-template-columns: 280px 270px minmax(220px, 1fr);
  grid-template-columns: 280px 270px;
  column-gap: 26px;
  align-items: start;
}
.merchant-product-form-panel .el-input__wrapper,
.merchant-product-form-panel .el-select__wrapper,
.merchant-product-form-panel .el-date-editor.el-input__wrapper,
.merchant-product-form-panel .el-textarea__inner {
  background: #ffffff;
}
.product-form-row,
@@ -1211,6 +1218,10 @@
  grid-template-columns: 54px 134px 24px;
}
.product-form-row.amount .el-input-number {
  width: 134px;
}
.product-form-row label,
.product-static-row label,
.product-image-row label,
talent-card-admin/src/views/MerchantCreateView.vue
@@ -136,8 +136,6 @@
const productMode = ref<'list' | 'form'>('list')
const productSaving = ref(false)
const editingProductId = ref<number | string>()
const productCreatedAt = ref('')
const productUpdatedAt = ref('')
const productPagination = reactive({
  page: 1,
@@ -588,8 +586,6 @@
function resetProductForm(row?: Product) {
  editingProductId.value = row?.id
  productCreatedAt.value = formatDisplayTime(row?.createdAt || form.createdAt)
  productUpdatedAt.value = formatDisplayTime(row?.submitTime || row?.createdAt || form.createdAt)
  const notice = parseJsonValue<Record<string, string>>(row?.purchaseNotice, {})
  productForm.merchantId = row?.merchantId || currentMerchantId()
  productForm.productType = row?.productType || 'GROUP'
@@ -1510,21 +1506,18 @@
            <div class="product-info-middle">
              <div class="product-form-row amount">
                <label>商品金额</label>
                <el-input v-model="productForm.salePrice" placeholder="请输入" />
                <el-input-number
                  v-model="productForm.salePrice"
                  :min="0.01"
                  :step="0.01"
                  :precision="2"
                  :controls="false"
                  placeholder="请输入"
                />
                <span>元</span>
              </div>
            </div>
            <div class="product-info-right">
              <div class="product-static-row">
                <label>创建时间</label>
                <span>{{ productCreatedAt }}</span>
              </div>
              <div class="product-static-row">
                <label>修改时间</label>
                <span>{{ productUpdatedAt }}</span>
              </div>
            </div>
          </div>
          <div class="product-detail-row">
talent-card-server/src/main/java/com/talentcard/server/business/admin/ProductCreateRequest.java
@@ -5,6 +5,7 @@
import java.util.Map;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.Digits;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
@@ -22,7 +23,7 @@
        String subtitle,
        @NotBlank String coverUrl,
        BigDecimal originalPrice,
        @NotNull @DecimalMin(value = "0.01") BigDecimal salePrice,
        @NotNull @DecimalMin(value = "0.01") @Digits(integer = 10, fraction = 2) BigDecimal salePrice,
        BigDecimal subsidyAmount,
        Integer stock,
        @NotBlank String detailText,
talent-card-server/src/main/java/com/talentcard/server/business/admin/ProductUpdateRequest.java
@@ -5,6 +5,7 @@
import java.util.Map;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.Digits;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
@@ -22,7 +23,7 @@
        String subtitle,
        @NotBlank String coverUrl,
        BigDecimal originalPrice,
        @NotNull @DecimalMin(value = "0.01") BigDecimal salePrice,
        @NotNull @DecimalMin(value = "0.01") @Digits(integer = 10, fraction = 2) BigDecimal salePrice,
        BigDecimal subsidyAmount,
        Integer stock,
        @NotBlank String detailText,