|
@@ -216,6 +216,11 @@ export default {
|
|
|
this.$msg('请输入充值金额');
|
|
this.$msg('请输入充值金额');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+ // 金额小数点后只能两位
|
|
|
|
|
+ if (this.amount.split('.')[1] && this.amount.split('.')[1].length > 2) {
|
|
|
|
|
+ this.$msg('充值金额最小到分');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
for (let i = 0; i < this.rules.length; i++) {
|
|
for (let i = 0; i < this.rules.length; i++) {
|
|
|
const rule = this.rules[i];
|
|
const rule = this.rules[i];
|
|
|
|
|
|
|
@@ -235,6 +240,18 @@ export default {
|
|
|
this.$msg(`请输入第${i+1}项最低消费`);
|
|
this.$msg(`请输入第${i+1}项最低消费`);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+ if (rule.hbAmount.split('.')[1] && rule.hbAmount.split('.')[1].length > 2) {
|
|
|
|
|
+ this.$msg('红包金额最小到分');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (rule.miniCost.split('.')[1] && rule.miniCost.split('.')[1].length > 2) {
|
|
|
|
|
+ this.$msg('最低消费最小到分');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (isNaN(rule.duration) || rule.duration % 1 !== 0 || rule.duration < 0) {
|
|
|
|
|
+ this.$msg('有效时长必须为正整数');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
sendHbRule({id: this.id, amount: this.amount, rules: this.rules}).then(res => {
|
|
sendHbRule({id: this.id, amount: this.amount, rules: this.rules}).then(res => {
|