Commit 2e9c8e2e by zhangxw

输入框输入限制

1 parent d1f8b4f9
...@@ -59,21 +59,30 @@ Page({ ...@@ -59,21 +59,30 @@ Page({
}, },
onProfitInput(e) { onProfitInput(e) {
const val = e.detail.value || '' let val = e.detail.value || ""
if (val.length > 50) {
val = val.substring(0, 50)
}
this.setData({ this.setData({
'infoData.profitRule': val, 'infoData.profitRule': val,
profitLength: val.length profitLength: val.length
}) })
}, },
onProductInput(e) { onProductInput(e) {
const val = e.detail.value || '' let val = e.detail.value || ""
if (val.length > 50) {
val = val.substring(0, 50)
}
this.setData({ this.setData({
'infoData.productInfo': val, 'infoData.productInfo': val,
productLength: val.length productLength: val.length
}) })
}, },
onFailInput(e) { onFailInput(e) {
const val = e.detail.value || '' let val = e.detail.value || ""
if (val.length > 100) {
val = val.substring(0, 100)
}
this.setData({ this.setData({
'infoData.failReason': val, 'infoData.failReason': val,
failLength: val.length failLength: val.length
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!