.page { min-height: 100vh; background: #FDFBF7; } /* ---- 加载失败兜底(web-view 为原生组件,仅在不渲染时才展示) ---- */ .error-page { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 120rpx 60rpx; height: 100vh; box-sizing: border-box; } .error-icon { width: 120rpx; height: 120rpx; border-radius: 50%; background: #FDEAEA; color: #C0392B; font-size: 64rpx; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-bottom: 32rpx; } .error-title { font-size: 32rpx; font-weight: 700; color: #2C1810; margin-bottom: 16rpx; } .error-desc { font-size: 26rpx; color: #8B7A6A; text-align: center; line-height: 1.6; margin-bottom: 40rpx; } .error-retry { padding: 20rpx 60rpx; background: #C67B30; color: #fff; font-size: 28rpx; border-radius: 999rpx; } .btn-hover { opacity: 0.7; } /* ---- 「去上课」浮窗 ---- 是 cover-view(原生组件),只能用基本定位/布局/文本样式: 不支持 box-shadow、background-image、单边 border、overflow: visible。 层次靠「主色底 + 浅描边」表达,别改成阴影 —— 真机上会静默不生效。 **2026-09-21 起改为「右侧垂直居中」**(原为右下角 bottom: 40rpx)。 本页是 tabBar 页面,可视区已不含 tabBar,所以 top: 50% 直接就是「内容区正中」, 不需要再为 tabBar 做偏移。 **2026-09-21 加大尺寸**(水平 padding 40 → 64 → 80 → **96**;垂直一直是 36,从未变过)。 尺寸约 286×112rpx(≈143×56px),满足微信建议的点击热区 ≥ 88rpx。 */ .class-float { position: fixed; right: 24rpx; /* 垂直居中 = top 50% + 负 margin 抵消自身高度的一半。 ⚠️ 不要改成 transform: translateY(-50%) —— cover-view 对 transform 没有官方支持承诺, 真机上一旦静默失效,按钮会掉回页面顶部(不是掉到中间,是掉到最上面)。 ⚠️ 不能同时保留 bottom:position: fixed 下 top/bottom 同时给出且 height 为 auto 时, 盒子会被拉伸填满整个视口高度,视觉上变成一条竖条。 ⚠️ -56rpx 与按钮高度强耦合:高度 = padding 36×2 + 文本 30×1.2(=36) + 边框 2×2 = 112rpx, 补偿值恒等于「-高度/2」。**只调水平 padding 不会影响它** —— 想调尺寸又不想碰这个坑时, 优先只动水平方向(垂直方向一改就必须重算,否则垂直居中静默偏掉: 不是报错,只是看着不太居中,很难肉眼发现)。 验证脚本 `verify_course_float.js` 的 [7c] 会按上述算式自动推导并断言,漏改会直接红。 ⚠️ 宽度同理 = 文本 3字×30(=90) + padding 水平 96×2 + 边框 2×2 = 286rpx(≈屏宽 38%)。 按钮越宽,横向压住课程列表的区域越大 —— 真机若发现挡住列表可点元素,优先收窄水平 padding。 **要调宽度只需改这一个数字**(水平 padding),不必动其他任何地方。 */ top: 50%; margin-top: -56rpx; z-index: 999; padding: 36rpx 96rpx; background: #C67B30; border: 2rpx solid #E8C79A; border-radius: 999rpx; } .class-float-text { color: #FFFFFF; font-size: 30rpx; font-weight: 700; line-height: 1.2; text-align: center; } .class-float-hover { background: #B06A26; }