Açıklama Yok
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.

import_city.htm 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. {include file="public/layout" /}
  2. <body style="background-color: rgb(255, 255, 255); overflow: auto; cursor: default; -moz-user-select: inherit;min-width: auto;">
  3. <div id="append_parent"></div>
  4. <div id="ajaxwaitid"></div>
  5. <div class="page" style="min-width: auto;box-shadow:none; padding-bottom: 0px;">
  6. <!-- 操作说明 -->
  7. <div id="explanation" class="explanation">
  8. <div id="checkZoom" class="title"><i class="fa fa-lightbulb-o"></i>
  9. <h4 title="提示相关设置操作时应注意的要点">提示</h4>
  10. <span title="收起提示" id="explanationZoom" style="display: block;"></span>
  11. </div>
  12. <ul>
  13. <li style="color: red;">注意:导入区域会自动过滤掉同级别的区域,保留原区域。</li>
  14. </ul>
  15. </div>
  16. <form class="form-horizontal" id="post_form" method="POST" action="{:url('Citysite/import_city')}" onsubmit="check_submit();">
  17. <div class="ncap-form-default">
  18. <dl class="row">
  19. <dt class="tit">
  20. <label for="">导入区域</label>
  21. </dt>
  22. <dd class="opt" style="width: auto;">
  23. <select name="province_id" id="province_id" style="margin:0px 5px;" onchange="set_city_list(0);">
  24. <option value="0">全国</option>
  25. {volist name='$province_list' id='vo'}
  26. <option value="{$vo.id}">{$vo.name}</option>
  27. {/volist}
  28. </select>
  29. <select name="city_id" id="city_id" style="margin:0px 5px;display: none;">
  30. <option value="">--请选择--</option>
  31. </select>
  32. <span class="err"></span>
  33. <p class="notic"></p>
  34. </dd>
  35. </dl>
  36. <dl class="row">
  37. <dt class="tit">
  38. <label for="is_open">二级域名</label>
  39. </dt>
  40. <dd class="opt" style="width: auto;">
  41. <label class="curpoin"><input type="radio" name="is_open" value="1">开启</label>&nbsp;&nbsp;
  42. <label class="curpoin"><input type="radio" name="is_open" value="0" checked="checked">关闭</label>
  43. <span class="err"></span>
  44. <p class="notic2 none" id="is_open_tips">开启之前,建议先做好二级域名解析及绑定,避免访问不了</p>
  45. </dd>
  46. </dl>
  47. <dl class="row">
  48. <dt class="tit">
  49. <label for="showall">主站文档</label>
  50. </dt>
  51. <dd class="opt" style="width: auto;">
  52. <label class="curpoin"><input type="radio" name="showall" value="1" checked="checked">显示</label>&nbsp;&nbsp;
  53. <label class="curpoin"><input type="radio" name="showall" value="0">隐藏</label>
  54. <span class="err"></span>
  55. <p class="notic">列表页面是否显示主站(所属区域为“全国”)的文档</p>
  56. </dd>
  57. </dl>
  58. <dl class="row">
  59. <dt class="tit">
  60. <label for="sort_order">SEO设置</label>
  61. </dt>
  62. <dd class="opt" style="width: auto;">
  63. <label class="curpoin"><input type="radio" name="seoset" value="1">自定义</label>&nbsp;&nbsp;
  64. <label class="curpoin"><input type="radio" name="seoset" value="0" checked="checked">引用系统默认</label>
  65. <span class="err"></span>
  66. <p class="notic">系统默认分站SEO在功能配置里统一填写</p>
  67. </dd>
  68. </dl>
  69. <div class="none" id="div_seoset_html">
  70. <dl class="row">
  71. <dt class="tit">
  72. <label for="seo_title">SEO标题</label>
  73. </dt>
  74. <dd class="opt" style="width: auto;">
  75. <input type="text" value="" name="seo_title" id="seo_title" class="input-txt" autocomplete="off">
  76. <p class="notic"></p>
  77. </dd>
  78. </dl>
  79. <dl class="row">
  80. <dt class="tit">
  81. <label>SEO关键词</label>
  82. </dt>
  83. <dd class="opt" style="width: auto;">
  84. <textarea rows="5" cols="60" id="seo_keywords" name="seo_keywords" style="height:20px;" autocomplete="off"></textarea>
  85. <span class="err"></span>
  86. <p class="notic"></p>
  87. </dd>
  88. </dl>
  89. <dl class="row">
  90. <dt class="tit">
  91. <label>SEO描述</label>
  92. </dt>
  93. <dd class="opt" style="width: auto;">
  94. <textarea rows="5" cols="60" id="seo_description" name="seo_description" style="height:60px;" autocomplete="off"></textarea>
  95. <span class="err"></span>
  96. <p class="notic"></p>
  97. <p class="notic2">{region}代表区域名称</p>
  98. </dd>
  99. </dl>
  100. </div>
  101. <dl class="row">
  102. <dt class="tit">
  103. <label for="status">区域状态</label>
  104. </dt>
  105. <dd class="opt" style="width: auto;">
  106. <label class="curpoin"><input type="radio" name="status" value="1">启用</label>&nbsp;&nbsp;
  107. <label class="curpoin"><input type="radio" name="status" value="0" checked="checked">禁用</label>
  108. <p class="notic"></p>
  109. </dd>
  110. </dl>
  111. <div class="bot" style="padding-bottom:0px;">
  112. <input type="hidden" name="_ajax" value="1">
  113. <a href="JavaScript:void(0);" onclick="check_submit();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a>
  114. </div>
  115. </div>
  116. </form>
  117. </div>
  118. <script type="text/javascript">
  119. var parentObj = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  120. $(function () {
  121. $('input[name=seoset]').click(function(){
  122. var seoset = $(this).val();
  123. if (0 == seoset) {
  124. $('#div_seoset_html').hide();
  125. } else {
  126. $('#div_seoset_html').show();
  127. }
  128. });
  129. $('input[name=is_open]').click(function(){
  130. var is_open = $(this).val();
  131. if (1 == is_open) {
  132. $('#is_open_tips').show();
  133. } else {
  134. $('#is_open_tips').hide();
  135. }
  136. });
  137. });
  138. function check_submit()
  139. {
  140. var province_id = $('#province_id').val();
  141. if (province_id > 0) {
  142. layer_loading('正在处理');
  143. $.ajax({
  144. url: "{:url('Citysite/import_city')}",
  145. type: 'POST',
  146. dataType: 'JSON',
  147. data: $('#post_form').serialize(),
  148. success: function(res){
  149. layer.closeAll();
  150. if (res.code == 1) {
  151. parent.layer.msg(res.msg, {shade: layer_shade, time: 1000}, function(){
  152. parent.window.location.reload();
  153. parent.layer.close(parentObj);
  154. });
  155. } else {
  156. showErrorMsg(res.msg);
  157. }
  158. return false;
  159. },
  160. error: function(e){
  161. layer.closeAll();
  162. showErrorAlert(e.responseText);
  163. return false;
  164. }
  165. });
  166. } else {
  167. layer_loading('<font id="allcity_progress">正在处理</font>');
  168. callback_single_handle(1);
  169. }
  170. }
  171. function callback_single_handle(province_id)
  172. {
  173. var url = "{:url('Citysite/import_city')}";
  174. url += "&cur_province_id="+province_id;
  175. $.ajax({
  176. url: url,
  177. type: 'POST',
  178. dataType: 'JSON',
  179. data: $('#post_form').serialize(),
  180. success: function(res){
  181. if (res.code == 1) {
  182. if (res.data.next_province_id == 0) {
  183. $('#allcity_progress').html('进度'+res.data.progress+'%');
  184. var timer = setTimeout(function(){
  185. clearTimeout(timer); // 清理定时任务
  186. layer.closeAll();
  187. parent.layer.msg(res.msg, {shade: layer_shade, time: 1000}, function(){
  188. parent.window.location.reload();
  189. parent.layer.close(parentObj);
  190. });
  191. }, 1000);
  192. } else {
  193. $('#allcity_progress').html('进度'+res.data.progress+'%');
  194. callback_single_handle(res.data.next_province_id);
  195. }
  196. } else {
  197. layer.closeAll();
  198. showErrorAlert(res.msg);
  199. }
  200. return false;
  201. },
  202. error: function(e){
  203. layer.closeAll();
  204. showErrorAlert(e.responseText);
  205. return false;
  206. }
  207. });
  208. }
  209. //获取二级城市列表
  210. function set_city_list(cityid, siteid) {
  211. var pid = $("#province_id").val();
  212. $.ajax({
  213. url: eyou_basefile + "?m=admin&c=Citysite&a=ajax_get_region_list&_ajax=1",
  214. type: 'POST',
  215. dataType: 'JSON',
  216. async: false,
  217. data: {pid:pid, level:2},
  218. success: function(res){
  219. if (res.code === 1){
  220. if (1 == res.data.isempty) {
  221. $("#city_id").hide();
  222. } else {
  223. $("#city_id").show();
  224. }
  225. $("#city_id").empty();
  226. $("#city_id").prepend(res.msg);
  227. if (cityid > 0) {
  228. $("#city_id").val(cityid);
  229. }
  230. }
  231. },
  232. error: function(e){
  233. showErrorMsg(e.responseText);
  234. return false;
  235. }
  236. });
  237. }
  238. </script>
  239. {include file="public/footer" /}