This commit is contained in:
sl 2022-08-18 09:09:01 +08:00
commit 06193e9a1c
28 changed files with 371 additions and 310 deletions

View File

@ -118,6 +118,7 @@ function plugin_route($route, $params = []): string
* @param $type
* @param $value
* @return string
* @throws Exception
*/
function type_route($type, $value): string
{
@ -125,6 +126,9 @@ function type_route($type, $value): string
if (empty($type) || empty($value) || !in_array($type, $types)) {
return '';
}
if (is_array($value)) {
throw new \Exception('Value must be integer, string or object');
}
if ($type == 'category') {
return shop_route('categories.show', ['category' => $value]);

View File

@ -163,11 +163,12 @@ class BrandRepo
/**
* 通过品牌ID获取品牌名称
* @param $id
* @param $brand
* @return mixed|string
*/
public static function getName($id)
public static function getName($brand)
{
$id = is_int($brand) ? $brand : $brand->id;
$categories = self::getAllBrandsWithName();
return $categories[$id]['name'] ?? '';
}

View File

@ -140,11 +140,12 @@ class CategoryRepo
/**
* 通过分类ID获取产品名称
* @param $id
* @param $category
* @return mixed|string
*/
public static function getName($id)
public static function getName($category)
{
$id = is_int($category) ? $category : $category->id;
$categories = self::getAllCategoriesWithName();
return $categories[$id]['name'] ?? '';
}

View File

@ -20,9 +20,17 @@ class BrandController extends Controller
public function show(int $id)
{
$products = BrandRepo::find($id)->products()->with('inCurrentWishlist')->paginate(20);
$brand = BrandRepo::find($id);
$products = $brand->products()
->with([
'master_sku',
'description',
'inCurrentWishlist'
])
->paginate(20);
$data = [
'brand' => $brand,
'products' => ProductSimple::collection($products)->jsonSerialize(),
];

View File

@ -6,13 +6,11 @@ use Beike\Libraries\Tax;
use Beike\Models\Customer;
use Illuminate\Support\Str;
use Illuminate\View\FileViewFinder;
use TorMorten\Eventy\Facades\Eventy;
use Beike\Repositories\CategoryRepo;
use Illuminate\Support\Facades\View;
use Beike\Shop\View\Components\Alert;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\ServiceProvider;
use Beike\Shop\View\Components\Breadcrumb;
use Beike\Shop\View\Components\AccountSidebar;
use Beike\Shop\View\Components\Alert;
class ShopServiceProvider extends ServiceProvider
{
@ -88,6 +86,7 @@ class ShopServiceProvider extends ServiceProvider
$this->loadViewComponentsAs('shop', [
'sidebar' => AccountSidebar::class,
'alert' => Alert::class,
'breadcrumb' => Breadcrumb::class
]);
}
}

View File

@ -1,37 +0,0 @@
<?php
/**
* breadcrumbs.php
*
* @copyright 2022 opencart.cn - All Rights Reserved
* @link http://www.guangdawangluo.com
* @author Edward Yang <yangjin@opencart.cn>
* @created 2022-07-26 17:26:37
* @modified 2022-07-26 17:26:37
*/
use Diglactic\Breadcrumbs\Breadcrumbs;
use Diglactic\Breadcrumbs\Generator as BreadcrumbTrail;
// Home
Breadcrumbs::for('home', function (BreadcrumbTrail $trail) {
$trail->push('首页', shop_route('home.index'));
});
// Home > [Category]
Breadcrumbs::for('category', function (BreadcrumbTrail $trail, $category) {
$trail->parent('home');
$trail->push($category->description->name, shop_route('categories.show', $category));
});
// Home > Category > [Product]
Breadcrumbs::for('product', function (BreadcrumbTrail $trail, $product) {
$productModel = \Beike\Models\Product::query()->find($product['id']);
$category = $productModel->categories->first();
if ($category) {
$trail->parent('category', $category);
} else {
$trail->parent('home');
}
$trail->push($product['name'], shop_route('products.show', $productModel));
});

View File

@ -1,26 +1,26 @@
<?php
use Beike\Models\Customer;
use Beike\Shop\Http\Controllers\Account\WishlistController;
use Beike\Shop\Http\Controllers\BrandController;
use Beike\Shop\Http\Controllers\CurrencyController;
use Beike\Shop\Http\Controllers\FileController;
use Beike\Shop\Http\Controllers\LanguageController;
use Illuminate\Support\Facades\Route;
use Beike\Shop\Http\Controllers\FileController;
use Beike\Shop\Http\Controllers\ZoneController;
use Beike\Shop\Http\Controllers\CartController;
use Beike\Shop\Http\Controllers\HomeController;
use Beike\Shop\Http\Controllers\PageController;
use Beike\Shop\Http\Controllers\BrandController;
use Beike\Shop\Http\Controllers\ProductController;
use Beike\Shop\Http\Controllers\CurrencyController;
use Beike\Shop\Http\Controllers\LanguageController;
use Beike\Shop\Http\Controllers\CategoryController;
use Beike\Shop\Http\Controllers\CheckoutController;
use Beike\Shop\Http\Controllers\Account\RmaController;
use Beike\Shop\Http\Controllers\Account\EditController;
use Beike\Shop\Http\Controllers\Account\LoginController;
use Beike\Shop\Http\Controllers\Account\OrderController;
use Beike\Shop\Http\Controllers\Account\LogoutController;
use Beike\Shop\Http\Controllers\Account\AddressController;
use Beike\Shop\Http\Controllers\Account\EditController;
use Beike\Shop\Http\Controllers\Account\AccountController;
use Beike\Shop\Http\Controllers\Account\RmaController;
use Beike\Shop\Http\Controllers\Account\WishlistController;
use Beike\Shop\Http\Controllers\Account\RegisterController;
use Beike\Shop\Http\Controllers\Account\ForgottenController;
@ -80,23 +80,24 @@ Route::prefix('/')
});
Route::prefix('account')
->name('account.')
->middleware('shop_auth:' . Customer::AUTH_GUARD)
->group(function () {
Route::get('/', [AccountController::class, 'index'])->name('account.index');
Route::get('/', [AccountController::class, 'index'])->name('index');
Route::resource('addresses', AddressController::class);
Route::get('edit', [EditController::class, 'index'])->name('account.edit.index');
Route::get('edit', [EditController::class, 'index'])->name('edit.index');
Route::get('rmas', [RmaController::class, 'index'])->name('account.rma.index');
Route::get('rmas/{id}', [RmaController::class, 'show'])->name('account.rma.show');
Route::get('rmas/create/{order_product_id}', [RmaController::class, 'create'])->name('account.rma.create');
Route::post('rmas/store', [RmaController::class, 'store'])->name('account.rma.store');
Route::get('rmas', [RmaController::class, 'index'])->name('rma.index');
Route::get('rmas/{id}', [RmaController::class, 'show'])->name('rma.show');
Route::get('rmas/create/{order_product_id}', [RmaController::class, 'create'])->name('rma.create');
Route::post('rmas/store', [RmaController::class, 'store'])->name('rma.store');
Route::put('edit', [EditController::class, 'update'])->name('account.edit.update');
Route::get('orders', [OrderController::class, 'index'])->name('account.order.index');
Route::get('orders/{number}', [OrderController::class, 'show'])->name('account.order.show');
Route::get('update_password', [AccountController::class, 'updatePassword'])->name('account.update_password');
Route::get('wishlist', [WishlistController::class, 'index'])->name('account.wishlist.index');
Route::post('wishlist', [WishlistController::class, 'add'])->name('account.wishlist.add');
Route::delete('wishlist/{id}', [WishlistController::class, 'remove'])->name('account.wishlist.remove');
Route::put('edit', [EditController::class, 'update'])->name('edit.update');
Route::get('orders', [OrderController::class, 'index'])->name('order.index');
Route::get('orders/{number}', [OrderController::class, 'show'])->name('order.show');
Route::get('update_password', [AccountController::class, 'updatePassword'])->name('update_password');
Route::get('wishlist', [WishlistController::class, 'index'])->name('wishlist.index');
Route::post('wishlist', [WishlistController::class, 'add'])->name('wishlist.add');
Route::delete('wishlist/{id}', [WishlistController::class, 'remove'])->name('wishlist.remove');
});
});

