<view class="flex jc-between">
<view>联系方式</view>
<input class="plan-text" bindblur="inputtaskphone" bindfocus="focus" value="{{task.phone}}" placeholder="{{placeholder}}" type="digit" />
<view class="flex red margin-right-20" style="position: absolute;right: 0;" wx:if="{{phonedisplay}}">
<van-icon name="warning-o" />
<view style="margin-right: 100rpx;">联系方式错误</view>
</view>
</view>
inputtaskphone(e) {
if(e.detail.value!=“”){
if (!(/^1[3456789]\d{9}$/.test(e.detail.value))) {
this.setData({
phonedisplay: true,
placeholder: “”,
“task.phone”:“”
})
}
}
},
focus() {
this.setData({
phonedisplay: false,
placeholder: “请输入联系方式”,
“task.phone”:“”
})
},文章来源:https://www.toymoban.com/news/detail-488742.html
data: {
task: {
phone: “”
},
phonedisplay: false,
placeholder: “请输入联系方式”
},文章来源地址https://www.toymoban.com/news/detail-488742.html
到了这里,关于微信小程序input输入框校验手机号输入错误的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!