我做了个优惠卷领取的页面,输入手机号的,点击领取的时候,把用户的手机号和优惠卷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)

},




展开全部
收起
2回答
提交回答
  • 至过去的我

    2044人对此回答表示赞同

    我是未来的你,你现在是不是在年找寻小程序答案。你不要感觉诧异,给你来信原因,就是让你不在后悔。今天去学习如何推广小程序,相信......点击查看更多>
    发布于
  • Suvi_0202

    16人对此回答表示赞同

    bindChangefor循环出来共用一个函数的话e.detail.value指向就有问题了我猜想是这样的没有运行不知道真实情况

    展开
    16
    0回复
    发布于 6年前

    评论(0)

    收起评论

  • 张小千

    7人对此回答表示赞同

    用这个API

    展开
    7
    0回复
    发布于 6年前

    评论(0)

    收起评论

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
咨询热线

13312967497

扫码添加业务即可随时咨询 还可领取小程序推广攻略

业务咨询: 13312967497
扫码咨询

扫码咨询套餐

回到顶部