!109 Add front hook

* Add front hook
This commit is contained in:
pushuo 2023-05-27 01:03:24 +00:00 committed by Edward Yang
parent 78ed309eec
commit 68f91b589f
5 changed files with 20 additions and 12 deletions

View File

@ -114,6 +114,7 @@
</div>
</div>
@hook('carts.footer')
@endsection
@push('add-scripts')
@ -126,15 +127,13 @@
amount: @json($data['amount']),
amount_format: @json($data['amount_format']),
},
// components: {},
// 计算属性
computed: {
allSelected: {
get() {
return !this.products.length ? false : this.products.every(s => s.selected)
},
set(val) {
// return
this.products.map(e => e.selected = val)
this.selectedBtnSelected()
}
@ -144,9 +143,7 @@
return this.products.map(e => e.quantity).reduce((n,m) => n + m);
},
},
// 侦听器
watch: {},
// 组件方法
methods: {
checkedBtnToCheckout() {
if (!this.products.some(e => e.selected)) {
@ -173,7 +170,6 @@
},
checkedCartTr(index) {
// this.products[index].selected = !this.products[index].selected;
this.selectedBtnSelected();
},
@ -193,9 +189,6 @@
bk.getCarts()
}
},
// 实例被挂载后调用
mounted () {
},
})
</script>
@endpush

View File

@ -21,6 +21,8 @@
<div class="col-12 col-md-8 left-column">
<div class="card shadow-sm">
<div class="card-body p-lg-4">
@hook('checkout.body.header')
@include('checkout._address')
<div class="checkout-black">
@ -61,6 +63,8 @@
@endforeach
</div>
</div>
@hook('checkout.body.footer')
</div>
</div>
</div>
@ -84,6 +88,8 @@
<span class="rounded-circle bg-primary">{{ $carts['quantity'] }}</span>
</div>
<div class="card-body">
@hook('checkout.total.header')
<div class="products-wrap">
@foreach ($carts['carts'] as $cart)
<div class="item">
@ -113,13 +119,17 @@
<div class="d-grid gap-2 mt-3">
<button class="btn btn-primary fw-bold fs-5" type="button" id="submit-checkout">{{ __('shop/checkout.submit_order') }}</button>
</div>
@hook('checkout.total.footer')
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@hook('checkout.footer')
@endsection
@push('add-scripts')
<script>

View File

@ -34,6 +34,8 @@
{!! $payment !!}
</div>
</div>
@hook('payment.footer')
</div>
</div>
</div>

View File

@ -93,6 +93,8 @@
</div>
</div>
</div>
@hook('checkout.success.footer')
</div>
</div>
</div>
@ -102,5 +104,4 @@
background-color: #f5f5f5;
}
</style>
@endsection

View File

@ -223,6 +223,8 @@
</div>
</div>
@endif
@hook('product.detail.footer')
@endsection
@push('add-scripts')