membersend.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <extend name="Public:base" />
  2. <block name="content">
  3. <div class="row">
  4. <div class="col-xs-12">
  5. <div class="alert alert-info">
  6. <i class="icon-hand-right"></i>
  7. 请从<a href="{:U('Member/index', array('order_status_id' => 1))}">《前台用户》</a>中导出指定会员的excel后,进行上传发送指定优惠券,<font color="red"></font>
  8. <button class="close" data-dismiss="alert">
  9. <i class="icon-remove"></i>
  10. </button>
  11. </div>
  12. <div class="table-responsive">
  13. <table class="table table-striped table-bordered table-hover">
  14. <thead>
  15. <tr>
  16. <th>编号</th>
  17. <th>优惠券名称</th>
  18. <th>优惠券金额</th>
  19. <th>订单满多少可用</th>
  20. <th>总生成张数</th>
  21. <th>已发送张数</th>
  22. <th>状态</th>
  23. <th>使用时间</th>
  24. </tr>
  25. </thead>
  26. <tbody>
  27. <tr>
  28. <td>{$data.id}</td>
  29. <td>{$data.voucher_title}</td>
  30. <td>{$data.credit}</td>
  31. <td>{$data.limit_money}</td>
  32. <td>{$data.total_count}</td>
  33. <td>{$data.send_count}</td>
  34. <td>
  35. <?php
  36. if($data['total_count'] > $data['send_count']){
  37. echo '<span class="green bold">剩余'.($data['total_count'] - $data['send_count']).'张</font>';
  38. }else {
  39. echo '<span class="red bold">已发完</font>';
  40. }
  41. ?>
  42. </td>
  43. <td>
  44. 开始时间:<?php echo date('Y-m-d H:i:s',$data['begin_time']); ?>
  45. <br/>
  46. 结束时间:<?php echo date('Y-m-d H:i:s', $data['end_time']); ?>
  47. </td>
  48. </tr>
  49. </tbody>
  50. </table>
  51. </div>
  52. <div id="thumb">
  53. <a href="#" data-toggle="image" class="img-thumbnail">
  54. <img osctype="image" data-placeholder="__ROOT__/Common/image/no_image_100x100.jpg" src="__ROOT__/Common/image/no_image_100x100.jpg" />
  55. </a>
  56. <input osctype="image_input" type="hidden" name="image" value="" id="input-image" />
  57. </div>
  58. <div id="dropzone">
  59. </div>
  60. </div>
  61. </div>
  62. </block>
  63. <block name="javascript">
  64. <script src="__PUBLIC__/ztree/jquery.ztree.all-3.5.min.js"></script>
  65. <script src="__PUBLIC__/fileupload/jquery.ui.widget.js"></script>
  66. <script src="__PUBLIC__/fileupload/jquery.fileupload.js"></script>
  67. <script>
  68. $(function(){
  69. <present name="Think.get.id">
  70. Oscshop.setValue("status", {$blog.status|default=1});
  71. Oscshop.setValue("allow_reply", {$blog.allow_reply|default=1});
  72. </present>
  73. // tooltips on hover button-upload
  74. $('[data-toggle=\'tooltip\']').tooltip({container: 'body', html: true});
  75. // Makes tooltips work on ajax generated content
  76. $(document).ajaxStop(function() {
  77. $('[data-toggle=\'tooltip\']').tooltip({container: 'body'});
  78. });
  79. $(document).delegate('a[data-toggle=\'image\']', 'click', function(e) {
  80. e.preventDefault();
  81. var index=$(this).attr('num');
  82. var element = this;
  83. if(index==undefined){
  84. $(element).popover({
  85. html: true,
  86. placement: 'right',
  87. trigger: 'manual',
  88. content: function() {
  89. return '<button type="button" id="thumb-image" class="btn btn-primary"><i class="icon-edit"></i></button> <button type="button" id="button-clear" class="btn btn-danger"><i class="icon-trash"></i></button>';
  90. }
  91. });
  92. }else{
  93. $(element).popover({
  94. html: true,
  95. placement: 'right',
  96. trigger: 'manual',
  97. content: function() {
  98. return '<button type="button" n="'+index+'" class="btn btn-primary button-image"><i class="icon-edit"></i></button> <button type="button" id="button-clear" class="btn btn-danger"><i class="icon-trash"></i></button>';
  99. }
  100. });
  101. }
  102. $(element).popover('toggle');
  103. //博客图片
  104. $('#thumb-image').on('click', function() {
  105. $('#modal-image').remove();
  106. $('#form-upload').remove();
  107. $('body').prepend('<form enctype="multipart/form-data" id="form-upload" style="display: none;"><input osctype="btn_upload_image" type="file" name="file" /></form>');
  108. $('#form-upload input[name=\'file\']').trigger('click');
  109. $(element).popover('hide');
  110. $('[osctype="btn_upload_image"]').fileupload({
  111. dataType: 'json',
  112. url: "{:U('Voucher/sendvoucher_tomember_excel_done',array('dir'=>'category','voucher_id' => $id))}",
  113. add: function(e, data) {
  114. $parent = $('#thumb');
  115. $input = $parent.find('[osctype="image_input"]');
  116. $img = $parent.find('[osctype="image"]');
  117. data.formData = {old_blog_images:$input.val()};
  118. $img.attr('src', "__IMG__/loading.gif");
  119. data.submit();
  120. },
  121. done: function (e,data) {
  122. alert('批量送券成功');
  123. location.href =location.href;
  124. return false;
  125. }
  126. });
  127. });
  128. $('#button-clear').on('click', function() {
  129. $(element).find('img').attr('src', $(element).find('img').attr('data-placeholder'));
  130. $(element).parent().find('input').attr('value', '');
  131. $(element).popover('hide');
  132. });
  133. });
  134. });
  135. </script>
  136. </block>