View File

@ -0,0 +1,157 @@
<?php
/**
* BreadCrumb.php
*
* @copyright 2022 opencart.cn - All Rights Reserved
* @link http://www.guangdawangluo.com
* @author Edward Yang <yangjin@opencart.cn>
* @created 2022-08-17 22:45:42
* @modified 2022-08-17 22:45:42
*/
namespace Beike\Shop\View\Components;
use Beike\Models\Product;
use Illuminate\Support\Str;
use Illuminate\View\Component;
use Illuminate\Support\Collection;
use Illuminate\Contracts\View\View;
class Breadcrumb extends Component
{
public Collection $breadcrumbs;
/**
* Create a new component instance.
*
* @return void
*/
public function __construct($type, $value, array $text = [])
{
$breadcrumbs[] = [
'title' => trans('shop/common.home'),
'url' => shop_route('home.index')
];
if ($type == 'category') {
$breadcrumbs = array_merge($breadcrumbs, $this->handleCategoryLinks($value));
} elseif ($type == 'product') {
$breadcrumbs = array_merge($breadcrumbs, $this->handleProductLinks($value));
} elseif (Str::startsWith($value, 'account')) {
$breadcrumbs = array_merge($breadcrumbs, $this->handleAccountLinks($value));
} else {
$breadcrumbs = array_merge($breadcrumbs, $this->handleLinks($type, $value, $text));
}
$this->breadcrumbs = collect($breadcrumbs);
}
/**
* Get the view / contents that represent the component.
*
* @return View|
*/
public function render(): View
{
return view('components.breadcrumbs');
}
/**
* 获取分类以及路径
*
* @param $value
* @return array
*/
private function handleCategoryLinks($value): array
{
$link = handle_link(['type' => 'category', 'value' => $value]);
return [
[
'title' => $link['text'],
'url' => $link['link'],
]
];
}
/**
* 获取产品以及分类路径
*
* @param $value
* @return array
*/
private function handleProductLinks($value): array
{
$links = [];
$productId = 0;
if (is_array($value)) {
$productId = $value['id'] ?? 0;
} elseif (is_int($value)) {
$productId = $value;
}
$product = Product::query()->find($productId);
$category = $product->categories()->first();
if ($category) {
$categoryLink = handle_link(['type' => 'category', 'value' => $category]);
$links[] = ['title' => $categoryLink['text'], 'url' => $categoryLink['link']];
}
$productLink = handle_link(['type' => 'product', 'value' => $value]);
$links[] = ['title' => $productLink['text'], 'url' => $productLink['link']];
return $links;
}
/**
* 处理个人中心面包屑
*
* @param $value
* @return array[]
*/
private function handleAccountLinks($value): array
{
$links = [];
$values = explode('.', $value);
if (count($values) == 3) {
$link = handle_link(['type' => 'static', 'value' => 'account.index']);
$links[] = [
'title' => $link['text'],
'url' => $link['link'],
];
}
$link = handle_link(['type' => 'static', 'value' => $value]);
$links[] = [
'title' => $link['text'],
'url' => $link['link'],
];
return $links;
}
/**
* 获取普通链接
*
* @param $type
* @param $value
* @param array $text
* @return array
*/
private function handleLinks($type, $value, array $text = []): array
{
$data = [
'type' => $type,
'value' => $value,
'text' => $text,
];
$link = handle_link($data);
return [
[
'title' => $link['text'],
'url' => $link['link'],
]
];
}
}

