Authored by mlge

种草--文章详情页修改

... ... @@ -1117,6 +1117,8 @@ public class GrassArticleServiceImpl implements IGrassArticleService{
rspBo.setAuthorizeAccount(article.getAuthorizeAccount());
rspBo.setSknList(sknMap.get(article.getId()));
rspBo.setSknType(sknTypeMap.get(article.getId()));
Long authTime = article.getAuthTime();
rspBo.setAuthTimeStr(DateUtil.long2DateStr(authTime,DateUtil.DATE_TIME_FORMAT));
rspBoList.add(rspBo);
});
return rspBoList;
... ...
... ... @@ -6,7 +6,17 @@
<script src="/pfcms/js/include.js"></script>
<script src="/pfcms/js/ajaxfileupload.js"></script>
<link rel="stylesheet" href="/pfcms/css/swiper.min.css">
<script src="/pfcms/js/utils/swiper.min.js"></script>
<style>
/* 可以设置样式,也可以不设置*/
.swiper-container {
width: 700px;
height: 400px;
}
.btn-long {
width: 120px;
height: 37px;
... ... @@ -96,7 +106,7 @@
textField : "text",
required:false,
prompt: "请选择状态",
data:[{text:"待审核",value:"0"},{text:"全部",value:"8"},{text:"已通过",value:"1"},{text:"未通过",value:"2"}]
data:[{text:"全部",value:"8"},{text:"待审核",value:"0"},{text:"已通过",value:"1"},{text:"未通过",value:"2"}]
});
//初次加载 设置默认选中的
$("#authStatus").combobox('select', '0');
... ... @@ -105,7 +115,7 @@
textField : "text",
required:false,
prompt: "请选择来源",
data:[{text:"全部",value:"0"},{text:"普通用户",value:"1"},{text:"guang资讯",value:"2"},{text:"mars",value:"3"},{text:"晒单",value:"4"},{text:"now社区",value:"5"},{text:"编辑",value:"6"}]
data:[{text:"全部",value:"0"},{text:"用户",value:"1"},{text:"编辑",value:"6"},{text:"资讯",value:"2"},{text:"now",value:"5"},{text:"mars",value:"3"},{text:"晒单",value:"4"}]
});
$("#searchBtn").linkbutton({
... ... @@ -186,8 +196,9 @@
}
str = str + "<a role='showDetail' dataId='"+rowData.articleId+ "' index='"+ rowIndex + "' status='1' style='margin-left:10px'>查看详情</a>";
str = str + "<a target='_blank' href='"+contextPath+"/html/grass/articleAuthorizeManage/articleDetail.html?articleId="+rowData.articleId+"'>查看详情</a>";
// str = str + "<a target='_blank' href='"+contextPath+"/html/grass/articleAuthorizeManage/articleDetail.html?articleId="+rowData.articleId+"'>查看详情</a>";
str =str + '</p>';
var labelList = rowData.labelList;
... ... @@ -231,10 +242,10 @@
debugger
var str = '';
if(rowData.source == '1'){
str = "普通用户";
str = "用户";
}
if(rowData.source == '2'){
str = "guang";
str = "资讯";
}
if(rowData.source == '3'){
str = "mars";
... ... @@ -257,7 +268,11 @@
title: "审核人",
field: "authorizeAccount",
width: 20,
align: "left"
align: "left",
formatter: function (value, rowData, rowIndex) {
//审核人账号 + 审核时间
return value == null ? "" :value + "<br>" + "<br>" + rowData.authTimeStr;
}
},
{
title: "审核状态",
... ... @@ -285,7 +300,9 @@
// var str = "<a role='switchR' class='btn-success' dataId='"+rowData.articleId+ "' index='"+ rowIndex + "' status='1' style='margin-left:10px'>审核</a>";
// var str = "<a target='_blank' role='validateR' style='margin-left:10px' class='btn-success' href='"+contextPath+"/html/grass/articleAuthorizeManage/articleDetail.html?articleId="+rowData.articleId+"'>审核</a>";
var str = "<a role='validateR' dataId='"+rowData.articleId+ "' style='margin-left:10px' class='btn-success' >审核</a>";
var str = "<a role='showDetail' dataId='"+rowData.articleId+ "' index='"+ rowIndex + "' status='1' style='margin-left:10px'>审核</a>";
// var str = "<a role='validateR' dataId='"+rowData.articleId+ "' style='margin-left:10px' class='btn-success' >审核</a>";
// if(rowData.authStatus==0){//待审核状态--允许审核通过 和 不通过
... ... @@ -356,6 +373,50 @@
}
});
$(this).datagrid("getPanel").find("a[role='close']").linkbutton({
iconCls: "icon-redo",
onClick: function () {
var close_id = $(this).attr("dataId");
var group_id = $(this).attr("groupId");
index = $(this).attr("index");
$.messager.confirm("确认", "确认删除该分组吗?", function (flag) {
if(flag){
$.post(serverContextPath + "/grassLabelManage/deleteGrassLabel", {
id : close_id,
groupId: group_id
}, function(data) {
if (data.code == CODE_SUCCESS) {
$("#labelListTable").datagrid("reload");
window.self.$.messager.show({
title : "提示",
msg : "删除成功!"
});
} else {
window.self.$.messager.alert("失败", data.message, "error");
}
});
}
});
}
});
// 编辑
$(this).datagrid("getPanel").find("a[role='showDetail']").linkbutton({
iconCls : "icon-edit",
onClick : function() {
index = $(this).attr("index");
var articleId = $(this).attr("dataId");
// var row = $("#labelListTable").datagrid('getData').rows[index];
getDetailDialog(articleId);
}
});
$(this).datagrid("getPanel").find("a[role='deleteR']").linkbutton({
iconCls : "icon-edit",
onClick: function () {
... ... @@ -374,53 +435,86 @@
}
});
/* $(this).datagrid("getPanel").find("a[role='switchT']").linkbutton({
iconCls : "icon-edit",
onClick: function () {
var status = $(this).attr("status");
var dataId = $(this).attr("dataId");
index = $(this).attr("index");
var message = "";
if(status == 1){
message = "取消置顶";
}
if(status == 0){
message = "置顶";
}
$.messager.confirm("确认", "确认"+message+"该文章吗?", function (flag) {
if(flag){
switchTop(dataId, status);
=======
/* $(this).datagrid("getPanel").find("a[role='switchT']").linkbutton({
iconCls : "icon-edit",
onClick: function () {
var status = $(this).attr("status");
var dataId = $(this).attr("dataId");
index = $(this).attr("index");
var message = "";
if(status == 1){
message = "取消置顶";
}
if(status == 0){
message = "置顶";
}
$.messager.confirm("确认", "确认"+message+"该文章吗?", function (flag) {
if(flag){
switchTop(dataId, status);
>>>>>>> dev_grass_190305
}
});
}
});*/
}
});
// 编辑分组
function getDetailDialog(articleId){
var activityList = $("<div id='activityList'>").appendTo($(document.body));
var title = "查看详情/审核";
// var textVar = articleId == null ? "保存":"保存";
window.self.paramObject.mkData = articleId;
$(activityList).myDialog({
title: title,
width: "80%",
height: "90%",
resizable:false,
buttons:[
{
id:"authBtn",
text: "审核通过",
iconCls: "icon-cancel",
handler: function () {
//文章审核-通过
$.post(serverContextPath + "/grassArticle/updateArticle?articleId=" + articleId + "&authStatus=1&operateType=2", function (data) {
if (data.code == 200) {
$.messager.show({
title: "提示",
msg: "操作成功!",
height: 120
});
$(activityList).dialog("close");
$("#activityListTable").datagrid("reload");
} else {
$.messager.alert("失败", "操作失败", "error");
}
}, "json");
}
},
{
id:"unAuthBtn",
text: "审核不通过",
iconCls: "icon-cancel",
handler: function () {
//文章审核--不通过
//文章审核-通过
$.post(serverContextPath + "/grassArticle/updateArticle?articleId=" + articleId + "&authStatus=2&operateType=2", function (data) {
if (data.code == 200) {
$.messager.show({
title: "提示",
msg: "操作成功!",
height: 120
});
$(activityList).dialog("close");
$("#activityListTable").datagrid("reload");
} else {
$.messager.alert("失败", "操作失败", "error");
}
}, "json");
}
},{
text: "关闭",
iconCls: "icon-cancel",
handler: function () {
$(activityList).dialog("close");
}
}
],
modal: true,
href: contextPath + "/html/grass/articleAuthorizeManage/articleDetail.html?articleId" + articleId,
});
}
//审核通过 或者不通过
function switchRecommend(id, status) {
$.post(serverContextPath + "/grassArticle/updateArticle?articleId=" + id + "&authStatus=" + status + "&operateType=2", function (data) {
... ... @@ -451,7 +545,7 @@
});
function bigImage(obj){
/* function bigImage(obj){
var labelList = $("<div id='activityListTable'>").appendTo($(document.body));
var data = [];
... ... @@ -472,7 +566,7 @@
modal: true,
href: contextPath + "/html/grass/articleAuthorizeManage/imageView.html",
});
}
}*/
</script>
</html>
\ No newline at end of file
... ...
<!DOCTYPE html>
<!--<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
... ... @@ -31,15 +31,16 @@
height: 400px;
}
td {
font-size: 14px;
}
/*td {*/
/*font-size: 14px;*/
/*}*/
</style>
</head>
<body class="easyui-layout">
<body class="easyui-layout">-->
<!DOCTYPE html>
<div region="center" id="articleDetail" style="margin-left: 20px">
<!--<div region="center" id="articleDetail" style="margin-left: 20px">-->
<div id="tt" class="easyui-layout" fit="true" style="overflow-y: scroll">
<form name="publishArticleForm" id="publishArticleForm" method="post">
<input id="checkedId" name="articleId" type="hidden"/>
... ... @@ -47,7 +48,7 @@
<input id="articleSkns" name="articleSkns" type="hidden"/>
<div style="margin-top: 20px;margin-left: 30px">
<h2>查看详情/审核</h2>
<!-- <h2>查看详情/审核</h2>-->
<table border="0" style="width:95%;margin-top:5px;line-height:30px;" id="tab">
<tr style="height: 60px">
... ... @@ -119,12 +120,12 @@
</td>
</tr>
<tr style="height: 60px">
<tr style=",height: 60px">
<td id="goodstd">
<div style="float: left;margin-left: 30px">
<a id="authBtn" class="btn-info" style="display: none">审核通过</a>
<!-- <a id="authBtn" class="btn-info" style="display: none">审核通过</a>
<a id="unAuthBtn" class="btn-info" style="display: none">审核不通过</a>
<a id="unAuthBtn" class="btn-info" style="display: none">审核不通过</a>-->
</div>
</td>
... ... @@ -136,8 +137,9 @@
</div>
</div>
<!--</div>-->
<script>
debugger
var mySwiper = new Swiper('.swiper-container', {
// direction: 'vertical', // 垂直切换选项
// loop: true, // 循环模式选项
... ... @@ -159,15 +161,15 @@
// scrollbar: {
// el: '.swiper-scrollbar',
// },
})
</script>
</body>
<script>
});
var articleId = getUrlParam("articleId");
debugger
// var articleId = getUrlParam("articleId");
var articleId = paramObject.mkData;
// var articleId = getUrlParam("articleId");
console.log("articleId:" + articleId);
$(function () {
debugger
//加载数据
console.log("articleId:" + articleId);
//获取文章的详细信息
... ... @@ -202,13 +204,13 @@
var authStatus = detailInfo.authStatus;
if (authStatus == null || authStatus == '0') {
authStatusStr = "待审核";
$("#authBtn").attr("style", "display:block");
// $("#authBtn").attr("style", "display:block");
} else if (authStatus == '1') {
authStatusStr = "已通过";
$("#unAuthBtn").attr("style", "display:block");
$("#authBtn").attr("style", "display:none");
} else if (authStatus == '2') {
authStatusStr = "未通过";
$("#authBtn").attr("style", "display:block");
$("#unAuthBtn").attr("style", "display:none");
}
$("#authStatusStr").html(authStatusStr);
... ... @@ -281,20 +283,20 @@
}
}
//审核通过
$("#authBtn").linkbutton({
iconCls: "icon-search",
onClick: function () {
switchRecommend(1);
}
});
//审核不通过
$("#unAuthBtn").linkbutton({
iconCls: "icon-search",
onClick: function () {
switchRecommend(2);
}
});
// //审核通过
// $("#authBtn").linkbutton({
// iconCls: "icon-search",
// onClick: function () {
// switchRecommend(1);
// }
// });
// //审核不通过
// $("#unAuthBtn").linkbutton({
// iconCls: "icon-search",
// onClick: function () {
// switchRecommend(2);
// }
// });
//审核通过 或者不通过
... ...