Commit 738c9d8e authored by duxinyuan's avatar duxinyuan

1

parent bd18c9bb
......@@ -238,8 +238,23 @@
background: #fff;
}
.btn4{
width : 14% !important;
}
width : 10% !important;
}
.autocut{
display:block ;
max-width : 300px;
overflow:hidden;
white-space:nowrap;
text-overflow:ellipsis;
-o-text-overflow:ellipsis;
-icab-text-overflow: ellipsis;
-khtml-text-overflow: ellipsis;
-moz-text-overflow: ellipsis;
-webkit-text-overflow: ellipsis; }
table{
width:100%;
/*table-layout:auto;*/
}
</style>
<!--导航star-->
......@@ -260,7 +275,7 @@
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover table-condensed">
<table class="table table-striped table-bordered table-hover table-condensed" style="width : 100%!important;overflow:hidden ; ">
<thead>
<tr>
<td colspan="11">
......@@ -278,8 +293,8 @@
<input class="form-control btn2 margin-top-ld" data-rule-phoneus="false" data-rule-required="false" id="comit_name" placeholder="姓名/手机号" type="text" value="">
<ul class="user-ul" style="display:none"></ul>
<input class="form-control btn2 margin-top-ld" data-rule-phoneus="false" data-rule-required="false" id="release_title" placeholder="文章名称" type="text" value="">
<ul class="user-ul" style="display:none"></ul>
<span class="btn btn-info btn3 margin-top-ld" id="search">搜索</span>
<span class="btn btn-info btn3 margin-top-ld" id="reset">重置</span>
......@@ -291,7 +306,7 @@
<th class="text-center">评论时间</th>
<th class="text-center">评论人姓名</th>
<th class="text-center">文章标题</th>
<th class="text-center">评论内容</th>
<th class="text-center" style="max-width : 40%">评论内容</th>
<th class="text-center">操作</th>
</tr>
</thead>
......@@ -357,7 +372,7 @@
</h4>
</div>
<div class="modal-body">
<span id="realContex"></span>
</div>
<div class="modal-footer text-center">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
......
......@@ -16,6 +16,7 @@ define (['doT', 'text!temp/plNews_template_tpl.html','ckfinder','ckfinderStart',
agent_id_two:'',
agent_id2 : 0,
modal_btn_id : '' ,
will_delete_id : '' ,
init: function () {
//初始化dot
$ ("body").append (template);
......@@ -33,10 +34,10 @@ define (['doT', 'text!temp/plNews_template_tpl.html','ckfinder','ckfinderStart',
$("#reset").click(function () {
document.getElementById("form_search").reset();
});
$("#confirm_delete").click(function(){
$("#confirm_delete").click(function(e){
var id = user.will_delete_id;
var params = {};
params.id = user.announcementdel_id;
console.log(user.announcementdel_id);
params.id = id;
if(!params.id || params.id == null){
alert ("要删除的id不能为空");
return false;
......@@ -49,6 +50,23 @@ define (['doT', 'text!temp/plNews_template_tpl.html','ckfinder','ckfinderStart',
user.text_details();
});
$("#show_modal").on("hidden.bs.modal",function(){
$('#realContex').text("");
});
$(document).on('click','.show_modal_btn',function(e){
var text = e.target.dataset.text;
$('#realContex').text(text);
});
$(document).on('click','.announcement-del',function(e){
var id = e.target.dataset.id;
user.will_delete_id = e.target.dataset.id;
});
$('#modal-delete').on("hidden.bs.modal",function(){
user.will_delete_id = "";
});
//部门门店的二级联动
that.getDistrict(function() {
_doc.on('input', '#commit_home', function() {
......@@ -182,55 +200,36 @@ define (['doT', 'text!temp/plNews_template_tpl.html','ckfinder','ckfinderStart',
var params = {};
params.start_time = $("#start_date").val();
params.end_time = $("#end_date").val();
params.commit_home = $('#commit_home').val();
params.commit_shop = $('#commit_shop').val();
params.userName = $('#comit_name').val();
params.release_title = $('#release_title').val();
params.district_id = $('#commit_home').val();
params.store_id = $('#commit_shop').val();
params.name = $('#comit_name').val().split("-")[1];
params.phone = $('#comit_name').val().split("-")[2];
params.title = $('#release_title').val();
params.pageNo = user.pageNo;
params.pageSize = user.pageSize;
console.log(params);
// $.ajax ({
// url: '/index/business_school',
// type: 'GET',
// async: true,
// data: params,
// dataType: 'json',
// success: function (data) {
// console.log('公告');
// var temp = document.getElementById ('plNews_list_tpl').innerHTML;
// var doTtmpl = doT.template (temp);
// $ ("#users_list").html (doTtmpl (data.data.list));
// /*分页代码*/
// add_page(data.data.total,pageNo,user.pageSize,user.getList);
// $("#total_page").html(data.data.total);
// }
// });
var datas = [
{
'create_time' :'2018-08-08',
'title' : "china",
'comment_number' :"welcome",
'id' : 1
},{
'create_time' :'2018-08-09',
'title' : "china0",
'comment_number' :"welcome1",
'id' : 2
}
]
var temp = document.getElementById ('plNews_list_tpl').innerHTML;
$.ajax ({
url: '/index/getCommentList',
type: 'GET',
async: true,
data: params,
dataType: 'json',
success: function (data) {
console.log('公告');
var temp = document.getElementById ('plNews_list_tpl').innerHTML;
var doTtmpl = doT.template (temp);
$ ("#users_list").html (doTtmpl (datas));
$ ("#users_list").html (doTtmpl (data.data));
/*分页代码*/
add_page(data.data.total,pageNo,user.pageSize,user.getList);
$("#total_page").html(data.data.total);
}
});
},
delete_text : function(params) {//删除文章
$.ajax ({
url: '/index/delNews',
url: '/index/delNewsComment',
type: 'POST',
async: true,
data: params,
......
<script id="plNews_list_tpl" type="text/template">
[% if(it) { %]
[% for(var item in it){ %]
<tr>
<tr style="width : 100%;">
<td>[%= it[item]['create_time'] %]</td>
<!--<td>[%= hideTel(it[item]["name"]) %]</td>-->
<!--<td>[% if(it[item]["name"] != null) { %]
[%= it[item]["name"] %]
[% } %]
</td>-->
<td>[%= it[item]["title"] %]</td>
<!--<td>[% if(it[item]["label_name"] != null) { %]
[%= it[item]["label_name"] %]
[% } %]
</td>-->
<!--<td>[%= it[item]["label_name"] %]</td>-->
<!--没有评论数字段-->
<td>[%= it[item]["comment_number"] %]</td>
<td>[%= it[item]["comment_number"] %]</td>
<td>[%= it[item]["name"] %]</td>
<td style=" ">[%= it[item]["title"] %]</td>
<td ><span class="autocut"> [%= it[item]["comment_content"] %]</span></td>
<td>
<a href="#show_modal" class="btn1 btn-success show_modal_btn" data-toggle="modal" data-id="[%= it[item]['id'] %]"> 评论详情</a>
<!--<a class="btn1 btn-success" href="new_text.html?id=[%= it[item]['id'] %]" data-createTime='[%= it[item]["create_time"] %]' data-title='[%= it[item]["title"] %]' data-id='[%= it[item]["id"] %]' data-content='[%= it[item]["content"] %]' target="_self">-->
<!--<a class="btn1 btn-success" href="new_text.html?id=[%= it[item]['id'] %]" data-id="[%= it[item]['id'] %]">
编辑
</a>
[% if(check_auth('index/delNews')) { %]-->
<!--删除权限-->
<a href="#show_modal" class="btn1 btn-success show_modal_btn" data-toggle="modal" data-id="[%= it[item]['id'] %]" data-text="[%= it[item]["comment_content"] %]"> 评论详情</a>
<a class="btn1 btn-danger announcement-del" href="#modal-delete" data-toggle="modal" data-id='[%= it[item]["id"] %]'>删除</a>
<!--[% } %]-->
</td>
</tr>
[% } %]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment