feat: refresh h5 debug workflow and ui design

This commit is contained in:
nepiedg
2026-03-31 21:29:54 +08:00
parent a55614c04f
commit e92f1bdfae
9 changed files with 1303 additions and 1329 deletions
+396
View File
@@ -0,0 +1,396 @@
# 戒烟助手 - 设计语言文档
> 所有页面和组件必须遵循此文档,确保视觉一致性。
---
## 1. 色彩体系
### 品牌色 — 薄荷绿
| 用途 | 色值 | 示例场景 |
|------|------|---------|
| 主色 | `#34C8A0` | 按钮、进度条、选中态边框 |
| 主色深 | `#1a8c62` | 选中文字、强调文字 |
| 主色最深 | `#0D3D2E` | 页面标题、数值文字 |
| 辅助文字 | `#52806E` | 副标题 |
| 次要文字 | `#7aA898` | 说明文字、标签、单位 |
| 淡底色 | `#9CC5B5` | placeholder 文字 |
### 功能色
| 用途 | 色值 | 场景 |
|------|------|------|
| 成功/正向 | `#1a8c62` | 下降趋势、达成状态 |
| 警告 | `#B45309` | 上升趋势、需注意 |
| 警告背景 | `rgba(251, 191, 36, 0.14)` | 警告标签底色 |
| 危险 | `#DC2626` | 高数值指标 |
| 信息蓝 | `#2563EB` | 对比数据(实际值) |
### 背景与表面
| 用途 | 色值 |
|------|------|
| 页面背景渐变 | `linear-gradient(180deg, #E6F7F2 0%, #F0FBF7 40%, #FAFFFE 100%)` |
| 卡片底色 | `rgba(255, 255, 255, 0.88)` |
| 卡片边框 | `rgba(52, 200, 160, 0.14)` |
| 卡片阴影 | `0 4rpx 18rpx rgba(52, 200, 160, 0.07)` |
| 浅底色块 | `rgba(52, 200, 160, 0.06)` |
| 选中底色 | `rgba(52, 200, 160, 0.09)` |
| 选中边框 | `rgba(52, 200, 160, 0.45)` |
---
## 2. 字体规范
### 字体栈
```css
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
```
### 字号层级
| 级别 | 字号 | 字重 | 颜色 | 用途 |
|------|------|------|------|------|
| H1 | 38rpx | 700 | `#0D3D2E` | 页面大标题 |
| H2 | 28rpx | 600 | `#0D3D2E` | 卡片标题 |
| H3 | 26rpx | 600 | `#1a5c45` | 区块标签(section-label |
| 数值大 | 52rpx | 700 | `#0D3D2E` | 核心指标数字 |
| 数值中 | 38-42rpx | 700 | `#0D3D2E` | 次要指标数字 |
| 正文 | 25rpx | 400 | `#52806E` | 描述文字 |
| 辅助 | 21-22rpx | 400 | `#7aA898` | 标签、单位、说明 |
| 小字 | 20rpx | 500 | `#7aA898` | 注释、补充信息 |
---
## 3. 间距与圆角
### 间距
| 级别 | 数值 | 用途 |
|------|------|------|
| xs | 6-8rpx | 元素内部微间距 |
| sm | 14-16rpx | 标签之间、紧凑元素间距 |
| md | 20rpx | 卡片之间、区块之间 |
| lg | 28rpx | 页面侧边距 |
### 圆角
| 元素 | 圆角 |
|------|------|
| 卡片 | 24rpx |
| 选项卡片 | 20rpx |
| 标签(pill | 999rpx |
| 按钮 | 48rpx(大按钮)/ 999rpx(小标签) |
| 输入框/选择器 | 12-14rpx |
| 圆形按钮/圆环 | 50% |
| 数据色块 | 14rpx |
---
## 4. 组件样式规范
### 4.1 卡片(Card
所有独立内容区域使用卡片包裹。
```css
.card {
background: rgba(255, 255, 255, 0.88);
border-radius: 24rpx;
border: 1.5rpx solid rgba(52, 200, 160, 0.14);
box-shadow: 0 4rpx 18rpx rgba(52, 200, 160, 0.07);
padding: 24rpx;
margin-bottom: 20rpx;
}
```
**禁止**:使用旧版灰蓝阴影 `rgba(15, 23, 42, 0.06)`,统一使用薄荷绿阴影。
### 4.2 选择卡片(Mode Card / Option Card
```css
/* 默认态 */
.option-card {
background: rgba(255, 255, 255, 0.72);
border: 2rpx solid rgba(52, 200, 160, 0.1);
border-radius: 20rpx;
box-shadow: 0 2rpx 10rpx rgba(52, 200, 160, 0.04);
}
/* 选中态 */
.option-card-active {
background: rgba(52, 200, 160, 0.09);
border-color: rgba(52, 200, 160, 0.45);
box-shadow: 0 4rpx 16rpx rgba(52, 200, 160, 0.14);
}
```
### 4.3 标签选项(Pill Tag
```css
/* 默认态 */
.tag {
padding: 14rpx 26rpx;
border-radius: 999rpx;
background: rgba(255, 255, 255, 0.9);
font-size: 25rpx;
color: #4a7a66;
border: 1.5rpx solid rgba(52, 200, 160, 0.18);
}
/* 选中态 */
.tag-active {
background: rgba(52, 200, 160, 0.12);
border-color: rgba(52, 200, 160, 0.45);
color: #1a7f61;
font-weight: 600;
}
```
### 4.4 按钮
```css
/* 主按钮 */
.btn-primary {
height: 96rpx;
background: linear-gradient(180deg, #3DD9AE 0%, #34C8A0 100%);
border-radius: 48rpx;
color: #FFFFFF;
font-size: 32rpx;
font-weight: 600;
box-shadow: 0 12rpx 28rpx rgba(52, 200, 160, 0.28);
}
/* 圆形操作按钮(+/- */
.btn-circle {
width: 60rpx;
height: 60rpx;
border-radius: 50%;
background: rgba(52, 200, 160, 0.1);
color: #34C8A0;
font-size: 38rpx;
border: 1.5rpx solid rgba(52, 200, 160, 0.25);
}
```
### 4.5 输入框
```css
.input {
background: rgba(52, 200, 160, 0.06);
border: 1.5rpx solid rgba(52, 200, 160, 0.2);
border-radius: 12rpx;
color: #0D3D2E;
font-weight: 600;
}
/* placeholder */
placeholder-style: "color: #9CC5B5"
```
### 4.6 进度条
```css
.progress-bar {
height: 10rpx;
background: rgba(52, 200, 160, 0.1);
border-radius: 999rpx;
}
.progress-fill {
background: linear-gradient(90deg, #34C8A0, #3DD9AE);
border-radius: 999rpx;
}
/* 未完成态 */
.progress-fill-pending {
background: rgba(52, 200, 160, 0.3);
}
```
### 4.7 圆环指标(Ring
```css
.ring {
width: 110rpx;
height: 110rpx;
border-radius: 50%;
/* 使用 conic-gradient 动态渲染 */
/* 主色: #34C8A0, 底色: #E8F8F3 */
}
.ring-inner {
width: 82rpx;
height: 82rpx;
border-radius: 50%;
background: #FFFFFF;
box-shadow: 0 4rpx 12rpx rgba(52, 200, 160, 0.1);
}
```
### 4.8 状态标签(Chip
```css
/* 正向 */
.chip-good {
background: rgba(52, 200, 160, 0.12);
color: #1a8c62;
}
/* 警告 */
.chip-warn {
background: rgba(251, 191, 36, 0.14);
color: #B45309;
}
/* 中性 */
.chip-neutral {
background: rgba(52, 200, 160, 0.06);
color: #7aA898;
}
```
### 4.9 SegmentTab 切换)
```css
.segment {
background: rgba(255, 255, 255, 0.82);
padding: 6rpx;
border-radius: 22rpx;
border: 1.5rpx solid rgba(52, 200, 160, 0.14);
box-shadow: 0 4rpx 16rpx rgba(52, 200, 160, 0.07);
}
.segment-item {
font-size: 24rpx;
font-weight: 600;
color: #7aA898;
border-radius: 16rpx;
}
.segment-active {
background: #FFFFFF;
color: #0D3D2E;
box-shadow: 0 4rpx 12rpx rgba(52, 200, 160, 0.12);
}
```
### 4.10 空状态
```css
.empty-block {
padding: 32rpx;
border-radius: 16rpx;
background: rgba(52, 200, 160, 0.04);
}
/* 虚线边框变体 */
.empty-block-dashed {
border: 2rpx dashed rgba(52, 200, 160, 0.2);
background: transparent;
}
.empty-text {
font-size: 24rpx;
color: #7aA898;
}
```
### 4.11 底部安全区
```css
.bottom-safe {
height: calc(32rpx + env(safe-area-inset-bottom));
}
/* 固定底部按钮区域 */
.footer-fixed {
position: fixed;
left: 0; right: 0; bottom: 0;
padding: 20rpx 28rpx;
padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
background: linear-gradient(180deg, transparent 0%, rgba(240, 251, 247, 0.97) 35%);
}
```
---
## 5. 数据可视化配色
| 数据类型 | 色值/色阶 |
|---------|----------|
| 0 / 无数据 | `rgba(52, 200, 160, 0.06)` |
| 低(1-3 | `rgba(52, 200, 160, 0.18)` |
| 中(4-8 | `rgba(251, 191, 36, 0.2)` |
| 高(9+ | `rgba(239, 68, 68, 0.15)` |
| 圆环已完成 | `#34C8A0` |
| 圆环未完成 | `#E8F8F3` |
---
## 6. 禁止事项
| 禁止 | 替代方案 |
|------|---------|
| 灰蓝色阴影 `rgba(15, 23, 42, *)` | 薄荷绿阴影 `rgba(52, 200, 160, *)` |
| 旧主色 `#1AA37A` / `#1aa37a` | 新主色 `#34C8A0`(按钮/进度条)或 `#1a8c62`(文字) |
| 灰色文字 `#6B7280` / `#94A3B8` | 绿调文字 `#7aA898` / `#52806E` |
| 灰色背景 `#F1F5F9` / `#F8FAFC` | 绿调背景 `rgba(52, 200, 160, 0.06)` |
| 纯白卡片背景 `#FFFFFF` | 半透明白 `rgba(255, 255, 255, 0.88)` |
| `backdrop-filter: blur()` | 不再使用模糊滤镜(性能考虑),用不透明度代替 |
| 旧页面背景渐变 `#edf2f8 → #fbfdff` | 薄荷绿渐变 `#E6F7F2 → #FAFFFE` |
---
## 7. 快速参考
开发新页面时复制此基础结构:
```vue
<template>
<view class="page">
<view class="status-bar" :style="{ height: navBarHeight + 'px' }"></view>
<view class="card">
<text class="card-title">标题</text>
<!-- 内容 -->
</view>
<view class="bottom-safe"></view>
</view>
</template>
<style scoped>
.page {
min-height: 100vh;
background: linear-gradient(180deg, #E6F7F2 0%, #F0FBF7 40%, #FAFFFE 100%);
padding: 0 28rpx;
box-sizing: border-box;
}
.status-bar {
background: transparent;
}
.card {
background: rgba(255, 255, 255, 0.88);
border-radius: 24rpx;
padding: 24rpx;
margin-bottom: 20rpx;
border: 1.5rpx solid rgba(52, 200, 160, 0.14);
box-shadow: 0 4rpx 18rpx rgba(52, 200, 160, 0.07);
}
.card-title {
font-size: 28rpx;
font-weight: 600;
color: #0D3D2E;
}
.bottom-safe {
height: calc(32rpx + env(safe-area-inset-bottom));
}
</style>
```
+3 -2
View File
@@ -2,13 +2,14 @@ import { request } from './request'
import { MINI_PROGRAM_ID } from '@/config' import { MINI_PROGRAM_ID } from '@/config'
import { storage, SESSION_KEY, USER_KEY } from '@/utils/storage' import { storage, SESSION_KEY, USER_KEY } from '@/utils/storage'
const H5_DEBUG_SESSION_KEY = 'o3dUk5QYaPdfMN9hBxeuouE0q63E' const H5_DEBUG_SESSION_KEY = 'FxLFPHHBw49loODmRSvqdg=='
export function applyH5DebugSession() { export function applyH5DebugSession() {
let applied = false let applied = false
// #ifdef H5 // #ifdef H5
if (process.env.NODE_ENV === 'development' && !storage.get(SESSION_KEY)) { if (process.env.NODE_ENV === 'development' && storage.get(SESSION_KEY) !== H5_DEBUG_SESSION_KEY) {
storage.set(SESSION_KEY, H5_DEBUG_SESSION_KEY) storage.set(SESSION_KEY, H5_DEBUG_SESSION_KEY)
storage.remove(USER_KEY)
applied = true applied = true
} }
// #endif // #endif
+1
View File
@@ -13,6 +13,7 @@ function isInvalidToken(res) {
export const request = { export const request = {
async request(options) { async request(options) {
const sessionKey = storage.get(SESSION_KEY) const sessionKey = storage.get(SESSION_KEY)
// 测试
const isRetryAfter401 = options._retryAfter401 === true const isRetryAfter401 = options._retryAfter401 === true
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
+185 -180
View File
@@ -1,15 +1,27 @@
<template> <template>
<view class="page"> <view class="page">
<view class="page-glow page-glow-a"></view> <view class="hero-card card">
<view class="page-glow page-glow-b"></view> <text class="hero-title">记录历史</text>
<view class="page-header"> <text class="hero-subtitle">按时间查看抽烟和忍住记录随时回看自己的变化轨迹</text>
<text class="page-eyebrow">History</text> <view class="hero-stats">
<text class="page-title">记录历史</text> <view class="hero-stat">
<text class="page-subtitle">按时间查看抽烟和忍住记录</text> <text class="hero-stat-value">{{ filteredLogs.length }}</text>
<text class="hero-stat-label">当前筛选</text>
</view>
<view class="hero-stat">
<text class="hero-stat-value">{{ smokeCount }}</text>
<text class="hero-stat-label">抽烟</text>
</view>
<view class="hero-stat">
<text class="hero-stat-value">{{ resistedCount }}</text>
<text class="hero-stat-label">忍住</text>
</view>
</view>
</view> </view>
<!-- 筛选标签 --> <view class="section">
<view class="filters"> <text class="section-label">筛选记录</text>
<view class="filters card">
<view class="tabs"> <view class="tabs">
<view <view
v-for="tab in tabs" v-for="tab in tabs"
@@ -22,8 +34,8 @@
</view> </view>
</view> </view>
</view> </view>
</view>
<!-- 记录列表 -->
<scroll-view <scroll-view
class="scroll-container" class="scroll-container"
scroll-y scroll-y
@@ -32,7 +44,8 @@
@refresherrefresh="onRefresh" @refresherrefresh="onRefresh"
@scrolltolower="onLoadMore" @scrolltolower="onLoadMore"
> >
<!-- 骨架屏 --> <text class="section-label">时间记录</text>
<view v-if="logsStore.loading && logsStore.logs.length === 0" class="skeleton"> <view v-if="logsStore.loading && logsStore.logs.length === 0" class="skeleton">
<view v-for="i in 3" :key="i" class="skeleton-item"> <view v-for="i in 3" :key="i" class="skeleton-item">
<view class="skeleton-dot"></view> <view class="skeleton-dot"></view>
@@ -44,7 +57,6 @@
</view> </view>
</view> </view>
<!-- 时间轴 -->
<view v-else-if="filteredLogs.length > 0" class="log-list"> <view v-else-if="filteredLogs.length > 0" class="log-list">
<view v-for="(group, date) in groupedLogs" :key="date" class="log-group"> <view v-for="(group, date) in groupedLogs" :key="date" class="log-group">
<view class="group-header"> <view class="group-header">
@@ -97,14 +109,12 @@
</view> </view>
</view> </view>
<!-- 空状态 -->
<view v-else class="empty-state"> <view v-else class="empty-state">
<text class="empty-icon"></text> <text class="empty-icon"></text>
<text class="empty-text">暂无记录</text> <text class="empty-text">暂无记录</text>
<text class="empty-hint">点击右下角按钮开始记录</text> <text class="empty-hint">点击右下角按钮开始记录</text>
</view> </view>
<!-- 加载更多 -->
<view v-if="logsStore.loading && logsStore.logs.length > 0" class="loading-more"> <view v-if="logsStore.loading && logsStore.logs.length > 0" class="loading-more">
<text class="loading-text">加载中...</text> <text class="loading-text">加载中...</text>
</view> </view>
@@ -112,14 +122,14 @@
<view v-if="!logsStore.hasMore && logsStore.logs.length > 0" class="no-more"> <view v-if="!logsStore.hasMore && logsStore.logs.length > 0" class="no-more">
<text class="no-more-text">没有更多了</text> <text class="no-more-text">没有更多了</text>
</view> </view>
<view class="bottom-safe"></view>
</scroll-view> </scroll-view>
<!-- 浮动按钮 -->
<view class="fab" @tap="addLog"> <view class="fab" @tap="addLog">
<text class="fab-icon">+</text> <text class="fab-icon">+</text>
</view> </view>
<!-- 编辑弹框 -->
<smoke-record-dialog <smoke-record-dialog
v-model:show="showEditDialog" v-model:show="showEditDialog"
:type="editType" :type="editType"
@@ -159,6 +169,9 @@ const filteredLogs = computed(() => {
return logs.filter(log => log.type === currentTab.value) return logs.filter(log => log.type === currentTab.value)
}) })
const smokeCount = computed(() => filteredLogs.value.filter(log => log.type === 'smoke').length)
const resistedCount = computed(() => filteredLogs.value.filter(log => log.type === 'resisted').length)
// 按日期分组 // 按日期分组
const groupedLogs = computed(() => { const groupedLogs = computed(() => {
return filteredLogs.value.reduce((groups, log) => { return filteredLogs.value.reduce((groups, log) => {
@@ -305,40 +318,15 @@ onShareAppMessage(() => {
<style scoped> <style scoped>
.page { .page {
min-height: 100vh; min-height: 100vh;
position: relative; display: flex;
background: flex-direction: column;
radial-gradient(circle at top left, rgba(52, 200, 160, 0.16), transparent 30%), background: linear-gradient(180deg, #E6F7F2 0%, #F0FBF7 40%, #FAFFFE 100%);
radial-gradient(circle at top right, rgba(255, 255, 255, 0.92), transparent 24%), padding: 24rpx 28rpx 0;
linear-gradient(180deg, #edf2f8 0%, #f5f7fb 38%, #fbfdff 100%);
box-sizing: border-box; box-sizing: border-box;
overflow: hidden;
} }
.page-glow { .hero-card,
position: absolute; .section,
border-radius: 50%;
filter: blur(24rpx);
opacity: 0.72;
pointer-events: none;
}
.page-glow-a {
top: 60rpx;
left: -140rpx;
width: 360rpx;
height: 360rpx;
background: rgba(52, 200, 160, 0.14);
}
.page-glow-b {
top: 360rpx;
right: -120rpx;
width: 320rpx;
height: 320rpx;
background: rgba(255, 255, 255, 0.9);
}
.page-header,
.filters, .filters,
.scroll-container, .scroll-container,
.fab { .fab {
@@ -346,53 +334,85 @@ onShareAppMessage(() => {
z-index: 1; z-index: 1;
} }
.page-header { .card {
padding: 32rpx 32rpx 8rpx; background: rgba(255, 255, 255, 0.88);
border-radius: 24rpx;
border: 1.5rpx solid rgba(52, 200, 160, 0.14);
box-shadow: 0 4rpx 18rpx rgba(52, 200, 160, 0.07);
padding: 24rpx;
} }
.page-eyebrow { .hero-card {
margin-bottom: 20rpx;
}
.hero-title {
display: block; display: block;
font-size: 20rpx; font-size: 38rpx;
line-height: 1.2;
font-weight: 700; font-weight: 700;
letter-spacing: 4rpx; color: #0D3D2E;
text-transform: uppercase;
color: #98a2b3;
} }
.page-title { .hero-subtitle {
display: block; display: block;
margin-top: 10rpx; margin-top: 10rpx;
font-size: 42rpx; font-size: 25rpx;
line-height: 1.18; line-height: 1.5;
font-weight: 700; color: #52806E;
color: #111827;
} }
.page-subtitle { .hero-stats {
display: flex;
gap: 16rpx;
margin-top: 24rpx;
}
.hero-stat {
flex: 1;
background: rgba(52, 200, 160, 0.06);
border: 1.5rpx solid rgba(52, 200, 160, 0.1);
border-radius: 20rpx;
padding: 18rpx 14rpx;
}
.hero-stat-value {
display: block;
font-size: 40rpx;
font-weight: 700;
color: #0D3D2E;
}
.hero-stat-label {
display: block; display: block;
margin-top: 8rpx; margin-top: 8rpx;
font-size: 24rpx; font-size: 22rpx;
line-height: 1.5; color: #7aA898;
color: #667085; }
.section {
margin-bottom: 20rpx;
}
.section-label {
display: block;
margin: 0 0 14rpx 6rpx;
font-size: 26rpx;
font-weight: 600;
color: #1a5c45;
} }
.filters { .filters {
display: flex; padding: 24rpx;
align-items: center;
gap: 16rpx;
padding: 16rpx 32rpx 8rpx;
} }
.tabs { .tabs {
display: flex; display: flex;
flex: 1; background: rgba(255, 255, 255, 0.82);
background: rgba(255, 255, 255, 0.76); border-radius: 22rpx;
border-radius: 24rpx;
padding: 6rpx; padding: 6rpx;
box-shadow: 0 12rpx 28rpx rgba(15, 23, 42, 0.06); border: 1.5rpx solid rgba(52, 200, 160, 0.14);
border: 2rpx solid rgba(255, 255, 255, 0.66); box-shadow: 0 4rpx 16rpx rgba(52, 200, 160, 0.07);
backdrop-filter: blur(24rpx);
-webkit-backdrop-filter: blur(24rpx);
} }
.tab { .tab {
@@ -400,73 +420,56 @@ onShareAppMessage(() => {
text-align: center; text-align: center;
padding: 14rpx 0; padding: 14rpx 0;
border-radius: 16rpx; border-radius: 16rpx;
font-size: 26rpx; font-size: 24rpx;
color: #6B7280;
transition: all 0.2s;
font-weight: 600; font-weight: 600;
color: #7aA898;
} }
.tab-active { .tab-active {
background: rgba(255, 255, 255, 0.92); background: #FFFFFF;
color: #111827; color: #0D3D2E;
box-shadow: 0 8rpx 18rpx rgba(15, 23, 42, 0.06); box-shadow: 0 4rpx 12rpx rgba(52, 200, 160, 0.12);
}
.filter-btn {
width: 72rpx;
height: 72rpx;
border-radius: 20rpx;
background-color: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
border: 2rpx solid #ECFDF3;
box-shadow: 0 6rpx 14rpx rgba(16, 185, 129, 0.1);
}
.filter-icon {
font-size: 32rpx;
} }
.scroll-container { .scroll-container {
height: calc(100vh - 10rpx); flex: 1;
padding: 0 32rpx 40rpx; min-height: 0;
padding-bottom: calc(140rpx + env(safe-area-inset-bottom));
box-sizing: border-box; box-sizing: border-box;
} }
/* 骨架屏 */
.skeleton { .skeleton {
padding-top: 24rpx; padding-top: 6rpx;
} }
.skeleton-item { .skeleton-item {
position: relative; display: flex;
padding-left: 80rpx; gap: 20rpx;
margin-bottom: 32rpx; margin-bottom: 20rpx;
} }
.skeleton-dot { .skeleton-dot {
position: absolute; width: 64rpx;
left: 0; height: 64rpx;
top: 16rpx; border-radius: 18rpx;
width: 48rpx; background: linear-gradient(90deg, rgba(52, 200, 160, 0.08) 25%, rgba(52, 200, 160, 0.18) 50%, rgba(52, 200, 160, 0.08) 75%);
height: 48rpx;
border-radius: 50%;
background: linear-gradient(90deg, #E5E7EB 25%, #F3F4F6 50%, #E5E7EB 75%);
background-size: 200% 100%; background-size: 200% 100%;
animation: shimmer 1.5s infinite; animation: shimmer 1.5s infinite;
flex-shrink: 0;
} }
.skeleton-card { .skeleton-card {
background: rgba(255, 255, 255, 0.82); flex: 1;
border-radius: 28rpx; background: rgba(255, 255, 255, 0.88);
border-radius: 24rpx;
padding: 24rpx; padding: 24rpx;
border: 2rpx solid rgba(255, 255, 255, 0.66); border: 1.5rpx solid rgba(52, 200, 160, 0.14);
box-shadow: 0 4rpx 18rpx rgba(52, 200, 160, 0.07);
} }
.skeleton-line { .skeleton-line {
height: 24rpx; height: 24rpx;
background: linear-gradient(90deg, #E5E7EB 25%, #F3F4F6 50%, #E5E7EB 75%); background: linear-gradient(90deg, rgba(52, 200, 160, 0.08) 25%, rgba(52, 200, 160, 0.18) 50%, rgba(52, 200, 160, 0.08) 75%);
background-size: 200% 100%; background-size: 200% 100%;
animation: shimmer 1.5s infinite; animation: shimmer 1.5s infinite;
border-radius: 8rpx; border-radius: 8rpx;
@@ -491,30 +494,30 @@ onShareAppMessage(() => {
100% { background-position: 200% 0; } 100% { background-position: 200% 0; }
} }
/* 列表分组 */
.log-group { .log-group {
margin-bottom: 32rpx; margin-bottom: 28rpx;
} }
.group-header { .group-header {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 12rpx; gap: 12rpx;
margin-bottom: 16rpx; margin-bottom: 14rpx;
} }
.group-title { .group-title {
font-size: 30rpx; font-size: 28rpx;
font-weight: 700; font-weight: 700;
color: #0F172A; color: #0D3D2E;
} }
.group-count { .group-count {
font-size: 22rpx; font-size: 22rpx;
color: #667085; color: #7aA898;
background-color: rgba(255, 255, 255, 0.76); background-color: rgba(52, 200, 160, 0.06);
padding: 6rpx 16rpx; padding: 6rpx 16rpx;
border-radius: 999rpx; border-radius: 999rpx;
border: 1.5rpx solid rgba(52, 200, 160, 0.14);
} }
.group-items { .group-items {
@@ -525,25 +528,22 @@ onShareAppMessage(() => {
.log-card { .log-card {
position: relative; position: relative;
background: rgba(255, 255, 255, 0.82); background: rgba(255, 255, 255, 0.88);
border-radius: 28rpx; border-radius: 24rpx;
padding: 24rpx 24rpx 20rpx 24rpx; padding: 24rpx 24rpx 20rpx 24rpx;
box-shadow: 0 14rpx 32rpx rgba(15, 23, 42, 0.06); box-shadow: 0 4rpx 18rpx rgba(52, 200, 160, 0.07);
display: flex; display: flex;
gap: 20rpx; gap: 20rpx;
overflow: hidden; overflow: hidden;
backdrop-filter: blur(24rpx); border: 1.5rpx solid rgba(52, 200, 160, 0.14);
-webkit-backdrop-filter: blur(24rpx);
} }
.log-card-resisted { .log-card-resisted {
background: linear-gradient(135deg, rgba(245, 255, 251, 0.95), rgba(255, 255, 255, 0.88)); background: linear-gradient(135deg, rgba(245, 255, 251, 0.96), rgba(255, 255, 255, 0.88));
border: 2rpx solid rgba(255, 255, 255, 0.7);
} }
.log-card-smoke { .log-card-smoke {
background: linear-gradient(135deg, rgba(255, 248, 242, 0.95), rgba(255, 255, 255, 0.88)); background: linear-gradient(135deg, rgba(255, 250, 244, 0.96), rgba(255, 255, 255, 0.88));
border: 2rpx solid rgba(255, 255, 255, 0.7);
} }
.log-bar { .log-bar {
@@ -552,11 +552,11 @@ onShareAppMessage(() => {
top: 0; top: 0;
bottom: 0; bottom: 0;
width: 8rpx; width: 8rpx;
background-color: #10B981; background-color: #34C8A0;
} }
.log-card-smoke .log-bar { .log-card-smoke .log-bar {
background-color: #F97316; background-color: #B45309;
} }
.log-icon { .log-icon {
@@ -572,13 +572,13 @@ onShareAppMessage(() => {
} }
.icon-resisted { .icon-resisted {
background-color: rgba(16, 185, 129, 0.16); background-color: rgba(52, 200, 160, 0.12);
color: #0F766E; color: #1a8c62;
} }
.icon-smoke { .icon-smoke {
background-color: rgba(249, 115, 22, 0.15); background-color: rgba(251, 191, 36, 0.14);
color: #C2410C; color: #B45309;
} }
.log-main { .log-main {
@@ -603,24 +603,24 @@ onShareAppMessage(() => {
.log-time { .log-time {
font-size: 30rpx; font-size: 30rpx;
font-weight: 700; font-weight: 700;
color: #0F172A; color: #0D3D2E;
} }
.log-tag { .log-tag {
font-size: 22rpx; font-size: 22rpx;
padding: 6rpx 14rpx; padding: 8rpx 16rpx;
border-radius: 12rpx; border-radius: 999rpx;
font-weight: 700; font-weight: 600;
} }
.tag-smoke { .tag-smoke {
background-color: #FEE2E2; background-color: rgba(251, 191, 36, 0.14);
color: #DC2626; color: #B45309;
} }
.tag-resisted { .tag-resisted {
background-color: #DCFCE7; background-color: rgba(52, 200, 160, 0.12);
color: #16A34A; color: #1a8c62;
} }
.log-right { .log-right {
@@ -632,24 +632,24 @@ onShareAppMessage(() => {
.count-pill { .count-pill {
font-size: 22rpx; font-size: 22rpx;
color: #DC2626; color: #B45309;
background-color: #FEE2E2; background-color: rgba(251, 191, 36, 0.14);
padding: 6rpx 14rpx; padding: 8rpx 16rpx;
border-radius: 12rpx; border-radius: 999rpx;
font-weight: 700; font-weight: 600;
} }
.thumb-pill { .thumb-pill {
font-size: 24rpx; font-size: 24rpx;
background-color: #DCFCE7; background-color: rgba(52, 200, 160, 0.12);
color: #16A34A; color: #1a8c62;
padding: 6rpx 12rpx; padding: 8rpx 14rpx;
border-radius: 12rpx; border-radius: 999rpx;
} }
.log-desc { .log-desc {
font-size: 24rpx; font-size: 25rpx;
color: #475467; color: #52806E;
line-height: 1.5; line-height: 1.5;
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }
@@ -669,10 +669,11 @@ onShareAppMessage(() => {
.log-interval { .log-interval {
font-size: 22rpx; font-size: 22rpx;
color: #667085; color: #7aA898;
background-color: rgba(255, 255, 255, 0.72); background-color: rgba(52, 200, 160, 0.06);
padding: 4rpx 12rpx; padding: 6rpx 14rpx;
border-radius: 999rpx; border-radius: 999rpx;
border: 1.5rpx solid rgba(52, 200, 160, 0.12);
} }
.log-actions { .log-actions {
@@ -684,31 +685,31 @@ onShareAppMessage(() => {
.action-btn { .action-btn {
font-size: 22rpx; font-size: 22rpx;
padding: 6rpx 14rpx; padding: 8rpx 16rpx;
border-radius: 999rpx; border-radius: 999rpx;
background-color: rgba(255, 255, 255, 0.8); background-color: rgba(255, 255, 255, 0.9);
border: 2rpx solid rgba(15, 23, 42, 0.08); border: 1.5rpx solid rgba(52, 200, 160, 0.18);
color: #667085; color: #7aA898;
} }
.edit-btn { .edit-btn {
color: #2563EB; color: #2563EB;
border-color: #DBEAFE; border-color: rgba(37, 99, 235, 0.18);
background-color: #EFF6FF; background-color: rgba(37, 99, 235, 0.08);
} }
.delete-btn { .delete-btn {
color: #DC2626; color: #DC2626;
border-color: #FECACA; border-color: rgba(220, 38, 38, 0.16);
background-color: #FEF2F2; background-color: rgba(220, 38, 38, 0.08);
} }
.level-unknown { .level-unknown {
color: #64748B; color: #7aA898;
} }
.level-1 { .level-1 {
color: #16A34A; color: #1a8c62;
} }
.level-2 { .level-2 {
@@ -727,43 +728,44 @@ onShareAppMessage(() => {
color: #EF4444; color: #EF4444;
} }
/* 空状态 */
.empty-state { .empty-state {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 120rpx 32rpx; padding: 120rpx 32rpx;
border-radius: 24rpx;
border: 2rpx dashed rgba(52, 200, 160, 0.2);
background: transparent;
} }
.empty-icon { .empty-icon {
width: 112rpx; width: 112rpx;
height: 112rpx; height: 112rpx;
border-radius: 36rpx; border-radius: 36rpx;
background: rgba(255, 255, 255, 0.82); background: rgba(52, 200, 160, 0.06);
border: 2rpx solid rgba(255, 255, 255, 0.68); border: 1.5rpx solid rgba(52, 200, 160, 0.14);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-size: 40rpx; font-size: 40rpx;
font-weight: 700; font-weight: 700;
color: #98a2b3; color: #7aA898;
margin-bottom: 24rpx; margin-bottom: 24rpx;
} }
.empty-text { .empty-text {
font-size: 32rpx; font-size: 32rpx;
color: #6B7280; color: #0D3D2E;
font-weight: 500; font-weight: 600;
margin-bottom: 12rpx; margin-bottom: 12rpx;
} }
.empty-hint { .empty-hint {
font-size: 26rpx; font-size: 24rpx;
color: #9CA3AF; color: #7aA898;
} }
/* 加载状态 */
.loading-more, .no-more { .loading-more, .no-more {
text-align: center; text-align: center;
padding: 32rpx; padding: 32rpx;
@@ -771,22 +773,21 @@ onShareAppMessage(() => {
.loading-text, .no-more-text { .loading-text, .no-more-text {
font-size: 24rpx; font-size: 24rpx;
color: #9CA3AF; color: #7aA898;
} }
/* 浮动按钮 */
.fab { .fab {
position: fixed; position: fixed;
right: 32rpx; right: 32rpx;
bottom: 140rpx; bottom: 140rpx;
width: 96rpx; width: 96rpx;
height: 96rpx; height: 96rpx;
background: linear-gradient(180deg, #32c59d 0%, #1aa37a 100%); background: linear-gradient(180deg, #3DD9AE 0%, #34C8A0 100%);
border-radius: 50%; border-radius: 50%;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
box-shadow: 0 16rpx 34rpx rgba(26, 163, 122, 0.24); box-shadow: 0 12rpx 28rpx rgba(52, 200, 160, 0.28);
transition: all 0.3s; transition: all 0.3s;
z-index: 100; z-index: 100;
} }
@@ -800,4 +801,8 @@ onShareAppMessage(() => {
color: #FFFFFF; color: #FFFFFF;
font-weight: 300; font-weight: 300;
} }
.bottom-safe {
height: calc(32rpx + env(safe-area-inset-bottom));
}
</style> </style>
+14
View File
@@ -100,6 +100,20 @@ async function selectMode(mode) {
onMounted(async () => { onMounted(async () => {
setupNavBar() setupNavBar()
await waitForLogin() await waitForLogin()
// New users go directly to onboarding (single-page flow)
try {
const profileData = await profileStore.fetchProfile()
const profile = profileData?.profile
const isCompleted = profileData?.is_completed ||
(profile && profile.onboarding_completed_at) ||
(profile && profile.baseline_cigs_per_day > 0)
if (!profileData?.exists || !isCompleted) {
uni.redirectTo({ url: '/pages/onboarding/index' })
}
} catch (e) {
// If fetch fails, let user choose mode normally
}
}) })
</script> </script>
+97 -76
View File
@@ -17,6 +17,7 @@
:class="{ 'mode-switch-item-active': formData.mode === item.value }" :class="{ 'mode-switch-item-active': formData.mode === item.value }"
@tap="selectMode(item.value)" @tap="selectMode(item.value)"
> >
<text class="mode-switch-icon">{{ item.icon }}</text>
<text class="mode-switch-title">{{ item.label }}</text> <text class="mode-switch-title">{{ item.label }}</text>
<text class="mode-switch-desc">{{ item.desc }}</text> <text class="mode-switch-desc">{{ item.desc }}</text>
</view> </view>
@@ -98,7 +99,7 @@
v-model="priceYuan" v-model="priceYuan"
class="inline-field" class="inline-field"
placeholder="25" placeholder="25"
placeholder-style="color: #9CA3AF" placeholder-style="color: #9CC5B5"
/> />
<text class="inline-unit">/</text> <text class="inline-unit">/</text>
</view> </view>
@@ -131,8 +132,8 @@ const navBarHeight = ref(0)
const modeSaving = ref(false) const modeSaving = ref(false)
const modeOptions = [ const modeOptions = [
{ value: 'quit', label: '戒烟打卡', desc: '按天记录今天没抽' }, { value: 'quit', label: '戒烟打卡', desc: '按天打卡,坚持戒烟', icon: '🌿' },
{ value: 'record', label: '记录抽烟', desc: '按支数记录变化' } { value: 'record', label: '记录抽烟', desc: '按支数记录变化趋势', icon: '📊' }
] ]
const formData = ref({ const formData = ref({
@@ -274,50 +275,56 @@ onShareAppMessage(() => {
</script> </script>
<style scoped> <style scoped>
/* ── 页面基础 ── */
.page { .page {
min-height: 100vh; min-height: 100vh;
background: background: linear-gradient(180deg, #E6F7F2 0%, #F0FBF7 40%, #FAFFFE 100%);
radial-gradient(circle at top left, rgba(52, 200, 160, 0.16), transparent 30%),
radial-gradient(circle at top right, rgba(255, 255, 255, 0.92), transparent 22%),
linear-gradient(180deg, #edf2f8 0%, #f5f7fb 38%, #fbfdff 100%);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.nav-area { .nav-area {
padding: 24rpx 32rpx; padding: 20rpx 32rpx 16rpx;
background: transparent; background: transparent;
} }
.nav-title { .nav-title {
display: block; display: block;
font-size: 40rpx; font-size: 38rpx;
font-weight: 700; font-weight: 700;
color: #111827; color: #0D3D2E;
} }
.nav-subtitle { .nav-subtitle {
display: block; display: block;
margin-top: 8rpx; margin-top: 6rpx;
font-size: 26rpx; font-size: 24rpx;
color: #6B7280; color: #52806E;
} }
/* ── 滚动区 ── */
.content { .content {
flex: 1; flex: 1;
padding: 0 32rpx; padding: 0 28rpx;
} }
/* ── 卡片式表单区块 ── */
.form-section { .form-section {
margin-bottom: 40rpx; margin-bottom: 20rpx;
background: rgba(255, 255, 255, 0.88);
border-radius: 24rpx;
border: 1.5rpx solid rgba(52, 200, 160, 0.14);
box-shadow: 0 4rpx 18rpx rgba(52, 200, 160, 0.07);
padding: 28rpx 24rpx;
} }
.section-label { .section-label {
display: block; display: block;
margin-bottom: 16rpx; margin-bottom: 18rpx;
font-size: 28rpx; font-size: 26rpx;
font-weight: 600; font-weight: 600;
color: #374151; color: #1a5c45;
letter-spacing: 0.4rpx;
} }
.section-row { .section-row {
@@ -326,7 +333,7 @@ onShareAppMessage(() => {
align-items: center; align-items: center;
} }
/* Mode switch */ /* ── 模式选择 ── */
.mode-switch { .mode-switch {
display: grid; display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-columns: repeat(2, minmax(0, 1fr));
@@ -334,35 +341,50 @@ onShareAppMessage(() => {
} }
.mode-switch-item { .mode-switch-item {
padding: 24rpx; padding: 28rpx 20rpx;
border-radius: 20rpx; border-radius: 20rpx;
background: rgba(255, 255, 255, 0.8); background: rgba(255, 255, 255, 0.72);
border: 2rpx solid rgba(255, 255, 255, 0.66); border: 2rpx solid rgba(52, 200, 160, 0.1);
box-shadow: 0 8rpx 24rpx rgba(15, 23, 42, 0.05); box-shadow: 0 2rpx 10rpx rgba(52, 200, 160, 0.04);
transition: all 0.2s;
} }
.mode-switch-item-active { .mode-switch-item-active {
background: rgba(255, 255, 255, 0.96); background: rgba(52, 200, 160, 0.09);
border-color: rgba(26, 163, 122, 0.3); border-color: rgba(52, 200, 160, 0.45);
box-shadow: 0 8rpx 24rpx rgba(26, 163, 122, 0.1); box-shadow: 0 4rpx 16rpx rgba(52, 200, 160, 0.14);
}
.mode-switch-icon {
display: block;
font-size: 40rpx;
margin-bottom: 10rpx;
} }
.mode-switch-title { .mode-switch-title {
display: block; display: block;
font-size: 28rpx; font-size: 28rpx;
font-weight: 600; font-weight: 700;
color: #111827; color: #0D3D2E;
}
.mode-switch-item-active .mode-switch-title {
color: #1a8c62;
} }
.mode-switch-desc { .mode-switch-desc {
display: block; display: block;
margin-top: 8rpx; margin-top: 6rpx;
font-size: 22rpx; font-size: 21rpx;
line-height: 1.4; line-height: 1.5;
color: #6b7280; color: #7aA898;
} }
/* Inline input */ .mode-switch-item-active .mode-switch-desc {
color: #3a9e78;
}
/* ── 数字步进器 ── */
.inline-input { .inline-input {
display: flex; display: flex;
align-items: center; align-items: center;
@@ -370,71 +392,70 @@ onShareAppMessage(() => {
} }
.inline-btn { .inline-btn {
width: 56rpx; width: 60rpx;
height: 56rpx; height: 60rpx;
border-radius: 50%; border-radius: 50%;
background: rgba(255, 255, 255, 0.9); background: rgba(52, 200, 160, 0.1);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-size: 36rpx; font-size: 38rpx;
color: #1aa37a; color: #34C8A0;
border: 2rpx solid rgba(255, 255, 255, 0.72); border: 1.5rpx solid rgba(52, 200, 160, 0.25);
box-shadow: 0 4rpx 12rpx rgba(15, 23, 42, 0.06);
} }
.inline-value { .inline-value {
font-size: 36rpx; font-size: 38rpx;
font-weight: 700; font-weight: 700;
color: #111827; color: #0D3D2E;
min-width: 48rpx; min-width: 52rpx;
text-align: center; text-align: center;
} }
.inline-unit { .inline-unit {
font-size: 26rpx; font-size: 24rpx;
color: #6B7280; color: #7aA898;
} }
.inline-field { .inline-field {
width: 100rpx; width: 100rpx;
font-size: 32rpx; font-size: 32rpx;
font-weight: 600; font-weight: 600;
color: #111827; color: #0D3D2E;
text-align: center; text-align: center;
background: rgba(255, 255, 255, 0.9); background: rgba(52, 200, 160, 0.06);
padding: 12rpx 16rpx; padding: 10rpx 14rpx;
border-radius: 12rpx; border-radius: 12rpx;
border: 2rpx solid rgba(255, 255, 255, 0.72); border: 1.5rpx solid rgba(52, 200, 160, 0.2);
} }
/* Options row */ /* ── 标签选择 ── */
.options-row { .options-row {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 16rpx; gap: 14rpx;
} }
.option-tag { .option-tag {
padding: 16rpx 28rpx; padding: 14rpx 26rpx;
border-radius: 999rpx; border-radius: 999rpx;
background: rgba(255, 255, 255, 0.84); background: rgba(255, 255, 255, 0.9);
font-size: 26rpx; font-size: 25rpx;
color: #374151; color: #4a7a66;
border: 2rpx solid rgba(255, 255, 255, 0.72); border: 1.5rpx solid rgba(52, 200, 160, 0.18);
box-shadow: 0 4rpx 12rpx rgba(15, 23, 42, 0.04);
} }
.option-tag-active { .option-tag-active {
background: rgba(26, 163, 122, 0.12); background: rgba(52, 200, 160, 0.12);
border-color: rgba(26, 163, 122, 0.3); border-color: rgba(52, 200, 160, 0.45);
color: #1a7f61; color: #1a7f61;
font-weight: 600;
} }
/* Time row */ /* ── 作息时间 ── */
.time-row { .time-row {
display: flex; display: flex;
gap: 24rpx; gap: 20rpx;
} }
.time-item { .time-item {
@@ -442,52 +463,52 @@ onShareAppMessage(() => {
} }
.time-label { .time-label {
font-size: 24rpx; font-size: 22rpx;
color: #6B7280; color: #7aA898;
display: block; display: block;
margin-bottom: 8rpx; margin-bottom: 8rpx;
} }
.time-picker { .time-picker {
background: rgba(255, 255, 255, 0.9); background: rgba(52, 200, 160, 0.06);
padding: 20rpx 24rpx; padding: 18rpx 20rpx;
border-radius: 12rpx; border-radius: 14rpx;
font-size: 32rpx; font-size: 30rpx;
font-weight: 600; font-weight: 600;
color: #111827; color: #0D3D2E;
text-align: center; text-align: center;
border: 2rpx solid rgba(255, 255, 255, 0.72); border: 1.5rpx solid rgba(52, 200, 160, 0.2);
box-shadow: 0 4rpx 12rpx rgba(15, 23, 42, 0.04);
} }
/* ── 底部空白 + 按钮 ── */
.bottom-space { .bottom-space {
height: 160rpx; height: 160rpx;
} }
/* Footer */
.footer { .footer {
position: fixed; position: fixed;
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
padding: 24rpx 32rpx; padding: 20rpx 28rpx;
padding-bottom: calc(24rpx + env(safe-area-inset-bottom)); padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
background: linear-gradient(180deg, transparent 0%, rgba(248, 250, 252, 0.95) 40%); background: linear-gradient(180deg, transparent 0%, rgba(240, 251, 247, 0.97) 35%);
} }
.btn-primary { .btn-primary {
height: 96rpx; height: 96rpx;
background: linear-gradient(180deg, #32c59d 0%, #1aa37a 100%); background: linear-gradient(180deg, #3DD9AE 0%, #34C8A0 100%);
border-radius: 48rpx; border-radius: 48rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
box-shadow: 0 12rpx 28rpx rgba(26, 163, 122, 0.22); box-shadow: 0 12rpx 28rpx rgba(52, 200, 160, 0.28);
} }
.btn-text { .btn-text {
font-size: 32rpx; font-size: 32rpx;
font-weight: 600; font-weight: 600;
color: #FFFFFF; color: #FFFFFF;
letter-spacing: 1rpx;
} }
</style> </style>
+82 -147
View File
@@ -1,16 +1,10 @@
<template> <template>
<view class="page"> <view class="page">
<view class="page-glow page-glow-a"></view>
<view class="page-glow page-glow-b"></view>
<view class="nav-placeholder" :style="{ height: navBarHeight + 'px' }"></view> <view class="nav-placeholder" :style="{ height: navBarHeight + 'px' }"></view>
<view class="page-header"> <view class="section">
<text class="header-eyebrow">Account</text> <text class="section-label">当前账号</text>
<text class="header-title">个人中心</text> <view class="user-section card">
<text class="header-subtitle">模式切换分享与基础设置</text>
</view>
<view class="user-section">
<image class="avatar" :src="userAvatar" mode="aspectFill"></image> <image class="avatar" :src="userAvatar" mode="aspectFill"></image>
<view class="user-copy"> <view class="user-copy">
<text class="user-name">{{ userName }}</text> <text class="user-name">{{ userName }}</text>
@@ -21,9 +15,11 @@
</view> </view>
</view> </view>
</view> </view>
</view>
<view class="section"> <view class="section">
<view class="mode-card"> <text class="section-label">使用模式</text>
<view class="mode-card card">
<view class="mode-card-header"> <view class="mode-card-header">
<view class="menu-icon menu-icon-accent"> <view class="menu-icon menu-icon-accent">
<text class="menu-glyph"></text> <text class="menu-glyph"></text>
@@ -48,7 +44,8 @@
<text class="mode-hint">当前{{ modeText }}</text> <text class="mode-hint">当前{{ modeText }}</text>
</view> </view>
<view class="menu-list"> <text class="section-label">常用操作</text>
<view class="menu-list card">
<view class="menu-item"> <view class="menu-item">
<view class="menu-icon menu-icon-accent"> <view class="menu-icon menu-icon-accent">
<text class="menu-glyph"></text> <text class="menu-glyph"></text>
@@ -83,7 +80,8 @@
</view> </view>
<view class="section"> <view class="section">
<view class="menu-list"> <text class="section-label">更多设置</text>
<view class="menu-list card">
<view class="menu-item" @tap="clearCache"> <view class="menu-item" @tap="clearCache">
<view class="menu-icon menu-icon-muted"> <view class="menu-icon menu-icon-muted">
<text class="menu-glyph"></text> <text class="menu-glyph"></text>
@@ -111,6 +109,7 @@
</view> </view>
<text class="version">版本 1.0.0</text> <text class="version">版本 1.0.0</text>
<view class="bottom-safe"></view>
</view> </view>
</template> </template>
@@ -286,98 +285,50 @@ onShow(async () => {
.page { .page {
min-height: 100vh; min-height: 100vh;
position: relative; position: relative;
background: background: linear-gradient(180deg, #E6F7F2 0%, #F0FBF7 40%, #FAFFFE 100%);
radial-gradient(circle at top left, rgba(52, 200, 160, 0.16), transparent 30%), padding: 0 28rpx 0;
radial-gradient(circle at top right, rgba(255, 255, 255, 0.92), transparent 22%),
linear-gradient(180deg, #edf2f8 0%, #f5f7fb 38%, #fbfdff 100%);
padding: 0 24rpx 168rpx;
box-sizing: border-box; box-sizing: border-box;
overflow: hidden;
}
.page-glow {
position: absolute;
border-radius: 50%;
filter: blur(24rpx);
opacity: 0.72;
pointer-events: none;
}
.page-glow-a {
top: 100rpx;
left: -140rpx;
width: 360rpx;
height: 360rpx;
background: rgba(52, 200, 160, 0.15);
}
.page-glow-b {
top: 340rpx;
right: -120rpx;
width: 320rpx;
height: 320rpx;
background: rgba(255, 255, 255, 0.86);
} }
.nav-placeholder, .nav-placeholder,
.page-header,
.user-section,
.section, .section,
.version { .version {
position: relative; position: relative;
z-index: 1; z-index: 1;
} }
.page-header { .section {
padding: 24rpx 6rpx 18rpx; margin-bottom: 20rpx;
} }
.header-eyebrow { .section-label {
display: block; display: block;
font-size: 20rpx; margin: 0 0 14rpx 6rpx;
font-weight: 700; font-size: 26rpx;
letter-spacing: 4rpx; font-weight: 600;
text-transform: uppercase; color: #1a5c45;
color: #98a2b3;
} }
.header-title { .card {
display: block; background: rgba(255, 255, 255, 0.88);
margin-top: 10rpx; border-radius: 24rpx;
font-size: 42rpx; padding: 24rpx;
line-height: 1.18; border: 1.5rpx solid rgba(52, 200, 160, 0.14);
font-weight: 700; box-shadow: 0 4rpx 18rpx rgba(52, 200, 160, 0.07);
color: #111827;
}
.header-subtitle {
display: block;
margin-top: 8rpx;
font-size: 24rpx;
line-height: 1.5;
color: #667085;
} }
.user-section { .user-section {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 24rpx; gap: 24rpx;
padding: 12rpx 28rpx 32rpx;
margin-bottom: 24rpx;
background: rgba(255, 255, 255, 0.74);
border: 2rpx solid rgba(255, 255, 255, 0.66);
border-radius: 32rpx;
box-shadow: 0 16rpx 42rpx rgba(15, 23, 42, 0.08);
backdrop-filter: blur(24rpx);
-webkit-backdrop-filter: blur(24rpx);
} }
.avatar { .avatar {
width: 132rpx; width: 120rpx;
height: 132rpx; height: 120rpx;
border-radius: 50%; border-radius: 50%;
border: 4rpx solid rgba(255, 255, 255, 0.82); border: 4rpx solid rgba(52, 200, 160, 0.16);
background-color: rgba(255, 255, 255, 0.7); background-color: rgba(52, 200, 160, 0.06);
} }
.user-copy { .user-copy {
@@ -388,110 +339,93 @@ onShow(async () => {
} }
.user-name { .user-name {
font-size: 40rpx; font-size: 38rpx;
font-weight: 700; font-weight: 700;
color: #111827; color: #0D3D2E;
} }
.user-desc { .user-desc {
display: block; display: block;
margin-top: 8rpx; margin-top: 8rpx;
font-size: 24rpx; font-size: 25rpx;
line-height: 1.5; line-height: 1.5;
color: #667085; color: #52806E;
} }
.user-meta { .user-meta {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 12rpx; gap: 14rpx;
margin-top: 18rpx; margin-top: 16rpx;
} }
.user-pill { .user-pill {
padding: 10rpx 20rpx; padding: 14rpx 26rpx;
border-radius: 999rpx; border-radius: 999rpx;
background: rgba(52, 200, 160, 0.12); background: rgba(52, 200, 160, 0.12);
border: 2rpx solid rgba(255, 255, 255, 0.64); border: 1.5rpx solid rgba(52, 200, 160, 0.18);
font-size: 22rpx; font-size: 22rpx;
font-weight: 600; font-weight: 600;
color: #17795c; color: #1a8c62;
} }
.user-pill-muted { .user-pill-muted {
background: rgba(255, 255, 255, 0.78); background: rgba(52, 200, 160, 0.06);
color: #667085; color: #7aA898;
}
.section {
margin-bottom: 24rpx;
} }
.mode-card { .mode-card {
background: rgba(255, 255, 255, 0.76);
border-radius: 32rpx;
padding: 30rpx 24rpx;
border: 2rpx solid rgba(255, 255, 255, 0.66);
box-shadow: 0 16rpx 42rpx rgba(15, 23, 42, 0.08);
backdrop-filter: blur(24rpx);
-webkit-backdrop-filter: blur(24rpx);
margin-bottom: 16rpx; margin-bottom: 16rpx;
} }
.mode-card-header { .mode-card-header {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 24rpx; gap: 20rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.menu-list { .menu-list {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
background: rgba(255, 255, 255, 0.8);
border-radius: 32rpx;
border: 2rpx solid rgba(255, 255, 255, 0.66);
box-shadow: 0 16rpx 42rpx rgba(15, 23, 42, 0.08);
backdrop-filter: blur(24rpx);
-webkit-backdrop-filter: blur(24rpx);
overflow: hidden; overflow: hidden;
} }
.menu-item { .menu-item {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 24rpx; gap: 20rpx;
padding: 28rpx 24rpx; padding: 6rpx 0;
} }
.menu-divider { .menu-divider {
margin: 0 24rpx; margin: 16rpx 0;
height: 2rpx; height: 2rpx;
background: rgba(15, 23, 42, 0.06); background: rgba(52, 200, 160, 0.12);
} }
.menu-icon { .menu-icon {
width: 64rpx; width: 64rpx;
height: 64rpx; height: 64rpx;
border-radius: 20rpx; border-radius: 18rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
border: 2rpx solid rgba(255, 255, 255, 0.7); border: 1.5rpx solid rgba(52, 200, 160, 0.18);
} }
.menu-icon-accent { .menu-icon-accent {
background: rgba(52, 200, 160, 0.14); background: rgba(52, 200, 160, 0.12);
} }
.menu-icon-muted { .menu-icon-muted {
background: rgba(255, 255, 255, 0.82); background: rgba(52, 200, 160, 0.06);
} }
.menu-glyph { .menu-glyph {
font-size: 24rpx; font-size: 24rpx;
font-weight: 700; font-weight: 700;
color: #111827; color: #1a8c62;
} }
.menu-content { .menu-content {
@@ -502,15 +436,15 @@ onShow(async () => {
} }
.menu-label { .menu-label {
font-size: 30rpx; font-size: 28rpx;
color: #111827; color: #0D3D2E;
font-weight: 600; font-weight: 600;
} }
.menu-desc { .menu-desc {
font-size: 24rpx; font-size: 25rpx;
line-height: 1.5; line-height: 1.5;
color: #667085; color: #52806E;
} }
.menu-actions { .menu-actions {
@@ -519,57 +453,54 @@ onShow(async () => {
align-items: center; align-items: center;
flex-wrap: wrap; flex-wrap: wrap;
gap: 8rpx; gap: 8rpx;
font-size: 24rpx; font-size: 22rpx;
color: #1aa37a; color: #1a8c62;
} }
.menu-action { .menu-action {
color: #1aa37a; color: #1a8c62;
} }
.menu-action-sep { .menu-action-sep {
color: #98a2b3; color: #7aA898;
} }
.menu-arrow { .menu-arrow {
font-size: 36rpx; font-size: 36rpx;
color: #98a2b3; color: #7aA898;
} }
.menu-value { .menu-value {
font-size: 24rpx; font-size: 24rpx;
font-weight: 600; font-weight: 600;
color: #1aa37a; color: #1a8c62;
} }
.mode-switch { .mode-switch {
display: flex; display: flex;
gap: 12rpx; gap: 16rpx;
padding: 8rpx;
border-radius: 24rpx;
background: rgba(247, 249, 252, 0.92);
border: 2rpx solid rgba(15, 23, 42, 0.05);
} }
.mode-switch-item { .mode-switch-item {
flex: 1; flex: 1;
padding: 22rpx 18rpx; padding: 22rpx 20rpx;
border-radius: 20rpx; border-radius: 20rpx;
background: transparent; background: rgba(255, 255, 255, 0.72);
border: 2rpx solid transparent; border: 2rpx solid rgba(52, 200, 160, 0.1);
box-shadow: 0 2rpx 10rpx rgba(52, 200, 160, 0.04);
} }
.mode-switch-item-active { .mode-switch-item-active {
background: rgba(255, 255, 255, 0.94); background: rgba(52, 200, 160, 0.09);
border-color: rgba(255, 255, 255, 0.76); border-color: rgba(52, 200, 160, 0.45);
box-shadow: 0 8rpx 18rpx rgba(15, 23, 42, 0.06); box-shadow: 0 4rpx 16rpx rgba(52, 200, 160, 0.14);
} }
.mode-switch-title { .mode-switch-title {
display: block; display: block;
font-size: 28rpx; font-size: 28rpx;
font-weight: 700; font-weight: 700;
color: #111827; color: #0D3D2E;
} }
.mode-switch-desc { .mode-switch-desc {
@@ -577,30 +508,30 @@ onShow(async () => {
margin-top: 8rpx; margin-top: 8rpx;
font-size: 22rpx; font-size: 22rpx;
line-height: 1.5; line-height: 1.5;
color: #667085; color: #7aA898;
} }
.mode-hint { .mode-hint {
display: block; display: block;
margin-top: 16rpx; margin-top: 16rpx;
font-size: 22rpx; font-size: 22rpx;
color: #1aa37a; color: #1a8c62;
} }
.share-btn { .share-btn {
margin: 0; margin: 0;
padding: 12rpx 22rpx; padding: 16rpx 28rpx;
line-height: 1.4; line-height: 1.4;
font-size: 24rpx; font-size: 24rpx;
border: none; border: none;
border-radius: 999rpx; border-radius: 999rpx;
color: #FFFFFF; color: #FFFFFF;
background: linear-gradient(180deg, #32c59d 0%, #1aa37a 100%); background: linear-gradient(180deg, #3DD9AE 0%, #34C8A0 100%);
box-shadow: 0 12rpx 28rpx rgba(26, 163, 122, 0.2); box-shadow: 0 12rpx 28rpx rgba(52, 200, 160, 0.28);
} }
.share-btn[disabled] { .share-btn[disabled] {
background: #98a2b3; background: #9CC5B5;
color: #FFFFFF; color: #FFFFFF;
} }
@@ -612,7 +543,11 @@ onShow(async () => {
display: block; display: block;
text-align: center; text-align: center;
font-size: 22rpx; font-size: 22rpx;
color: #98a2b3; color: #7aA898;
margin-top: 32rpx; margin-top: 28rpx;
}
.bottom-safe {
height: calc(32rpx + env(safe-area-inset-bottom));
} }
</style> </style>
+467 -870
View File
File diff suppressed because it is too large Load Diff
+5 -1
View File
@@ -5,9 +5,13 @@ import Uni from '@uni-helper/plugin-uni'
export default defineConfig({ export default defineConfig({
server: { server: {
host: '0.0.0.0',
port: 5173,
strictPort: true,
proxy: { proxy: {
'/api/v1': { '/api/v1': {
target: 'http://localhost:8080', // target: 'http://localhost:8080',
target: 'http://nas.quitsmok.top:8300',
changeOrigin: true changeOrigin: true
} }
} }