wx.createSelectorQuery()用这个API
求助,for循环中获取循环里面的input的值我做了个优惠卷领取的页面,输入手机号的,点击领取的时候,把用户的手机号和优惠卷id传到后台,现在我获取不到用户输入的手机号了,求大神指教 <view class="container"> <block wx:for="{{images}}" > <view class="item" > <view class="viewimage"> <image class="slide-image" src="{{item.imgUrl}}"/> </view> <view class="inputArea"> <text class="textw">联系方式</text> <input id="userPhone{{item.id}}" class="inputw" bindinput="bindChange" placeholder="" type="number" value="{{userPhone}}"/> <button type="" data-conponid="{{item.id}}" bindtap="saveCoupon" class="lingqu">领取</button> </view> </view> </block> </view> js var mobile=""; bindChange:function(e,mobile){ mobile = e.detail.value; console.log(mobile) }, saveCoupon: function (e,mobile) { console.log(e) console.log(mobile); var that = this; console.log(that.data.userPhone) },
2018-07-06