123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- {include file="public/layout" /}
- <style>
- .ncap-form-default dl.row {position: unset;}
- .comboTreeDropDownContainer {width: 388px !important;}
- .multiplesFilter {border: 0 !important;border-bottom: solid 1px #eee !important;outline: none !important; }
- .comboTreeDropDownContainer {box-shadow: 0 0 8px rgba(0,0,0,0.2);border-radius: 4px!important;background-color: #FFF !important;border: solid 1px #eee !important;}
- .multiplesFilter{height: 30px !important;}
- </style>
- {eq name="$editor.editor_select" value="1"}
- {load href="__PUBLIC__/plugins/Ueditor/ueditor.config.js" /}
- {load href="__PUBLIC__/plugins/Ueditor/ueditor.all.min.js" /}
- {load href="__PUBLIC__/plugins/Ueditor/lang/zh-cn/zh-cn.js" /}
- {else/}
- {load href="__PUBLIC__/plugins/ckeditor/ckeditor.js" /}
- {/eq}
- <link href="__SKIN__/css/notice.css?v={$version}" rel="stylesheet" type="text/css">
-
- <script type="text/javascript" src="__SKIN__/js/icontains.js?v={$version}"></script>
- <script type="text/javascript" src="__SKIN__/js/comboTreePlugin.js?v={$version}"></script>
- <body class="bodystyle" style="overflow-y: scroll;">
- <div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
- <div id="append_parent"></div>
- <div id="ajaxwaitid"></div>
- <div class="page min-hg-c-10">
-
- <form class="form-horizontal" id="post_form" action="{:url('UsersNotice/add')}" method="post">
- <div class="ncap-form-default">
- <dl class="row">
- <dt class="tit">
- <label for="usernames">通知对象</label>
- </dt>
- <dd class="opt">
- <input type="text" name="users_id" placeholder="请输入会员ID或添加会员,可以多选,全站通知不选" id="users_id" class="input-txt" autocomplete="off" onkeyup="this.value=this.value.replace(/,/ig,',');" onpaste="this.value=this.value.replace(/,/ig,',');">
-
- <a href="javascript:void(0);" onclick="openFullframe(this, '会员选择', '90%', '90%');" data-cancel_callback="cancel_callback" data-href="{:url('UsersNotice/select_users')}" class="ncap-btn ncap-btn-green">添加会员</a>
- <span class="err"></span>
- <p class="notic"></p>
- <p class="notic2"></p>
- </dd>
- </dl>
- <dl class="row">
- <dt class="tit">
- <label for="title"><em>*</em>通知标题</label>
- </dt>
- <dd class="opt">
- <input type="text" name="title" value="" id="title" class="input-txt">
- <span class="err"></span>
- <p class="notic"></p>
- </dd>
- </dl>
- <dl class="row">
- <dt class="tit">
- <label for="remark"><em>*</em>通知内容</label>
- </dt>
- <dd class="opt">
- <textarea rows="5" cols="60" id="remark" name="remark" style="height:150px;"></textarea>
- <!-- <textarea class="span12 ckeditor" id="remark" placeholder="通知内容" name="remark" ></textarea>
- <div class="opt-moreOper">
- <p>
- <a href="javascript:void(0);" onclick="remote_to_local_remark();" class="ncap-btn2">远程图片本地化</a>
- <a href="javascript:void(0);" onclick="replace_links_remark();" class="ncap-btn2">清除非本站链接</a>
- </p>
- </div> -->
- <span class="err"></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 type="text/javascript">
- var parentObj = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
- // 判断输入框是否为空
- function checkForm(){
- if($('input[name=title]').val() == ''){
- showErrorMsg('通知标题不能为空!');
- $('input[name=title]').focus();
- return false;
- }
- if($('textarea[name=remark]').val() == ''){
- showErrorMsg('通知内容不能为空!');
- $('textarea[name=remark]').focus();
- return false;
- }
-
- layer_loading('正在处理');
- $.ajax({
- type : 'post',
- url : "{:url('UsersNotice/add', ['_ajax'=>1])}",
- data : $('#post_form').serialize(),
- dataType : 'json',
- success : function(res){
- layer.closeAll();
- if(res.code == 1){
- var _parent = parent;
- _parent.layer.close(parentObj);
- _parent.layer.msg(res.msg, {shade: 0.1, time: 1000}, function(){
- _parent.window.location.reload();
- });
- }else{
- showErrorMsg(res.msg);
- }
- },
- error: function(e){
- layer.closeAll();
- layer.alert(e.responseText, {icon: 5, title:false});
- }
- });
- }
-
- // 会员选择页所需方法
- var usersID = [];
- var usersStr = '';
- function usersSelect(obj, opt) {
- // 当前点击会员ID
- var users_id = $(obj).val();
- if (users_id) {
- // 数组去重
- usersID = $.unique(usersID.sort());
- // 判断是否已选择当前点击会员
- var index = $.inArray(users_id, usersID);
- if ('cut' == opt) {
- console.log(34)
- // 去除已选
- usersID.splice(index, 1);
- } else if ('add' == opt) {
- console.log(56)
- // 增加已选
- usersID.push(users_id);
- }
- usersStr = usersID.join(',');
- }
- }
-
- // 清空已选会员 并 关闭所有弹框
- function closeUsersSelect(clear) {
- // 清空已选会员
- if (clear) usersID = [];
- // 关闭所有弹框
- layer.closeAll();
- }
-
- function cancel_callback()
- {
- usersID = [];
- }
-
- // 处理已选会员 并 关闭所有弹框
- function submitUsersSelect() {
- if (usersID.length >= 1) {
- $('#users_id').val(usersStr);
- }
- // 关闭所有弹框
- closeUsersSelect(false);
- }
- </script>
- {include file="public/footer" /}
|