diff --git a/beike/Admin/View/Components/Form/Input.php b/beike/Admin/View/Components/Form/Input.php index 781000dd..720de18c 100644 --- a/beike/Admin/View/Components/Form/Input.php +++ b/beike/Admin/View/Components/Form/Input.php @@ -9,16 +9,16 @@ class Input extends Component public string $name; public string $title; public string $value; - public string $class; + public string $error; public string $width; public bool $required; - public function __construct(string $name, string $title, ?string $value, bool $required = false, ?string $class = '', ?string $width = '400') + public function __construct(string $name, string $title, ?string $value, bool $required = false, ?string $error = '', ?string $width = '400') { $this->name = $name; $this->title = $title; $this->value = $value; - $this->class = $class; + $this->error = $error; $this->width = $width; $this->required = $required; } diff --git a/beike/Shop/Http/Controllers/Account/RmaController.php b/beike/Shop/Http/Controllers/Account/RmaController.php index 667cd35a..5f943c5c 100644 --- a/beike/Shop/Http/Controllers/Account/RmaController.php +++ b/beike/Shop/Http/Controllers/Account/RmaController.php @@ -9,14 +9,16 @@ * @modified 2022-08-03 21:17:04 */ -namespace Beike\Shop\Http\Controllers; +namespace Beike\Shop\Http\Controllers\Account; +use App\Http\Controllers\Controller; use Beike\Repositories\RmaRepo; use Beike\Shop\Http\Requests\RmaRequest; use Beike\Shop\Services\RmaService; use Illuminate\Contracts\Foundation\Application; use Illuminate\Contracts\View\Factory; use Illuminate\Contracts\View\View; +use Beike\Repositories\OrderProductRepo; class RmaController extends Controller { @@ -47,11 +49,12 @@ class RmaController extends Controller public function create(int $orderProductId) { $data = [ - 'orderProductId' => $orderProductId, + 'orderProduct' => OrderProductRepo::find($orderProductId), 'statuses' => RmaRepo::getStatuses(), 'types' => RmaRepo::getTypes(), ]; - return view('rms/form', $data); + + return view('account/rmas/form', $data); } public function store(RmaRequest $request): array diff --git a/beike/Shop/Routes/shop.php b/beike/Shop/Routes/shop.php index cc35cd84..9d0f4cd4 100644 --- a/beike/Shop/Routes/shop.php +++ b/beike/Shop/Routes/shop.php @@ -83,7 +83,12 @@ Route::prefix('/') Route::get('/', [AccountController::class, 'index'])->name('account.index'); Route::resource('addresses', AddressController::class); Route::get('edit', [EditController::class, 'index'])->name('account.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::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'); diff --git a/resources/beike/admin/views/components/form/input.blade.php b/resources/beike/admin/views/components/form/input.blade.php index 37142bcb..08a912ea 100644 --- a/resources/beike/admin/views/components/form/input.blade.php +++ b/resources/beike/admin/views/components/form/input.blade.php @@ -1,7 +1,7 @@ - - @if ($errors->has($name)) - {{ $errors->first($name) }} + + @if ($error) + {{ $error }} @endif {{ $slot }} diff --git a/resources/beike/admin/views/pages/pages/form.blade.php b/resources/beike/admin/views/pages/pages/form.blade.php index f08412b2..95f975bc 100644 --- a/resources/beike/admin/views/pages/pages/form.blade.php +++ b/resources/beike/admin/views/pages/pages/form.blade.php @@ -24,7 +24,16 @@
@foreach ($admin_languages as $language)
- + {{ $errors->first("descriptions.{$language['code']}.title") }} + first("descriptions.{$language['code']}.title") : ''" --}} + error="bbhjhhjg" + {{-- error="{{ $errors->first("descriptions.{$language['code']}.title") }}" --}} + name="descriptions[{{ $language['code'] }}][title]" + title="信息标题" + value="{{ old('title', $descriptions[$language['code']]['title'] ?? '') }}" + /> +
+
+ +
+ +
+
+ +
+ + + + +@endsection + +@push('add-scripts') + +@endpush diff --git a/themes/default/account/rmas/info.blade.php b/themes/default/account/rmas/info.blade.php deleted file mode 100644 index 06e55476..00000000 --- a/themes/default/account/rmas/info.blade.php +++ /dev/null @@ -1 +0,0 @@ -info \ No newline at end of file