ux: 动作收藏按钮从顶部浮窗移到底部,与加入计划并排 + 图标美化
- detail 顶部 favbtn 浮窗(需避让胶囊、丑)移除,改为底部 addbar 内与 CTA 并排的方形按钮 - fc-icon 新增 filled 属性:收藏态实心心形(Lucide 描边图标默认 fill=none,filled=true 时 fill=stroke 变实心) - 收藏按钮美化:圆角 24rpx 方形 + 发丝边框,未收藏描边(text-2)、已收藏实心(accent)+ accent-soft 底色 + accent-ring 边框 + 点按 scale 反馈 - detail.js 清理 favRight/favTop 胶囊避让逻辑(不再需要)
This commit is contained in:
@@ -7,8 +7,6 @@ const auth = require('../../utils/auth');
|
||||
Page({
|
||||
data: {
|
||||
statusBarHeight: 20,
|
||||
favRight: 8,
|
||||
favTop: 20,
|
||||
id: '',
|
||||
planId: '',
|
||||
exercise: null,
|
||||
@@ -23,18 +21,7 @@ Page({
|
||||
onLoad(query) {
|
||||
const id = query.id || '';
|
||||
const planId = query.planId || '';
|
||||
// 收藏按钮需避让微信右上角胶囊按钮(···◯):用胶囊实际位置算出安全右/上边距
|
||||
let favRight = 8;
|
||||
let favTop = (app.globalData.statusBarHeight || 20) + 6;
|
||||
try {
|
||||
const menu = wx.getMenuButtonBoundingClientRect();
|
||||
const win = (wx.getWindowInfo && wx.getWindowInfo()) || wx.getSystemInfoSync();
|
||||
if (menu && win) {
|
||||
favRight = Math.max(8, win.windowWidth - menu.left + 8);
|
||||
favTop = menu.top + Math.max(0, (menu.height - 36) / 2);
|
||||
}
|
||||
} catch (e) {}
|
||||
this.setData({ statusBarHeight: app.globalData.statusBarHeight || 20, favRight, favTop, id, planId });
|
||||
this.setData({ statusBarHeight: app.globalData.statusBarHeight || 20, id, planId });
|
||||
// 防御:id 缺失直接显示空态,避免请求 /api/exercises/ 导致错乱或 404
|
||||
if (!id) {
|
||||
this.setData({ loading: false });
|
||||
|
||||
Reference in New Issue
Block a user