fix: rename marketing account bill tabs

This commit is contained in:
chenxi 2026-08-07 10:20:13 +08:00
parent 005d221697
commit 962d95fe05
2 changed files with 24 additions and 26 deletions

View File

@ -1,23 +1,24 @@
@php
$isMarketingAccountBillsPage = ($section['slug'] ?? null) === 'billing-transactions'
&& ($page['slug'] ?? null) === 'marketing-account-bills';
$marketingAccountTabTitles = [
'taobao-alipay' => '淘系账户',
'taobao-wechat' => '阿里巴巴账户',
'jd-wallet' => '京东账户',
];
$activeContentTitle = $activeTab['title'] ?? ($page['title'] ?? $section['title']);
if ($isMarketingAccountBillsPage && isset($marketingAccountTabTitles[$activeTab['slug'] ?? null])) {
$activeContentTitle = $marketingAccountTabTitles[$activeTab['slug']];
}
@endphp
<x-layouts.admin>
<x-slot name="title">
{{ $activeTab['title'] ?? ($page['title'] ?? $section['title']) }}
{{ $activeContentTitle }}
</x-slot>
<x-slot name="content">
@php
$isMarketingAccountBillsPage = ($section['slug'] ?? null) === 'billing-transactions'
&& ($page['slug'] ?? null) === 'marketing-account-bills';
$activeContentTitle = $activeTab['title'] ?? ($page['title'] ?? $section['title']);
if ($isMarketingAccountBillsPage && ($activeTab['slug'] ?? null) === 'taobao-wechat') {
$activeContentTitle = 'Alibaba';
}
if ($isMarketingAccountBillsPage && ($activeTab['slug'] ?? null) === 'jd-wallet') {
$activeContentTitle = '京东';
}
@endphp
<style>
#main-body > .container {
max-width: none;
@ -410,15 +411,9 @@
<nav class="business-tab-bar" aria-label="{{ $page['title'] }}">
@foreach ($tabs as $tab)
@php
$visibleTabTitle = $tab['title'];
if ($isMarketingAccountBillsPage && $tab['slug'] === 'taobao-wechat') {
$visibleTabTitle = 'Alibaba';
}
if ($isMarketingAccountBillsPage && $tab['slug'] === 'jd-wallet') {
$visibleTabTitle = '京东';
}
$visibleTabTitle = $isMarketingAccountBillsPage
? ($marketingAccountTabTitles[$tab['slug']] ?? $tab['title'])
: $tab['title'];
@endphp
<a

View File

@ -18,8 +18,11 @@ class MarketingAccountBillsTabsTest extends FeatureTestCase
'tab' => 'taobao-wechat',
]))
->assertOk()
->assertSeeText('Alibaba')
->assertSeeText('京东')
->assertSeeText('淘系账户')
->assertSeeText('阿里巴巴账户')
->assertSeeText('京东账户')
->assertDontSeeText('淘系支付宝账户')
->assertDontSeeText('京东网银钱包账户')
->assertSee('class="my-6 business-page--marketing-account-bills"', false);
}