feat: 领取优惠券新增节流功能

master
Yer 2023-07-28 10:49:20 +08:00
parent fcc99b61e8
commit 02812a9128
1 changed files with 10 additions and 2 deletions

View File

@ -119,8 +119,15 @@
/** /**
* 领取优惠券 * 领取优惠券
*/ */
receive(item) { receive(val) {
receiveCoupons(item.id).then((res) => { this.$u.throttle(()=>{
this.fetchCoupon(val)
}, 1500)
},
fetchCoupon(val){
receiveCoupons(val.id).then((res) => {
if (res.data.code == 200) { if (res.data.code == 200) {
uni.showToast({ uni.showToast({
title: "领取成功", title: "领取成功",
@ -134,6 +141,7 @@
} }
}); });
}, },
/** /**
* 加载更多 * 加载更多
*/ */