心理咨询网
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.

single.html 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  1. {include file='common/head.html'}
  2. <div class="layui-body">
  3. {if([$list])}
  4. <div class="layui-tab layui-tab-brief" lay-filter="tab">
  5. <ul class="layui-tab-title">
  6. <li class="layui-this" lay-id="t1">{$model_name}内容</li>
  7. </ul>
  8. <div class="layui-tab-content">
  9. <div class="layui-tab-item layui-show">
  10. <form action="{url./admin/Single/index/mcode/'.get('mcode').'}" method="get" class="layui-form">
  11. <div class="layui-form-item nospace">
  12. <div class="layui-input-inline">
  13. {$pathinfo}
  14. <select name="field" class="form-control input-sm" style="width:auto;">
  15. <option value="b.name" {if(get('field')=='b.name')}selected="selected" {/if}>栏目名称</option>
  16. <option value="a.title" {if(get('field')=='a.title')}selected="selected" {/if} >文章标题</option>
  17. <option value="a.content" {if(get('field')=='a.content')}selected="selected" {/if}>文章内容</option>
  18. </select>
  19. </div>
  20. <div class="layui-input-inline">
  21. <input type="text" name="keyword" value="{$get.keyword}" placeholder="请输入搜索关键字" class="layui-input">
  22. </div>
  23. <div class="layui-input-inline">
  24. <button class="layui-btn" lay-submit>搜索</button>
  25. <a class="layui-btn layui-btn-primary" href="{url./admin/Single/index/mcode/'.get('mcode').'}">清除搜索</a>
  26. </div>
  27. </div>
  28. </form>
  29. <table class="layui-table">
  30. <thead>
  31. <tr>
  32. <th>ID</th>
  33. <th>栏目</th>
  34. <th>标题</th>
  35. <th>时间</th>
  36. <th>状态</th>
  37. <th>访问量</th>
  38. <th>操作</th>
  39. </tr>
  40. </thead>
  41. <tbody>
  42. {foreach $contents(key,value)}
  43. <tr>
  44. <td>[value->id]</td>
  45. <td title="[value->scode]">[value->sortname]</td>
  46. <td title="[value->title]">
  47. {fun=substr_both($value->title,0,15)}
  48. {if($value->ico)}
  49. <span class="layui-badge layui-bg-orange">缩</span>
  50. {/if}
  51. {if($value->pics)}
  52. <span class="layui-badge">图</span>
  53. {/if}
  54. {if($value->outlink)}
  55. <span class="layui-badge layui-bg-black">链</span>
  56. {/if}
  57. </td>
  58. <td>[value->date]</td>
  59. <td>
  60. {if($value->status)}
  61. <a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/status/value/0}" class="switch"><i class='fa fa-toggle-on' title="点击关闭"></i></a>
  62. {else}
  63. <a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/status/value/1}" class="switch"><i class='fa fa-toggle-off' title="点击开启"></i></a>
  64. {/if}
  65. </td>
  66. <td>[value->visits]</td>
  67. <td>
  68. {if(!$value->outlink)}
  69. {php}
  70. $Parser=new app\home\controller\ParserController();
  71. $link=$Parser->parserLink(1,$value->urlname,'about',$value->scode,$value->filename,'','');
  72. {/php}
  73. <a href="{php}echo $link{/php}" class="layui-btn layui-btn-xs layui-btn-primary" target="_blank">查看</a>
  74. {/if}
  75. {if(check_level('mod'))}
  76. <a href="{url./admin/Single/mod/mcode/'.$value->mcode.'/id/'.$value->id.'}{$btnqs}" class="layui-btn layui-btn-xs" >修改</a>
  77. {if([$baidu_zz_token] && !$value->outlink)}
  78. <a href="{url./admin/'.C.'/mod/baiduzz/'.$value->id.'}" class="layui-btn layui-btn-xs layui-btn-primary" >百度普通推送</a>
  79. {/if}
  80. {if([$baidu_ks_token] && !$value->outlink)}
  81. <a href="{url./admin/'.C.'/mod/baiduks/'.$value->id.'}" class="layui-btn layui-btn-xs layui-btn-primary" >百度快速推送</a>
  82. {/if}
  83. {/if}
  84. </td>
  85. </tr>
  86. {/foreach}
  87. </tbody>
  88. </table>
  89. </div>
  90. </div>
  91. </div>
  92. {/if}
  93. {if([$mod])}
  94. <div class="layui-tab layui-tab-brief" lay-filter="tab">
  95. <ul class="layui-tab-title">
  96. <li class="layui-this">单页修改</li>
  97. </ul>
  98. <div class="layui-tab-content">
  99. <div class="layui-tab-item layui-show">
  100. <form action="{url./admin/Single/mod/id/'.[$get.id].'}{$backurl}" method="post" class="layui-form" id="edit">
  101. <input type="hidden" name="formcheck" value="{$formcheck}" >
  102. <div class="layui-tab">
  103. <ul class="layui-tab-title">
  104. <li class="layui-this">基本内容</li>
  105. <li>高级内容</li>
  106. </ul>
  107. <div class="layui-tab-content">
  108. <div class="layui-tab-item layui-show">
  109. <div class="layui-form-item">
  110. <label class="layui-form-label">内容标题 <span class="layui-text-red">*</span></label>
  111. <div class="layui-input-block">
  112. <input type="text" name="title" required lay-verify="required" value="{$content->title}" placeholder="请输入内容标题" class="layui-input">
  113. </div>
  114. </div>
  115. {foreach $extfield(key,value)}
  116. {if($value->type==1)} <!-- 单行文本 -->
  117. <div class="layui-form-item">
  118. <label class="layui-form-label">[value->description]</label>
  119. <div class="layui-input-block">
  120. <input type="text" name="[value->name]" value="{$content->{$value->name}}" placeholder="请输入[value->description]" class="layui-input">
  121. </div>
  122. </div>
  123. {/if}
  124. {if($value->type==2)}<!-- 多行文本 -->
  125. <div class="layui-form-item">
  126. <label class="layui-form-label">[value->description]</label>
  127. <div class="layui-input-block">
  128. <textarea name="[value->name]" class="layui-textarea" placeholder="请输入[value->description]">{php}$name=$value->name;echo str_replace('<br>', "\r\n",$this->vars['content']->$name);{/php}</textarea>
  129. </div>
  130. </div>
  131. {/if}
  132. {if($value->type==3)}<!-- 单选 -->
  133. <div class="layui-form-item">
  134. <label class="layui-form-label">[value->description]</label>
  135. <div class="layui-input-block">
  136. <div>
  137. {php}
  138. $radios=explode(',',$value->value);
  139. $name=$value->name;
  140. foreach ($radios as $value2) {
  141. if($this->vars['content']->$name==$value2){
  142. echo '<input type="radio" name="'.$value->name.'" value="'.$value2.'" title="'.$value2.'" checked>';
  143. }else{
  144. echo '<input type="radio" name="'.$value->name.'" value="'.$value2.'" title="'.$value2.'">';
  145. }
  146. }
  147. {/php}
  148. </div>
  149. </div>
  150. </div>
  151. {/if}
  152. {if($value->type==4)}<!-- 多选 -->
  153. <div class="layui-form-item">
  154. <label class="layui-form-label">[value->description]</label>
  155. <div class="layui-input-block">
  156. <div>
  157. {php}
  158. $checkboxs=explode(',',$value->value);
  159. $name=$value->name;
  160. echo '<input name="'.$value->name.'" type="hidden">';//占位清空
  161. $values=explode(',',$this->vars['content']->$name);
  162. foreach ($checkboxs as $value2) {
  163. if(in_array($value2,$values)){
  164. echo '<input type="checkbox" name="'.$value->name.'[]" value="'.$value2.'" title="'.$value2.'" checked>';
  165. }else{
  166. echo '<input type="checkbox" name="'.$value->name.'[]" value="'.$value2.'" title="'.$value2.'">';
  167. }
  168. }
  169. {/php}
  170. </div>
  171. </div>
  172. </div>
  173. {/if}
  174. {if($value->type==5)}<!-- 图片 -->
  175. <div class="layui-form-item">
  176. <label class="layui-form-label">[value->description]</label>
  177. <div class="layui-input-inline">
  178. <input type="text" name="[value->name]" id="[value->name]" value="{$content->{$value->name}}" placeholder="请上传[value->description]" class="layui-input">
  179. </div>
  180. <button type="button" class="layui-btn upload watermark" data-des="[value->name]">
  181. <i class="layui-icon">&#xe67c;</i>上传图片
  182. </button>
  183. {php}$name=$value->name; {/php}
  184. <div id="[value->name]_box" class="pic"><dl><dt>{if([$content]->$name)}<img src='{SITE_DIR}{$content->{$value->name}}' data-url="{$content->{$value->name}}"></dt><dd>删除</dd></dl>{/if}</div>
  185. </div>
  186. {/if}
  187. {if($value->type==6)}<!-- 文件 -->
  188. <div class="layui-form-item">
  189. <label class="layui-form-label">[value->description]</label>
  190. <div class="layui-input-inline">
  191. <input type="text" name="[value->name]" id="[value->name]" value="{$content->{$value->name}}" placeholder="请上传[value->description]" class="layui-input">
  192. </div>
  193. <button type="button" class="layui-btn file" data-des="[value->name]">
  194. <i class="layui-icon">&#xe67c;</i>上传文件
  195. </button>
  196. </div>
  197. {/if}
  198. {if($value->type==7)}<!-- 日期 -->
  199. <div class="layui-form-item">
  200. <label class="layui-form-label">[value->description]</label>
  201. <div class="layui-input-block">
  202. <input type="text" name="[value->name]" value="{$content->{$value->name}}" readonly placeholder="请选择[value->description]" class="layui-input datetime">
  203. </div>
  204. </div>
  205. {/if}
  206. {if($value->type==8)}<!-- 编辑器 -->
  207. <div class="layui-form-item">
  208. <label class="layui-form-label">[value->description]</label>
  209. <div class="layui-input-block">
  210. {php}
  211. $name=@$value->name;
  212. {/php}
  213. <script type="text/plain" id="editor_[value->name]" name="[value->name]" style="width:100%;height:240px;">{fun=decode_string([$content->$name])}</script>
  214. <script>
  215. //初始化编辑器
  216. $(document).ready(function (e) {
  217. var ue = UE.getEditor('editor_[value->name]',{
  218. maximumWords:10000
  219. });
  220. })
  221. </script>
  222. </div>
  223. </div>
  224. {/if}
  225. {if($value->type==9)}<!-- 下拉 -->
  226. <div class="layui-form-item">
  227. <label class="layui-form-label">[value->description]</label>
  228. <div class="layui-input-block">
  229. <select name="[value->name]">
  230. {php}
  231. $selects=explode(',',$value->value);
  232. $name=$value->name;
  233. foreach ($selects as $value2) {
  234. if($this->vars['content']->$name==$value2){
  235. echo '<option value="'.$value2.'" selected>'.$value2.'</option>';
  236. }else{
  237. echo '<option value="'.$value2.'">'.$value2.'</option>';
  238. }
  239. }
  240. {/php}
  241. </select>
  242. </div>
  243. </div>
  244. {/if}
  245. {/foreach}
  246. <div class="layui-form-item">
  247. <label class="layui-form-label">内容</label>
  248. <div class="layui-input-block">
  249. <script type="text/plain" id="editor" name="content" style="width:100%;height:240px;">{fun=decode_string([$content->content])}</script>
  250. </div>
  251. </div>
  252. <div class="layui-form-item">
  253. <label class="layui-form-label">tags</label>
  254. <div class="layui-input-block">
  255. <input type="text" name="tags" placeholder="请输入文章tag,英文逗号隔开" value="{$content->tags}" class="layui-input">
  256. </div>
  257. </div>
  258. <div class="layui-form-item">
  259. <label class="layui-form-label">作者</label>
  260. <div class="layui-input-block">
  261. <input type="text" name="author" placeholder="请输入作者" value="{$content->author}" class="layui-input">
  262. </div>
  263. </div>
  264. <div class="layui-form-item">
  265. <label class="layui-form-label">来源</label>
  266. <div class="layui-input-block">
  267. <input type="text" name="source" placeholder="请输入来源" value="{$content->source}" class="layui-input">
  268. </div>
  269. </div>
  270. <div class="layui-form-item">
  271. <label class="layui-form-label">缩略图</label>
  272. <div class="layui-input-inline">
  273. <input type="text" name="ico" id="ico" value="{$content->ico}" placeholder="请上传缩略图" class="layui-input">
  274. </div>
  275. <button type="button" class="layui-btn upload watermark" data-des="ico">
  276. <i class="layui-icon">&#xe67c;</i>上传图片
  277. </button>
  278. <div id="ico_box" class="pic addedit">{if([$content->ico])}<dl><dt><img src="{SITE_DIR}{$content->ico}" data-url="{$content->ico}"></dt><dd>删除</dd></dl>{/if}</div>
  279. </div>
  280. <div class="layui-form-item">
  281. <label class="layui-form-label">轮播多图</label>
  282. <div class="layui-input-inline">
  283. <input type="text" name="pics" id="pics" value="{$content->pics}" placeholder="请上传轮播多图" class="layui-input">
  284. </div>
  285. <button type="button" class="layui-btn uploads watermark" data-des="pics">
  286. <i class="layui-icon">&#xe67c;</i>上传多图
  287. </button>
  288. <div id="pics_box" class="pic addedit">
  289. <dl></dl> <!-- 规避空内容拖动bug -->
  290. {php}
  291. if([$content->pics]){
  292. $pics=explode(',',[$content->pics]);
  293. }else{
  294. $pics = array();
  295. }
  296. if([$content->picstitle]){
  297. $picstitle=explode(',',[$content->picstitle]);
  298. }else{
  299. $picstitle = array();
  300. }
  301. foreach ($pics as $key=>$value) {
  302. //需要留一个空,不然被解析为标签了
  303. echo "<dl><dt><img src='".SITE_DIR.$value."' data-url='".$value."'></dt><dd>删除</dd><dt><input type='text' value='".$picstitle[$key ]."' name='picstitle[]' style='width:95%' /></dt></dl>";
  304. }
  305. {/php}
  306. </div>
  307. </div>
  308. </div>
  309. <div class="layui-tab-item ">
  310. <div class="layui-form-item">
  311. <label class="layui-form-label">标题颜色</label>
  312. <div class="layui-input-inline">
  313. <input type="text" name="titlecolor" value="{$content->titlecolor}" placeholder="请选择标题颜色" class="layui-input jscolor {hash:true}">
  314. </div>
  315. </div>
  316. <div class="layui-form-item">
  317. <label class="layui-form-label">副标题</label>
  318. <div class="layui-input-block">
  319. <input type="text" name="subtitle" value="{$content->subtitle}" placeholder="请输入副标题" class="layui-input">
  320. </div>
  321. </div>
  322. <div class="layui-form-item">
  323. <label class="layui-form-label">时间</label>
  324. <div class="layui-input-inline">
  325. <input type="text" name="date" value="{$content->date}" readonly placeholder="请选择发布时间" class="layui-input datetime">
  326. </div>
  327. <div class="layui-form-mid layui-word-aux">温馨提示:单页不支持定时发布!</div>
  328. </div>
  329. <div class="layui-form-item">
  330. <label class="layui-form-label">附件</label>
  331. <div class="layui-input-inline">
  332. <input type="text" name="enclosure" id="enclosure" value="{$content->enclosure}" placeholder="请上传附件" class="layui-input">
  333. </div>
  334. <button type="button" class="layui-btn file" data-des="enclosure">
  335. <i class="layui-icon">&#xe67c;</i>上传附件
  336. </button>
  337. </div>
  338. <div class="layui-form-item">
  339. <label class="layui-form-label">SEO关键字</label>
  340. <div class="layui-input-block">
  341. <input type="text" name="keywords" value="{$content->keywords}" placeholder="请输入详情页SEO关键字" class="layui-input">
  342. </div>
  343. </div>
  344. <div class="layui-form-item">
  345. <label class="layui-form-label">SEO描述</label>
  346. <div class="layui-input-block">
  347. <textarea name="description" placeholder="请输入详情页SEO描述" class="layui-textarea">{$content->description}</textarea>
  348. </div>
  349. </div>
  350. <div class="layui-form-item">
  351. <label class="layui-form-label">状态</label>
  352. <div class="layui-input-block">
  353. <input type="radio" name="status" value="1" title="显示" {if([$content->status]==1)} checked="checked"{/if}>
  354. <input type="radio" name="status" value="0" title="隐藏" {if([$content->status]==0)} checked="checked"{/if}>
  355. </div>
  356. </div>
  357. </div>
  358. </div>
  359. </div>
  360. <div class="layui-form-item">
  361. <div class="layui-input-block">
  362. <button class="layui-btn" lay-submit>立即提交</button>
  363. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  364. {fun=get_btn_back()}
  365. </div>
  366. </div>
  367. </form>
  368. </div>
  369. </div>
  370. </div>
  371. {/if}
  372. </div>
  373. <style>.placeHolder {border:dashed 2px gray; }</style>
  374. <script type="text/javascript" src="{APP_THEME_DIR}/js/jquery.dragsort-0.5.2.min.js"></script>
  375. <script type="text/javascript">
  376. $("#pics_box").dragsort({
  377. dragSelector: "dl",
  378. dragSelectorExclude: "input,textarea,dd",
  379. dragBetween: false,
  380. dragEnd: saveOrder,
  381. placeHolderTemplate: "<dl class='placeHolder'><dt></dt></dl>"
  382. });
  383. function saveOrder() {
  384. var data = $("#pics_box dl dt img").map(function() {
  385. return $(this).data("url");
  386. }).get();
  387. $("input[name=pics]").val(data.join(","))
  388. };
  389. </script>
  390. <script type="text/javascript" src="{APP_THEME_DIR}/js/jscolor.js"></script>
  391. {include file='common/ueditor.html'}
  392. {include file='common/foot.html'}