feat: 花期 V1.0 纵向切片(暖色调设计系统 + 周期/情绪/会员全链路)
前端(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
这个提交包含在:
@@ -0,0 +1,201 @@
|
||||
<template>
|
||||
<view class="cal">
|
||||
<view class="cal-week">
|
||||
<text v-for="w in weeks" :key="w" class="cal-week-item">{{ w }}</text>
|
||||
</view>
|
||||
|
||||
<view class="cal-grid">
|
||||
<view v-for="n in blanks" :key="'b' + n" class="cal-cell cal-cell-empty"></view>
|
||||
|
||||
<view
|
||||
v-for="day in days"
|
||||
:key="day.date"
|
||||
class="cal-cell"
|
||||
:class="{
|
||||
'cal-cell-selected': selected === day.date,
|
||||
'cal-cell-today': day.is_today
|
||||
}"
|
||||
@tap="$emit('select', day)"
|
||||
>
|
||||
<text
|
||||
class="cal-num"
|
||||
:class="{
|
||||
'cal-num-strong': day.in_period,
|
||||
'cal-num-selected': selected === day.date
|
||||
}"
|
||||
>{{ day.day }}</text>
|
||||
|
||||
<view class="cal-dot-wrap">
|
||||
<view
|
||||
v-if="day.phase !== 'unknown'"
|
||||
class="cal-dot"
|
||||
:class="{ 'cal-dot-hollow': day.is_predicted }"
|
||||
:style="{ backgroundColor: day.is_predicted ? 'transparent' : day.color, borderColor: day.color }"
|
||||
></view>
|
||||
<view v-if="day.has_log" class="cal-log-dot"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="cal-legend">
|
||||
<view class="cal-legend-item">
|
||||
<view class="cal-dot" style="background-color: #E8604C"></view>
|
||||
<text class="cal-legend-text">经期</text>
|
||||
</view>
|
||||
<view class="cal-legend-item">
|
||||
<view class="cal-dot" style="background-color: #F5A65B"></view>
|
||||
<text class="cal-legend-text">卵泡期</text>
|
||||
</view>
|
||||
<view class="cal-legend-item">
|
||||
<view class="cal-dot" style="background-color: #F0796A"></view>
|
||||
<text class="cal-legend-text">排卵期</text>
|
||||
</view>
|
||||
<view class="cal-legend-item">
|
||||
<view class="cal-dot" style="background-color: #C79A7B"></view>
|
||||
<text class="cal-legend-text">黄体期</text>
|
||||
</view>
|
||||
<view class="cal-legend-item">
|
||||
<view class="cal-dot cal-dot-hollow" style="border-color: #E8604C"></view>
|
||||
<text class="cal-legend-text">预测</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'bloom-calendar',
|
||||
props: {
|
||||
days: { type: Array, default: () => [] },
|
||||
month: { type: String, default: '' },
|
||||
selected: { type: String, default: '' }
|
||||
},
|
||||
computed: {
|
||||
weeks() {
|
||||
return ['日', '一', '二', '三', '四', '五', '六']
|
||||
},
|
||||
blanks() {
|
||||
if (!this.days.length) return 0
|
||||
const first = new Date(this.days[0].date.replace(/-/g, '/'))
|
||||
return first.getDay()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.cal {
|
||||
background-color: #FFFFFF;
|
||||
border-radius: 32rpx;
|
||||
padding: 24rpx 16rpx 20rpx;
|
||||
box-shadow: 0 12rpx 36rpx rgba(232, 96, 76, 0.08);
|
||||
}
|
||||
|
||||
.cal-week {
|
||||
display: flex;
|
||||
padding-bottom: 12rpx;
|
||||
}
|
||||
|
||||
.cal-week-item {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-size: 22rpx;
|
||||
color: #B9A79E;
|
||||
}
|
||||
|
||||
.cal-grid {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.cal-cell {
|
||||
width: 14.285%;
|
||||
height: 92rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.cal-cell-empty {
|
||||
height: 92rpx;
|
||||
}
|
||||
|
||||
.cal-cell-today {
|
||||
background-color: #FFF6F1;
|
||||
}
|
||||
|
||||
.cal-cell-selected {
|
||||
background: linear-gradient(135deg, #F58C7C 0%, #E8604C 100%);
|
||||
box-shadow: 0 10rpx 24rpx rgba(232, 96, 76, 0.24);
|
||||
}
|
||||
|
||||
.cal-num {
|
||||
font-size: 28rpx;
|
||||
color: #5C4A43;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.cal-num-strong {
|
||||
font-weight: 600;
|
||||
color: #E8604C;
|
||||
}
|
||||
|
||||
.cal-num-selected,
|
||||
.cal-num-strong.cal-num-selected {
|
||||
color: #FFFFFF;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.cal-dot-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 16rpx;
|
||||
margin-top: 6rpx;
|
||||
}
|
||||
|
||||
.cal-dot {
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
border-radius: 50%;
|
||||
border: 2rpx solid transparent;
|
||||
background-color: #E8604C;
|
||||
}
|
||||
|
||||
.cal-dot-hollow {
|
||||
background-color: transparent !important;
|
||||
border-width: 2rpx;
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
.cal-log-dot {
|
||||
width: 8rpx;
|
||||
height: 8rpx;
|
||||
border-radius: 50%;
|
||||
background-color: #C79A7B;
|
||||
margin-left: 6rpx;
|
||||
}
|
||||
|
||||
.cal-legend {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
padding: 16rpx 8rpx 0;
|
||||
border-top: 2rpx solid #F5E7DF;
|
||||
margin-top: 12rpx;
|
||||
}
|
||||
|
||||
.cal-legend-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
|
||||
.cal-legend-text {
|
||||
font-size: 20rpx;
|
||||
color: #B9A79E;
|
||||
margin-left: 8rpx;
|
||||
}
|
||||
</style>
|
||||
101
components/hq-tabbar/hq-tabbar.vue
普通文件
101
components/hq-tabbar/hq-tabbar.vue
普通文件
@@ -0,0 +1,101 @@
|
||||
<template>
|
||||
<view class="hq-tabbar">
|
||||
<view class="hq-tabbar-inner">
|
||||
<view
|
||||
v-for="item in tabs"
|
||||
:key="item.key"
|
||||
class="hq-tab"
|
||||
:class="{ 'hq-tab-active': current === item.key }"
|
||||
@tap="go(item)"
|
||||
>
|
||||
<text class="hq-tab-icon">{{ item.icon }}</text>
|
||||
<text class="hq-tab-label" :class="{ 'hq-tab-label-active': current === item.key }">{{ item.label }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'hq-tabbar',
|
||||
props: {
|
||||
current: {
|
||||
type: String,
|
||||
default: 'home'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tabs: [
|
||||
{ key: 'home', label: '首页', icon: '✿', path: '/pages/index/index' },
|
||||
{ key: 'cycle', label: '周期', icon: '❀', path: '/pages/cycle/index' },
|
||||
{ key: 'mood', label: '情绪', icon: '☾', path: '/pages/mood/index' },
|
||||
{ key: 'mine', label: '我的', icon: '✦', path: '/pages/mine/index' }
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
go(item) {
|
||||
if (item.key === this.current) return
|
||||
uni.reLaunch({ url: item.path })
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.hq-tabbar {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 99;
|
||||
padding: 12rpx 32rpx calc(12rpx + env(safe-area-inset-bottom));
|
||||
background-color: rgba(255, 251, 248, 0.96);
|
||||
box-shadow: 0 -8rpx 32rpx rgba(232, 96, 76, 0.08);
|
||||
}
|
||||
|
||||
.hq-tabbar-inner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 104rpx;
|
||||
}
|
||||
|
||||
.hq-tab {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 8rpx 0;
|
||||
border-radius: 24rpx;
|
||||
transition: background-color 0.2s ease;
|
||||
}
|
||||
|
||||
.hq-tab-icon {
|
||||
font-size: 34rpx;
|
||||
color: #C9B4AA;
|
||||
line-height: 1.1;
|
||||
}
|
||||
|
||||
.hq-tab-label {
|
||||
margin-top: 6rpx;
|
||||
font-size: 22rpx;
|
||||
color: #B9A79E;
|
||||
letter-spacing: 1rpx;
|
||||
}
|
||||
|
||||
.hq-tab-active {
|
||||
background-color: #FFF1E9;
|
||||
}
|
||||
|
||||
.hq-tab-active .hq-tab-icon {
|
||||
color: #E8604C;
|
||||
}
|
||||
|
||||
.hq-tab-label-active {
|
||||
color: #E8604C;
|
||||
font-weight: 600;
|
||||
}
|
||||
</style>
|
||||
在新工单中引用
屏蔽一个用户