文件
huaqiapp/pages/cycle/report.vue
linda ea2be7af8c style(ui): 图标整体放大并与页面比例协调
按 6 级尺寸阶梯统一放大图标,避免小而散、提升大气感:
- 底部导航 40 -> 48,容器 104 -> 116,标签 22 -> 23
- 首页快捷入口 40 -> 52,容器 96 -> 112、圆角 32 -> 36,标签 22 -> 24
- 首页品牌花标 40 -> 46,牌标容器 72 -> 84
- 今日心语 52 -> 62,提醒 38 -> 46
- 情绪选择 40 -> 50(容器 76),记录 30 -> 36,疗愈内容 34 -> 42
- 健康 Tab 26 -> 32(Tab 76 -> 84),建议项 34 -> 42(容器 84)
- 我的设置项 32 -> 40,头像 108 -> 116
- 备孕/关系/亲子勾选 20 -> 24(容器 40 -> 46),会员勾选 18 -> 22
- 咨询师头像 40 -> 50(容器 100),热线 34/36 -> 42,急救工具 44 -> 54
- 空状态与会员锁 72 -> 96,内容详情头图 64 -> 78,登录花瓣与输入框图标同步放大
- 大尺寸图标描边降至 1.6-1.8,小尺寸保持 1.8-2.4,线宽视觉统一
- 文档补充「图标尺寸阶梯」规范

验证:no_emoji 0 问题 / 契约 84 接口 0 偏差 / Vue 20-20 / SCSS 19-19
2026-11-06 10:25:41 +08:00

363 行
7.5 KiB
Vue

此文件含有模棱两可的 Unicode 字符

此文件含有可能会与其他字符混淆的 Unicode 字符。 如果您是想特意这样的,可以安全地忽略该警告。 使用 Escape 按钮显示他们。

