| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259 |
- <!DOCTYPE html>
- <html lang="zh-CN" class="index_page">
- <head>
- {template header}
- <title>{$page_title}</title>
- <meta name="description" id="description" content="{$page_title}" />
- <link type="text/css" rel="stylesheet" href="{$mayimobile[mobiledomain]}/template/css/global.css">
- <link type="text/css" rel="stylesheet" href="{$mayimobile[mobiledomain]}/template/css/style.css">
- <link type="text/css" rel="stylesheet" href="{$mayimobile[mobiledomain]}/template/css/post.css">
- <script>window['current'] = '{echo $id ? "修改" : "发布"}信息';</script>
- <script language="javascript">
- var checkmobile = false;
- function submitForm() {
- if (document.form1.title.value == "") {
- alert('请填写信息标题!');
- document.form1.title.focus();
- return false
- }
- if ($("#title").val()) {
- if (!isNaN($("#title").val())) {
- alert('请填写正确的信息标题!');
- $("#title").focus();
- return false
- }
- }
- var length = lenthString($("#title").val());
- if (length < 6 || length > 80) {
- alert('标题请填写至少3个汉字,至多40个汉字!');
- $("#title").focus();
- return false
- }
- if (document.form1.endtime.value == "") {
- alert('请选择有效期!');
- document.form1.endtime.focus();
- return false
- }
- <!--{loop $show_mod_option $mymps}-->
- <!--{if $mymps[required]==1}-->
- if ($("[name='extra[{$mymps[identifier]}]']").val() == '') {
- alert('{$mymps[title]}不能为空!');
- $("[name='extra[{$mymps[identifier]}]']").focus();
- return false
- }
- <!--{/if}-->
- <!--{/loop}-->
- if (document.form1.contact_who.value == "") {
- alert('请填写联系人!');
- document.form1.contact_who.focus();
- return false
- }
- if ($("#contact_who").val()) {
- if (!isNaN($("#contact_who").val())) {
- alert('请填写正确的联系人!');
- document.form1.contact_who.focus();
- return false
- }
- }
- var isPhone = /^((\d{7,8})|(0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/;
- if(!isPhone.test(document.form1.tel.value)) {
- alert('请填写正确的手机!!');
- document.form1.tel.focus();
- return false;
- }
- if ($("#qq").val()) {
- if (isNaN($("#qq").val())) {
- alert('请填写正确的QQ号码!');
- document.form1.qq.focus();
- return false
- }
- }
- if (document.form1.content.value == "") {
- alert('请填写信息内容!');
- document.form1.content.focus();
- return false
- }
- var lenth = lenthString($("#content").val());
- if (lenth < 10) {
- alert('请填写至少5个汉字!');
- $("#content").focus();
- return false
- }
- if (lenth > 1000) {
- alert('您的描述字数太多了,请精简内容描述!');
- $("#content").focus();
- return false
- }
- <!--{if $iflogin==0}-->
- if (document.form1.manage_pwd.value == "") {
- alert('请填写管理密码!');
- document.form1.manage_pwd.focus();
- return false
- }
- <!--{/if}-->
- <!--{if $info[imgcode]==1 && !$mymps_global[cfg_if_nonmember_mob_post]}-->
- if (document.form1.checkcode.value == "") {
- alert('请填写验证码!');
- document.form1.checkcode.focus();
- return false;
- }
- <!--{/if}-->
- $("#loadingPostdiv").show();
- return true
- }
- function chk_authcode() {
- if ($("#checkcode").val()) {
- $.get('{$mayimobile[mobiledomain]}/index.php?mod=javascript&part=chk_authcode&value=' + $("#checkcode").val(), function (data) {
- if (data != 'success') {
- alert(data);
- $("#checkcode").focus();
- return false
- }
- })
- }
- }
- function chk_remobile() {
- var mobile = $("#mobile").val();
- if (mobile) {
- 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})$/;
- if(!myreg.test(mobile)) {
- alert('请输入有效的手机号码!');
- $("#mobile").focus();
- return false;
- }
- checkmobile = true;
- }
- }
- function loadingPost() {
- var _PageWidth = document.documentElement.clientWidth;
- var _LoadingLeft = _PageWidth > 215 ? (_PageWidth - 215) / 2 : 0;
- 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>";
- document.write(_LoadingHtml)
- }
- loadingPost();
- </script>
- </head>
- <body class="{$mymps_global[cfg_tpl_dir]}">
- <div class="wrapper">
- {template header_search}
- <form id="form1" method="post" enctype="multipart/form-data" action="{$mayimobile[mobiledomain]}/index.php?mod=post" name="form1"
- onSubmit="return submitForm();">
- {if empty($child)}<input name="catid" type="hidden" value="{$catid}">{/if}
- <input name="id" type="hidden" value="{$id}">
- <input name="action" type="hidden" value="post">
- <input type="hidden" value="{$mixcode}" name="mixcode"/>
- <input type="hidden" id="lat" name="lat" value="">
- <input type="hidden" id="lng" name="lng" value="">
- <div class="inp_Itembox">
- <dl class="cfix">
- <dt>类别</dt>
- <dd><em>{$info[catname]}</em> {if !$id}<a href="{$mayimobile[mobiledomain]}/index.php?mod=post">(重选)</a>{/if}</dd>
- </dl>
- <dl class="cfix">
- <dt>标题</dt>
- <dd><input name="title" id="title" type="text" size="26" value="{$info[title]}"
- placeholder="输入标题,40字以内"/></dd>
- </dl>
- <li style="width:48%;"><em>区域</em><select name='areaid' id='areaid'>
- <option value=''>请选择区域</option>
- {echo cat_list('area','',$info[areaid]);}
- </select></li>
- <li style="width:52%;"><em style="border-left:1px solid #eee;">有效期</em>{echo GetInfoLastTime($info[activetime],'endtime','wap')} </li>
- </div>
- {if $show_mod_option}
- <div class="inp_Itembox">
- {loop $show_mod_option $mymps}
- <dl class="cfix">
- <dt>{$mymps[title]}</dt>
- <dd>
- {$mymps[value]}
- {if strstr($mymps[value],'select')}
- <div class="menu">
- <i></i>
- <i></i>
- <i></i>
- </div>
- {/if}
- </dd>
- </dl>
- {/loop}
- </div>
- {/if}
- <div class="inp_Itembox">
- <dl class="cfix">
- <dt>联系人</dt>
- <dd><input type="text" id="contact_who" placeholder="请填写您的称呼,如刘女士" name="contact_who"
- value="{$info[contact_who]}"/></dd>
- </dl>
-
- <dl class="cfix">
- <dt>手机</dt>
- <dd><input type="text" id="tel" placeholder="请输入您的手机号码" name="tel" value="{$info[tel]}"/></dd>
- </dl>
-
- <dl class="cfix">
- <dt>QQ</dt>
- <dd><input type="text" id="qq" placeholder="选填项,请输入QQ号码" name="qq" value="{$info[qq]}"/></dd>
- </dl>
-
- <dl class="cfix">
- <dt>微信号</dt>
- <dd><input type="text" id="email" placeholder="选填项,请填写微信号" name="email" value="{$info[email]}"/></dd>
- </dl>
- </div>
- {if $cat[if_upimg]==1}
- <script type="text/javascript" src="{$mayimobile[mobiledomain]}/template/js/a_ddimgview.js"></script>
- <div class="inp_Itembox" style="overflow:auto; padding:10px 0 10px 0">
- {echo $id ? get_upload_image_edit($cat['if_upimg'],$id) : get_upload_image_view(1,'',2);}
- </div>
- {/if}
- <div class="inp_Itembox">
- <textarea class="txt" id="content" name="content" placeholder="输入描述文字,不能超过500字">{$info[content]}</textarea>
- {if $iflogin == 0}
- <dl class="cfix">
- <dt>管理密码</dt>
- <dd><input name="manage_pwd" type="text" size="26" value="" placeholder="请牢记,用于修改/删除该信息"/></dd>
- </dl>
- {/if}
- </div>
-
- {if $info[imgcode] == 1}
- <div class="inp_Itembox">
- <dl class="cfix">
- <dt>验证码</dt>
- <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>
- </dl>
- </div>
- {/if}
- <p> </p>
- <button type="submit" class="fb">{echo $id ? "保存修改" : "提交发布"}</button>
- </form>
- </div>
- {template footer}
- <script>
- (function($){
- var list = $('.checkboxinner input:checkbox');
- if(list.length > 0){
- $('.checkboxinner input:checkbox').each(function(i){
- if ($(this).attr("checked")) {
- $(this).parent().addClass('ch_label_selected');
- } else {
- $(this).parent().removeClass('ch_label_selected');
- }
- });
- }
- $('.checkboxinner input:checkbox').click(function () {
- if ($(this).attr("checked")) {
- $(this).parent().addClass('ch_label_selected');
- } else {
- $(this).parent().removeClass('ch_label_selected');
- }
- });
- })(jQuery);
- </script>
- </body>
- </html>
|