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
+3 -2
View File
@@ -2,13 +2,14 @@ import { request } from './request'
import { MINI_PROGRAM_ID } from '@/config'
import { storage, SESSION_KEY, USER_KEY } from '@/utils/storage'
const H5_DEBUG_SESSION_KEY = 'o3dUk5QYaPdfMN9hBxeuouE0q63E'
const H5_DEBUG_SESSION_KEY = 'FxLFPHHBw49loODmRSvqdg=='
export function applyH5DebugSession() {
let applied = false
// #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.remove(USER_KEY)
applied = true
}
// #endif
+1
View File
@@ -13,6 +13,7 @@ function isInvalidToken(res) {
export const request = {
async request(options) {
const sessionKey = storage.get(SESSION_KEY)
// 测试
const isRetryAfter401 = options._retryAfter401 === true
return new Promise((resolve, reject) => {
+196 -191
View File
@@ -1,29 +1,41 @@
<template>
<view class="page">
<view class="page-glow page-glow-a"></view>
<view class="page-glow page-glow-b"></view>
<view class="page-header">
<text class="page-eyebrow">History</text>
<text class="page-title">记录历史</text>
<text class="page-subtitle">按时间查看抽烟和忍住记录</text>
</view>
<!-- 筛选标签 -->
<view class="filters">
<view class="tabs">
<view
v-for="tab in tabs"
:key="tab.value"
class="tab"
:class="{ 'tab-active': currentTab === tab.value }"
@tap="currentTab = tab.value"
>
{{ tab.label }}
<view class="hero-card card">
<text class="hero-title">记录历史</text>
<text class="hero-subtitle">按时间查看抽烟和忍住记录随时回看自己的变化轨迹</text>
<view class="hero-stats">
<view class="hero-stat">
<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 class="section">
<text class="section-label">筛选记录</text>
<view class="filters card">
<view class="tabs">
<view
v-for="tab in tabs"
:key="tab.value"
class="tab"
:class="{ 'tab-active': currentTab === tab.value }"
@tap="currentTab = tab.value"
>
{{ tab.label }}
</view>
</view>
</view>
</view>
<!-- 记录列表 -->
<scroll-view
class="scroll-container"
scroll-y
@@ -32,7 +44,8 @@
@refresherrefresh="onRefresh"
@scrolltolower="onLoadMore"
>
<!-- 骨架屏 -->
<text class="section-label">时间记录</text>
<view v-if="logsStore.loading && logsStore.logs.length === 0" class="skeleton">
<view v-for="i in 3" :key="i" class="skeleton-item">
<view class="skeleton-dot"></view>
@@ -44,7 +57,6 @@
</view>
</view>
<!-- 时间轴 -->
<view v-else-if="filteredLogs.length > 0" class="log-list">
<view v-for="(group, date) in groupedLogs" :key="date" class="log-group">
<view class="group-header">
@@ -97,14 +109,12 @@
</view>
</view>
<!-- 空状态 -->
<view v-else class="empty-state">
<text class="empty-icon"></text>
<text class="empty-text">暂无记录</text>
<text class="empty-hint">点击右下角按钮开始记录</text>
</view>
<!-- 加载更多 -->
<view v-if="logsStore.loading && logsStore.logs.length > 0" class="loading-more">
<text class="loading-text">加载中...</text>
</view>
@@ -112,14 +122,14 @@
<view v-if="!logsStore.hasMore && logsStore.logs.length > 0" class="no-more">
<text class="no-more-text">没有更多了</text>
</view>
<view class="bottom-safe"></view>
</scroll-view>
<!-- 浮动按钮 -->
<view class="fab" @tap="addLog">
<text class="fab-icon">+</text>
</view>
<!-- 编辑弹框 -->
<smoke-record-dialog
v-model:show="showEditDialog"
:type="editType"
@@ -159,6 +169,9 @@ const filteredLogs = computed(() => {
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(() => {
return filteredLogs.value.reduce((groups, log) => {
@@ -305,40 +318,15 @@ onShareAppMessage(() => {
<style scoped>
.page {
min-height: 100vh;
position: relative;
background:
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 24%),
linear-gradient(180deg, #edf2f8 0%, #f5f7fb 38%, #fbfdff 100%);
display: flex;
flex-direction: column;
background: linear-gradient(180deg, #E6F7F2 0%, #F0FBF7 40%, #FAFFFE 100%);
padding: 24rpx 28rpx 0;
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: 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,
.hero-card,
.section,
.filters,
.scroll-container,
.fab {
@@ -346,53 +334,85 @@ onShareAppMessage(() => {
z-index: 1;
}
.page-header {
padding: 32rpx 32rpx 8rpx;
.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;
}
.page-eyebrow {
.hero-card {
margin-bottom: 20rpx;
}
.hero-title {
display: block;
font-size: 20rpx;
font-size: 38rpx;
line-height: 1.2;
font-weight: 700;
letter-spacing: 4rpx;
text-transform: uppercase;
color: #98a2b3;
color: #0D3D2E;
}
.page-title {
.hero-subtitle {
display: block;
margin-top: 10rpx;
font-size: 42rpx;
line-height: 1.18;
font-weight: 700;
color: #111827;
font-size: 25rpx;
line-height: 1.5;
color: #52806E;
}
.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;
margin-top: 8rpx;
font-size: 24rpx;
line-height: 1.5;
color: #667085;
font-size: 22rpx;
color: #7aA898;
}
.section {
margin-bottom: 20rpx;
}
.section-label {
display: block;
margin: 0 0 14rpx 6rpx;
font-size: 26rpx;
font-weight: 600;
color: #1a5c45;
}
.filters {
display: flex;
align-items: center;
gap: 16rpx;
padding: 16rpx 32rpx 8rpx;
padding: 24rpx;
}
.tabs {
display: flex;
flex: 1;
background: rgba(255, 255, 255, 0.76);
border-radius: 24rpx;
background: rgba(255, 255, 255, 0.82);
border-radius: 22rpx;
padding: 6rpx;
box-shadow: 0 12rpx 28rpx rgba(15, 23, 42, 0.06);
border: 2rpx solid rgba(255, 255, 255, 0.66);
backdrop-filter: blur(24rpx);
-webkit-backdrop-filter: blur(24rpx);
border: 1.5rpx solid rgba(52, 200, 160, 0.14);
box-shadow: 0 4rpx 16rpx rgba(52, 200, 160, 0.07);
}
.tab {
@@ -400,73 +420,56 @@ onShareAppMessage(() => {
text-align: center;
padding: 14rpx 0;
border-radius: 16rpx;
font-size: 26rpx;
color: #6B7280;
transition: all 0.2s;
font-size: 24rpx;
font-weight: 600;
color: #7aA898;
}
.tab-active {
background: rgba(255, 255, 255, 0.92);
color: #111827;
box-shadow: 0 8rpx 18rpx rgba(15, 23, 42, 0.06);
}
.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;
background: #FFFFFF;
color: #0D3D2E;
box-shadow: 0 4rpx 12rpx rgba(52, 200, 160, 0.12);
}
.scroll-container {
height: calc(100vh - 10rpx);
padding: 0 32rpx 40rpx;
flex: 1;
min-height: 0;
padding-bottom: calc(140rpx + env(safe-area-inset-bottom));
box-sizing: border-box;
}
/* 骨架屏 */
.skeleton {
padding-top: 24rpx;
padding-top: 6rpx;
}
.skeleton-item {
position: relative;
padding-left: 80rpx;
margin-bottom: 32rpx;
display: flex;
gap: 20rpx;
margin-bottom: 20rpx;
}
.skeleton-dot {
position: absolute;
left: 0;
top: 16rpx;
width: 48rpx;
height: 48rpx;
border-radius: 50%;
background: linear-gradient(90deg, #E5E7EB 25%, #F3F4F6 50%, #E5E7EB 75%);
width: 64rpx;
height: 64rpx;
border-radius: 18rpx;
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%;
animation: shimmer 1.5s infinite;
flex-shrink: 0;
}
.skeleton-card {
background: rgba(255, 255, 255, 0.82);
border-radius: 28rpx;
flex: 1;
background: rgba(255, 255, 255, 0.88);
border-radius: 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 {
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%;
animation: shimmer 1.5s infinite;
border-radius: 8rpx;
@@ -491,30 +494,30 @@ onShareAppMessage(() => {
100% { background-position: 200% 0; }
}
/* 列表分组 */
.log-group {
margin-bottom: 32rpx;
margin-bottom: 28rpx;
}
.group-header {
display: flex;
align-items: center;
gap: 12rpx;
margin-bottom: 16rpx;
margin-bottom: 14rpx;
}
.group-title {
font-size: 30rpx;
font-size: 28rpx;
font-weight: 700;
color: #0F172A;
color: #0D3D2E;
}
.group-count {
font-size: 22rpx;
color: #667085;
background-color: rgba(255, 255, 255, 0.76);
color: #7aA898;
background-color: rgba(52, 200, 160, 0.06);
padding: 6rpx 16rpx;
border-radius: 999rpx;
border: 1.5rpx solid rgba(52, 200, 160, 0.14);
}
.group-items {
@@ -525,25 +528,22 @@ onShareAppMessage(() => {
.log-card {
position: relative;
background: rgba(255, 255, 255, 0.82);
border-radius: 28rpx;
background: rgba(255, 255, 255, 0.88);
border-radius: 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;
gap: 20rpx;
overflow: hidden;
backdrop-filter: blur(24rpx);
-webkit-backdrop-filter: blur(24rpx);
border: 1.5rpx solid rgba(52, 200, 160, 0.14);
}
.log-card-resisted {
background: linear-gradient(135deg, rgba(245, 255, 251, 0.95), rgba(255, 255, 255, 0.88));
border: 2rpx solid rgba(255, 255, 255, 0.7);
background: linear-gradient(135deg, rgba(245, 255, 251, 0.96), rgba(255, 255, 255, 0.88));
}
.log-card-smoke {
background: linear-gradient(135deg, rgba(255, 248, 242, 0.95), rgba(255, 255, 255, 0.88));
border: 2rpx solid rgba(255, 255, 255, 0.7);
background: linear-gradient(135deg, rgba(255, 250, 244, 0.96), rgba(255, 255, 255, 0.88));
}
.log-bar {
@@ -552,11 +552,11 @@ onShareAppMessage(() => {
top: 0;
bottom: 0;
width: 8rpx;
background-color: #10B981;
background-color: #34C8A0;
}
.log-card-smoke .log-bar {
background-color: #F97316;
background-color: #B45309;
}
.log-icon {
@@ -572,13 +572,13 @@ onShareAppMessage(() => {
}
.icon-resisted {
background-color: rgba(16, 185, 129, 0.16);
color: #0F766E;
background-color: rgba(52, 200, 160, 0.12);
color: #1a8c62;
}
.icon-smoke {
background-color: rgba(249, 115, 22, 0.15);
color: #C2410C;
background-color: rgba(251, 191, 36, 0.14);
color: #B45309;
}
.log-main {
@@ -603,24 +603,24 @@ onShareAppMessage(() => {
.log-time {
font-size: 30rpx;
font-weight: 700;
color: #0F172A;
color: #0D3D2E;
}
.log-tag {
font-size: 22rpx;
padding: 6rpx 14rpx;
border-radius: 12rpx;
font-weight: 700;
padding: 8rpx 16rpx;
border-radius: 999rpx;
font-weight: 600;
}
.tag-smoke {
background-color: #FEE2E2;
color: #DC2626;
background-color: rgba(251, 191, 36, 0.14);
color: #B45309;
}
.tag-resisted {
background-color: #DCFCE7;
color: #16A34A;
background-color: rgba(52, 200, 160, 0.12);
color: #1a8c62;
}
.log-right {
@@ -632,24 +632,24 @@ onShareAppMessage(() => {
.count-pill {
font-size: 22rpx;
color: #DC2626;
background-color: #FEE2E2;
padding: 6rpx 14rpx;
border-radius: 12rpx;
font-weight: 700;
color: #B45309;
background-color: rgba(251, 191, 36, 0.14);
padding: 8rpx 16rpx;
border-radius: 999rpx;
font-weight: 600;
}
.thumb-pill {
font-size: 24rpx;
background-color: #DCFCE7;
color: #16A34A;
padding: 6rpx 12rpx;
border-radius: 12rpx;
background-color: rgba(52, 200, 160, 0.12);
color: #1a8c62;
padding: 8rpx 14rpx;
border-radius: 999rpx;
}
.log-desc {
font-size: 24rpx;
color: #475467;
font-size: 25rpx;
color: #52806E;
line-height: 1.5;
margin-bottom: 10rpx;
}
@@ -669,10 +669,11 @@ onShareAppMessage(() => {
.log-interval {
font-size: 22rpx;
color: #667085;
background-color: rgba(255, 255, 255, 0.72);
padding: 4rpx 12rpx;
color: #7aA898;
background-color: rgba(52, 200, 160, 0.06);
padding: 6rpx 14rpx;
border-radius: 999rpx;
border: 1.5rpx solid rgba(52, 200, 160, 0.12);
}
.log-actions {
@@ -684,31 +685,31 @@ onShareAppMessage(() => {
.action-btn {
font-size: 22rpx;
padding: 6rpx 14rpx;
padding: 8rpx 16rpx;
border-radius: 999rpx;
background-color: rgba(255, 255, 255, 0.8);
border: 2rpx solid rgba(15, 23, 42, 0.08);
color: #667085;
background-color: rgba(255, 255, 255, 0.9);
border: 1.5rpx solid rgba(52, 200, 160, 0.18);
color: #7aA898;
}
.edit-btn {
color: #2563EB;
border-color: #DBEAFE;
background-color: #EFF6FF;
border-color: rgba(37, 99, 235, 0.18);
background-color: rgba(37, 99, 235, 0.08);
}
.delete-btn {
color: #DC2626;
border-color: #FECACA;
background-color: #FEF2F2;
border-color: rgba(220, 38, 38, 0.16);
background-color: rgba(220, 38, 38, 0.08);
}
.level-unknown {
color: #64748B;
color: #7aA898;
}
.level-1 {
color: #16A34A;
color: #1a8c62;
}
.level-2 {
@@ -727,43 +728,44 @@ onShareAppMessage(() => {
color: #EF4444;
}
/* 空状态 */
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 120rpx 32rpx;
border-radius: 24rpx;
border: 2rpx dashed rgba(52, 200, 160, 0.2);
background: transparent;
}
.empty-icon {
width: 112rpx;
height: 112rpx;
border-radius: 36rpx;
background: rgba(255, 255, 255, 0.82);
border: 2rpx solid rgba(255, 255, 255, 0.68);
background: rgba(52, 200, 160, 0.06);
border: 1.5rpx solid rgba(52, 200, 160, 0.14);
display: flex;
align-items: center;
justify-content: center;
font-size: 40rpx;
font-weight: 700;
color: #98a2b3;
color: #7aA898;
margin-bottom: 24rpx;
}
.empty-text {
font-size: 32rpx;
color: #6B7280;
font-weight: 500;
color: #0D3D2E;
font-weight: 600;
margin-bottom: 12rpx;
}
.empty-hint {
font-size: 26rpx;
color: #9CA3AF;
font-size: 24rpx;
color: #7aA898;
}
/* 加载状态 */
.loading-more, .no-more {
text-align: center;
padding: 32rpx;
@@ -771,22 +773,21 @@ onShareAppMessage(() => {
.loading-text, .no-more-text {
font-size: 24rpx;
color: #9CA3AF;
color: #7aA898;
}
/* 浮动按钮 */
.fab {
position: fixed;
right: 32rpx;
bottom: 140rpx;
width: 96rpx;
height: 96rpx;
background: linear-gradient(180deg, #32c59d 0%, #1aa37a 100%);
background: linear-gradient(180deg, #3DD9AE 0%, #34C8A0 100%);
border-radius: 50%;
display: flex;
align-items: 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;
z-index: 100;
}
@@ -800,4 +801,8 @@ onShareAppMessage(() => {
color: #FFFFFF;
font-weight: 300;
}
.bottom-safe {
height: calc(32rpx + env(safe-area-inset-bottom));
}
</style>
+14
View File
@@ -100,6 +100,20 @@ async function selectMode(mode) {
onMounted(async () => {
setupNavBar()
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>
+97 -76
View File
@@ -17,6 +17,7 @@
:class="{ 'mode-switch-item-active': formData.mode === 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-desc">{{ item.desc }}</text>
</view>
@@ -98,7 +99,7 @@
v-model="priceYuan"
class="inline-field"
placeholder="25"
placeholder-style="color: #9CA3AF"
placeholder-style="color: #9CC5B5"
/>
<text class="inline-unit">/</text>
</view>
@@ -131,8 +132,8 @@ const navBarHeight = ref(0)
const modeSaving = ref(false)
const modeOptions = [
{ value: 'quit', label: '戒烟打卡', desc: '按天记录今天没抽' },
{ value: 'record', label: '记录抽烟', desc: '按支数记录变化' }
{ value: 'quit', label: '戒烟打卡', desc: '按天打卡,坚持戒烟', icon: '🌿' },
{ value: 'record', label: '记录抽烟', desc: '按支数记录变化趋势', icon: '📊' }
]
const formData = ref({
@@ -274,50 +275,56 @@ onShareAppMessage(() => {
</script>
<style scoped>
/* ── 页面基础 ── */
.page {
min-height: 100vh;
background:
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%);
background: linear-gradient(180deg, #E6F7F2 0%, #F0FBF7 40%, #FAFFFE 100%);
display: flex;
flex-direction: column;
}
.nav-area {
padding: 24rpx 32rpx;
padding: 20rpx 32rpx 16rpx;
background: transparent;
}
.nav-title {
display: block;
font-size: 40rpx;
font-size: 38rpx;
font-weight: 700;
color: #111827;
color: #0D3D2E;
}
.nav-subtitle {
display: block;
margin-top: 8rpx;
font-size: 26rpx;
color: #6B7280;
margin-top: 6rpx;
font-size: 24rpx;
color: #52806E;
}
/* ── 滚动区 ── */
.content {
flex: 1;
padding: 0 32rpx;
padding: 0 28rpx;
}
/* ── 卡片式表单区块 ── */
.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 {
display: block;
margin-bottom: 16rpx;
font-size: 28rpx;
margin-bottom: 18rpx;
font-size: 26rpx;
font-weight: 600;
color: #374151;
color: #1a5c45;
letter-spacing: 0.4rpx;
}
.section-row {
@@ -326,7 +333,7 @@ onShareAppMessage(() => {
align-items: center;
}
/* Mode switch */
/* ── 模式选择 ── */
.mode-switch {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
@@ -334,35 +341,50 @@ onShareAppMessage(() => {
}
.mode-switch-item {
padding: 24rpx;
padding: 28rpx 20rpx;
border-radius: 20rpx;
background: rgba(255, 255, 255, 0.8);
border: 2rpx solid rgba(255, 255, 255, 0.66);
box-shadow: 0 8rpx 24rpx rgba(15, 23, 42, 0.05);
background: rgba(255, 255, 255, 0.72);
border: 2rpx solid rgba(52, 200, 160, 0.1);
box-shadow: 0 2rpx 10rpx rgba(52, 200, 160, 0.04);
transition: all 0.2s;
}
.mode-switch-item-active {
background: rgba(255, 255, 255, 0.96);
border-color: rgba(26, 163, 122, 0.3);
box-shadow: 0 8rpx 24rpx rgba(26, 163, 122, 0.1);
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);
}
.mode-switch-icon {
display: block;
font-size: 40rpx;
margin-bottom: 10rpx;
}
.mode-switch-title {
display: block;
font-size: 28rpx;
font-weight: 600;
color: #111827;
font-weight: 700;
color: #0D3D2E;
}
.mode-switch-item-active .mode-switch-title {
color: #1a8c62;
}
.mode-switch-desc {
display: block;
margin-top: 8rpx;
font-size: 22rpx;
line-height: 1.4;
color: #6b7280;
margin-top: 6rpx;
font-size: 21rpx;
line-height: 1.5;
color: #7aA898;
}
/* Inline input */
.mode-switch-item-active .mode-switch-desc {
color: #3a9e78;
}
/* ── 数字步进器 ── */
.inline-input {
display: flex;
align-items: center;
@@ -370,71 +392,70 @@ onShareAppMessage(() => {
}
.inline-btn {
width: 56rpx;
height: 56rpx;
width: 60rpx;
height: 60rpx;
border-radius: 50%;
background: rgba(255, 255, 255, 0.9);
background: rgba(52, 200, 160, 0.1);
display: flex;
align-items: center;
justify-content: center;
font-size: 36rpx;
color: #1aa37a;
border: 2rpx solid rgba(255, 255, 255, 0.72);
box-shadow: 0 4rpx 12rpx rgba(15, 23, 42, 0.06);
font-size: 38rpx;
color: #34C8A0;
border: 1.5rpx solid rgba(52, 200, 160, 0.25);
}
.inline-value {
font-size: 36rpx;
font-size: 38rpx;
font-weight: 700;
color: #111827;
min-width: 48rpx;
color: #0D3D2E;
min-width: 52rpx;
text-align: center;
}
.inline-unit {
font-size: 26rpx;
color: #6B7280;
font-size: 24rpx;
color: #7aA898;
}
.inline-field {
width: 100rpx;
font-size: 32rpx;
font-weight: 600;
color: #111827;
color: #0D3D2E;
text-align: center;
background: rgba(255, 255, 255, 0.9);
padding: 12rpx 16rpx;
background: rgba(52, 200, 160, 0.06);
padding: 10rpx 14rpx;
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 {
display: flex;
flex-wrap: wrap;
gap: 16rpx;
gap: 14rpx;
}
.option-tag {
padding: 16rpx 28rpx;
padding: 14rpx 26rpx;
border-radius: 999rpx;
background: rgba(255, 255, 255, 0.84);
font-size: 26rpx;
color: #374151;
border: 2rpx solid rgba(255, 255, 255, 0.72);
box-shadow: 0 4rpx 12rpx rgba(15, 23, 42, 0.04);
background: rgba(255, 255, 255, 0.9);
font-size: 25rpx;
color: #4a7a66;
border: 1.5rpx solid rgba(52, 200, 160, 0.18);
}
.option-tag-active {
background: rgba(26, 163, 122, 0.12);
border-color: rgba(26, 163, 122, 0.3);
background: rgba(52, 200, 160, 0.12);
border-color: rgba(52, 200, 160, 0.45);
color: #1a7f61;
font-weight: 600;
}
/* Time row */
/* ── 作息时间 ── */
.time-row {
display: flex;
gap: 24rpx;
gap: 20rpx;
}
.time-item {
@@ -442,52 +463,52 @@ onShareAppMessage(() => {
}
.time-label {
font-size: 24rpx;
color: #6B7280;
font-size: 22rpx;
color: #7aA898;
display: block;
margin-bottom: 8rpx;
}
.time-picker {
background: rgba(255, 255, 255, 0.9);
padding: 20rpx 24rpx;
border-radius: 12rpx;
font-size: 32rpx;
background: rgba(52, 200, 160, 0.06);
padding: 18rpx 20rpx;
border-radius: 14rpx;
font-size: 30rpx;
font-weight: 600;
color: #111827;
color: #0D3D2E;
text-align: center;
border: 2rpx solid rgba(255, 255, 255, 0.72);
box-shadow: 0 4rpx 12rpx rgba(15, 23, 42, 0.04);
border: 1.5rpx solid rgba(52, 200, 160, 0.2);
}
/* ── 底部空白 + 按钮 ── */
.bottom-space {
height: 160rpx;
}
/* Footer */
.footer {
position: fixed;
left: 0;
right: 0;
bottom: 0;
padding: 24rpx 32rpx;
padding-bottom: calc(24rpx + env(safe-area-inset-bottom));
background: linear-gradient(180deg, transparent 0%, rgba(248, 250, 252, 0.95) 40%);
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%);
}
.btn-primary {
height: 96rpx;
background: linear-gradient(180deg, #32c59d 0%, #1aa37a 100%);
background: linear-gradient(180deg, #3DD9AE 0%, #34C8A0 100%);
border-radius: 48rpx;
display: flex;
align-items: 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 {
font-size: 32rpx;
font-weight: 600;
color: #FFFFFF;
letter-spacing: 1rpx;
}
</style>
+89 -154
View File
@@ -1,29 +1,25 @@
<template>
<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="page-header">
<text class="header-eyebrow">Account</text>
<text class="header-title">个人中心</text>
<text class="header-subtitle">模式切换分享与基础设置</text>
</view>
<view class="user-section">
<image class="avatar" :src="userAvatar" mode="aspectFill"></image>
<view class="user-copy">
<text class="user-name">{{ userName }}</text>
<text class="user-desc">已连接戒烟记录与统计数据</text>
<view class="user-meta">
<text class="user-pill">{{ modeText }}</text>
<text class="user-pill user-pill-muted">{{ shareToken ? '分享已启用' : '分享未生成' }}</text>
<view class="section">
<text class="section-label">当前账号</text>
<view class="user-section card">
<image class="avatar" :src="userAvatar" mode="aspectFill"></image>
<view class="user-copy">
<text class="user-name">{{ userName }}</text>
<text class="user-desc">已连接戒烟记录与统计数据</text>
<view class="user-meta">
<text class="user-pill">{{ modeText }}</text>
<text class="user-pill user-pill-muted">{{ shareToken ? '分享已启用' : '分享未生成' }}</text>
</view>
</view>
</view>
</view>
<view class="section">
<view class="mode-card">
<text class="section-label">使用模式</text>
<view class="mode-card card">
<view class="mode-card-header">
<view class="menu-icon menu-icon-accent">
<text class="menu-glyph"></text>
@@ -48,7 +44,8 @@
<text class="mode-hint">当前{{ modeText }}</text>
</view>
<view class="menu-list">
<text class="section-label">常用操作</text>
<view class="menu-list card">
<view class="menu-item">
<view class="menu-icon menu-icon-accent">
<text class="menu-glyph"></text>
@@ -83,7 +80,8 @@
</view>
<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-icon menu-icon-muted">
<text class="menu-glyph"></text>
@@ -111,6 +109,7 @@
</view>
<text class="version">版本 1.0.0</text>
<view class="bottom-safe"></view>
</view>
</template>
@@ -286,98 +285,50 @@ onShow(async () => {
.page {
min-height: 100vh;
position: relative;
background:
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%);
padding: 0 24rpx 168rpx;
background: linear-gradient(180deg, #E6F7F2 0%, #F0FBF7 40%, #FAFFFE 100%);
padding: 0 28rpx 0;
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,
.page-header,
.user-section,
.section,
.version {
position: relative;
z-index: 1;
}
.page-header {
padding: 24rpx 6rpx 18rpx;
.section {
margin-bottom: 20rpx;
}
.header-eyebrow {
.section-label {
display: block;
font-size: 20rpx;
font-weight: 700;
letter-spacing: 4rpx;
text-transform: uppercase;
color: #98a2b3;
margin: 0 0 14rpx 6rpx;
font-size: 26rpx;
font-weight: 600;
color: #1a5c45;
}
.header-title {
display: block;
margin-top: 10rpx;
font-size: 42rpx;
line-height: 1.18;
font-weight: 700;
color: #111827;
}
.header-subtitle {
display: block;
margin-top: 8rpx;
font-size: 24rpx;
line-height: 1.5;
color: #667085;
.card {
background: rgba(255, 255, 255, 0.88);
border-radius: 24rpx;
padding: 24rpx;
border: 1.5rpx solid rgba(52, 200, 160, 0.14);
box-shadow: 0 4rpx 18rpx rgba(52, 200, 160, 0.07);
}
.user-section {
display: flex;
align-items: center;
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 {
width: 132rpx;
height: 132rpx;
width: 120rpx;
height: 120rpx;
border-radius: 50%;
border: 4rpx solid rgba(255, 255, 255, 0.82);
background-color: rgba(255, 255, 255, 0.7);
border: 4rpx solid rgba(52, 200, 160, 0.16);
background-color: rgba(52, 200, 160, 0.06);
}
.user-copy {
@@ -388,110 +339,93 @@ onShow(async () => {
}
.user-name {
font-size: 40rpx;
font-size: 38rpx;
font-weight: 700;
color: #111827;
color: #0D3D2E;
}
.user-desc {
display: block;
margin-top: 8rpx;
font-size: 24rpx;
font-size: 25rpx;
line-height: 1.5;
color: #667085;
color: #52806E;
}
.user-meta {
display: flex;
flex-wrap: wrap;
gap: 12rpx;
margin-top: 18rpx;
gap: 14rpx;
margin-top: 16rpx;
}
.user-pill {
padding: 10rpx 20rpx;
padding: 14rpx 26rpx;
border-radius: 999rpx;
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-weight: 600;
color: #17795c;
color: #1a8c62;
}
.user-pill-muted {
background: rgba(255, 255, 255, 0.78);
color: #667085;
}
.section {
margin-bottom: 24rpx;
background: rgba(52, 200, 160, 0.06);
color: #7aA898;
}
.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;
}
.mode-card-header {
display: flex;
align-items: center;
gap: 24rpx;
gap: 20rpx;
margin-bottom: 20rpx;
}
.menu-list {
display: flex;
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;
}
.menu-item {
display: flex;
align-items: center;
gap: 24rpx;
padding: 28rpx 24rpx;
gap: 20rpx;
padding: 6rpx 0;
}
.menu-divider {
margin: 0 24rpx;
margin: 16rpx 0;
height: 2rpx;
background: rgba(15, 23, 42, 0.06);
background: rgba(52, 200, 160, 0.12);
}
.menu-icon {
width: 64rpx;
height: 64rpx;
border-radius: 20rpx;
border-radius: 18rpx;
display: flex;
align-items: 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 {
background: rgba(52, 200, 160, 0.14);
background: rgba(52, 200, 160, 0.12);
}
.menu-icon-muted {
background: rgba(255, 255, 255, 0.82);
background: rgba(52, 200, 160, 0.06);
}
.menu-glyph {
font-size: 24rpx;
font-weight: 700;
color: #111827;
color: #1a8c62;
}
.menu-content {
@@ -502,15 +436,15 @@ onShow(async () => {
}
.menu-label {
font-size: 30rpx;
color: #111827;
font-size: 28rpx;
color: #0D3D2E;
font-weight: 600;
}
.menu-desc {
font-size: 24rpx;
font-size: 25rpx;
line-height: 1.5;
color: #667085;
color: #52806E;
}
.menu-actions {
@@ -519,57 +453,54 @@ onShow(async () => {
align-items: center;
flex-wrap: wrap;
gap: 8rpx;
font-size: 24rpx;
color: #1aa37a;
font-size: 22rpx;
color: #1a8c62;
}
.menu-action {
color: #1aa37a;
color: #1a8c62;
}
.menu-action-sep {
color: #98a2b3;
color: #7aA898;
}
.menu-arrow {
font-size: 36rpx;
color: #98a2b3;
color: #7aA898;
}
.menu-value {
font-size: 24rpx;
font-weight: 600;
color: #1aa37a;
color: #1a8c62;
}
.mode-switch {
display: flex;
gap: 12rpx;
padding: 8rpx;
border-radius: 24rpx;
background: rgba(247, 249, 252, 0.92);
border: 2rpx solid rgba(15, 23, 42, 0.05);
gap: 16rpx;
}
.mode-switch-item {
flex: 1;
padding: 22rpx 18rpx;
padding: 22rpx 20rpx;
border-radius: 20rpx;
background: transparent;
border: 2rpx solid transparent;
background: rgba(255, 255, 255, 0.72);
border: 2rpx solid rgba(52, 200, 160, 0.1);
box-shadow: 0 2rpx 10rpx rgba(52, 200, 160, 0.04);
}
.mode-switch-item-active {
background: rgba(255, 255, 255, 0.94);
border-color: rgba(255, 255, 255, 0.76);
box-shadow: 0 8rpx 18rpx rgba(15, 23, 42, 0.06);
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);
}
.mode-switch-title {
display: block;
font-size: 28rpx;
font-weight: 700;
color: #111827;
color: #0D3D2E;
}
.mode-switch-desc {
@@ -577,30 +508,30 @@ onShow(async () => {
margin-top: 8rpx;
font-size: 22rpx;
line-height: 1.5;
color: #667085;
color: #7aA898;
}
.mode-hint {
display: block;
margin-top: 16rpx;
font-size: 22rpx;
color: #1aa37a;
color: #1a8c62;
}
.share-btn {
margin: 0;
padding: 12rpx 22rpx;
padding: 16rpx 28rpx;
line-height: 1.4;
font-size: 24rpx;
border: none;
border-radius: 999rpx;
color: #FFFFFF;
background: linear-gradient(180deg, #32c59d 0%, #1aa37a 100%);
box-shadow: 0 12rpx 28rpx rgba(26, 163, 122, 0.2);
background: linear-gradient(180deg, #3DD9AE 0%, #34C8A0 100%);
box-shadow: 0 12rpx 28rpx rgba(52, 200, 160, 0.28);
}
.share-btn[disabled] {
background: #98a2b3;
background: #9CC5B5;
color: #FFFFFF;
}
@@ -612,7 +543,11 @@ onShow(async () => {
display: block;
text-align: center;
font-size: 22rpx;
color: #98a2b3;
margin-top: 32rpx;
color: #7aA898;
margin-top: 28rpx;
}
.bottom-safe {
height: calc(32rpx + env(safe-area-inset-bottom));
}
</style>
+502 -905
View File
File diff suppressed because it is too large Load Diff