No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

theme_conf.htm 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. {include file="public/layout" /}
  2. <script src="__SKIN__/js/users_upgrade.js?v={$version}"></script>
  3. <script type="text/javascript" src="__PUBLIC__/plugins/colpick/js/colpick.js"></script>
  4. <link href="__PUBLIC__/plugins/colpick/css/colpick.css" rel="stylesheet" type="text/css"/>
  5. <body class="bodystyle" style="overflow-y: scroll; cursor: default; -moz-user-select: inherit;">
  6. <style type="text/css">
  7. #web_theme_color,#web_assist_color {
  8. /*margin:0;*/
  9. /*padding:0;*/
  10. border:solid 1px #ccc;
  11. width:70px;
  12. height:20px;
  13. border-right:40px solid green;
  14. /*line-height:20px;*/
  15. }
  16. </style>
  17. <div id="append_parent"></div>
  18. <div id="ajaxwaitid"></div>
  19. <div class="page">
  20. <div class="flexigrid">
  21. <form class="form-horizontal" id="postForm" action="{:url('Encodes/theme_conf')}" method="post">
  22. <div class="ncap-form-default">
  23. <dl class="row">
  24. <dt class="tit">
  25. <label for="uname">主题色选择</label>
  26. </dt>
  27. <dd class="opt">
  28. <div class="theme-color">
  29. <input type="hidden" name="web[web_theme_color_model]" value="{$globalTpCache.web_theme_color_model|default='1'}" id="web_theme_color_model"/>
  30. <ul>
  31. <li {if condition="empty($globalTpCache['web_theme_color_model']) || $globalTpCache['web_theme_color_model'] == 1"} class="active" {/if} data-model="1">
  32. <span class="theme_color" style="background-color: #3398cc;"></span>
  33. <span class="assist_color" style="background-color: #2189be;"></span>
  34. </li>
  35. <li {if condition="$globalTpCache['web_theme_color_model'] == 2"} class="active" {/if} data-model="2">
  36. <span class="theme_color" style="background-color: #1e9fff;"></span>
  37. <span class="assist_color" style="background-color: #0069b7;"></span>
  38. </li>
  39. <li {if condition="$globalTpCache['web_theme_color_model'] == 3"} class="active" {/if} data-model="3">
  40. <span class="theme_color" style="background-color: #1aa094;"></span>
  41. <span class="assist_color" style="background-color: #197971;"></span>
  42. </li>
  43. <li {if condition="$globalTpCache['web_theme_color_model'] == 4"} class="active" {/if} data-model="4">
  44. <span class="theme_color" style="background-color: #e82121;"></span>
  45. <span class="assist_color" style="background-color: #ae1919;"></span>
  46. </li>
  47. <li {if condition="$globalTpCache['web_theme_color_model'] == 5"} class="active" {/if} data-model="5">
  48. <span class="theme_color" style="background-color:#197971;"></span>
  49. <span class="assist_color" style="background-color: #fa921b;"></span>
  50. </li>
  51. <li {if condition="$globalTpCache['web_theme_color_model'] == 6"} class="active" {/if} data-model="6">
  52. <span class="theme_color" style="background-color:#963885;"></span>
  53. <span class="assist_color" style="background-color: #772c6a;"></span>
  54. </li>
  55. <li {if condition="$globalTpCache['web_theme_color_model'] == 'custom'"} class="active" {/if} data-model="custom">
  56. <span style="background-color:#ffffff;">
  57. <img src="__STATIC__/admin/images/empty-color.png?v={$version|default='v1.4.7'}">
  58. </span>
  59. <span style="background-color:#ffffff;">
  60. <img src="__STATIC__/admin/images/empty-color.png?v={$version|default='v1.4.7'}">
  61. </span>
  62. </li>
  63. </ul>
  64. </div>
  65. </dd>
  66. </dl>
  67. <div id="div_custom_theme_color" class="{if condition="$globalTpCache['web_theme_color_model'] != 'custom'"} none {/if}">
  68. <dl class="row">
  69. <dt class="tit">
  70. <label for="uname">自定义主色</label>
  71. </dt>
  72. <dd class="opt">
  73. <input type="text" name="web[web_theme_color]" value="{$globalTpCache.web_theme_color|default='#3398cc'}" id="web_theme_color" style="border-color: {$globalTpCache.web_theme_color|default='#3398cc'};" />
  74. </dd>
  75. </dl>
  76. <dl class="row">
  77. <dt class="tit">
  78. <label for="uname">自定义辅色</label>
  79. </dt>
  80. <dd class="opt">
  81. <input type="text" name="web[web_assist_color]" value="{$globalTpCache.web_assist_color|default='#2189be'}" id="web_assist_color" style="border-color: {$globalTpCache.web_assist_color|default='#2189be'};" />
  82. </dd>
  83. </dl>
  84. </div>
  85. {eq name='$main_lang' value='$admin_lang'}
  86. <dl class="row">
  87. <dt class="tit">
  88. <label for="web_adminlogo">后台LOGO</label>
  89. </dt>
  90. <dd class="opt">
  91. <div class="input-file-show">
  92. <span class="show">
  93. <a id="img_a_web_adminlogo" class="nyroModal" rel="gal" href="{$globalTpCache.web_adminlogo|default='javascript:void(0);'}?t={php}echo getTime();{/php}" target="_blank">
  94. <i id="img_i_web_adminlogo" class="fa fa-picture-o" {notempty name="$globalTpCache.web_adminlogo"}onmouseover="layer_tips=layer.tips('<img src={$globalTpCache.web_adminlogo|default=''} class=\'layer_tips_img\'>',this,{tips: [1, '#fff']});"{/notempty} onmouseout="layer.close(layer_tips);"></i>
  95. </a>
  96. </span>
  97. <span class="type-file-box">
  98. <input type="text" id="web_adminlogo" name="web[web_adminlogo]" value="{$globalTpCache.web_adminlogo|default=''}" class="type-file-text" autocomplete="off">
  99. <input type="button" name="button" id="button1" value="选择上传..." class="type-file-button">
  100. <input class="type-file-file" onClick="GetUploadify(1,'','adminlogo','adminlogo_call_back','{:url('Uploadify/upload_full')}');" size="30" hidefocus="true" nc_type="change_site_logo" title="点击前方预览图可查看大图,点击按钮选择文件并提交表单后上传生效">
  101. </span>
  102. </div>
  103. <span class="err"></span>
  104. <p class="notic"></p>
  105. </dd>
  106. </dl>
  107. <dl class="row">
  108. <dt class="tit">
  109. <label for="web_loginlogo">登录LOGO</label>
  110. </dt>
  111. <dd class="opt">
  112. <div class="input-file-show">
  113. <span class="show">
  114. <a id="img_a_web_loginlogo" class="nyroModal" rel="gal" href="{$globalTpCache.web_loginlogo|default='javascript:void(0);'}?t={php}echo getTime();{/php}" target="_blank">
  115. <i id="img_i_web_loginlogo" class="fa fa-picture-o" {notempty name="$globalTpCache.web_loginlogo"}onmouseover="layer_tips=layer.tips('<img src={$globalTpCache.web_loginlogo|default=''} class=\'layer_tips_img\'>',this,{tips: [1, '#fff']});"{/notempty} onmouseout="layer.close(layer_tips);"></i>
  116. </a>
  117. </span>
  118. <span class="type-file-box">
  119. <input type="text" id="web_loginlogo" name="web[web_loginlogo]" value="{$globalTpCache.web_loginlogo|default=''}" class="type-file-text" autocomplete="off">
  120. <input type="button" name="button" id="button1" value="选择上传..." class="type-file-button">
  121. <input class="type-file-file" onClick="GetUploadify(1,'','loginlogo','loginlogo_call_back','{:url('Uploadify/upload_full')}');" size="30" hidefocus="true" nc_type="change_site_logo" title="点击前方预览图可查看大图,点击按钮选择文件并提交表单后上传生效">
  122. </span>
  123. </div>
  124. <span class="err"></span>
  125. <p class="notic"></p>
  126. </dd>
  127. </dl>
  128. <dl class="row">
  129. <dt class="tit">
  130. <label for="web_loginbgimg">登录背景选择</label>
  131. </dt>
  132. <dd class="opt">
  133. <input type="hidden" name="web[web_loginbgimg_model]" value="{$globalTpCache.web_loginbgimg_model|default='1'}" id="web_loginbgimg_model"/>
  134. <div class="theme_bg">
  135. <ul>
  136. <li {if condition="$globalTpCache['web_loginbgimg_model'] == 1"} class="active" {/if} data-model="1"><img src="__SKIN__/loginbg/login-bg-1.png"></li>
  137. <li {if condition="$globalTpCache['web_loginbgimg_model'] == 2"} class="active" {/if} data-model="2"><img src="__SKIN__/loginbg/login-bg-2.png"></li>
  138. {if condition="$php_servicemeal >= 2"}
  139. <li {if condition="$globalTpCache['web_loginbgimg_model'] == 3"} class="active" {/if} data-model="3"><img src="__SKIN__/loginbg/login-bg-3.png"></li>
  140. {/if}
  141. <li {if condition="$globalTpCache['web_loginbgimg_model'] == 'custom'"} class="active" {/if} data-model="custom"><img src="__SKIN__/images/login-bg-empty.png" title="自定义背景"></li>
  142. </ul>
  143. </div>
  144. </dd>
  145. </dl>
  146. <dl class="row" id="div_custom_loginbgimg" {if condition="$globalTpCache['web_loginbgimg_model'] != 'custom'"} style="display: none;" {/if}>
  147. <dt class="tit">
  148. <label for="web_loginbgimg">&nbsp;</label>
  149. </dt>
  150. <dd class="opt">
  151. <div class="input-file-show">
  152. <span class="show">
  153. <a id="img_a_web_loginbgimg" class="nyroModal" rel="gal" href="{$globalTpCache.web_loginbgimg|default='javascript:void(0);'}" target="_blank">
  154. <i id="img_i_web_loginbgimg" class="fa fa-picture-o" {notempty name="$globalTpCache.web_loginbgimg"}onmouseover="layer_tips=layer.tips('<img src={$globalTpCache.web_loginbgimg|default=''} class=\'layer_tips_img\'>',this,{tips: [1, '#fff']});"{/notempty} onmouseout="layer.close(layer_tips);"></i>
  155. </a>
  156. </span>
  157. <span class="type-file-box">
  158. <input type="text" id="web_loginbgimg" name="web[web_loginbgimg]" value="{$globalTpCache.web_loginbgimg|default=''}" class="type-file-text" autocomplete="off">
  159. <input type="button" name="button" id="button1" value="选择上传..." class="type-file-button">
  160. <input class="type-file-file" onClick="GetUploadify(1,'','loginbgimg','loginbgimg_call_back','{:url('Uploadify/upload_full')}');" size="30" hidefocus="true" nc_type="change_site_logo" title="点击前方预览图可查看大图,点击按钮选择文件并提交表单后上传生效">
  161. </span>
  162. </div>
  163. <span class="err"></span>
  164. <p class="notic"></p>
  165. </dd>
  166. </dl>
  167. {/eq}
  168. <dl class="row">
  169. <div class="bot">
  170. <a href="JavaScript:void(0);" onclick="checkSubmit();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a>
  171. </div>
  172. </dl>
  173. </div>
  174. </form>
  175. </div>
  176. </div>
  177. <script>
  178. var parentObj = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  179. $(document).ready(function(){
  180. // 主题色切换
  181. $('.theme-color').find('li').click(function(){
  182. $('.theme-color').find('li').removeClass('active');
  183. $(this).addClass('active');
  184. var data_model = $(this).attr('data-model');
  185. $('#web_theme_color_model').val(data_model);
  186. if ('custom' == data_model) {
  187. $('#div_custom_theme_color').show();
  188. } else {
  189. $('#div_custom_theme_color').hide();
  190. // 主题色
  191. var theme_color = $(this).find('span.theme_color').css('background-color');
  192. theme_color = theme_color.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
  193. theme_color= "#" + hex(theme_color[1]) + hex(theme_color[2]) + hex(theme_color[3]);
  194. $('#web_theme_color').val(theme_color);
  195. // 辅助色
  196. var assist_color = $(this).find('span.assist_color').css('background-color');
  197. assist_color = assist_color.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
  198. assist_color= "#" + hex(assist_color[1]) + hex(assist_color[2]) + hex(assist_color[3]);
  199. $('#web_assist_color').val(assist_color);
  200. }
  201. });
  202. // 10进制转为16进制
  203. function hex(x) {
  204. return ("0" + parseInt(x).toString(16)).slice(-2);
  205. }
  206. // 登录背景图切换
  207. $('.theme_bg').find('li').click(function(){
  208. $('.theme_bg').find('li').removeClass('active');
  209. $(this).addClass('active');
  210. var data_model = $(this).attr('data-model');
  211. $('#web_loginbgimg_model').val(data_model);
  212. if ('custom' == data_model) {
  213. $('#div_custom_loginbgimg').show();
  214. } else {
  215. $('#div_custom_loginbgimg').hide();
  216. // 登录背景图
  217. var loginbgimg = $(this).find('img').attr('src');
  218. $('#web_loginbgimg').val(loginbgimg);
  219. }
  220. });
  221. // 自定义 - 主题颜色选择
  222. $('#web_theme_color').colpick({
  223. flat:false,
  224. layout:'rgbhex',
  225. submit:0,
  226. colorScheme:'light',
  227. color:$('#web_theme_color').val(),
  228. onChange:function(hsb,hex,rgb,el,bySetColor) {
  229. $(el).css('border-color','#'+hex);
  230. // Fill the text box just if the color was set using the picker, and not the colpickSetColor function.
  231. if(!bySetColor) $(el).val('#'+hex);
  232. }
  233. }).keyup(function(){
  234. $(this).colpickSetColor('#'+this.value);
  235. });
  236. // 自定义 - 辅助颜色选择
  237. $('#web_assist_color').colpick({
  238. flat:false,
  239. layout:'rgbhex',
  240. submit:0,
  241. colorScheme:'light',
  242. color:$('#web_assist_color').val(),
  243. onChange:function(hsb,hex,rgb,el,bySetColor) {
  244. $(el).css('border-color','#'+hex);
  245. // Fill the text box just if the color was set using the picker, and not the colpickSetColor function.
  246. if(!bySetColor) $(el).val('#'+hex);
  247. }
  248. }).keyup(function(){
  249. $(this).colpickSetColor('#'+this.value);
  250. });
  251. });
  252. function checkSubmit(){
  253. layer_loading('正在处理');
  254. $.ajax({
  255. type : 'post',
  256. url : "{:url('Encodes/theme_conf', ['_ajax'=>1])}",
  257. data : $('#postForm').serialize(),
  258. dataType : 'json',
  259. success : function(res){
  260. layer.closeAll();
  261. if(res.code == 1){
  262. var _parent = parent;
  263. _parent.layer.close(parentObj);
  264. _parent.layer.msg(res.msg, {shade: layer_shade, time: 1000}, function(){
  265. _parent.top.window.location.reload();
  266. });
  267. }else{
  268. showErrorMsg(res.msg);
  269. }
  270. },
  271. error: function(e){
  272. layer.closeAll();
  273. layer.alert(e.responseText, {icon: 5, title:false});
  274. }
  275. });
  276. }
  277. function adminlogo_call_back(fileurl_tmp)
  278. {
  279. $("#web_adminlogo").val(fileurl_tmp);
  280. $("#img_a_web_adminlogo").attr('href', fileurl_tmp);
  281. $("#img_i_web_adminlogo").attr('onmouseover', "layer_tips=layer.tips('<img src="+fileurl_tmp+" class=\\'layer_tips_img\\'>',this,{tips: [1, '#fff']});");
  282. }
  283. function loginlogo_call_back(fileurl_tmp)
  284. {
  285. $("#web_loginlogo").val(fileurl_tmp);
  286. $("#img_a_web_loginlogo").attr('href', fileurl_tmp);
  287. $("#img_i_web_loginlogo").attr('onmouseover', "layer_tips=layer.tips('<img src="+fileurl_tmp+" class=\\'layer_tips_img\\'>',this,{tips: [1, '#fff']});");
  288. }
  289. function loginbgimg_call_back(fileurl_tmp)
  290. {
  291. $("#web_loginbgimg").val(fileurl_tmp);
  292. $("#img_a_web_loginbgimg").attr('href', fileurl_tmp);
  293. $("#img_i_web_loginbgimg").attr('onmouseover', "layer_tips=layer.tips('<img src="+fileurl_tmp+" class=\\'layer_tips_img\\'>',this,{tips: [1, '#fff']});");
  294. }
  295. </script>
  296. {include file="public/footer" /}