修正多处问题,添加骨架屏

This commit is contained in:
2026-06-29 16:41:36 +08:00
parent e85f39ab83
commit 13b99428de
124 changed files with 929 additions and 147 deletions
@@ -1,4 +1,4 @@
<template>
<template>
<view class="qr-status">
<!-- 加载中状态 -->
<view v-if="status === 'loading'" class="status-loading">
@@ -1,4 +1,4 @@
<template>
<template>
<SkeletonBase>
<view class="skeleton-banner"></view>
@@ -0,0 +1,169 @@
<!-- components/Skeleton/ListSkeleton.vue -->
<template>
<SkeletonBase>
<!-- Tab区域 -->
<view v-if="showTabs" class="skeleton-tabs">
<view v-for="i in tabCount" :key="i" class="skeleton-tab skeleton-shimmer"></view>
</view>
<!-- 列表项 -->
<view class="skeleton-list" :style="{ padding: listPadding }">
<view v-for="i in count" :key="i" class="skeleton-item">
<!-- 卡片式布局(默认) -->
<template v-if="layout === 'card'">
<view class="skeleton-card-item">
<view class="skeleton-card-icon skeleton-shimmer"></view>
<view class="skeleton-card-body">
<view class="skeleton-card-title skeleton-shimmer"></view>
<view class="skeleton-card-desc skeleton-shimmer"></view>
<view class="skeleton-card-footer">
<view class="skeleton-card-tag skeleton-shimmer"></view>
<view class="skeleton-card-time skeleton-shimmer"></view>
</view>
</view>
</view>
</template>
<!-- 简洁列表布局 -->
<template v-else-if="layout === 'simple'">
<view class="skeleton-simple-item">
<view class="skeleton-simple-title skeleton-shimmer"></view>
<view class="skeleton-simple-meta">
<view class="skeleton-simple-line skeleton-shimmer"></view>
<view class="skeleton-simple-line skeleton-shimmer short"></view>
</view>
</view>
</template>
</view>
</view>
</SkeletonBase>
</template>
<script setup>
import SkeletonBase from './SkeletonBase.vue'
defineProps({
count: { type: Number, default: 6 },
layout: { type: String, default: 'card' },
showTabs: { type: Boolean, default: false },
tabCount: { type: Number, default: 3 },
listPadding: { type: String, default: '0 24rpx' }
})
</script>
<style lang="scss" scoped>
.skeleton-tabs {
display: flex;
gap: 16rpx;
padding: 20rpx 24rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.skeleton-tab {
height: 60rpx;
width: 140rpx;
border-radius: 12rpx;
}
.skeleton-list {
display: flex;
flex-direction: column;
gap: 16rpx;
padding-top: 16rpx;
}
/* 卡片式 */
.skeleton-card-item {
display: flex;
align-items: center;
padding: 24rpx 20rpx;
background: #fff;
border-radius: 16rpx;
gap: 20rpx;
}
.skeleton-card-icon {
width: 80rpx;
height: 80rpx;
border-radius: 16rpx;
flex-shrink: 0;
}
.skeleton-card-body {
flex: 1;
display: flex;
flex-direction: column;
gap: 12rpx;
min-width: 0;
}
.skeleton-card-title {
height: 32rpx;
width: 60%;
border-radius: 8rpx;
}
.skeleton-card-desc {
height: 28rpx;
width: 80%;
border-radius: 8rpx;
}
.skeleton-card-footer {
display: flex;
justify-content: space-between;
margin-top: 4rpx;
}
.skeleton-card-tag {
height: 24rpx;
width: 80rpx;
border-radius: 6rpx;
}
.skeleton-card-time {
height: 24rpx;
width: 120rpx;
border-radius: 6rpx;
}
/* 简洁式 */
.skeleton-simple-item {
padding: 28rpx 24rpx;
background: #fff;
border-radius: 16rpx;
display: flex;
flex-direction: column;
gap: 16rpx;
}
.skeleton-simple-title {
height: 34rpx;
width: 55%;
border-radius: 8rpx;
}
.skeleton-simple-meta {
display: flex;
gap: 24rpx;
}
.skeleton-simple-line {
height: 26rpx;
width: 180rpx;
border-radius: 6rpx;
&.short {
width: 100rpx;
}
}
:deep(.skeleton-shimmer) {
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
background-size: 200% 100%;
animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
0% { background-position: 200% 0; }
100% { background-position: -200% 0; }
}
</style>
@@ -0,0 +1,179 @@
<!-- components/Skeleton/MemberCenterSkeleton.vue -->
<template>
<SkeletonBase>
<!-- 头像和个人信息 -->
<view class="skeleton-header">
<view class="skeleton-avatar skeleton-shimmer"></view>
<view class="skeleton-header-info">
<view class="skeleton-name skeleton-shimmer"></view>
<view class="skeleton-level skeleton-shimmer"></view>
</view>
</view>
<!-- 统计数据 -->
<view class="skeleton-stats">
<view v-for="i in 3" :key="i" class="skeleton-stat-item">
<view class="skeleton-stat-num skeleton-shimmer"></view>
<view class="skeleton-stat-label skeleton-shimmer"></view>
</view>
</view>
<!-- 会员卡 -->
<view class="skeleton-card">
<view class="skeleton-card-title skeleton-shimmer"></view>
<view class="skeleton-card-body">
<view class="skeleton-card-line skeleton-shimmer"></view>
<view class="skeleton-card-line skeleton-shimmer short"></view>
<view class="skeleton-card-btn skeleton-shimmer"></view>
</view>
</view>
<!-- 快捷入口 -->
<view class="skeleton-entry">
<view v-for="i in 4" :key="i" class="skeleton-entry-item">
<view class="skeleton-entry-icon skeleton-shimmer"></view>
<view class="skeleton-entry-label skeleton-shimmer"></view>
</view>
</view>
<!-- 底部占位 -->
<view class="skeleton-spacer"></view>
</SkeletonBase>
</template>
<script setup>
import SkeletonBase from './SkeletonBase.vue'
</script>
<style lang="scss" scoped>
.skeleton-header {
display: flex;
align-items: center;
padding: 40rpx 32rpx 24rpx;
}
.skeleton-avatar {
width: 120rpx;
height: 120rpx;
border-radius: 50%;
flex-shrink: 0;
}
.skeleton-header-info {
margin-left: 24rpx;
flex: 1;
display: flex;
flex-direction: column;
gap: 16rpx;
}
.skeleton-name {
height: 36rpx;
width: 160rpx;
border-radius: 8rpx;
}
.skeleton-level {
height: 28rpx;
width: 120rpx;
border-radius: 8rpx;
}
.skeleton-stats {
display: flex;
justify-content: space-around;
padding: 24rpx 32rpx;
}
.skeleton-stat-item {
display: flex;
flex-direction: column;
align-items: center;
gap: 12rpx;
}
.skeleton-stat-num {
height: 40rpx;
width: 80rpx;
border-radius: 8rpx;
}
.skeleton-stat-label {
height: 24rpx;
width: 60rpx;
border-radius: 8rpx;
}
.skeleton-card {
margin: 0 24rpx 24rpx;
padding: 32rpx;
background: #fff;
border-radius: 20rpx;
}
.skeleton-card-title {
height: 32rpx;
width: 140rpx;
border-radius: 8rpx;
margin-bottom: 24rpx;
}
.skeleton-card-body {
display: flex;
flex-direction: column;
gap: 16rpx;
}
.skeleton-card-line {
height: 28rpx;
width: 70%;
border-radius: 8rpx;
&.short {
width: 45%;
}
}
.skeleton-card-btn {
height: 56rpx;
width: 160rpx;
border-radius: 12rpx;
margin-top: 8rpx;
}
.skeleton-entry {
display: flex;
justify-content: space-around;
padding: 24rpx 32rpx;
}
.skeleton-entry-item {
display: flex;
flex-direction: column;
align-items: center;
gap: 12rpx;
}
.skeleton-entry-icon {
width: 80rpx;
height: 80rpx;
border-radius: 20rpx;
}
.skeleton-entry-label {
height: 24rpx;
width: 60rpx;
border-radius: 8rpx;
}
.skeleton-spacer {
height: 200rpx;
}
:deep(.skeleton-shimmer) {
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
background-size: 200% 100%;
animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
0% { background-position: 200% 0; }
100% { background-position: -200% 0; }
}
</style>
@@ -1,4 +1,4 @@
<template>
<template>
<view class="message-skeleton">
<view v-for="i in 6" :key="i" class="skeleton-item">
<view class="skeleton-icon skeleton-shimmer"></view>
@@ -1,4 +1,4 @@
<template>
<template>
<view class="skeleton" :style="{ padding: padding }">
<slot />
</view>
+2 -2
View File
@@ -1,4 +1,4 @@
<!-- components/TabBar.vue -->
<!-- components/TabBar.vue -->
<template>
<view v-if="shouldShowTabBar" class="tab-bar-wrapper">
<view class="tab-bar">
@@ -290,4 +290,4 @@ function onTabTap(index) {
color: rgba(130, 220, 130, 0.9);
font-weight: 600;
}
</style>
</style>
@@ -1,4 +1,4 @@
<!-- components/GlobalLoading.vue -->
<!-- components/GlobalLoading.vue -->
<template>
<view v-if="visible" class="global-loading">
<view class="loading-mask"></view>
@@ -1,4 +1,4 @@
<template>
<template>
<!-- 登录弹窗组件 -->
<view class="login-modal-mask" v-if="visible" @tap="handleMaskTap">
<view class="login-modal" :class="{ 'login-modal--center': modalStyle === 'center' }" @tap.stop>
@@ -0,0 +1,351 @@
<template>
<view class="ppm-overlay" v-if="visible" @tap="handleCancel">
<view class="ppm-dialog" @tap.stop>
<!-- 头部 -->
<view class="ppm-header">
<text class="ppm-header__icon">&#128274;</text>
<text class="ppm-header__title">{{ title }}</text>
<text v-if="subtitle" class="ppm-header__subtitle">{{ subtitle }}</text>
</view>
<!-- 金额展示 -->
<view v-if="amount != null" class="ppm-amount">
<text class="ppm-amount__label">{{ amountLabel }}</text>
<text class="ppm-amount__value">¥{{ formatAmount(amount) }}</text>
</view>
<!-- 退款提示(免费次数) -->
<view v-if="cancelNotice && cancelNotice.length" class="ppm-notice">
<text>{{ cancelNotice }}</text>
</view>
<!-- 密码输入 -->
<view class="ppm-input-wrap">
<view class="ppm-code-box">
<view
v-for="i in 6"
:key="i"
class="ppm-code-item"
:class="{
'ppm-code-item--focus': focusIndex === i - 1 && password.length < 6,
'ppm-code-item--filled': password.length >= i
}"
>
<text v-if="password.length >= i" class="ppm-code-dot"></text>
<view v-if="focusIndex === i - 1 && password.length === i - 1" class="ppm-code-cursor"></view>
</view>
</view>
</view>
<!-- 隐藏输入框 -->
<input
class="ppm-hidden-input"
type="number"
:maxlength="6"
:focus="inputFocus"
:value="password"
@input="onInput"
@focus="onFocus"
@blur="onBlur"
/>
<!-- 提示 -->
<view class="ppm-tips">
<text>请输入6位支付密码</text>
</view>
<!-- 底部按钮 -->
<view class="ppm-buttons">
<view class="ppm-btn ppm-btn--cancel" @tap="handleCancel">
<text>取消</text>
</view>
<view
class="ppm-btn ppm-btn--confirm"
:class="{ 'ppm-btn--disabled': password.length < 6 || loading }"
@tap="handleConfirm"
>
<text>{{ loading ? '验证中...' : '确认' }}</text>
</view>
</view>
</view>
</view>
</template>
<script setup>
import { ref, watch, nextTick } from 'vue'
const props = defineProps({
visible: { type: Boolean, default: false },
title: { type: String, default: '支付验证' },
subtitle: { type: String, default: '' },
amount: { type: [Number, String], default: null },
amountLabel: { type: String, default: '支付金额' },
cancelNotice: { type: String, default: '' },
errorMsg: { type: String, default: '' },
loading: { type: Boolean, default: false }
})
const emit = defineEmits(['confirm', 'cancel'])
const password = ref('')
const inputFocus = ref(false)
const focusIndex = ref(0)
watch(() => props.visible, (val) => {
if (val) {
password.value = ''
focusIndex.value = 0
nextTick(() => {
setTimeout(() => {
inputFocus.value = true
}, 300)
})
}
})
function formatAmount(val) {
return Number(val).toFixed(2)
}
function onInput(e) {
let val = String(e.detail.value || '').replace(/\D/g, '').slice(0, 6)
password.value = val
focusIndex.value = val.length
}
function onFocus() {
inputFocus.value = true
focusIndex.value = password.value.length
}
function onBlur() {
// Keep focusIndex, just mark input as not focused
}
function handleConfirm() {
if (password.value.length < 6 || props.loading) return
emit('confirm', password.value)
}
function handleCancel() {
emit('cancel')
}
function clear() {
password.value = ''
focusIndex.value = 0
}
defineExpose({ clear })
</script>
<style lang="scss" scoped>
.ppm-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 9999;
animation: ppm-fade-in 0.25s ease;
}
@keyframes ppm-fade-in {
from { opacity: 0; }
to { opacity: 1; }
}
.ppm-dialog {
width: 600rpx;
background: #FFFFFF;
border-radius: 32rpx;
padding: 48rpx 40rpx 36rpx;
box-shadow: 0 16rpx 48rpx rgba(0, 0, 0, 0.15);
animation: ppm-scale-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
display: flex;
flex-direction: column;
align-items: center;
}
@keyframes ppm-scale-in {
from { opacity: 0; transform: scale(0.85); }
to { opacity: 1; transform: scale(1); }
}
.ppm-header {
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 28rpx;
}
.ppm-header__icon {
font-size: 48rpx;
margin-bottom: 12rpx;
}
.ppm-header__title {
font-size: 34rpx;
font-weight: 700;
color: #1A202C;
}
.ppm-header__subtitle {
font-size: 24rpx;
color: #8A99B4;
margin-top: 6rpx;
}
.ppm-amount {
display: flex;
flex-direction: column;
align-items: center;
padding: 20rpx 40rpx;
background: linear-gradient(135deg, #FFF5F0 0%, #FFF8F5 100%);
border-radius: 16rpx;
margin-bottom: 24rpx;
width: 100%;
box-sizing: border-box;
}
.ppm-amount__label {
font-size: 22rpx;
color: #8A99B4;
margin-bottom: 4rpx;
}
.ppm-amount__value {
font-size: 48rpx;
font-weight: 800;
color: #FF6B35;
font-family: 'DIN', 'Helvetica Neue', sans-serif;
}
.ppm-notice {
width: 100%;
padding: 12rpx 24rpx;
margin-bottom: 20rpx;
background: #FFF7ED;
border-radius: 12rpx;
border: 1rpx solid #FFEDD5;
box-sizing: border-box;
}
.ppm-notice text {
font-size: 22rpx;
color: #C2410C;
line-height: 1.5;
}
.ppm-input-wrap {
width: 100%;
display: flex;
justify-content: center;
margin-bottom: 16rpx;
}
.ppm-code-box {
display: flex;
justify-content: center;
gap: 8px;
}
.ppm-code-item {
width: 36px;
height: 40px;
background: #FFFFFF;
border: 1px solid #E2E8F0;
border-radius: 6px;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s ease;
}
.ppm-code-item--focus {
border-color: #FF6B35;
}
.ppm-code-item--filled {
border-color: #1A202C;
}
.ppm-code-dot {
width: 8px;
height: 8px;
border-radius: 50%;
background: #1A202C;
}
.ppm-code-cursor {
width: 2px;
height: 20px;
background: #FF6B35;
animation: ppm-blink 1s infinite;
}
@keyframes ppm-blink {
0%, 100% { opacity: 1; }
50% { opacity: 0; }
}
.ppm-hidden-input {
position: fixed;
left: -9999px;
top: -9999px;
width: 1px;
height: 1px;
opacity: 0;
z-index: -1;
}
.ppm-tips {
margin-bottom: 32rpx;
}
.ppm-tips text {
font-size: 22rpx;
color: #8A99B4;
}
.ppm-buttons {
display: flex;
gap: 20rpx;
width: 100%;
}
.ppm-btn {
flex: 1;
height: 80rpx;
border-radius: 40rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 28rpx;
font-weight: 600;
transition: all 0.2s ease;
}
.ppm-btn:active {
transform: scale(0.96);
}
.ppm-btn--cancel {
background: #F3F4F6;
color: #6B7280;
}
.ppm-btn--confirm {
background: linear-gradient(135deg, #FF6B35 0%, #FF8C5A 100%);
color: #FFFFFF;
box-shadow: 0 8rpx 20rpx rgba(255, 107, 53, 0.25);
}
.ppm-btn--disabled {
opacity: 0.5;
}
</style>
@@ -1,4 +1,4 @@
<template>
<template>
<view
class="verify-code-input"
@tap="focusInput"
@@ -1,4 +1,4 @@
<template>
<template>
<!-- 团课卡片容器 -->
<view class="course-card" @click="goDetail">
<!-- 卡片顶部图片区域 -->
@@ -7,7 +7,7 @@
<view v-if="!imageLoaded" class="skeleton skeleton-image"></view>
<!-- 课程封面图片 -->
<image
:src="course.coverImage"
:src="getCourseCoverUrl(course.coverImage)"
mode="aspectFill"
class="cover-image"
:class="{ hidden: !imageLoaded }"
@@ -111,6 +111,7 @@
<script setup>
import { ref, computed } from 'vue'
import { getCourseCoverUrl } from '@/utils/request.js'
// 图片加载状态
const imageLoaded = ref(false)
@@ -1,4 +1,4 @@
<template>
<template>
<view class="filter-section">
<!-- 课程类型筛选 -->
<picker
@@ -1,4 +1,4 @@
<template>
<template>
<view class="search-bar-wrapper">
<!-- 搜索框 -->
<view class="search-bar">
@@ -1,4 +1,4 @@
<template>
<template>
<view class="time-period-selector">
<view class="sort-header">
<uni-icons type="calendar" size="16" color="#FF6B35" class="sort-icon" />
@@ -1,4 +1,4 @@
<template>
<template>
<view>
<!-- 时间范围选择弹窗 -->
<Transition name="modal">
@@ -134,7 +134,7 @@ const onImageLoad = (index) => {
}
const onImageError = (index) => {
console.error(`图片 ${index} 加载失败`)
console.error(`图片 ${index} 加载失败, URL:`, banners.value[index]?.image?.substring(0, 120))
}
</script>
@@ -1,4 +1,4 @@
<template>
<template>
<!-- 课程卡片 -->
<view class="course-card" :style="cardStyle">
<!-- 课程图片区域 -->
@@ -1,4 +1,4 @@
<template>
<template>
<!-- 状态栏占位区(仅 App 端生效,H5/小程序无状态栏概念) -->
<view class="tab-page__status-bar" :style="{ height: statusBarHeight + 'px' }"></view>
<!-- 导航栏主体 -->
@@ -75,6 +75,8 @@ import { ref, onMounted } from 'vue'
import { onShow } from '@dcloudio/uni-app'
import { getActiveRecommendCourses } from '@/api/groupCourse.js'
import { getCourseCoverUrl } from '@/utils/request.js'
console.log('[RecommendCourses] 组件脚本已加载')
// 推荐课程数据列表
@@ -99,12 +101,8 @@ const getCourseLevel = (course) => {
return '初级'
}
// 处理图片URL
const getImageUrl = (coverImage) => {
if (!coverImage) return 'https://images.unsplash.com/photo-1534438327276-14e5300c3a48?w=400&q=80'
if (coverImage.startsWith('http')) return coverImage
return `https://your-domain.com${coverImage}`
}
// 处理图片URL - 已由 getOssUrl 工具函数处理
// 使用 @/utils/request.js 中的 getOssUrl 替代
// 获取推荐课程
const fetchRecommendCourses = async () => {
@@ -112,6 +110,10 @@ const fetchRecommendCourses = async () => {
try {
const res = await getActiveRecommendCourses()
console.log('[RecommendCourses] API 返回:', JSON.stringify(res).substring(0, 200))
if (res && Array.isArray(res) && res.length > 0) {
console.log('[RecommendCourses] 第一项 groupCourse.coverImage:', JSON.stringify(res[0]?.groupCourse?.coverImage))
console.log('[RecommendCourses] 第一项完整 groupCourse:', JSON.stringify(res[0]?.groupCourse))
}
if (res && Array.isArray(res)) {
// 提取推荐中的 groupCourse,只排除已满员的课程(已结束的仍展示,点击时拦截)
const filteredCourses = res.filter(recommend => {
@@ -125,9 +127,17 @@ const fetchRecommendCourses = async () => {
// 只取前3个符合条件的推荐课程
courses.value = filteredCourses.slice(0, 3).map(recommend => {
const course = recommend.groupCourse
const rawCover = course.coverImage
const finalImage = getCourseCoverUrl(rawCover) || 'https://images.unsplash.com/photo-1534438327276-14e5300c3a48?w=400&q=80'
console.log('[RecommendCourses] 封面URL映射:', {
'courseName': course.courseName,
'原始coverImage': rawCover,
'转换后URL': finalImage,
'是否为完整URL': finalImage.startsWith('http')
})
return {
id: course.id,
image: getImageUrl(course.coverImage),
image: finalImage,
name: course.courseName || '未知课程',
duration: calculateDuration(course.startTime, course.endTime),
level: getCourseLevel(course),
@@ -48,6 +48,8 @@ import { ref, onMounted } from 'vue'
import { onShow } from '@dcloudio/uni-app'
import { getActiveRecommendCourses } from '@/api/groupCourse.js'
import { getCourseCoverUrl } from '@/utils/request.js'
console.log('[TodayRecommend] 组件脚本已加载')
// 今日推荐数据列表
@@ -72,12 +74,7 @@ const getCourseLevel = (course) => {
return '初级'
}
// 处理图片URL
const getImageUrl = (coverImage) => {
if (!coverImage) return 'https://images.unsplash.com/photo-1571019613454-1cb2f99b2d8b?w=300&q=80'
if (coverImage.startsWith('http')) return coverImage
return `https://your-domain.com${coverImage}`
}
// 处理图片URL - 已由 getOssUrl 工具函数处理
// 获取今日推荐
const fetchTodayRecommend = async () => {
@@ -85,6 +82,10 @@ const fetchTodayRecommend = async () => {
try {
const res = await getActiveRecommendCourses()
console.log('[TodayRecommend] API 返回:', JSON.stringify(res).substring(0, 200))
if (res && Array.isArray(res) && res.length > 0) {
console.log('[TodayRecommend] 第一项 groupCourse.coverImage:', JSON.stringify(res[0]?.groupCourse?.coverImage))
console.log('[TodayRecommend] 第一项完整 groupCourse:', JSON.stringify(res[0]?.groupCourse))
}
if (res && Array.isArray(res)) {
// 提取推荐中的 groupCourse,只排除已满员的课程
const filteredCourses = res.filter(recommend => {
@@ -97,9 +98,17 @@ const fetchTodayRecommend = async () => {
recommends.value = filteredCourses.slice(0, 3).map(recommend => {
const course = recommend.groupCourse
const rawCover = course.coverImage
const finalImage = getCourseCoverUrl(rawCover) || 'https://images.unsplash.com/photo-1571019613454-1cb2f99b2d8b?w=300&q=80'
console.log('[TodayRecommend] 封面URL映射:', {
'courseName': course.courseName,
'原始coverImage': rawCover,
'转换后URL': finalImage,
'是否为完整URL': finalImage.startsWith('http')
})
return {
id: course.id,
image: getImageUrl(course.coverImage),
image: finalImage,
title: course.courseName || '未知课程',
tags: [calculateDuration(course.startTime, course.endTime), getCourseLevel(course)],
desc: course.description || '精彩课程,不容错过',
@@ -1,4 +1,4 @@
<template>
<template>
<view class="bt-radar">
<canvas
:id="canvasId"
@@ -1,4 +1,4 @@
<template>
<template>
<view class="bt-trend">
<canvas
:id="canvasId"
@@ -1,4 +1,4 @@
<template>
<template>
<view class="body-report-section">
<view class="body-report-section__inner">
<view class="body-report-section__header">
@@ -1,4 +1,4 @@
<template>
<template>
<view class="booking-section">
<view class="booking-section__inner">
<view class="booking-section__header">
@@ -1,4 +1,4 @@
<template>
<template>
<view class="checkin-section">
<view class="checkin-section__inner">
<view class="checkin-section__header">
@@ -1,4 +1,4 @@
<template>
<template>
<view class="coupon-section">
<view class="coupon-section__inner">
<view class="coupon-section__header">
@@ -1,4 +1,4 @@
<template>
<template>
<view class="profile-header">
<!-- 登录状态 -->
<view class="profile-card" v-if="isLogin" hover-class="mi-tap--hover" :hover-stay-time="150" @tap="handleUserTap">
@@ -1,4 +1,4 @@
<template>
<template>
<view class="logout-section">
<view
class="logout-section__btn"
@@ -1,4 +1,4 @@
<template>
<template>
<view class="member-card-section">
<view class="member-card-section__inner">
<!-- 标题栏 -->
@@ -1,4 +1,4 @@
<template>
<template>
<view class="quick-actions">
<view class="quick-actions__inner">
<view class="quick-actions__grid">
@@ -1,4 +1,4 @@
<template>
<template>
<view class="referral-section">
<view class="referral-section__inner">
<view class="referral-section__header">
@@ -1,4 +1,4 @@
<template>
<template>
<view class="settings-section">
<view class="settings-section__inner">
<text class="settings-section__title">设置与安全</text>
@@ -1,4 +1,4 @@
<template>
<template>
<view class="status-bar">
<view class="status-bar__inner">
<text class="status-bar__time">{{ statusBarTime }}</text>
@@ -1,4 +1,4 @@
<template>
<template>
<view class="sub-nav">
<view class="sub-nav__toolbar" :style="toolbarStyle">
<view class="sub-nav__nav">
@@ -1,4 +1,4 @@
<template>
<template>
<view class="payment-panel">
<!-- 支付方式 -->
<view class="pp-section">
@@ -49,6 +49,7 @@
<script setup>
import { computed } from 'vue'
import { getCourseCoverUrl } from '@/utils/request.js'
const props = defineProps({
recommend: {
@@ -91,9 +92,14 @@ const courseId = computed(() => props.recommend.groupCourse?.id)
// 课程封面图片
const courseImage = computed(() => {
const coverImage = props.recommend.groupCourse?.coverImage
if (!coverImage) return 'https://images.unsplash.com/photo-1534438327276-14e5300c3a48?w=400&q=80'
if (coverImage.startsWith('http')) return coverImage
return `https://your-domain.com${coverImage}`
const url = getCourseCoverUrl(coverImage) || 'https://images.unsplash.com/photo-1534438327276-14e5300c3a48?w=400&q=80'
console.log('[RecommendCourseCard] 封面URL:', {
'courseName': props.recommend.groupCourse?.courseName,
'原始coverImage': coverImage,
'转换后URL': url,
'是否完整URL': url && url.startsWith('http')
})
return url
})
// 课程标签文本