theme.html 1.6 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <form action="{:sysuri()}" method="post" data-auto="true" class="layui-form layui-card" id="theme">
  2. <div class="layui-card-body padding-left-40">
  3. <div class="layui-form-item margin-bottom-5 label-required-prev">
  4. <div class="help-label"><b>后台配色方案</b>Theme Style</div>
  5. <div class="layui-textarea think-bg-gray" style="min-height:unset">
  6. {foreach $themes as $k=>$v}
  7. <label class="think-radio">
  8. {if isset($theme) and $theme eq $k}
  9. <input name="site_theme" type="radio" value="{$k}" lay-ignore checked> {$v}
  10. {else}
  11. <input name="site_theme" type="radio" value="{$k}" lay-ignore> {$v}
  12. {/if}
  13. </label>
  14. {/foreach}
  15. </div>
  16. <p class="help-block">切换配色方案,需要保存成功后配色方案才会永久生效,下次登录也会有效哦 ~</p>
  17. </div>
  18. </div>
  19. <div class="hr-line-dashed"></div>
  20. <div class="layui-form-item text-center">
  21. <button class="layui-btn" type="submit">保存配置</button>
  22. <button class="layui-btn layui-btn-danger" type='button' data-close>取消修改</button>
  23. </div>
  24. </form>
  25. <script>
  26. $('form#theme input[name=site_theme]').on('click', function () {
  27. var alls = '', that = this, prox = 'layui-layout-theme-', curt = prox + that.value;
  28. $('form#theme input[name=site_theme]').map(function () {
  29. if (this.value !== that.value) alls += ' ' + prox + this.value;
  30. });
  31. $('.layui-layout-body').removeClass(alls).addClass(curt)
  32. });
  33. </script>