From e05b749e4d0f6f7f3072255cce848f89f25e0bb5 Mon Sep 17 00:00:00 2001 From: owen Date: Sun, 1 Oct 2023 10:41:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=9A=E5=91=98=EF=BC=9A=E4=BC=9A=E5=91=98?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=9A=84=E7=A7=AF=E5=88=86=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=8A=A0=E4=B8=8Apoint=E5=89=8D=E7=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 3a96812d472f4976ac2a52ba069773a53a933450) --- src/api/member/config/index.ts | 8 ++++---- src/views/member/config/index.vue | 32 +++++++++++++++---------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/api/member/config/index.ts b/src/api/member/config/index.ts index ceaaa842..7ddca16b 100644 --- a/src/api/member/config/index.ts +++ b/src/api/member/config/index.ts @@ -2,10 +2,10 @@ import request from '@/config/axios' export interface ConfigVO { id: number - tradeDeductEnable: number - tradeDeductUnitPrice: number - tradeDeductMaxPrice: number - tradeGivePoint: number + pointTradeDeductEnable: number + pointTradeDeductUnitPrice: number + pointTradeDeductMaxPrice: number + pointTradeGivePoint: number } // 查询积分设置详情 diff --git a/src/views/member/config/index.vue b/src/views/member/config/index.vue index 5e308433..38196690 100644 --- a/src/views/member/config/index.vue +++ b/src/views/member/config/index.vue @@ -13,13 +13,13 @@ - - + + 下单积分是否抵用订单金额 - + @@ -27,18 +27,18 @@ 积分抵用比例(1 积分抵多少金额),单位:元 - + 单次下单积分使用上限,0 不限制 - + @@ -66,17 +66,17 @@ const dialogVisible = ref(false) // 弹窗的是否展示 const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 const formData = ref({ id: undefined, - tradeDeductEnable: true, - tradeDeductUnitPrice: 0, - tradeDeductMaxPrice: 0, - tradeGivePoint: 0 + pointTradeDeductEnable: true, + pointTradeDeductUnitPrice: 0, + pointTradeDeductMaxPrice: 0, + pointTradeGivePoint: 0 }) -// 创建一个计算属性,用于将 tradeDeductUnitPrice 显示为带两位小数的形式 -const computedTradeDeductUnitPrice = computed({ - get: () => (formData.value.tradeDeductUnitPrice / 100).toFixed(2), +// 创建一个计算属性,用于将 pointTradeDeductUnitPrice 显示为带两位小数的形式 +const computedPointTradeDeductUnitPrice = computed({ + get: () => (formData.value.pointTradeDeductUnitPrice / 100).toFixed(2), set: (newValue: number) => { - formData.value.tradeDeductUnitPrice = Math.round(newValue * 100) + formData.value.pointTradeDeductUnitPrice = Math.round(newValue * 100) } })