설명 없음
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 27KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626
  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" style="box-shadow:none;">
  6. <div class="fixed-bar">
  7. <div class="item-title">
  8. {if condition="$Request.param.pid > 0"}
  9. <a class="back_xin" href="{:url('Citysite/index', ['pid'=>$parentInfo.parent_id])}" title="返回"><i class="iconfont e-fanhui"></i></a>
  10. {elseif condition="$Request.param.source eq 'archives'"}
  11. <a class="back_xin" href="javascript:history.back();" title="返回"><i class="iconfont e-fanhui"></i></a>
  12. {else /}
  13. <a class="back_xin" href="{:url('Index/switch_map')}" title="返回"><i class="iconfont e-fanhui"></i></a>
  14. {/if}
  15. <!-- <a class="back_sz" href="javascript:void(0);" data-href="{:url('Citysite/conf')}" onclick="openHelpframe(this, '功能配置', '500px', '100%', 'r');" title="功能配置"><i class="iconfont e-shezhi-tongyong"></i></a> -->
  16. <div class="subject">
  17. <h3>城市分站</h3>
  18. <h5></h5>
  19. </div>
  20. </div>
  21. </div>
  22. <div class="flexigrid" style="min-height: 600px;">
  23. <!-- 操作说明 -->
  24. <div id="explanation" class="explanation" style="color: rgb(44, 188, 163); background-color: rgb(237, 251, 248); margin-bottom: 10px;">
  25. <div id="checkZoom" class="title"><i class="fa fa-lightbulb-o"></i>
  26. <h4 title="提示相关设置操作时应注意的要点">操作提示</h4>
  27. <span title="收起提示" id="explanationZoom" style="display: block;"></span>
  28. </div>
  29. <ul>
  30. <li>如果前台要显示多城市分站列表,请<a href="JavaScript:void(0);" onclick="click_to_eyou_1575506523('https://www.eyoucms.com/plus/view.php?aid=11842&origin_eycms=1','citysite 多城市站点列表标签调用')">查看标签教程</a></li>
  31. </ul>
  32. </div>
  33. <div class="mDiv pt0">
  34. <div class="ftitle">
  35. {eq name="'Citysite@conf'|is_check_access" value="1"}
  36. <div class="fbutton">
  37. <a href="javascript:void(0);" data-href="{:url('Citysite/conf')}" onclick="openFullframe(this, '功能配置', '700px', '80%');">
  38. <div class="add">
  39. <span>功能配置</span>
  40. </div>
  41. </a>
  42. </div>
  43. {/eq}
  44. <div class="nav-dropup">
  45. <button class="layui-btn layui-btn-primary dropdown-bt" id="dropdown-bt-add">新增区域<i class="layui-icon layui-icon-down"></i></button>
  46. <div class="droptop-menus" id="dropdown-menus-add" style="display:none; {if condition='0 < $pager->totalRows && ($pager->totalRows < 4 || $pager->listRows < 4)'}top:28px;bottom:unset;border-bottom:1px solid rgba(0,0,0,.15);border-top:none; min-height: 110px;{/if}">
  47. {eq name="'Citysite@add'|is_check_access" value="1"}
  48. <a href="javascript:void(0);" data-href="{:url('Citysite/add', ['pid'=>$parentInfo.id])}" onclick="openFullframe(this, '单项新增', '700px', '80%');">单项新增</a>
  49. {/eq}
  50. {eq name="'Citysite@batch_add'|is_check_access" value="1"}
  51. <a href="javascript:void(0);" data-href="{:url('Citysite/batch_add', ['pid'=>$parentInfo.id])}" onclick="openFullframe(this, '批量新增', '700px', '80%');">批量新增</a>
  52. {/eq}
  53. {eq name="'Citysite@set_top_status'|is_check_access" value="1"}
  54. <a href="javascript:void(0);" onclick="import_city(this, '导入全国');" data-url="{:url('Citysite/import_city')}">导入全国数据</a>
  55. {/eq}
  56. </div>
  57. </div>
  58. <div class="nav-dropup">
  59. <button class="layui-btn layui-btn-primary dropdown-bt" id="dropdown-bt-sta">状态操作<i class="layui-icon layui-icon-down"></i></button>
  60. <div class="droptop-menus" id="dropdown-menus-sta" style="display:none; {if condition='0 < $pager->totalRows && ($pager->totalRows < 4 || $pager->listRows < 4)'}top:28px;bottom:unset;border-bottom:1px solid rgba(0,0,0,.15);border-top:none; min-height: 110px;{/if}">
  61. {eq name="'Citysite@set_top_status'|is_check_access" value="1"}
  62. <a href="javascript:void(0);" data-href="{:url('Citysite/set_city_status')}" onclick="setCityStatus(this, 1);">全部启用</a>
  63. {/eq}
  64. {eq name="'Citysite@set_top_status'|is_check_access" value="1"}
  65. <a href="javascript:void(0);" data-href="{:url('Citysite/set_city_status')}" onclick="setCityStatus(this, 0);">全部禁用</a>
  66. {/eq}
  67. {eq name="'Citysite@set_top_status'|is_check_access" value="1"}
  68. <a href="javascript:void(0);" data-href="{:url('Citysite/set_bqs_status')}" onclick="setBqsStatus(this);">启用推荐城市</a>
  69. {/eq}
  70. </div>
  71. </div>
  72. {notempty name="$parentInfo['id']"}
  73. <div class="fbutton">
  74. <a href="{:url('Citysite/index', ['pid'=>$parentInfo['parent_id']])}">
  75. <div class="adds">
  76. <span>
  77. 返回上一层
  78. </span>
  79. </div>
  80. </a>
  81. </div>
  82. {/notempty}
  83. </div>
  84. <!-- <div title="刷新数据" class="pReload"><i class="fa fa-refresh"></i></div> -->
  85. <form class="navbar-form form-inline" action="{:url('Citysite/index')}" method="get" onsubmit="layer_loading('正在处理');">
  86. {$searchform.hidden|default=''}
  87. <div class="sDiv">
  88. <div class="sDiv2 fl" style="">
  89. <input type="text" size="30" name="keywords" value="{$Request.param.keywords}" class="qsbox" placeholder="搜索名称...">
  90. <input type="submit" class="btn" value="搜索">
  91. <i class="iconfont e-sousuo"></i>
  92. </div>
  93. </div>
  94. </form>
  95. </div>
  96. <div class="hDiv">
  97. <div class="hDivBox">
  98. <table cellspacing="0" cellpadding="0" style="width: 100%">
  99. <thead>
  100. <tr>
  101. <th class="sign w40" axis="col0">
  102. <div class="tc"><input type="checkbox" class="checkAll"></div>
  103. </th>
  104. <th abbr="article_show" axis="col5" class="w40">
  105. <div class="tc">ID</div>
  106. </th>
  107. <th abbr="ac_id" axis="col4">
  108. <div class="text-l10">区域名称</div>
  109. </th>
  110. <th abbr="article_time" axis="col6" class="w120">
  111. <div class="tc">二级域名</div>
  112. </th>
  113. <th abbr="article_title" axis="col3" class="w160">
  114. <div class="tc">上级区域</div>
  115. </th>
  116. <th abbr="article_time" axis="col6" class="w60">
  117. <div class="tc">启用</div>
  118. </th>
  119. <th abbr="article_time" axis="col6" class="w50">
  120. <div class="tc">层级</div>
  121. </th>
  122. <th axis="col1" class="w220">
  123. <div class="tc">操作</div>
  124. </th>
  125. <th abbr="article_show" axis="col5" class="w60">
  126. <div class="tc">排序</div>
  127. </th>
  128. </tr>
  129. </thead>
  130. </table>
  131. </div>
  132. </div>
  133. <div class="bDiv" style="height: auto;">
  134. <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
  135. <table style="width: 100%">
  136. <tbody>
  137. {empty name="list"}
  138. <tr>
  139. <td class="no-data" align="center" axis="col0" colspan="50">
  140. <div class="no_row">
  141. <div class="no_pic"><img src="__SKIN__/images/null-data.png"></div>
  142. </div>
  143. </td>
  144. </tr>
  145. {else/}
  146. {foreach name="list" item="vo" key="k" }
  147. <tr>
  148. <td class="sign">
  149. <div class="w40 tc"><input type="checkbox" name="ids[]" value="{$vo.id}"></div>
  150. </td>
  151. <td class="sort">
  152. <div class="w40 tc">
  153. {$vo.id}
  154. </div>
  155. </td>
  156. <td style="width: 100%">
  157. <div class="text-l10">
  158. {eq name="'Citysite@edit'|is_check_access" value="1"}
  159. <input style="text-align: left;" type="text" onchange="changeTableVal('citysite','id','{$vo.id}','name',this);" value="{$vo.name}" />
  160. {else /}
  161. {$vo.name}
  162. {/eq}
  163. </div>
  164. </td>
  165. <td class="">
  166. <div class="w120 tc">
  167. {empty name='$vo.is_open'}——{else/}{$vo.domain}{/empty}
  168. </div>
  169. </td>
  170. <td class="">
  171. <div class="w160 tc">
  172. {empty name='$parentInfo.name'}无{else/}{$parentInfo.name}{/empty}
  173. </div>
  174. </td>
  175. <td>
  176. <div class="tc w60">
  177. {if condition="$vo['status'] eq 1"}
  178. <span class="yes" data-value="0" data-id="{$vo.id}" {eq name="'Citysite@edit'|is_check_access" value="1"}onClick="setStatus(this);"{/eq}><i class="fa fa-check-circle"></i>是</span>
  179. {else /}
  180. <span class="no" data-value="1" data-id="{$vo.id}" {eq name="'Citysite@edit'|is_check_access" value="1"}onClick="setStatus(this);"{/eq}><i class="fa fa-ban"></i>否</span>
  181. {/if}
  182. </div>
  183. </td>
  184. <td class="">
  185. <div class="w50 tc">
  186. {$vo.level}
  187. </div>
  188. </td>
  189. <td class="operation">
  190. <div class="w220 tc">
  191. {eq name="$Think.const.CONTROLLER_NAME.'@edit'|is_check_access" value="1"}
  192. <a href="javascript:void(0);" data-href="{:url('Citysite/edit',array('id'=>$vo['id']))}" class="btn blue" onclick="openFullframe(this, '编辑区域');">编辑</a>
  193. <i></i>
  194. {/eq}
  195. {lt name='$vo.level' value='3'}
  196. <a href="{:url('Citysite/index',array('pid'=>$vo['id']))}" class="btn blue">查看下级</a>
  197. {else /}
  198. <a href="javascript:void(0);" class="btn grey">查看下级</a>
  199. {/lt}
  200. <!-- <i></i>
  201. {if condition="($vo.is_default eq 1)"}
  202. <a class="btn grey" href="javascript:void(0);">默认区域</a>
  203. {else /}
  204. <a class="btn blue" href="javascript:;" onClick="changeSortOrder('{$vo.id}');">设为默认</a>
  205. {/if}
  206. -->
  207. {eq name="$Think.const.CONTROLLER_NAME.'@del'|is_check_access" value="1"}
  208. <i></i>
  209. <a class="btn red" href="javascript:void(0)" data-url="{:url('Citysite/del')}" data-id="{$vo.id}" data-msg="将同步清空该区域下的全部区域,确认删除?" onClick="delfun(this);">删除</a>
  210. {/eq}
  211. <i></i>
  212. <a href="{$vo.siteurl}" class="btn blue" target="_blank">预览</a>
  213. </div>
  214. </td>
  215. <i></i>
  216. <td class="sort">
  217. <div class="w60 tc">
  218. {eq name="'Citysite@edit'|is_check_access" value="1"}
  219. <input style="text-align: left;" type="text" onchange="changeTableVal('citysite','id','{$vo.id}','sort_order',this);" size="4" value="{$vo.sort_order}" />
  220. {else /}
  221. {$vo.sort_order}
  222. {/eq}
  223. </div>
  224. </td>
  225. </tr>
  226. {/foreach}
  227. {/empty}
  228. </tbody>
  229. </table>
  230. </div>
  231. <div class="iDiv" style="display: none;"></div>
  232. </div>
  233. <div class="footer-oper">
  234. <span class="ml15">
  235. <input type="checkbox" class="checkAll" autocomplete="off">
  236. </span>
  237. <div class="nav-dropup">
  238. <button class="layui-btn layui-btn-primary dropdown-bt" id="dropdown-bt-bat">批量操作<i class="layui-icon layui-icon-up"></i></button>
  239. <div class="dropdown-menus" id="dropdown-menus-bat" style="display:none; {if condition='0 < $pager->totalRows && ($pager->totalRows < 4 || $pager->listRows < 4)'}top:28px;bottom:unset;border-bottom:1px solid rgba(0,0,0,.15);border-top:none; min-height: 110px;{/if}">
  240. {eq name="'Citysite@batch_setcity'|is_check_access" value="1"}
  241. <a href="javascript:void(0);" onclick="batch_setcity(this, 'ids', '批量设置地区');" data-url="{:url('Citysite/batch_setcity', ['level'=>$parentInfo.level])}">设置地区</a>
  242. {/eq}
  243. {eq name="'Citysite@del'|is_check_access" value="1"}
  244. <a href="javascript:void(0);" onclick="batch_del(this, 'ids');" data-url="{:url('Citysite/del')}">删除地区</a>
  245. {/eq}
  246. <hr class="layui-bg-gray">
  247. {eq name="'Citysite@batch_setcityseo'|is_check_access" value="1"}
  248. <a href="javascript:void(0);" onclick="batch_setcityseo(this, 'ids', '批量设置SEO');" data-url="{:url('Citysite/batch_setcityseo', ['level'=>$parentInfo.level])}">设置SEO</a>
  249. {/eq}
  250. </div>
  251. </div>
  252. <a href="JavaScript:void(0);" onclick="click_to_eyou_1575506523('https://www.eyoucms.com/plus/view.php?aid=11842&origin_eycms=1','citysite 多城市站点列表标签调用')" style="font-size: 12px;padding-left: 10px;position:absolute;top: 18px">标签教程?</a>
  253. {include file="public/page" /}
  254. </div>
  255. </div>
  256. </div>
  257. <script>
  258. $(function(){
  259. $('input[name*=ids]').click(function(){
  260. if ($('input[name*=ids]').length == $('input[name*=ids]:checked').length) {
  261. $('.checkAll').prop('checked','checked');
  262. } else {
  263. $('.checkAll').prop('checked', false);
  264. }
  265. });
  266. $('input[type=checkbox].checkAll').click(function(){
  267. $('input[type=checkbox]').prop('checked',this.checked);
  268. });
  269. });
  270. $(document).ready(function(){
  271. // 表格行点击选中切换
  272. $('#flexigrid > table>tbody >tr').click(function(){
  273. $(this).toggleClass('trSelected');
  274. });
  275. // 点击刷新数据
  276. $('.fa-refresh').click(function(){
  277. location.href = location.href;
  278. });
  279. // 新增批量操作
  280. $("#dropdown-bt-add").click(function(){
  281. $("#dropdown-menus-add").slideToggle(200);
  282. $("#dropdown-menus-bat").slideUp(200);
  283. $("#dropdown-menus-sta").slideUp(200);
  284. event.stopPropagation();
  285. })
  286. // 状态批量操作
  287. $("#dropdown-bt-sta").click(function(){
  288. $("#dropdown-menus-sta").slideToggle(200);
  289. $("#dropdown-menus-bat").slideUp(200);
  290. $("#dropdown-menus-add").slideUp(200);
  291. event.stopPropagation();
  292. })
  293. // 批量操作
  294. $("#dropdown-bt-bat").click(function(){
  295. $("#dropdown-menus-bat").slideToggle(200);
  296. $("#dropdown-menus-add").slideUp(200);
  297. $("#dropdown-menus-sta").slideUp(200);
  298. event.stopPropagation();
  299. })
  300. $(document).click(function(){
  301. $("#dropdown-menus-bat").slideUp(200);
  302. $("#dropdown-menus-add").slideUp(200);
  303. $("#dropdown-menus-sta").slideUp(200);
  304. event.stopPropagation();
  305. })
  306. });
  307. //修改是否默认
  308. // function changeSortOrder(id) {
  309. // var url = "{:url('Citysite/setSortOrder')}";
  310. // $.ajax({
  311. // type: 'POST',
  312. // url: url,
  313. // data: {id:id,_ajax:1},
  314. // dataType: 'json',
  315. // success: function(res) {
  316. // if (res.code == 1) {
  317. // layer.msg(res.msg, {icon: 1, time:1000}, function(){
  318. // window.location.reload();
  319. // });
  320. // } else {
  321. // layer.msg(res.msg, {icon: 5}, function(){
  322. // window.location.reload();
  323. // });
  324. // }
  325. // },
  326. // error:function (e) {
  327. // showErrorAlert(e.responseText);
  328. // }
  329. // });
  330. // }
  331. /**
  332. * 关闭当前弹窗
  333. */
  334. function closeIframes(obj) {
  335. parent.layer.close(parentObj);
  336. }
  337. // 是否启用
  338. function setStatus(obj)
  339. {
  340. var src = "";
  341. if($(obj).hasClass('no')) // 图片点击是否操作
  342. {
  343. var text = "<i class='fa fa-check-circle'></i>是";
  344. if ($(obj).attr('data-yestext')) {
  345. text = $(obj).attr('data-yestext');
  346. }
  347. var value = 1;
  348. try {
  349. if ($(obj).attr('data-value')) {
  350. value = $(obj).attr('data-value');
  351. }
  352. } catch(e) {
  353. // 出现异常以后执行的代码
  354. // e:exception,用来捕获异常的信息
  355. }
  356. }else if($(obj).hasClass('yes')){ // 图片点击是否操作
  357. var text = "<i class='fa fa-ban'></i>否";
  358. if ($(obj).attr('data-notext')) {
  359. text = $(obj).attr('data-notext');
  360. }
  361. var value = 0;
  362. try {
  363. if ($(obj).attr('data-value')) {
  364. value = $(obj).attr('data-value');
  365. }
  366. } catch(e) {
  367. // 出现异常以后执行的代码
  368. // e:exception,用来捕获异常的信息
  369. }
  370. }else{ // 其他输入框操作
  371. var value = $(obj).val();
  372. }
  373. var id = $(obj).attr('data-id');
  374. var status = value;
  375. $.ajax({
  376. type: 'POST',
  377. url: eyou_basefile + "?m="+module_name+"&c=Citysite&a=setStatus&lang"+__lang__,
  378. data: {id:id, status:status, _ajax:1},
  379. dataType: 'json',
  380. success: function(res){
  381. if (res.code == 1) {
  382. if ($(obj).hasClass('no')) {
  383. $(obj).removeClass('no').addClass('yes');
  384. $(obj).html(text);
  385. }else if($(obj).hasClass('yes')) {
  386. $(obj).removeClass('yes').addClass('no');
  387. $(obj).html(text);
  388. }
  389. layer.msg(res.msg, {icon: 1, time: 500});
  390. } else {
  391. var time = parseFloat(res.wait) * 1000;
  392. layer.msg(res.msg, {icon: 5, time: time}, function(){
  393. window.location.reload();
  394. });
  395. }
  396. }
  397. });
  398. }
  399. /**
  400. * 快速开启百强市
  401. * @param {[type]} obj [description]
  402. */
  403. function setBqsStatus(obj) {
  404. var iframes = layer.open({
  405. type: 2,
  406. title: '快速启用百强市的列表',
  407. fixed: true, //不固定
  408. shadeClose: false,
  409. shade: layer_shade,
  410. offset: 'auto',
  411. // maxmin: true, //开启最大化最小化按钮
  412. area: ['80%', '80%'],
  413. anim: 0,
  414. btn: ['我已知晓,确认启用', '取消'],
  415. content: 'https://www.eyoucms.com/plus/view.php?aid=29193&origin_eycms=1',
  416. yes: function(index, layero){
  417. layer_loading('正在处理');
  418. $.ajax({
  419. type: 'POST',
  420. url: $(obj).data('href'),
  421. data: {_ajax:1},
  422. dataType: 'json',
  423. success: function(res) {
  424. if (res.code == 1) {
  425. layer.closeAll();
  426. var _parent = parent;
  427. _parent.layer.msg(res.msg, {icon: 1, time:1000}, function(){
  428. _parent.window.location.reload();
  429. });
  430. } else {
  431. showErrorAlert(res.msg);
  432. }
  433. },
  434. error:function (e) {
  435. showErrorAlert(e.responseText);
  436. }
  437. });
  438. }
  439. });
  440. }
  441. function setCityStatus(obj, status)
  442. {
  443. var title = '确定开启全部区域吗?';
  444. var btn = ['我已知晓,确认启用', '取消'];
  445. if (0 == status) {
  446. title = '确认关闭全部区域吗?';
  447. btn = ['我已知晓,确认关闭', '取消'];
  448. }
  449. layer.confirm(title, {
  450. shade: layer_shade,
  451. area: ['480px', '190px'],
  452. move: false,
  453. title: '提示',
  454. btnAlign:'r',
  455. closeBtn: 3,
  456. btn: btn, //按钮
  457. success: function () {
  458. $(".layui-layer-content").css('text-align', 'left');
  459. }
  460. }, function () {
  461. layer_loading('正在处理');
  462. $.ajax({
  463. type: 'POST',
  464. url: $(obj).data('href'),
  465. data: {status:status, _ajax:1},
  466. dataType: 'json',
  467. success: function(res) {
  468. if (res.code == 1) {
  469. layer.closeAll();
  470. layer.msg(res.msg, {icon: 1, time:1000}, function(){
  471. window.location.reload();
  472. });
  473. } else {
  474. showErrorAlert(res.msg);
  475. }
  476. },
  477. error:function (e) {
  478. showErrorAlert(e.responseText);
  479. }
  480. });
  481. }, function (index) {
  482. layer.closeAll(index);
  483. });
  484. }
  485. /**
  486. * 批量设置区域
  487. */
  488. function batch_setcity(obj, name, title)
  489. {
  490. var a = [];
  491. var k = 0;
  492. var ids = '';
  493. $('input[name^='+name+']').each(function(i,o){
  494. if($(o).is(':checked')){
  495. a.push($(o).val());
  496. if (k > 0) {
  497. ids += ',';
  498. }
  499. ids += $(o).val();
  500. k++;
  501. }
  502. })
  503. if(a.length == 0){
  504. layer.alert('请至少选择一项', {
  505. shade: layer_shade,
  506. area: ['480px', '190px'],
  507. move: false,
  508. title: '提示',
  509. btnAlign:'r',
  510. closeBtn: 3,
  511. success: function () {
  512. $(".layui-layer-content").css('text-align', 'left');
  513. }
  514. });
  515. return;
  516. }
  517. var url = $(obj).attr('data-url');
  518. //iframe窗
  519. layer.open({
  520. type: 2,
  521. title: title,
  522. fixed: true, //不固定
  523. shadeClose: false,
  524. shade: layer_shade,
  525. maxmin: false, //开启最大化最小化按钮
  526. area: ['650px', '520px'],
  527. content: url,
  528. success: function(layero, index){
  529. var body = layer.getChildFrame('body', index);
  530. body.find('input[name=ids]').val(ids);
  531. }
  532. });
  533. }
  534. /**
  535. * 批量设置SEO
  536. */
  537. function batch_setcityseo(obj, name, title)
  538. {
  539. var a = [];
  540. var k = 0;
  541. var ids = '';
  542. $('input[name^='+name+']').each(function(i,o){
  543. if($(o).is(':checked')){
  544. a.push($(o).val());
  545. if (k > 0) {
  546. ids += ',';
  547. }
  548. ids += $(o).val();
  549. k++;
  550. }
  551. })
  552. if(a.length == 0){
  553. layer.alert('请至少选择一项', {
  554. shade: layer_shade,
  555. area: ['480px', '190px'],
  556. move: false,
  557. title: '提示',
  558. btnAlign:'r',
  559. closeBtn: 3,
  560. success: function () {
  561. $(".layui-layer-content").css('text-align', 'left');
  562. }
  563. });
  564. return;
  565. }
  566. var url = $(obj).attr('data-url');
  567. //iframe窗
  568. layer.open({
  569. type: 2,
  570. title: title,
  571. fixed: true, //不固定
  572. shadeClose: false,
  573. shade: layer_shade,
  574. maxmin: false, //开启最大化最小化按钮
  575. area: ['650px', '520px'],
  576. content: url,
  577. success: function(layero, index){
  578. var body = layer.getChildFrame('body', index);
  579. body.find('input[name=ids]').val(ids);
  580. }
  581. });
  582. }
  583. /**
  584. * 一键导入全国城市
  585. */
  586. function import_city(obj, title)
  587. {
  588. var url = $(obj).attr('data-url');
  589. //iframe窗
  590. layer.open({
  591. type: 2,
  592. title: title,
  593. fixed: true, //不固定
  594. shadeClose: false,
  595. shade: layer_shade,
  596. maxmin: false, //开启最大化最小化按钮
  597. area: ['650px', '80%'],
  598. content: url,
  599. success: function(layero, index){
  600. }
  601. });
  602. }
  603. </script>
  604. {include file="public/footer" /}