This commit is contained in:
pushuo 2022-08-05 16:49:41 +08:00
parent ff10ec9370
commit 0c74fc87eb
6 changed files with 23 additions and 15 deletions

View File

@ -12,6 +12,7 @@ use Beike\Admin\View\Components\Header;
use Beike\Admin\View\Components\Sidebar; use Beike\Admin\View\Components\Sidebar;
use Beike\Admin\View\Components\Form\Image; use Beike\Admin\View\Components\Form\Image;
use Beike\Admin\View\Components\Form\Input; use Beike\Admin\View\Components\Form\Input;
use Beike\Admin\View\Components\Form\Select;
use Beike\Console\Commands\MakeRootAdminUser; use Beike\Console\Commands\MakeRootAdminUser;
use Beike\Admin\View\Components\Form\InputLocale; use Beike\Admin\View\Components\Form\InputLocale;
use Beike\Admin\View\Components\Form\SwitchRadio; use Beike\Admin\View\Components\Form\SwitchRadio;
@ -46,6 +47,7 @@ class AdminServiceProvider extends ServiceProvider
'form-input-locale' => InputLocale::class, 'form-input-locale' => InputLocale::class,
'form-switch' => SwitchRadio::class, 'form-switch' => SwitchRadio::class,
'form-input' => Input::class, 'form-input' => Input::class,
'form-select' => Select::class,
'form-image' => Image::class, 'form-image' => Image::class,
]); ]);

View File

@ -1,5 +1,5 @@
<div class="row g-3 mb-3"> <div class="row g-3 mb-3">
<label for="" class="wp-200 col-form-label text-end">{{ $title ?? '' }}</label> <label for="" class="wp-200 col-form-label text-end opacity-75">{{ $title ?? '' }}</label>
<div class="col-auto wp-200-"> <div class="col-auto wp-200-">
{{ $slot }} {{ $slot }}
</div> </div>

View File

@ -1,10 +1,8 @@
<x-admin::form.row :title="$title"> <x-admin::form.row :title="$title">
{{-- <input type="text" name="{{ $name }}" class="form-control wp-400" value="{{ $value }}" placeholder="{{ $title }}"> --}} <select class="form-select wp-200 me-3" name="{{ $name }}">
<select class="form-select" aria-label="Default select example"> @foreach ($options as $option)
<option selected>Open this select menu</option> <option value="{{ $option['value'] }}" {{ $option['value'] == $value ? 'selected': '' }}>{{ $option['label'] }}</option>
<option value="1">One</option> @endforeach
<option value="2">Two</option>
<option value="3">Three</option>
</select> </select>
{{ $slot }} {{ $slot }}
</x-admin::form.row> </x-admin::form.row>

View File

@ -204,14 +204,14 @@
const ordersChart = new Chart(orders, { const ordersChart = new Chart(orders, {
type: 'line', type: 'line',
data: { data: {
labels: Array.from({length: 30}, (v, k) => k + 1), labels: {!! $order_trends['latest_month']->pluck('date') !!},
datasets: [{ datasets: [{
// label: ["订单数"], // label: ["订单数"],
fill: true, fill: true,
backgroundColor : gradient, // Put the gradient here as a fill color backgroundColor : gradient, // Put the gradient here as a fill color
borderColor : "#4da4f9", borderColor : "#4da4f9",
borderWidth: 2, borderWidth: 2,
data: Array.from({length: 30}, () => Math.floor(Math.random() * 23.7)), data: {!! $order_trends['latest_month']->pluck('total') !!},
// borderDash: [], // borderDash: [],
responsive: true, responsive: true,
lineTension: 0.4, lineTension: 0.4,

View File

@ -60,7 +60,7 @@
<div class="text-muted font-size-12 lh-base">管理后台目录,默认为admin</div> <div class="text-muted font-size-12 lh-base">管理后台目录,默认为admin</div>
</x-admin-form-input> </x-admin-form-input>
<x-admin::form.row title="模版主题"> {{-- <x-admin::form.row title="模版主题">
<select class="form-select wp-200 me-3" name="theme" aria-label="Default select example"> <select class="form-select wp-200 me-3" name="theme" aria-label="Default select example">
@foreach ($themes as $theme) @foreach ($themes as $theme)
<option <option
@ -71,13 +71,21 @@
@endforeach @endforeach
</select> </select>
<div class="text-muted font-size-12 lh-base">主题模板选择</div> <div class="text-muted font-size-12 lh-base">主题模板选择</div>
</x-admin::form.row> </x-admin::form.row> --}}
<x-admin-form-select title="模版主题" name="theme" :value="old('theme', system_setting('base.theme', 'default'))" :options="$themes">
<div class="text-muted font-size-12 lh-base">主题模板选择</div>
</x-admin-form-select>
<x-admin-form-switch name="tax" title="启用税费" value="{{ old('tax', system_setting('base.tax', '0')) }}"> <x-admin-form-switch name="tax" title="启用税费" value="{{ old('tax', system_setting('base.tax', '0')) }}">
<div class="text-muted font-size-12 lh-base">是否启用税费计算</div> <div class="text-muted font-size-12 lh-base">是否启用税费计算</div>
</x-admin-form-switch> </x-admin-form-switch>
<x-admin::form.row title="税费地址"> <x-admin-form-select title="税费地址" name="tax_address" :value="old('tax_address', system_setting('base.address', 'shipping'))" :options="$tax_address">
<div class="text-muted font-size-12 lh-base">按什么地址计算税费</div>
</x-admin-form-select>
{{-- <x-admin::form.row title="税费地址">
<select class="form-select wp-200 me-3" name="tax_address" aria-label="Default select example"> <select class="form-select wp-200 me-3" name="tax_address" aria-label="Default select example">
@foreach ($tax_address as $address) @foreach ($tax_address as $address)
<option <option
@ -88,7 +96,7 @@
@endforeach @endforeach
</select> </select>
<div class="text-muted font-size-12 lh-base">按什么地址计算税费</div> <div class="text-muted font-size-12 lh-base">按什么地址计算税费</div>
</x-admin::form.row> </x-admin::form.row> --}}
<x-admin::form.row title=""> <x-admin::form.row title="">
<button type="submit" class="btn btn-primary mt-4">提交</button> <button type="submit" class="btn btn-primary mt-4">提交</button>

View File

@ -7,14 +7,14 @@
aria-expanded="false"> aria-expanded="false">
@foreach (currencies() as $currency) @foreach (currencies() as $currency)
@if ($currency->code == current_currency_code()) @if ($currency->code == current_currency_code())
{{ $currency->name }} {{ $currency->symbol_left }} {{ $currency->name }}
@endif @endif
@endforeach @endforeach
</a> </a>
<div class="dropdown-menu" aria-labelledby="currency-dropdown"> <div class="dropdown-menu" aria-labelledby="currency-dropdown">
@foreach (currencies() as $currency) @foreach (currencies() as $currency)
<a class="dropdown-item" href="{{ shop_route('currency.switch', [$currency->code]) }}">{{ $currency->name }}</a> <a class="dropdown-item" href="{{ shop_route('currency.switch', [$currency->code]) }}">{{ $currency->symbol_left }} {{ $currency->name }}</a>
@endforeach @endforeach
</div> </div>
</div> </div>