View File

@ -8,7 +8,6 @@
"php": "^7.4|^8.0",
"ext-json": "*",
"ext-zip": "*",
"diglactic/laravel-breadcrumbs": "^7.2",
"doctrine/dbal": "^3.3",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.2",

197
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "baf9504253adfc5cc3fd0b9e881f26a1",
"content-hash": "b0d15109abae83061530a0836ca3b001",
"packages": [
{
"name": "asm89/stack-cors",
@ -215,83 +215,6 @@
},
"time": "2021-08-13T13:06:58+00:00"
},
{
"name": "diglactic/laravel-breadcrumbs",
"version": "v7.2.0",
"source": {
"type": "git",
"url": "https://github.com/diglactic/laravel-breadcrumbs.git",
"reference": "309ec597d047b763d1df3c5113a3932cc771500f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/diglactic/laravel-breadcrumbs/zipball/309ec597d047b763d1df3c5113a3932cc771500f",
"reference": "309ec597d047b763d1df3c5113a3932cc771500f",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"facade/ignition-contracts": "^1.0",
"laravel/framework": "^6.0 || ^7.0 || ^8.0 || ^9.0",
"php": "^7.2 || ^8.0"
},
"conflict": {
"davejamesmiller/laravel-breadcrumbs": "*"
},
"require-dev": {
"orchestra/testbench": "^4.10 || ^5.9 || ^6.4 || ^7.0",
"php-coveralls/php-coveralls": "^2.4",
"phpunit/phpunit": "^8.5 || ^9.4",
"spatie/phpunit-snapshot-assertions": "^2.2 || ^4.2"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Diglactic\\Breadcrumbs\\ServiceProvider"
],
"aliases": {
"Breadcrumbs": "Diglactic\\Breadcrumbs\\Breadcrumbs"
}
}
},
"autoload": {
"psr-4": {
"Diglactic\\Breadcrumbs\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Sheng Slogar",
"email": "sheng@diglactic.com",
"role": "Maintainer"
},
{
"name": "Dave James Miller",
"email": "dave@davejamesmiller.com",
"role": "Original Creator"
}
],
"description": "A simple Laravel-style way to create breadcrumbs.",
"homepage": "https://github.com/diglactic/laravel-breadcrumbs",
"keywords": [
"laravel"
],
"support": {
"issues": "https://github.com/diglactic/laravel-breadcrumbs/issues",
"source": "https://github.com/diglactic/laravel-breadcrumbs/tree/v7.2.0"
},
"time": "2022-05-03T05:40:37+00:00"
},
{
"name": "doctrine/cache",
"version": "2.2.0",
@ -977,65 +900,6 @@
],
"time": "2022-06-18T20:57:19+00:00"
},
{
"name": "facade/ignition-contracts",
"version": "1.0.2",
"source": {
"type": "git",
"url": "https://github.com/facade/ignition-contracts.git",
"reference": "3c921a1cdba35b68a7f0ccffc6dffc1995b18267"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/facade/ignition-contracts/zipball/3c921a1cdba35b68a7f0ccffc6dffc1995b18267",
"reference": "3c921a1cdba35b68a7f0ccffc6dffc1995b18267",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": "^7.3|^8.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^v2.15.8",
"phpunit/phpunit": "^9.3.11",
"vimeo/psalm": "^3.17.1"
},
"type": "library",
"autoload": {
"psr-4": {
"Facade\\IgnitionContracts\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Freek Van der Herten",
"email": "freek@spatie.be",
"homepage": "https://flareapp.io",
"role": "Developer"
}
],
"description": "Solution contracts for Ignition",
"homepage": "https://github.com/facade/ignition-contracts",
"keywords": [
"contracts",
"flare",
"ignition"
],
"support": {
"issues": "https://github.com/facade/ignition-contracts/issues",
"source": "https://github.com/facade/ignition-contracts/tree/1.0.2"
},
"time": "2020-10-16T08:27:54+00:00"
},
{
"name": "fruitcake/laravel-cors",
"version": "v2.2.0",
@ -6907,6 +6771,65 @@
],
"time": "2022-03-03T08:28:38+00:00"
},
{
"name": "facade/ignition-contracts",
"version": "1.0.2",
"source": {
"type": "git",
"url": "https://github.com/facade/ignition-contracts.git",
"reference": "3c921a1cdba35b68a7f0ccffc6dffc1995b18267"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/facade/ignition-contracts/zipball/3c921a1cdba35b68a7f0ccffc6dffc1995b18267",
"reference": "3c921a1cdba35b68a7f0ccffc6dffc1995b18267",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": "^7.3|^8.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^v2.15.8",
"phpunit/phpunit": "^9.3.11",
"vimeo/psalm": "^3.17.1"
},
"type": "library",
"autoload": {
"psr-4": {
"Facade\\IgnitionContracts\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Freek Van der Herten",
"email": "freek@spatie.be",
"homepage": "https://flareapp.io",
"role": "Developer"
}
],
"description": "Solution contracts for Ignition",
"homepage": "https://github.com/facade/ignition-contracts",
"keywords": [
"contracts",
"flare",
"ignition"
],
"support": {
"issues": "https://github.com/facade/ignition-contracts/issues",
"source": "https://github.com/facade/ignition-contracts/tree/1.0.2"
},
"time": "2020-10-16T08:27:54+00:00"
},
{
"name": "fakerphp/faker",
"version": "v1.19.0",

View File

@ -1,75 +0,0 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| View Name
|--------------------------------------------------------------------------
|
| Choose a view to display when Breadcrumbs::render() is called.
| Built in templates are:
|
| - 'breadcrumbs::bootstrap5' - Bootstrap 5
| - 'breadcrumbs::bootstrap4' - Bootstrap 4
| - 'breadcrumbs::bulma' - Bulma
| - 'breadcrumbs::foundation6' - Foundation 6
| - 'breadcrumbs::json-ld' - JSON-LD Structured Data
| - 'breadcrumbs::materialize' - Materialize
| - 'breadcrumbs::tailwind' - Tailwind CSS
| - 'breadcrumbs::uikit' - UIkit
|
| Or a custom view, e.g. '_partials/breadcrumbs'.
|
*/
'view' => 'breadcrumbs::bootstrap5',
/*
|--------------------------------------------------------------------------
| Breadcrumbs File(s)
|--------------------------------------------------------------------------
|
| The file(s) where breadcrumbs are defined. e.g.
|
| - base_path('routes/breadcrumbs.php')
| - glob(base_path('breadcrumbs/*.php'))
|
*/
'files' => base_path('beike/Shop/Routes/breadcrumbs.php'),
/*
|--------------------------------------------------------------------------
| Exceptions
|--------------------------------------------------------------------------
|
| Determine when to throw an exception.
|
*/
// When route-bound breadcrumbs are used but the current route doesn't have a name (UnnamedRouteException)
'unnamed-route-exception' => true,
// When route-bound breadcrumbs are used and the matching breadcrumb doesn't exist (InvalidBreadcrumbException)
'missing-route-bound-breadcrumb-exception' => true,
// When a named breadcrumb is used but doesn't exist (InvalidBreadcrumbException)
'invalid-named-breadcrumb-exception' => true,
/*
|--------------------------------------------------------------------------
| Classes
|--------------------------------------------------------------------------
|
| Subclass the default classes for more advanced customisations.
|
*/
// Manager
'manager-class' => Diglactic\Breadcrumbs\Manager::class,
// Generator
'generator-class' => Diglactic\Breadcrumbs\Generator::class,
];

