goods.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <?php
  2. use common\components\stringUtil;
  3. ?>
  4. <div class="page-title">
  5. <div class="title-env">
  6. <h1 class="title">首页商品</h1>
  7. </div>
  8. <div class="breadcrumb-env">
  9. <ol class="breadcrumb bc-1">
  10. <li>
  11. <a href="/"><i class="fa-home"></i>Home</a>
  12. </li>
  13. <li>
  14. <a href="javascript:void(0)">推荐管理</a>
  15. </li>
  16. <li class="active">
  17. <strong>首页商品</strong>
  18. </li>
  19. </ol>
  20. </div>
  21. </div>
  22. <div class="panel panel-default">
  23. <div class="panel-body">
  24. <div class="dataTables_wrapper form-inline dt-bootstrap no-footer">
  25. <div class="table-responsive">
  26. <table class="table table-bordered table-striped table-hover" >
  27. <thead>
  28. <tr class="active">
  29. <th class="no-sorting hidden-xs"><input type="checkbox"></th>
  30. <th>ID</th>
  31. <th>封面</th>
  32. <th>标题</th>
  33. <!--
  34. <th>上移</th>
  35. <th>下移</th>
  36. -->
  37. <th>操作</th>
  38. </tr>
  39. </thead>
  40. <tbody class="middle-align">
  41. <?php if(!empty($recommend)){ foreach($recommend as $key => $val){ ?>
  42. <tr>
  43. <td class="hidden-xs"><input type="checkbox"></td>
  44. <td><?= $val['id'] ?></td>
  45. <td><img src="<?= Yii::$app->params['imgUrl'].$val['cover'] ?>" width="20" /></td>
  46. <td><?= $val['goodsName'] ?></td>
  47. <!--
  48. <td><a>↑</a></td>
  49. <td><a>↓</a></td>
  50. -->
  51. <td>
  52. <!--
  53. <a class="btn btn-secondary btn-single" href="javascript:void(0)" name="categoryButton" data-msg="置顶" data-url="/recommend/toTop?id=1" style="padding:2px 5px;">置顶</a>
  54. -->
  55. <a href="javascript:void(0)" name="delRecommendGoods" data-url="/recommend/del-index-goods?id=<?= $val['id']; ?>" data-msg="删除" class="btn btn-secondary btn-sm btn-icon icon-left">删除 </a>
  56. </td>
  57. </tr>
  58. <?php } }?>
  59. </tbody>
  60. </table>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. <!-- footer -->
  66. <?php
  67. use backend\widgets\FooterWidget;
  68. ?>
  69. <?= FooterWidget::widget()?>
  70. <!-- footer -->
  71. <!-- modal 确认提醒框 -->
  72. <div class="modal fade" id="confirmMention">
  73. <div class="modal-dialog" style="height:300px;">
  74. <div class="modal-content">
  75. <div class="modal-header">
  76. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
  77. <h4 class="modal-title">消息提示</h4>
  78. </div>
  79. <div class="modal-body">
  80. 确认<span></span>?<input type="hidden" name="requestUrl" value="" />
  81. </div>
  82. <div class="modal-footer">
  83. <button type="button" class="btn btn-info" name="confirmOk" >确认</button>
  84. <button type="button" class="btn btn-white" data-dismiss="modal">取消</button>
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. <!-- Modal 查看商品-->
  90. <div class="modal fade" id="modal-goodsDetail">
  91. <div class="modal-dialog">
  92. <div class="modal-content">
  93. <div class="modal-header">
  94. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
  95. <h4 class="modal-title">商品详细</h4>
  96. </div>
  97. <div class="modal-body">
  98. </div>
  99. <div class="modal-footer">
  100. <button type="button" class="btn btn-info" data-dismiss="modal">确认</button>
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. <script>
  106. //推荐商品
  107. $(function(){
  108. jQuery("a[name=delRecommendGoods]").click(function(){
  109. var url = $(this).attr('data-url');
  110. $.ajax({type:"GET",url:url,async:false,dataType:'json',success:function(data){
  111. if(data.code == 'A0001'){
  112. xhPopMsg(data.msg,1200);//调用定时浮层 XXX毫秒后消失
  113. setTimeout(function(){
  114. window.location.reload();
  115. },2200);
  116. }else{
  117. xhPopMsg(data.msg,2000);//调用定时浮层 XXX毫秒后消失
  118. }
  119. }});
  120. });
  121. });
  122. </script>