>》>》>》>》

支付按钮防止点击多次

用遮罩限制住

 

 

buy(){
            wx.showLoading({
                title: '加载中...',
                mask: true
            })

            api.me.saveAddress(this.receipt).then(data => {
                if(data.retCode == '0'){
                    this.order.addressId = data.id
                    return true
                }else{
                    wx.showToast({
                        title: data.message,
                        icon: 'none',
                        duration: 3000
                    });
                }
            }).then(flag => {
                if(flag){


                    api.init.createorder(this.order).then(generate => {
                        console.log(generate)
                        if(generate.retCode == "0"){
                            api.pay.pull({orderId: generate.orderId, openId: this.$app.$options.globalData.openid}).then(payment => {
                                if(payment.retCode == "0"){


                                    wx.hideLoading()


                                    wx.requestPayment({
                                        success (res) { 
                                            wx.showLoading({
                                                title: '请稍后……',
                                            })
                                            _this.confirmActive(appUserId)
                                        },
                                        fail (res) { console.log(res) }
                                    })

来个链接:

https://blog.csdn.net/qappleh/article/details/80419463

posted @ 2019-10-12 15:12  大、锤  阅读(483)  评论(0编辑  收藏  举报