新建按钮
<button class="weui-btn" type="default" bindtap="scan">扫码</button>
js实现
scan:function(){ wx.scanCode({ success:function(res){ console.log('扫码返回:'+res.result) } }) }