This commit is contained in:
Your Name
2026-06-02 18:33:25 +08:00
parent 62f74888f3
commit 15e9c486f9
11 changed files with 731 additions and 674 deletions
@@ -1,5 +1,45 @@
<template>
<view v-if="visible" class="dev-entry-wrap" :style="{ bottom: props.bottom + 'rpx' }">
<!-- 页面内嵌模块 weekly 统计页主内容区 -->
<view v-if="visible && props.inline" class="dev-entry-inline">
<view class="inline-head">
<view class="inline-head-text">
<text class="inline-title">居家耗糖训练</text>
<text class="inline-sub">低强度动起来配合血糖管理</text>
</view>
<view class="inline-wave" aria-hidden="true" />
</view>
<view class="inline-grid">
<view
v-for="item in trainingItems"
:key="item.url"
class="inline-item"
@click="goto(item.url)"
>
<view class="menu-icon" :class="item.iconClass">
<view v-if="item.icon === 'dumbbell'" class="dumbbell-shape">
<view class="dumbbell-plate dumbbell-plate-left" />
<view class="dumbbell-bar" />
<view class="dumbbell-plate dumbbell-plate-right" />
</view>
<view v-else-if="item.icon === 'pedal'" class="foot-pedal-shape">
<view class="pedal-bar pedal-bar-left" />
<view class="pedal-bar pedal-bar-right" />
</view>
<view v-else-if="item.icon === 'pilates'" class="pilates-ring-shape" />
<view v-else-if="item.icon === 'grip'" class="grip-ring-shape" />
<view v-else-if="item.icon === 'metro'" class="menu-icon--metro-inner">
<view class="metro-bar metro-bar-1" />
<view class="metro-bar metro-bar-2" />
<view class="metro-bar metro-bar-3" />
</view>
</view>
<text class="inline-item-title">{{ item.title }}</text>
<text class="inline-item-sub">{{ item.sub }}</text>
</view>
</view>
</view>
<view v-else-if="visible" class="dev-entry-wrap" :style="{ bottom: props.bottom + 'rpx' }">
<!-- 展开后的菜单卡片(从下往上动画) -->
<view v-if="expanded" class="menu-list" @click.stop>
<view class="menu-item" @click="goto('/training/pages/dumbbell')">
@@ -86,11 +126,22 @@
<script setup lang="ts">
import { ref } from 'vue'
const trainingItems = [
{ url: '/training/pages/dumbbell', title: '哑铃', sub: '力量塑形', icon: 'dumbbell', iconClass: 'menu-icon--dumbbell' },
{ url: '/training/pages/foot-pedal', title: '脚蹬器', sub: '下肢有氧', icon: 'pedal', iconClass: 'menu-icon--pedal' },
{ url: '/training/pages/pilates-ring', title: '瑜伽环', sub: '核心塑形', icon: 'pilates', iconClass: 'menu-icon--pilates' },
{ url: '/training/pages/grip-ring', title: '握力环', sub: '握力训练', icon: 'grip', iconClass: 'menu-icon--grip' },
{ url: '/training/pages/metronome', title: '耗糖节拍器', sub: '健走配速', icon: 'metro', iconClass: 'menu-icon--metro' },
] as const
const props = withDefaults(
defineProps<{
/** 悬浮按钮距底部 rpx(仅非 inline */
bottom?: number
/** 内嵌到页面主内容区,非 fixed 悬浮 */
inline?: boolean
}>(),
{ bottom: 200 },
{ bottom: 200, inline: false },
)
const isDevMode = (): boolean => {
@@ -449,4 +500,121 @@ $brand-light: #34d399;
line-height: 1;
margin-left: 4rpx;
}
.menu-icon--metro-inner {
display: flex;
align-items: flex-end;
justify-content: center;
gap: 4rpx;
width: 100%;
height: 100%;
}
/* ============================================================
* 内嵌模块(weekly 等)
* ============================================================ */
.dev-entry-inline {
width: 100%;
padding: 24rpx 24rpx 20rpx;
border-radius: 48rpx;
background: #fff;
border: 1rpx solid rgba(0, 108, 73, 0.12);
box-shadow: 0 24rpx 60rpx -20rpx rgba(0, 108, 73, 0.08), 0 8rpx 20rpx -8rpx rgba(0, 0, 0, 0.03);
box-sizing: border-box;
}
.inline-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16rpx;
margin-bottom: 20rpx;
}
.inline-head-text {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: 4rpx;
}
.inline-title {
font-size: 32rpx;
font-weight: 700;
color: #0f172a;
line-height: 1.25;
}
.inline-sub {
font-size: 24rpx;
font-weight: 500;
color: #64748b;
line-height: 1.35;
}
.inline-wave {
width: 120rpx;
height: 48rpx;
flex-shrink: 0;
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 40' fill='none'><path d='M0 20 H18 L26 8 L34 32 L42 14 L50 26 L58 20 H120' stroke='%23006c49' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' opacity='0.85'/></svg>");
background-size: contain;
background-repeat: no-repeat;
background-position: center right;
}
/* 五行并列,一屏展示完整(不横向滑动) */
.inline-grid {
display: flex;
flex-direction: row;
align-items: stretch;
justify-content: space-between;
gap: 8rpx;
width: 100%;
}
.inline-item {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
align-items: center;
padding: 14rpx 4rpx 12rpx;
border-radius: 20rpx;
background: #f0fdf4;
border: 1rpx solid rgba(0, 108, 73, 0.1);
box-sizing: border-box;
&:active {
transform: scale(0.97);
opacity: 0.9;
}
.menu-icon {
width: 56rpx;
height: 56rpx;
margin-bottom: 8rpx;
flex-shrink: 0;
}
}
.inline-item-title {
font-size: 22rpx;
font-weight: 700;
color: #0f172a;
text-align: center;
line-height: 1.2;
width: 100%;
word-break: break-all;
}
.inline-item-sub {
margin-top: 2rpx;
font-size: 18rpx;
color: #94a3b8;
text-align: center;
line-height: 1.2;
width: 100%;
word-break: break-all;
}
</style>