Ingen beskrivning
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.

add.htm 9.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
  4. <div id="append_parent"></div>
  5. <div id="ajaxwaitid"></div>
  6. <div class="page" style="min-width: auto;box-shadow:none;">
  7. <form class="form-horizontal" id="post_form" action="{:url('Citysite/add')}" method="post">
  8. <div class="ncap-form-default">
  9. <dl class="row">
  10. <dt class="tit">上级区域</dt>
  11. <dd class="opt" style="width: auto;">
  12. <div class="onoff">
  13. <select name="province_id" id="province_id" onchange="set_city_list(0);">
  14. <option value="0">默认顶级</option>
  15. {volist name='$province_all' id='vo'}
  16. <option value="{$vo.id}" {eq name="$province_id" value="$vo.id" } selected {/eq}>{$vo.name}</option>
  17. {/volist}
  18. </select>
  19. <select name="city_id" id="city_id" class="none ml5">
  20. <option value="0">--请选择--</option>
  21. </select>
  22. </div>
  23. <p class="notic"></p>
  24. </dd>
  25. </dl>
  26. <dl class="row">
  27. <dt class="tit">
  28. <label><em>*</em>区域名称</label>
  29. </dt>
  30. <dd class="opt" style="width: auto;">
  31. <input type="text" name="name" id="name" class="input-txt" autocomplete="off">
  32. </dd>
  33. </dl>
  34. <dl class="row">
  35. <dt class="tit">
  36. <label for="domain"><em>*</em>英文名称</label>
  37. </dt>
  38. <dd class="opt" style="width: auto;">
  39. <input type="text" name="domain" id="domain" value="" class="input-txt" onkeyup="this.value=this.value.replace(/[^0-9a-z]/g,'');" onpaste="this.value=this.value.replace(/[^0-9a-z]/g,'');" autocomplete="off">
  40. &nbsp;<a href="javascript:void(0);" onclick="get_name_pinyin(this);" class="ncap-btn ncap-btn-green">获取拼音</a>
  41. <span class="err"></span>
  42. <p class="notic">数字与小写字母的组合,前台访问:http://www.yourweb.com/英文名称</p>
  43. </dd>
  44. </dl>
  45. <dl class="row">
  46. <dt class="tit">
  47. <label for="is_open">二级域名</label>
  48. </dt>
  49. <dd class="opt" style="width: auto;">
  50. <label class="curpoin"><input type="radio" name="is_open" value="1">开启</label>&nbsp;&nbsp;
  51. <label class="curpoin"><input type="radio" name="is_open" value="0" checked="checked">关闭</label>
  52. <span class="err"></span>
  53. <p class="notic2 none" id="is_open_tips">
  54. 先做好二级域名 <span class="span_domain">demo</span>.{$Request.rootDomain} 的解析及绑定 ,访问链接 {$Request.scheme}://<span class="span_domain">demo</span>.{$rootDomain}
  55. </p>
  56. </dd>
  57. </dl>
  58. <dl class="row">
  59. <dt class="tit">
  60. <label for="showall">主站文档</label>
  61. </dt>
  62. <dd class="opt" style="width: auto;">
  63. <label class="curpoin"><input type="radio" name="showall" value="1" checked="checked">显示</label>&nbsp;&nbsp;
  64. <label class="curpoin"><input type="radio" name="showall" value="0">隐藏</label>
  65. <span class="err"></span>
  66. <p class="notic">
  67. 列表页面是否显示主站(所属区域为“全国”)的文档
  68. </p>
  69. </dd>
  70. </dl>
  71. <dl class="row">
  72. <dt class="tit">
  73. <label for="sort_order">SEO设置</label>
  74. </dt>
  75. <dd class="opt" style="width: auto;">
  76. <label class="curpoin"><input type="radio" name="seoset" value="1">自定义</label>&nbsp;&nbsp;
  77. <label class="curpoin"><input type="radio" name="seoset" value="0" checked="checked">引用系统默认</label>
  78. <span class="err"></span>
  79. <p class="notic">系统默认分站SEO在功能配置里统一填写</p>
  80. </dd>
  81. </dl>
  82. <div class="none" id="div_seoset_html">
  83. <dl class="row">
  84. <dt class="tit">
  85. <label for="seo_title">SEO标题</label>
  86. </dt>
  87. <dd class="opt" style="width: auto;">
  88. <input type="text" value="" name="seo_title" id="seo_title" class="input-txt" autocomplete="off">
  89. <p class="notic">一般不超过80个字符</p>
  90. </dd>
  91. </dl>
  92. <dl class="row">
  93. <dt class="tit">
  94. <label>SEO关键词</label>
  95. </dt>
  96. <dd class="opt" style="width: auto;">
  97. <textarea rows="5" cols="60" id="seo_keywords" name="seo_keywords" style="height:20px;" autocomplete="off"></textarea>
  98. <span class="err"></span>
  99. <p class="notic">一般不超过100个字符,多个关键词请用英文逗号(,)隔开,建议3到5个关键词。</p>
  100. </dd>
  101. </dl>
  102. <dl class="row">
  103. <dt class="tit">
  104. <label>SEO描述</label>
  105. </dt>
  106. <dd class="opt" style="width: auto;">
  107. <textarea rows="5" cols="60" id="seo_description" name="seo_description" style="height:60px;" autocomplete="off"></textarea>
  108. <span class="err"></span>
  109. <p class="notic">一般不超过200个字符</p>
  110. <p class="notic2">{region}代表区域名称</p>
  111. </dd>
  112. </dl>
  113. </div>
  114. <div class="bot"><a href="JavaScript:void(0);" onclick="checkForm();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a></div>
  115. </div>
  116. </form>
  117. </div>
  118. <script type="text/javascript">
  119. var parentObj = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  120. $(function () {
  121. try {
  122. set_city_list({$city_id|default=0});
  123. }catch(e){}
  124. $('input[name=seoset]').click(function(){
  125. var seoset = $(this).val();
  126. if (0 == seoset) {
  127. $('#div_seoset_html').hide();
  128. } else {
  129. $('#div_seoset_html').show();
  130. }
  131. });
  132. $('input[name=domain]').keyup(function(){
  133. var domain = $(this).val();
  134. $('.span_domain').html(domain);
  135. });
  136. $('input[name=is_open]').click(function(){
  137. var is_open = $(this).val();
  138. if (1 == is_open) {
  139. $('#is_open_tips').show();
  140. } else {
  141. $('#is_open_tips').hide();
  142. }
  143. });
  144. });
  145. // 判断输入框是否为空
  146. function checkForm(){
  147. if($('input[name=name]').val() == ''){
  148. showErrorMsg('区域名称不能为空!');
  149. $('input[name=name]').focus();
  150. return false;
  151. }
  152. if($('input[name=domain]').val() == ''){
  153. showErrorMsg('路径不能为空!');
  154. $('input[name=domain]').focus();
  155. return false;
  156. }
  157. layer_loading('正在处理');
  158. $.ajax({
  159. type : 'post',
  160. url : "{:url('Citysite/add', ['_ajax'=>1])}",
  161. data : $('#post_form').serialize(),
  162. dataType : 'json',
  163. success : function(res){
  164. layer.closeAll();
  165. if(res.code == 1){
  166. var _parent = parent;
  167. _parent.layer.close(parentObj);
  168. _parent.layer.msg(res.msg, {icon: 1, shade: layer_shade, time: 1000}, function(){
  169. _parent.window.location.reload();
  170. });
  171. }else{
  172. showErrorMsg(res.msg);
  173. }
  174. },
  175. error: function(e){
  176. layer.closeAll();
  177. showErrorAlert(e.responseText);
  178. }
  179. });
  180. }
  181. function get_name_pinyin(obj)
  182. {
  183. var name = $('input[name=name]').val();
  184. if ($.trim(name) == '') {
  185. showErrorMsg('区域名称不能为空!');
  186. $('input[name=name]').focus();
  187. return false;
  188. }
  189. $(obj).html('正在处理');
  190. $.ajax({
  191. url: "{:url('Citysite/ajax_get_name_pinyin', ['_ajax'=>1])}",
  192. type: 'POST',
  193. dataType: 'JSON',
  194. data: {name: name},
  195. success: function(res){
  196. $(obj).html('获取拼音');
  197. if (res.code == 1) {
  198. $('input[name=domain]').val(res.data.pinyin);
  199. return true;
  200. } else {
  201. showErrorMsg('获取失败');
  202. return false;
  203. }
  204. },
  205. error: function(e){
  206. $(obj).html('获取拼音');
  207. showErrorMsg(e.responseText);
  208. return false;
  209. }
  210. });
  211. }
  212. </script>
  213. {include file="public/footer" /}