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
dab8aa92
Commit
dab8aa92
authored
Dec 10, 2020
by
zhaofei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
s
parent
fd85770f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
7 deletions
+12
-7
prize-dialog.axml
client/components/dialog/prize-dialog/prize-dialog.axml
+2
-1
prize-dialog.js
client/components/dialog/prize-dialog/prize-dialog.js
+1
-1
validate.js
client/utils/validate.js
+9
-5
No files found.
client/components/dialog/prize-dialog/prize-dialog.axml
View file @
dab8aa92
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
<view class="probability-prize-content-form">
<view class="probability-prize-content-form">
<form inline="true">
<form inline="true">
<form-item
<form-item
a:if="{{type !== 'rank'}}"
style="width:100%"
style="width:100%"
size="large"
size="large"
class="probability-prize-content-formItem"
class="probability-prize-content-formItem"
...
@@ -165,7 +166,7 @@
...
@@ -165,7 +166,7 @@
</form-item>
</form-item>
<form-item
<form-item
a:if="{{type==='probability'}}"
a:if="{{type==='probability'
&& !prizeInitData.isBackUp
}}"
style="width:100%"
style="width:100%"
size="large"
size="large"
class="probability-prize-content-formItem"
class="probability-prize-content-formItem"
...
...
client/components/dialog/prize-dialog/prize-dialog.js
View file @
dab8aa92
...
@@ -380,7 +380,7 @@ Component({
...
@@ -380,7 +380,7 @@ Component({
const
{
imageTips
}
=
this
.
data
;
const
{
imageTips
}
=
this
.
data
;
const
{
type
:
dialogType
,
maxRankLimit
}
=
this
.
props
;
const
{
type
:
dialogType
,
maxRankLimit
}
=
this
.
props
;
if
(
dialogType
==
"probability"
)
{
if
(
dialogType
==
"probability"
&&
isBackUp
)
{
let
probabilityRexp
=
/^
\d
+
(\.\d{1,2})?
$/
;
let
probabilityRexp
=
/^
\d
+
(\.\d{1,2})?
$/
;
if
(
if
(
!
probabilityRexp
.
test
(
probability
)
||
!
probabilityRexp
.
test
(
probability
)
||
...
...
client/utils/validate.js
View file @
dab8aa92
...
@@ -34,7 +34,7 @@ export const validateRangeNumber = (number, [min, max] = [], fixed = 0) => {
...
@@ -34,7 +34,7 @@ export const validateRangeNumber = (number, [min, max] = [], fixed = 0) => {
console
.
error
(
'数字范围的最小值不能大于最大值'
);
console
.
error
(
'数字范围的最小值不能大于最大值'
);
return
;
return
;
}
}
if
(
number
!=
0
)
{
if
(
number
!=
0
)
{
if
(
!
pattern
.
test
(
number
)
||
number
===
''
)
return
false
;
if
(
!
pattern
.
test
(
number
)
||
number
===
''
)
return
false
;
}
}
...
@@ -49,12 +49,16 @@ export const rateTableValidator = (rule, value, callback, source, options) => {
...
@@ -49,12 +49,16 @@ export const rateTableValidator = (rule, value, callback, source, options) => {
if
(
!
value
.
length
||
!
value
)
{
if
(
!
value
.
length
||
!
value
)
{
return
new
Error
(
'请至少配置一个奖品'
);
return
new
Error
(
'请至少配置一个奖品'
);
}
}
if
(
value
.
length
)
{
if
(
value
.
length
)
{
value
.
forEach
(
item
=>
{
value
.
forEach
(
item
=>
{
n
+=
Number
(
item
.
probability
)
n
+=
Number
(
item
.
probability
)
})
})
}
}
if
(
n
>
100
){
const
backUp
=
value
.
filter
(
item
=>
item
.
backUp
);
if
(
backUp
.
length
>
1
)
{
return
new
Error
(
'降级奖品最多配置一个'
);
}
if
(
n
>
100
)
{
return
new
Error
(
'总概率不能大于100%'
);
return
new
Error
(
'总概率不能大于100%'
);
}
}
return
callback
()
return
callback
()
...
...
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