diff --git a/beike/Admin/Http/Controllers/CustomerController.php b/beike/Admin/Http/Controllers/CustomerController.php index 1419d132..4f6e3cfc 100644 --- a/beike/Admin/Http/Controllers/CustomerController.php +++ b/beike/Admin/Http/Controllers/CustomerController.php @@ -28,6 +28,7 @@ class CustomerController extends Controller $data = [ 'customers' => CustomerResource::collection($customers), + 'customer_groups' => CustomerGroupRepo::list(), ]; return view('admin::pages.customers.index', $data); diff --git a/beike/Shop/Services/CheckoutService.php b/beike/Shop/Services/CheckoutService.php index 48809add..8087cc53 100644 --- a/beike/Shop/Services/CheckoutService.php +++ b/beike/Shop/Services/CheckoutService.php @@ -13,6 +13,7 @@ namespace Beike\Shop\Services; use Beike\Repositories\AddressRepo; use Beike\Repositories\SettingRepo; +use Beike\Repositories\CountryRepo; class CheckoutService { @@ -30,6 +31,9 @@ class CheckoutService $data = [ 'addresses' => $addresses, 'shipments' => $shipments, + 'country_id' => setting('country_id'), + 'customer_id' => $customer->id, + 'countries' => CountryRepo::all(), 'payments' => $payments, 'carts' => $carts ]; diff --git a/public/build/beike/admin/css/app.css b/public/build/beike/admin/css/app.css index 7fd239e8..c37d1add 100644 --- a/public/build/beike/admin/css/app.css +++ b/public/build/beike/admin/css/app.css @@ -437,3 +437,7 @@ table.table.table-striped > tbody > tr:nth-of-type(2n) { .el-tabs__header { margin-bottom: 25px; } + +.el-tabs__item { + padding: 0 10px; +} diff --git a/public/build/beike/shop/default/css/app.css b/public/build/beike/shop/default/css/app.css index b06f6768..9867aa0b 100644 --- a/public/build/beike/shop/default/css/app.css +++ b/public/build/beike/shop/default/css/app.css @@ -469,7 +469,7 @@ body.page-cart .total-wrap .list-group li .total-price { font-weight: bold; } -body.page-checkout h4.title { +body.page-checkout .module-title { border-bottom: 1px solid #e5e5e5; padding-bottom: 16px; margin-bottom: 16px; @@ -551,10 +551,10 @@ body.page-checkout .addresses-wrap { } body.page-checkout .addresses-wrap .item { position: relative; - padding: 20px 20px 30px; + padding: 10px 20px; margin-bottom: 10px; border: 1px solid #e8e8e8; - height: 155px; + height: 125px; cursor: pointer; } body.page-checkout .addresses-wrap .item.add-addres { @@ -586,6 +586,7 @@ body.page-checkout .addresses-wrap .item.active:before { } body.page-checkout .addresses-wrap .item .name-wrap { margin-bottom: 0.5rem; + line-height: 1; } body.page-checkout .addresses-wrap .item .name-wrap .name { font-size: 1rem; @@ -596,10 +597,15 @@ body.page-checkout .addresses-wrap .item .name-wrap .phone { color: #666; } body.page-checkout .addresses-wrap .item .zipcode { - margin-bottom: 0.5rem; + margin-bottom: 0.1rem; } body.page-checkout .addresses-wrap .item .address-info { - margin-bottom: 0.5rem; + margin-bottom: 0.9rem; +} +body.page-checkout .addresses-wrap .item .address-bottom { + display: flex; + align-items: center; + justify-content: space-between; } body.page-checkout .addresses-wrap .item .address-bottom a { color: #2d68a8; diff --git a/resources/beike/admin/css/element-ui.scss b/resources/beike/admin/css/element-ui.scss index 4e76a071..4e33fef1 100644 --- a/resources/beike/admin/css/element-ui.scss +++ b/resources/beike/admin/css/element-ui.scss @@ -10,4 +10,8 @@ .el-tabs__header { margin-bottom: 25px; +} + +.el-tabs__item { + padding: 0 10px; } \ No newline at end of file diff --git a/resources/beike/admin/views/pages/categories/form-vue.blade.php b/resources/beike/admin/views/pages/categories/form-vue.blade.php index 9289f6a9..4dea984b 100644 --- a/resources/beike/admin/views/pages/categories/form-vue.blade.php +++ b/resources/beike/admin/views/pages/categories/form-vue.blade.php @@ -3,64 +3,64 @@ @section('title', '分类管理') @push('header') - + @endpush @section('content') -
- -
- 编辑分类 -
+
+ +
+ 编辑分类 +
- + - -
- @foreach (locales() as $locale) - - - - @endforeach -
-
+ +
+ @foreach (locales() as $locale) + + + + @endforeach +
+
- -
- @foreach (locales() as $locale) - - - - @endforeach -
-
+ +
+ @foreach (locales() as $locale) + + + + @endforeach +
+
- - - @foreach ($categories as $_category) - - @endforeach - - + + + @foreach ($categories as $_category) + + @endforeach + + - - - 启用 - 禁用 - - + + + 启用 + 禁用 + + - - 立即创建 - 取消 - -
-
-
+ + 立即创建 + 取消 + + +
+
@endsection @push('footer') - + @endpush diff --git a/resources/beike/admin/views/pages/categories/form.blade.php b/resources/beike/admin/views/pages/categories/form.blade.php index ce045039..0578042c 100644 --- a/resources/beike/admin/views/pages/categories/form.blade.php +++ b/resources/beike/admin/views/pages/categories/form.blade.php @@ -3,52 +3,52 @@ @section('title', '分类管理') @section('content') -
-
- 编辑分类 -
-
-
- @csrf - @method($category->id ? 'PUT' : 'POST') - - - @foreach (locales() as $index => $locale) - {{-- --}} - @endforeach - - - - - - @php - $_parent_id = old('parent_id', $category->parent_id ?? 0); - @endphp - - - - - - - - 返回 - - - -
+
+
+ 编辑分类
+
+
+ @csrf + @method($category->id ? 'PUT' : 'POST') + + + @foreach (locales() as $index => $locale) + {{-- --}} + @endforeach + + + + + + @php + $_parent_id = old('parent_id', $category->parent_id ?? 0); + @endphp + + + + + + + + 返回 + + + +
+
@endsection @push('footer') - + @endpush diff --git a/resources/beike/admin/views/pages/categories/index.blade.php b/resources/beike/admin/views/pages/categories/index.blade.php index f2f82d10..c5139e33 100644 --- a/resources/beike/admin/views/pages/categories/index.blade.php +++ b/resources/beike/admin/views/pages/categories/index.blade.php @@ -3,37 +3,37 @@ @section('title', '分类管理') @push('header') - + @endpush @section('content') -
-
- 创建分类 -
- -
- @{{ data.name }} -
- @{{ data.active ? '启用' : '禁用' }} -
- 编辑 - 删除 -
-
-
+
+
+ 创建分类 +
+ +
+ @{{ data.name }} +
+ @{{ data.active ? '启用' : '禁用' }} + -
+
+ +
+
@endsection @push('footer') - + @endpush diff --git a/resources/beike/admin/views/pages/currencies/form.blade.php b/resources/beike/admin/views/pages/currencies/form.blade.php index b4778488..c391d846 100644 --- a/resources/beike/admin/views/pages/currencies/form.blade.php +++ b/resources/beike/admin/views/pages/currencies/form.blade.php @@ -5,73 +5,76 @@ @section('content')
-
- @csrf + + @csrf -
- - - @error('name') - - @enderror -
+
+ + + @error('name') + + @enderror +
-
- - - @error('code') - - @enderror -
+
+ + + @error('code') + + @enderror +
-
- - - @error('symbol_left') - - @enderror -
+
+ + + @error('symbol_left') + + @enderror +
-
- - - @error('symbol_right') - - @enderror -
+
+ + + @error('symbol_right') + + @enderror +
-
- - - @error('decimal_place') - - @enderror -
+
+ + + @error('decimal_place') + + @enderror +
-
- - - @error('value') - - @enderror -
+
+ + + @error('value') + + @enderror +
-
- - - @error('status') - - @enderror -
+
+ + + @error('status') + + @enderror +
- @if (session('error')) -
- {{ session('error') }} -
- @endif + @if (session('error')) +
+ {{ session('error') }} +
+ @endif - -
+ +
@endsection diff --git a/resources/beike/admin/views/pages/currencies/index.blade.php b/resources/beike/admin/views/pages/currencies/index.blade.php index c168da9d..126b050e 100644 --- a/resources/beike/admin/views/pages/currencies/index.blade.php +++ b/resources/beike/admin/views/pages/currencies/index.blade.php @@ -3,43 +3,44 @@ @section('title', '货币管理') @section('content') -
-
-
- 创建 -
- - - - - - - - - - - - - - - - @foreach ($currencies as $currency) - - - - - - - - - - - - @endforeach - -
#名称编码货币左符号货币右符号小数位数汇率值状态操作
{{ $currency['id'] }}{{ $currency['name'] }}{{ $currency['code'] }}{{ $currency['symbol_left'] }}{{ $currency['symbol_right'] }}{{ $currency['decimal_place'] }}{{ $currency['value'] }}{{ $currency['status'] }} - 编辑 -
-
+
+
+
+ 创建 +
+ + + + + + + + + + + + + + + + @foreach ($currencies as $currency) + + + + + + + + + + + + @endforeach + +
#名称编码货币左符号货币右符号小数位数汇率值状态操作
{{ $currency['id'] }}{{ $currency['name'] }}{{ $currency['code'] }}{{ $currency['symbol_left'] }}{{ $currency['symbol_right'] }}{{ $currency['decimal_place'] }}{{ $currency['value'] }}{{ $currency['status'] }} + 编辑 +
+
@endsection diff --git a/resources/beike/admin/views/pages/customers/form.blade.php b/resources/beike/admin/views/pages/customers/form.blade.php index 6c6262fa..1dd22676 100644 --- a/resources/beike/admin/views/pages/customers/form.blade.php +++ b/resources/beike/admin/views/pages/customers/form.blade.php @@ -54,14 +54,17 @@ 222 222 - - + + - 当前账号无地址 新增地址 + 当前账号无地址 + 新增地址 @@ -70,7 +73,8 @@
- + @@ -163,20 +167,44 @@ }, rules: { - name: [{required: true, message: '请输入用户名', trigger: 'blur'}, ], + name: [{ + required: true, + message: '请输入用户名', + trigger: 'blur' + }, ], }, addressRules: { - name: [{required: true, message: '请输入姓名', trigger: 'blur'}, ], - phone: [{required: true, message: '请输入联系电话', trigger: 'blur'}, ], - address_1: [{required: true, message: '请输入详细地址 1', trigger: 'blur'}, ], - zone_id: [{required: true, message: '请选择省份', trigger: 'blur'}, ], - city_id: [{required: true, message: '请填写 city', trigger: 'blur'}, ], + name: [{ + required: true, + message: '请输入姓名', + trigger: 'blur' + }, ], + phone: [{ + required: true, + message: '请输入联系电话', + trigger: 'blur' + }, ], + address_1: [{ + required: true, + message: '请输入详细地址 1', + trigger: 'blur' + }, ], + zone_id: [{ + required: true, + message: '请选择省份', + trigger: 'blur' + }, ], + city_id: [{ + required: true, + message: '请填写 city', + trigger: 'blur' + }, ], } }, // 在挂载开始之前被调用:相关的 render 函数首次被调用 - beforeMount () { + beforeMount() { this.countryChange(this.dialogAddress.form.country_id); }, @@ -190,12 +218,12 @@ return; } - $.ajax({ - url: `/admin/countries/${e}/zones`, - type: 'get', + url: `/admin/customers/{{ $customer['id'] }}`, + type: 'put', + data: self.form, success: function(res) { - this.$message.success('提交成功'); + self.$message.success(res.message); } }) }); diff --git a/resources/beike/admin/views/pages/customers/index.blade.php b/resources/beike/admin/views/pages/customers/index.blade.php index f74f7424..8f3bc0c8 100644 --- a/resources/beike/admin/views/pages/customers/index.blade.php +++ b/resources/beike/admin/views/pages/customers/index.blade.php @@ -3,42 +3,144 @@ @section('title', '顾客管理') @section('content') -
-
- - - - - - - - - - - - - - @foreach ($customers as $customer) - - - - - - - - - @endforeach - -
#邮箱名称注册来源状态操作
{{ $customer['id'] }}{{ $customer['email'] }} -
- -
{{ $customer['name'] }}
-
-
{{ $customer['from'] }}{{ $customer['status'] }} - 编辑 -
-
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + +
#邮箱名称注册来源客户组状态操作
@{{ customer.id }}@{{ customer.email }} +
+ {{-- --}} +
@{{ customer.name }}
+
+
@{{ customer.from }}@{{ customer.customer_group_name }} + @{{ customer.status ? '启用' : '禁用' }} + + 编辑 + +
-@endsection \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + 保存 + 取消 + + + +
+@endsection + +@push('footer') + +@endpush diff --git a/resources/beike/admin/views/pages/home.blade.php b/resources/beike/admin/views/pages/home.blade.php index 4d4c5474..f8bebe17 100644 --- a/resources/beike/admin/views/pages/home.blade.php +++ b/resources/beike/admin/views/pages/home.blade.php @@ -3,13 +3,13 @@ @section('title', '后台管理') @section('content') - {{-- Products --}} - @for ($i = 0; $i < 10; $i++) -
-
订单统计
-
-
11
-
-
- @endfor + {{-- Products --}} + @for ($i = 0; $i < 10; $i++) +
+
订单统计
+
+
11
+
+
+ @endfor @endsection diff --git a/resources/beike/admin/views/pages/products/form/form.blade.php b/resources/beike/admin/views/pages/products/form/form.blade.php index 3d8779da..721e66df 100644 --- a/resources/beike/admin/views/pages/products/form/form.blade.php +++ b/resources/beike/admin/views/pages/products/form/form.blade.php @@ -1,145 +1,141 @@ @extends('admin::layouts.master') @push('header') - + @endpush @section('content') -
-
-

product

-
- @csrf - @method($product->id ? 'PUT' : 'POST') - +
+
+

product

+ + @csrf + @method($product->id ? 'PUT' : 'POST') + - @foreach (locales() as $index => $locale) - {{-- --}} - @endforeach + @foreach (locales() as $index => $locale) + {{-- --}} + @endforeach - - - - - + + + + + - - @foreach ($source['categories'] as $_category) -
- id, $category_ids) ? 'checked' : '' }}> - -
- @endforeach -
+ + @foreach ($source['categories'] as $_category) +
+ id, $category_ids) ? 'checked' : '' }}> + +
+ @endforeach +
+
+

