Authored by 姜敏

逛bug修复

... ... @@ -15,7 +15,7 @@ var ENUM = {
},
status: {
'1': "开启",
'0': "关闭",
'0': "关闭"
},
tab: {
... ... @@ -130,10 +130,12 @@ var g = new common.grid({
hidden: true,
render: function(item) {
var html = [];
html.push("<p>" + common.util.__filterNull(item, 'createTime') + "</p>");
return html.join('');
//var html = [];
//html.push("<p>" + common.util.__filterNull(item, 'createTime') + "</p>");
//return html.join('');
var t = new Date(item.createTime * 1000);
var formatted = common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss");
return "<p>" + formatted + "</p>";
}
},{
// 4
... ...
... ... @@ -14,10 +14,10 @@ var ENUM = {
},
status: {
'1': "开启",
'0': "关闭",
'0': "关闭"
}
}
};
var currentSelItem;
... ... @@ -41,7 +41,7 @@ new common.dropDown({
var t = new common.tab({
el: "#basicTab",
click: function() {
click: function () {
var columnname = $(this).find('a').attr('columnname');
... ... @@ -53,7 +53,7 @@ var t = new common.tab({
g.options.columns[6].hidden = false;
g.options.columns[7].hidden = true;
} else if(columnname == 100) {
} else if (columnname == 100) {
g.options.columns[2].hidden = true;
g.options.columns[3].hidden = false;
g.options.columns[4].hidden = false;
... ... @@ -88,30 +88,29 @@ var t = new common.tab({
var g = new common.grid({
el: '#basicTable',
parms: function() {
parms: function () {
return {
brandId: common.util.__input("brandId"),
isPayDelivery: common.util.__input("isPayDelivery"),
productSkn: common.util.__input("productSkn"),
status: (t.active && t.active!='all') ? t.active : 400
status: (t.active && t.active != 'all') ? t.active : 400
};
},
columns: [{
display: 'SKN',
name: 'productSkn'
},{
}, {
display: '品牌',
name: 'brandName'
},
// 审核状态(全部商品是显示) 2
{
display: "状态",
render: function(item) {
render: function (item) {
var html = [];
html.push("<p>" + ENUM.status[item.isPayDelivery] + "</p>");
return html.join('');
}
},
... ... @@ -119,7 +118,7 @@ var g = new common.grid({
display: "申请人",
hidden: true,
render: function(item) {
render: function (item) {
var html = [];
html.push("<p>" + common.util.__filterNull(item, 'applicant') + "</p>");
... ... @@ -129,23 +128,22 @@ var g = new common.grid({
display: "申请时间",
hidden: true,
render: function(item) {
render: function (item) {
var html = [];
html.push("<p>" + common.util.__filterNull(item, 'createTime') + "</p>");
return html.join('');
}
},{
}, {
// 5
display: '驳回理由',
hidden: true,
name: 'rejectReason', // 8待上架,2待审核,3驳回,4通过,1已上架,0已下架,5再上架待审核,6再上架驳回,7再上架通过
render: function(item) {
return '<p style="color:red;">' + common.util.__filterNull(item, 'rejectReason') + '</p>' ;
render: function (item) {
return '<p style="color:red;">' + common.util.__filterNull(item, 'rejectReason') + '</p>';
}
}, { // 6
display: "操作",
render: function(item) {
render: function (item) {
var html = [];
if (item.isPayDelivery == 1) { // 待审核
html.push('<a data-index="' + item.__index + '" href="JavaScript:;" class="btn operation btn-danger btn-xs edit-class-btn" id="btn-item-close" data-type="close">关闭</a>');
... ... @@ -156,17 +154,16 @@ var g = new common.grid({
return html.join('');
}
},{ // 7
}, { // 7
display: "操作",
hidden: true,
render: function(item) {
render: function (item) {
var html = [];
html.push('<a data-index="' + item.__index + '" href="JavaScript:;" class="btn operation btn-danger btn-xs edit-class-btn" id="btn-item-reject" data-type="reject">驳回</a>');
html.push('<a data-index="' + item.__index + '" href="JavaScript:;" class="btn operation btn-success btn-xs edit-class-btn" id="btn-item-pass" data-type="pass">通过</a>');
return html.join('');
}
},
... ... @@ -175,13 +172,13 @@ var g = new common.grid({
g.init('/payDelivery/queryPayDeliveryList');
// tab初始化
var loadTab = function() {
var loadTab = function () {
t.active = undefined;
setTimeout(function() {
setTimeout(function () {
common.util.__ajax({
url: "/payDelivery/queryCountProductPayDelivery",
data: g.options.parms()
}, function(res) {
}, function (res) {
var __dt = $.extend({}, ENUM.tips, res.data);
t.init(__dt);
}, true);
... ... @@ -190,7 +187,7 @@ var loadTab = function() {
loadTab();
// 筛选
$(document).on('click', "#filter-btn", function() {
$(document).on('click', "#filter-btn", function () {
loadTab();
g.options.columns[2].hidden = false;
g.options.columns[3].hidden = true;
... ... @@ -202,18 +199,18 @@ $(document).on('click', "#filter-btn", function() {
});
$(document).on('click', ".edit-class-btn", function() {
$(document).on('click', ".edit-class-btn", function () {
console.log($(this).data('type'));
var btnType = $(this).data('type');
var url = '';
var alertContent;
currentSelItem = g.rows[$(this).data("index")];
var data = function() {
var data = function () {
var reason = $('#reason').val();
if (reason === '' || $.trim(reason) === '') {
if(btnType == 'reject') {
if (btnType == 'reject') {
return "请填写驳回原因";
}
}
... ... @@ -222,7 +219,7 @@ $(document).on('click', ".edit-class-btn", function() {
brandName: currentSelItem.brandName,
brandId: currentSelItem.brandId,
rejectReason: reason,
id:currentSelItem.id
id: currentSelItem.id
};
}
... ... @@ -264,17 +261,17 @@ $(document).on('click', ".edit-class-btn", function() {
break;
}
common.dialog.confirm("温馨提示", alertContent, function() {
common.dialog.confirm("温馨提示", alertContent, function () {
common.util.__ajax({
url: url,
data: data()
}, function() {
}, function () {
g.reload();
loadTab();
});
});
});
$('#export-btn').on('click', function() {
$('#export-btn').on('click', function () {
window.open("/ajax/down?queryConf=" + JSON.stringify(g.options.parms()) + "&type=productPayDeliveryExport");
});
\ No newline at end of file
... ...
... ... @@ -9,13 +9,13 @@ var ENUM = {
GenderEnum: {
'1': '男',
'2': '女',
'3': '通用',
'3': '通用'
},
StatusEnum: {
0:'关闭',
1:'开启',
},
1:'开启'
}
}
... ... @@ -77,15 +77,14 @@ var g = new common.grid({
return HtmArr.join('');
}
}]
})
});
g.init('/guang/article/categoryist');
//==================== 按钮点击事件 =====================//
//添加
$(document).on('click', '#add', function() {
articleCategoryOP("新增", '/guang/article/sort/add', {});
articleCategoryOP("新增", '/guang/article/sort/add', {})
});
//编辑
... ... @@ -97,7 +96,6 @@ $(document).on('click', '.info-modify', function() {
//删除
$(document).on('click', '.info-del', function() {
var item = g.rows[$(this).data("index")];
common.dialog.confirm("温馨提示","确定要删除该文章分类?" , function() {
common.util.__ajax({
url: '/guang/article/sort/del',
... ...
... ... @@ -4,35 +4,23 @@
var $ = require('jquery'),
common = require('../common/common');
/**
* Created by wangqianjun on 16/3/22.
*/
'use strict';
var $ = require('jquery'),
common = require('../common/common');
var STATUS = 0;
var ENUM = {
HotEnum: {
'1': '是',
'0': '否',
'0': '否'
},
StatusEnum: {
'-1':'屏蔽',
0:'待审核',
1:'通过',
},
}
1:'通过'
}
};
new common.dropDown({
el: "#condNum",
ajax: 'guangCommentGetFilterItems',
ajax: 'guangCommentGetFilterItems'
});
var g = new common.grid({
... ... @@ -42,11 +30,10 @@ var g = new common.grid({
return {
status: STATUS,
condNum: common.util.__input('condNum'),
condContent: common.util.__input('condContent'),
condContent: common.util.__input('condContent')
};
},
columns: [
{
display: '',
type: 'checkbox'
... ... @@ -69,13 +56,12 @@ var g = new common.grid({
{
display: "回复内容",
name: "content",
width:'15%',
width:'15%'
},
{display: "回复文章", name: "articleTitle", width:'15%',},
{display: "回复文章", name: "articleTitle", width:'15%'},
{display: "编辑", name: "editorName"},
{
display: '状态',
render: function (item) {
... ...
... ... @@ -2,23 +2,23 @@
* Created by wangqianjun on 16/3/22.
*/
var $ = require('jquery');
common = require('../common/common');
datepicker = require('../util/datepicker');
common = require('../common/common');
datepicker = require('../util/datepicker');
var ENUM = {
GenderEnum: {
'1':'男',
'2':'女',
'3':'通用',
'1': '男',
'2': '女',
'3': '通用'
},
StatusEnum: {
'-1':'已关闭',
0:'未发布',
1:'开启',
},
'-1': '已关闭',
0: '未发布',
1: '已发布'
}
}
};
//下拉框
new common.dropDown({
... ... @@ -67,7 +67,7 @@ var Timmer = {
var g = new common.grid({
el: '#basicTable',
size: 10,
parms: function() {
parms: function () {
return {
articleTitle: common.util.__input('articleTitle'),
... ... @@ -77,7 +77,7 @@ var g = new common.grid({
status: $('#status').val(),//common.util.__input('status'),
orderBy: common.util.__input('orderBy'),
startTime: common.util.__input('starttime'),
endTime: common.util.__input('endtime'),
endTime: common.util.__input('endtime')
};
},
columns: [{
... ... @@ -85,17 +85,17 @@ var g = new common.grid({
name: "id"
}, {
display: "缩略图",
render: function(item) {
render: function (item) {
item.coverImage = common.util.__template(item.coverImage,{mode:2,width:100,height:100});
item.coverImage = common.util.__template(item.coverImage, {mode: 2, width: 100, height: 100});
return '<img src="' + item.coverImage + '" width="100" height="60"/>'
}
}, {
display: '文章标题',
//name: "articleTitle",
width:'15%',
render: function(item) {
return '<span class="text-overflow"">'+item.articleTitle+'</span>'
width: '15%',
render: function (item) {
return '<span class="text-overflow"">' + item.articleTitle + '</span>'
}
}, {
display: '分类',
... ... @@ -117,23 +117,33 @@ var g = new common.grid({
display: "创建时间",
render: function (item) {
if (item.createTime && item.createTime !== 0) {
var t = new Date(item.createTime * 1000);
var formatted = common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss");
return "<p>" + formatted + "</p>";
}
else {
return "";
}
}
}, {
display: "发布时间",
render: function (item) {
if (item.publishTime && item.publishTime !== 0) {
var t = new Date(item.publishTime * 1000);
var formatted = common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss");
return "<p>" + formatted + "</p>";
}
},{
else {
return "";
}
}
}, {
display: '操作',
//}
name: "status",
render: function(items) {
render: function (items) {
var HtmArr = [];
if (items.status == 1) {
... ... @@ -150,24 +160,23 @@ var g = new common.grid({
}
HtmArr.push('<a data-index="' + items.__index + '" href="/guang/article/contentEdit/'+items.id+'" class="btn btn-primary btn-xs info-modify">编辑</a>');
HtmArr.push('<a data-index="' + items.__index + '" href="/guang/article/contentEdit/' + items.id + '" 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() {
$("#filter-btn").click(function () {
g.reload(1);
});
//关闭资讯
$(document).on('click', '.info-close', function() {
$(document).on('click', '.info-close', function () {
var item = g.rows[$(this).data("index")];
common.util.__ajax({
... ... @@ -176,7 +185,7 @@ $(document).on('click', '.info-close', function() {
id: item.id,
status: -1
}
}, function(res) {
}, function (res) {
if (res.code == 200) {
common.util.__tip('关闭资讯成功', 'success');
... ... @@ -188,7 +197,7 @@ $(document).on('click', '.info-close', function() {
});
//打开资讯
$(document).on('click', '.info-open', function() {
$(document).on('click', '.info-open', function () {
var item = g.rows[$(this).data("index")];
common.util.__ajax({
... ... @@ -197,7 +206,7 @@ $(document).on('click', '.info-open', function() {
id: item.id,
status: 1
}
}, function(res) {
}, function (res) {
if (res.code == 200) {
common.util.__tip('开启资讯成功', 'success');
... ... @@ -209,7 +218,7 @@ $(document).on('click', '.info-open', function() {
});
//推荐
$(document).on('click', '.info-recommend', function() {
$(document).on('click', '.info-recommend', function () {
var item = g.rows[$(this).data("index")];
common.util.__ajax({
... ... @@ -218,7 +227,7 @@ $(document).on('click', '.info-recommend', function() {
id: item.id,
isRecommend: 1
}
}, function(res) {
}, function (res) {
if (res.code == 200) {
common.util.__tip('成功推荐', 'success');
... ... @@ -230,7 +239,7 @@ $(document).on('click', '.info-recommend', function() {
});
//取消推荐
$(document).on('click', '.info-recommend-cancel', function() {
$(document).on('click', '.info-recommend-cancel', function () {
var item = g.rows[$(this).data("index")];
common.util.__ajax({
... ... @@ -239,7 +248,7 @@ $(document).on('click', '.info-recommend-cancel', function() {
id: item.id,
isRecommend: 0
}
}, function(res) {
}, function (res) {
if (res.code == 200) {
common.util.__tip('成功取消推荐', 'success');
... ... @@ -253,24 +262,20 @@ $(document).on('click', '.info-recommend-cancel', function() {
//定时
$(document).on("click", ".info-time", function () {
var item = g.rows[$(this).data("index")];
//$('#title').val("title");
var data = function () {
var dateString = common.util.__input('datepicker');
if (dateString === '' || $.trim(dateString) === '') {
return "请填写时间";
}
return {
publishTime: dateString,
id: item.id
};
}
};
Timmer.toast(common.util.__template2($("#template").html(), item), data);
$('#datepicker').fdatepicker({
format: 'yyyy-mm-dd'
format: 'yyyy-mm-dd hh:mm',
pickTime:true
});
});
... ... @@ -282,7 +287,7 @@ $(document).on("click", ".info-del", function () {
common.util.__ajax({
url: '/guang/article/del',
data: {
id:item.id
id: item.id
}
}, function () {
g.reload();
... ...
... ... @@ -10,7 +10,7 @@ exports.res = [{
route: '/goods/cod/brand/index',
method: 'GET',
view: 'pages/goods/cod-brand',
src: '/goods/cod-brand',
src: '/goods/cod-brand'
}, {
route: '/payDelivery/queryTotalBrandPayDelivery',
method: 'POST',
... ... @@ -21,8 +21,8 @@ exports.res = [{
{name: 'isPayDelivery', type: 'Number'},
{name: 'checkStatus', type: 'Number'},
{name: 'page', type: 'Number'},
{name: 'size', type: 'Number'},
],
{name: 'size', type: 'Number'}
]
}, {
// 开启 & 关闭 货到付款
route: '/payDelivery/addPayDeliveryCheck',
... ... @@ -31,8 +31,8 @@ exports.res = [{
params: [
{name: 'isPayDelivery', type: 'Number'},
{name: 'brandName', type: 'String'},
{name: 'brandId', type: 'Number'},
],
{name: 'brandId', type: 'Number'}
]
},{
// 通过 & 驳回申请
route: '/payDelivery/reviewPayDeliveryCheck',
... ... @@ -44,9 +44,8 @@ exports.res = [{
{name: 'rejectReason', type: 'String'},
{name: 'isPayDelivery', type: 'Number'},
{name: 'checkStatus', type: 'Number'},
{name: 'id', type: 'Number'},
],
{name: 'id', type: 'Number'}
]
},
// 获取tab上的数量
{
... ... @@ -55,15 +54,15 @@ exports.res = [{
url: '/payDelivery/queryCountBrandPayDelivery',
params: [
{name: 'brandId', type: 'Number'},
{name: 'isPayDelivery', type: 'Number'},
],
{name: 'isPayDelivery', type: 'Number'}
]
},
// ====================== 单品货到付款限制页面路由 ===================
{
route: '/goods/cod/goods/index',
method: 'GET',
view: 'pages/goods/cod-goods',
src: '/goods/cod-goods',
src: '/goods/cod-goods'
}, {
route: '/payDelivery/queryPayDeliveryList',
method: 'POST',
... ... @@ -75,8 +74,8 @@ exports.res = [{
{name: 'status', type:'Number'},
{name: 'productSkn', type:'Number'},
{name: 'page', type: 'Number'},
{name: 'size', type: 'Number'},
],
{name: 'size', type: 'Number'}
]
},
{
// 开启货到付款
... ... @@ -86,8 +85,8 @@ exports.res = [{
params: [
{name: 'productSkn', type: 'String'},
{name: 'brandName', type: 'String'},
{name: 'brandId', type: 'Number'},
],
{name: 'brandId', type: 'Number'}
]
},{
// 关闭货到付款
route: '/payDelivery/closePayDelivery',
... ... @@ -96,8 +95,8 @@ exports.res = [{
params: [
{name: 'productSkn', type: 'String'},
{name: 'brandName', type: 'String'},
{name: 'brandId', type: 'Number'},
],
{name: 'brandId', type: 'Number'}
]
},{
// 通过申请
route: '/payDelivery/passPayDelivery',
... ... @@ -107,8 +106,8 @@ exports.res = [{
{name: 'productSkn', type: 'String'},
{name: 'brandName', type: 'String'},
{name: 'brandId', type: 'Number'},
{name: 'id', type: 'Number'},
],
{name: 'id', type: 'Number'}
]
},{
// 驳回申请
route: '/payDelivery/rejectPayDelivery',
... ... @@ -119,8 +118,8 @@ exports.res = [{
{name: 'brandName', type: 'String'},
{name: 'rejectReason', type: 'String'},
{name: 'brandId', type: 'Number'},
{name: 'id', type: 'Number'},
],
{name: 'id', type: 'Number'}
]
},
// 获取skn列表
{
... ... @@ -129,7 +128,7 @@ exports.res = [{
url: '/payDelivery/queryPayDeliveryProductSkn',
params: [
{name: 'idName', type: 'String'}
],
]
}, // 获取tab上的数量
{
route: '/payDelivery/queryCountProductPayDelivery',
... ... @@ -138,22 +137,19 @@ exports.res = [{
params: [
{name: 'productSkn', type: 'String'},
{name: 'brandId', type: 'Number'},
{name: 'isPayDelivery', type: 'Number'},
],
{name: 'isPayDelivery', type: 'Number'}
]
}, { // 获取品牌列表
route: '/payDelivery/queryPayDeliveryBrandName',
method: 'POST',
url: '/payDelivery/queryPayDeliveryBrandName',
params: [
{name: 'idName', type: 'String'}
],
]
}, { // 批量导入
route: '/goods/cod/upload',
method: 'GET',
view: 'pages/goods/cod-upload',
src: '/goods/cod-upload',
src: '/goods/cod-upload'
}
];
\ No newline at end of file
... ...
... ... @@ -68,8 +68,8 @@
<label for="status" class="col-sm-2 control-label">是否启用:</label>
<div class="radio">
<label><input type="radio" value="1" name="status" kl_vkbd_parsed="true">开启</label>
<label><input type="radio" value="0" name="status" kl_vkbd_parsed="true">关闭</label>
<label><input type="radio" value="0" name="status" kl_vkbd_parsed="true" checked>关闭</label>
</div>
<input id="status" type="hidden" value="[[status]]" for="radio" required="required" kl_vkbd_parsed="true">
<input id="status" type="hidden" value="[[status]]" for="radio" kl_vkbd_parsed="true">
</div>
</script>
\ No newline at end of file
... ...
... ... @@ -72,7 +72,7 @@
<label></label>
<input type="radio" value="2" name="articleGender">
<label></label>
<input type="radio" value="3" name="articleGender">
<input type="radio" value="3" name="articleGender" checked>
<label>通用</label>
<input type="hidden" value="[[articleGender]]" id="articleGender" for="radio" required/>
</div>
... ...
... ... @@ -105,8 +105,6 @@
<p id="title">[[articleTitle]]</p>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">定时发布时间</label>
<div class="col-sm-9">
... ...
... ... @@ -54,8 +54,8 @@
<label for="status" class="col-sm-2 control-label">是否启用:</label>
<div class="radio">
<label><input type="radio" value="1" name="status" kl_vkbd_parsed="true">开启</label>
<label><input type="radio" value="0" name="status" kl_vkbd_parsed="true">关闭</label>
<label><input type="radio" value="0" name="status" kl_vkbd_parsed="true" checked="checked">关闭</label>
</div>
<input id="status" type="hidden" value="[[status]]" for="radio" required="required" kl_vkbd_parsed="true">
<input id="status" type="hidden" value="[[status]]" for="radio" kl_vkbd_parsed="true">
</div>
</script>
\ No newline at end of file
... ...
... ... @@ -68,16 +68,12 @@
<script type="text/template" id="template">
<div class="form-group">
<label for="tagName" class="col-sm-2 control-label">标签名称:</label>
<div class="col-sm-10">
<input type="text" value="[[tagName]]" name="content" id="tagName" placeholder="标签名称" required="required" class="form-control">
</div>
</div>
<div class="form-group" id="maxsord">
<label for="classifyId" class="col-sm-2 control-label">标签分类:</label>
<div class="col-sm-10">
... ... @@ -93,18 +89,18 @@
<label for="isHot" class="col-sm-2 control-label">是否热门:</label>
<div class="radio">
<label><input type="radio" value="1" name="isHot" kl_vkbd_parsed="true"></label>
<label><input type="radio" value="0" name="isHot" kl_vkbd_parsed="true"></label>
<label><input type="radio" value="0" name="isHot" kl_vkbd_parsed="true" checked></label>
</div>
<input id="isHot" type="hidden" value="[[isHot]]" for="radio" required="required" kl_vkbd_parsed="true">
<input id="isHot" type="hidden" value="[[isHot]]" for="radio" kl_vkbd_parsed="true">
</div>
<div class="form-group">
<label for="status" class="col-sm-2 control-label">是否启用:</label>
<div class="radio">
<label><input type="radio" value="1" name="status" kl_vkbd_parsed="true"></label>
<label><input type="radio" value="0" name="status" kl_vkbd_parsed="true"></label>
<label><input type="radio" value="0" name="status" kl_vkbd_parsed="true" checked></label>
</div>
<input id="status" type="hidden" value="[[status]]" for="radio" required="required" kl_vkbd_parsed="true">
<input id="status" type="hidden" value="[[status]]" for="radio" kl_vkbd_parsed="true">
</div>
</script>
... ...