Açıklama Yok
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 6.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. {include file="public/layout" /}
  2. <style>
  3. .ncap-form-default dl.row {position: unset;}
  4. .comboTreeDropDownContainer {width: 388px !important;}
  5. .multiplesFilter {border: 0 !important;border-bottom: solid 1px #eee !important;outline: none !important; }
  6. .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;}
  7. .multiplesFilter{height: 30px !important;}
  8. </style>
  9. {eq name="$editor.editor_select" value="1"}
  10. {load href="__PUBLIC__/plugins/Ueditor/ueditor.config.js" /}
  11. {load href="__PUBLIC__/plugins/Ueditor/ueditor.all.min.js" /}
  12. {load href="__PUBLIC__/plugins/Ueditor/lang/zh-cn/zh-cn.js" /}
  13. {else/}
  14. {load href="__PUBLIC__/plugins/ckeditor/ckeditor.js" /}
  15. {/eq}
  16. <link href="__SKIN__/css/notice.css?v={$version}" rel="stylesheet" type="text/css">
  17. <script type="text/javascript" src="__SKIN__/js/icontains.js?v={$version}"></script>
  18. <script type="text/javascript" src="__SKIN__/js/comboTreePlugin.js?v={$version}"></script>
  19. <body class="bodystyle" style="overflow-y: scroll;">
  20. <div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
  21. <div id="append_parent"></div>
  22. <div id="ajaxwaitid"></div>
  23. <div class="page min-hg-c-10">
  24. <form class="form-horizontal" id="post_form" action="{:url('UsersNotice/add')}" method="post">
  25. <div class="ncap-form-default">
  26. <dl class="row">
  27. <dt class="tit">
  28. <label for="usernames">通知对象</label>
  29. </dt>
  30. <dd class="opt">
  31. <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,',');">
  32. &nbsp;
  33. <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>
  34. <span class="err"></span>
  35. <p class="notic"></p>
  36. <p class="notic2"></p>
  37. </dd>
  38. </dl>
  39. <dl class="row">
  40. <dt class="tit">
  41. <label for="title"><em>*</em>通知标题</label>
  42. </dt>
  43. <dd class="opt">
  44. <input type="text" name="title" value="" id="title" class="input-txt">
  45. <span class="err"></span>
  46. <p class="notic"></p>
  47. </dd>
  48. </dl>
  49. <dl class="row">
  50. <dt class="tit">
  51. <label for="remark"><em>*</em>通知内容</label>
  52. </dt>
  53. <dd class="opt">
  54. <textarea rows="5" cols="60" id="remark" name="remark" style="height:150px;"></textarea>
  55. <!-- <textarea class="span12 ckeditor" id="remark" placeholder="通知内容" name="remark" ></textarea>
  56. <div class="opt-moreOper">
  57. <p>
  58. <a href="javascript:void(0);" onclick="remote_to_local_remark();" class="ncap-btn2">远程图片本地化</a>&nbsp;
  59. <a href="javascript:void(0);" onclick="replace_links_remark();" class="ncap-btn2">清除非本站链接</a>&nbsp;
  60. </p>
  61. </div> -->
  62. <span class="err"></span>
  63. <p class="notic"></p>
  64. </dd>
  65. </dl>
  66. <div class="bot">
  67. <a href="JavaScript:void(0);" onclick="checkForm();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a>
  68. </div>
  69. </div>
  70. </form>
  71. </div>
  72. <script type="text/javascript">
  73. var parentObj = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  74. // 判断输入框是否为空
  75. function checkForm(){
  76. if($('input[name=title]').val() == ''){
  77. showErrorMsg('通知标题不能为空!');
  78. $('input[name=title]').focus();
  79. return false;
  80. }
  81. if($('textarea[name=remark]').val() == ''){
  82. showErrorMsg('通知内容不能为空!');
  83. $('textarea[name=remark]').focus();
  84. return false;
  85. }
  86. layer_loading('正在处理');
  87. $.ajax({
  88. type : 'post',
  89. url : "{:url('UsersNotice/add', ['_ajax'=>1])}",
  90. data : $('#post_form').serialize(),
  91. dataType : 'json',
  92. success : function(res){
  93. layer.closeAll();
  94. if(res.code == 1){
  95. var _parent = parent;
  96. _parent.layer.close(parentObj);
  97. _parent.layer.msg(res.msg, {shade: 0.1, time: 1000}, function(){
  98. _parent.window.location.reload();
  99. });
  100. }else{
  101. showErrorMsg(res.msg);
  102. }
  103. },
  104. error: function(e){
  105. layer.closeAll();
  106. layer.alert(e.responseText, {icon: 5, title:false});
  107. }
  108. });
  109. }
  110. // 会员选择页所需方法
  111. var usersID = [];
  112. var usersStr = '';
  113. function usersSelect(obj, opt) {
  114. // 当前点击会员ID
  115. var users_id = $(obj).val();
  116. if (users_id) {
  117. // 数组去重
  118. usersID = $.unique(usersID.sort());
  119. // 判断是否已选择当前点击会员
  120. var index = $.inArray(users_id, usersID);
  121. if ('cut' == opt) {
  122. console.log(34)
  123. // 去除已选
  124. usersID.splice(index, 1);
  125. } else if ('add' == opt) {
  126. console.log(56)
  127. // 增加已选
  128. usersID.push(users_id);
  129. }
  130. usersStr = usersID.join(',');
  131. }
  132. }
  133. // 清空已选会员 并 关闭所有弹框
  134. function closeUsersSelect(clear) {
  135. // 清空已选会员
  136. if (clear) usersID = [];
  137. // 关闭所有弹框
  138. layer.closeAll();
  139. }
  140. function cancel_callback()
  141. {
  142. usersID = [];
  143. }
  144. // 处理已选会员 并 关闭所有弹框
  145. function submitUsersSelect() {
  146. if (usersID.length >= 1) {
  147. $('#users_id').val(usersStr);
  148. }
  149. // 关闭所有弹框
  150. closeUsersSelect(false);
  151. }
  152. </script>
  153. {include file="public/footer" /}