Commit c7d75c5d authored by zhaofei's avatar zhaofei

s

parent abe76149
......@@ -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) ||
......
......@@ -54,7 +54,7 @@ export const rateTableValidator = (rule, value, callback, source, options) => {
n += Number(item.probability)
})
}
const backUp = value.filter(item => item.backUp);
const backUp = value.filter(item => item.isBackUp);
if (backUp.length > 1) {
return new Error('降级奖品最多配置一个');
}
......
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