feat: 完成分龄页开发

This commit is contained in:
R524809
2026-05-06 17:28:51 +08:00
parent 50394154f7
commit 9bdf850f20
54 changed files with 3499 additions and 1021 deletions
+1
View File
@@ -8,6 +8,7 @@
"usingComponents": {
"nav-bar": "/components3.0/nav-bar/nav-bar",
"category-tabs": "/components3.0/category-tabs/category-tabs",
"worksheet-card": "/components3.0/worksheet-card/worksheet-card",
"van-icon": "@vant/weapp/icon/index",
"toy-icon": "../../toy/icon/icon"
}
-73
View File
@@ -225,79 +225,6 @@
.home-track-card {
width: calc((750rpx - 2 * @page-padding-x - 2 * @home-track-gap) / 2.2);
flex-shrink: 0;
border-radius: 24rpx;
overflow: hidden;
background: #ffffff;
box-shadow: 0 6rpx 20rpx rgba(50, 46, 37, 0.06);
}
.home-track-card__top {
/* 与 supportPages/mathIndex .function-item-img-wrapper 一致 */
height: 270rpx;
flex-shrink: 0;
position: relative;
overflow: hidden;
display: flex;
align-items: flex-start;
justify-content: center;
border-bottom: 1rpx solid rgba(50, 46, 37, 0.08);
background: #f5edd8;
}
.home-track-card__cover {
width: 100%;
display: block;
}
.home-track-card__icon {
font-size: 72rpx;
line-height: 1;
}
.home-track-card__tags {
position: absolute;
right: 12rpx;
bottom: 12rpx;
display: flex;
gap: 10rpx;
}
.home-track-card__body {
box-sizing: border-box;
width: 100%;
padding: 20rpx @page-padding-inner-x 22rpx;
background: #ffffff;
white-space: normal;
}
.home-track-card__title {
box-sizing: border-box;
width: 100%;
font-size: 28rpx;
font-weight: 600;
color: @text-title;
line-height: 1.35;
display: -webkit-box;
-webkit-box-orient: vertical;
line-clamp: 2;
-webkit-line-clamp: 2;
overflow: hidden;
word-break: break-word;
}
.home-track-card__sub {
box-sizing: border-box;
width: 100%;
margin-top: 8rpx;
font-size: 20rpx;
color: @text-gray;
line-height: 1.45;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
line-clamp: 2;
overflow: hidden;
word-break: break-word;
}
.home-age-scroll {
+8 -3
View File
@@ -254,9 +254,14 @@ Page({
navigateByPath(path, title);
},
onTapTrackCard(e: WechatMiniprogram.TouchEvent) {
const path = e.currentTarget.dataset.path as string | undefined;
const title = e.currentTarget.dataset.title as string | undefined;
onTapCard(e: WechatMiniprogram.CustomEvent) {
const detail = (e.detail || {}) as { title?: string; path?: string };
const path =
detail.path ||
(e.currentTarget.dataset.path as string | undefined);
const title =
detail.title ||
(e.currentTarget.dataset.title as string | undefined);
navigateByPath(path, title);
},
+11 -29
View File
@@ -186,40 +186,22 @@
<!-- <text class="home-section-panel__sub">{{item.subtitle}}</text> -->
<scroll-view class="home-track-scroll" scroll-x enable-flex>
<view class="home-track-row">
<view
<worksheet-card
wx:for="{{item.items}}"
wx:key="id"
class="home-track-card"
variant="track"
title="{{item.title}}"
subtitle="{{item.subtitle}}"
preview-img="{{item.previewImg}}"
icon="{{item.icon}}"
age-band="{{item.ageBand}}"
difficulty="{{item.difficulty}}"
path="{{item.path}}"
data-title="{{item.title}}"
data-path="{{item.path}}"
bindtap="onTapTrackCard">
<view class="home-track-card__top">
<image
wx:if="{{item.previewImg}}"
class="home-track-card__cover"
src="{{item.previewImg}}"
mode="widthFix" />
<text wx:else class="home-track-card__icon"
>{{item.icon}}</text
>
<view class="home-track-card__tags">
<text class="tag tag--age"
>{{item.ageBand}}</text
>
<text class="tag tag--diff"
>{{item.difficulty}}</text
>
</view>
</view>
<view class="home-track-card__body">
<text class="home-track-card__title"
>{{item.title}}</text
>
<text class="home-track-card__sub"
>{{item.subtitle}}</text
>
</view>
</view>
bindtap="onTapCard"
/>
</view>
</scroll-view>
</view>