info.html 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. {extend name="admin@main"}
  2. {block name="content"}
  3. <form onsubmit="return false;" data-auto="true" method="post" class='layui-form layui-card ' autocomplete="off" lay-filter="payment">
  4. <div class="layui-card-body think-box-shadow">
  5. <div class="padding-left-40 padding-right-30">
  6. <label class="layui-form-item margin-top-20 block relative">
  7. <span class="color-green margin-right-10 font-w7">保障金金额</span>
  8. <input name="price" required value="{$price.value}" class="layui-input">
  9. </label>
  10. <label class="layui-form-item margin-top-20 block relative">
  11. <span class="color-green margin-right-10 font-w7">缴纳协议</span>
  12. <textarea name="'xieyi" class="layui-input" style="height: 100%"> {$xieyi.value}</textarea>
  13. </label>
  14. </div>
  15. <div class="hr-line-dashed"></div>
  16. <div class="layui-form-item text-center">
  17. <button class="layui-btn" type="submit">保存配置</button>
  18. </div>
  19. </div>
  20. </form>
  21. {/block}
  22. {block name="script"}
  23. <script>
  24. (new function () {
  25. form.render();
  26. this.type = "{:sysconf('wechat_mch_ssl_type')}" || 'p12';
  27. form.val('payment', {wechat_mch_ssl_type: this.type});
  28. form.on('radio(data-mch-type)', function (data) {
  29. apply(data.value);
  30. });
  31. apply.call(this, this.type);
  32. function apply(type) {
  33. $('[data-mch-type="' + type + '"]').show().siblings('[data-mch-type]').hide();
  34. };
  35. // 证书文件上传控制
  36. this.types = ['wechat_mch_ssl_p12', 'wechat_mch_ssl_key', 'wechat_mch_ssl_cer'];
  37. for (var i in this.types) $('input[name="' + this.types[i] + '"]').on('change', function () {
  38. var input = this, $button = $(this).next('button');
  39. setTimeout(function () {
  40. if (typeof input.value === 'string' && input.value.length > 5) {
  41. $button.find('i').addClass('color-green layui-icon-vercode').removeClass('layui-icon-upload-drag');
  42. } else {
  43. $button.find('i').removeClass('color-green layui-icon-vercode').addClass('layui-icon-upload-drag');
  44. }
  45. }, 300);
  46. }).trigger('change');
  47. });
  48. </script>
  49. {/block}