fix(navigation): align mega-menu rendering and menu-item backend with the reference

Renderer:
- Graphic-card images carry fit-cover so they crop into the fixed card box
  instead of stretching it and pushing the title out of alignment.
- Mega-menu link icons use fa-fw (fixed glyph column) instead of the
  undefined menu-item-icon class, so link titles line up.

Backend:
- Restore show_policy (login / vip / vip_2 / auth) on menu items; the field
  was missing entirely, so items could not be gated by identity.
- Default submenu_type to graphic_card, badge_class to jb-red, arrangement
  to swiper, size to md.
- Clamp img_scale to 20-300 to match the reference's spinner bounds.
- Drop the now-meaningless "none" submenu_type option: the senior-submenu
  switch is itself the on/off control.
- Admin JS gains the align control (left/center/space-around).

Cleanup:
- Remove the unused header_actions nav menu location.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
kate522andClaude Opus 5 committed 2026-11-05 10:51:36 +08:00
1 parent 55423403a6
commit e6d9ff49a2
6 files changed
+113 -29

No files matched your search

+9 -2
View File
@@ -18,9 +18,10 @@
function graphicTemplate() {
return {
arrangement: '',
arrangement: 'swiper',
size: 'md',
img_scale: 100,
align: '',
items: [{ img: '', title: '', badge: '', badge_class: 'jb-red', link: { url: '', text: '', target: '' } }],
};
}
@@ -80,7 +81,12 @@
});
html += '</div>';
html += field('size', '尺寸 sm/md/lg/xs', data.size || 'md');
html += field('img_scale', '图片比例%', data.img_scale || 100, 'number');
html += field('img_scale', '图片比例%(20-300)', data.img_scale || 100, 'number');
html += ' <label>对齐 <select data-name="align">';
html += '<option value=""' + (!data.align ? ' selected' : '') + '>靠左</option>';
html += '<option value="jc"' + (data.align === 'jc' ? ' selected' : '') + '>居中</option>';
html += '<option value="jsa"' + (data.align === 'jsa' ? ' selected' : '') + '>平均分布</option>';
html += '</select></label>';
$wrap.html(html);
}
@@ -114,6 +120,7 @@
var data = graphicTemplate();
data.arrangement = $wrap.find('[data-name="arrangement"]').val() || '';
data.size = $wrap.find('[data-name="size"]').val() || 'md';
data.align = $wrap.find('[data-name="align"]').val() || '';
data.img_scale = parseInt($wrap.find('[data-name="img_scale"]').val(), 10) || 100;
data.items = [];
$wrap.find('.jio-sme-card').each(function () {