skus

+ 单规格 + 多规格 +
+
+
-

skus

- 单规格 - 多规格 -
-
-
-
- + -
- -
- -
-
- - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - -
- @{{ variant.name || 'No name' }} - imagemodelskupriceorgin pricecost pricequantity
- - - - -
-
-
- -
-
- - - - - - - - - - -
-
+
+ +
+
+
- - + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ @{{ variant.name || 'No name' }} + imagemodelskupriceorgin pricecost pricequantity
+ + + + + +
+
+
+ +
+
+ + + + + + + + + + +
+
+ + +
+
@endsection @push('footer') - + @endpush diff --git a/resources/beike/admin/views/pages/products/index.blade.php b/resources/beike/admin/views/pages/products/index.blade.php index 0d0410e7..59f778d6 100644 --- a/resources/beike/admin/views/pages/products/index.blade.php +++ b/resources/beike/admin/views/pages/products/index.blade.php @@ -3,140 +3,134 @@ @section('title', '商品管理') @push('header') - - + + @endpush @section('content') -
-
-
+
+
+
-
-
-
- - -
-
- - -
- -
- - -
- -
- - -
-
- -
- -
- - -
-
-
- -
- - - - -
- - - - -
-
- - - -

无商品

+
+
+
+ +
+
+ + +
+ +
+ + +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ + + + +
+ + + + +
+
+ + + +

