order.html 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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. </style>
  22. <body>
  23. <div class="layui-fluid">
  24. <div class="layui-row layui-col-space15">
  25. <div class="layui-col-md12" style="background-color:#ffffff">
  26. <div class="tplay-body-div">
  27. <div class="layui-tab">
  28. <ul class="layui-tab-title">
  29. <li class="layui-this" style="margin-left: 0px;">
  30. 已支付订单
  31. </li>
  32. <li>
  33. <a href="{:url('broad/order_no_pay')}">下单未支付</a>
  34. </li>
  35. <li>
  36. <a href="{:url('broad/present_order')}">进店礼订单</a>
  37. </li>
  38. <li>
  39. <a href="{:url('broad/gift')}">打赏订单</a>
  40. </li>
  41. <li>
  42. <a href="{:url('broad/order_course_pay')}">课程购买订单</a>
  43. </li>
  44. </ul>
  45. </div>
  46. <!-- <div class="layui-card"> -->
  47. <div class="layui-card-body">
  48. <div class="layui-form">
  49. <div class="layui-inline">
  50. <input class="layui-input" name="orderNo" id="orderNo" autocomplete="off"
  51. placeholder="搜索订单号..">
  52. </div>
  53. <div class="layui-inline">
  54. <input class="layui-input" name="course" id="course" autocomplete="off"
  55. placeholder="搜索活动名..">
  56. </div>
  57. <div class="layui-inline">
  58. <input class="layui-input" name="name" id="name" autocomplete="off" placeholder="搜索姓名..">
  59. </div>
  60. <div class="layui-inline">
  61. <input class="layui-input" name="mobile" id="mobile" autocomplete="off"
  62. placeholder="搜索手机号..">
  63. </div>
  64. <div class="layui-inline" style="width: 100px;">
  65. <select name="contact" id='contact'>
  66. <option value="">选择状态</option>
  67. <option value="0">未联系</option>
  68. <option value="1">已联系</option>
  69. </select>
  70. </div>
  71. <button class="layui-btn" data-type="reload"><i class="layui-icon layui-icon-search layuiadmin-button-btn"></i></button>
  72. <button class="layui-btn" id="export" style="float: right;">导出</button>
  73. </div>
  74. <table class="layui-hide" id="user" lay-filter="user"></table>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. {/block}
  81. {block name="js"}
  82. <script type="text/html" id="switchTpl">
  83. {{# if(d.isContact == 1){ }}
  84. 已联系
  85. {{# }else{ }}
  86. <a class="layui-btn layui-btn-xs enter" title="确认联系" data-value="{{d.id}}">确认联系</a>
  87. {{# } }}
  88. </script>
  89. <script>
  90. var indexurl = '{:url("broad/order")}';
  91. var t;
  92. layui.use(['table', 'form'], function () {
  93. var form = layui.form
  94. , table = layui.table
  95. , $ = layui.jquery
  96. , active = {
  97. reload: function () {
  98. var name = $('#name');
  99. var mobile = $('#mobile');
  100. var orderNo = $('#orderNo');
  101. var course = $('#course');
  102. var contact = $('#contact');
  103. var status = $('#status');
  104. //执行重载
  105. table.reload('userTable', {
  106. page: {
  107. curr: 1 //重新从第 1 页开始
  108. }
  109. , where: {
  110. name: name.val(),
  111. mobile: mobile.val(),
  112. orderNo: orderNo.val(),
  113. course: course.val(),
  114. contact: contact.val(),
  115. status: status.val()
  116. }
  117. });
  118. }
  119. };
  120. //展示已知数据
  121. t = table.render({
  122. elem: '#user'
  123. , url: indexurl
  124. , page: true
  125. , autoSort: true
  126. , cols: [[ //标题栏
  127. { type: 'numbers', title: '序号', fixed: 'left' }
  128. , { field: 'share_team', title: '所属团队', width: 100 }
  129. , { field: 'share_nickname', title: '邀请人昵称', width: 100 }
  130. , { field: 'nickname', title: '客户昵称', width: 100 }
  131. , { field: 'name', title: '姓名', width: 100 }
  132. , { field: 'mobile', title: '电话', width: 140, style: "color:green", align: 'center' }
  133. , { field: 'course_name', title: '活动名', minWidth: 200 }
  134. , { field: 'title', title: '商品名称', minWidth: 100 }
  135. , { field: 'order_no', title: '订单号', width: 150 ,templet: function (d) {
  136. return d.order_no + "\t";
  137. }}
  138. , { field: 'money', title: '订金', width: 80, sort: true }
  139. , { templet: function () { return '已发送' }, title: '短信通知', width: 110 }
  140. , { field: 'addtime', title: '下单时间', width: 160, sort: true }
  141. , { field: 'isContact', title: '操作', width: 100, templet: '#switchTpl', unresize: true, align: 'center' }
  142. ]]
  143. , id: 'userTable'
  144. });
  145. $('.layui-form>.layui-btn').on('click', function () {
  146. var type = $(this).data('type');
  147. active[type] ? active[type].call(this) : '';
  148. });
  149. table.on('sort(user)', function (obj) {
  150. table.reload('userTable', {
  151. initSort: obj
  152. , where: obj
  153. });
  154. });
  155. $('table').on('click', '.enter', function () {
  156. var that = this;
  157. var id = $(that).data('value');
  158. $.post('{:url("broad/order_edit_contact")}', { id: id, isContact: 1 }, function (res) {
  159. var resp = JSON.parse(res);
  160. if (resp.code == 0) {
  161. that.before('已联系');
  162. that.remove();
  163. layer.msg('操作成功', { anim: 0 }, function () {
  164. });
  165. } else {
  166. layer.msg(resp.msg, { anim: 6 });
  167. }
  168. });
  169. });
  170. $('#export').click(function () {
  171. var loading = layer.load(1, {shade: [0.6,'#fff']});
  172. var name = $('#name');
  173. var mobile = $('#mobile');
  174. var orderNo = $('#orderNo');
  175. var course = $('#course');
  176. var contact = $('#contact');
  177. var status = $('#status');
  178. $.ajax({
  179. type: 'post',
  180. url: '{:url("broad/order_export")}',
  181. data: {name: name.val(),mobile: mobile.val(),orderNo: orderNo.val(),course: course.val(),contact: contact.val(),status: status.val()},
  182. success: function (resp) {
  183. var res = JSON.parse(resp);
  184. table.exportFile('userTable', res, 'xls');
  185. layer.close(loading);
  186. }
  187. });
  188. });
  189. });
  190. </script>
  191. {/block}