link.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. <script type="text/javascript">
  2. function clicklink(href, title) {
  3. if(href=='tel:'){
  4. require(['util'],function(u){
  5. u.message('请添加一键拨号号码.');
  6. });
  7. return;
  8. }
  9. if($.isFunction({$callback})){
  10. {$callback}(href, title);
  11. }
  12. }
  13. function linkModal(a) {
  14. $(".link-browser").addClass('hide');
  15. $(".link-modal > div").addClass('hide');
  16. $(a).removeClass('hide');
  17. }
  18. function retrunLinkBrowser() {
  19. $(".link-browser").removeClass('hide');
  20. $(".link-modal > div").addClass('hide');
  21. }
  22. require(['util'], function (u) {
  23. $('.pagination a').click(function() {
  24. var page = $(this).attr('page');
  25. {$callback}('', page);
  26. });
  27. });
  28. </script>
  29. {if $do == 'modulelink'}
  30. <style type="text/css">
  31. .link-browser ul li{width: 120px; }
  32. .link-module {margin-left: 15px; }
  33. .list-group .list-group-item a{color:#428bca;}
  34. .link-browser .page-header, .link-modal .page-header{margin:25px 0 10px;}
  35. .link-browser .page-header:first-child, .link-modal .page-header:first-of-type{margin-top:0;}
  36. .link-browser div.btn, .link-modal div.btn{min-width:100px; text-align:center; margin:5px 2px;}
  37. </style>
  38. <div class="link-module">
  39. <div class="link-browser">
  40. <form method="post" class="form-horizontal form" enctype="multipart/form-data" >
  41. <div class="form-group" id="url">
  42. <label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
  43. {loop $entries $key $item}
  44. <div class="page-header">
  45. <h4><i class="fa fa-folder-open-o"></i> {$item['title']}</h4>
  46. </div>
  47. {loop $item['menu'] $entrie}
  48. <div class="btn btn-default" onclick="clicklink('{$entrie['url']}', '{$key}_menu_{$entrie['do']}')" title="">{$entrie['title']}</div>
  49. {/loop}
  50. {/loop}
  51. </div>
  52. </form>
  53. </div>
  54. </div>
  55. {elseif $do == 'page'}
  56. <div class="tab-pane active" role="tabpanel">
  57. <table class="table table-hover">
  58. <thead class="table table-hover">
  59. <tr>
  60. <th style="width: 40%;">名称</th>
  61. <th style="width: 30%;">创建时间</th>
  62. <th style="width: 30%; text-align: right">
  63. <div class="input-group input-group-sm">
  64. <input type="text" class="form-control">
  65. <span class="input-group-btn">
  66. <button class="btn btn-default" type="button"><i class="fa fa-search"></i></button>
  67. </span>
  68. </div>
  69. </th>
  70. </tr>
  71. </thead>
  72. <tbody>
  73. {loop $result['list'] $list}
  74. <tr>
  75. <td><a href="#">{$list['title']}</a></td>
  76. <td><a href="#">{$list['createtime']}</a></td>
  77. <td><button class="btn btn-default select" onclick="clicklink('./index.php?i={$list['uniacid']}&c=home&a=page&id={$list['id']}')">选取</button></td>
  78. </tr>
  79. {/loop}
  80. </tbody>
  81. </table>
  82. {$result['pager']}
  83. </div>
  84. {elseif $do == 'news'}
  85. <div class="tab-pane active" role="tabpanel">
  86. <table class="table table-hover">
  87. <thead class="table table-hover">
  88. <tr>
  89. <th style="width: 40%;">标题</th>
  90. <th style="width: 30%;"></th>
  91. <th style="width: 30%; text-align: right">
  92. <div class="input-group input-group-sm">
  93. <input type="text" class="form-control">
  94. <span class="input-group-btn">
  95. <button class="btn btn-default" type="button"><i class="fa fa-search"></i></button>
  96. </span>
  97. </div>
  98. </th>
  99. </tr>
  100. </thead>
  101. <tbody>
  102. {loop $result['list'] $list}
  103. <tr>
  104. <td><a href="#">{$list['title']}</a></td>
  105. <td><a href="#"></a></td>
  106. <td><button class="btn btn-default select" onclick="clicklink('./index.php?i={$_W['uniacid']}&c=entry&id={$list['id']}&do=detail&m=news')">选取</button></td>
  107. </tr>
  108. {/loop}
  109. </tbody>
  110. </table>
  111. {$result['pager']}
  112. </div>
  113. {elseif $do == 'article'}
  114. <div class="tab-pane active" role="tabpanel">
  115. <ul role="tablist" class="nav nav-pills" style="font-size:14px; margin-top:10px; margin-bottom: 10px">
  116. <li role="presentation" class="active" id="li_goodslist"><a data-toggle="tab" role="tab" href="javascript:" onclick="$('#articlelist').show();$('#categorylist').hide();$('.active').removeClass();$(this).parent().addClass('active')">文章</a></li>
  117. <li role="presentation" class="" id="li_category"><a data-toggle="tab" role="tab" href="javascript:" onclick="$('#articlelist').hide();$('#categorylist').show();$('.active').removeClass();$(this).parent().addClass('active')">分类</a></li>
  118. </ul>
  119. <div id="articlelist">
  120. <table class="table table-hover">
  121. <thead class="table table-hover">
  122. <tr>
  123. <th style="width: 40%;">标题</th>
  124. <th style="width: 30%;">创建时间</th>
  125. <th style="width: 30%; text-align: right">
  126. <div class="input-group input-group-sm">
  127. <input type="text" class="form-control">
  128. <span class="input-group-btn">
  129. <button class="btn btn-default" type="button"><i class="fa fa-search"></i></button>
  130. </span>
  131. </div>
  132. </th>
  133. </tr>
  134. </thead>
  135. <tbody>
  136. {loop $result['list'] $list}
  137. <tr>
  138. <td><a href="#">{$list['title']}</a></td>
  139. <td><a href="#"></a></td>
  140. <td><button class="btn btn-default select" onclick="clicklink('./index.php?c=site&a=site&do=detail&id={$list['id']}&i={$list['uniacid']}')">选取</button></td>
  141. </tr>
  142. {/loop}
  143. </tbody>
  144. </table>
  145. {$result['pager']}
  146. </div>
  147. <div id="categorylist" class="tab-pane" role="tabpanel" style="display: none">
  148. <table class="table table-hover">
  149. <thead class="navbar-inner">
  150. <tr>
  151. <th style="width:40%;">标题</th>
  152. <th style="width:30%">创建时间</th>
  153. <th style="width:30%; text-align:right">
  154. <div class="input-group input-group-sm">
  155. <input type="text" class="form-control">
  156. <span class="input-group-btn">
  157. <button class="btn btn-default" type="button"><i class="fa fa-search"></i></button>
  158. </span>
  159. </div>
  160. </th>
  161. </tr>
  162. </thead>
  163. <tbody>
  164. {loop $category $cate}
  165. <tr>
  166. <td colspan="2"><a href="#">{$cate['name']}</a></td>
  167. <td class="text-right"><button class="btn btn-default select" onclick="clicklink('./index.php?c=site&a=site&cid={$cate['id']}&i={$cate['uniacid']}')">选取</button></td>
  168. </tr>
  169. {loop $cate['children'] $child}
  170. <tr>
  171. <td colspan="2" style="padding-left:50px;height:30px;line-height:30px;background-image:url('./resource/images/bg_repno.gif'); background-repeat:no-repeat; background-position: -245px -540px;"><a href="#">{$child['name']}</a></td>
  172. <td class="text-right">
  173. <button class="btn btn-default select" onclick="clicklink('./index.php?c=site&a=site&cid={$child['id']}&i={$child['uniacid']}')">选取</button>
  174. </td>
  175. </tr>
  176. {/loop}
  177. {/loop}
  178. </tbody>
  179. </table>
  180. </div>
  181. </div>
  182. {elseif $do == 'phone'}
  183. <div id="">
  184. <div class="form-group list-group-item clearfix">
  185. <label class="col-xs-12 col-sm-2 col-md-2 control-label" style="margin-top:5px;">号码</label>
  186. <div class="col-sm-6">
  187. <input type="text" class="form-control" name="telphone" id="telphone" value="" />
  188. </div>
  189. <div class="col-sm-4">
  190. <a href="javascript:;" class="btn btn-primary" onclick="clicklink('tel:' + $('#telphone').val());">确定</a>
  191. </div>
  192. </div>
  193. </div>
  194. {elseif $do == 'entry'}
  195. <style type="text/css">
  196. .link-browser ul li{width: 120px; }
  197. .list-group .list-group-item a{color:#428bca;}
  198. .link-browser .page-header, .link-modal .page-header{margin:25px 0 10px;}
  199. .link-browser .page-header:first-child, .link-modal .page-header:first-of-type{margin-top:0;}
  200. .link-browser div.btn, .link-modal div.btn{min-width:100px; text-align:center; margin:5px 2px;}
  201. </style>
  202. <!--二级页面-->
  203. <div class="link-modal">
  204. <!--一键拨号-->
  205. <div id="telphone-modal" class="hide">
  206. <ol class="breadcrumb">
  207. <li><a href="javascript:;" onclick="retrunLinkBrowser();">选择器首页</a></li>
  208. <li><a href="javascript:;" onclick="retrunLinkBrowser();">系统默认链接</a></li>
  209. <li class="active">一键拨号</li>
  210. </ol>
  211. <div class="form-group list-group-item clearfix">
  212. <label class="col-xs-12 col-sm-2 col-md-2 control-label" style="margin-top:5px;">号码</label>
  213. <div class="col-sm-6">
  214. <input type="text" class="form-control" name="telphone" id="telphone" value="" />
  215. </div>
  216. <div class="col-sm-4">
  217. <a href="javascript:;" class="btn btn-primary" onclick="clicklink('tel:' + $('#telphone').val());">确定</a>
  218. </div>
  219. </div>
  220. </div>
  221. {loop $modulemenus $moduletype $modules}
  222. {loop $modules $modulekey $module}
  223. <div id="{$module['name']}" class="hide">
  224. <ol class="breadcrumb">
  225. <li><a href="javascript:;" onclick="retrunLinkBrowser();">选择器首页</a></li>
  226. <li><a href="javascript:;" onclick="retrunLinkBrowser();">{$modtypes[$moduletype]['title']}</a></li>
  227. <li class="active">{$module['title']}</li>
  228. </ol>
  229. {loop $linktypes $linktypekey $linktype}
  230. {if !empty($module[$linktypekey])}
  231. <div class="page-header">
  232. <h4><i class="fa fa-folder-open-o"></i> {$linktype}</h4>
  233. </div>
  234. {loop $module[$linktypekey] $m}
  235. <div class="btn btn-default" onclick="clicklink('{$m['url']}', '{$m['title']}');" title="{$m['title']}">{php echo cutstr($m['title'],6);}</div>
  236. {/loop}
  237. {/if}
  238. {/loop}
  239. </div>
  240. {/loop}
  241. {/loop}
  242. </div>
  243. <!--一级页面-->
  244. <div class="link-browser">
  245. <div class="page-header">
  246. <h4><i class="fa fa-folder-open-o"></i> 系统默认链接</h4>
  247. </div>
  248. {loop $sysmenus $m}
  249. <div class="btn btn-default" onclick="clicklink('{$m['url']}', '{$m['title']}');" title="{$m['title']}">{$m['title']}</div>
  250. {/loop}
  251. <div class="btn btn-default" onclick="linkModal('#telphone-modal')">一键拨号</div>
  252. {if !empty($cardmenus)}
  253. <div class="page-header">
  254. <h4><i class="fa fa-folder-open-o"></i> 会员卡功能链接</h4>
  255. </div>
  256. {loop $cardmenus $c}
  257. <div class="btn btn-default" onclick="clicklink('{$c['url']}', '{$c['title']}');" title="{$c['title']}">{$c['title']}</div>
  258. {/loop}
  259. {/if}
  260. {if !empty($multimenus)}
  261. <div class="page-header">
  262. <h4><i class="fa fa-folder-open-o"></i> 多微站首页链接</h4>
  263. </div>
  264. {loop $multimenus $multi}
  265. <div class="btn btn-default" onclick="clicklink('{$multi['url']}', '{$multi['title']}');" title="{$multi['title']}">{$multi['title']}</div>
  266. {/loop}
  267. {/if}
  268. {loop $modulemenus $moduletype $modules}
  269. <div class="page-header">
  270. <h4><i class="fa fa-folder-open-o"></i> {$modtypes[$moduletype]['title']}</h4>
  271. </div>
  272. {loop $modules $modulekey $module}
  273. <div class="btn btn-default" onclick="linkModal('#{$module['name']}', '{$module['title']}')" title="{$module['title']}">{$module['title']}</div>
  274. {/loop}
  275. {/loop}
  276. </div>
  277. {/if}