wip
This commit is contained in:
parent
6053e67915
commit
67be2fd9fa
|
|
@ -2254,6 +2254,7 @@ $(function () {
|
||||||
|
|
||||||
$(document).on('click', '.quantity-wrap .right i', function (event) {
|
$(document).on('click', '.quantity-wrap .right i', function (event) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
event.preventDefault();
|
||||||
var input = $(this).parent().siblings('input');
|
var input = $(this).parent().siblings('input');
|
||||||
|
|
||||||
if ($(this).hasClass('bi-chevron-up')) {
|
if ($(this).hasClass('bi-chevron-up')) {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,11 @@
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
|
|
||||||
@dump($errors)
|
{{-- @dump($errors) --}}
|
||||||
|
|
||||||
|
{{-- @if (session('success'))
|
||||||
|
<x-admin-alert type="success" msg="{{ session('success') }}" class="mt-4" />
|
||||||
|
@endif --}}
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body h-min-600">
|
<div class="card-body h-min-600">
|
||||||
|
|
@ -24,21 +28,24 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@foreach ($pages_format as $page)
|
@foreach ($pages_format as $page)
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ $page['id'] }}</td>
|
<td>{{ $page['id'] }}</td>
|
||||||
<td><div title="{{ $page['title'] ?? '' }}">{{ $page['title_format'] ?? '' }}</div></td>
|
<td>
|
||||||
<td>{{ $page['active'] }}</td>
|
<div title="{{ $page['title'] ?? '' }}">{{ $page['title_format'] ?? '' }}</div>
|
||||||
<td>{{ $page['created_at'] }}</td>
|
</td>
|
||||||
<td>{{ $page['updated_at'] }}</td>
|
<td>{{ $page['active'] }}</td>
|
||||||
<td class="text-end">
|
<td>{{ $page['created_at'] }}</td>
|
||||||
<a href="{{ admin_route('pages.edit', [$page['id']]) }}" class="btn btn-outline-secondary btn-sm">编辑</a>
|
<td>{{ $page['updated_at'] }}</td>
|
||||||
{{-- <form action="{{ admin_route('pages.destroy', [$page['id']]) }}" method="post" class="d-inline-block">
|
<td class="text-end">
|
||||||
|
<a href="{{ admin_route('pages.edit', [$page['id']]) }}" class="btn btn-outline-secondary btn-sm">编辑</a>
|
||||||
|
{{-- <form action="{{ admin_route('pages.destroy', [$page['id']]) }}" method="post" class="d-inline-block">
|
||||||
{{ method_field('delete') }}
|
{{ method_field('delete') }}
|
||||||
{{ csrf_field() }}
|
{{ csrf_field() }}
|
||||||
</form> --}}
|
</form> --}}
|
||||||
<button class="btn btn-outline-danger btn-sm delete-btn" type='button' data-id="{{ $page['id'] }}">删除</button>
|
<button class="btn btn-outline-danger btn-sm delete-btn" type='button'
|
||||||
</td>
|
data-id="{{ $page['id'] }}">删除</button>
|
||||||
</tr>
|
</td>
|
||||||
|
</tr>
|
||||||
@endforeach
|
@endforeach
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
@ -60,7 +67,7 @@
|
||||||
btn: ['取消', '确定'],
|
btn: ['取消', '确定'],
|
||||||
area: ['400px'],
|
area: ['400px'],
|
||||||
btn2: () => {
|
btn2: () => {
|
||||||
$http.delete(`pages/${id}`).then((res) => {
|
$http.delete(`pages/${id}`).then((res) => {
|
||||||
layer.msg(res.message);
|
layer.msg(res.message);
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
$(document).on('click', '.quantity-wrap .right i', function(event) {
|
$(document).on('click', '.quantity-wrap .right i', function(event) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
let input = $(this).parent().siblings('input')
|
let input = $(this).parent().siblings('input')
|
||||||
|
|
||||||
if ($(this).hasClass('bi-chevron-up')) {
|
if ($(this).hasClass('bi-chevron-up')) {
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
<div class="col-12 col-md-9">@include('shared.steps', ['steps' => 1])</div>
|
<div class="col-12 col-md-9">@include('shared.steps', ['steps' => 1])</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@dump($errors)
|
{{-- @dump($errors) --}}
|
||||||
|
|
||||||
<div class="row mt-5" v-if="products.length">
|
<div class="row mt-5" v-if="products.length">
|
||||||
<div class="col-12 col-md-9">
|
<div class="col-12 col-md-9">
|
||||||
|
|
@ -38,11 +38,10 @@
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="product, index in products" :key="index" @click="checkedCartTr(index)"
|
<tr v-for="product, index in products" :key="index" :class="product.selected ? 'active' : ''">
|
||||||
:class="product.selected ? 'active' : ''">
|
|
||||||
<td>
|
<td>
|
||||||
<div class="d-flex align-items-center p-image">
|
<div class="d-flex align-items-center p-image">
|
||||||
<input class="form-check-input" type="checkbox" v-model="product.selected">
|
<input class="form-check-input" type="checkbox" @change="checkedCartTr(index)" v-model="product.selected">
|
||||||
<img :src="product.image" class="img-fluid">
|
<img :src="product.image" class="img-fluid">
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
@ -144,7 +143,7 @@
|
||||||
|
|
||||||
quantityChange(quantity, cart_id) {
|
quantityChange(quantity, cart_id) {
|
||||||
const self = this;
|
const self = this;
|
||||||
$http.put(`/carts/${cart_id}`, {quantity: quantity}).then((res) => {
|
$http.put(`/carts/${cart_id}`, {quantity: quantity}, {hload: true}).then((res) => {
|
||||||
this.setUpdateData(res);
|
this.setUpdateData(res);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
@ -158,7 +157,7 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
checkedCartTr(index) {
|
checkedCartTr(index) {
|
||||||
this.products[index].selected = !this.products[index].selected;
|
// this.products[index].selected = !this.products[index].selected;
|
||||||
this.selectedBtnSelected();
|
this.selectedBtnSelected();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -166,7 +165,7 @@
|
||||||
const self = this;
|
const self = this;
|
||||||
const cart_ids = this.products.filter(e => e.selected).map(x => x.cart_id)
|
const cart_ids = this.products.filter(e => e.selected).map(x => x.cart_id)
|
||||||
|
|
||||||
$http.post(`/carts/select`, {cart_ids: cart_ids}).then((res) => {
|
$http.post(`/carts/select`, {cart_ids: cart_ids}, {hload: true}).then((res) => {
|
||||||
this.setUpdateData(res);
|
this.setUpdateData(res);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue