fix(pay): render paid reading as fragments

This commit is contained in:
2026-08-13 18:58:24 +08:00
parent 4cc1f2b2ea
commit f040a680d6
9 changed files with 316 additions and 65 deletions
+7
View File
@@ -89,6 +89,10 @@ class ResourceMetaBox {
</span>
</div>
<p class="aksrt-pmb__hint" id="aksrt-pmb-reading-hint" hidden>
<?php esc_html_e('付费阅读价格只作用于正文中的“付费可见”片段;未插入片段时,正文保持公开。', 'aksrt'); ?>
</p>
<div class="aksrt-pmb__fields" id="aksrt-pmb-fields" data-disabled="<?php echo $is_paid ? '0' : '1'; ?>">
<!-- 基础价格 -->
@@ -378,6 +382,9 @@ class ResourceMetaBox {
var isPaid = t !== 'no';
fields.setAttribute('data-disabled', isPaid ? '0' : '1');
var readingHint = document.getElementById('aksrt-pmb-reading-hint');
if (readingHint) readingHint.hidden = t !== 'reading';
// 根据付费类型显示/隐藏相关字段
if (dlFields) dlFields.style.display = (t === 'download') ? '' : 'none';
if (galleryFields) galleryFields.style.display = (t === 'gallery') ? '' : 'none';