截流自动化的商城平台
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

lists.html 7.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. {layout name="layout1" /}
  2. <div class="wrapper">
  3. <div class="layui-card">
  4. <!-- 操作提示 -->
  5. <div class="layui-card-body">
  6. <div class="layui-collapse" style="border:1px dashed #c4c4c4">
  7. <div class="layui-colla-item">
  8. <h2 class="layui-colla-title like-layui-colla-title">操作提示</h2>
  9. <div class="layui-colla-content layui-show">
  10. <p>*商家需要设置好提现账号才能申请提现。</p>
  11. </div>
  12. </div>
  13. </div>
  14. </div>
  15. <div class="layui-card-body">
  16. <div class="layui-tab layui-tab-brief">
  17. <ul class="layui-tab-title">
  18. <li <?php if (request()->controller() == 'Bank') { echo 'class="layui-this"'; } ?>><a href="{:url('bank/lists')}">银行卡</a></li>
  19. <li <?php if (request()->controller() == 'Alipay') { echo 'class="layui-this"'; } ?>><a href="{:url('alipay/lists')}">支付宝</a></li>
  20. </ul>
  21. </div>
  22. </div>
  23. <!-- 主体区域 -->
  24. <div class="layui-card-body">
  25. <button type="button" class="layui-btn layui-btn-normal layui-btn-sm layEvent" lay-event="add">新增提现账号</button>
  26. <table id="like-table-lists" lay-filter="like-table-lists"></table>
  27. <script type="text/html" id="table-image">
  28. {{# if(d.image){ }}
  29. <img src="{{d.image}}" alt="图标" style="width:28px;height:28px;">
  30. {{# } }}
  31. </script>
  32. <script type="text/html" id="table-operation">
  33. <a class="layui-btn layui-btn-primary layui-btn-sm" lay-event="detail">详情</a>
  34. <a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="edit">编辑</a>
  35. <a class="layui-btn layui-btn-danger layui-btn-sm" lay-event="del">删除</a>
  36. </script>
  37. </div>
  38. </div>
  39. </div>
  40. <script>
  41. layui.use(["table", "form"], function(){
  42. var table = layui.table;
  43. var form = layui.form;
  44. like.tableLists("#like-table-lists", "{:url()}", [
  45. {field:"id", width:60, title:"ID"}
  46. ,{field:"name", width:160, align:"center", title:"提现银行"}
  47. ,{field:"branch", width:120, align:"center", title:"银行支行"}
  48. ,{field:"nickname", width:120, align:"center", title:"开户名称"}
  49. ,{field:"account", width:200, align:"center", title:"银行账号"}
  50. ,{title:"操作", width:200, align:"center", fixed:"right", toolbar:"#table-operation"}
  51. ]);
  52. var active = {
  53. add: function() {
  54. layer.open({
  55. type: 2
  56. ,title: "新增提现账号"
  57. ,content: "{:url('bank/add')}"
  58. ,area: ["550px", "500px"]
  59. ,btn: ["确定", "取消"]
  60. ,yes: function(index, layero){
  61. var iframeWindow = window["layui-layer-iframe" + index];
  62. var submit = layero.find("iframe").contents().find("#addSubmit");
  63. iframeWindow.layui.form.on("submit(addSubmit)", function(data){
  64. like.ajax({
  65. url: "{:url('Bank/add')}",
  66. data: data.field,
  67. type: "POST",
  68. success:function(res) {
  69. if(res.code === 1) {
  70. layui.layer.msg(res.msg);
  71. layer.close(index);
  72. table.reload("like-table-lists", {
  73. where: {},
  74. page: { cur: 1 }
  75. });
  76. }
  77. }
  78. });
  79. });
  80. submit.trigger("click");
  81. }
  82. });
  83. },
  84. edit: function(obj) {
  85. layer.open({
  86. type: 2
  87. ,title: "编辑提现账号"
  88. ,content: "{:url('Bank/edit')}?id=" + obj.data.id
  89. ,area: ["550px", "500px"]
  90. ,btn: ["确定", "取消"]
  91. ,yes: function(index, layero){
  92. var iframeWindow = window["layui-layer-iframe" + index];
  93. var submit = layero.find("iframe").contents().find("#addSubmit");
  94. iframeWindow.layui.form.on("submit(addSubmit)", function(data){
  95. data.field['id'] = obj.data.id;
  96. like.ajax({
  97. url: "{:url('Bank/edit')}",
  98. data: data.field,
  99. type: "POST",
  100. success:function(res) {
  101. if(res.code === 1) {
  102. layui.layer.msg(res.msg);
  103. layer.close(index);
  104. table.reload("like-table-lists", {
  105. where: {},
  106. page: { cur: 1 }
  107. });
  108. }
  109. }
  110. });
  111. });
  112. submit.trigger("click");
  113. }
  114. });
  115. },
  116. del: function(obj) {
  117. layer.confirm("确定删除提现账号:"+obj.data.name, function(index) {
  118. like.ajax({
  119. url: "{:url('Bank/del')}",
  120. data: {id: obj.data.id},
  121. type: "POST",
  122. success: function (res) {
  123. if (res.code === 1) {
  124. layui.layer.msg(res.msg);
  125. layer.close(index);
  126. obj.del();
  127. }
  128. }
  129. });
  130. layer.close(index);
  131. })
  132. },
  133. detail: function (obj) {
  134. layer.open({
  135. type: 2
  136. ,title: "账号详细"
  137. ,content: "{:url('Bank/detail')}?id=" + obj.data.id
  138. ,area: ["500px", "400px"]
  139. });
  140. }
  141. };
  142. like.eventClick(active);
  143. form.on("submit(search)", function(data){
  144. table.reload("like-table-lists", {
  145. where: data.field,
  146. page: {
  147. curr: 1
  148. }
  149. });
  150. });
  151. form.on("submit(clear-search)", function(){
  152. $("#name").val("");
  153. form.render("select");
  154. table.reload("like-table-lists", {
  155. where: {},
  156. page: {
  157. curr: 1
  158. }
  159. });
  160. });
  161. })
  162. </script>