View File

@ -21,5 +21,9 @@ return [
'order' => [
'index' => 'Order List',
'order_completed' => 'Completed Order',
]
],
'addresses' => [
'index' => 'My Addresses'
],
];

View File

@ -0,0 +1,14 @@
<?php
/**
* account.php
*
* @copyright 2022 opencart.cn - All Rights Reserved
* @link http://www.guangdawangluo.com
* @author Edward Yang <yangjin@opencart.cn>
* @created 2022-08-04 10:59:15
* @modified 2022-08-04 10:59:15
*/
return [
'index' => 'Brand List',
];

View File

@ -0,0 +1,14 @@
<?php
/**
* common.php
*
* @copyright 2022 opencart.cn - All Rights Reserved
* @link http://www.guangdawangluo.com
* @author Edward Yang <yangjin@opencart.cn>
* @created 2022-08-17 23:10:20
* @modified 2022-08-17 23:10:20
*/
return [
'home' => 'Home'
];

View File

@ -0,0 +1,14 @@
<?php
/**
* products.php
*
* @copyright 2022 opencart.cn - All Rights Reserved
* @link http://www.guangdawangluo.com
* @author Edward Yang <yangjin@opencart.cn>
* @created 2022-08-18 08:31:03
* @modified 2022-08-18 08:31:03
*/
return [
'search' => 'Search',
];

