最近在给一个门诊部开发微信预约医生的小项目,界面如下:
希望在点击性别下面的input 输入框时后弹出如下界面:
结果总是唤起键盘输入界面如下:
用语言描述就是点击input选择男和女时候,总是会唤起手机的键盘。导致没法使用小程序的控件,后来经过反复测试。禁用了input,代码如下:
<input class="ipt" disabled="true" placeholder-class="placeholder_style" name="password" type="text" placeholder="请输入您的性别" value="{{array[index]}}"></input>
原来的完整代码如下(错误的):
<picker value="{{index}}" range="{{array}}" bindchange="bindPickerChange"><view class="picker" bindchange="bindPickerChange"><text class="detial_text" >性别:</text><input class="ipt" placeholder-class="placeholder_style" name="password" type="text" placeholder="请输入您的性别" value="{{array[index]}}"></input></view>
</picker>
正确的完整代码如下:
<picker value="{{index}}" range="{{array}}" bindchange="bindPickerChange"><view class="picker" bindchange="bindPickerChange"><text class="detial_text" >性别:</text><input class="ipt" disabled="true" placeholder-class="placeholder_style" name="password" type="text" placeholder="请输入您的性别" value="{{array[index]}}"></input></view>
</picker>
经过测试,一切ok!