Commit dab8aa92 authored by zhaofei's avatar zhaofei

s

parent fd85770f
......@@ -9,6 +9,7 @@
<view class="probability-prize-content-form">
<form inline="true">
<form-item
a:if="{{type !== 'rank'}}"
style="width:100%"
size="large"
class="probability-prize-content-formItem"
......@@ -165,7 +166,7 @@
</form-item>
<form-item
a:if="{{type==='probability'}}"
a:if="{{type==='probability' && !prizeInitData.isBackUp}}"
style="width:100%"
size="large"
class="probability-prize-content-formItem"
......
......@@ -380,7 +380,7 @@ Component({
const { imageTips } = this.data;
const { type: dialogType, maxRankLimit } = this.props;
if (dialogType == "probability") {
if (dialogType == "probability" && isBackUp) {
let probabilityRexp = /^\d+(\.\d{1,2})?$/;
if (
!probabilityRexp.test(probability) ||
......
......@@ -34,7 +34,7 @@ export const validateRangeNumber = (number, [min, max] = [], fixed = 0) => {
console.error('数字范围的最小值不能大于最大值');
return;
}
if(number != 0){
if (number != 0) {
if (!pattern.test(number) || number === '') return false;
}
......@@ -49,13 +49,17 @@ export const rateTableValidator = (rule, value, callback, source, options) => {
if (!value.length || !value) {
return new Error('请至少配置一个奖品');
}
if(value.length){
value.forEach(item=>{
if (value.length) {
value.forEach(item => {
n += Number(item.probability)
})
}
if(n>100){
return new Error('总概率不能大于100%');
const backUp = value.filter(item => item.backUp);
if (backUp.length > 1) {
return new Error('降级奖品最多配置一个');
}
if (n > 100) {
return new Error('总概率不能大于100%');
}
return callback()
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment