<view class=‘phoneMask {{phoneMask == false?“hide”:""}}’>
<view class=‘phoneView’>
<view class=‘phoneTitle’>请完善以下信息获取预估装修价格</view>
<input placeholder=“姓名” type=“text” maxlength=“11” bindinput=“inputName” auto-focus />
<input placeholder=“电话” type=“number” maxlength=“11” bindinput=“inputPhoneNum”/>
<input type=“number” maxlength=“11” bindinput=“addCode” style=‘width:240rpx;’/>
<view class=‘codeButton’ bindtap=“sendMsg” wx:if="{{send}}">获取短信验证码</view>
<view class=‘codeButton’ wx:if="{{alreadySend}}">{{second+“s”}}</view>
<view class=‘submitButton active’ bindtap=‘onSubmit’ wx:if="{{buttonType}}">提交</view>
<view class=‘submitButton’ wx:if="{{!buttonType}}">提交</view>
</view>
</view>
代码片段如上,如果上层view在隐藏的情况下,iphonex和5s使用auto-focus会导致微信程序崩溃。安卓手机则无此问题。