活动报名静态界面3.1
This commit is contained in:
parent
510965cf44
commit
23d876ee73
|
|
@ -161,14 +161,6 @@ export default {
|
|||
return;
|
||||
}
|
||||
this.selectedNumber = value;
|
||||
// 根据人数计算价格
|
||||
if (value === "1") {
|
||||
this.price = 100;
|
||||
} else if (value === "2") {
|
||||
this.price = 180;
|
||||
} else {
|
||||
this.price = 100; // 自定义价格,可以根据需要调整
|
||||
}
|
||||
},
|
||||
|
||||
// 提交报名
|
||||
|
|
@ -259,8 +251,11 @@ export default {
|
|||
|
||||
onCustomNumberInput(e) {
|
||||
const value = e.detail.value;
|
||||
// 只允许输入数字
|
||||
this.customNumber = value.replace(/[^\d]/g, "");
|
||||
// 只允许输入数字,且小于99
|
||||
const numValue = value.replace(/[^\d]/g, "");
|
||||
if (numValue === "" || parseInt(numValue) < 99) {
|
||||
this.customNumber = numValue;
|
||||
}
|
||||
},
|
||||
|
||||
confirmCustomNumber() {
|
||||
|
|
@ -271,6 +266,16 @@ export default {
|
|||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const numValue = parseInt(this.customNumber);
|
||||
if (numValue >= 99) {
|
||||
uni.showToast({
|
||||
title: "人数不能大于等于99",
|
||||
icon: "none",
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
this.selectedNumber = this.customNumber;
|
||||
this.showCustomNumberModal = false;
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user