diff --git a/beike/Helpers.php b/beike/Helpers.php index a282dd38..39ccc71d 100644 --- a/beike/Helpers.php +++ b/beike/Helpers.php @@ -301,6 +301,19 @@ function locale(): string return Session::get('locale') ?? system_setting('base.locale'); } +/** + * 获取后台当前语言 + * + * @return string + */ +function admin_locale(): string +{ + if (is_admin()) { + return current_user()->locale; + } + return locale(); +} + /** * 货币格式化 * diff --git a/beike/Shop/Http/Controllers/CategoryController.php b/beike/Shop/Http/Controllers/CategoryController.php index 1d682ae2..24e1f937 100644 --- a/beike/Shop/Http/Controllers/CategoryController.php +++ b/beike/Shop/Http/Controllers/CategoryController.php @@ -18,6 +18,8 @@ class CategoryController extends Controller { $products = ProductRepo::getProductsByCategory($category->id); + $category->load('description'); + $data = [ 'category' => $category, 'products_format' => $products->jsonSerialize(), diff --git a/beike/Shop/View/Components/NoData.php b/beike/Shop/View/Components/NoData.php index 36e94e99..8a7ca319 100644 --- a/beike/Shop/View/Components/NoData.php +++ b/beike/Shop/View/Components/NoData.php @@ -8,10 +8,14 @@ use Illuminate\Contracts\View\View; class NoData extends Component { public string $text; + public string $link; + public string $btn; - public function __construct(?string $text = '') + public function __construct(?string $text = '', ?string $link = '', ?string $btn = '') { $this->text = $text ?: trans('common.no_data'); + $this->link = $link; + $this->btn = $btn; } public function render() diff --git a/resources/beike/admin/css/_global.scss b/resources/beike/admin/css/_global.scss index faf72492..a7763052 100644 --- a/resources/beike/admin/css/_global.scss +++ b/resources/beike/admin/css/_global.scss @@ -13,6 +13,11 @@ src: url('/fonts/poppins/Poppins-Regular.ttf'); } +@font-face {font-family: 'poppins'; + src: url('/fonts/poppins/Poppins-Bold.ttf'); + font-weight: bold; +} + @font-face {font-family: 'Poppins-Medium'; src: url('/fonts/poppins/Poppins-Medium.ttf'); } diff --git a/resources/beike/admin/css/_header.scss b/resources/beike/admin/css/_header.scss index 1a55d004..81381e93 100644 --- a/resources/beike/admin/css/_header.scss +++ b/resources/beike/admin/css/_header.scss @@ -42,12 +42,12 @@ padding: 0; list-style: none; > li { - html[lang="zh_cn"] &, html[lang="zh_hk"] &, html[lang="en"] & { + html[lang="zh_cn"] &, html[lang="zh_hk"] &, html[lang="en"] &, html[lang="ja"] & { padding: 0 1rem; } @media screen and (max-width: 1200px) { - html[lang="zh_cn"] &, html[lang="zh_hk"] &, html[lang="en"] & { + html[lang="zh_cn"] &, html[lang="zh_hk"] &, html[lang="en"] &, html[lang="ja"] & { padding: 0 .2rem; } } diff --git a/resources/beike/admin/views/components/header.blade.php b/resources/beike/admin/views/components/header.blade.php index 3c89033d..ae5f23b8 100644 --- a/resources/beike/admin/views/components/header.blade.php +++ b/resources/beike/admin/views/components/header.blade.php @@ -3,7 +3,6 @@