123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- {extend name="admin@main"}
- {block name="content"}
- <form onsubmit="return false;" data-auto="true" method="post" class='layui-form layui-card ' autocomplete="off" lay-filter="payment">
- <div class="layui-card-body think-box-shadow">
- <div class="padding-left-40 padding-right-30">
- <label class="layui-form-item margin-top-20 block relative">
- <span class="color-green margin-right-10 font-w7">保障金金额</span>
- <input name="price" required value="{$price.value}" class="layui-input">
- </label>
- <label class="layui-form-item margin-top-20 block relative">
- <span class="color-green margin-right-10 font-w7">缴纳协议</span>
- <textarea name="'xieyi" class="layui-input" style="height: 100%"> {$xieyi.value}</textarea>
- </label>
- </div>
- <div class="hr-line-dashed"></div>
- <div class="layui-form-item text-center">
- <button class="layui-btn" type="submit">保存配置</button>
- </div>
- </div>
- </form>
- {/block}
- {block name="script"}
- <script>
- (new function () {
- form.render();
- this.type = "{:sysconf('wechat_mch_ssl_type')}" || 'p12';
- form.val('payment', {wechat_mch_ssl_type: this.type});
- form.on('radio(data-mch-type)', function (data) {
- apply(data.value);
- });
- apply.call(this, this.type);
- function apply(type) {
- $('[data-mch-type="' + type + '"]').show().siblings('[data-mch-type]').hide();
- };
- // 证书文件上传控制
- this.types = ['wechat_mch_ssl_p12', 'wechat_mch_ssl_key', 'wechat_mch_ssl_cer'];
- for (var i in this.types) $('input[name="' + this.types[i] + '"]').on('change', function () {
- var input = this, $button = $(this).next('button');
- setTimeout(function () {
- if (typeof input.value === 'string' && input.value.length > 5) {
- $button.find('i').addClass('color-green layui-icon-vercode').removeClass('layui-icon-upload-drag');
- } else {
- $button.find('i').removeClass('color-green layui-icon-vercode').addClass('layui-icon-upload-drag');
- }
- }, 300);
- }).trigger('change');
- });
- </script>
- {/block}
|