无商品

+
+
@endsection @push('footer') - + @endpush diff --git a/resources/beike/shop/default/css/page-checkout.scss b/resources/beike/shop/default/css/page-checkout.scss index 74d4add7..39d32551 100644 --- a/resources/beike/shop/default/css/page-checkout.scss +++ b/resources/beike/shop/default/css/page-checkout.scss @@ -1,7 +1,7 @@ @charset "UTF-8"; body.page-checkout { - h4.title { + .module-title { border-bottom: 1px solid #e5e5e5; padding-bottom: 16px; margin-bottom: 16px; @@ -99,10 +99,10 @@ body.page-checkout { .item { position: relative; - padding: 20px 20px 30px; + padding: 10px 20px; margin-bottom: 10px; border: 1px solid #e8e8e8; - height: 155px; + height: 125px; cursor: pointer; &.add-addres { @@ -140,6 +140,7 @@ body.page-checkout { .name-wrap { margin-bottom: .5rem; + line-height: 1; .name { font-size: 1rem; @@ -153,14 +154,18 @@ body.page-checkout { } .zipcode { - margin-bottom: .5rem; + margin-bottom: .1rem; } .address-info { - margin-bottom: .5rem; + margin-bottom: .9rem; } .address-bottom { + display: flex; + align-items: center; // flex-start | center + justify-content: space-between; // flex-end | center | space-between + // flex-wrap: wrap; a { color: #2d68a8; } diff --git a/themes/default/checkout.blade.php b/themes/default/checkout.blade.php index c3ccdc32..5bb0392b 100644 --- a/themes/default/checkout.blade.php +++ b/themes/default/checkout.blade.php @@ -25,97 +25,7 @@
-

地址

-{{--
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
--}} - -{{-- - - - - - - - - - - - - - - - - - - - - - - - -
#名称电话注册来源状态操作
@{{ index }}@{{ address.name }}@{{ address.phone }}222222 - - -
- 当前账号无地址 新增地址 -
--}} - +

地址

@@ -127,17 +37,18 @@
@{{ address.zipcode }}
@{{ address.country_id }} @{{ address.zone_id }}
- 编辑 + 已选择 + 编辑
-
添加新地址
+
添加新地址
-

支付方式

+

支付方式

@@ -148,7 +59,7 @@
-

配送方式

+

配送方式

@@ -166,31 +77,80 @@
CART TOTALS
- @for ($i = 0; $i < 4; $i++) -
+
- +
- Camera Canon EOS M50 Kit - x2 + + x @{{ cart.quantity }}
-
$1156.00
+
- @endfor
    -
  • 总数1120
  • -
  • 运费20
  • -
  • 总价2220
  • +
  • 总数
  • +
  • 运费
  • +
  • 总价
- +
+ + + + + + + + + + +
+
+ + + + + + +
+
+ + + + + + +
+
+ + + +
+
+
+ + + + + + + + + + + 保存 + 取消 + +
+
@endsection @push('add-scripts') @@ -205,6 +165,9 @@ source: { addresses: @json($addresses ?? []), + countries: @json($countries ?? []), + carts: @json($carts ?? null), + zones: [] }, dialogAddress: { @@ -221,6 +184,14 @@ address_2: '', } }, + + addressRules: { + name: [{required: true, message: '请输入姓名', trigger: 'blur'}, ], + phone: [{required: true, message: '请输入联系电话', trigger: 'blur'}, ], + address_1: [{required: true, message: '请输入详细地址 1', trigger: 'blur'}, ], + zone_id: [{required: true, message: '请选择省份', trigger: 'blur'}, ], + city_id: [{required: true, message: '请填写 city', trigger: 'blur'}, ], + } }, beforeMount () { @@ -232,12 +203,64 @@ this.dialogAddress.index = index; this.$nextTick(() => { - this.dialogAddress.form = JSON.parse(JSON.stringify(this.form.address[index])) + this.dialogAddress.form = JSON.parse(JSON.stringify(this.source.addresses[index])) }) } this.dialogAddress.show = true }, + + addressFormSubmit(form) { + const self = this; + + this.$refs[form].validate((valid) => { + if (!valid) { + this.$message.error('请检查表单是否填写正确'); + return; + } + + const type = this.dialogAddress.form.id ? 'put' : 'post'; + + $.ajax({ + url: `/admin/customers/{{ $customer_id }}/addresses${type == 'put' ? '/' + this.dialogAddress.form.id : ''}`, + data: self.dialogAddress.form, + type: type, + success: function(res) { + if (type == 'post') { + self.source.addresses.push(res.data) + } else { + self.source.addresses[self.dialogAddress.index] = res.data + } + self.$message.success(res.message); + self.$refs[form].resetFields(); + self.dialogAddress.show = false + self.dialogAddress.index = null; + } + }) + }); + }, + + closeAddressDialog(form) { + this.$refs[form].resetFields(); + this.dialogAddress.show = false + this.dialogAddress.index = null; + }, + + countryChange(e) { + const self = this; + + $.ajax({ + url: `/admin/countries/${e}/zones`, + type: 'get', + success: function(res) { + self.source.zones = res.data.zones; + } + }) + }, + + checkedBtnCheckoutConfirm() { + console.log(1) + } } })