在wxml文件里绑定:
<view class=‘wel-list‘ bindtap=‘TZdown‘> <image src="/images/welcome_08.png"></image> <text>C语言资料下载</text> </view>
在js文件里相应:
Page({ TZdown: function () { wx.navigateTo({ url: ‘../download/download‘ }); }})
wxml文件:
<input type="number" placeholder="请输入手机号" class="inp-holder" maxlength="11" bindinput="getPhone" />
<input type="number" placeholder="请输入验证码" class="inp-holder" maxlength="6" bindinput="getCode" />
js文件:
// 拿到手机号 getPhone: function (e) { var val = e.detail.value; this.setData({ telphone: val }); }, // 拿到验证码 getCode: function (e) { var val = e.detail.value; this.setData({ code: val }); },
<input type="number" placeholder="请输入手机号" class="inp-holder" maxlength="11" bindinput="getPhone" />