Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
gl_tape
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
3
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit cc60e173
authored
Mar 11, 2026
by
cen
Committed by
chenwq1
Mar 18, 2026
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: 入参问题
1 parent
92f17f98
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
pages/boutique/tool/components/CreateOrder.vue
pages/boutique/tool/components/CreateOrder.vue
View file @
cc60e17
...
...
@@ -274,7 +274,7 @@ export default {
const
qty
=
parseInt
(
number
||
1
)
if
(
!
price
||
!
orderTypeCode
)
{
return
Math
.
round
(
price
*
qty
*
100
)
/
100
return
utils
.
ceilDecimal
(
price
*
qty
)
}
const
orderType
=
String
(
orderTypeCode
||
''
)
...
...
@@ -286,16 +286,16 @@ export default {
const
ratio
=
parseFloat
(
strategyConfig
.
discountRatio
)
if
(
ratio
>=
0.1
&&
ratio
<=
10
)
{
// 单价 * 折扣比例 * 数量
return
Math
.
round
(
price
*
(
ratio
/
10
)
*
qty
*
100
)
/
100
return
utils
.
ceilDecimal
(
price
*
(
ratio
/
10
)
*
qty
)
}
}
else
if
(
strategyConfig
.
mode
===
'amount'
&&
strategyConfig
.
discountAmount
)
{
const
discountAmount
=
parseFloat
(
strategyConfig
.
discountAmount
)
if
(
discountAmount
>=
0.01
&&
discountAmount
<=
price
)
{
// (单价 - 折扣金额) * 数量
return
Math
.
round
((
price
-
discountAmount
)
*
qty
*
100
)
/
100
return
utils
.
ceilDecimal
((
price
-
discountAmount
)
*
qty
)
}
}
return
Math
.
round
(
price
*
qty
*
100
)
/
100
return
utils
.
ceilDecimal
(
price
*
qty
)
}
// '3' 买赠策略
...
...
@@ -303,7 +303,7 @@ export default {
if
(
strategyConfig
.
isGift
===
'1'
)
{
return
0
}
return
Math
.
round
(
price
*
qty
*
100
)
/
100
return
utils
.
ceilDecimal
(
price
*
qty
)
}
// '5' 组合付款
...
...
@@ -312,13 +312,13 @@ export default {
const
deductAmount
=
parseFloat
(
strategyConfig
.
deductAmount
)
if
(
deductAmount
>=
0.01
&&
deductAmount
<=
price
)
{
// (单价 - 抵扣金额) * 数量
return
Math
.
round
((
price
-
deductAmount
)
*
qty
*
100
)
/
100
return
utils
.
ceilDecimal
((
price
-
deductAmount
)
*
qty
)
}
}
return
Math
.
round
(
price
*
qty
*
100
)
/
100
return
utils
.
ceilDecimal
(
price
*
qty
)
}
return
Math
.
round
(
price
*
qty
*
100
)
/
100
return
utils
.
ceilDecimal
(
price
*
qty
)
},
// 计算主订单的总 finalPrice
calculateTotalFinalPrice
(
subGoodsList
)
{
...
...
@@ -326,7 +326,7 @@ export default {
const
total
=
subGoodsList
.
reduce
((
sum
,
item
)
=>
{
return
sum
+
parseFloat
(
item
.
finalPrice
||
0
)
},
0
)
return
Math
.
round
(
total
*
100
)
/
100
return
utils
.
ceilDecimal
(
total
)
},
// 根据 discountType、discountValue 等字段构建 strategyConfig(用于回显)
buildStrategyConfigFromDiscountFields
(
item
,
orderTypeCode
)
{
...
...
@@ -1001,7 +1001,7 @@ export default {
number
:
e
.
multipleSpecificationsGoods
.
number
,
merchantGoodsId
:
goods
.
id
||
goods
.
merchantGoodsId
,
finalPrice
:
finalPrice
,
// 商品实付单价(向上取整保留两位)
// 商品实付单价(向上取整保留两位)
singleProductFinalPrice
:
utils
.
ceilDecimal
(
unitFinalPrice
),
discountType
:
discountFields
.
discountType
,
discountValue
:
discountFields
.
discountValue
,
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment