diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/service/impl/ActiveRecommendRecordsServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/service/impl/ActiveRecommendRecordsServiceImpl.java index 0244e8245..a319d3c3f 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/service/impl/ActiveRecommendRecordsServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeRecommend/service/impl/ActiveRecommendRecordsServiceImpl.java @@ -380,8 +380,8 @@ public class ActiveRecommendRecordsServiceImpl extends ServiceImpl pageVo(Page page, CardCoupon cardCoupon) { return baseMapper.pageVo( page, cardCoupon); @@ -90,6 +94,10 @@ public class CardCouponServiceImpl extends ServiceImpl cardCouponUniVos1 = baseMapper.selectByStoreIdCount(cardCouponUniVo1); Map cardCouponMap = cardCouponUniVos1.stream().collect(Collectors.toMap(CardCouponUniVo::getId, CardCouponUniVo::getCount)); + //查询用户的会员等级 + UserBalance userBalance = userBalanceMapper.selectOne(new LambdaQueryWrapper() + .eq(UserBalance::getMtUserId, nowAccountInfo.getId())); + //存放最终可领取的优惠券id集合 List ids = new ArrayList<>(); @@ -99,6 +107,11 @@ public class CardCouponServiceImpl extends ServiceImpl() .eq(CardCouponUser::getMtUserId, nowAccountInfo.getId()) .eq(CardCouponUser::getCardCouponId, couponId)); - if (getCount >= cardCoupon.getGetNumLimit()) { - return 1; + if (getCount >= (cardCoupon.getGetNumLimit() == null ? 0 : cardCoupon.getGetNumLimit())) { + return 3; } Integer validityDay = 0; //优惠券的有效期 @@ -206,6 +219,7 @@ public class CardCouponServiceImpl extends ServiceImpl - - + + @@ -15,7 +16,9 @@ 折扣券 油品立减券 单品代金券 - 剩余{{ couponInfo.tfGetNum ? (couponInfo.tfTotal - couponInfo.tfGetNum) : couponInfo.tfTotal}}张 + + 剩余{{ couponInfo.tfGetNum ? (couponInfo.tfTotal - couponInfo.tfGetNum) : couponInfo.tfTotal}}张 + @@ -27,7 +30,9 @@ 2、每日限领{{couponInfo.dayGetLimit || 0}}张 核销说明: - + + {{item}} @@ -47,7 +52,7 @@ 免费 - 立即领取 + 立即领取 @@ -92,7 +97,7 @@ longitude: lon, name: this.store.name, address: this.store.address, - + success: function() { console.log('success'); }, @@ -109,7 +114,7 @@ type: 'gcj02', // 使用国测局坐标系 success: function(res) { if (_this.longitude == "" && _this.latitude == "") { - + _this.longitude = res.longitude; _this.latitude = res.latitude } @@ -123,14 +128,14 @@ "lat": _this.latitude, "storeId": storeId, "isLogin": _this.AppToken ? "0" : "1", // 0为登录 - + }, }).then((response) => { if (response.data.store) { _this.distance = (Math.ceil(response.data.distance)) .toFixed(1) _this.store = response.data.store - + _this.lon = _this.store.longitude _this.lat = _this.store.latitude console.log(_this.store, 129); @@ -140,7 +145,7 @@ icon: "none" }) } - + }).catch(err => {}) }, fail: function(err) { @@ -148,6 +153,38 @@ } }); }, + //领取优惠券 + getCardCoupon() { + request({ + url: '/cardCoupon/userGetCoupon', + method: 'post', + data: this.couponInfo.id + }).then(res => { + if (res.code == 200) { + if (res.data == 2) { + uni.showToast({ + title: "优惠券已下线", + icon: "none" + }) + } else if (res.data == 0) { + uni.showToast({ + title: "优惠券剩余不足", + icon: "none" + }) + } else if (res.data == 3) { + uni.showToast({ + title: "你已领取上限", + icon: "none" + }) + } else { + uni.showToast({ + title: "领取成功", + icon: "none" + }) + } + } + }) + }, getInfo() { request({ url: '/cardCoupon/' + this.certificateId,