修复跳转功能

This commit is contained in:
2026-06-15 18:10:39 +08:00
parent d7961694f9
commit 1c547a717e
@@ -1,6 +1,6 @@
<template> <template>
<!-- 推荐团课卡片 --> <!-- 推荐团课卡片 -->
<view class="recommend-card" :style="cardStyle"> <view class="recommend-card" :style="cardStyle" @click="handleCardClick">
<!-- 卡片头部推荐信息 --> <!-- 卡片头部推荐信息 -->
<view class="card-header"> <view class="card-header">
<text class="recommend-title">{{ recommend.recommendTitle || '推荐课程' }}</text> <text class="recommend-title">{{ recommend.recommendTitle || '推荐课程' }}</text>
@@ -56,8 +56,8 @@
</view> </view>
<!-- 卡片底部操作按钮 --> <!-- 卡片底部操作按钮 -->
<view class="card-footer"> <view class="card-footer" @click.stop="handleJoinCourse">
<view class="action-btn" @click="handleJoinCourse"> <view class="action-btn">
<text>立即预约</text> <text>立即预约</text>
</view> </view>
</view> </view>
@@ -163,6 +163,15 @@ const formattedTime = computed(() => {
return `${date} ${time}` return `${date} ${time}`
}) })
// 处理卡片点击(跳转到详情页)
const handleCardClick = () => {
if (!props.recommend.groupCourse) {
uni.showToast({ title: '课程信息不完整', icon: 'none' })
return
}
uni.navigateTo({ url: `/pages/groupCourse/detail?id=${courseId.value}` })
}
// 处理预约课程点击 // 处理预约课程点击
const handleJoinCourse = () => { const handleJoinCourse = () => {
if (props.recommend.groupCourse?.status === 2) { if (props.recommend.groupCourse?.status === 2) {