Commit c7d75c5d authored by zhaofei's avatar zhaofei

s

parent abe76149
...@@ -207,13 +207,14 @@ Component({ ...@@ -207,13 +207,14 @@ Component({
plugin.setBridge(bridge); plugin.setBridge(bridge);
}, },
// 编辑更换类型时重置数据 // 编辑更换类型时重置数据
resetPrizeData(type, rank) { resetPrizeData(type, rank, isBackUp) {
this.setData({ this.setData({
prizeInitData: { prizeInitData: {
...INIT_DATA, ...INIT_DATA,
type, type,
_id: null, _id: null,
rank, rank,
isBackUp
}, },
}); });
}, },
...@@ -232,11 +233,10 @@ Component({ ...@@ -232,11 +233,10 @@ Component({
credits: "", credits: "",
probability: "", probability: "",
name: "", name: "",
isBackUp: false,
switchStock: STOCK_NO_LIMIT, switchStock: STOCK_NO_LIMIT,
}; };
if (type !== value) { if (type !== value) {
this.resetPrizeData(+value, rank); this.resetPrizeData(+value, rank, isBackUp);
return; return;
} }
this.setData({ this.setData({
...@@ -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" && isBackUp) { if (dialogType == "probability" && !isBackUp) {
let probabilityRexp = /^\d+(\.\d{1,2})?$/; let probabilityRexp = /^\d+(\.\d{1,2})?$/;
if ( if (
!probabilityRexp.test(probability) || !probabilityRexp.test(probability) ||
......
...@@ -54,7 +54,7 @@ export const rateTableValidator = (rule, value, callback, source, options) => { ...@@ -54,7 +54,7 @@ export const rateTableValidator = (rule, value, callback, source, options) => {
n += Number(item.probability) n += Number(item.probability)
}) })
} }
const backUp = value.filter(item => item.backUp); const backUp = value.filter(item => item.isBackUp);
if (backUp.length > 1) { if (backUp.length > 1) {
return new Error('降级奖品最多配置一个'); 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