From 9dce9854c8ecdc23b72dc6496bbfd1e7eaaea75a Mon Sep 17 00:00:00 2001 From: augushong Date: Sat, 2 May 2026 09:54:59 +0800 Subject: [PATCH] fix(phone-image): T7 integration fixes Fix 3 bugs found during Playwright integration testing: 1. Template syntax: {|json_encode|default='{}'} -> PHP native (curly braces parsed as TP6 tags) 2. jQuery event namespace mismatch: off('click.phoneImage') -> off('click') to match on('click') 3. Migration executed on server All 6 Playwright test scenarios passed: layout, content flow, preview, alignment, font size, toolbar buttons --- public/static/js/phone-image.js | 6 +++--- view/admin/post/phone_image.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/static/js/phone-image.js b/public/static/js/phone-image.js index ea080ef..59775a9 100644 --- a/public/static/js/phone-image.js +++ b/public/static/js/phone-image.js @@ -60,9 +60,9 @@ var PhoneImageEngine = (function () { } // 内容流事件委托(只绑定一次) - $(document).off('click.phoneImage', '.break-inserter-btn'); - $(document).off('click.phoneImage', '.remove-break-btn'); - $(document).off('click.phoneImage', '.page-alignment-toggle'); + $(document).off('click', '.break-inserter-btn'); + $(document).off('click', '.remove-break-btn'); + $(document).off('click', '.page-alignment-toggle'); $(document).on('click', '.break-inserter-btn', function () { var afterIndex = parseInt($(this).parent().data('after-index'), 10); diff --git a/view/admin/post/phone_image.html b/view/admin/post/phone_image.html index ee48ceb..bb688dc 100644 --- a/view/admin/post/phone_image.html +++ b/view/admin/post/phone_image.html @@ -180,7 +180,7 @@ }; // 恢复之前保存的排版配置 - var savedConfig = {$layoutConfig|json_encode|default="{}"}; + var savedConfig = ; var initConfig = { size: savedConfig.size || 'xiaohongshu', fontSize: savedConfig.fontSize || 14,