Files
wordpress-theme-aksrt/inc/helpers/user-center-renderers/affiliate-poster-modal.php
T
kate522andClaude Fable 5 9a22c7eb8b fix(revenue): stop poster modal from blocking the whole revenue page
Two regressions from the previous commit made /user/revenue/ unusable.

The rewrite dropped data-aksrt-affiliate-poster-modal from the modal shell.
That single attribute was both the JS lookup key and the CSS hook, so
initAffiliatePoster() bailed at `if (!button || !modal) return` — which is
why the 推广海报 button never got un-hidden — and no CSS could target the
shell. Restore it.

With the shell back but still visible, main.css's .flex{display:flex} loads
after bootstrap and matches .modal{display:none} on specificity, so the
resting modal rendered as a full-viewport flex box. Combined with .fade's
opacity:0 that is an invisible overlay swallowing every click on the page.
Pin the resting state to display:none and the open state to flex, the same
way credits.css already does for the charge and points-pay modals — that
file documents this exact trap.

Add a contract test asserting the markup, JS selector and CSS hook share
one attribute and that the resting state is explicitly hidden.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-10-21 19:26:48 +08:00

37 lines
1.9 KiB
PHP

<?php
/**
* Affiliate poster preview modal.
*
* 1:1 replica of the reference theme's poster-share modal (zibll js/poster-share.js
* + css/main.css `.poster-share` block): a borderless 360px Bootstrap-style dialog
* centred by `.modal.flex.jc`, a `.loading-mask` overlay while the canvas renders,
* and circular download/close buttons on a `.hover-show-con` layer that only fades
* in on hover. The 推广海报 button lives in the revenue detail link row; the QR code
* is no longer rendered on its own — it exists only inside the generated poster.
*
* @package AKSRT
*/
defined('ABSPATH') || exit;
if (!empty($GLOBALS['aksrt_affiliate_poster_modal_rendered'])) {
return;
}
$GLOBALS['aksrt_affiliate_poster_modal_rendered'] = true;
?>
<div class="modal fade flex jc" id="aksrt-affiliate-poster-modal" data-aksrt-affiliate-poster-modal tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog poster-share hover-show" role="document">
<div class="modal-content" style="height:220px;overflow:hidden">
<div class="poster-imgbox hover-show" data-affiliate-poster-stage></div>
<div class="flex jc loading-mask absolute main-bg radius8" data-affiliate-poster-loading>
<div class="loading zts fa-2x"></div>
<div class="muted-2-color box-body"><?php esc_html_e('正在生成图片,请稍候...', 'aksrt'); ?></div>
</div>
</div>
<div class="padding-6 abs-center hover-show-con text-center" style="top:auto">
<a href="javascript:;" class="but cir jb-blue poster-download hide" data-affiliate-poster-download aria-label="<?php esc_attr_e('保存海报', 'aksrt'); ?>"><i class="fas fa-download" aria-hidden="true"></i></a>
<button type="button" data-dismiss="modal" class="but cir jb-yellow ml10" aria-label="<?php esc_attr_e('关闭', 'aksrt'); ?>"><svg aria-hidden="true" class="icon em12"><use xlink:href="#icon-close"></use></svg></button>
</div>
</div>
</div>