mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-11-06 17:09:08 +08:00
fix(buyer): 补齐领券中心页头并处理秒杀空数据
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<div class="coupon-center">
|
||||
<BaseHeader></BaseHeader>
|
||||
<SearchHeader></SearchHeader>
|
||||
<div class="content">
|
||||
<h2 class="coupon-page-title">领券中心</h2>
|
||||
|
||||
@@ -48,6 +49,7 @@ import { onMounted, reactive, ref } from "vue";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { Modal } from "@/utils/message";
|
||||
import storage from "@/plugins/storage";
|
||||
import SearchHeader from "@/components/indexDecorate/components/SearchHeader.vue";
|
||||
import { couponList, receiveCoupon } from "@/api/member.js";
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
@@ -81,7 +81,7 @@ watch(currIndex, (val) => {
|
||||
interval = null;
|
||||
nowHour.value = new Date().getHours();
|
||||
countDown(val);
|
||||
goodsList.value = list.value[val].seckillGoodsList;
|
||||
goodsList.value = list.value[val]?.seckillGoodsList || [];
|
||||
});
|
||||
|
||||
watch(diffSeconds, (val) => {
|
||||
@@ -108,11 +108,11 @@ watch(diffSeconds, (val) => {
|
||||
});
|
||||
|
||||
function getListByDay () {
|
||||
// 当天秒杀活动
|
||||
// 当天秒杀活动;result 可能为空数组(当天无活动),需判空避免取下标 0 报错
|
||||
seckillByDay().then((res) => {
|
||||
if (res.success) {
|
||||
if (res.success && res.result && res.result.length) {
|
||||
list.value = res.result;
|
||||
goodsList.value = list.value[0].seckillGoodsList;
|
||||
goodsList.value = list.value[0].seckillGoodsList || [];
|
||||
countDown(currIndex.value);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user