Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taobao-mini-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
qinhaitao
taobao-mini-template
Commits
50a9e51c
Commit
50a9e51c
authored
Oct 12, 2020
by
李硕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
限制库存和不限库存切换校验限制
parent
59107fa8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
10 deletions
+7
-10
prize-dialog.js
client/components/dialog/prize-dialog/prize-dialog.js
+7
-10
No files found.
client/components/dialog/prize-dialog/prize-dialog.js
View file @
50a9e51c
...
...
@@ -69,7 +69,7 @@ Component({
status
:
"success"
,
content
:
""
,
},
goodIdTips
:
{
good
s
IdTips
:
{
status
:
"success"
,
content
:
""
,
},
...
...
@@ -397,11 +397,11 @@ Component({
}
//实物奖品的配置商品id
// if (type == OBJECT_TYPE) {
// if (!goodId) {
// this.showItemTips('goodIdTips', 'error', '请选择商品链接');
// if (!good
s
Id) {
// this.showItemTips('good
s
IdTips', 'error', '请选择商品链接');
// }
// else {
// this.showItemTips('goodIdTips', 'success', '');
// this.showItemTips('good
s
IdTips', 'success', '');
// }
// }
if
(
type
==
EQUITY_TYPE
||
type
==
OBJECT_TYPE
)
{
...
...
@@ -421,10 +421,7 @@ Component({
}
// 库存奖品的库存值判断
let
usePass
=
switchStock
==
1
?
+
stock
>
(
useStock
||
0
)
:
true
;
// console.log("stock==", stock, "useStock==", useStock, 'type===', type);
let
intNum
=
/^
[
1-9
]
+
[
0-9
]
*$/
;
let
stockPass
=
switchStock
==
1
?
(
intNum
.
test
(
+
stock
)
&&
+
stock
>
0
&&
+
stock
<=
99999
)
:
true
;
console
.
log
(
intNum
.
test
(
+
stock
),
+
stock
<=
0
,
+
stock
>
99999
,
usePass
);
let
stockPass
=
switchStock
==
1
?
!
validateRangeNumber
(
credits
,
[
0
,
99999
])
:
true
;
if
(
!
stockPass
||
!
usePass
)
{
this
.
showItemTips
(
"prizeNumberTips"
,
...
...
@@ -480,7 +477,7 @@ Component({
creditsValueTips
,
useUrlTips
,
prizeDescTips
,
goodIdTips
,
good
s
IdTips
,
}
=
this
.
data
;
const
isImagePass
=
image
&&
imageTips
.
status
!==
"error"
;
...
...
@@ -500,7 +497,7 @@ Component({
isImagePass
&&
probabilityTips
.
status
!==
"error"
&&
prizeNumberTips
.
status
!==
"error"
&&
goodIdTips
.
status
!==
"error"
&&
good
s
IdTips
.
status
!==
"error"
&&
prizeDescTips
.
status
!==
"error"
;
const
isCreditsPass
=
type
==
CREDITS_TYPE
&&
...
...
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