小程序防重复点击都怎么做的?

发布于 2020-11-09 00:13:02

你们的小程序防重复点击都怎么做的

查看更多

浏览量
3078
1 个回答
猫哥
猫哥 项目组成员 2020-11-09
希望我的回答能对你有所帮助
//领取按钮
getCoupon(e){
    const that = this;
    if(this.disabled){
        return false;
    }
    this.disabled = true;
    const id = e.currentTarget.dataset.id;
    App._post_form('user/getcoupon',{id:id},(res,obj)=>{
        App.showSuccess('领取成功',()=>{
            wx.navigateTo({
              url: '/pages/user/coupon',
            });
        });
    },null,()=>{
        setTimeout(function(){
            that.disabled = false;
        },500);
    });
},

学习
记录

发布
问题

分享
好友

手机
浏览

扫码手机浏览