list.php 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <?php
  2. use common\services\xhActiveTicketClassService;
  3. use yii\widgets\LinkPager;
  4. use common\components\stringUtil;
  5. ?>
  6. <div class="page-title">
  7. <div class="title-env">
  8. <h1 class="title">投票活动</h1>
  9. </div>
  10. <div class="breadcrumb-env">
  11. <ol class="breadcrumb bc-1">
  12. <li>
  13. <a href="/"><i class="fa-home"></i>Home</a>
  14. </li>
  15. <li>
  16. <a href="javascript:void(0)">营销管理</a>
  17. </li>
  18. <li class="active">
  19. <strong>投票活动</strong>
  20. </li>
  21. </ol>
  22. </div>
  23. </div>
  24. <div class="panel panel-default">
  25. <div class="panel-body">
  26. <div class="dataTables_wrapper form-inline dt-bootstrap no-footer">
  27. <div class="row">
  28. <form action="" method="GET">
  29. <div class="col-xs-6" style="width:90%;">
  30. <div class="dataTables_length">
  31. <label>标题:<input type="search" class="form-control" name="activeName" value="<?php if(isset($_GET['activeName'])) echo $_GET['activeName']; ?>"
  32. placeholder="" aria-controls="example-1"></label>
  33. <input class="btn btn-secondary btn-single" type="submit" name="submit" value="搜索" />
  34. <a href="javascript:void(0)" onclick="xhPopMsg('开发中,敬请期待…');" class="btn btn-secondary btn-single" style="margin-right:15px;">添加投票</a>
  35. </div>
  36. </div>
  37. </form>
  38. </div>
  39. <div name="xhQrTip" style="position:absolute;border-color: #8dc63f;width:110px;height:122px;z-index:9999;display:none;background:white;border:1px solid #ccc;">
  40. <div style="background:red;">
  41. <a href="javascript:void(0)" style="color:#68b828;float:right;z-index:9999;" <i="" class="fa-times"></a>
  42. </div>
  43. <div></div>
  44. </div>
  45. <div class="table-responsive">
  46. <table class="table table-bordered table-striped table-hover" >
  47. <thead>
  48. <tr class="active">
  49. <th class="no-sorting hidden-xs"><input type="checkbox"></th>
  50. <th class="hidden-xs">ID</th>
  51. <th>活动名称</th>
  52. <th class="hidden-xs">时间</th>
  53. <th>操作</th>
  54. </tr>
  55. </thead>
  56. <tbody class="middle-align">
  57. <?php if(!empty($vote)){
  58. foreach($vote as $key => $val){
  59. ?>
  60. <tr>
  61. <td class="hidden-xs"><input type="checkbox"></td>
  62. <td class="hidden-xs"> </td>
  63. <td class="hidden-xs"> </td>
  64. <td class="hidden-xs"> </td>
  65. <td class="hidden-xs"> </td>
  66. </tr>
  67. <?php } }?>
  68. </tbody>
  69. </table>
  70. </div>
  71. <div class="row">
  72. <div>
  73. <!--
  74. <div style="display:inline-block;margin-left:15px;">
  75. <label><select name="example-1_length"
  76. aria-controls="example-1" class="form-control">
  77. <option value="0">批量操作</option>
  78. <option value="1">批量下架</option>
  79. <option value="2">批量删除</option>
  80. </select>
  81. </label>
  82. <input class="btn btn-secondary btn-single" type="submit" name="" value="确认" />
  83. </div>
  84. -->
  85. <div class="dataTables_paginate paging_simple_numbers" style="float:right;padding-top:0px;margin-right:15px;">
  86. <?= $paging ?>
  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. <!-- modal 确认提醒框 -->
  100. <div class="modal fade" id="confirmMention">
  101. <div class="modal-dialog" style="height:300px;">
  102. <div class="modal-content">
  103. <div class="modal-header">
  104. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
  105. <h4 class="modal-title">消息提示</h4>
  106. </div>
  107. <div class="modal-body">
  108. 确认<span></span>?<input type="hidden" name="requestUrl" value="" />
  109. </div>
  110. <div class="modal-footer">
  111. <button type="button" class="btn btn-info" name="confirmOk" >确认</button>
  112. <button type="button" class="btn btn-white" data-dismiss="modal">取消</button>
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. <!-- Modal 查看活动-->
  118. <div class="modal fade" id="modal-activeDetail">
  119. <div class="modal-dialog">
  120. <div class="modal-content">
  121. <div class="modal-header">
  122. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
  123. <h4 class="modal-title">活动详细</h4>
  124. </div>
  125. <div class="modal-body">
  126. </div>
  127. <div class="modal-footer">
  128. <button type="button" class="btn btn-info" data-dismiss="modal">确认</button>
  129. </div>
  130. </div>
  131. </div>
  132. </div>
  133. <script>
  134. //确认提醒操作
  135. $(function(){
  136. jQuery("a[name=dealactive]").click(function(){
  137. var url = $(this).attr('data-url');
  138. var msg = $(this).attr('data-msg');
  139. $("#confirmMention .modal-body span").text(msg);
  140. $("#confirmMention .modal-body input").val(url);
  141. jQuery('#confirmMention').modal('show', {backdrop: 'fade'}).css({
  142. 'margin-top': function () {
  143. var modalHeight = jQuery("#confirmMention").find('.modal-dialog').height();
  144. return ($(window).height() / 2 - (modalHeight / 2));
  145. }
  146. });
  147. });
  148. //点击确认操作
  149. jQuery("button[name=confirmOk]").click(function(){
  150. var url = $("#confirmMention .modal-body input").val();
  151. $.ajax({type:"GET",url:url,async:false,dataType:'json',success:function(data){
  152. if(data.code == 'A0001'){
  153. $('#confirmMention').modal('hide');
  154. window.location.reload();
  155. }
  156. }});
  157. });
  158. });
  159. //推荐活动
  160. $(function(){
  161. jQuery("a[name=recommendactive]").click(function(){
  162. var url = $(this).attr('data-url');
  163. $.ajax({type:"GET",url:url,async:false,dataType:'json',success:function(data){
  164. if(data.code == 'A0001'){
  165. xhPopMsg(data.msg,1200);//调用定时浮层 XXX毫秒后消失
  166. }else{
  167. xhPopMsg(data.msg,2000);//调用定时浮层 XXX毫秒后消失
  168. }
  169. }});
  170. });
  171. });
  172. $("a[name=qrShow]").click(function(){
  173. var left = $(this).position().left;
  174. var top = $(this).position().top;
  175. var id = $(this).attr('data-id');
  176. var urlqrcode = $(this).attr('data-urlqrcode');
  177. var object = $(this);
  178. $("div[name=xhQrTip]").children('div').eq(1).html('<img src="/images/loading.gif" style="margin:47px 0 0 47px;" />');
  179. $("div[name=xhQrTip]").css('left',left).css('top',top - 110).css('display','block');
  180. if(urlqrcode.length > 0){
  181. $("div[name=xhQrTip]").children('div').eq(1).html('<img width="105" src="<?= Yii::$app->params['imgUrl'] ?>'+urlqrcode+'" />');
  182. $("div[name=xhQrTip]").css('left',left).css('top',top - 110).css("padding","2px").fadeIn();
  183. }else{
  184. $.ajax({type:"get",url:'/active/show-act-qrcode?id='+id,async:true,dataType:'json',success:function(data){
  185. if(data.code == 'A0001'){
  186. var imgUrl = data.data.url;
  187. object.attr('data-urlqrcode',imgUrl);
  188. $("div[name=xhQrTip]").children('div').eq(1).html('<img width="105" src="<?= Yii::$app->params['imgUrl'] ?>'+imgUrl+'" />');
  189. $("div[name=xhQrTip]").css('left',left).css('top',top - 110).css("padding","2px").fadeIn();
  190. }
  191. }});
  192. }
  193. });
  194. $("div[name=xhQrTip]").click(function(){
  195. $(this).css("display","none");
  196. });
  197. $("a[name=sendActiveUrlToMobile]").click(function(){
  198. var activeId = $(this).attr('data-id');
  199. $.ajax({type:"get",url:'/active/send-active-url?activeId='+activeId,async:true,dataType:'json',success:function(data){
  200. xhPopMsg(data.msg,2000);
  201. }});
  202. });
  203. </script>