| | |
| | | <view v-if="item.endTime">有效期至:{{ item.endTime.split(" ")[0] }}</view> |
| | | </view> |
| | | <view class="receive" @click="receive(item)"> |
| | | <text>点击</text><br /> |
| | | <text>{{item.owned ? '已' : '点击'}}</text><br /> |
| | | <text>领取</text> |
| | | </view> |
| | | <view class="bg-quan"> 券 </view> |
| | |
| | | import { |
| | | receiveCoupons |
| | | } from "@/api/members.js"; |
| | | import { getMemberCoupons } from "@/api/members.js"; |
| | | import { |
| | | getAllCoupons |
| | | } from "@/api/promotions.js"; |
| | |
| | | .catch((err) => { |
| | | if (this.$store.state.isShowToast){ uni.hideLoading() }; |
| | | }); |
| | | console.log(this.couponList) |
| | | }, |
| | | /** |
| | | * 领取优惠券 |
| | |
| | | this.$u.throttle(()=>{ |
| | | this.fetchCoupon(val) |
| | | }, 1500) |
| | | |
| | | }, |
| | | |
| | | fetchCoupon(val){ |
| | | receiveCoupons(val.id).then((res) => { |
| | | if (res.data.code == 200) { |
| | | //修改点击的优惠卷当前的领取状态 |
| | | val.owned = true; |
| | | uni.showToast({ |
| | | title: "领取成功", |
| | | icon: "none", |