绿满眶商城微信小程序-uniapp
zxl
2025-08-04 6c7fecf52405e132e3573b43a7206f99026a1fd8
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,9 +46,11 @@
</template>
<script>
   import '@/components/uview-components/uview-ui';
   import {
      receiveCoupons
   } from "@/api/members.js";
   import { getMemberCoupons } from "@/api/members.js";
   import {
      getAllCoupons
   } from "@/api/promotions.js";
@@ -115,6 +117,7 @@
               .catch((err) => {
                   if (this.$store.state.isShowToast){ uni.hideLoading() };
               });
               console.log(this.couponList)
         },
         /**
          * 领取优惠券
@@ -123,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",