Authored by 王钱钧

添加逛-资讯管理模块代码。

... ... @@ -26,7 +26,11 @@ var urlObj = {
'getByCategoryId': '/operations/helpcontent/getSecondCategoryList',
'getAllHelpCategory': '/operations/helpcontent/getAllHelpCategory',
'getHelpCategory': '/operations/helpcontent/getHelpCategory',
'queryAll4Select': '/goods/brandSeries/queryAll4Select' //品牌款型系列
'queryAll4Select': '/goods/brandSeries/queryAll4Select', //品牌款型系列
// 逛
'guangGetAuthorList':'/guang/article/getAuthorList', // 逛-获取作者
'guangGetSortList':'/guang/article/getSortList', // 逛-获取作者
};
var dropDown = function(option) {
... ...
/**
* Created by wangqianjun on 16/3/22.
*/
... ...
/**
* Created by wangqianjun on 16/3/22.
*/
... ...
/**
* Created by wangqianjun on 16/3/22.
*/
... ...
/**
* Created by wangqianjun on 16/3/22.
*/
var $ = require('jquery');
common = require('../common/common');
datepicker = require('../util/datepicker');
//下拉框
new common.dropDown({
el: "#articleGender"
});
new common.dropDown({
el: "#authorId",
ajax: 'guangGetAuthorList'
});
new common.dropDown({
el: "#maxSortId",
ajax: 'guangGetSortList'
});
new common.dropDown({
el: "#status"
});
new common.dropDown({
el: '#orderBy'
});
//日期插件
$('.hasDatepicker').fdatepicker({
format: 'yyyy-mm-dd'
});
var g = new common.grid({
el: '#basicTable',
size: 10,
parms: function() {
return {
articleTitle: common.util.__input('articleTitle'),
articleGender: common.util.__input('articleGender'),
authorId: common.util.__input('authorId'),
maxSortId: common.util.__input('maxSortId'),
status: common.util.__input('status'),
orderBy: common.util.__input('orderBy'),
startTime: common.util.__input('starttime'),
endTime: common.util.__input('endtime'),
};
},
columns: [{
display: 'ID',
name: "id"
}, {
display: "缩略图",
render: function(item) {
return '<img src="' + item.coverImage + '" width="100" height="60"/>'
}
}, {
display: '文章标题',
name: "articleTitle"
}, {
display: '分类',
name: "brandNameEn"
}, {
display: '性别',
name: "articleGender"
}, {
display: '作者',
name: "authorId"
}, {
display: '状态',
name: "status"
}, {
display: "创建时间",
render: function (item) {
var t = new Date(item.createTime * 1000);
var formatted = common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss");
return "<p>" + formatted + "</p>";
}
}, {
display: "发布时间",
render: function (item) {
var t = new Date(item.publishTime * 1000);
var formatted = common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss");
return "<p>" + formatted + "</p>";
}
},{
display: '操作',
//}
name: "status",
render: function(items) {
var HtmArr = [];
if (items.status == 1) {
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-warning btn-xs info-close">关闭</a>');
} else {
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-warning btn-xs info-open">发布</a>');
}
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-primary btn-xs info-time">定时</a>');
if (items.isRecommend == 1) {
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-danger btn-xs info-recommend-cancel">取消推荐</a>');
} else {
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-warning btn-xs info-recommend">推荐</a>');
}
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-primary btn-xs info-modify">编辑</a>');
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-danger btn-xs info-del">删除</a>');
return HtmArr.join('');
}
}]
})
g.init('/guang/article/list');
// 按钮点击事件
$("#filter-btn").click(function() {
g.reload(1);
});
\ No newline at end of file
... ...
/**
* Created by wangqianjun on 16/3/22.
*/
... ...
/**
* Created by wangqianjun on 16/3/22.
*/
... ...
... ... @@ -18,8 +18,8 @@ var config = {
// domain: 'http://172.16.6.252:9080',//陈超
//domain: 'http://172.16.6.227:8088/platform', //玛丽
// domain: 'http://192.168.102.202:8088/platform',
//domain:'http://172.16.9.8:8080/yohobuy-platform-web',//葛超
domain: 'http://192.168.102.202:8088/platform',
domain:'http://172.16.6.197:8080/yohobuy-platform-web',//葛超
//domain: 'http://192.168.102.202:8088/platform',
loggers: {
api: {
level: 'verbose',
... ...
/**
* Created by wangqianjun on 16/3/22.
* Interface for Guang Model
*/
exports.domain =require('../config/common.js').domain;
//【资讯管理】
exports.res = [
{//逛-> 资讯管理 空白页
route:'/guang/article/index',
method:'GET',
view:'pages/guang/infoManager',
src: '/guang/infoManager',
data:{
iscreate:true
}
}, {
// 资讯管理列表数据
route:'/guang/article/list',
method:'POST',
url: '/guang/article/getList',
params:[
{name: 'articleTitle',type: 'String'},
{name: 'articleGender',type: 'String'},
{name: 'authorId',type: 'Number'},
{name: 'maxSortId',type: 'Number'},
{name: 'status',type: 'Number'},
{name: 'orderBy',type: 'String'},
{name: 'startTime',type: 'String'},
{name: 'endTime',type: 'String'}
]
}, {
// 资讯管理-列表操作(修改、发布、关闭、推荐、取消推荐)
route:'/guang/article/operation',
method:'POST',
url: '/guang/article/updateArticle',
params:[
{name: 'id',type: 'Number'},
{name: 'articleTitle',type: 'String'},
{name: 'articleGender',type: 'String'},
{name: 'authorId',type: 'Number'},
{name: 'maxSortId',type: 'Number'},
{name: 'minSortId',type: 'Number'},
{name: 'articleSummary',type: 'String'},
{name: 'coverImage',type: 'String'},
{name: 'status',type: 'Number'},
{name: 'coverImageType',type: 'Number'},
{name: 'articleType',type: 'Number'},
{name: 'adsImgSize',type: 'String'},
{name: 'isRecommend',type: 'Number'},
]
},
//【文章分类管理】
//【标签管理】
//【标签分类管理】
//【评论管理】
//【作者管理】
// [下拉框调用的接口]
{// 作者
route:'/guang/article/getAuthorList',
method:'POST',
url: '/guang/article/getAuthorList',
params:[
{name: 'idName',type: 'String'},
]
},
{// 所有分类
route:'/guang/article/getSortList',
method:'POST',
url: '/guang/article/getSortList',
},
];
... ...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
</body>
</html>
\ No newline at end of file
... ...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
</body>
</html>
\ No newline at end of file
... ...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
</body>
</html>
\ No newline at end of file
... ...
<div class="pageheader">
<div class="media">
<div class="pageicon pull-left">
<i class="fa fa-th-list"></i>
</div>
<div class="media-body">
<ul class="breadcrumb">
<li><a href=""><i class="glyphicon glyphicon-home"></i></a></li>
<li><a href="">商品管理</a></li>
<li>资讯管理</li>
</ul>
<div>
<div style="width: 30%;float: left;">
<h4>资讯列表管理</h4>
</div>
</div>
</div>
</div>
</div>
<div class="contentpanel">
<div class="panel panel-default" style="margin-bottom:10px;">
<div class="panel-body">
<div class="row">
<div class="panel-col">
<input type="text" id="articleTitle" class="form-control" placeholder="输入关键字" style="height: 39px;"/>
</div>
<div class="panel-col">
<select id="articleGender" class="form-control">
<option value="-1">请选择性别</option>
<option value="1"></option>
<option value="2"></option>
<option value="3">通用</option>
</select>
</div>
<div class="panel-col">
<select id="authorId" class="form-control">
<option value="-1">请选择作者</option>
</select>
</div>
<div class="panel-col">
<select id="maxSortId" class="form-control">
<option value="-1">请选择分类</option>
</select>
</div>
<div class="panel-col">
<select id="status" class="form-control">
<option value="-1">请选择状态</option>
<option value="1">已发布</option>
<option value="0">未发布</option>
<option value="-1">已关闭</option>
</select>
</div>
<div class="panel-col">
<select id="orderBy" class="form-control">
<option value="-1">请选择时间方式</option>
<option value="create_time">添加时间</option>
<option value="publish_time">发布时间</option>
</select>
</div>
<div class="panel-col2">
<input type="text" id="starttime" class="form-control panel-input hasDatepicker" name="start_time" placeholder="开始时间" value="" kl_vkbd_parsed="true">
</div>
<div class="panel-col2">
<input type="text" id="endtime" class="form-control panel-input hasDatepicker" name="end_time" placeholder="结束时间" value="" kl_vkbd_parsed="true">
</div>
<div class="panel-col">
<a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a>
<a id="all-btn" href="" class="btn btn-info">全部</a>
</div>
</div>
</div>
</div>
<div class="panel panel-primary-head">
<div id="basicTable_wrapper" class="dataTables_wrapper no-footer">
<div class="dataTables_length" id="basicTable">
</div>
<nav>
<ul id="pagination" class="pagination pagination-lg"></ul>
</nav>
</div>
</div>
</div>
... ...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
</body>
</html>
\ No newline at end of file
... ...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
</body>
</html>
\ No newline at end of file
... ...