Няма описание
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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. {include file="public/layout" /}
  2. <body style="background-color: #FFF; overflow-x:hidden;">
  3. <div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
  4. <div class="page">
  5. <div class="fixed-bar">
  6. <div class="item-title">
  7. <div class="subject">
  8. <h3>广告管理</h3>
  9. <h5></h5>
  10. </div>
  11. <ul class="tab-base nc-row">
  12. <li><a href="javascript:void(0);" class="tab current"><span>编辑</span></a></li>
  13. {eq name='$main_lang' value='$admin_lang'}
  14. <li><a href="javascript:void(0);" class="tab" data-url="{:url('Other/ui_del')}" data-id="{$field.id}" onClick="ui_delfun(this);"><span>删除</span></a></li>
  15. <li><a href="{:url('Other/ui_add', array('edit_id'=>$field.id, 'pid'=>$field.pid))}" class="tab"><span>新增</span></a></li>
  16. {/eq}
  17. </ul>
  18. </div>
  19. </div>
  20. <form class="form-horizontal" id="post_form" action="" method="post">
  21. <div class="ncap-form-default">
  22. <dl class="row">
  23. <dt class="tit">
  24. <label for="title"><em>*</em>广告名称</label>
  25. </dt>
  26. <dd class="opt">
  27. <input type="text" name="title" value="{$field.title}" id="title" class="input-txt">
  28. <span class="err"></span>
  29. <p class="notic"></p>
  30. </dd>
  31. </dl>
  32. <dl class="row">
  33. <dt class="tit">
  34. <label for="title">广告位说明</label>
  35. </dt>
  36. <dd class="opt">
  37. {$ad_position['title']}&nbsp;({$ad_position['width']}*{$ad_position['height']}&nbsp;像素)
  38. <span class="err"></span>
  39. <p class="notic"></p>
  40. </dd>
  41. </dl>
  42. <dl class="row">
  43. <dt class="tit">
  44. <label>广告链接</label>
  45. </dt>
  46. <dd class="opt">
  47. <input type="text" name="links" value="{$field.links}" class="input-txt">
  48. <span class="err"></span>
  49. <p class="notic"></p>
  50. </dd>
  51. </dl>
  52. <dl class="row">
  53. <dt class="tit">
  54. <label>广告图片</label>
  55. </dt>
  56. <dd class="opt">
  57. <div class="input-file-show div_litpic_local" {neq name="$field.is_remote" value="0"}style="display: none;"{/neq}>
  58. <span class="show">
  59. <a id="img_a" target="_blank" class="nyroModal" rel="gal" href="{$field.litpic_local|default='javascript:void(0);'}" target="_blank">
  60. <i id="img_i" class="fa fa-picture-o" {notempty name="$field.litpic_local"}onmouseover="layer_tips=layer.tips('<img src={$field.litpic_local} class=\'layer_tips_img\'>',this,{tips: [1, '#fff']});"{/notempty} onmouseout="layer.close(layer_tips);"></i>
  61. </a>
  62. </span>
  63. <span class="type-file-box">
  64. <input type="text" id="litpic_local" name="litpic_local" value="{$field.litpic_local|default=''}" class="type-file-text" autocomplete="off">
  65. <input type="button" name="button" id="button1" value="选择上传..." class="type-file-button">
  66. <input class="type-file-file" onClick="GetUploadify(1,'','allimg','img_call_back')" size="30" hidefocus="true" nc_type="change_site_logo"
  67. title="点击前方预览图可查看大图,点击按钮选择文件并提交表单后上传生效">
  68. </span>
  69. </div>
  70. <input type="text" id="litpic_remote" name="litpic_remote" value="{$field.litpic_remote|default=''}" placeholder="http://" class="input-txt" {neq name="$field.is_remote" value="1"}style="display: none;"{/neq}>
  71. &nbsp;
  72. <label><input type="checkbox" name="is_remote" id="is_remote" value="1" {eq name="$field.is_remote" value="1"}checked="checked"{/eq} onClick="clickRemote(this, 'litpic');">远程图片</label>
  73. <span class="err"></span>
  74. <p class="notic">请填写图片链接,或上传图片格式文件,具体像素大小视网站模板而定</p>
  75. </dd>
  76. </dl>
  77. <dl class="row">
  78. <dt class="tit">
  79. <label for="author">排序</label>
  80. </dt>
  81. <dd class="opt">
  82. <input type="text" name="sort_order" value="{$field.sort_order|default='100'}" id="sort_order" class="input-txt">
  83. <span class="err"></span>
  84. <p class="notic">越小越靠前</p>
  85. </dd>
  86. </dl>
  87. </div>
  88. <!-- 常规信息 -->
  89. <div class="ncap-form-default">
  90. <div class="bot">
  91. <input type="hidden" name="id" value="{$field.id}">
  92. <a href="JavaScript:void(0);" onclick="check_submit();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a>
  93. </div>
  94. </div>
  95. </form>
  96. </div>
  97. <script type="text/javascript">
  98. var parentObj = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  99. $(function () {
  100. //选项卡切换列表
  101. });
  102. // 远程/本地上传图片切换
  103. function clickRemote(obj, id)
  104. {
  105. if ($(obj).is(':checked')) {
  106. $('#'+id+'_remote').show();
  107. $('.div_'+id+'_local').hide();
  108. } else {
  109. $('.div_'+id+'_local').show();
  110. $('#'+id+'_remote').hide();
  111. }
  112. }
  113. // 判断输入框是否为空
  114. function check_submit(){
  115. if($('input[name=title]').val() == ''){
  116. layer.msg('广告名称不能为空!', {icon: 2,time: 1000});
  117. return false;
  118. }
  119. layer_loading('正在处理');
  120. $.ajax({
  121. url: "{:url('Other/ui_edit', ['_ajax'=>1])}",
  122. type: 'POST',
  123. dataType: 'JSON',
  124. data: $('#post_form').serialize(),
  125. success: function(res){
  126. layer.closeAll();
  127. if (res.code == 1) {
  128. parent.layer.msg(res.msg, {shade: layer_shade, time: 1000}, function(){
  129. parent.window.location.reload();
  130. parent.layer.close(parentObj);
  131. });
  132. } else {
  133. // parent.showErrorMsg(res.msg);
  134. layer.alert(res.msg, {icon:5});
  135. }
  136. return false;
  137. },
  138. error: function(e){
  139. layer.closeAll();
  140. layer.alert('操作失败', {icon:5});
  141. return false;
  142. }
  143. });
  144. return false;
  145. }
  146. function img_call_back(fileurl_tmp)
  147. {
  148. $("#litpic_local").val(fileurl_tmp);
  149. $("#img_a").attr('href', fileurl_tmp);
  150. $("#img_i").attr('onmouseover', "layer_tips=layer.tips('<img src="+fileurl_tmp+" class=\\'layer_tips_img\\'>',this,{tips: [1, '#fff']});");
  151. }
  152. function ui_delfun(obj) {
  153. layer.confirm('此操作不可恢复,确认删除?', {
  154. shade: layer_shade,
  155. area: ['480px', '190px'],
  156. move: false,
  157. title: '提示',
  158. btnAlign:'r',
  159. closeBtn: 3,
  160. btn: ['确定', '取消'] ,//按钮
  161. success: function () {
  162. $(".layui-layer-content").css('text-align', 'left');
  163. }
  164. }, function(){
  165. // 确定
  166. layer_loading('正在处理');
  167. $.ajax({
  168. type : 'post',
  169. url : $(obj).attr('data-url'),
  170. data : {del_id:$(obj).attr('data-id'), _ajax:1},
  171. dataType : 'json',
  172. success : function(data){
  173. layer.closeAll();
  174. if(data.code == 1){
  175. parent.layer.msg(data.msg, {shade: layer_shade, time: 1000}, function(){
  176. parent.window.location.reload();
  177. parent.layer.close(parentObj);
  178. });
  179. }else{
  180. layer.msg(data.msg, {icon: 2,time: 2000});
  181. }
  182. }
  183. })
  184. }, function(index){
  185. layer.close(index);
  186. return false;// 取消
  187. }
  188. );
  189. }
  190. </script>
  191. {include file="public/footer" /}