截流自动化的商城平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

recharge.html 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. {layout name="layout1" /}
  2. <style>
  3. .layui-table-cell {
  4. height:auto;
  5. }
  6. .goods-content>div:not(:last-of-type) {
  7. brecharge-bottom:1px solid #DCDCDC;
  8. }
  9. .goods-data::after{
  10. display: block;
  11. content: '';
  12. clear: both;
  13. }
  14. .goods_name_hide{
  15. overflow:hidden;
  16. white-space:nowrap;
  17. text-overflow: ellipsis;
  18. }
  19. .operation-btn {
  20. margin: 5px;
  21. }
  22. .table-operate{
  23. text-align: left;
  24. font-size:14px;
  25. padding:0 5px;
  26. height:auto;
  27. overflow:visible;
  28. text-overflow:inherit;
  29. white-space:normal;
  30. word-break: break-all;
  31. }
  32. </style>
  33. <div class="wrapper">
  34. <div class="layui-card">
  35. <div class="layui-card-body">
  36. <div class="layui-collapse like-layui-collapse" lay-accordion="" style="brecharge:1px dashed #c4c4c4">
  37. <div class="layui-colla-item">
  38. <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
  39. <div class="layui-colla-content layui-show">
  40. <p>*查看会员充值订单。</p>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. <div class="layui-tab layui-tab-card" lay-filter="tab-all">
  46. <div class="layui-card-body layui-form">
  47. <div class="layui-form-item">
  48. <div class="layui-row">
  49. <div class="layui-inline">
  50. <label class="layui-form-label">订单搜索:</label>
  51. <div class="layui-input-block">
  52. <select name="search_key">
  53. <option >全部</option>
  54. <option value="order_sn">订单编号</option>
  55. <option value="nickname">会员昵称</option>
  56. <option value="user_mobile">会员手机号码</option>
  57. </select>
  58. </div>
  59. </div>
  60. <div class="layui-inline">
  61. <input type="text" name="keyword" id="keyword" placeholder="请输入搜索内容"
  62. autocomplete="off" class="layui-input">
  63. </div>
  64. <div class="layui-inline">
  65. <label class="layui-form-label">订单来源:</label>
  66. <div class="layui-input-block">
  67. <select name="order_source" id="order_source">
  68. <option value="">全部</option>
  69. {foreach $order_source as $item => $val}
  70. <option value="{$item}">{$val}</option>
  71. {/foreach}
  72. </select>
  73. </div>
  74. </div>
  75. <div class="layui-inline">
  76. <label class="layui-form-label">订单状态:</label>
  77. <div class="layui-input-inline">
  78. <select name="pay_status" id="pay_status">
  79. <option value="0">全部</option>
  80. <option value="2">待支付</option>
  81. <option value="1">已完成</option>
  82. </select>
  83. </div>
  84. </div>
  85. <div class="layui-inline">
  86. <label class="layui-form-label">付款方式:</label>
  87. <div class="layui-input-block">
  88. <select name="pay_way" id="pay_way">
  89. <option value="">全部</option>
  90. {foreach $pay_way as $item => $val}
  91. <option value="{$item}">{$val}</option>
  92. {/foreach}
  93. </select>
  94. </div>
  95. </div>
  96. <div class="layui-inline">
  97. <label class="layui-form-label">下单时间:</label>
  98. <div class="layui-input-inline">
  99. <div class="layui-input-inline">
  100. <input type="text" name="start_time" class="layui-input" id="start_time"
  101. placeholder="" autocomplete="off">
  102. </div>
  103. </div>
  104. <div class="layui-input-inline" style="margin-right: 5px;width: 20px;">
  105. <label class="layui-form-mid">至</label>
  106. </div>
  107. <div class="layui-input-inline">
  108. <input type="text" name="end_time" class="layui-input" id="end_time"
  109. placeholder="" autocomplete="off">
  110. </div>
  111. </div>
  112. <div class="layui-inline">
  113. <div class="layui-btn-group">
  114. <button type="button" id="today" day="1" class="layui-btn layui-btn-sm layui-btn-normal day">今天</button>
  115. <button type="button" day="-1" class="layui-btn layui-btn-sm layui-btn-primary day">昨天</button>
  116. <button type="button" day="7" class="layui-btn layui-btn-sm layui-btn-primary day">近7天</button>
  117. <button type="button" day="30" class="layui-btn layui-btn-sm layui-btn-primary day">近30天</button>
  118. </div>
  119. </div>
  120. <div class="layui-inline">
  121. <button class="layui-btn layui-btn-sm layuiadmin-btn-ad {$view_theme_color}" lay-submit
  122. lay-filter="recharge-search">查询
  123. </button>
  124. <button class="layui-btn layui-btn-sm layuiadmin-btn-ad layui-btn-primary " lay-submit
  125. lay-filter="recharge-clear-search">重置
  126. </button>
  127. <button class="layui-btn layui-btn-sm layuiadmin-btn-ad layui-btn-primary " lay-submit
  128. lay-filter="data-export">导出
  129. </button>
  130. </div>
  131. </div>
  132. </div>
  133. </div>
  134. <div class="layui-tab-item layui-show">
  135. <div class="layui-card">
  136. <div class="layui-card-body">
  137. <table id="recharge-lists" lay-filter="recharge-lists"></table>
  138. </div>
  139. </div>
  140. </div>
  141. </div>
  142. </div>
  143. </div>
  144. <script>
  145. layui.config({
  146. version:"{$front_version}",
  147. base: '/static/lib/' //静态资源所在路径
  148. }).use(['form'], function(){
  149. var $ = layui.$
  150. , form = layui.form
  151. , table = layui.table
  152. , element = layui.element
  153. , laydate = layui.laydate;
  154. //图片放大
  155. $(document).on('click', '.image-show', function () {
  156. var src = $(this).attr('src');
  157. like.showImg(src,400);
  158. });
  159. //监听搜索
  160. form.on('submit(recharge-search)', function (data) {
  161. var field = data.field;
  162. //执行重载
  163. table.reload('recharge-lists', {
  164. where: field,
  165. page: {
  166. curr: 1
  167. }
  168. });
  169. });
  170. // 导出
  171. form.on('submit(data-export)', function (data) {
  172. var field = data.field;
  173. like.ajax({
  174. url: '{:url("finance.User/rechargeExport")}'
  175. , data: field
  176. , type: 'get'
  177. , success: function (res) {
  178. if (res.code == 1) {
  179. window.location.href = res.data.url;
  180. }
  181. }
  182. });
  183. });
  184. //清空查询
  185. form.on('submit(recharge-clear-search)', function () {
  186. $('#keyword').val('');
  187. $('#recharge_status').val('');
  188. $('#pay_status').val('');
  189. $('#pay_way').val('');
  190. $('#order_source').val('');
  191. $('#recharge_type').val('');
  192. $('#delivery_type').val('');
  193. $('#start_time').val('{$today[0]}');
  194. $('#end_time').val('{$today[1]}');
  195. $('#today').trigger("click");
  196. form.render('select');
  197. //刷新列表
  198. table.reload('recharge-lists', {
  199. where: [],
  200. page: {
  201. curr: 1
  202. }
  203. });
  204. });
  205. //日期时间范围
  206. laydate.render({
  207. elem: '#start_time'
  208. , type: 'datetime'
  209. ,theme: '#1E9FFF'
  210. , value: "{$today[0]}"
  211. });
  212. laydate.render({
  213. elem: '#end_time'
  214. , type: 'datetime'
  215. ,theme: '#1E9FFF'
  216. ,value: "{$today[1]}"
  217. });
  218. //获取列表
  219. getList('');
  220. //切换列表
  221. element.on('tab(tab-all)', function (data) {
  222. $('#keyword').val('');
  223. $('#recharge_status').val('');
  224. $('#goods_name').val('');
  225. $('#pay_way').val('');
  226. $('#order_status').val('');
  227. $('#recharge_type').val('');
  228. $('#start_time').val('');
  229. $('#end_time').val('');
  230. $('#delivery_type').val('');
  231. form.render('select');
  232. var type = $(this).attr('data-type');
  233. getList(type);
  234. if (type !== ''){
  235. $('.recharge_status').hide();
  236. }else {
  237. $('.recharge_status').show();
  238. }
  239. });
  240. function getList(type) {
  241. table.render({
  242. elem: '#recharge-lists'
  243. , url: '{:url("finance.User/recharge")}'
  244. , cols: [[
  245. {field: 'order_sn', title: '订单编号', align: 'center',width:220}
  246. , {field: 'nickname', title: '用户昵称', align: 'center',width:220}
  247. , {field: 'mobile', title: '用户手机号', align: 'center',width:180}
  248. , {field: 'order_amount', title: '充值金额', align: 'center',width:180}
  249. , {field: 'give_money', title: '赠送金额', align: 'center',width:120}
  250. , {field: 'give_growth', title: '赠送成长值', align: 'center',width:120}
  251. , {field: 'pay_way', title: '支付方式', align: 'center',width:115}
  252. , {field: 'pay_time', title: '支付时间', align: 'center',width:120}
  253. , {field: 'pay_status', title: '订单状态', align: 'center',width:120}
  254. , {field: 'create_time', title: '下单时间', align: 'center',width:220}
  255. ]]
  256. , page: true
  257. , text: {none: '暂无数据!'}
  258. ,response: {
  259. statusCode: 1
  260. }
  261. , parseData: function (res) {
  262. return {
  263. "code": res.code,
  264. "msg": res.msg,
  265. "count": res.data.count,
  266. "data": res.data.lists,
  267. };
  268. }
  269. ,done: function(res, curr, count){
  270. // 解决操作栏因为内容过多换行问题
  271. $(".layui-table-main tr").each(function (index, val) {
  272. $($(".layui-table-fixed-l .layui-table-body tbody tr")[index]).height($(val).height());
  273. $($(".layui-table-fixed-r .layui-table-body tbody tr")[index]).height($(val).height());
  274. });
  275. }
  276. });
  277. }
  278. $('.day').click(function(){
  279. $('.day').removeClass('layui-btn-normal');
  280. $('.day').removeClass('layui-btn-primary');
  281. $('.day').addClass('layui-btn-primary');
  282. $(this).removeClass('layui-btn-primary');
  283. $(this).addClass('layui-btn-normal');
  284. var day = $(this).attr('day');
  285. switch (day) {
  286. case '-1':
  287. $('#start_time').val('{$yesterday[0]}');
  288. $('#end_time').val('{$yesterday[1]}');
  289. break;
  290. case '1':
  291. $('#start_time').val('{$today[0]}');
  292. $('#end_time').val('{$today[1]}');
  293. break;
  294. case '7':
  295. $('#start_time').val('{$days_ago7[0]}');
  296. $('#end_time').val('{$days_ago7[1]}');
  297. break;
  298. case '30':
  299. $('#start_time').val('{$days_ago30[0]}');
  300. $('#end_time').val('{$days_ago30[1]}');
  301. break;
  302. }
  303. });
  304. });
  305. </script>