post.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <!DOCTYPE html>
  2. <html lang="zh-CN" class="index_page">
  3. <head>
  4. {template header}
  5. <title>{$page_title}</title>
  6. <meta name="description" id="description" content="{$page_title}" />
  7. <link type="text/css" rel="stylesheet" href="{$mayimobile[mobiledomain]}/template/css/global.css">
  8. <link type="text/css" rel="stylesheet" href="{$mayimobile[mobiledomain]}/template/css/style.css">
  9. <link type="text/css" rel="stylesheet" href="{$mayimobile[mobiledomain]}/template/css/post.css">
  10. <script>window['current'] = '{echo $id ? "修改" : "发布"}信息';</script>
  11. <script language="javascript">
  12. var checkmobile = false;
  13. function submitForm() {
  14. if (document.form1.title.value == "") {
  15. alert('请填写信息标题!');
  16. document.form1.title.focus();
  17. return false
  18. }
  19. if ($("#title").val()) {
  20. if (!isNaN($("#title").val())) {
  21. alert('请填写正确的信息标题!');
  22. $("#title").focus();
  23. return false
  24. }
  25. }
  26. var length = lenthString($("#title").val());
  27. if (length < 6 || length > 80) {
  28. alert('标题请填写至少3个汉字,至多40个汉字!');
  29. $("#title").focus();
  30. return false
  31. }
  32. if (document.form1.endtime.value == "") {
  33. alert('请选择有效期!');
  34. document.form1.endtime.focus();
  35. return false
  36. }
  37. <!--{loop $show_mod_option $mymps}-->
  38. <!--{if $mymps[required]==1}-->
  39. if ($("[name='extra[{$mymps[identifier]}]']").val() == '') {
  40. alert('{$mymps[title]}不能为空!');
  41. $("[name='extra[{$mymps[identifier]}]']").focus();
  42. return false
  43. }
  44. <!--{/if}-->
  45. <!--{/loop}-->
  46. if (document.form1.contact_who.value == "") {
  47. alert('请填写联系人!');
  48. document.form1.contact_who.focus();
  49. return false
  50. }
  51. if ($("#contact_who").val()) {
  52. if (!isNaN($("#contact_who").val())) {
  53. alert('请填写正确的联系人!');
  54. document.form1.contact_who.focus();
  55. return false
  56. }
  57. }
  58. var isPhone = /^((\d{7,8})|(0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/;
  59. if(!isPhone.test(document.form1.tel.value)) {
  60. alert('请填写正确的手机!!');
  61. document.form1.tel.focus();
  62. return false;
  63. }
  64. if ($("#qq").val()) {
  65. if (isNaN($("#qq").val())) {
  66. alert('请填写正确的QQ号码!');
  67. document.form1.qq.focus();
  68. return false
  69. }
  70. }
  71. if (document.form1.content.value == "") {
  72. alert('请填写信息内容!');
  73. document.form1.content.focus();
  74. return false
  75. }
  76. var lenth = lenthString($("#content").val());
  77. if (lenth < 10) {
  78. alert('请填写至少5个汉字!');
  79. $("#content").focus();
  80. return false
  81. }
  82. if (lenth > 1000) {
  83. alert('您的描述字数太多了,请精简内容描述!');
  84. $("#content").focus();
  85. return false
  86. }
  87. <!--{if $iflogin==0}-->
  88. if (document.form1.manage_pwd.value == "") {
  89. alert('请填写管理密码!');
  90. document.form1.manage_pwd.focus();
  91. return false
  92. }
  93. <!--{/if}-->
  94. <!--{if $info[imgcode]==1 && !$mymps_global[cfg_if_nonmember_mob_post]}-->
  95. if (document.form1.checkcode.value == "") {
  96. alert('请填写验证码!');
  97. document.form1.checkcode.focus();
  98. return false;
  99. }
  100. <!--{/if}-->
  101. $("#loadingPostdiv").show();
  102. return true
  103. }
  104. function chk_authcode() {
  105. if ($("#checkcode").val()) {
  106. $.get('{$mayimobile[mobiledomain]}/index.php?mod=javascript&part=chk_authcode&value=' + $("#checkcode").val(), function (data) {
  107. if (data != 'success') {
  108. alert(data);
  109. $("#checkcode").focus();
  110. return false
  111. }
  112. })
  113. }
  114. }
  115. function chk_remobile() {
  116. var mobile = $("#mobile").val();
  117. if (mobile) {
  118. var myreg = /^(((13[0-9]{1})|(15[0-9]{1})|(16[0-9]{1})|(14[0-9]{1})|(17[0-9]{1})|(19[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
  119. if(!myreg.test(mobile)) {
  120. alert('请输入有效的手机号码!');
  121. $("#mobile").focus();
  122. return false;
  123. }
  124. checkmobile = true;
  125. }
  126. }
  127. function loadingPost() {
  128. var _PageWidth = document.documentElement.clientWidth;
  129. var _LoadingLeft = _PageWidth > 215 ? (_PageWidth - 215) / 2 : 0;
  130. var _LoadingHtml = '<div id="loadingPostdiv" style="display:none;position:fixed;left:0;width:100%;height:100%;top:0;background:#e1e1e1;opacity:0.8;filter:alpha(opacity=80);z-index:10000;"><div style="position: absolute; cursor1: wait; left: ' + _LoadingLeft + "px; top:40%; width: auto; height: 57px; line-height: 57px; padding-left: 40px; padding-right: 20px; background:#ffffff url(../images/loading.gif) no-repeat scroll 15px 20px; border: 5px solid #CCCCCC; border-radius:5px; color: #000;font-size:14px;\">数据提交中,请等待...</div></div>";
  131. document.write(_LoadingHtml)
  132. }
  133. loadingPost();
  134. </script>
  135. </head>
  136. <body class="{$mymps_global[cfg_tpl_dir]}">
  137. <div class="wrapper">
  138. {template header_search}
  139. <form id="form1" method="post" enctype="multipart/form-data" action="{$mayimobile[mobiledomain]}/index.php?mod=post" name="form1"
  140. onSubmit="return submitForm();">
  141. {if empty($child)}<input name="catid" type="hidden" value="{$catid}">{/if}
  142. <input name="id" type="hidden" value="{$id}">
  143. <input name="action" type="hidden" value="post">
  144. <input type="hidden" value="{$mixcode}" name="mixcode"/>
  145. <input type="hidden" id="lat" name="lat" value="">
  146. <input type="hidden" id="lng" name="lng" value="">
  147. <div class="inp_Itembox">
  148. <dl class="cfix">
  149. <dt>类别</dt>
  150. <dd><em>{$info[catname]}</em> {if !$id}<a href="{$mayimobile[mobiledomain]}/index.php?mod=post">(重选)</a>{/if}</dd>
  151. </dl>
  152. <dl class="cfix">
  153. <dt>标题</dt>
  154. <dd><input name="title" id="title" type="text" size="26" value="{$info[title]}"
  155. placeholder="输入标题,40字以内"/></dd>
  156. </dl>
  157. <li style="width:48%;"><em>区域</em><select name='areaid' id='areaid'>
  158. <option value=''>请选择区域</option>
  159. {echo cat_list('area','',$info[areaid]);}
  160. </select></li>
  161. <li style="width:52%;"><em style="border-left:1px solid #eee;">有效期</em>{echo GetInfoLastTime($info[activetime],'endtime','wap')} </li>
  162. </div>
  163. {if $show_mod_option}
  164. <div class="inp_Itembox">
  165. {loop $show_mod_option $mymps}
  166. <dl class="cfix">
  167. <dt>{$mymps[title]}</dt>
  168. <dd>
  169. {$mymps[value]}
  170. {if strstr($mymps[value],'select')}
  171. <div class="menu">
  172. <i></i>
  173. <i></i>
  174. <i></i>
  175. </div>
  176. {/if}
  177. </dd>
  178. </dl>
  179. {/loop}
  180. </div>
  181. {/if}
  182. <div class="inp_Itembox">
  183. <dl class="cfix">
  184. <dt>联系人</dt>
  185. <dd><input type="text" id="contact_who" placeholder="请填写您的称呼,如刘女士" name="contact_who"
  186. value="{$info[contact_who]}"/></dd>
  187. </dl>
  188. <dl class="cfix">
  189. <dt>手机</dt>
  190. <dd><input type="text" id="tel" placeholder="请输入您的手机号码" name="tel" value="{$info[tel]}"/></dd>
  191. </dl>
  192. <dl class="cfix">
  193. <dt>QQ</dt>
  194. <dd><input type="text" id="qq" placeholder="选填项,请输入QQ号码" name="qq" value="{$info[qq]}"/></dd>
  195. </dl>
  196. <dl class="cfix">
  197. <dt>微信号</dt>
  198. <dd><input type="text" id="email" placeholder="选填项,请填写微信号" name="email" value="{$info[email]}"/></dd>
  199. </dl>
  200. </div>
  201. {if $cat[if_upimg]==1}
  202. <script type="text/javascript" src="{$mayimobile[mobiledomain]}/template/js/a_ddimgview.js"></script>
  203. <div class="inp_Itembox" style="overflow:auto; padding:10px 0 10px 0">
  204. {echo $id ? get_upload_image_edit($cat['if_upimg'],$id) : get_upload_image_view(1,'',2);}
  205. </div>
  206. {/if}
  207. <div class="inp_Itembox">
  208. <textarea class="txt" id="content" name="content" placeholder="输入描述文字,不能超过500字">{$info[content]}</textarea>
  209. {if $iflogin == 0}
  210. <dl class="cfix">
  211. <dt>管理密码</dt>
  212. <dd><input name="manage_pwd" type="text" size="26" value="" placeholder="请牢记,用于修改/删除该信息"/></dd>
  213. </dl>
  214. {/if}
  215. </div>
  216. {if $info[imgcode] == 1}
  217. <div class="inp_Itembox">
  218. <dl class="cfix">
  219. <dt>验证码</dt>
  220. <dd><input id="checkcode" name="checkcode" onChange="chk_authcode()" placeholder="请输入下图验证码" type="text" size="26" /><img src="{$mayimobile[mobiledomain]}/index.php?mod=randcode" alt="看不清,请点击刷新" class="authcode" align="absmiddle" onClick="this.src=this.src"/></dd>
  221. </dl>
  222. </div>
  223. {/if}
  224. <p>&nbsp;</p>
  225. <button type="submit" class="fb">{echo $id ? "保存修改" : "提交发布"}</button>
  226. </form>
  227. </div>
  228. {template footer}
  229. <script>
  230. (function($){
  231. var list = $('.checkboxinner input:checkbox');
  232. if(list.length > 0){
  233. $('.checkboxinner input:checkbox').each(function(i){
  234. if ($(this).attr("checked")) {
  235. $(this).parent().addClass('ch_label_selected');
  236. } else {
  237. $(this).parent().removeClass('ch_label_selected');
  238. }
  239. });
  240. }
  241. $('.checkboxinner input:checkbox').click(function () {
  242. if ($(this).attr("checked")) {
  243. $(this).parent().addClass('ch_label_selected');
  244. } else {
  245. $(this).parent().removeClass('ch_label_selected');
  246. }
  247. });
  248. })(jQuery);
  249. </script>
  250. </body>
  251. </html>