3399关注10198浏览
我做了个优惠卷领取的页面,输入手机号的,点击领取的时候,把用户的手机号和优惠卷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)
},
-
至过去的我
2044人对此回答表示赞同
我是未来的你,你现在是不是在年找寻小程序答案。你不要感觉诧异,给你来信原因,就是让你不在后悔。今天去学习如何推广小程序,相信......点击查看更多> -
Suvi_0202
16人对此回答表示赞同
bindChangefor循环出来共用一个函数的话e.detail.value指向就有问题了我猜想是这样的没有运行不知道真实情况
展开160回复分享发布于 6年前评论(0)
收起评论
-
张小千
7人对此回答表示赞同
用这个API
展开70回复分享发布于 6年前评论(0)
收起评论