<template>
<view class="hq-page">
<view class="report-head">
<view class="report-month">
<text class="report-month-text">{{ monthText }}</text>
<text class="report-month-sub">{{ range[0] }} 至 {{ range[1] }}</text>
</view>
<view class="report-score">
<text class="report-score-value">{{ summary.regularity || 0 }}</text>
<text class="report-score-label">规律性</text>
</view>
</view>
<view class="score-bar">
<view class="score-bar-inner" :style="{ width: (summary.regularity || 0) + '%' }"></view>
</view>
<text class="score-text">{{ summary.regularity_text || '继续记录,数据会更准确' }}</text>
<!-- 关键指标 -->
<view class="hq-section-head">
<text class="hq-section-title">本期数据</text>
</view>
<view class="metrics">
<view class="metric">
<text class="metric-value">{{ stats.log_days || 0 }}</text>
<text class="metric-label">记录天数</text>
</view>
<view class="metric">
<text class="metric-value">{{ stats.avg_pain || 0 }}</text>
<text class="metric-label">平均痛经</text>
</view>
<view class="metric">
<text class="metric-value">{{ stats.avg_sleep || 0 }}</text>
<text class="metric-label">平均睡眠(h)</text>
</view>
<view class="metric">
<text class="metric-value">{{ stats.mood_days || 0 }}</text>
<text class="metric-label">情绪记录</text>
</view>
</view>
<!-- 常见症状 -->
<view class="hq-card" v-if="stats.top_symptoms && stats.top_symptoms.length">
<view class="hq-section-head">
<text class="hq-section-title">常见症状</text>
<text class="hq-muted">按出现次数</text>
</view>
<view class="symptom-row" v-for="item in stats.top_symptoms" :key="item.name">
<text class="symptom-name">{{ item.name }}</text>
<view class="symptom-bar-wrap">
<view class="symptom-bar" :style="{ width: Math.min(100, item.count * 20) + '%' }"></view>
</view>
<text class="symptom-count">{{ item.count }} 次</text>
</view>
</view>
<view class="hq-card" v-else>
<view class="hq-empty">
<hq-icon name="sprout" :size="96" :stroke="1.6" color="#E6D3C9" />
<text class="hq-empty-text">本期还没有症状记录</text>
</view>
</view>
<!-- 建议 -->
<view class="hq-card">
<view class="hq-section-head">
<text class="hq-section-title">给你的建议</text>
</view>
<view class="advice-item" v-for="(item, index) in advice" :key="index">
<view class="advice-dot"></view>
<text class="advice-text">{{ item }}</text>
</view>
</view>
<!-- 深度报告(会员权益) -->
<view class="deep-card">
<view class="deep-head">
<text class="deep-title">深度分析报告</text>
<text class="deep-tag" v-if="!access.deep">会员专享</text>
</view>
<text class="deep-desc" v-if="!access.deep">{{ access.tip }}</text>
<text class="deep-desc" v-else>已解锁:包含趋势对比、症状归因与周期优化建议</text>
<view class="deep-btn" v-if="!access.deep" @tap="goMember">
<text class="deep-btn-text">开通会员解锁</text>
</view>
</view>
<view class="footer">
<text class="footer-text">以上内容仅供参考,不能替代医疗诊断</text>
</view>
</view>
</template>
<script>
import api from '@/utils/api.js'
import store from '@/utils/store.js'
import { monthOf, monthText } from '@/utils/date.js'
import hqIcon from '@/components/hq-icon/hq-icon.vue'
export default {
components: { hqIcon },
data() {
return {
month: monthOf(new Date()),
range: ['', ''],
summary: {},
stats: {},
advice: [],
access: { deep: false, tip: '' }
}
},
computed: {
monthText() {
return monthText(this.month)
}
},
onLoad(options) {
if (!store.token) {
uni.reLaunch({ url: '/pages/login/index' })
return
}
if (options && options.month) {
this.month = options.month
}
this.load()
},
methods: {
async load() {
try {
const data = await api.cycleReport('month', this.month)
this.range = (data && data.range) || ['', '']
this.summary = (data && data.summary) || {}
this.stats = (data && data.stats) || {}
this.advice = (data && data.advice) || []
this.access = (data && data.access) || { deep: false, tip: '' }
} catch (e) {}
},
goMember() {
uni.navigateTo({ url: '/pages/member/index' })
}
}
}
</script>
<style lang="scss" scoped>
.report-head {
display: flex;
align-items: center;
justify-content: space-between;
padding: 32rpx 0 20rpx;
}
.report-month {
display: flex;
flex-direction: column;
}
.report-month-text {
font-size: 40rpx;
font-weight: 600;
color: #3E2C27;
letter-spacing: 2rpx;
}
.report-month-sub {
margin-top: 6rpx;
font-size: 22rpx;
color: #B9A79E;
}
.report-score {
display: flex;
flex-direction: column;
align-items: flex-end;
}
.report-score-value {
font-size: 56rpx;
font-weight: 600;
color: #E8604C;
line-height: 1;
}
.report-score-label {
margin-top: 4rpx;
font-size: 20rpx;
color: #B9A79E;
}
.score-bar {
height: 12rpx;
border-radius: 999rpx;
background-color: #FFF1E9;
overflow: hidden;
}
.score-bar-inner {
height: 100%;
border-radius: 999rpx;
background: linear-gradient(90deg, #F5A65B 0%, #E8604C 100%);
}
.score-text {
display: block;
margin-top: 12rpx;
font-size: 22rpx;
color: #8C7367;
}
.metrics {
display: flex;
flex-wrap: wrap;
margin-bottom: 12rpx;
}
.metric {
width: 50%;
box-sizing: border-box;
background-color: #FFFFFF;
border-radius: 28rpx;
padding: 28rpx;
margin-bottom: 16rpx;
display: flex;
flex-direction: column;
align-items: center;
box-shadow: 0 10rpx 28rpx rgba(232, 96, 76, 0.06);
}
.metric:nth-child(odd) {
width: calc(50% - 8rpx);
margin-right: 16rpx;
}
.metric:nth-child(even) {
width: calc(50% - 8rpx);
}
.metric-value {
font-size: 44rpx;
font-weight: 600;
color: #3E2C27;
}
.metric-label {
margin-top: 6rpx;
font-size: 22rpx;
color: #8C7367;
}
.symptom-row {
display: flex;
align-items: center;
padding: 14rpx 0;
}
.symptom-name {
width: 140rpx;
font-size: 26rpx;
color: #3E2C27;
}
.symptom-bar-wrap {
flex: 1;
height: 12rpx;
border-radius: 999rpx;
background-color: #FFF1E9;
overflow: hidden;
margin: 0 16rpx;
}
.symptom-bar {
height: 100%;
border-radius: 999rpx;
background: linear-gradient(90deg, #F5A65B 0%, #E8604C 100%);
}
.symptom-count {
font-size: 22rpx;
color: #B9A79E;
}
.advice-item {
display: flex;
align-items: flex-start;
padding: 12rpx 0;
}
.advice-dot {
width: 12rpx;
height: 12rpx;
border-radius: 50%;
background-color: #F5A65B;
margin-top: 14rpx;
margin-right: 14rpx;
}
.advice-text {
flex: 1;
font-size: 26rpx;
color: #5C4A43;
line-height: 1.8;
}
.deep-card {
border-radius: 32rpx;
padding: 32rpx;
background: linear-gradient(135deg, #FFF1E0 0%, #FFE0CE 100%);
border: 2rpx solid #F7DCC8;
}
.deep-head {
display: flex;
align-items: center;
justify-content: space-between;
}
.deep-title {
font-size: 30rpx;
font-weight: 600;
color: #A8452F;
}
.deep-tag {
font-size: 20rpx;
color: #FFFFFF;
background: linear-gradient(135deg, #F5A65B 0%, #E8604C 100%);
padding: 6rpx 16rpx;
border-radius: 999rpx;
}
.deep-desc {
display: block;
margin-top: 12rpx;
font-size: 22rpx;
color: #B5715B;
line-height: 1.7;
}
.deep-btn {
margin-top: 24rpx;
height: 80rpx;
border-radius: 40rpx;
background-color: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
}
.deep-btn-text {
font-size: 26rpx;
color: #C9482F;
}
.footer {
padding: 24rpx 0;
text-align: center;
}
.footer-text {
font-size: 20rpx;
color: #C9B4AA;
}
</style>