前端(uni-app · Vue3)
- 设计系统:uni.scss 品牌令牌(花红 #E8604C / 蜜橙 #F5A65B / 暖米白 #FFF9F5),
App.vue 全局原子类(卡片/按钮/胶囊/单元格/空态/进度)
- 页面:登录、首页(聚合)、周期(花瓣日历+当日记录+预测+概览)、情绪(记录+趋势+日记+疗愈)、
我的(资料/会员/隐私/提醒)、健康报告、会员套餐、内容详情
- 组件:hq-tabbar(自定义底栏)、bloom-calendar(阶段日历)
- 基础层:utils/{config,request,store,api,date}.js(统一 token、401 处理、接口集中定义)
后端(FastAdmin / ThinkPHP 5.0)
- 新增 api 控制器:Home / Cycle / Mood / Content / Member / Setting,User 增补 detail、updateprofile
- 新增服务层:CycleService(四阶段计算、预测、月历、汇总)、MemberService(权益判定)
- 新增表:fa_cycle / fa_cycle_log / fa_symptom_tag / fa_mood_log / fa_content /
fa_content_category / fa_member_plan / fa_member_order / fa_user_setting
- 初始化数据:20 个症状标签、28 条内容(心语/科普/知识/食谱/运动/睡眠/痛经/冥想)、3 档会员
验证(全部通过)
- 接口全链路 48 项断言(登录→周期→首页→情绪→内容→会员→设置→资料)
- 前后端契约静态校验 24 个接口 0 偏差
- Vue SFC 编译 11/11、SCSS 编译 10/10
- 验证脚本见 scripts/verify/,报告见 docs/04-前端设计系统与联调验证.md
229 行
4.2 KiB
Vue
229 行
4.2 KiB
Vue
<script>
|
|
import store from '@/utils/store.js'
|
|
|
|
export default {
|
|
onLaunch: function() {
|
|
store.restore()
|
|
},
|
|
onShow: function() {
|
|
// 启动时校验登录态:无 token 直接进入登录页(首页除外,首页会自行引导)
|
|
if (!store.token) {
|
|
const pages = getCurrentPages()
|
|
const route = pages.length ? pages[pages.length - 1].route : ''
|
|
if (route && route.indexOf('pages/login') === -1) {
|
|
uni.reLaunch({ url: '/pages/login/index' })
|
|
}
|
|
}
|
|
},
|
|
onHide: function() {}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
/* ============================================================
|
|
全局样式 · 花期(暖色调 / 简洁大气)
|
|
============================================================ */
|
|
page {
|
|
background-color: #FFF9F5;
|
|
color: #3E2C27;
|
|
font-size: 28rpx;
|
|
line-height: 1.6;
|
|
font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
}
|
|
|
|
/* 页面容器 */
|
|
.hq-page {
|
|
min-height: 100vh;
|
|
padding: 0 32rpx calc(180rpx + env(safe-area-inset-bottom));
|
|
box-sizing: border-box;
|
|
background: linear-gradient(180deg, #FFF3EC 0%, #FFF9F5 34%, #FFFDFB 100%);
|
|
}
|
|
|
|
/* 卡片 */
|
|
.hq-card {
|
|
background-color: #FFFFFF;
|
|
border-radius: 32rpx;
|
|
padding: 32rpx;
|
|
margin-bottom: 24rpx;
|
|
box-shadow: 0 12rpx 36rpx rgba(232, 96, 76, 0.08);
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.hq-card-hover {
|
|
transform: scale(0.995);
|
|
transition: transform 0.15s ease;
|
|
}
|
|
|
|
/* 标题层级 */
|
|
.hq-section-head {
|
|
display: flex;
|
|
align-items: baseline;
|
|
justify-content: space-between;
|
|
margin: 8rpx 0 20rpx;
|
|
}
|
|
|
|
.hq-section-title {
|
|
font-size: 32rpx;
|
|
font-weight: 600;
|
|
color: #3E2C27;
|
|
letter-spacing: 1rpx;
|
|
}
|
|
|
|
.hq-section-more {
|
|
font-size: 24rpx;
|
|
color: #B9A79E;
|
|
}
|
|
|
|
.hq-sub {
|
|
font-size: 24rpx;
|
|
color: #8C7367;
|
|
line-height: 1.7;
|
|
}
|
|
|
|
.hq-muted {
|
|
font-size: 22rpx;
|
|
color: #B9A79E;
|
|
}
|
|
|
|
/* 按钮 */
|
|
.hq-btn {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
height: 88rpx;
|
|
border-radius: 44rpx;
|
|
font-size: 30rpx;
|
|
font-weight: 500;
|
|
letter-spacing: 2rpx;
|
|
background: linear-gradient(135deg, #F58C7C 0%, #E8604C 100%);
|
|
color: #FFFFFF;
|
|
box-shadow: 0 16rpx 32rpx rgba(232, 96, 76, 0.24);
|
|
}
|
|
|
|
.hq-btn-ghost {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
height: 88rpx;
|
|
border-radius: 44rpx;
|
|
font-size: 30rpx;
|
|
color: #E8604C;
|
|
background-color: #FFF1E9;
|
|
}
|
|
|
|
.hq-btn-plain {
|
|
color: #8C7367;
|
|
background-color: #FFFFFF;
|
|
box-shadow: none;
|
|
border: 2rpx solid #F5E7DF;
|
|
}
|
|
|
|
/* 标签 / 胶囊 */
|
|
.hq-chip {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
padding: 10rpx 24rpx;
|
|
border-radius: 999rpx;
|
|
font-size: 24rpx;
|
|
color: #8C7367;
|
|
background-color: #FFF4EE;
|
|
margin: 0 16rpx 16rpx 0;
|
|
}
|
|
|
|
.hq-chip-active {
|
|
color: #FFFFFF;
|
|
background: linear-gradient(135deg, #F58C7C 0%, #E8604C 100%);
|
|
box-shadow: 0 8rpx 20rpx rgba(232, 96, 76, 0.2);
|
|
}
|
|
|
|
/* 分割线 */
|
|
.hq-divider {
|
|
height: 2rpx;
|
|
background-color: #F5E7DF;
|
|
margin: 24rpx 0;
|
|
}
|
|
|
|
/* 空状态 */
|
|
.hq-empty {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
padding: 60rpx 0;
|
|
}
|
|
|
|
.hq-empty-emoji {
|
|
font-size: 72rpx;
|
|
margin-bottom: 16rpx;
|
|
}
|
|
|
|
.hq-empty-text {
|
|
font-size: 26rpx;
|
|
color: #B9A79E;
|
|
text-align: center;
|
|
}
|
|
|
|
/* 行布局 */
|
|
.hq-row {
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.hq-between {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
}
|
|
|
|
/* 通用列表行 */
|
|
.hq-cell {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 28rpx 0;
|
|
}
|
|
|
|
.hq-cell + .hq-cell {
|
|
border-top: 2rpx solid #F5E7DF;
|
|
}
|
|
|
|
.hq-cell-label {
|
|
font-size: 28rpx;
|
|
color: #3E2C27;
|
|
}
|
|
|
|
.hq-cell-value {
|
|
font-size: 26rpx;
|
|
color: #8C7367;
|
|
}
|
|
|
|
.hq-arrow {
|
|
font-size: 26rpx;
|
|
color: #D8C6BD;
|
|
margin-left: 8rpx;
|
|
}
|
|
|
|
/* 滑动条(自定义进度) */
|
|
.hq-progress {
|
|
height: 12rpx;
|
|
border-radius: 999rpx;
|
|
background-color: #FFF1E9;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.hq-progress-inner {
|
|
height: 100%;
|
|
border-radius: 999rpx;
|
|
background: linear-gradient(90deg, #F5A65B 0%, #E8604C 100%);
|
|
}
|
|
|
|
/* 动画 */
|
|
@keyframes hqFadeUp {
|
|
from { opacity: 0; transform: translateY(16rpx); }
|
|
to { opacity: 1; transform: translateY(0); }
|
|
}
|
|
|
|
.hq-fade-up {
|
|
animation: hqFadeUp 0.36s ease both;
|
|
}
|
|
</style>
|