order_no_pay.html 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  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 style="margin-left: 0px;">
  30. <a href="{:url('broad/order')}">已支付订单</a>
  31. </li>
  32. <li class="layui-this">
  33. 下单未支付
  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-body">
  47. <div class="layui-form">
  48. <!-- <div class="layui-inline">
  49. <input class="layui-input" name="orderNo" id="orderNo" autocomplete="off" placeholder="订单号">
  50. </div> -->
  51. <div class="layui-inline">
  52. <input class="layui-input" name="course" id="course" autocomplete="off"
  53. placeholder="搜索活动名..">
  54. </div>
  55. <div class="layui-inline">
  56. <input class="layui-input" name="name" id="name" autocomplete="off" placeholder="搜索姓名..">
  57. </div>
  58. <div class="layui-inline">
  59. <input class="layui-input" name="mobile" id="mobile" autocomplete="off"
  60. placeholder="搜索手机号..">
  61. </div>
  62. <!-- <div class="layui-inline" style="width: 100px;">
  63. <select name="status" id='status'>
  64. <option value="">全部</option>
  65. <option value="0">未支付</option>
  66. <option value="1">已支付</option>
  67. </select>
  68. </div> -->
  69. <div class="layui-inline" style="width: 100px;">
  70. <select name="contact" id='contact'>
  71. <option value="">选择状态</option>
  72. <option value="0">未联系</option>
  73. <option value="1">已联系</option>
  74. </select>
  75. </div>
  76. <button class="layui-btn" data-type="reload"><i class="layui-icon layui-icon-search layuiadmin-button-btn"></i></button>
  77. </div>
  78. <table class="layui-hide" id="user" lay-filter="user"></table>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. {/block}
  85. {block name="js"}
  86. <script type="text/html" id="switchTpl">
  87. <!-- {{# if(d.isContact == 1){ }}
  88. <a class="layui-btn layui-btn-xs sms" title="促单" data-course="{{d.cid}}" data-user="{{d.uid}}" data-goods="{{d.gid}}" data-name="{{d.name}}" data-mobile="{{d.mobile}}">促单</a>
  89. {{# }else{ }}
  90. {{# } }} -->
  91. {{# if(d.isContact == 1){ }}
  92. 已联系
  93. {{# }else{ }}
  94. <a class="layui-btn layui-btn-xs enter" title="确认促单" data-user="{{d.uid}}" data-course="{{d.cid}}"
  95. data-goods="{{d.gid}}" data-name="{{d.name}}" data-mobile="{{d.mobile}}">确认促单</a>
  96. {{# } }}
  97. </script>
  98. <script type="text/html" id="statusField">
  99. {{ d.status == 1 ? '支付成功' : '否' }}
  100. </script>
  101. <script type="text/html" id="mb">
  102. <div class="mb" data-type="评分原因:<br>在{{d.start}}<br>至{{d.end}}之间,<br>试图下单{{d.num}}次未支付成功">
  103. {{# if(d.num == 1){ }}
  104. <strong>C</strong>
  105. {{# }else if(d.num > 3){ }}
  106. <strong style="color:red">A</strong>
  107. {{# }else{ }}
  108. <strong style="color:#1e95f2">B</strong>
  109. {{# } }}
  110. </div>
  111. </script>
  112. <script>
  113. var indexurl = '{:url("broad/order_no_pay")}';
  114. var t;
  115. layui.use(['table', 'form'], function () {
  116. var form = layui.form
  117. , table = layui.table
  118. , $ = layui.jquery
  119. , active = {
  120. reload: function () {
  121. var name = $('#name');
  122. var mobile = $('#mobile');
  123. var orderNo = $('#orderNo');
  124. var course = $('#course');
  125. var contact = $('#contact');
  126. var status = $('#status');
  127. //执行重载
  128. table.reload('userTable', {
  129. page: {
  130. curr: 1 //重新从第 1 页开始
  131. }
  132. , where: {
  133. name: name.val(),
  134. mobile: mobile.val(),
  135. orderNo: orderNo.val(),
  136. course: course.val(),
  137. contact: contact.val(),
  138. status: status.val()
  139. }
  140. });
  141. }
  142. };
  143. //展示已知数据
  144. t = table.render({
  145. elem: '#user'
  146. , url: indexurl
  147. , page: true
  148. , autoSort: true
  149. , cols: [[ //标题栏
  150. { type: 'numbers', title: '序号', fixed: 'left' }
  151. , { field: 'share_team', title: '所属团队', width: 100 }
  152. , { field: 'share_nickname', title: '邀请人昵称', width: 100 }
  153. , { field: 'nickname', title: '客户昵称', width: 100 }
  154. , { field: 'name', title: '姓名', width: 100 }
  155. , { field: 'mobile', title: '电话', width: 140, style: "color:green", align: 'center' }
  156. , { field: 'course_name', title: '活动名', minWidth: 200 }
  157. , { field: 'title', title: '商品名称', width: 200 }
  158. , { field: 'num', templet: '#mb', title: '意向评分', width: 120, sort: true, align: 'center' }
  159. , { field: 'end', title: '最后触发时间', width: 170, sort: true }
  160. , { field: 'isContact', title: '操作', width: 100, templet: '#switchTpl', unresize: true, align: 'center' }
  161. ]]
  162. , id: 'userTable'
  163. });
  164. $('.layui-form>.layui-btn').on('click', function () {
  165. var type = $(this).data('type');
  166. active[type] ? active[type].call(this) : '';
  167. });
  168. table.on('sort(user)', function (obj) {
  169. table.reload('userTable', {
  170. initSort: obj
  171. , where: obj
  172. });
  173. });
  174. $('table').on('click', '.enter', function () {
  175. var that = $(this);
  176. var user = that.data('user');
  177. var course = that.data('course');
  178. var goods = that.data('goods');
  179. var name = that.data('name');
  180. var mobile = that.data('mobile');
  181. $.post('{:url("broad/order_contact")}', { uid: user, cid: course, gid: goods, isContact: 1, name: name, mobile: mobile }, function (res) {
  182. var resp = JSON.parse(res);
  183. if (resp.code == 0) {
  184. that.before('已联系');
  185. that.remove();
  186. layer.msg('操作成功', { anim: 0 }, function () {
  187. });
  188. } else {
  189. layer.msg(resp.msg, { anim: 6 });
  190. }
  191. });
  192. });
  193. // $('table').on('click', '.sms', function () {
  194. // var that = $(this);
  195. // var user = that.data('user');
  196. // var course = that.data('course');
  197. // var goods = that.data('goods');
  198. // var name = that.data('name');
  199. // var mobile = that.data('mobile');
  200. // $.post('{:url("order/contact")}', { uid: user, cid: course, gid: goods, isContact: 1, name: name, mobile: mobile }, function (res) {
  201. // if (res.code == 0) {
  202. // that.before('已发送');
  203. // that.remove();
  204. // layer.msg('操作成功', { anim: 0 }, function () {
  205. // });
  206. // } else {
  207. // layer.msg(res.mgs, { anim: 6 });
  208. // }
  209. // });
  210. // });
  211. $('body').on('mouseover', '.mb', function () {
  212. var type = $(this).data('type');
  213. layer.tips(type, this, {
  214. tips: [1, '#3595CC'],
  215. time: 2000
  216. });
  217. });
  218. });
  219. </script>
  220. {/block}