parent
24a650d89b
commit
e05b749e4d
@ -2,10 +2,10 @@ import request from '@/config/axios'
|
|||||||
|
|
||||||
export interface ConfigVO {
|
export interface ConfigVO {
|
||||||
id: number
|
id: number
|
||||||
tradeDeductEnable: number
|
pointTradeDeductEnable: number
|
||||||
tradeDeductUnitPrice: number
|
pointTradeDeductUnitPrice: number
|
||||||
tradeDeductMaxPrice: number
|
pointTradeDeductMaxPrice: number
|
||||||
tradeGivePoint: number
|
pointTradeGivePoint: number
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询积分设置详情
|
// 查询积分设置详情
|
||||||
|
@ -13,13 +13,13 @@
|
|||||||
|
|
||||||
<el-tabs>
|
<el-tabs>
|
||||||
<el-tab-pane label="积分">
|
<el-tab-pane label="积分">
|
||||||
<el-form-item label="积分抵扣" prop="tradeDeductEnable">
|
<el-form-item label="积分抵扣" prop="pointTradeDeductEnable">
|
||||||
<el-switch v-model="formData.tradeDeductEnable" style="user-select: none" />
|
<el-switch v-model="formData.pointTradeDeductEnable" style="user-select: none" />
|
||||||
<el-text class="w-full" size="small" type="info">下单积分是否抵用订单金额</el-text>
|
<el-text class="w-full" size="small" type="info">下单积分是否抵用订单金额</el-text>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="积分抵扣" prop="tradeDeductUnitPrice">
|
<el-form-item label="积分抵扣" prop="pointTradeDeductUnitPrice">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="computedTradeDeductUnitPrice"
|
v-model="computedPointTradeDeductUnitPrice"
|
||||||
placeholder="请输入积分抵扣金额"
|
placeholder="请输入积分抵扣金额"
|
||||||
:precision="2"
|
:precision="2"
|
||||||
/>
|
/>
|
||||||
@ -27,18 +27,18 @@
|
|||||||
积分抵用比例(1 积分抵多少金额),单位:元
|
积分抵用比例(1 积分抵多少金额),单位:元
|
||||||
</el-text>
|
</el-text>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="积分抵扣最大值" prop="tradeDeductMaxPrice">
|
<el-form-item label="积分抵扣最大值" prop="pointTradeDeductMaxPrice">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="formData.tradeDeductMaxPrice"
|
v-model="formData.pointTradeDeductMaxPrice"
|
||||||
placeholder="请输入积分抵扣最大值"
|
placeholder="请输入积分抵扣最大值"
|
||||||
/>
|
/>
|
||||||
<el-text class="w-full" size="small" type="info">
|
<el-text class="w-full" size="small" type="info">
|
||||||
单次下单积分使用上限,0 不限制
|
单次下单积分使用上限,0 不限制
|
||||||
</el-text>
|
</el-text>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="1 元赠送多少分" prop="tradeGivePoint">
|
<el-form-item label="1 元赠送多少分" prop="pointTradeGivePoint">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="formData.tradeGivePoint"
|
v-model="formData.pointTradeGivePoint"
|
||||||
placeholder="请输入 1 元赠送多少积分"
|
placeholder="请输入 1 元赠送多少积分"
|
||||||
/>
|
/>
|
||||||
<el-text class="w-full" size="small" type="info">
|
<el-text class="w-full" size="small" type="info">
|
||||||
@ -66,17 +66,17 @@ const dialogVisible = ref(false) // 弹窗的是否展示
|
|||||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
id: undefined,
|
id: undefined,
|
||||||
tradeDeductEnable: true,
|
pointTradeDeductEnable: true,
|
||||||
tradeDeductUnitPrice: 0,
|
pointTradeDeductUnitPrice: 0,
|
||||||
tradeDeductMaxPrice: 0,
|
pointTradeDeductMaxPrice: 0,
|
||||||
tradeGivePoint: 0
|
pointTradeGivePoint: 0
|
||||||
})
|
})
|
||||||
|
|
||||||
// 创建一个计算属性,用于将 tradeDeductUnitPrice 显示为带两位小数的形式
|
// 创建一个计算属性,用于将 pointTradeDeductUnitPrice 显示为带两位小数的形式
|
||||||
const computedTradeDeductUnitPrice = computed({
|
const computedPointTradeDeductUnitPrice = computed({
|
||||||
get: () => (formData.value.tradeDeductUnitPrice / 100).toFixed(2),
|
get: () => (formData.value.pointTradeDeductUnitPrice / 100).toFixed(2),
|
||||||
set: (newValue: number) => {
|
set: (newValue: number) => {
|
||||||
formData.value.tradeDeductUnitPrice = Math.round(newValue * 100)
|
formData.value.pointTradeDeductUnitPrice = Math.round(newValue * 100)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user