fix(revenue): replicate the reference rebate poster canvas layers
The poster modal shell already matched the reference theme, but the canvas drawing diverged from zibll's poster-share.js rebate branch in four places: - No 推荐人 tags layer. The reference paints a red #fc4e1f 24px line at img_height+160; AKSRT dropped the layer entirely, so the poster lost the referrer attribution that identifies whose link it is. - The logo slot painted text. The reference contains the real logo image into (80, height-190, 300, 100); AKSRT drew the site name as a 30px string plus a hardcoded 长按识别二维码访问 caption in that slot. - Bottom copy was hardcoded. The reference reads share_desc; now sourced from the new pay_rebate_poster_desc_bottom field with share_desc fallback. - No banner fallback. The reference walks banner → banner_default → banner_spare; a single broken URL left the top half of the poster black. Also aligns the week label to the reference's 周 prefix (was 星期日) and ports drawTextOverflow for wrapping/truncation, which retires the local wrapText. Adds pay_rebate_poster_banner and pay_rebate_poster_desc_bottom to both the Vue and PHP schemas; rest_me now returns logo, compatible and referrer_name. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
ef15416ef7
commit
81b60eb427
7 files changed
+212
-95
No files matched your search
@@ -348,12 +348,25 @@ final class ReferralAttribution {
|
||||
$affiliate = \AKSRT\Settings\Settings::get_affiliate_settings();
|
||||
$registration = $this->registration_settings();
|
||||
$reward = $this->reward_settings();
|
||||
$poster = (array) ($affiliate['poster'] ?? ['enabled' => false]);
|
||||
// 参考主题 rebate 海报的 logo 与底部文案取自分享设置,不在推广海报字段里重复配置。
|
||||
if (class_exists('\AKSRT\Settings\Settings')) {
|
||||
$share = \AKSRT\Settings\Settings::get_share_settings();
|
||||
$poster['logo'] = esc_url_raw((string) ($share['poster_logo'] ?? ''));
|
||||
$poster['compatible'] = !empty($share['compatible_s']);
|
||||
if (($poster['bottom'] ?? '') === '') {
|
||||
$poster['bottom'] = sanitize_text_field((string) ($share['share_desc'] ?? ''));
|
||||
}
|
||||
}
|
||||
$user = get_userdata($user_id);
|
||||
return new \WP_REST_Response([
|
||||
'ref' => $link['ref'],
|
||||
'url' => $link['url'],
|
||||
'status' => $link['status'],
|
||||
'site_name' => get_bloginfo('name'),
|
||||
'poster' => (array) ($affiliate['poster'] ?? ['enabled' => false]),
|
||||
// 参考主题 tags:`推荐人: {昵称}`,画在海报主图下方的独立红色标签层。
|
||||
'referrer_name' => $user instanceof WP_User ? $user->display_name : '',
|
||||
'poster' => $poster,
|
||||
'features' => [
|
||||
'registration' => !empty($registration['enabled']),
|
||||
'points_reward' => !empty($reward['enabled']),
|
||||
|
||||
Reference in new issue
Block a user