feat(auth): access token 缩到 2 小时 + refresh token 机制 #3
@@ -428,6 +428,38 @@ page{scrollbar-width:none;-ms-overflow-style:none}
|
||||
}
|
||||
.follow-btn.on{color:var(--muted);background:#F4F1EC;border-color:var(--line)}
|
||||
|
||||
/* ===== 关注按钮 =====
|
||||
社区列表和关注/粉丝列表都在用。同上:两页共用的就不能留在任一页的 wxss 里 */
|
||||
.follow-btn{
|
||||
flex:none;font-size:var(--fs-cap);font-weight:var(--fw-b);padding:6rpx var(--sp-3);border-radius:var(--r-full);
|
||||
color:var(--primary-dark);background:var(--primary-soft);border:1rpx solid var(--primary-line);
|
||||
}
|
||||
.follow-btn.on{color:var(--muted);background:#F4F1EC;border-color:var(--line)}
|
||||
|
||||
/* ===== 记录类型分组宫格 =====
|
||||
记录页和历史页都在用。页面级 wxss 跨不了页,所以放全局。
|
||||
组的着色走 g-1..g-4,不要复用 tone-N —— tone-N 自带背景色,
|
||||
套在分组外层会把整块涂成色块。 */
|
||||
.tg{margin-bottom:var(--sp-5)}
|
||||
.tg:last-of-type{margin-bottom:0}
|
||||
.tg-head{
|
||||
display:flex;align-items:center;gap:var(--sp-2);
|
||||
font-size:var(--fs-md);font-weight:var(--fw-b);margin-bottom:var(--sp-3);
|
||||
}
|
||||
.tg-bar{width:6rpx;height:26rpx;border-radius:3rpx;background:currentColor}
|
||||
.g-1 .tg-head{color:var(--primary-ink)}
|
||||
.g-2 .tg-head{color:var(--green-ink)}
|
||||
.g-3 .tg-head{color:var(--blue-ink)}
|
||||
.g-4 .tg-head{color:var(--purple-ink)}
|
||||
|
||||
/* ===== 关注按钮 =====
|
||||
社区列表和关注/粉丝列表都在用。同上:两页共用的就不能留在任一页的 wxss 里 */
|
||||
.follow-btn{
|
||||
flex:none;font-size:var(--fs-cap);font-weight:var(--fw-b);padding:6rpx var(--sp-3);border-radius:var(--r-full);
|
||||
color:var(--primary-dark);background:var(--primary-soft);border:1rpx solid var(--primary-line);
|
||||
}
|
||||
.follow-btn.on{color:var(--muted);background:#F4F1EC;border-color:var(--line)}
|
||||
|
||||
/* ===== 记录类型分组宫格 =====
|
||||
记录页和「快速记录」弹层都在用,页面级 wxss 跨不了页
|
||||
四组各一个色系,色值全走 token 的 soft/ink 二件套,没有新色。
|
||||
|
||||
@@ -5,6 +5,13 @@ const recordTypes = require('../../utils/recordTypes.js');
|
||||
// 原来它还带着健康洞察、体重趋势、健康时间轴——那三块搬到 pages/history 了,
|
||||
// 从报告页进。一个「我要记一笔」的页面上摆着三块只读图表,
|
||||
// 用户每次都得先滚过去才能找到要点的东西。
|
||||
// tone-N 只给格子用(它自带背景色);组标题的颜色走 g-N。
|
||||
// short 是去掉「记录」后缀的组名——「日常记录」在标题位置念着啰嗦
|
||||
const G = { 'tone-1': 'g-1', 'tone-2': 'g-2', 'tone-3': 'g-3', 'tone-4': 'g-4' };
|
||||
function decorate(g) {
|
||||
return { ...g, g: G[g.tone] || 'g-1', short: (g.label || '').replace(/记录$/, '') };
|
||||
}
|
||||
|
||||
Page({
|
||||
data: { pet: {}, typeGroups: [], sheetShow: false, sheetType: '' },
|
||||
onLoad() {
|
||||
@@ -24,7 +31,7 @@ Page({
|
||||
if (this.data.typeGroups.length) return;
|
||||
recordTypes
|
||||
.load()
|
||||
.then((groups) => this.setData({ typeGroups: groups }))
|
||||
.then((groups) => this.setData({ typeGroups: groups.map(decorate) }))
|
||||
.catch(() => {});
|
||||
},
|
||||
goAdd(e) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"nav-bar": "/components/nav-bar/nav-bar",
|
||||
"pet-switch": "/components/pet-switch/pet-switch",
|
||||
"bottom-sheet": "/components/bottom-sheet/bottom-sheet",
|
||||
"pt-icon": "/components/pt-icon/index"
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<nav-bar title="记录" show-back="{{true}}"></nav-bar>
|
||||
|
||||
<view class="top-bar"><pet-switch bind:add="onAddPet"></pet-switch></view>
|
||||
|
||||
<scroll-view class="page-scroll" scroll-y="{{true}}" enhanced="{{true}}" show-scrollbar="{{false}}">
|
||||
<view class="page-body no-fab">
|
||||
<view wx:if="{{!pet.id}}" class="no-pet">
|
||||
@@ -11,21 +9,22 @@
|
||||
<view class="btn btn-dark" bindtap="onAddPet"><pt-icon name="plus" size="{{30}}"></pt-icon>建一份档案</view>
|
||||
</view>
|
||||
|
||||
<!-- 记一笔:分组来自后端 record_types,后台加一种不用发版。
|
||||
每组一个色系,靠浅色圆底 + 分组配色出彩,图标仍是线性的 -->
|
||||
<view class="card">
|
||||
<view class="section-head"><view class="sh-title">记一笔</view></view>
|
||||
<view wx:for="{{typeGroups}}" wx:key="key" class="tg {{item.tone}}">
|
||||
<view class="tg-head"><view class="tg-bar"></view>{{item.label}}<text class="tg-n">{{item.items.length}}</text></view>
|
||||
<view class="quick-grid cols-3">
|
||||
<!-- 分组来自后端 record_types,后台加一种不用发版。
|
||||
组标记用 g-N 而不是 tone-N:tone-N 在 app.wxss 里自带背景色,
|
||||
加在这一层会把整组涂成一片色块(本来只想给组标题上色)。
|
||||
记哪只宠物在添加页里选,这页不放宠物切换——它只是个事项目录。 -->
|
||||
<block wx:for="{{typeGroups}}" wx:key="key">
|
||||
<view class="tg {{item.g}}">
|
||||
<view class="tg-head"><view class="tg-bar"></view>{{item.short}}</view>
|
||||
<view class="quick-grid">
|
||||
<view wx:for="{{item.items}}" wx:for-item="t" wx:key="code" class="quick {{item.tone}}"
|
||||
data-type="{{t.code}}" bindtap="goAdd">
|
||||
<pt-icon name="{{t.icon}}" size="{{44}}" fallback="note"></pt-icon>{{t.label}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{!typeGroups.length}}" class="empty">还没有配置可记事项</view>
|
||||
</view>
|
||||
</block>
|
||||
<view wx:if="{{!typeGroups.length}}" class="empty lg">还没有配置可记事项</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
/* 分组宫格的样式在 app.wxss(记录页和历史页都用过,页面级 wxss 跨不了页)。
|
||||
趋势图和时间轴的样式跟着那三块一起搬到 pages/history 了。
|
||||
这页只剩「没建档」的空态,那套也在 app.wxss。 */
|
||||
|
||||
|
||||
/* 格子里的图标容器就是 .quick + .tone-N(app.wxss),这里不重复定义 */
|
||||
|
||||
Reference in New Issue
Block a user