View File

@ -42,5 +42,9 @@ return [
'order' => [
'index' => '订单列表',
'order_completed' => '已确认收货',
]
],
'addresses' => [
'index' => '我的地址'
],
];

View File

@ -0,0 +1,14 @@
<?php
/**
* common.php
*
* @copyright 2022 opencart.cn - All Rights Reserved
* @link http://www.guangdawangluo.com
* @author Edward Yang <yangjin@opencart.cn>
* @created 2022-08-17 23:10:20
* @modified 2022-08-17 23:10:20
*/
return [
'home' => '首页'
];

View File

@ -0,0 +1,14 @@
<?php
/**
* products.php
*
* @copyright 2022 opencart.cn - All Rights Reserved
* @link http://www.guangdawangluo.com
* @author Edward Yang <yangjin@opencart.cn>
* @created 2022-08-18 08:31:03
* @modified 2022-08-18 08:31:03
*/
return [
'search' => '搜索',
];

View File

@ -4,12 +4,8 @@
@section('content')
<div class="container">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">Library</li>
</ol>
</nav>
<x-shop-breadcrumb type="static" value="account.index" />
<div class="row">

View File

@ -10,12 +10,8 @@
@section('content')
<div class="container" id="address-app">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">Library</li>
</ol>
</nav>
<x-shop-breadcrumb type="static" value="account.addresses.index" />
<div class="row">
<x-shop-sidebar/>

