绿满眶商城微信小程序-uniapp
zxl
2025-08-08 3e2ef5dd097474b14adc81a003603720e2a4a90d
pages/cart/coupon/couponCenter.vue
@@ -32,7 +32,7 @@
                        <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>
@@ -46,15 +46,15 @@
</template>
<script>
   import UEmpty from '@/uview-components/uview-ui/components/u-empty/u-empty.vue';
   import '@/components/uview-components/uview-ui';
   import {
      receiveCoupons
   } from "@/api/members.js";
   import { getMemberCoupons } from "@/api/members.js";
   import {
      getAllCoupons
   } from "@/api/promotions.js";
   export default {
      components: {UEmpty},
      data() {
         return {
            loadStatus: "more", //下拉状态
@@ -117,6 +117,7 @@
               .catch((err) => {
                   if (this.$store.state.isShowToast){ uni.hideLoading() };
               });
               console.log(this.couponList)
         },
         /**
          * 领取优惠券
@@ -125,12 +126,13 @@
            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",