list.php 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <?php
  2. use yii\widgets\LinkPager;
  3. use common\components\stringUtil;
  4. ?>
  5. <?php
  6. use backend\widgets\TabWidget;
  7. echo TabWidget::widget(['list' => $this->context->menuList, 'currentMenu' => $this->context->id]);
  8. ?>
  9. <div class="panel panel-default">
  10. <?php
  11. use backend\widgets\SubTabWidget;
  12. echo SubTabWidget::widget(['list' => $this->context->subMenuList, 'currentMenu' => $this->context->action->id]);
  13. ?>
  14. <div class="panel-body">
  15. <div class="dataTables_wrapper form-inline dt-bootstrap no-footer">
  16. <div class="row">
  17. <form action="" method="GET">
  18. <div class="col-xs-6" style="width:90%;">
  19. <div class="dataTables_length">
  20. <a href="./add" class="btn btn-secondary btn-single" style="margin-right:15px;">添加刮刮卡</a>
  21. </div>
  22. </div>
  23. </form>
  24. </div>
  25. <div name="xhQrTip" style="position:absolute;border-color: #8dc63f;width:110px;height:122px;z-index:9999;display:none;background:white;border:1px solid #ccc;">
  26. <div style="background:red;">
  27. <a href="javascript:void(0)" style="color:#68b828;float:right;z-index:9999;"
  28. <i="" class="fa-times"></a>
  29. </div>
  30. <div></div>
  31. </div>
  32. <div class="table-responsive">
  33. <table class="table table-bordered table-striped table-hover table-condensed">
  34. <thead>
  35. <tr class="active">
  36. <th class="no-sorting hidden-xs"><input type="checkbox"></th>
  37. <th class="hidden-xs">ID</th>
  38. <th>活动名称</th>
  39. <th class="hidden-xs">开始时间</th>
  40. <th class="hidden-xs">结束时间</th>
  41. <th class="hidden-xs">访问次数</th>
  42. <th class="hidden-xs">客户数</th>
  43. <th class="hidden-xs">抽奖人数</th>
  44. <th class="hidden-xs">中奖人数</th>
  45. <th>状态</th>
  46. <th>操作</th>
  47. </tr>
  48. </thead>
  49. <tbody class="middle-align">
  50. <?php
  51. foreach ($activities as $key => $activity) {
  52. ?>
  53. <tr>
  54. <td class="hidden-xs"><input type="checkbox"></td>
  55. <td class="hidden-xs"><?= $activity['id'] ?></td>
  56. <td title="<?= $activity['actName'] ?>">
  57. <a href="./edit?id=<?= $activity['id'] ?>"><?= stringUtil::subStringUtf8($activity['actName'], 9, '…') ?></a>
  58. &nbsp;
  59. <a data-toggle="tooltip" data-placement="bottom" title="" data-original-title="点击将访问链接发送到管理员手机上" data-urlqrcode="<?= $activity['urlQrCode'] ?>" data-id="<?= $activity['id'] ?>" name="sendActiveUrlToMobile" href="javascript:void(0)" style="color:#68b828;margin-left:6px;text-decoration:none;">
  60. <i class="fa-mobile-phone" style="font-size:16px;"></i> </a>
  61. &nbsp;
  62. <a data-toggle="tooltip" data-placement="bottom" title="" data-original-title="点击显示二维码链接" data-urlqrcode="<?= $activity['urlQrCode'] ?>" data-id="<?= $activity['id'] ?>" name="qrShow" href="javascript:void(0)" style="color:#68b828;margin-left:4px;text-decoration:none;">
  63. <i class="fa-qrcode"></i>
  64. </td>
  65. <td class="hidden-xs"><?= date('Y-m-d', $activity['startTime']) ?></td>
  66. <td class="hidden-xs"><?= date('Y-m-d', $activity['endTime']) ?></td>
  67. <td><?= $activity['visitNum'] ?></td>
  68. <td><?= $activity['visitUser'] ?></td>
  69. <td><a href="./join-list?id=<?= $activity['id'] ?>"><?= $activity['drawUser'] ?></a></td>
  70. <td><a href="./win-list?id=<?= $activity['id'] ?>"><?= $activity['winUser'] ?></a></td>
  71. <td><?= $activity['status'] ?></td>
  72. <td>
  73. <a href="./win-list?id=<?= $activity['id'] ?>" class="btn btn-secondary btn-sm btn-icon icon-left">中奖客户</a>
  74. <a href="./prize-detail?id=<?= $activity['id'] ?>" class="btn btn-secondary btn-sm btn-icon icon-left">奖品</a>
  75. <a href="./join-list?id=<?= $activity['id'] ?>" class="btn btn-secondary btn-sm btn-icon icon-left">参与人</a>
  76. <a href="./edit?id=<?= $activity['id'] ?>" class="btn btn-secondary btn-sm btn-icon icon-left">修改</a>
  77. </td>
  78. </tr>
  79. <?php } ?>
  80. </tbody>
  81. </table>
  82. </div>
  83. <div class="row">
  84. <div>
  85. <div class="dataTables_paginate paging_simple_numbers" style="float:right;padding-top:0px;margin-right:15px;">
  86. <?= LinkPager::widget(['pagination' => $pages]); ?>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. <!-- footer -->
  94. <?php
  95. use backend\widgets\FooterWidget;
  96. ?>
  97. <?= FooterWidget::widget() ?>
  98. <!-- footer -->
  99. <script>
  100. $(function () {
  101. $("a[name=qrShow]").click(function () {
  102. var left = $(this).position().left;
  103. var top = $(this).position().top;
  104. var id = $(this).attr('data-id');
  105. var urlqrcode = $(this).attr('data-urlqrcode');
  106. var object = $(this);
  107. $("div[name=xhQrTip]").children('div').eq(1).html('<img src="/images/loading.gif" style="margin:47px 0 0 47px;" />');
  108. $("div[name=xhQrTip]").css('left', left).css('top', top - 110).css('display', 'block');
  109. if (urlqrcode.length > 0) {
  110. $("div[name=xhQrTip]").children('div').eq(1).html('<img width="105" src="<?= Yii::$app->params['imgUrl'] ?>' + urlqrcode + '" />');
  111. $("div[name=xhQrTip]").css('left', left).css('top', top - 110).css("padding", "2px").fadeIn();
  112. } else {
  113. $.ajax({
  114. type: "get",
  115. url: '/gua-gua/show-act-qrcode?id=' + id,
  116. async: true,
  117. dataType: 'json',
  118. success: function (data) {
  119. if (data.code == 'A0001') {
  120. var imgUrl = data.data.url;
  121. object.attr('data-urlqrcode', imgUrl);
  122. $("div[name=xhQrTip]").children('div').eq(1).html('<img width="105" src="<?= Yii::$app->params['imgUrl'] ?>' + imgUrl + '" />');
  123. $("div[name=xhQrTip]").css('left', left).css('top', top - 110).css("padding", "2px").fadeIn();
  124. }
  125. }
  126. });
  127. }
  128. });
  129. $("div[name=xhQrTip]").click(function () {
  130. $(this).css("display", "none");
  131. });
  132. $("a[name=sendActiveUrlToMobile]").click(function () {
  133. var activeId = $(this).attr('data-id');
  134. $.ajax({
  135. type: "get",
  136. url: '/gua-gua/send-active-url?activeId=' + activeId,
  137. async: true,
  138. dataType: 'json',
  139. success: function (data) {
  140. xhPopMsg(data.msg, 2000);
  141. }
  142. });
  143. });
  144. });
  145. </script>