View File

@ -4,12 +4,9 @@
@section('content')
<div class="container">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">Library</li>
</ol>
</nav>
<x-shop-breadcrumb type="static" value="account.order.index" />
{{-- {{ dd($orders) }} --}}

View File

@ -4,12 +4,7 @@
@section('content')
<div class="container">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">Library</li>
</ol>
</nav>
<x-shop-breadcrumb type="brand" :value="$brand" />
<div class="row">
@foreach ($products as $product)

View File

@ -4,7 +4,7 @@
@section('content')
<div class="container">
{{ Diglactic\Breadcrumbs\Breadcrumbs::render('category', $category) }}
<x-shop-breadcrumb type="category" :value="$category" />
<div class="row">
@foreach ($products as $product)

View File

@ -12,7 +12,7 @@
<span>修改个人信息</span></a>
<a class="list-group-item d-flex justify-content-between align-items-center" href="{{ shop_route('account.order.index') }}">
<span>我的订单</span></a>
<a class="list-group-item d-flex justify-content-between align-items-center" href="{{ shop_route('addresses.index') }}">
<a class="list-group-item d-flex justify-content-between align-items-center" href="{{ shop_route('account.addresses.index') }}">
<span>我的地址</span></a>
<a class="list-group-item d-flex justify-content-between align-items-center" href="{{ shop_route('account.wishlist.index') }}">
<span>我的收藏</span></a>

View File

@ -0,0 +1,15 @@
@unless ($breadcrumbs->isEmpty())
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
@foreach ($breadcrumbs as $breadcrumb)
@if (isset($breadcrumb['url']) && $breadcrumb['url'])
<li class="breadcrumb-item"><a href="{{ $breadcrumb['url'] }}">{{ $breadcrumb['title'] }}</a></li>
@else
<li class="breadcrumb-item active" aria-current="page">{{ $breadcrumb['title'] }}</li>
@endif
@endforeach
</ol>
</nav>
@endunless

View File

@ -6,6 +6,9 @@
@section('content')
<div class="container">
{!! $page['content'] !!}
<x-shop-breadcrumb type="page" :value="$page['id']" />
<div class="row">
{!! $page['content'] !!}
</div>
</div>
@endsection

View File

@ -12,7 +12,7 @@
@section('content')
<div class="container" id="product-app" v-cloak>
{{ Diglactic\Breadcrumbs\Breadcrumbs::render('product', $product) }}
<x-shop-breadcrumb type="product" :value="$product['id']" />
<div class="row mb-5" id="product-top">
<div class="col-12 col-lg-6 mb-3">

View File

@ -4,7 +4,7 @@
@section('content')
<div class="container">
{{-- {{ Diglactic\Breadcrumbs\Breadcrumbs::render('category', $category) }} --}}
<x-shop-breadcrumb type="static" value="products.search" />
<div class="row">
@foreach ($items as $product)