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
c7d75c5d
Commit
c7d75c5d
authored
Dec 10, 2020
by
zhaofei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
s
parent
abe76149
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
prize-dialog.js
client/components/dialog/prize-dialog/prize-dialog.js
+4
-4
validate.js
client/utils/validate.js
+1
-1
No files found.
client/components/dialog/prize-dialog/prize-dialog.js
View file @
c7d75c5d
...
...
@@ -207,13 +207,14 @@ Component({
plugin
.
setBridge
(
bridge
);
},
// 编辑更换类型时重置数据
resetPrizeData
(
type
,
rank
)
{
resetPrizeData
(
type
,
rank
,
isBackUp
)
{
this
.
setData
({
prizeInitData
:
{
...
INIT_DATA
,
type
,
_id
:
null
,
rank
,
isBackUp
},
});
},
...
...
@@ -232,11 +233,10 @@ Component({
credits
:
""
,
probability
:
""
,
name
:
""
,
isBackUp
:
false
,
switchStock
:
STOCK_NO_LIMIT
,
};
if
(
type
!==
value
)
{
this
.
resetPrizeData
(
+
value
,
rank
);
this
.
resetPrizeData
(
+
value
,
rank
,
isBackUp
);
return
;
}
this
.
setData
({
...
...
@@ -380,7 +380,7 @@ Component({
const
{
imageTips
}
=
this
.
data
;
const
{
type
:
dialogType
,
maxRankLimit
}
=
this
.
props
;
if
(
dialogType
==
"probability"
&&
isBackUp
)
{
if
(
dialogType
==
"probability"
&&
!
isBackUp
)
{
let
probabilityRexp
=
/^
\d
+
(\.\d{1,2})?
$/
;
if
(
!
probabilityRexp
.
test
(
probability
)
||
...
...
client/utils/validate.js
View file @
c7d75c5d
...
...
@@ -54,7 +54,7 @@ export const rateTableValidator = (rule, value, callback, source, options) => {
n
+=
Number
(
item
.
probability
)
})
}
const
backUp
=
value
.
filter
(
item
=>
item
.
b
ackUp
);
const
backUp
=
value
.
filter
(
item
=>
item
.
isB
ackUp
);
if
(
backUp
.
length
>
1
)
{
return
new
Error
(
'降级奖品最多配置一个'
);
}
...
...
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