present_order.html 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. {extend name="public/layout"}
  2. {block name="body"}
  3. <style>
  4. .layui-table thead tr,
  5. .layui-table-header {
  6. background-color: #D8E6F1 !important;
  7. }
  8. .layui-tab-title .layui-this {
  9. background-color: #249EFB;
  10. color: #fff;
  11. }
  12. .layui-tab-title .layui-this:after {
  13. border-bottom: none;
  14. border: none;
  15. }
  16. .layui-tab-title li {
  17. background-color: #F2F2F2;
  18. margin: 0px 5px;
  19. padding: 0px 20px;
  20. }
  21. .layui-btn-xs,.layui-btn-xs:hover {
  22. border: 1px solid #249EFB;
  23. background-color: #fff;
  24. color: #249EFB;
  25. padding: 0px 10px;
  26. }
  27. .layui-btn-danger,.layui-btn-danger:hover{
  28. color: #FF5722;
  29. background-color: #fff;
  30. border: 1px solid #FF5722;
  31. padding: 0px 10px;
  32. }
  33. </style>
  34. <body>
  35. <div class="layui-fluid">
  36. <div class="layui-row layui-col-space15">
  37. <div class="layui-col-md12" style="background-color:#ffffff">
  38. <div class="tplay-body-div">
  39. <div class="layui-tab">
  40. <ul class="layui-tab-title">
  41. <li style="margin-left: 0px;">
  42. <a href="{:url('broad/order')}">已支付订单</a>
  43. </li>
  44. <li>
  45. <a href="{:url('broad/order_no_pay')}">下单未支付</a>
  46. </li>
  47. <li class="layui-this">
  48. 进店礼订单
  49. </li>
  50. <li>
  51. <a href="{:url('broad/gift')}">打赏订单</a>
  52. </li>
  53. <li>
  54. <a href="{:url('broad/order_course_pay')}">课程购买订单</a>
  55. </li>
  56. </ul>
  57. </div>
  58. <div class="layui-card-body">
  59. <div class="layui-form">
  60. <div class="layui-inline">
  61. <select name="course_id" id="course_id">
  62. <option value="">选择活动</option>
  63. {volist name="course" id="vo"}
  64. <option value="{$vo.cid}">{$vo.title}</option>
  65. {/volist}
  66. </select>
  67. </div>
  68. <div class="layui-inline">
  69. <input type="text" class="layui-input" id="date" placeholder="开始日期 - 结束日期"
  70. autocomplete="off">
  71. </div>
  72. <div class="layui-inline">
  73. <select name="status" id="status">
  74. <option value="">选择状态</option>
  75. <option value="0">未进店</option>
  76. <option value="1">已进店</option>
  77. </select>
  78. </div>
  79. <button class="layui-btn" data-type="reload"><i class="layui-icon layui-icon-search layuiadmin-button-btn"></i></button>
  80. </div>
  81. <table class="layui-hide" id="user" lay-filter="user"></table>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. {/block}
  88. {block name="js"}
  89. <script type="text/html" id="bt">
  90. {{# if(d.state == 1){ }}
  91. 已进店
  92. {{# }else{ }}
  93. <a class="layui-btn layui-btn-xs enter" title="确认到店" data-value="{{d.id}}">确认到店</a>
  94. {{# } }}
  95. </script>
  96. <script>
  97. var indexurl = '{:url("broad/present_order")}';
  98. var enterurl = '{:url("broad/present_enter_shop")}';
  99. var t;
  100. layui.use(['table', 'laydate'], function () {
  101. var form = layui.form
  102. , table = layui.table
  103. , laydate = layui.laydate
  104. , $ = layui.jquery
  105. , active = {
  106. reload: function () {
  107. var course_id = $('#course_id');
  108. var date = $('#date');
  109. var status = $('#status');
  110. //执行重载
  111. table.reload('userTable', {
  112. page: {
  113. curr: 1 //重新从第 1 页开始
  114. }
  115. , where: {
  116. course_id: course_id.val(),
  117. date: date.val(),
  118. status: status.val()
  119. }
  120. });
  121. }
  122. };
  123. laydate.render({
  124. elem: '#date'
  125. , range: true
  126. , type: 'date'
  127. });
  128. //展示已知数据
  129. t = table.render({
  130. elem: '#user'
  131. , url: indexurl
  132. , page: true
  133. , autoSort: true
  134. , cols: [[ //标题栏
  135. { type: 'numbers', title: '序号', fixed: 'left', width: 50 }
  136. , { field: 'nickname', title: '昵称', width: 100 }
  137. , { field: 'mobile', title: '电话', width: 140, style: "color:green", align: 'center' }
  138. , { field: 'title', title: '活动', minWidth: 200 }
  139. , { field: 'content', title: '进店礼' }
  140. , { field: 'addtime', title: '报名时间', width: 180, sort: true }
  141. , { fixed: 'right', title: '操作', toolbar: '#bt', width: 100, align: 'center' }
  142. ]]
  143. , id: 'userTable'
  144. });
  145. $('table').on('click', '.enter', function () {
  146. var that = this;
  147. var id = $(that).data('value');
  148. $.post(enterurl, { id: id }, function (res) {
  149. var resp = JSON.parse(res);
  150. if (resp.code == 0) {
  151. that.before('已进店');
  152. that.remove();
  153. layer.msg('操作成功', { anim: 0 }, function () {
  154. });
  155. } else {
  156. layer.msg(resp.msg, { anim: 6 });
  157. }
  158. });
  159. });
  160. form.on('switch(enter)', function (obj) {
  161. var that = $(obj.elem);
  162. var id = this.value;
  163. $.post(enterurl, { id: id }, function (res) {
  164. if (res.code == 0) {
  165. that.remove();
  166. layer.msg('操作成功', { anim: 0 }, function () {
  167. });
  168. } else {
  169. layer.msg(res.mgs, { anim: 6 });
  170. }
  171. });
  172. });
  173. $('.layui-form>.layui-btn').on('click', function () {
  174. var type = $(this).data('type');
  175. active[type] ? active[type].call(this) : '';
  176. });
  177. });
  178. </script>
  179. {/block}