截流自动化的商城平台
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.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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:"account", width:160, align:"center", title:"支付宝账号"}
  47. ,{field:"username", width:120, align:"center", title:"认证姓名"}
  48. ,{title:"操作", width:200, align:"center", fixed:"right", toolbar:"#table-operation"}
  49. ]);
  50. var active = {
  51. add: function() {
  52. layer.open({
  53. type: 2
  54. ,title: "新增提现账号"
  55. ,content: "{:url('Alipay/add')}"
  56. ,area: ["550px", "500px"]
  57. ,btn: ["确定", "取消"]
  58. ,yes: function(index, layero){
  59. var iframeWindow = window["layui-layer-iframe" + index];
  60. var submit = layero.find("iframe").contents().find("#addSubmit");
  61. iframeWindow.layui.form.on("submit(addSubmit)", function(data){
  62. like.ajax({
  63. url: "{:url('Alipay/add')}",
  64. data: data.field,
  65. type: "POST",
  66. success:function(res) {
  67. if(res.code === 1) {
  68. layui.layer.msg(res.msg);
  69. layer.close(index);
  70. table.reload("like-table-lists", {
  71. where: {},
  72. page: { cur: 1 }
  73. });
  74. }
  75. }
  76. });
  77. });
  78. submit.trigger("click");
  79. }
  80. });
  81. },
  82. edit: function(obj) {
  83. layer.open({
  84. type: 2
  85. ,title: "编辑提现账号"
  86. ,content: "{:url('Alipay/edit')}?id=" + obj.data.id
  87. ,area: ["550px", "500px"]
  88. ,btn: ["确定", "取消"]
  89. ,yes: function(index, layero){
  90. var iframeWindow = window["layui-layer-iframe" + index];
  91. var submit = layero.find("iframe").contents().find("#addSubmit");
  92. iframeWindow.layui.form.on("submit(addSubmit)", function(data){
  93. data.field['id'] = obj.data.id;
  94. like.ajax({
  95. url: "{:url('Alipay/edit')}",
  96. data: data.field,
  97. type: "POST",
  98. success:function(res) {
  99. if(res.code === 1) {
  100. layui.layer.msg(res.msg);
  101. layer.close(index);
  102. table.reload("like-table-lists", {
  103. where: {},
  104. page: { cur: 1 }
  105. });
  106. }
  107. }
  108. });
  109. });
  110. submit.trigger("click");
  111. }
  112. });
  113. },
  114. del: function(obj) {
  115. layer.confirm("确定删除提现账号:"+obj.data.account, function(index) {
  116. like.ajax({
  117. url: "{:url('Alipay/del')}",
  118. data: {id: obj.data.id},
  119. type: "POST",
  120. success: function (res) {
  121. if (res.code === 1) {
  122. layui.layer.msg(res.msg);
  123. layer.close(index);
  124. obj.del();
  125. }
  126. }
  127. });
  128. layer.close(index);
  129. })
  130. },
  131. detail: function (obj) {
  132. layer.open({
  133. type: 2
  134. ,title: "账号详细"
  135. ,content: "{:url('Alipay/detail')}?id=" + obj.data.id
  136. ,area: ["500px", "400px"]
  137. });
  138. }
  139. };
  140. like.eventClick(active);
  141. form.on("submit(search)", function(data){
  142. table.reload("like-table-lists", {
  143. where: data.field,
  144. page: {
  145. curr: 1
  146. }
  147. });
  148. });
  149. form.on("submit(clear-search)", function(){
  150. $("#name").val("");
  151. form.render("select");
  152. table.reload("like-table-lists", {
  153. where: {},
  154. page: {
  155. curr: 1
  156. }
  157. });
  158. });
  159. })
  160. </script>