wish-list.blade.php 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. @extends('views.layouts.master')
  2. @section('content')
  3. <!--=====================================
  4. BANNER PART START
  5. =======================================-->
  6. <section class="inner-section single-banner">
  7. <div class="container">
  8. <h2>wishlist</h2>
  9. <ol class="breadcrumb">
  10. <li class="breadcrumb-item"><a href="/">Home</a></li>
  11. <li class="breadcrumb-item active" aria-current="page">wishlist</li>
  12. </ol>
  13. </div>
  14. </section>
  15. <!--=====================================
  16. BANNER PART END
  17. =======================================-->
  18. <!--=====================================
  19. WISHLIST PART START
  20. =======================================-->
  21. <section class="inner-section wishlist-part">
  22. <div class="container">
  23. <div class="row">
  24. <div class="col-lg-12">
  25. <div class="table-scroll table-responsive">
  26. <table class="table-list">
  27. <thead>
  28. <tr>
  29. <th scope="col">Serial</th>
  30. <th scope="col">Product</th>
  31. <th scope="col">Name</th>
  32. <th scope="col">Price</th>
  33. <th scope="col">status</th>
  34. <th scope="col">shopping</th>
  35. <th scope="col">action</th>
  36. </tr>
  37. </thead>
  38. <tbody>
  39. @forelse ($listType1Book['Book'][0]['Page'] ?? [] as $wish)
  40. <tr>
  41. <td class="table-serial"><h6>{{ $wish['C3'] }}</h6></td>
  42. <td class="table-image"><img src="{{ env('MEDIA_URL') . $wish['C2'] }}" alt="product"></td>
  43. <td class="table-name"><a href="{{ route('item-details', $wish['C9'] ?: $wish['C1']) }}"><h6>{{ $wish['C4'] }}</h6></a></td>
  44. <td class="table-price"><h6>{{ number_format($wish['C6']) }} 원<!--<small>/kilo</small>--></h6></td>
  45. {{-- <td class="table-status"><h6 class="stock-out">품절</h6></td>--}}
  46. <td class="table-status"><h6 class="stock-in">재고있음</h6></td>
  47. <td class="table-shop">
  48. <form class="form-prevent-multiple-submits" action="{{ route('cart.store') }}" method="POST">
  49. @csrf
  50. <div class="product-action">
  51. <button type="button" class="action-minus" title="Quantity Minus"><i class="icofont-minus"></i></button>
  52. <input class="action-input" title="Quantity Number" type="text" name="cart_qty" onchange="wish_qty_update(this, {{ $wish['Id'] }})"
  53. value="{{ (int)$wish['C7'] }}">
  54. <button type="button" class="action-plus" title="Quantity Plus"><i class="icofont-plus"></i></button>
  55. </div>
  56. <input type="hidden" name="item_id" value="{{ $wish['C1'] }}">
  57. <button type="submit" class="product-add button-prevent-multiple-submits" title="Add to Wish">
  58. <i class="fas fa-cart-arrow-down"></i>
  59. 카트에 담기
  60. </button>
  61. </form>
  62. </td>
  63. <td class="table-action">
  64. {{-- <a class="view" href="#" title="Quick View" data-bs-toggle="modal" data-bs-target="#product-view"><i class="fas fa-eye"></i></a>--}}
  65. <form class="wish-delete-form" action="{{ route('wish-list.destroy') }}" method="POST">
  66. @csrf
  67. <input type="hidden" name="item_id" value="{{ $wish['C1'] }}">
  68. <input type="hidden" name="_method" value="delete" />
  69. <button type="submit" class="trash" title="Remove Wishlist"><i class="icofont-trash"></i></button>
  70. </form>
  71. </td>
  72. </tr>
  73. @empty
  74. <tr>
  75. <td class="text-center" colspan="7">위시 리스트가 비어있습니다</td>
  76. </tr>
  77. @endforelse
  78. </tbody>
  79. </table>
  80. </div>
  81. </div>
  82. </div>
  83. {{-- <div class="row">--}}
  84. {{-- <div class="col-lg-12">--}}
  85. {{-- <div class="text-center mt-5">--}}
  86. {{-- <button class="btn btn-outline">--}}
  87. {{-- 더보기 +--}}
  88. {{-- </button>--}}
  89. {{-- </div>--}}
  90. {{-- </div>--}}
  91. {{-- </div>--}}
  92. </div>
  93. </section>
  94. <!--=====================================
  95. WISHLIST PART END
  96. =======================================-->
  97. @endsection
  98. @push('js')
  99. <script>
  100. $('.wish-delete-form').on('submit', function() {
  101. event.preventDefault()
  102. $this = (this)
  103. iziToast.question({
  104. timeout: 20000,
  105. close: false,
  106. overlay: true,
  107. displayMode: 'once',
  108. id: 'question',
  109. title: $('#comfirm-delete').text(),
  110. message: $('#can-not-recover-after-delete').text(),
  111. position: 'center',
  112. buttons: [
  113. [`<button type="button"><b>${$('#delete').text()}</b></button>`, async function (instance, toast) {
  114. instance.hide({ transitionOut: 'fadeOut' }, toast, 'button');
  115. $($this).submit()
  116. }, true],
  117. [`<button type="button">${$('#cancel').text()}</button>`, function (instance, toast) {
  118. instance.hide({ transitionOut: 'fadeOut' }, toast, 'button');
  119. }],
  120. ],
  121. });
  122. });
  123. async function wish_qty_update($this, wish_id) {
  124. const qty = Number($($this).val())
  125. if (qty < 1) {
  126. $($this).val(1)
  127. iziToast.info({ title: 'Info', message: '수량 에러' })
  128. return
  129. }
  130. const wish_pick = await get_api_data('wish-pick', {
  131. Page : [ { Id: Number(wish_id) } ]
  132. })
  133. const wish = wish_pick.data.Page[0]
  134. const wish_amt = String(Number(wish.WishPrc) * Number($($this).val()));
  135. const response = await get_api_data('wish-act', {
  136. Page : [
  137. {
  138. Id: Number(wish_id),
  139. WishPrc: wish.WishPrc,
  140. WishQty: $($this).val(),
  141. WishAmt: wish_amt,
  142. }
  143. ]
  144. })
  145. show_iziToast_msg(response.data.Page, function () {
  146. location.reload()
  147. })
  148. }
  149. </script>
  150. @endpush