addwxsend.html1 3.52 KB
<include file="public/layout" />
<body style="background-color: #FFF; overflow: auto;"> 
<div class="page">
  <div class="fixed-bar">
    <div class="item-title"><a class="back" href="javascript:history.back();" title="返回列表"><i class="fa fa-arrow-circle-o-left"></i></a>
      <div class="subject">
        <h3>添加/修改推送消息</h3>
        <h5></h5>
      </div>
    </div>
  </div>
    <!--表单数据-->
    <form method="post" id="addwxsenddForm">
    <div class="ncap-form-default">

        <dl class="row" >
            <dt class="tit" colspan="2">
                <label class="" for="typeid"><em>*</em>选择模板</label>
            </dt>
            <dd class="opt">
                <div id="gcategory">
                    <select name="typeid" id="typeid"
                            onkeydown="strkeydown(event, this, 'submitBtn')"
                        class="form-control" >
                        <option value="0">请选择分类</option>
                        <foreach name="typelist" item="v" >
                            <option value="{$v[typeid]}"  <if condition="$v[typeid] eq $wxsend[typeid]"> selected="selected" </if>>{$v[typename]}</option>
                        </foreach>
                    </select>

                </div>
            </dd>
        </dl>
      <dl class="row">
        <dt class="tit">
          <label for="template_id"><em>*</em>微信template_id参数</label>
        </dt>
        <dd class="opt">
          <input type="text" placeholder="微信template_id参数"
                 onkeydown="strkeydown(event, this, 'submitBtn')" id="template_id"
                 class="input-txt" name="template_id" value="{$wxsend.template_id}" >
		  <span class="err cr" id="err_template_id"></span>
          <p class="notic"></p>
        </dd>
      </dl>
        <dl class="row">
            <dt class="tit">
                <label for="ac_name">详细跳转地址</label>
            </dt>
            <dd class="opt">
                <input type="text" placeholder="详细跳转地址"
                       onkeydown="strkeydown(event, this, 'submitBtn')" id="htmlurl"
                       class="input-txt" name="htmlurl" value="{$wxsend.htmlurl}">
                <span class="err cr" id="err_htmlurl"></span>
                <p class="notic"></p>
            </dd>
        </dl>
      <div class="bot"><a href="JavaScript:void(0);" onClick="checkForm();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a></div>
    </div>
  </form>
</div>
<script>
    function checkForm(){

        var typeid = $("#typeid").val();
        if($.trim(typeid) == '0')
        {
            set_err_msg("请选择模板","typeid")
            return false;
        }
        var template_id = $("#template_id").val();
        if($.trim(template_id) == '')
        {
            set_err_msg("请输入微信模板Id","template_id")
            $("#template_id").focus();
            return false;
        }
        layer.msg('加载中...', {icon: 16,shade: [0.5, '#f5f5f5'],scrollbar: false,offset: '10px', time:100000}) ;
        $('#addwxsenddForm').submit();
    }

// 上传商品图片成功回调函数
function call_back(fileurl_tmp){

    $("#logo").val(fileurl_tmp);
    $("#original_img2").attr('onmouseover', "layer.tips('<img src="+fileurl_tmp+">',this,{tips: [1, '#fff']});");
    $("#original_img2").attr('src', fileurl_tmp);
}


function  set_err_msg(text,elem)
{
    layer.msg(text,{icon:2,time:1000});
    $("#"+elem).focus();
    $("#"+elem).parent().find("span").text(text);
}


</script>
</body>
</html>