新增推广后台公告

master
chenzhi 3 years ago
parent 42d8883456
commit 57c0f6736d

@ -0,0 +1,26 @@
<?php
namespace Admin\Controller;
use Think\Model;
/**
* 推广后台公告
*/
class PromoteNoticeController extends ThinkController
{
public function edit()
{
$data = M("promote_notice","tab_")->find();
$this->assign('data',$data);
$this->display();
}
public function doEdit()
{
$res = M("promote_notice","tab_")->save($_REQUEST);
if(!$res){
$this->ajaxReturn(["status"=>0,"msg"=>"保存失败"]);
}
$this->ajaxReturn(["status"=>1,"msg"=>"修改并保存成功"]);
}
}

@ -0,0 +1,87 @@
<extend name="Public/base" />
<block name="body">
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script src="__STATIC__/layer/extend/layer.ext.js" type="text/javascript"></script>
<link rel="stylesheet" href="__STATIC__/kindeditor/default/default.css" />
<script charset="utf-8" src="__STATIC__/kindeditor/kindeditor-min.js"></script>
<script charset="utf-8" src="__STATIC__/kindeditor/zh_CN.js"></script>
<!-- 标签页导航 -->
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">推广后台公告</h3>
<p class="description_text">说明:设置推广后台公告。</p>
</div>
<div class="tab-content tabcon1711">
<!-- 表单 -->
<!-- 基础 -->
<div id="tab1" class="tab-pane in tab1">
<table border="0" cellspacing="0" cellpadding="0">
<tr >
<td class="l noticeinfo">是否开启:</td>
<td class="r table_radio table_radio2">
<span class="table_btn">
<label>
<input type="radio" class="inp_radio" value="1" name="is_open" <if condition="$data['is_open'] eq 1"> checked</if>> 是
</label>
<label style="margin-left: 50px;">
<input type="radio" class="inp_radio" value="0" name="is_open" <if condition="$data['is_open'] eq 0"> checked</if> > 否
</label></span>
</td>
</tr>
<tr style="height: 50px;"></tr>
<tr>
<td class="l">公告内容:</td>
<td class="r">
<textarea name="content" id="content" class="txt_area">{$data['content']}</textarea>
</td>
</tr>
</table>
</div>
<div class="form-item cf">
<input type="hidden" name="id" value="{$data['id']}" />
<button class="submit_btn" style="margin-left:210px;">
保存
</button>
</div>
</div>
</block>
<block name="script">
<script type="text/javascript">
highlight_subnav("{:U('edit')}");
KindEditor.ready(function(K) {
var options = {
filterMode : true,
width : '700px',
height:'600px'
};
var editor = K.create('textarea[name="content"]', options);
$('.submit_btn').on("click",function(){
editor.sync();
var senddata = {
id:$("input[name='id']").val(),
is_open:$("input[type='radio']:checked").val(),
content:$("#content").val()
}
$.ajax({
type: "POST",
url: "{:U('doEdit')}",
dataType: 'json',
data: senddata,
success:function(data){
if(data.status==1){
layer.msg("<font style='color:white'>" + data.msg + "</font>");
setTimeout(function(){
window.location.reload();
},1500);
}else{
layer.msg("<font style='color:white'>" + data.msg + "</font>");
return false;
}
}
});
})
})
</script>
</block>

@ -298,9 +298,17 @@ class PromoteController extends BaseController
$this->assign("tips",$tips); $this->assign("tips",$tips);
$this->assign("message",$message); $this->assign("message",$message);
$this->meta_title = "首页"; $this->meta_title = "首页";
//首页公告
$this->getIndexTip();
$this->display(); $this->display();
} }
public function getIndexTip()
{
$data = M("promote_notice","tab_")->where("is_open = 1")->getField('content');
if($data){
$this->assign('index_tip',$data);
}
}
public function popRuleDetail($id=0, $p=1, $row=1, $force=false, $pop = false) public function popRuleDetail($id=0, $p=1, $row=1, $force=false, $pop = false)
{ {
$promoteBelong = M('promote', 'tab_')->where(['id'=>get_pid()])->getField('company_belong'); $promoteBelong = M('promote', 'tab_')->where(['id'=>get_pid()])->getField('company_belong');

@ -3,6 +3,10 @@
<link href="__CSS__/index/index.new.css" rel="stylesheet" > <link href="__CSS__/index/index.new.css" rel="stylesheet" >
</block> </block>
<block name="body"> <block name="body">
<script type="text/javascript" src="__JS__/jquery.min.js"></script>
<script type="text/javascript" src="__JS__/index/jquery.fxTab.js"></script>
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<script src="__STATIC__/js.cookie.min.js" type="text/javascript"></script>
<div class="page-overview promote-index-overview index-overview clearfix poll"> <div class="page-overview promote-index-overview index-overview clearfix poll">
<?php if($canViewUserRecharge):?> <?php if($canViewUserRecharge):?>
<ul> <ul>
@ -209,12 +213,51 @@
{$_page} {$_page}
</div> </div>
</div> </div>
</div>. </div>
<script type="text/javascript" src="__JS__/jquery.min.js"></script> <notempty name="index_tip">
<script type="text/javascript" src="__JS__/index/jquery.fxTab.js"></script> <div id="TestingTipShow" style="display: none;">
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script> <div style="width: 100vw;height:100%;padding: 0;position: absolute;top: 0;z-index: 9999;background-color:rgba(0,0,0,.6);margin: -1.9%;">
<div class="layui-layer layui-layer-hui" style="width:800px;height:auto;z-index: 19891015; top:18%; left:50%;margin-left: -400px;border-radius: 2%;background-color:white;color: #0a001f;">
<div style="padding: 15px 30px 15px 20px;font-size: 18px;text-align: center;border-bottom: 1px dashed #999;">系统公告</div>
<div style="padding: 5px 25px;height: auto;max-height: 500px;overflow-x:hidden;overflow-y:auto">
{$index_tip}
</div>
<div style="text-align: right;margin-top: 20px;margin-right: 30px;padding-bottom: 55px;">
<div class="form-group normal_space fr">
<input type="button" id="closeTip" class="submit" value="关闭">
</div>
<div class="form-group normal_space fr">
<input type="button" id="ignoreTip" class="submit" value="今日不再提醒" style="background-color: #fff;border: 1px solid #333;color: #333;">
</div>
</div>
</div>
</div>
</div>
<script> <script>
var d = new Date();
var cookieKey = 'promote-notice-ignore-'+d.getFullYear()+"-"+(d.getMonth()-0+1)+"-"+d.getDate();
var isIgnore = Cookies.get(cookieKey);
if(!isIgnore){
$("#TestingTipShow").show();
}
$("#closeTip").on("click",function(){
$("#TestingTipShow").hide();
})
$("#ignoreTip").on("click",function(){
Cookies.set(cookieKey, 1, { expires: 2 });
$("#TestingTipShow").hide();
})
</script>
</notempty>
<script>
var pop_ids = {$match_rules_id}; var pop_ids = {$match_rules_id};
var match_rules_route ={$match_rules_route}; var match_rules_route ={$match_rules_route};
var pop_time = {$pop_time1}; var pop_time = {$pop_time1};

Loading…
Cancel
Save