Nessuna descrizione
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.

index.htm 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. {include file="public/layout" /}
  2. <body class="bodystyle" style="cursor: default; -moz-user-select: inherit;">
  3. <div id="append_parent"></div>
  4. <div id="ajaxwaitid"></div>
  5. <div class="page min-hg-c-10">
  6. <div class="flexigrid">
  7. <div class="mDiv">
  8. <div class="ftitle">
  9. {if condition="$main_lang == $admin_lang || !empty($global['language_split'])"}
  10. {eq name="$Think.const.CONTROLLER_NAME.'@add'|is_check_access" value="1"}
  11. <div class="fbutton">
  12. <a href="javascript:void(0);" data-href="{:url('AdPosition/add')}" onclick="openFullframe(this, '新增广告', '100%', '100%');">
  13. <div class="add">
  14. <span><i class="layui-icon layui-icon-addition"></i>新增广告</span>
  15. </div>
  16. </a>
  17. </div>
  18. {/eq}
  19. {/if}
  20. </div>
  21. <form id="searchForm" class="navbar-form form-inline" action="{:url('AdPosition/index')}" method="get" onsubmit="layer_loading('正在处理');">
  22. {$searchform.hidden|default=''}
  23. <div class="sDiv">
  24. <div class="sDiv2">
  25. <select name="type" class="select" style="margin:0px 5px;">
  26. <option value="">--广告类型--</option>
  27. <option value="1" {eq name="$Request.param.type" value="1"}selected{/eq}>图片</option>
  28. <option value="2" {eq name="$Request.param.type" value="2"}selected{/eq}>多媒体</option>
  29. <option value="3" {eq name="$Request.param.type" value="3"}selected{/eq}>HTML代码</option>
  30. </select>
  31. </div>
  32. <div class="sDiv2">
  33. <input type="text" size="30" name="keywords" value="{$Request.param.keywords}" class="qsbox" placeholder="名称搜索...">
  34. <input type="submit" class="btn" value="搜索">
  35. <i class="iconfont e-sousuo"></i>
  36. </div>
  37. </div>
  38. </form>
  39. </div>
  40. <div class="hDiv">
  41. <div class="hDivBox">
  42. <table cellspacing="0" cellpadding="0" style="width: 100%">
  43. <thead>
  44. <tr>
  45. {if condition="$main_lang == $admin_lang || !empty($global['language_split'])"}
  46. <th class="sign w40" axis="col0">
  47. <div class="tc"><input type="checkbox" class="checkAll"></div>
  48. </th>
  49. {/if}
  50. <th abbr="article_title" axis="col3" class="w60">
  51. <div class="tc">ID</div>
  52. </th>
  53. <th abbr="article_title" axis="col3">
  54. <div class="tl text-l10" style="width: 100%">广告名称</div>
  55. </th>
  56. <th abbr="article_title" axis="col3" class="w100">
  57. <div class="tc">广告类型</div>
  58. </th>
  59. <th abbr="article_title" axis="col3" class="w120">
  60. <div class="tc">封面图片</div>
  61. </th>
  62. <th abbr="article_time" axis="col6" class="w60">
  63. <div class="tc">启用</div>
  64. </th>
  65. <th axis="col1" class="w180">
  66. <div class="tc">操作</div>
  67. </th>
  68. </tr>
  69. </thead>
  70. </table>
  71. </div>
  72. </div>
  73. <div class="bDiv" style="height: auto;">
  74. <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
  75. <table style="width: 100%">
  76. <tbody>
  77. {empty name="list"}
  78. <tr>
  79. <td class="no-data" align="center" axis="col0" colspan="50">
  80. <div class="no_row">
  81. <div class="no_pic"><img src="__SKIN__/images/null-data.png"></div>
  82. </div>
  83. </td>
  84. </tr>
  85. {else/}
  86. {foreach name="list" item="vo" key="k" }
  87. <tr>
  88. {if condition="$main_lang == $admin_lang || !empty($global['language_split'])"}
  89. <td class="sign">
  90. <div class="w40 tc"> <input type="checkbox" name="ids[]" value="{$vo.id}"> </div>
  91. </td>
  92. {/if}
  93. <td>
  94. <div class="tc w60">
  95. {eq name='$main_lang' value='$admin_lang'}
  96. {$vo.id}
  97. {else /}
  98. {$main_adv_list[$vo['id']]['id']|default=$vo['id']}
  99. {/eq}
  100. </div>
  101. </td>
  102. <td align="left" style="width:100%;">
  103. <div class="tl text-l10">
  104. {eq name="$Think.const.CONTROLLER_NAME.'@edit'|is_check_access" value="1"}
  105. <a href="javascript:void(0);" data-href="{:url('AdPosition/edit',array('id'=>$vo['id']))}" data-closereload="1" onclick="openFullframe(this, '编辑广告', '100%', '100%');">{$vo.title}</a>
  106. {else /}
  107. {$vo.title}
  108. {/eq}
  109. </div>
  110. </td>
  111. <td>
  112. <div class="tc w100"> {$vo.type_name} </div>
  113. </td>
  114. <td>
  115. <div class="tc w120">
  116. <ul class="adpic">
  117. {volist name="$vo.ad" id="vs" length="1" }
  118. <li>
  119. <img src="{$vs.litpic}"> {eq name="$vo.type" value="1"}<span>{$vo.ad_count}</span>{/eq}
  120. </li>
  121. {/volist}
  122. </ul>
  123. </div>
  124. </td>
  125. <td>
  126. <div class="tc w60">
  127. {if condition="$vo['status'] eq 1"}
  128. <span class="yes" {eq name="$Think.const.CONTROLLER_NAME.'@edit'|is_check_access" value="1"}onClick="changeTableVal('ad_position','id','{$vo.id}','status',this);"{/eq} ><i class="fa fa-check-circle"></i>是</span>
  129. {else /}
  130. <span class="no" {eq name="$Think.const.CONTROLLER_NAME.'@edit'|is_check_access" value="1"}onClick="changeTableVal('ad_position','id','{$vo.id}','status',this);"{/eq} ><i class="fa fa-ban"></i>否</span>
  131. {/if}
  132. </div>
  133. </td>
  134. <td class="operation">
  135. <div class="w180 tc">
  136. {eq name="$Think.const.CONTROLLER_NAME.'@edit'|is_check_access" value="1"}
  137. <a href="javascript:void(0);" data-href="{:url('AdPosition/edit',array('id'=>$vo['id']))}" data-closereload="1" class="btn blue" onclick="openFullframe(this, '编辑广告', '100%', '100%');">编辑</a> <i></i>
  138. {/eq}
  139. {if condition="$main_lang == $admin_lang || !empty($global['language_split'])"}
  140. {eq name="$Think.const.CONTROLLER_NAME.'@del'|is_check_access" value="1"}
  141. <a class="btn red" href="javascript:void(0);" data-url="{:url('AdPosition/del')}" data-id="{$vo.id}" onClick="delfun(this);">删除</a>
  142. {/eq} <i></i>
  143. {/if}
  144. <a class="btn blue" href="javascript:void(0);" onclick="copyToClipBoard({$main_adv_list[$vo['id']]['id']|default=$vo['id']}, 1, {$vo['type']})">标签调用</a>
  145. </div>
  146. </td>
  147. </tr>
  148. {/foreach}
  149. {/empty}
  150. </tbody>
  151. </table>
  152. </div>
  153. <div class="iDiv" style="display: none;"></div>
  154. </div>
  155. {notempty name="list"}
  156. <div class="tDiv">
  157. <div class="tDiv2">
  158. {if condition="$main_lang == $admin_lang || !empty($global['language_split'])"}
  159. <div class="fbutton checkboxall"> <input type="checkbox" class="checkAll"> </div>
  160. {eq name="$Think.const.CONTROLLER_NAME.'@del'|is_check_access" value="1"}
  161. <div class="fbutton">
  162. <a onclick="batch_del(this, 'ids');" data-url="{:url('AdPosition/del')}" class="layui-btn layui-btn-primary">批量删除</a>
  163. </div>
  164. {/eq}
  165. {/if}
  166. <!-- 分页 -->
  167. {include file="public/page" /}
  168. </div>
  169. <div style="clear:both"></div>
  170. </div>
  171. {/notempty}
  172. </div>
  173. </div>
  174. <script type="text/javascript">
  175. $(function() {
  176. $('input[name*=ids]').click(function() {
  177. if ($('input[name*=ids]').length == $('input[name*=ids]:checked').length) {
  178. $('.checkAll').prop('checked', 'checked');
  179. } else {
  180. $('.checkAll').prop('checked', false);
  181. }
  182. });
  183. $('input[type=checkbox].checkAll').click(function() {
  184. $('input[type=checkbox]').prop('checked', this.checked);
  185. });
  186. });
  187. $(document).ready(function() {
  188. // 表格行点击选中切换
  189. $('#flexigrid > table>tbody >tr').click(function() {
  190. $(this).toggleClass('trSelected');
  191. });
  192. // 点击刷新数据
  193. $('.fa-refresh').click(function() {
  194. location.href = location.href;
  195. });
  196. $('#searchForm select[name=type]').change(function(){
  197. $('#searchForm').submit();
  198. });
  199. });
  200. /**
  201. * 代码调用js
  202. * @param id id
  203. * @param limit 条数
  204. */
  205. function copyToClipBoard(id, limit, type) {
  206. var advstr = '';
  207. if (1 == type) {
  208. advstr = "{eyou:adv pid='" + id + "'}\r\n <img src='{$"+"field.litpic}' alt='{$"+"field.title}' />\r\n{/eyou:adv";
  209. } else if (2 == type) {
  210. advstr = "{eyou:adv pid='" + id + "'}\r\n <video src='{$"+"field.litpic}' controls preload='auto' oncontextmenu='return fase'></video>\r\n{/eyou:adv";
  211. } else if (3 == type) {
  212. advstr = "{eyou:adv pid='" + id + "'}\r\n {$"+"field.intro}\r\n{/eyou:adv";
  213. }
  214. var contentdiv = '<div class="dialog_content" style="margin: 0px; padding: 0px;"><dl style="padding:10px 30px;line-height:30px"><dd>标签 adv 调用:</dd>';
  215. contentdiv += '<textarea rows="4" cols="60" style="width:400px;height:60px;">' + advstr + '}</textarea>';
  216. contentdiv += '<dd>JavaScript:</dd>';
  217. contentdiv += '<dd><input type="text" style=" width:400px;" value="<script type=&quot;text/javascript&quot; src=&quot;http://' + '{$Think.server.http_host}' + '__ROOT_DIR__/index.php?m=api&amp;c=Other&amp;a=other_show&amp;pid=' + id + '&amp;row='+limit+'&quot;><\/script>"></dd>';
  218. contentdiv += '<dd style="border-top: dotted 1px #E7E7E7; color: #F60;">请将标签adv或JavaScript代码复制并粘贴到对应模板文件中!</dd></dl></div>';
  219. layer.open({
  220. title: '代码调用',
  221. type: 1,
  222. shade: layer_shade,
  223. skin: 'layui-layer-demo',
  224. area: ['480px', '280px'], //宽高
  225. content: contentdiv
  226. });
  227. }
  228. </script>
  229. {include file="public/footer" /}