<view class="form-field dis-flex flex-y-center">
<view class="field-label">手机号:</view>
<view class="field-input flex-box">
<input name="mobile" placeholder="请输入手机号" value="{{mobile}}"></input>
</view>
</view>
<view class="form-field dis-flex flex-y-center">
<view class="field-label">短信验证码:</view>
<view class="field-input flex-box">
<input name="sms-code" placeholder="请输入短信验证码" style="float:left;width:230rpx"></input>
<label style="float:right;margin-top:12rpx;color:#006400;pointer-events: {{isDisabled}};" bindtap="getcode">{{codetime}}</label>
</view>
</view>
//获取验证码
getcode:function(){
mobile = ?这里怎么获取到手机字段的值呢,dom不行,这下有点尴尬。
}
input组件上使用bindinput获取
https://developers.weixin.qq.com/miniprogram/dev/component/input.html
或者使用双向绑定
https://developers.weixin.qq.com/miniprogram/dev/framework/view/two-way-bindings.html