Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f2e029dc
authored
Aug 09, 2023
by
xiaqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
会员积分针对代码格式、功能优化
1.修改积分抵扣单位,按照分显示
parent
de941ec6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
+16
-7
src/views/member/point/config/index.vue
+16
-7
No files found.
src/views/member/point/config/index.vue
View file @
f2e029dc
...
@@ -16,12 +16,12 @@
...
@@ -16,12 +16,12 @@
<el-form-item>
<el-form-item>
<el-text
class=
"mx-1"
size=
"small"
type=
"info"
>
下单积分是否抵用订单金额
</el-text>
<el-text
class=
"mx-1"
size=
"small"
type=
"info"
>
下单积分是否抵用订单金额
</el-text>
</el-form-item>
</el-form-item>
<!-- TODO @xiaqing:用户看到的是元,最多 2 位;分是后端的存储哈 -->
<el-form-item
label=
"积分抵扣"
prop=
"tradeDeductUnitPrice"
class=
"item-bottom"
>
<el-form-item
label=
"积分抵扣"
prop=
"tradeDeductUnitPrice"
class=
"item-bottom"
>
<el-input-number
<el-input-number
v-model=
"
formData.t
radeDeductUnitPrice"
v-model=
"
computedT
radeDeductUnitPrice"
placeholder=
"请输入积分抵扣金额"
placeholder=
"请输入积分抵扣金额"
style=
"width: 300px"
style=
"width: 300px"
:precision=
"2"
/>
/>
</el-form-item>
</el-form-item>
<el-form-item>
<el-form-item>
...
@@ -67,11 +67,19 @@ const dialogVisible = ref(false) // 弹窗的是否展示
...
@@ -67,11 +67,19 @@ 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
:
undefined
,
tradeDeductEnable
:
true
,
tradeDeductUnitPrice
:
undefined
,
tradeDeductUnitPrice
:
0
,
tradeDeductMaxPrice
:
undefined
,
tradeDeductMaxPrice
:
0
,
tradeGivePoint
:
undefined
tradeGivePoint
:
0
})
})
// 创建一个计算属性,用于将 tradeDeductUnitPrice 显示为带两位小数的形式
const
computedTradeDeductUnitPrice
=
computed
({
get
:
()
=>
(
formData
.
value
.
tradeDeductUnitPrice
/
100
).
toFixed
(
2
),
set
:
(
newValue
)
=>
{
formData
.
value
.
tradeDeductUnitPrice
=
Math
.
round
(
newValue
*
100
)
}
})
const
formRules
=
reactive
({})
const
formRules
=
reactive
({})
const
formRef
=
ref
()
// 表单 Ref
const
formRef
=
ref
()
// 表单 Ref
...
@@ -97,7 +105,8 @@ const onSubmit = async () => {
...
@@ -97,7 +105,8 @@ const onSubmit = async () => {
const
getConfig
=
async
()
=>
{
const
getConfig
=
async
()
=>
{
try
{
try
{
const
data
=
await
ConfigApi
.
getConfig
()
const
data
=
await
ConfigApi
.
getConfig
()
formData
.
value
=
data
// if (data === null) return
// formData.value = data
}
finally
{
}
finally
{
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment