Commit 822785d7 by Lin

feat: 弹框提交校验提示

1 parent bf40cbbb
...@@ -64,7 +64,7 @@ Component({ ...@@ -64,7 +64,7 @@ Component({
} }
// 实时校验:如果输入值大于maxValue,显示toast提示 // 实时校验:如果输入值大于maxValue,显示toast提示
if (value && value.trim() !== '') { if (value && value.trim() !== '' && appealType != 'recording') {
const numValue = appealType === 'recording' ? parseInt(value, 10) : parseFloat(value) const numValue = appealType === 'recording' ? parseInt(value, 10) : parseFloat(value)
if (!isNaN(numValue) && numValue > maxValue) { if (!isNaN(numValue) && numValue > maxValue) {
// 显示toast提示 // 显示toast提示
...@@ -310,7 +310,7 @@ Component({ ...@@ -310,7 +310,7 @@ Component({
// 验证数值有效性 // 验证数值有效性
if (isNaN(num) || num < 0 || num > maxValue) { if (isNaN(num) || num < 0 || num > maxValue) {
wx.showToast({ title: `请输入正确的${unit}(0-${maxValue})`, icon: 'none' }) wx.showToast({ title: `${unit}数需在${maxValue}${unit}以内`, icon: 'none' })
return return
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!