hookehuyr

feat(课程页): 为课程横幅添加点击跳转功能

......@@ -19,6 +19,7 @@
v-for="(banner, index) in bannerList"
:key="index"
class="relative"
@click="handleBannerClick(banner)"
>
<img
:src="banner.banner || 'https://cdn.ipadbiz.cn/mlaj/images/featured-course.jpg'"
......@@ -124,6 +125,15 @@ const $route = useRoute();
const $router = useRouter();
useTitle($route.meta.title);
const handleBannerClick = (banner) => {
if (!banner.post_link) return;
if (banner.post_link.startsWith('http')) {
window.location.href = banner.post_link;
} else {
$router.push(banner.post_link);
}
};
// Current time for the countdown timer
const todayDate = new Date();
const formattedTime = featuredCourse.liveTime.split(":");
......