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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. {layout name="layout1" /}
  2. <style>
  3. .layui-table-cell {height: auto; }
  4. </style>
  5. <div class="wrapper">
  6. <div class="layui-card">
  7. <!--操作提示-->
  8. <div class="layui-card-body">
  9. <div class="layui-collapse like-layui-collapse" lay-accordion="" style="border:1px dashed #c4c4c4">
  10. <div class="layui-colla-item">
  11. <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
  12. <div class="layui-colla-content layui-show">
  13. <p>* 商城支付方式设置,不同应用场景支持的支付方式不同。</p>
  14. <p>* 请前往
  15. <a href="https://pay.weixin.qq.com" style="color:deepskyblue;" target="_blank">微信支付</a> 、
  16. <a href="https://open.alipay.com" style="color:deepskyblue;" target="_blank">支付宝支付</a>、
  17. <a href="https://paas.huifu.com" style="color:deepskyblue;" target="_blank">汇付支付</a>
  18. 申请对应的支付密钥。</p>
  19. </div>
  20. </div>
  21. </div>
  22. </div>
  23. <div class="layui-form layui-card-header layuiadmin-card-header-auto">
  24. <h1 class="site-h1">支付设置</h1>
  25. </div>
  26. <div class="layui-card-body" id="card-body">
  27. <table id="like-table-lists" lay-filter="like-table-lists"></table>
  28. <script type="text/html" id="icon">
  29. <img src="{{d.image}}" style="width: 48px; height: 48px" class="image-show">
  30. </script>
  31. <script type="text/html" id="table-operation">
  32. <a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="edit">配置</a>
  33. </script>
  34. </div>
  35. </div>
  36. </div>
  37. <script>
  38. layui.use(['table','form'], function(){
  39. var $ = layui.$
  40. ,form = layui.form
  41. ,table = layui.table;
  42. like.tableLists('#like-table-lists', '{:url("setting.pay_config/lists")}', [
  43. {field: 'name', title: '支付方式'}
  44. ,{field: 'image', title: '图标', toolbar: '#icon', align: 'center'}
  45. ,{field: 'short_name', title: '简称', align: 'center'}
  46. ,{field: 'status', title: '状态', minWidth: 40, align: 'center'}
  47. ,{field: 'sort', title: '排序', event: 'tips', sort: true}
  48. ,{fixed: 'right', title: '操作', align: 'center', toolbar: '#table-operation'}
  49. ]);
  50. table.on('tool(like-table-lists)', function(obj) {
  51. if(obj.event === 'edit') {
  52. var name = obj.data.name;
  53. var code = obj.data.code;
  54. var edit_page;
  55. if (code == 'balance') {
  56. edit_page = 'editBalance';
  57. }else if (code == 'wechat') {
  58. edit_page = 'editWechat';
  59. }else if (code == 'alipay') {
  60. edit_page = 'editAlipay';
  61. }else if (code == 'hfdg_wechat') {
  62. edit_page = 'editHfdgWechat';
  63. }else if (code == 'hfdg_alipay') {
  64. edit_page = 'editHfdgAlipay';
  65. }else if (code == 'offline') {
  66. edit_page = 'editOffline';
  67. }
  68. layer.open({
  69. type: 2
  70. ,title: '编辑'+name
  71. ,content: '{:url("setting.pay_config/'+edit_page+'")}?name='+name
  72. ,area: ['90%', '90%']
  73. ,btn: ['确定', '取消']
  74. ,yes: function(index, layero) {
  75. var iframeWindow = window['layui-layer-iframe'+ index]
  76. ,submit = layero.find('iframe').contents().find('#edit-submit');
  77. //监听提交
  78. iframeWindow.layui.form.on('submit(edit-submit)', function(data){
  79. var field = data.field;
  80. like.ajax({
  81. url:'{:url("setting.pay_config/'+edit_page+'")}',
  82. data:field,
  83. type:"post",
  84. success:function(res)
  85. {
  86. if(res.code == 1)
  87. {
  88. layui.layer.msg(res.msg, {
  89. offset: '15px'
  90. , icon: 1
  91. , time: 1000
  92. });
  93. layer.close(index);
  94. table.reload('like-table-lists');
  95. }
  96. }
  97. });
  98. });
  99. submit.trigger('click');
  100. }
  101. })
  102. }
  103. });
  104. });
  105. </script>