小程式之簡訊驗證
阿新 • • 發佈:2018-12-21
在此描述一下前端實現效果的思路:當用戶輸入完手機號,點擊發送驗證碼時候,要判斷現在能否點選(能點選:使用者手機號正確且不在傳送驗證碼過程中;不能點選:使用者輸入的手機號不對或者已經在傳送驗證碼過程中),然後做相應的處理。
wxml程式碼:<form bindsubmit='formsubmit'> <view class='people_info_box'> <view class='people_info_item'> <view class='people_info_box_name'> <view>姓名</view> </view> <view class='people_info_box_cont'> <input type='text' value='哈嘍'></input> </view> </view><view class='people_info_item'> <view class='people_info_box_name'> <view>手機號</view> </view> <view class='people_info_box_cont'> <input type='number' placeholder='輸入手機號' maxlength='11' bindinput='input_val'></input> </view> </view> <view class='people_info_item'> <view class='people_info_box_name'> <view>驗證碼</view> </view> <view class='people_info_box_contsinge'> <input type='text' value='' placeholder='輸入驗證碼' class='single'></input> </view> <view class='people_info_box_code'> <text bindtap='check'>{{show_get_code}}</text> </view> </view> </view> <button class='wc_btn' name="wc_btn" form-type='submit'>提交</button> </form></pre>