Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
op-web-service
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bp
op-web-service
Commits
9b2fe1b0
Commit
9b2fe1b0
authored
Jul 27, 2021
by
mengwenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:商品-更改原价可以为空
parent
acdba7f3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
index.vue
src/pages/Goods/Detail/index.vue
+10
-9
No files found.
src/pages/Goods/Detail/index.vue
View file @
9b2fe1b0
...
...
@@ -1144,7 +1144,9 @@ export default {
// 更改售价
salePrice
()
{
if
(
!
this
.
goodsObj
.
price
)
{
this
.
$nextTick
(()
=>
{
this
.
goodsObj
.
price
=
""
;
})
}
const
parseFloatValue
=
Number
(
this
.
goodsObj
.
price
).
toFixed
(
2
);
this
.
goodsObj
.
price
=
Number
(
parseFloatValue
);
...
...
@@ -1152,7 +1154,7 @@ export default {
typeof
this
.
goodsObj
.
price
===
"number"
&&
isNaN
(
this
.
goodsObj
.
price
)
)
{
this
.
goodsObj
.
price
=
0
;
this
.
goodsObj
.
price
=
""
;
return
this
.
$message
.
error
(
"售价价格必须为数字"
);
}
},
...
...
@@ -1160,7 +1162,9 @@ export default {
// 更改原价
perPrice
()
{
if
(
!
this
.
goodsObj
.
original_price
)
{
this
.
$nextTick
(()
=>
{
this
.
goodsObj
.
original_price
=
""
;
})
}
const
parseOriginalPrice
=
Number
(
this
.
goodsObj
.
original_price
).
toFixed
(
2
...
...
@@ -1170,7 +1174,7 @@ export default {
typeof
this
.
goodsObj
.
original_price
===
"number"
&&
isNaN
(
this
.
goodsObj
.
original_price
)
)
{
this
.
goodsObj
.
original_price
=
0
;
this
.
goodsObj
.
original_price
=
""
;
return
this
.
$message
.
error
(
"原价价格必为数字"
);
}
},
...
...
@@ -1266,10 +1270,7 @@ export default {
if
(
!
query
.
rule_refund
)
{
return
this
.
$message
.
error
(
"请填写退款规则"
);
}
if
(
query
.
original_price
.
length
===
0
)
{
return
this
.
$message
.
error
(
"请填写原价(保留两位小数)"
);
}
if
(
query
.
original_price
==
0
)
{
if
(
query
.
original_price
===
"0"
)
{
return
this
.
$message
.
error
(
"原价价格不得为0"
);
}
if
(
query
.
price
.
length
===
0
)
{
...
...
@@ -1278,7 +1279,7 @@ export default {
if
(
query
.
price
==
0
)
{
return
this
.
$message
.
error
(
"售价价格不得为0"
);
}
if
(
typeof
query
.
original_price
!==
"number"
)
{
if
(
query
.
original_price
&&
typeof
query
.
original_price
!==
"number"
)
{
return
this
.
$message
.
error
(
"原价价格必须为数字"
);
}
if
(
typeof
query
.
price
!==
"number"
)
{
...
...
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