<view class=‘question’>
<view class=‘quest1’>
<view class=‘topic’>姓名</view>
<input placeholder=‘联系人称呼’ class=‘input’ bindinput=‘inputname’ maxlength=‘10’></input>
</view>
<view class=‘quest1’>
<view class=‘topic’>手机</view>
<input placeholder=‘请填写手机号码’ class=‘input2’ bindinput=‘inputphone’ type=‘number’ maxlength=‘11’></input>
<view class=‘vertical’></view>
<view class=‘code’ bindtap=‘sendmessage’ wx:if="{{send}}">发送验证码</view>
<view class=‘code2’ wx:if="{{unsend}}">{{second}}{{sendtext}}</view>
</view>
<view class=‘quest2’>
<view class=‘topic’>验证码</view>
<input placeholder=‘请输入收到的验证码’ class=‘input’ bindinput=‘inputcode’ type=‘number’></input>
</view>
</view>
/**
* 输入框名字
*/
inputname: function (e) {
console.log(e.detail.value)
this.setData({
name: e.detail.value
})
},
/**
* 输入框手机号
*/
inputphone: function (e) {
console.log(e.detail.value)
this.setData({
phone: e.detail.value
})
},
/**
* 输入框验证码
*/
inputcode: function (e) {
console.log(e.detail.value)
this.setData({
code: e.detail.value
})
},
获取到的参数长度为0 或者缺少长度 安卓机型部分出现