eb04cae0fa2b79df1d912d1925578e76.php 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690
  1. <?php /*a:2:{s:99:"E:\phpstudy_pro_8.1.0.1_64bit_Green\phpstudy_pro\WWW\yueshengshop\app\admin\view\upload\config.html";i:1587196808;s:90:"E:\phpstudy_pro_8.1.0.1_64bit_Green\phpstudy_pro\WWW\yueshengshop\app\admin\view\base.html";i:1587517806;}*/ ?>
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <meta name="renderer" content="webkit" />
  6. <meta http-equiv="X-UA-COMPATIBLE" content="IE=edge,chrome=1" />
  7. <title><?php echo htmlentities((isset($menu_info['title']) && ($menu_info['title'] !== '')?$menu_info['title']:"")); ?> - <?php echo htmlentities((isset($website['title']) && ($website['title'] !== '')?$website['title']:"Niushop开源商城")); ?></title>
  8. <meta name="keywords" content="<?php echo htmlentities((isset($website['keywords']) && ($website['keywords'] !== '')?$website['keywords']:'Niushop开源商城')); ?>">
  9. <meta name="description" content="<?php echo htmlentities((isset($website['desc']) && ($website['desc'] !== '')?$website['desc']:'描述')); ?>}">
  10. <link rel="icon" type="image/x-icon" href="http://yueshengshop.top/public/static/img/bitbug_favicon.ico" />
  11. <link rel="stylesheet" type="text/css" href="http://yueshengshop.top/public/static/css/iconfont.css" />
  12. <link rel="stylesheet" type="text/css" href="http://yueshengshop.top/public/static/ext/layui/css/layui.css" />
  13. <link rel="stylesheet" type="text/css" href="http://yueshengshop.top/public/static/loading/msgbox.css"/>
  14. <link rel="stylesheet" type="text/css" href="http://yueshengshop.top/app/admin/view/public/css/common.css" />
  15. <script src="http://yueshengshop.top/public/static/js/jquery-3.1.1.js"></script>
  16. <script src="http://yueshengshop.top/public/static/ext/layui/layui.js"></script>
  17. <script>
  18. layui.use(['layer', 'upload', 'element'], function() {});
  19. window.ns_url = {
  20. baseUrl: "http://yueshengshop.top/",
  21. route: ['<?php echo request()->module(); ?>', '<?php echo request()->controller(); ?>', '<?php echo request()->action(); ?>'],
  22. };
  23. </script>
  24. <script src="http://yueshengshop.top/public/static/js/common.js"></script>
  25. <style>
  26. .ns-calendar{background: url("http://yueshengshop.top/public/static/img/ns_calendar.png") no-repeat center / 16px 16px;}
  27. </style>
  28. <style>
  29. .ns-watermark-img, .ns-watermark-font { display: none; }
  30. </style>
  31. <script type="text/javascript">
  32. </script>
  33. </head>
  34. <body>
  35. <!-- logo -->
  36. <div class="ns-logo">
  37. <div class="logo-box">
  38. <img src="http://yueshengshop.top/app/admin/view/public/img/logo.png">
  39. </div>
  40. <span>B2B2C多商户平台端</span>
  41. <span>
  42. 服务电话:400-886-7993
  43. </span>
  44. </div>
  45. <div class="layui-layout layui-layout-admin">
  46. <div class="layui-header">
  47. <!-- 一级菜单 -->
  48. <ul class="layui-nav layui-layout-left">
  49. <?php $serond_menu = []; foreach($menu as $menu_k => $menu_v): ?>
  50. <li class="layui-nav-item <?php if($menu_v['selected']): ?> layui-this<?php endif; ?>">
  51. <a href="<?php echo htmlentities($menu_v['url']); ?>"><?php echo htmlentities($menu_v['title']); ?></a>
  52. </li>
  53. <?php if($menu_v['selected']):
  54. $serond_menu = $menu_v['child_list'];
  55. ?>
  56. <?php endif; ?>
  57. <?php endforeach; ?>
  58. </ul>
  59. <ul class="layui-nav layui-layout-right">
  60. <li class="layui-nav-item">
  61. <a href="javascript:;">
  62. <div class="ns-img-box">
  63. <img src="http://yueshengshop.top/app/admin/view/public/img/default_headimg.png" alt="">
  64. </div>
  65. <?php echo htmlentities($user_info['username']); ?>
  66. </a>
  67. <dl class="layui-nav-child">
  68. <dd class="ns-reset-pass" onclick="resetPassword();">
  69. <a href="javascript:;">修改密码</a>
  70. </dd>
  71. <dd>
  72. <a onclick="clearCache()" href="javascript:;">清除缓存</a>
  73. </dd>
  74. <dd>
  75. <a href="<?php echo addon_url('admin/login/logout'); ?>" class="login-out">退出登录</a>
  76. </dd>
  77. </dl>
  78. </li>
  79. </ul>
  80. </div>
  81. <?php if(!(empty($serond_menu) || (($serond_menu instanceof \think\Collection || $serond_menu instanceof \think\Paginator ) && $serond_menu->isEmpty()))): ?>
  82. <div class="layui-side">
  83. <div class="layui-side-scroll">
  84. <span class="ns-side-title"><?php echo htmlentities($crumbs[0]['title']); ?></span>
  85. <!-- 二三级菜单-->
  86. <ul class="layui-nav layui-nav-tree" lay-filter="test">
  87. <?php foreach($serond_menu as $menu_second_k => $menu_second_v): ?>
  88. <li class="layui-nav-item <?php if($menu_second_v['selected']): ?> layui-nav-itemed <?php endif; if(!$menu_second_v['child_list'] && $menu_second_v['selected']): ?> layui-this<?php endif; ?>">
  89. <a class="layui-menu-tips" href="<?php if(!$menu_second_v['child_list']): ?> <?php echo htmlentities($menu_second_v['url']); else: ?>javascript:;<?php endif; ?>"><?php echo htmlentities($menu_second_v['title']); ?></a>
  90. <?php if(!(empty($menu_second_v['child_list']) || (($menu_second_v['child_list'] instanceof \think\Collection || $menu_second_v['child_list'] instanceof \think\Paginator ) && $menu_second_v['child_list']->isEmpty()))): ?>
  91. <dl class="layui-nav-child">
  92. <?php foreach($menu_second_v["child_list"] as $menu_third_k => $menu_third_v): ?>
  93. <dd class="<?php if($menu_third_v['selected']): ?> layui-this<?php endif; ?>">
  94. <a href="<?php echo htmlentities($menu_third_v['url']); ?>"><?php echo htmlentities($menu_third_v['title']); ?></a>
  95. </dd>
  96. <?php endforeach; ?>
  97. </dl>
  98. <?php endif; ?>
  99. </li>
  100. <?php endforeach; ?>
  101. </ul>
  102. </div>
  103. </div>
  104. <?php endif; ?>
  105. <div class="layui-body<?php if(empty($serond_menu) || (($serond_menu instanceof \think\Collection || $serond_menu instanceof \think\Paginator ) && $serond_menu->isEmpty())): ?> child_no_exit<?php endif; ?>">
  106. <!-- 面包屑 -->
  107. <?php if(count($serond_menu) > 0): ?>
  108. <div class="ns-crumbs<?php if(empty($serond_menu) || (($serond_menu instanceof \think\Collection || $serond_menu instanceof \think\Paginator ) && $serond_menu->isEmpty())): ?> child_no_exit<?php endif; ?>">
  109. <span class="layui-breadcrumb" lay-separator="-">
  110. <?php foreach($crumbs as $crumbs_k => $crumbs_v): if(count($crumbs) == ($crumbs_k + 1)): ?>
  111. <a href="<?php echo htmlentities($crumbs_v['url']); ?>"><cite><?php echo htmlentities($crumbs_v['title']); ?></cite></a>
  112. <?php else: ?>
  113. <a href="<?php echo htmlentities($crumbs_v['url']); ?>"><?php echo htmlentities($crumbs_v['title']); ?></a>
  114. <?php endif; ?>
  115. <?php endforeach; ?>
  116. </span>
  117. </div>
  118. <?php endif; ?>
  119. <div class="ns-body-content <?php if(count($serond_menu) < 1): ?> crumbs_no_exit<?php endif; ?>">
  120. <div class="ns-body">
  121. <!-- 四级导航 -->
  122. <?php if(isset($forth_menu) && !empty($forth_menu)): ?>
  123. <div class="fourstage-nav layui-tab layui-tab-brief" lay-filter="edit_user_tab">
  124. <ul class="layui-tab-title">
  125. <?php if(is_array($forth_menu) || $forth_menu instanceof \think\Collection || $forth_menu instanceof \think\Paginator): $i = 0; $__LIST__ = $forth_menu;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$menu): $mod = ($i % 2 );++$i;?>
  126. <li class="<?php echo $menu['selected']==1 ? 'layui-this' : ''; ?>" lay-id="basic_info"><a href="<?php echo htmlentities($menu['parse_url']); ?>"><?php echo htmlentities($menu['title']); ?></a></li>
  127. <?php endforeach; endif; else: echo "" ;endif; ?>
  128. </ul>
  129. </div>
  130. <?php endif; ?>
  131. <div class="layui-form">
  132. <!-- 基础上传 -->
  133. <div class="layui-card ns-card-common ns-card-brief">
  134. <div class="layui-card-header">
  135. <span class="ns-card-title">基础上传</span>
  136. </div>
  137. <div class="layui-card-body">
  138. <div class="layui-form-item">
  139. <label class="layui-form-label">上传大小:</label>
  140. <div class="layui-input-block">
  141. <div class="layui-input-inline">
  142. <input name="max_filesize" type="number" lay-verify="num" value="<?php echo htmlentities($config['value']['upload']['max_filesize']); ?>" class="layui-input ns-len-short">
  143. </div>
  144. <div class="layui-form-mid">kb</div>
  145. </div>
  146. <div class="ns-word-aux">允许上传的文件大小,0为不限制</div>
  147. </div>
  148. <div class="layui-form-item">
  149. <label class="layui-form-label">图片扩展名:</label>
  150. <div class="layui-input-block">
  151. <input name="image_allow_ext" type="text" value="<?php echo htmlentities($config['value']['upload']['image_allow_ext']); ?>" class="layui-input ns-len-long">
  152. </div>
  153. <div class="ns-word-aux">设置允许上传的文件扩展名,多个扩展名之间用“,”隔开,如不填则为不限制</div>
  154. </div>
  155. <div class="layui-form-item">
  156. <label class="layui-form-label">图片Mime类型:</label>
  157. <div class="layui-input-block">
  158. <input name="image_allow_mime" type="text" value="<?php echo htmlentities($config['value']['upload']['image_allow_mime']); ?>" class="layui-input ns-len-long">
  159. </div>
  160. <div class="ns-word-aux">设置允许上传的文件mime类型,多个类型之间用“,”隔开,如不填则为不限制</div>
  161. </div>
  162. </div>
  163. </div>
  164. <!-- 缩略图上传 -->
  165. <div class="layui-card ns-card-common ns-card-brief">
  166. <div class="layui-card-header">
  167. <span class="ns-card-title">缩略图</span>
  168. </div>
  169. <div class="layui-card-body">
  170. <div class="layui-form-item">
  171. <label class="layui-form-label">自定义裁剪位置:</label>
  172. <div class="layui-input-block">
  173. <?php foreach($position as $thumb_position_k => $thumb_position_v): ?>
  174. <input type="radio" name="thumb_position" value="<?php echo htmlentities($thumb_position_k); ?>" lay-filter="thumbPosition" title="<?php echo htmlentities($thumb_position_v); ?>" <?php echo $config['value']['thumb']['thumb_position']==$thumb_position_k ? 'checked' : ''; ?> />
  175. <?php endforeach; ?>
  176. </div>
  177. </div>
  178. <div class="layui-form-item">
  179. <label class="layui-form-label">缩略大图(单位:px):</label>
  180. <div class="layui-input-block">
  181. <div class="layui-form-mid">宽</div>
  182. <div class="layui-input-inline">
  183. <input name="thumb_big_width" type="number" value="<?php echo htmlentities($config['value']['thumb']['thumb_big_width']); ?>" lay-verify="int" class="layui-input ns-len-short">
  184. </div>
  185. <div class="layui-form-mid">高</div>
  186. <div class="layui-input-inline">
  187. <input name="thumb_big_height" type="number" value="<?php echo htmlentities($config['value']['thumb']['thumb_big_height']); ?>" lay-verify="int" class="layui-input ns-len-short">
  188. </div>
  189. </div>
  190. </div>
  191. <div class="layui-form-item">
  192. <label class="layui-form-label">缩略中图(单位:px):</label>
  193. <div class="layui-input-block">
  194. <div class="layui-form-mid">宽</div>
  195. <div class="layui-input-inline">
  196. <input name="thumb_mid_width" type="number" value="<?php echo htmlentities($config['value']['thumb']['thumb_mid_width']); ?>" lay-verify="int" class="layui-input ns-len-short">
  197. </div>
  198. <div class="layui-form-mid">高</div>
  199. <div class="layui-input-inline">
  200. <input name="thumb_mid_height" type="number" value="<?php echo htmlentities($config['value']['thumb']['thumb_mid_height']); ?>" lay-verify="int" class="layui-input ns-len-short">
  201. </div>
  202. </div>
  203. </div>
  204. <div class="layui-form-item">
  205. <label class="layui-form-label">缩略小图(单位:px):</label>
  206. <div class="layui-input-block">
  207. <div class="layui-form-mid">宽</div>
  208. <div class="layui-input-inline">
  209. <input name="thumb_small_width" type="number" value="<?php echo htmlentities($config['value']['thumb']['thumb_small_width']); ?>" lay-verify="int" class="layui-input ns-len-short">
  210. </div>
  211. <div class="layui-form-mid">高</div>
  212. <div class="layui-input-inline">
  213. <input name="thumb_small_height" type="number" value="<?php echo htmlentities($config['value']['thumb']['thumb_small_height']); ?>" lay-verify="int" class="layui-input ns-len-short">
  214. </div>
  215. </div>
  216. </div>
  217. </div>
  218. </div>
  219. <!-- 水印设置 -->
  220. <div class="layui-card ns-card-common ns-card-brief">
  221. <div class="layui-card-header">
  222. <span class="ns-card-title">水印设置</span>
  223. </div>
  224. <div class="layui-card-body">
  225. <div class="layui-form-item">
  226. <label class="layui-form-label">是否开启水印:</label>
  227. <div class="layui-input-block">
  228. <input type="checkbox" name="is_watermark" value="1" lay-skin="switch" lay-filter="isOpen" <?php if($config['value']['water']['is_watermark'] == 1): ?> checked <?php endif; ?> />
  229. </div>
  230. <div class="ns-word-aux">开启水印设置之后所有上传图片都会有水印标志</div>
  231. </div>
  232. <!-- 水印开启 -->
  233. <div class="layui-form-item">
  234. <label class="layui-form-label">水印类型:</label>
  235. <div class="layui-input-block" id="watermark_type">
  236. <input type="radio" name="watermark_type" lay-filter="watermark" value="1" title="图片" <?php echo $config['value']['water']['watermark_type']==1 ? 'checked' : ''; ?> >
  237. <input type="radio" name="watermark_type" lay-filter="watermark" value="2" title="文字" <?php echo $config['value']['water']['watermark_type']==2 ? 'checked' : ''; ?> >
  238. </div>
  239. <div class="ns-word-aux">水印可为图片或文字形式</div>
  240. </div>
  241. <!-- 图片水印 -->
  242. <div class="ns-watermark-img">
  243. <div class="layui-form-item">
  244. <label class="layui-form-label img-upload-lable">水印图片来源:</label>
  245. <div class="layui-input-block">
  246. <div class="upload-img-block">
  247. <!-- 用于存储图片路径 -->
  248. <input type="hidden" name="watermark_source" value="<?php echo htmlentities($config['value']['water']['watermark_source']); ?>" class="layui-input"/>
  249. <div class="upload-img-box" id="watermark_source">
  250. <?php if(empty($config['value']['water']['watermark_source'])): ?>
  251. <div class="ns-upload-default">
  252. <img src="http://yueshengshop.top/public/static/img/upload_img.png" />
  253. <p>点击上传</p>
  254. </div>
  255. <?php else: ?>
  256. <img src="<?php echo img($config['value']['water']['watermark_source']); ?>" alt="">
  257. <?php endif; ?>
  258. </div>
  259. </div>
  260. </div>
  261. <div class="ns-word-aux">水印为图片时,上传水印图片</div>
  262. </div>
  263. <div class="layui-form-item">
  264. <label class="layui-form-label">水印图片位置:</label>
  265. <div class="layui-input-block">
  266. <?php foreach($position as $watermark_position_k => $watermark_position_v): ?>
  267. <input type="radio" name="watermark_position" value="<?php echo htmlentities($watermark_position_k); ?>" title="<?php echo htmlentities($watermark_position_v); ?>" <?php echo $config['value']['water']['watermark_position']==$watermark_position_k ? 'checked' : ''; ?> />
  268. <?php endforeach; ?>
  269. </div>
  270. <div class="ns-word-aux">水印图片在图片上的位置</div>
  271. </div>
  272. <div class="layui-form-item">
  273. <label class="layui-form-label">水印图片透明度:</label>
  274. <div class="layui-input-block">
  275. <div class="layui-input-inline">
  276. <input name="watermark_opacity" type="number" value="<?php echo htmlentities($config['value']['water']['watermark_opacity']); ?>" lay-verify="intrange" class="layui-input ns-len-short">
  277. </div>
  278. <div class="layui-form-mid">%</div>
  279. </div>
  280. <div class="ns-word-aux">水印图片透明度,用百分数表示,可为0-100%,0为不透明</div>
  281. </div>
  282. <div class="layui-form-item">
  283. <label class="layui-form-label">水印图片倾斜度:</label>
  284. <div class="layui-input-block">
  285. <div class="layui-input-inline">
  286. <input name="watermark_rotate" type="number" value="<?php echo htmlentities($config['value']['water']['watermark_rotate']); ?>" lay-verify="angle" class="layui-input ns-len-short">
  287. </div>
  288. <div class="layui-form-mid">度</div>
  289. </div>
  290. <div class="ns-word-aux">水印图片倾斜的角度</div>
  291. </div>
  292. </div>
  293. <!-- 文字水印 -->
  294. <div class="ns-watermark-font">
  295. <div class="layui-form-item">
  296. <label class="layui-form-label">水印文字:</label>
  297. <div class="layui-input-inline">
  298. <input name="watermark_text" type="text" value="<?php echo htmlentities($config['value']['water']['watermark_text']); ?>" class="layui-input ns-len-long">
  299. </div>
  300. </div>
  301. <div class="layui-form-item">
  302. <label class="layui-form-label">字体大小:</label>
  303. <div class="layui-input-block">
  304. <div class="layui-input-inline">
  305. <input name="watermark_text_size" type="number" value="<?php echo htmlentities($config['value']['water']['watermark_text_size']); ?>" lay-verify="int" class="layui-input ns-len-short">
  306. </div>
  307. <div class="layui-form-mid">px</div>
  308. </div>
  309. <div class="ns-word-aux">水印文字的字体大小</div>
  310. </div>
  311. <div class="layui-form-item">
  312. <label class="layui-form-label">字体颜色:</label>
  313. <div class="layui-input-inline">
  314. <input name="watermark_text_color" type="text" value="<?php echo htmlentities($config['value']['water']['watermark_text_color']); ?>" class="layui-input ns-len-short" id="watermark_color_input">
  315. </div>
  316. <div class="layui-input-block">
  317. <div id="watermark_color">
  318. </div>
  319. </div>
  320. <div class="ns-word-aux">水印文字颜色</div>
  321. </div>
  322. <div class="layui-form-item">
  323. <label class="layui-form-label">水印文字水平对齐方式:</label>
  324. <div class="layui-input-block">
  325. <input type="radio" name="watermark_text_align" value="left" title="居左对齐" <?php echo $config['value']['water']['watermark_text_align']=='left' ? 'checked' : ''; ?> >
  326. <input type="radio" name="watermark_text_align" value="center" title="居中对齐" <?php echo $config['value']['water']['watermark_text_align']=='center' ? 'checked' : ''; ?> >
  327. <input type="radio" name="watermark_text_align" value="right" title="居右对齐" <?php echo $config['value']['water']['watermark_text_align']=='right' ? 'checked' : ''; ?> >
  328. </div>
  329. </div>
  330. <div class="layui-form-item">
  331. <label class="layui-form-label">水印文字垂直对齐方式:</label>
  332. <div class="layui-input-block">
  333. <input type="radio" name="watermark_text_valign" value="top" title="居上对齐" <?php echo $config['value']['water']['watermark_text_valign']=='top' ? 'checked' : ''; ?> >
  334. <input type="radio" name="watermark_text_valign" value="center" title="居中对齐" <?php echo $config['value']['water']['watermark_text_valign']=='center' ? 'checked' : ''; ?> >
  335. <input type="radio" name="watermark_text_valign" value="bottom" title="居下对齐" <?php echo $config['value']['water']['watermark_text_valign']=='bottom' ? 'checked' : ''; ?> >
  336. </div>
  337. </div>
  338. <div class="layui-form-item">
  339. <label class="layui-form-label">文本旋转角度:</label>
  340. <div class="layui-input-block">
  341. <div class="layui-input-inline">
  342. <input name="watermark_text_angle" type="number" value="<?php echo htmlentities($config['value']['water']['watermark_text_angle']); ?>" lay-verify="angle" class="layui-input ns-len-short">
  343. </div>
  344. <div class="layui-form-mid">度</div>
  345. </div>
  346. <div class="ns-word-aux">水印文字相对于图片旋转的角度</div>
  347. </div>
  348. </div>
  349. <div class="layui-form-item">
  350. <label class="layui-form-label">水印横坐标偏移量:</label>
  351. <div class="layui-input-block">
  352. <div class="layui-input-inline">
  353. <input name="watermark_x" type="number" value="<?php echo htmlentities($config['value']['water']['watermark_x']); ?>" lay-verify="int" class="layui-input ns-len-short">
  354. </div>
  355. <div class="layui-form-mid">px</div>
  356. </div>
  357. <div class="ns-word-aux">水印相对于横坐标偏移的距离,用像素单位表示</div>
  358. </div>
  359. <div class="layui-form-item">
  360. <label class="layui-form-label">水印纵坐标偏移量:</label>
  361. <div class="layui-input-block">
  362. <div class="layui-input-inline">
  363. <input name="watermark_y" type="number" value="<?php echo htmlentities($config['value']['water']['watermark_y']); ?>" lay-verify="int" class="layui-input ns-len-short">
  364. </div>
  365. <div class="layui-form-mid">px</div>
  366. </div>
  367. <div class="ns-word-aux">水印相对于纵坐标偏移的距离,用像素单位表示</div>
  368. </div>
  369. </div>
  370. </div>
  371. <!-- 提交 -->
  372. <div class="ns-single-filter-box">
  373. <div class="ns-form-row">
  374. <button class="layui-btn ns-bg-color" lay-submit lay-filter="save">保存</button>
  375. </div>
  376. </div>
  377. <!-- 隐藏域 -->
  378. <input class="watermark-type" type="hidden" value="<?php echo htmlentities($config['value']['water']['watermark_type']); ?>" /><!-- 水印类型 -->
  379. </div>
  380. </div>
  381. <!-- 版权信息 -->
  382. <div class="ns-footer">
  383. <div class="ns-footer-img">
  384. <a href="#"><img style="-webkit-filter: grayscale(100%);-moz-filter: grayscale(100%);-ms-filter: grayscale(100%);-o-filter: grayscale(100%);filter: grayscale(100%);filter: gray;" src="<?php if(!empty($copyright['logo'])): ?> <?php echo img($copyright['logo']); else: ?>http://yueshengshop.top/public/static/img/copyright_logo.png<?php endif; ?>" /></a>
  385. </div>
  386. </div>
  387. </div>
  388. </div>
  389. </div>
  390. <!-- 重置密码弹框html -->
  391. <div class="layui-form" id="reset_pass" style="display: none;">
  392. <div class="layui-form-item">
  393. <label class="layui-form-label"><span class="required">*</span>原密码</label>
  394. <div class="layui-input-block">
  395. <input type="password" id="old_pass" name="old_pass" required class="layui-input ns-len-mid" maxlength="18" autocomplete="off" readonly onfocus="this.removeAttribute('readonly');" onblur="this.setAttribute('readonly',true);">
  396. <span class="required"></span>
  397. </div>
  398. </div>
  399. <div class="layui-form-item">
  400. <label class="layui-form-label"><span class="required">*</span>新密码</label>
  401. <div class="layui-input-block">
  402. <input type="password" id="new_pass" name="new_pass" required class="layui-input ns-len-mid" maxlength="18" autocomplete="off" readonly onfocus="this.removeAttribute('readonly');" onblur="this.setAttribute('readonly',true);">
  403. <span class="required"></span>
  404. </div>
  405. </div>
  406. <div class="layui-form-item">
  407. <label class="layui-form-label"><span class="required">*</span>确认新密码</label>
  408. <div class="layui-input-block">
  409. <input type="password" id="repeat_pass" name="repeat_pass" required class="layui-input ns-len-mid" maxlength="18" autocomplete="off" readonly onfocus="this.removeAttribute('readonly');" onblur="this.setAttribute('readonly',true);">
  410. <span class="required"></span>
  411. </div>
  412. </div>
  413. <div class="ns-form-row">
  414. <button class="layui-btn ns-bg-color" onclick="repass()">确定</button>
  415. <button class="layui-btn layui-btn-primary" onclick="closePass()">返回</button>
  416. </div>
  417. </div>
  418. <script type="text/javascript">
  419. layui.use('element',function () {
  420. var element = layui.element;
  421. element.render('breadcrumb');
  422. });
  423. function clearCache () {
  424. $.ajax({
  425. type: 'post',
  426. url: ns.url("admin/Login/clearCache"),
  427. dataType: 'JSON',
  428. success: function(res) {
  429. layer.msg(res.message);
  430. location.reload();
  431. }
  432. })
  433. }
  434. /**
  435. * 重置密码
  436. */
  437. var index;
  438. function resetPassword() {
  439. index = layer.open({
  440. type:1,
  441. content:$('#reset_pass'),
  442. offset: 'auto',
  443. area: ['650px']
  444. });
  445. setTimeout(function() {
  446. $(".ns-reset-pass").removeClass('layui-this');
  447. }, 1000);
  448. }
  449. // $(".ns-reset-pass").on('click', function() {
  450. // $(this).removeClass('layui-this');
  451. // })
  452. var repeat_flag = false;
  453. function repass(){
  454. var old_pass = $("#old_pass").val();
  455. var new_pass = $("#new_pass").val();
  456. var repeat_pass = $("#repeat_pass").val();
  457. if (old_pass == '') {
  458. $("#old_pass").focus();
  459. layer.msg("原密码不能为空");
  460. return;
  461. }
  462. if (new_pass == '') {
  463. $("#new_pass").focus();
  464. layer.msg("密码不能为空");
  465. return;
  466. } else if ($("#new_pass").val().length < 6) {
  467. $("#new_pass").focus();
  468. layer.msg("密码不能少于6位数");
  469. return;
  470. }
  471. if (repeat_pass == '') {
  472. $("#repeat_pass").focus();
  473. layer.msg("密码不能为空");
  474. return;
  475. } else if ($("#repeat_pass").val().length < 6) {
  476. $("#repeat_pass").focus();
  477. layer.msg("密码不能少于6位数");
  478. return;
  479. }
  480. if (new_pass != repeat_pass) {
  481. $("#repeat_pass").focus();
  482. layer.msg("两次密码输入不一样,请重新输入");
  483. return;
  484. }
  485. if(repeat_flag)return;
  486. repeat_flag = true;
  487. $.ajax({
  488. type: "POST",
  489. dataType: 'JSON',
  490. url: ns.url("admin/login/modifypassword"),
  491. data: {"old_pass": old_pass,"new_pass": new_pass},
  492. success: function(res) {
  493. layer.msg(res.message);
  494. repeat_flag = false;
  495. if (res.code == 0) {
  496. layer.close(index);
  497. location.reload();
  498. }
  499. }
  500. });
  501. }
  502. function closePass() {
  503. layer.close(index);
  504. }
  505. layui.use('element', function() {
  506. var element = layui.element;
  507. element.init();
  508. });
  509. </script>
  510. <script>
  511. layui.use(['form', 'upload', 'colorpicker'], function() {
  512. var form = layui.form,
  513. upload = layui.upload,
  514. colorpicker = layui.colorpicker,
  515. repeat_flag = false; //防重复标识
  516. form.render();
  517. /**
  518. * 监听保存
  519. */
  520. form.on('submit(save)', function(data) {
  521. if(repeat_flag) return;
  522. repeat_flag = true;
  523. $.ajax({
  524. type: 'POST',
  525. url: ns.url("admin/upload/config"),
  526. dataType: 'JSON',
  527. data: data.field,
  528. success: function(res) {
  529. layer.msg(res.message);
  530. repeat_flag = false;
  531. if (res.code == 0) {
  532. location.reload();
  533. }
  534. }
  535. });
  536. });
  537. /**
  538. * 水印类型
  539. */
  540. var type = $(".watermark-type").val();
  541. if (type == 1) {
  542. $(".ns-watermark-img").show();
  543. } else {
  544. $(".ns-watermark-font").show();
  545. }
  546. form.on('radio(watermark)', function(data) {
  547. if (data.value == 1) {
  548. $(".ns-watermark-img").show();
  549. $(".ns-watermark-font").hide();
  550. } else{
  551. $(".ns-watermark-img").hide();
  552. $(".ns-watermark-font").show();
  553. }
  554. });
  555. /**
  556. * 图片上传
  557. */
  558. var uploadLogo = upload.render({
  559. elem: '#watermark_source',
  560. url: ns.url("admin/upload/upload"),
  561. done: function(res) {
  562. if (res.code >= 0) {
  563. $("input[name='watermark_source']").val(res.data.pic_path);
  564. $('.upload-img-box').html("<img src=" + ns.img(res.data.pic_path) + " >"); //图片链接(base64)
  565. }
  566. return layer.msg(res.message);
  567. }
  568. });
  569. /**
  570. * 水印文字颜色
  571. */
  572. colorpicker.render({
  573. elem: '#watermark_color', //绑定元素
  574. color: "<?php echo htmlentities($config['value']['water']['watermark_text_color']); ?>",
  575. done: function(color) {
  576. $("#watermark_color_input").attr("value", color);
  577. }
  578. });
  579. /**
  580. * 表单验证
  581. */
  582. form.verify({
  583. num: function(value) {
  584. var arrMen = value.split("."),
  585. val = 0;
  586. if (arrMen.length == 2) {
  587. val = arrMen[1];
  588. }
  589. if (value == "") {
  590. return false;
  591. }
  592. if (value < 0 || val.length > 2) {
  593. return '请输入大于0的数,保留小数点后两位'
  594. }
  595. },
  596. int: function(value) {
  597. if (value == "") {
  598. return false;
  599. }
  600. if (value < 0 || !(value % 1 === 0)) {
  601. return '请输入大于0的整数'
  602. }
  603. },
  604. intrange: function(value) {
  605. if (value == "") {
  606. return false;
  607. }
  608. if (value < 0 || value > 100 || !(value % 1 === 0)) {
  609. return '请输入0-100之间的整数'
  610. }
  611. },
  612. angle: function(value) {
  613. if (value == "") {
  614. return false;
  615. }
  616. if (!(value % 1 === 0)) {
  617. return '请输入整数'
  618. }
  619. }
  620. });
  621. });
  622. </script>
  623. </body>
  624. </html>