feat: 完善课程订阅

This commit is contained in:
richarjiang
2026-04-06 08:38:05 +08:00
parent f71ff968ad
commit 3a9982209f
21 changed files with 2301 additions and 94 deletions

View File

@@ -4,8 +4,10 @@
<view v-if="!userStore.loggedIn" class="entry-card login-card" @tap="handleLogin">
<view class="entry-content">
<view class="entry-left">
<text class="entry-icon">👋</text>
<view>
<view class="entry-icon-wrap login-icon">
<view class="icon-user" />
</view>
<view class="entry-text">
<text class="entry-title">欢迎来到工作室</text>
<text class="entry-subtitle">登录后即可预约课程</text>
</view>
@@ -24,8 +26,10 @@
>
<view class="entry-content">
<view class="entry-left">
<text class="entry-icon"></text>
<view>
<view class="entry-icon-wrap trial-icon">
<view class="icon-star" />
</view>
<view class="entry-text">
<text class="entry-title">初次体验</text>
<text class="entry-subtitle">专属体验课了解普拉提</text>
</view>
@@ -42,8 +46,10 @@
<view class="entry-card active-card" @tap="handleBooking">
<view class="entry-content">
<view class="entry-left">
<text class="entry-icon">🧘</text>
<view>
<view class="entry-icon-wrap active-icon">
<view class="icon-clock" />
</view>
<view class="entry-text">
<text class="entry-title">一键约课</text>
<text class="entry-subtitle">{{ activeMembershipLabel }}</text>
</view>
@@ -60,7 +66,9 @@
<!-- Renew reminder if running low -->
<view v-if="isRunningLow" class="renew-tip" @tap="scrollToCardShop">
<text class="renew-tip-icon"></text>
<view class="renew-tip-icon">
<view class="icon-warning" />
</view>
<text class="renew-tip-text">课次即将用完点击续卡保持练习节奏</text>
<text class="renew-tip-action">续卡 </text>
</view>
@@ -74,8 +82,10 @@
>
<view class="entry-content">
<view class="entry-left">
<text class="entry-icon">💳</text>
<view>
<view class="entry-icon-wrap expired-icon">
<view class="icon-card" />
</view>
<view class="entry-text">
<text class="entry-title">续费会员卡</text>
<text class="entry-subtitle">您的卡已到期续卡继续练习</text>
</view>
@@ -174,24 +184,24 @@ const lowestRemainingTimes = computed(() => {
position: relative;
border-radius: 16rpx;
padding: 36rpx 32rpx;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.10);
box-shadow: 0 4rpx 24rpx rgba(0, 0, 0, 0.08);
overflow: hidden;
}
.login-card {
background: linear-gradient(135deg, #1a1a2e, #2d2d5e);
background: linear-gradient(135deg, #1a1a2e 0%, #2d2d5e 100%);
}
.trial-card {
background: linear-gradient(135deg, #2d2d5e, #4a3f7a);
background: linear-gradient(135deg, #2d2d5e 0%, #4a3f7a 100%);
}
.active-card {
background: linear-gradient(135deg, #1a1a2e, #3a2a1a);
background: linear-gradient(135deg, #2a3a4a 0%, #1a2a3a 100%);
}
.expired-card {
background: linear-gradient(135deg, #4a4a4a, #2a2a2a);
background: linear-gradient(135deg, #4a4a4a 0%, #2a2a2a 100%);
}
.entry-content {
@@ -204,59 +214,196 @@ const lowestRemainingTimes = computed(() => {
.entry-left {
display: flex;
align-items: center;
gap: 24rpx;
gap: 28rpx;
flex: 1;
}
.entry-icon {
font-size: 56rpx;
.entry-icon-wrap {
width: 88rpx;
height: 88rpx;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
position: relative;
}
.login-icon {
background: rgba(255, 255, 255, 0.12);
}
.trial-icon {
background: rgba(255, 215, 0, 0.2);
}
.active-icon {
background: rgba(168, 196, 206, 0.25);
}
.expired-icon {
background: rgba(255, 255, 255, 0.12);
}
/* ── Icon shapes (pure CSS) ── */
/* User icon: head + shoulders */
.icon-user {
position: relative;
width: 36rpx;
height: 36rpx;
&::before {
content: '';
position: absolute;
top: 0;
left: 50%;
transform: translateX(-50%);
width: 20rpx;
height: 20rpx;
border-radius: 50%;
background: #fff;
}
&::after {
content: '';
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 28rpx;
height: 14rpx;
border-radius: 14rpx 14rpx 0 0;
background: #fff;
}
}
/* Star icon - diamond shape */
.icon-star {
position: relative;
width: 32rpx;
height: 32rpx;
&::before {
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) rotate(45deg);
width: 24rpx;
height: 24rpx;
background: #ffd700;
}
}
/* Clock icon - circle with dot */
.icon-clock {
position: relative;
width: 36rpx;
height: 36rpx;
border-radius: 50%;
border: 3rpx solid #fff;
&::before {
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 8rpx;
height: 8rpx;
border-radius: 50%;
background: #fff;
}
}
/* Card icon */
.icon-card {
position: relative;
width: 36rpx;
height: 26rpx;
border-radius: 4rpx;
border: 3rpx solid #fff;
&::before {
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 12rpx;
height: 6rpx;
border-radius: 2rpx;
background: #fff;
}
}
/* Warning triangle */
.icon-warning {
position: relative;
width: 0;
height: 0;
border-left: 12rpx solid transparent;
border-right: 12rpx solid transparent;
border-bottom: 20rpx solid #e8a87c;
}
.entry-text {
flex: 1;
min-width: 0;
}
.entry-title {
display: block;
font-size: 34rpx;
font-weight: 700;
font-weight: 600;
color: #ffffff;
margin-bottom: 8rpx;
letter-spacing: 1rpx;
}
.entry-subtitle {
display: block;
font-size: 24rpx;
color: rgba(255, 255, 255, 0.65);
color: rgba(255, 255, 255, 0.6);
line-height: 1.4;
}
.entry-btn {
flex-shrink: 0;
padding: 16rpx 32rpx;
padding: 18rpx 36rpx;
border-radius: 40rpx;
display: flex;
align-items: center;
justify-content: center;
position: relative;
overflow: hidden;
&::before {
content: '';
position: absolute;
inset: 0;
background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, transparent 100%);
opacity: 0.5;
}
}
.entry-btn-text {
font-size: 28rpx;
font-weight: 600;
white-space: nowrap;
position: relative;
z-index: 1;
}
.login-btn {
background: $primary-dark;
}
.trial-btn {
background: $primary-dark;
}
.login-btn,
.trial-btn,
.book-btn {
background: $primary-dark;
background: $primary-color;
}
.renew-btn {
background: #888;
background: #666;
}
.login-btn .entry-btn-text,
@@ -278,7 +425,7 @@ const lowestRemainingTimes = computed(() => {
}
.trial-badge {
background: $primary-dark;
background: linear-gradient(135deg, #ffd700, #ffaa00);
color: #1a1a2e;
}
@@ -296,11 +443,15 @@ const lowestRemainingTimes = computed(() => {
padding: 20rpx 24rpx;
background: #fff8f0;
border-radius: 12rpx;
border: 1rpx solid #f0d9bc;
border: 1rpx solid rgba(240, 180, 100, 0.3);
}
.renew-tip-icon {
font-size: 28rpx;
width: 36rpx;
height: 36rpx;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}