index.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. {include file="public/frame_head"}
  2. <div class="row">
  3. <div class="col-sm-12">
  4. <div class="ibox">
  5. <div class="ibox-title">
  6. <button type="button" class="btn btn-w-m btn-primary" onclick="$eb.createModalFrame(this.innerText,'{:Url('create')}')">添加产品</button>
  7. </div>
  8. <div class="ibox-content">
  9. <div class="row">
  10. <div class="m-b m-l">
  11. <form action="" class="form-inline">
  12. <select name="is_show" aria-controls="editable" class="form-control input-sm">
  13. <option value="">产品状态</option>
  14. <option value="1" {eq name="where.is_show" value="1"}selected="selected"{/eq}>上架</option>
  15. <option value="0" {eq name="where.is_show" value="0"}selected="selected"{/eq}>下架</option>
  16. </select>
  17. <select name="is_hot" aria-controls="editable" class="form-control input-sm">
  18. <option value="">热卖单品</option>
  19. <option value="1" {eq name="where.is_hot" value="1"}selected="selected"{/eq}>是</option>
  20. <option value="0" {eq name="where.is_hot" value="0"}selected="selected"{/eq}>否</option>
  21. </select>
  22. <select name="is_benefit" aria-controls="editable" class="form-control input-sm">
  23. <option value="">促销单品</option>
  24. <option value="1" {eq name="where.is_benefit" value="1"}selected="selected"{/eq}>是</option>
  25. <option value="0" {eq name="where.is_benefit" value="0"}selected="selected"{/eq}>否</option>
  26. </select>
  27. <select name="is_best" aria-controls="editable" class="form-control input-sm">
  28. <option value="">会员商品</option>
  29. <option value="1" {eq name="where.is_best" value="1"}selected="selected"{/eq}>是</option>
  30. <option value="0" {eq name="where.is_best" value="0"}selected="selected"{/eq}>否</option>
  31. </select>
  32. <select name="is_new" aria-controls="editable" class="form-control input-sm">
  33. <option value="">首发新品</option>
  34. <option value="1" {eq name="where.is_new" value="1"}selected="selected"{/eq}>是</option>
  35. <option value="0" {eq name="where.is_new" value="0"}selected="selected"{/eq}>否</option>
  36. </select>
  37. <div class="input-group">
  38. <input type="text" name="store_name" value="{$where.store_name}" placeholder="请输入产品名称或者关键字" class="input-sm form-control" size="38"> <span class="input-group-btn">
  39. <button type="submit" class="btn btn-sm btn-primary"> <i class="fa fa-search" ></i> 搜索</button> </span>
  40. </div>
  41. </form>
  42. </div>
  43. </div>
  44. <div class="table-responsive">
  45. <table class="table table-striped table-bordered">
  46. <thead>
  47. <tr>
  48. <th class="text-center">编号</th>
  49. <th class="text-center">产品图片</th>
  50. <th class="text-center">产品名称</th>
  51. <th class="text-center">产品分类</th>
  52. <th class="text-center">价格</th>
  53. <th class="text-center">产品状态</th>
  54. <th class="text-center">热卖单品</th>
  55. <th class="text-center">促销单品</th>
  56. <th class="text-center">精品推荐</th>
  57. <th class="text-center">首发新品</th>
  58. <th class="text-center">库存</th>
  59. <th class="text-center">点赞</th>
  60. <th class="text-center">收藏</th>
  61. <th class="text-center">内容</th>
  62. <th class="text-center">秒杀</th>
  63. <th class="text-center">操作</th>
  64. <th class="text-center">评论</th>
  65. </tr>
  66. </thead>
  67. <tbody class="">
  68. {volist name="list" id="vo"}
  69. <tr>
  70. <td class="text-center">
  71. {$vo.id}
  72. </td>
  73. <td class="text-center">
  74. <img src="{$vo.image}" alt="{$vo.store_name}" class="open_image" data-image="{$vo.image}" style="width: 50px;height: 50px;cursor: pointer;">
  75. </td>
  76. <td class="text-center">
  77. {$vo.store_name}
  78. </td>
  79. <td class="text-center">
  80. {$vo.cate_name}
  81. </td>
  82. <td class="text-center">
  83. {$vo.price}
  84. </td>
  85. <td class="text-center">
  86. <i class="fa {eq name='vo.is_show' value='1'}fa-check text-navy{else/}fa-close text-danger{/eq}"></i>
  87. </td>
  88. <td class="text-center">
  89. <i class="fa {eq name='vo.is_hot' value='1'}fa-check text-navy{else/}fa-close text-danger{/eq}"></i>
  90. </td>
  91. <td class="text-center">
  92. <i class="fa {eq name='vo.is_benefit' value='1'}fa-check text-navy{else/}fa-close text-danger{/eq}"></i>
  93. </td>
  94. <td class="text-center">
  95. <i class="fa {eq name='vo.is_best' value='1'}fa-check text-navy{else/}fa-close text-danger{/eq}"></i>
  96. </td>
  97. <td class="text-center">
  98. <i class="fa {eq name='vo.is_new' value='1'}fa-check text-navy{else/}fa-close text-danger{/eq}"></i>
  99. </td>
  100. <td class="text-center">
  101. {$vo.stock}
  102. </td>
  103. <td class="text-center">
  104. <span class="btn btn-xs btn-white" {if condition="$vo['collect'] gt 0"}onclick="$eb.createModalFrame('点赞','{:Url('collect',array('id'=>$vo['id']))}')"{/if} style="cursor: pointer">
  105. <i class="fa fa-thumbs-up"></i>&nbsp;&nbsp;{$vo.collect}
  106. </span>
  107. </td>
  108. <td class="text-center">
  109. <span class="btn btn-xs btn-white" {if condition="$vo['like'] gt 0"}onclick="$eb.createModalFrame('收藏','{:Url('like',array('id'=>$vo['id']))}')"{/if} style="cursor: pointer">
  110. <i class="fa fa-heart"></i>&nbsp;&nbsp;{$vo.like}
  111. </span>
  112. </td>
  113. <td class="text-center">
  114. <button type="button" class="btn btn-xs btn-primary" onclick="$eb.createModalFrame(this.innerText,'{:Url('edit_content',array('id'=>$vo['id']))}')"><i class="fa fa-pencil"></i> 编辑内容</button>
  115. </td>
  116. <td class="text-center">
  117. <button class="btn btn-success btn-xs" type="button" onclick="$eb.createModalFrame('开启秒杀','{:Url('seckill',array('id'=>$vo['id']))}')"><i class="fa fa-forumbee"></i> 开启秒杀</button></td>
  118. <td class="text-center">
  119. <button class="btn btn-default btn-xs" type="button" onclick="$eb.createModalFrame('属性','{:Url('attr',array('id'=>$vo['id']))}')"><i class="fa fa-shekel"></i> 属性</button>
  120. <button class="btn btn-info btn-xs" type="button" onclick="$eb.createModalFrame('编辑','{:Url('edit',array('id'=>$vo['id']))}')"><i class="fa fa-edit"></i> 编辑</button>
  121. <button class="btn btn-danger btn-xs " data-url="{:Url('delete',array('id'=>$vo['id']))}" type="button"><i class="fa fa-times"></i> 删除
  122. </button>
  123. </td>
  124. <td class="text-center">
  125. <a href="{:Url('store.storeProductReply/index',array('product_id'=>$vo['id']))}">查看</a>
  126. </td>
  127. </tr>
  128. {/volist}
  129. </tbody>
  130. </table>
  131. </div>
  132. {include file="public/inner_page"}
  133. </div>
  134. </div>
  135. </div>
  136. <script>
  137. $('.btn-warning').on('click',function(){
  138. window.t = $(this);
  139. var _this = $(this),url =_this.data('url');
  140. $eb.$swal('delete',function(){
  141. $eb.axios.get(url).then(function(res){
  142. console.log(res);
  143. if(res.status == 200 && res.data.code == 200) {
  144. $eb.$swal('success',res.data.msg);
  145. _this.parents('tr').remove();
  146. }else
  147. return Promise.reject(res.data.msg || '删除失败')
  148. }).catch(function(err){
  149. $eb.$swal('error',err);
  150. });
  151. })
  152. });
  153. $(".open_image").on('click',function (e) {
  154. var image = $(this).data('image');
  155. $eb.openImage(image);
  156. })
  157. </script>
  158. </div>
  159. {include file="public/inner_footer"}