按 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
187 行
3.8 KiB
Vue
187 行
3.8 KiB
Vue
<template>
|
||
<view class="hq-page">
|
||
<view class="head">
|
||
<text class="head-title">情绪急救包</text>
|
||
<text class="head-sub">情绪上头时,先照顾身体,再处理问题</text>
|
||
</view>
|
||
|
||
<view class="hotline" @tap="callHotline">
|
||
<hq-icon name="phone" :size="42" :stroke="1.7" color="#C9482F" style="margin-right: 20rpx" />
|
||
<view class="hotline-body">
|
||
<text class="hotline-title">如果可以,先告诉一个人「我现在不太好」</text>
|
||
<text class="hotline-sub">需要专业支持:{{ data.hotline && data.hotline.phone ? data.hotline.phone : '12356' }}</text>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="hq-card tool" v-for="item in data.list || []" :key="item.id" @tap="open(item)">
|
||
<view class="tool-head">
|
||
<hq-icon :name="toolIcon(item)" :size="54" :stroke="1.7" color="#E8604C" style="margin-right: 24rpx" />
|
||
<view class="tool-title-wrap">
|
||
<text class="tool-title">{{ item.title }}</text>
|
||
<text class="tool-summary">{{ item.summary }}</text>
|
||
</view>
|
||
</view>
|
||
<view class="tool-foot">
|
||
<text class="tool-action">立即开始 ›</text>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="hq-card" v-if="!(data.list || []).length">
|
||
<view class="hq-empty">
|
||
<hq-icon name="droplets" :size="96" :stroke="1.6" color="#E6D3C9" />
|
||
<text class="hq-empty-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 { resolveIcon, iconForContentType } from '@/utils/icons.js'
|
||
import hqIcon from '@/components/hq-icon/hq-icon.vue'
|
||
|
||
export default {
|
||
components: { hqIcon },
|
||
data() {
|
||
return {
|
||
data: { list: [] }
|
||
}
|
||
},
|
||
onLoad() {
|
||
if (!store.token) {
|
||
uni.reLaunch({ url: '/pages/login/index' })
|
||
return
|
||
}
|
||
this.load()
|
||
},
|
||
methods: {
|
||
async load() {
|
||
try {
|
||
this.data = await api.moodFirstaid()
|
||
} catch (e) {}
|
||
},
|
||
toolIcon(item) {
|
||
if (item && (item.icon || item.emoji)) {
|
||
return resolveIcon(item.icon || item.emoji)
|
||
}
|
||
return iconForContentType((item && item.type) || 'firstaid')
|
||
},
|
||
open(item) {
|
||
uni.navigateTo({ url: '/pages/content/detail?id=' + item.id })
|
||
},
|
||
callHotline() {
|
||
const phone = (this.data.hotline && this.data.hotline.phone) || '12356'
|
||
uni.makePhoneCall({ phoneNumber: phone, fail: () => {
|
||
uni.showToast({ title: '拨打 ' + phone, icon: 'none' })
|
||
} })
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style lang="scss" scoped>
|
||
.head {
|
||
padding: 28rpx 0 20rpx;
|
||
}
|
||
|
||
.head-title {
|
||
font-size: 44rpx;
|
||
font-weight: 600;
|
||
color: #3E2C27;
|
||
}
|
||
|
||
.head-sub {
|
||
display: block;
|
||
margin-top: 8rpx;
|
||
font-size: 24rpx;
|
||
color: #8C7367;
|
||
}
|
||
|
||
.hotline {
|
||
display: flex;
|
||
align-items: center;
|
||
padding: 28rpx 30rpx;
|
||
border-radius: 28rpx;
|
||
background: linear-gradient(135deg, #FFF1E0 0%, #FFE3D3 100%);
|
||
border: 2rpx solid #F7DCC8;
|
||
margin-bottom: 20rpx;
|
||
}
|
||
|
||
.hotline-icon {
|
||
margin-right: 16rpx;
|
||
}
|
||
|
||
.hotline-body {
|
||
flex: 1;
|
||
display: flex;
|
||
flex-direction: column;
|
||
}
|
||
|
||
.hotline-title {
|
||
font-size: 26rpx;
|
||
color: #A8452F;
|
||
font-weight: 500;
|
||
}
|
||
|
||
.hotline-sub {
|
||
margin-top: 4rpx;
|
||
font-size: 22rpx;
|
||
color: #B5715B;
|
||
}
|
||
|
||
.tool {
|
||
padding: 28rpx 32rpx;
|
||
}
|
||
|
||
.tool-head {
|
||
display: flex;
|
||
align-items: flex-start;
|
||
}
|
||
|
||
.tool-title-wrap {
|
||
flex: 1;
|
||
display: flex;
|
||
flex-direction: column;
|
||
}
|
||
|
||
.tool-title {
|
||
font-size: 30rpx;
|
||
font-weight: 600;
|
||
color: #3E2C27;
|
||
}
|
||
|
||
.tool-summary {
|
||
margin-top: 6rpx;
|
||
font-size: 24rpx;
|
||
color: #8C7367;
|
||
line-height: 1.7;
|
||
}
|
||
|
||
.tool-foot {
|
||
margin-top: 16rpx;
|
||
padding-top: 16rpx;
|
||
border-top: 2rpx solid #F5E7DF;
|
||
text-align: right;
|
||
}
|
||
|
||
.tool-action {
|
||
font-size: 24rpx;
|
||
color: #E8604C;
|
||
}
|
||
|
||
.footer {
|
||
padding: 24rpx 0;
|
||
text-align: center;
|
||
}
|
||
|
||
.footer-text {
|
||
font-size: 20rpx;
|
||
color: #C9B4AA;
|
||
}
|
||
</style>
|