wxml
view>手機號:</view>
<input value="{{phone}}" bindinput="bindPhone" placeholder="請輸入手機號"></input>
<view>驗證碼: <text>點擊獲取驗證碼</text>
</view>
<input value="{{code}}" bindinput="bindCode" placeholder="請輸入驗證碼"></input>
js
data: { phone:"", code:"" }, bindPhone:function(e){ this.setData({phone:e.detail.value}); }, bindCode:function(e){ this.setData({code:e.detail.value}); },