wechat.html 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. {extend name="common/base"/}
  2. <!-- 主体 -->
  3. {block name="body"}
  4. <form class="layui-form p-4">
  5. <h3 class="pb-3">微信配置</h3>
  6. <table class="layui-table layui-table-form">
  7. <tr>
  8. <td class="layui-td-gray">token<font>*</font>
  9. </td>
  10. <td>
  11. <input type="hidden" value="{$id}" name="id">
  12. <input type="text" name="token" lay-verify="required" autocomplete="off" placeholder="请输入Token"
  13. class="layui-input" {notempty name="$config.token" } value="{$config.token}" {/notempty}>
  14. </td>
  15. <td class="layui-td-gray">登录回调地址<font>*</font>
  16. </td>
  17. <td>
  18. <input type="text" name="login_back_url" lay-verify="required" autocomplete="off"
  19. placeholder="请输入微信登录回调地址" class="layui-input" {notempty name="$config.login_back_url" }
  20. value="{$config.login_back_url}" {/notempty}>
  21. </td>
  22. </tr>
  23. <tr>
  24. <td class="layui-td-gray">公众号appid<font>*</font>
  25. </td>
  26. <td>
  27. <input type="text" name="appid" lay-verify="required" autocomplete="off" placeholder="请输入appID"
  28. class="layui-input" {notempty name="$config.appid" } value="{$config.appid}" {/notempty}>
  29. </td>
  30. <td class="layui-td-gray">公众号appsecret<font>*</font>
  31. </td>
  32. <td>
  33. <input type="text" name="appsecret" lay-verify="required" autocomplete="off" placeholder="请输入secretey"
  34. class="layui-input" {notempty name="$config.appsecret" } value="{$config.appsecret}" {/notempty}>
  35. </td>
  36. </tr>
  37. <tr>
  38. <td class="layui-td-gray">支付商户号</td>
  39. <td>
  40. <input type="text" name="mchid" autocomplete="off" placeholder="请输入微信支付商户号" class="layui-input"
  41. {notempty name="$config.mchid" } value="{$config.mchid}" {/notempty}>
  42. </td>
  43. <td class="layui-td-gray">支付API密钥</td>
  44. <td>
  45. <input type="text" name="secrect_key" autocomplete="off" placeholder="请输入微信支付API密钥" class="layui-input"
  46. {notempty name="$config.secrect_key" } value="{$config.secrect_key}" {/notempty}>
  47. </td>
  48. </tr>
  49. <tr>
  50. <td class="layui-td-gray">支付证书路径</td>
  51. <td>
  52. <input type="text" name="cert_url" autocomplete="off" placeholder="请输入微信支付证书路径" class="layui-input"
  53. {notempty name="$config.cert_url" } value="{$config.cert_url}" {/notempty}>
  54. </td>
  55. <td class="layui-td-gray">支付回调地址</td>
  56. <td>
  57. <input type="text" name="pay_back_url" autocomplete="off" placeholder="请输入微信支付回调地址" class="layui-input"
  58. {notempty name="$config.pay_back_url" } value="{$config.pay_back_url}" {/notempty}>
  59. </td>
  60. </tr>
  61. <tr>
  62. <td class="layui-td-gray-2">小程序appid<font>*</font>
  63. </td>
  64. <td>
  65. <input type="text" name="xcx_appid" lay-verify="required" autocomplete="off" placeholder="请输入小程序appid"
  66. class="layui-input" {notempty name="$config.xcx_appid" } value="{$config.xcx_appid}" {/notempty}>
  67. </td>
  68. <td class="layui-td-gray-3">小程序appsecret<font>*</font>
  69. </td>
  70. <td>
  71. <input type="text" name="xcx_appsecret" lay-verify="required" autocomplete="off"
  72. placeholder="请输入小程序appsecret" class="layui-input" {notempty name="$config.xcx_appsecret" }
  73. value="{$config.xcx_appsecret}" {/notempty}>
  74. </td>
  75. </tr>
  76. </table>
  77. <div class="py-3">
  78. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
  79. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  80. </div>
  81. </form>
  82. {/block}
  83. <!-- /主体 -->
  84. <!-- 脚本 -->
  85. {block name="script"}
  86. <script>
  87. const moduleInit = ['tool'];
  88. function gouguInit() {
  89. var form = layui.form, tool = layui.tool;
  90. //监听提交
  91. form.on('submit(webform)', function (data) {
  92. let callback = function (e) {
  93. layer.msg(e.msg);
  94. if (e.code == 0) {
  95. parent.layui.tool.close(1000);
  96. }
  97. }
  98. tool.post("/admin/conf/edit", data.field, callback);
  99. return false;
  100. });
  101. }
  102. </script>
  103. {/block}
  104. <!-- /脚本 -->