aae9dbbe6c3b7ab01a5651f356d619b3d0c28039.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  1. <?php $__env->startSection('panel_content'); ?>
  2. <!--<div class="aiz-titlebar mt-2 mb-4">-->
  3. <!-- <div class="row align-items-center">-->
  4. <!-- <div class="col-md-6">-->
  5. <!-- <h1 class="h3"><?php echo e(translate('Products')); ?></h1>-->
  6. <!-- </div>-->
  7. <!-- </div>-->
  8. <!--</div>-->
  9. <div class="row gutters-10 justify-content-center">
  10. <?php if(addon_is_activated('seller_subscription')): ?>
  11. <div class="col-md-4 mx-auto mb-3" >
  12. <div class="bg-grad-1 text-white rounded-lg overflow-hidden">
  13. <span class="size-30px rounded-circle mx-auto bg-soft-primary d-flex align-items-center justify-content-center mt-3">
  14. <i class="las la-upload la-2x text-white"></i>
  15. </span>
  16. <div class="px-3 pt-3 pb-3">
  17. <div class="h4 fw-700 text-center"><?php echo e(max(0, auth()->user()->shop->product_upload_limit - auth()->user()->products()->count())); ?></div>
  18. <div class="opacity-50 text-center"><?php echo e(translate('Remaining Uploads')); ?></div>
  19. </div>
  20. </div>
  21. </div>
  22. <?php endif; ?>
  23. <div class="col-md-4 mx-auto mb-3" >
  24. <!--<a href="<?php echo e(route('seller.products.create')); ?>">-->
  25. <!-- <div class="p-3 rounded mb-3 c-pointer text-center bg-white shadow-sm hov-shadow-lg has-transition">-->
  26. <!-- <span class="size-60px rounded-circle mx-auto bg-secondary d-flex align-items-center justify-content-center mb-3">-->
  27. <!-- <i class="las la-plus la-3x text-white"></i>-->
  28. <!-- </span>-->
  29. <!-- <div class="fs-18 text-primary"><?php echo e(translate('Add New Product')); ?></div>-->
  30. <!-- </div>-->
  31. <!--</a>-->
  32. </div>
  33. <?php if(addon_is_activated('seller_subscription')): ?>
  34. <?php
  35. $seller_package = \App\Models\SellerPackage::find(Auth::user()->shop->seller_package_id);
  36. ?>
  37. <div class="col-md-4">
  38. <a href="<?php echo e(route('seller.seller_packages_list')); ?>" class="text-center bg-white shadow-sm hov-shadow-lg text-center d-block p-3 rounded">
  39. <?php if($seller_package != null): ?>
  40. <img src="<?php echo e(uploaded_asset($seller_package->logo)); ?>" height="44" class="mw-100 mx-auto">
  41. <span class="d-block sub-title mb-2"><?php echo e(translate('Current Package')); ?>: <?php echo e($seller_package->getTranslation('name')); ?></span>
  42. <?php else: ?>
  43. <i class="la la-frown-o mb-2 la-3x"></i>
  44. <div class="d-block sub-title mb-2"><?php echo e(translate('No Package Found')); ?></div>
  45. <?php endif; ?>
  46. <div class="btn btn-outline-primary py-1"><?php echo e(translate('Upgrade Package')); ?></div>
  47. </a>
  48. </div>
  49. <?php endif; ?>
  50. </div>
  51. <div class="card">
  52. <div class="card-header row gutters-5">
  53. <div class="col">
  54. <h5 class="mb-md-0 h6"><?php echo e(translate('All Products')); ?></h5>
  55. </div>
  56. <div class="col-md-4">
  57. <form class="" id="sort_brands" action="" method="GET">
  58. <div class="input-group input-group-sm">
  59. <input type="text" class="form-control" id="search" name="search" <?php if(isset($search)): ?> value="<?php echo e($search); ?>" <?php endif; ?> placeholder="<?php echo e(translate('Search product')); ?>">
  60. </div>
  61. </form>
  62. </div>
  63. </div>
  64. <div class="card-body">
  65. <table class="table aiz-table mb-0">
  66. <thead>
  67. <tr>
  68. <th>#</th>
  69. <th data-breakpoints="md">
  70. <?php echo e(translate('Thumbnail Image')); ?>
  71. </th>
  72. <th width="30%"><?php echo e(translate('Name')); ?></th>
  73. <th data-breakpoints="md"><?php echo e(translate('Category')); ?></th>
  74. <th data-breakpoints="md"><?php echo e(translate('Current Qty')); ?></th>
  75. <th><?php echo e(translate('Base Price')); ?></th>
  76. <?php if(get_setting('product_approve_by_admin') == 1): ?>
  77. <th data-breakpoints="md"><?php echo e(translate('Approval')); ?></th>
  78. <?php endif; ?>
  79. <th data-breakpoints="md"><?php echo e(translate('Published')); ?></th>
  80. <th data-breakpoints="md"><?php echo e(translate('Featured')); ?></th>
  81. <th data-breakpoints="md">直通车推广</th>
  82. <th data-breakpoints="md" class="text-right"><?php echo e(translate('Options')); ?></th>
  83. </tr>
  84. </thead>
  85. <tbody>
  86. <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
  87. <tr>
  88. <td><?php echo e(($key+1) + ($products->currentPage() - 1)*$products->perPage()); ?></td>
  89. <td>
  90. <img
  91. height="80px"
  92. class="lazyload"
  93. src="<?php echo e(static_asset('assets/img/placeholder.jpg')); ?>"
  94. data-src="<?php echo e(uploaded_asset($product->thumbnail_img)); ?>"
  95. alt="<?php echo e($product->getTranslation('name')); ?>"
  96. onerror="this.onerror=null;this.src='<?php echo e(static_asset('assets/img/placeholder.jpg')); ?>';"
  97. >
  98. </td>
  99. <td>
  100. <a href="<?php echo e(route('product', $product->slug)); ?>" target="_blank" class="text-reset">
  101. <?php echo e($product->getTranslation('name')); ?>
  102. </a>
  103. </td>
  104. <td>
  105. <?php if($product->category != null): ?>
  106. <?php echo e($product->category->getTranslation('name')); ?>
  107. <?php endif; ?>
  108. </td>
  109. <td>
  110. <?php
  111. $qty = 0;
  112. foreach ($product->stocks as $key => $stock) {
  113. $qty += $stock->qty;
  114. }
  115. echo $qty;
  116. ?>
  117. </td>
  118. <td><?php echo e($product->unit_price); ?></td>
  119. <?php if(get_setting('product_approve_by_admin') == 1): ?>
  120. <td>
  121. <?php if($product->approved == 1): ?>
  122. <span class="badge badge-inline badge-success"><?php echo e(translate('Approved')); ?></span>
  123. <?php else: ?>
  124. <span class="badge badge-inline badge-info"><?php echo e(translate('Pending')); ?></span>
  125. <?php endif; ?>
  126. </td>
  127. <?php endif; ?>
  128. <td>
  129. <label class="aiz-switch aiz-switch-success mb-0">
  130. <input onchange="update_published(this)" value="<?php echo e($product->id); ?>" type="checkbox" <?php if($product->published == 1) echo "checked";?> >
  131. <span class="slider round"></span>
  132. </label>
  133. </td>
  134. <td>
  135. <label class="aiz-switch aiz-switch-success mb-0">
  136. <input onchange="update_featured(this)" value="<?php echo e($product->id); ?>" type="checkbox" <?php if($product->seller_featured == 1) echo "checked";?> >
  137. <span class="slider round"></span>
  138. </label>
  139. </td>
  140. <td>
  141. <label class="aiz-switch aiz-switch-success mb-0">
  142. <?php if( count($seller_spread_packages_payments)==0 && $product->seller_spread_package_payment): ?>
  143. <?php if($product->seller_spread_package_payment && $product->seller_spread_package_payment->expire_at > time()): ?>
  144. <input type="checkbox" checked readonly disabled >
  145. <?php else: ?>
  146. <input onchange="toJump()" type="checkbox" >
  147. <?php endif; ?>
  148. <?php else: ?>
  149. <?php if( $product->seller_spread_package_payment && $product->seller_spread_package_payment->expire_at > time()): ?>
  150. <input type="checkbox" checked readonly disabled >
  151. <?php else: ?>
  152. <input onchange="select_spread_package(<?php echo e($product->id); ?>)" type="checkbox">
  153. <?php endif; ?>
  154. <?php endif; ?>
  155. <span class="slider round"></span>
  156. </label>
  157. </td>
  158. <td class="text-right">
  159. <a class="btn btn-soft-warning btn-icon btn-circle btn-sm" style="width: auto" href="javascript:void(0);" onclick="product_review('<?php echo e($product->id); ?>')" title="<?php echo e(translate('Review')); ?>">
  160. <?php echo e(translate('Review')); ?>
  161. </a>
  162. <!--<a class="btn btn-soft-info btn-icon btn-circle btn-sm" href="<?php echo e(route('seller.products.edit', ['id'=>$product->id, 'lang'=>env('DEFAULT_LANGUAGE')])); ?>" title="<?php echo e(translate('Edit')); ?>">-->
  163. <!-- <i class="las la-edit"></i>-->
  164. <!--</a>-->
  165. <!-- <a href="<?php echo e(route('seller.products.duplicate', $product->id)); ?>" class="btn btn-soft-success btn-icon btn-circle btn-sm" title="<?php echo e(translate('Duplicate')); ?>">-->
  166. <!-- <i class="las la-copy"></i>-->
  167. <!--</a>-->
  168. <!-- <a href="#" class="btn btn-soft-danger btn-icon btn-circle btn-sm confirm-delete" data-href="<?php echo e(route('seller.products.destroy', $product->id)); ?>" title="<?php echo e(translate('Delete')); ?>">-->
  169. <!-- <i class="las la-trash"></i>-->
  170. <!-- </a>-->
  171. </td>
  172. </tr>
  173. <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
  174. </tbody>
  175. </table>
  176. <div class="aiz-pagination">
  177. <?php echo e($products->links()); ?>
  178. </div>
  179. </div>
  180. </div>
  181. <?php $__env->stopSection(); ?>
  182. <?php $__env->startSection('modal'); ?>
  183. <?php echo $__env->make('modals.delete_modal', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
  184. <!-- 选择直通车 -->
  185. <div class="modal fade" id="select_payment_type_modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  186. <form class="" id="package_payment_form" action="<?php echo e(route('seller.products.spread')); ?>" method="post">
  187. <div class="modal-dialog modal-dialog-centered" role="document">
  188. <div class="modal-content">
  189. <div class="modal-header">
  190. <h5 class="modal-title" id="exampleModalLabel"><?php echo e(translate('Select Spread Package')); ?></h5>
  191. <button type="button" class="close" data-dismiss="modal" aria-label="Close"></button>
  192. </div>
  193. <div class="modal-body">
  194. <input type="hidden" id="product_id" name="product_id" value="">
  195. <div class="row">
  196. <div class="col-md-2">
  197. <label><?php echo e(translate('Spread Package')); ?></label>
  198. </div>
  199. <div class="col-md-10">
  200. <div class="mb-3">
  201. <select class="form-control aiz-selectpicker" name="seller_spread_package_payment_id"
  202. data-minimum-results-for-search="Infinity" required>
  203. <option value=""><?php echo e(translate('Select One')); ?></option>
  204. <?php $__currentLoopData = $seller_spread_packages_payments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $seller_spread_packages_payment): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
  205. <option value="<?php echo e($seller_spread_packages_payment['id']); ?>"><?php echo e($seller_spread_packages_payment['seller_spread_package']['name']); ?></option>
  206. <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
  207. </select>
  208. </div>
  209. </div>
  210. </div>
  211. <div class="form-group text-right">
  212. <button type="button" class="btn btn-sm btn-primary transition-3d-hover mr-1" id="select_type_cancel" data-dismiss="modal"><?php echo e(translate('Cancel')); ?></button>
  213. <button type="submit" class="btn btn-sm btn-primary transition-3d-hover mr-1"><?php echo e(translate('Confirm')); ?></button>
  214. </div>
  215. </div>
  216. </div>
  217. </div>
  218. </form>
  219. </div>
  220. <!-- Product Review Modal -->
  221. <div class="modal fade" id="product-review-modal">
  222. <div class="modal-dialog">
  223. <div class="modal-content">
  224. <div class="modal-header">
  225. <h5 class="modal-title h6"><?php echo e(translate('Review')); ?></h5>
  226. <button type="button" class="close" data-dismiss="modal">
  227. </button>
  228. </div>
  229. <form action="<?php echo e(route('reviews.store')); ?>" enctype="multipart/form-data" method="POST">
  230. <div id="product-review-modal-content">
  231. </div>
  232. <div class="modal-body">
  233. <div class="form-group">
  234. <label class="opacity-60"><?php echo e(translate('Product')); ?></label>
  235. <p>1</p>
  236. </div>
  237. <div class="form-group">
  238. <label class="opacity-60"><?php echo e(translate('Customer')); ?></label>
  239. <div>
  240. <?php
  241. $customers = \App\Models\User::where('user_type', 'customer')->where('email_verified_at', '!=', null)->orderBy('created_at', 'desc')->get();
  242. ?>
  243. <select name="user_id" class="form-control aiz-selectpicker pos-customer" data-live-search="true">
  244. <?php $__currentLoopData = $customers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $customer): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
  245. <option value="<?php echo e($customer->id); ?>" data-contact="<?php echo e($customer->email); ?>">
  246. <?php echo e($customer->name); ?> <?php if($customer->is_virtual == 1): ?> (<font color="red"><?php echo e(translate('Virtual')); ?></font>) <?php endif; ?>
  247. </option>
  248. <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
  249. </select>
  250. </div>
  251. </div>
  252. <div class="form-group">
  253. <label class="opacity-60"><?php echo e(translate('Rating')); ?></label>
  254. <div class="rating rating-input">
  255. <label> <input type="radio" name="rating" value="1" required> <i class="las la-star"></i> </label>
  256. <label> <input type="radio" name="rating" value="2"> <i class="las la-star"></i> </label> <label>
  257. <input type="radio" name="rating" value="3"> <i class="las la-star"></i> </label> <label>
  258. <input type="radio" name="rating" value="4"> <i class="las la-star"></i> </label> <label>
  259. <input type="radio" name="rating" value="5"> <i class="las la-star"></i> </label>
  260. </div>
  261. </div>
  262. <div class="form-group">
  263. <label class="opacity-60"><?php echo e(translate('Comment')); ?></label>
  264. <textarea class="form-control" rows="4" name="comment" placeholder="<?php echo e(translate('Your review')); ?>" required></textarea>
  265. </div>
  266. </div>
  267. <div class="modal-footer">
  268. <button type="submit" class="btn btn-sm btn-primary"><?php echo e(translate('Submit review')); ?></button>
  269. <button type="button" class="btn btn-sm btn-light" data-dismiss="modal"><?php echo e(translate('Cancel')); ?></button>
  270. </div>
  271. </form>
  272. </div>
  273. </div>
  274. </div>
  275. <?php $__env->stopSection(); ?>
  276. <?php $__env->startSection('script'); ?>
  277. <script type="text/javascript">
  278. function product_review(product_id) {
  279. $.post('<?php echo e(route('seller.products.product_seller_review_modal')); ?>', {
  280. _token: '<?php echo e(@csrf_token()); ?>',
  281. product_id: product_id
  282. }, function(data) {
  283. console.log(data);
  284. $('#product-review-modal-content').html(data);
  285. $('#product-review-modal').modal('show', {
  286. backdrop: 'static'
  287. });
  288. AIZ.extra.inputRating();
  289. });
  290. }
  291. function update_featured(el){
  292. if(el.checked){
  293. var status = 1;
  294. }
  295. else{
  296. var status = 0;
  297. }
  298. $.post('<?php echo e(route('seller.products.featured')); ?>', {_token:'<?php echo e(csrf_token()); ?>', id:el.value, status:status}, function(data){
  299. if(data == 1){
  300. AIZ.plugins.notify('success', '<?php echo e(translate('Featured products updated successfully')); ?>');
  301. }
  302. else{
  303. AIZ.plugins.notify('danger', '<?php echo e(translate('Something went wrong')); ?>');
  304. location.reload();
  305. }
  306. });
  307. }
  308. function update_published(el){
  309. if(el.checked){
  310. var status = 1;
  311. }
  312. else{
  313. var status = 0;
  314. }
  315. $.post('<?php echo e(route('seller.products.published')); ?>', {_token:'<?php echo e(csrf_token()); ?>', id:el.value, status:status}, function(data){
  316. if(data == 1){
  317. AIZ.plugins.notify('success', '<?php echo e(translate('Published products updated successfully')); ?>');
  318. }
  319. else if(data == 2){
  320. AIZ.plugins.notify('danger', '<?php echo e(translate('Please upgrade your package.')); ?>');
  321. location.reload();
  322. }
  323. else{
  324. AIZ.plugins.notify('danger', '<?php echo e(translate('Something went wrong')); ?>');
  325. location.reload();
  326. }
  327. });
  328. }
  329. function toJump(){
  330. AIZ.plugins.notify('danger', '请开通直通车');
  331. window.location.href = "<?php echo e(route('seller.seller_spread_packages_list')); ?>"
  332. }
  333. function select_spread_package(product_id){
  334. $('input[name=product_id]').val(product_id);
  335. $('#select_payment_type_modal').modal('show');
  336. }
  337. </script>
  338. <?php $__env->stopSection(); ?>
  339. <?php echo $__env->make('seller.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /Users/shaoguo/Desktop/公司资料/小梦/商城/ebayShop/resources/views/seller/product/products/index.blade.php ENDPATH**/ ?>