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 82fd1a90
authored
Mar 11, 2026
by
cen
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: 入参问题
1 parent
272c3699
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
pages/boutique/tool/components/CreateOrder.vue
pages/boutique/tool/components/CreateOrder.vue
View file @
82fd1a9
...
@@ -274,7 +274,7 @@ export default {
...
@@ -274,7 +274,7 @@ export default {
const
qty
=
parseInt
(
number
||
1
)
const
qty
=
parseInt
(
number
||
1
)
if
(
!
price
||
!
orderTypeCode
)
{
if
(
!
price
||
!
orderTypeCode
)
{
return
Math
.
round
(
price
*
qty
*
100
)
/
100
return
utils
.
ceilDecimal
(
price
*
qty
)
}
}
const
orderType
=
String
(
orderTypeCode
||
''
)
const
orderType
=
String
(
orderTypeCode
||
''
)
...
@@ -286,16 +286,16 @@ export default {
...
@@ -286,16 +286,16 @@ export default {
const
ratio
=
parseFloat
(
strategyConfig
.
discountRatio
)
const
ratio
=
parseFloat
(
strategyConfig
.
discountRatio
)
if
(
ratio
>=
0.1
&&
ratio
<=
10
)
{
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
)
{
}
else
if
(
strategyConfig
.
mode
===
'amount'
&&
strategyConfig
.
discountAmount
)
{
const
discountAmount
=
parseFloat
(
strategyConfig
.
discountAmount
)
const
discountAmount
=
parseFloat
(
strategyConfig
.
discountAmount
)
if
(
discountAmount
>=
0.01
&&
discountAmount
<=
price
)
{
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' 买赠策略
// '3' 买赠策略
...
@@ -303,7 +303,7 @@ export default {
...
@@ -303,7 +303,7 @@ export default {
if
(
strategyConfig
.
isGift
===
'1'
)
{
if
(
strategyConfig
.
isGift
===
'1'
)
{
return
0
return
0
}
}
return
Math
.
round
(
price
*
qty
*
100
)
/
100
return
utils
.
ceilDecimal
(
price
*
qty
)
}
}
// '5' 组合付款
// '5' 组合付款
...
@@ -312,13 +312,13 @@ export default {
...
@@ -312,13 +312,13 @@ export default {
const
deductAmount
=
parseFloat
(
strategyConfig
.
deductAmount
)
const
deductAmount
=
parseFloat
(
strategyConfig
.
deductAmount
)
if
(
deductAmount
>=
0.01
&&
deductAmount
<=
price
)
{
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
// 计算主订单的总 finalPrice
calculateTotalFinalPrice
(
subGoodsList
)
{
calculateTotalFinalPrice
(
subGoodsList
)
{
...
@@ -326,7 +326,7 @@ export default {
...
@@ -326,7 +326,7 @@ export default {
const
total
=
subGoodsList
.
reduce
((
sum
,
item
)
=>
{
const
total
=
subGoodsList
.
reduce
((
sum
,
item
)
=>
{
return
sum
+
parseFloat
(
item
.
finalPrice
||
0
)
return
sum
+
parseFloat
(
item
.
finalPrice
||
0
)
},
0
)
},
0
)
return
Math
.
round
(
total
*
100
)
/
100
return
utils
.
ceilDecimal
(
total
)
},
},
// 根据 discountType、discountValue 等字段构建 strategyConfig(用于回显)
// 根据 discountType、discountValue 等字段构建 strategyConfig(用于回显)
buildStrategyConfigFromDiscountFields
(
item
,
orderTypeCode
)
{
buildStrategyConfigFromDiscountFields
(
item
,
orderTypeCode
)
{
...
...
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