feat: 前台 paywall——整篇锁定渲染付费墙,付费块替换为 teaser
- membership/post.rendered 过滤:整篇锁定(members_only)渲染 paywall 视图(封面+标题+价格+单篇解锁/开通会员按钮,游客引导登录);[paid] 块替换为带解锁按钮的 teaser;替换改用 preg_replace_callback 避免 $ 转义问题 - 视图放 resources/views/membership/(主题同名文件可覆盖),两主题补充 .paywall/.paid-teaser 样式 - 修复泄漏:excerpt_or_fallback 对 members_only 文章不再回退截取正文,防止内容泄漏到 paywall 与 SEO meta - 测试:更新 teaser 断言,新增 guest 见 paywall、登录用户见解锁/会员按钮
This commit is contained in:
@@ -144,3 +144,14 @@ a:hover { color: #f60; text-decoration: underline; }
|
||||
.toc-level-4, .toc-level-5, .toc-level-6 { padding-left: 28px; }
|
||||
|
||||
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
|
||||
|
||||
/* Paywall */
|
||||
.paywall { border: 1px solid #e0e0e0; border-radius: 8px; padding: 24px 20px; background: #fafafa; text-align: center; }
|
||||
.paywall-cover img { max-width: 100%; border-radius: 6px; margin-bottom: 14px; }
|
||||
.paywall-title { font-size: 20px; margin: 0 0 10px; }
|
||||
.paywall-excerpt { color: #666; font-size: 14px; margin: 0 0 14px; }
|
||||
.paywall-price { font-size: 22px; font-weight: 800; color: #f60; margin: 0 0 8px; }
|
||||
.paywall-hint { color: #888; font-size: 13px; margin: 0 0 16px; }
|
||||
.paywall-actions .btn { margin: 0 6px; }
|
||||
.paid-teaser { border: 1px dashed #f5c6cb; background: #fdecea; color: #c62828; border-radius: 6px; padding: 12px 14px; margin: 12px 0; font-size: 14px; }
|
||||
.paid-teaser .btn { margin-left: 8px; }
|
||||
|
||||
Reference in New Issue
Block a user