config.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. {extend name="app/admin/view/base.html"/}
  2. {block name="resources"}
  3. <style>
  4. .ns-input-text span{margin-left: 15px;}
  5. .ns-form {margin-top: 0;}
  6. </style>
  7. {/block}
  8. {block name="main"}
  9. <div class="layui-form ns-form">
  10. <div class="layui-form-item">
  11. <label class="layui-form-label">支付宝应用ID:</label>
  12. <div class="layui-input-block">
  13. <input name="app_id" type="text" value="{$info.value.app_id ?? ''}" class="layui-input ns-len-long">
  14. </div>
  15. <div class="ns-word-aux"><span class="ns-text-color-red">[API_ID]</span>支付宝分配给开发者的应用ID</div>
  16. </div>
  17. <div class="layui-form-item">
  18. <label class="layui-form-label">应用私钥:</label>
  19. <div class="layui-input-block">
  20. <textarea name="private_key" class="layui-textarea ns-len-long" placeholder="请输入应用私钥">{$info.value.private_key ?? ''}</textarea>
  21. </div>
  22. </div>
  23. <div class="layui-form-item">
  24. <label class="layui-form-label">应用公钥:</label>
  25. <div class="layui-input-block">
  26. <textarea name="public_key" class="layui-textarea ns-len-long" placeholder="请输入应用公钥">{$info.value.public_key ?? ''}</textarea>
  27. </div>
  28. </div>
  29. <div class="layui-form-item">
  30. <label class="layui-form-label">支付宝公钥:</label>
  31. <div class="layui-input-block">
  32. <textarea name="alipay_public_key" class="layui-textarea ns-len-long" placeholder="请输入支付宝公钥">{$info.value.alipay_public_key ?? ''}</textarea>
  33. </div>
  34. </div>
  35. <div class="layui-form-item">
  36. <label class="layui-form-label">支持端口:</label>
  37. <div class="ns-input-text">
  38. {foreach $app_type as $app_type_k => $app_type_v}
  39. {if condition="$app_type_v['name'] !='微信小程序' && $app_type_v['name'] !='微信公众号'"}
  40. <span>{$app_type_v['name']}</span>
  41. {/if}
  42. {/foreach}
  43. </div>
  44. </div>
  45. <div class="layui-form-item">
  46. <label class="layui-form-label">是否启用支付:</label>
  47. <div class="layui-input-block">
  48. <input type="checkbox" name="pay_status" value="1" lay-skin="switch" {if condition="$info.value && $info.value.pay_status == 1"} checked {/if} />
  49. </div>
  50. </div>
  51. <div class="layui-form-item">
  52. <label class="layui-form-label">是否启用退款:</label>
  53. <div class="layui-input-block">
  54. <input type="checkbox" name="refund_status" value="1" lay-skin="switch" {if condition="$info.value && $info.value.refund_status == 1"} checked {/if} />
  55. </div>
  56. </div>
  57. <div class="layui-form-item">
  58. <label class="layui-form-label">是否启用转账:</label>
  59. <div class="layui-input-block">
  60. <input type="checkbox" name="transfer_status" value="1" lay-skin="switch" {if condition="$info.value && $info.value.transfer_status == 1"} checked {/if} />
  61. </div>
  62. </div>
  63. <div class="ns-form-row">
  64. <button class="layui-btn ns-bg-color" lay-submit lay-filter="save">保存</button>
  65. <button class="layui-btn layui-btn-primary" onclick="back()">返回</button>
  66. </div>
  67. </div>
  68. {/block}
  69. {block name="script"}
  70. <script>
  71. layui.use('form', function() {
  72. var form = layui.form;
  73. var repeat_flag = false; //防重复标识
  74. form.render();
  75. /**
  76. * 监听提交
  77. */
  78. form.on('submit(save)', function(data) {
  79. if (repeat_flag) return false;
  80. repeat_flag = true;
  81. $.ajax({
  82. url: ns.url("alipay://admin/pay/config"),
  83. data: data.field,
  84. dataType: 'JSON',
  85. type: 'POST',
  86. success: function(res){
  87. repeat_flag = false;
  88. if (res.code == 0) {
  89. layer.confirm('编辑成功', {
  90. title:'操作提示',
  91. btn: ['返回列表', '继续操作'],
  92. yes: function(){
  93. location.href = ns.url("admin/config/pay")
  94. },
  95. btn2: function() {
  96. location.reload();
  97. }
  98. });
  99. }else{
  100. layer.msg(res.message);
  101. }
  102. }
  103. });
  104. });
  105. });
  106. function back(){
  107. location.href = ns.url("admin/config/pay");
  108. }
  109. </script>
  110. {/block}