Authored by 马力

Merge branch 'test5.5.1'

/**
* Created by zhaojun on 17/3/15.
*/
module.exports = function (app) {
//列表页
app.get("/market/eventConfig/index", "marketing.EventConfig.Index",function(){
this.$extend={
moduleName:'营销管理',
pageName:'配置管理',
}
});
//列表请求
app.post("/eventConfig/queryList", "EventConfig_queryEventConfig");
//详情请求
app.post("/eventConfig/queryById", "EventConfig_getEventConfigById");
//编辑请求
app.post("/eventConfig/update", "EventConfig_updateEventConfig");
};
\ No newline at end of file
... ...
/**
* Created by zhaojun on 17/3/15.
*/
module.exports = {
namespace: "EventConfig",
apis: {
queryEventConfig: {
title: "配置列表",
url: "/eventConfig/queryList",
params: {
page: {type: Number},
size: {type: Number},
eventCode: {type: String},
eventValue: {type: String},
status: {type: Number}
}
},
getEventConfigById:{
title: "配置详情",
url: "/eventConfig/queryById",
params: {
id: {type: Number}
}
},
updateEventConfig: {
title: "配置修改",
url: "/eventConfig/update",
params: {
id: {type: Number},
eventCode: {type: String},
eventValue: {type: String},
msgTitle:{type: String},
msgContent:{type: String},
status: {type: Number},
isRepeat: {type: Number},
clientLimit: {type: String}
}
}
}
};
\ No newline at end of file
... ...
<%include '../../../common/views/__ui/header'%>
<%include '../../../common/views/__partail/ListHeader'%>
<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="sel-eventCode" value="" class="form-control observe" placeholder="输入配置编码" style="height: 39px;"/>
</div>
<div class="panel-col">
<select id="sel-status" class="form-control">
<option value="-1">是否生效</option>
<option value="0">失效</option>
<option value="1">有效</option>
</select>
</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>
<script type="text/template" id="template">
<div class="form-group">
<label class="col-sm-2 control-label">配置名称</label>
<div class="col-sm-10">
<input type="text" value="[[comments]]" class="form-control observe" placeholder="配置名称" data-field="comments" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">配置编码</label>
<div class="col-sm-10">
<input type="text" value="[[eventCode]]" class="form-control observe" placeholder="配置编码" data-field="eventCode" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">配置属性<span style="color: red;"> *</span></label>
<div class="col-sm-10">
<input type="text" value="[[eventValue]]" class="form-control observe" placeholder="配置属性" required="required" data-field="eventValue">
</div>
</div>
<div class="form-group">
<label for="type" class="col-sm-2 control-label">业务类型</label>
<div class="col-sm-10">
<select name="type" id="type" tabindex="-1" class="select2-offscreen" style="width: 100px;" disabled>
<option value="1" {{if type == 1}}selected{{/if}}>优惠券</option>
<option value="2" {{if type == 2}}selected{{/if}}>有货币</option>
</select>
</div>
</div>
<div class="form-group">
<label for="isRepeat" class="col-sm-2 control-label">是否支持重复发送<span style="color: red;"> *</span></label>
<div class="radio">
<label><input type="radio" value="0" class=" observe" name="isRepeat" kl_vkbd_parsed="true" data-field="isRepeat" checked>不是</label>
<label><input type="radio" value="1" class=" observe" name="isRepeat" kl_vkbd_parsed="true" data-field="isRepeat"></label>
</div>
<input id="isRepeat" type="hidden" required="required" class="form-control observe" value="[[isRepeat||'0']]" for="radio" kl_vkbd_parsed="true" data-field="isRepeat">
</div>
<div class="form-group">
<label class="col-sm-2 control-label">消息标题</label>
<div class="col-sm-10">
<input type="text" value="[[msgTitle]]" class="form-control observe" placeholder="消息标题" data-field="msgTitle">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">消息内容</label>
<div class="col-sm-10">
<input type="text" value="[[msgContent]]" class="form-control observe" placeholder="消息内容" data-field="msgContent">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">客户端限制</label>
<div class="col-sm-10">
<input type="text" value="[[clientLimit]]" class="form-control observe" placeholder="客户端限制" data-field="clientLimit">
</div>
</div>
<div class="form-group">
<label for="status" class="col-sm-2 control-label">是否生效<span style="color: red;"> *</span></label>
<div class="radio">
<label><input type="radio" value="0" class=" observe" name="status" kl_vkbd_parsed="true" data-field="status" checked>失效</label>
<label><input type="radio" value="1" class=" observe" name="status" kl_vkbd_parsed="true" data-field="status">有效</label>
</div>
<input id="status" type="hidden" required="required" class="form-control observe" value="[[status||'0']]" for="radio" kl_vkbd_parsed="true" data-field="status">
</div>
</script>
<%include '../../../common/views/__ui/footer'%>
\ No newline at end of file
... ...
... ... @@ -50,7 +50,10 @@ module.exports={
{name: 'relationUrl', type: 'string'},
{name: 'parentId', type: 'string'},
{name: 'orderBy', type: 'string'},
{name: 'icon', type: 'string'}
{name: 'icon', type: 'string'},
{name:'productSkn',type:'number'},
{name:'url',type:'string'},
{name:'goTo',type:'string'}
]
},
updateSC:{
... ... @@ -65,7 +68,10 @@ module.exports={
{name: 'parentId', type: 'string'},
{name: 'orderBy', type: 'string'},
{name: 'icon', type: 'string'},
{name: 'state', type: 'string'}
{name: 'state', type: 'string'},
{name:'productSkn',type:'number'},
{name:'url',type:'string'},
{name:'goTo',type:'string'}
]
},
updateSCStatus:{
... ...
... ... @@ -69,6 +69,69 @@
<label class="col-sm-2 control-label">分类图标:</label>
<div class="col-sm-8"><input type="file" id="icon" name="icon" value="[[icon]]" placeholder="分别图标"></div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">SKN</label>
<div class="col-sm-8"><input type="text" id="productSkn" name="productSkn" class="form-control" placeholder="SKN" value="[[productSkn]]" data-type="number"></div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">url地址</label>
<div class="col-sm-4">
<select id="goTo" name="goTo" class="form-control" value="[[goTo]]">
<option value="" selected="selected">选择跳转目的</option>
<option value="go.brand">品牌列表页</option>
<option value="go.productDetail">商品详情页</option>
<option value="go.coupon">优惠券页</option>
<option value="go.fav">收藏列表页</option>
<option value="go.mine">我的页面</option>
<option value="go.list">列表或搜索页</option>
<option value="go.attention">关注页</option>
<option value="go.plus">plus</option>
<option value="go.star">star</option>
<option value="go.new">新品到着页</option>
<option value="go.sale">折扣页</option>
<option value="go.share">分享</option>
<option value="go.h5">h5网页</option>
<option value="go.weblogin">h5网页调用本地登录</option>
<option value="go.guangchannel">逛频道</option>
<option value="go.gender">男女首页</option>
<option value="go.activity">app活动页</option>
<option value="go.home">频道首页</option>
<option value="go.yohood">YOHOOD</option>
<option value="go.top100">热销排行</option>
<option value="go.activitytemplate">活动模板</option>
<option value="go.globalpurchase">全球购</option>
<option value="go.subchannel">二级频道</option>
<option value="go.guangchannel">逛频道或SHOW晒单页</option>
<option value="go.showgoods">去晒单</option>
<option value="go.limitpurchase">尖货频道</option>
<option value="go.vippro">会员商品</option>
<option value="go.shortsize">断码页</option>
<option value="go.discountmarket">折扣专区</option>
<option value="go.discountmarketpro">折扣专区详情页</option>
<option value="go.signin">签到页</option>
<option value="go.playvideo">视频播放</option>
<option value="go.shop">店铺</option>
<option value="go.outletactivity">奥莱活动详情页</option>
<option value="go.newoutlet">奥莱频道页</option>
<option value="go.category">选择一级品类</option>
<option value="go.comm.postdetail">社区帖子详情页</option>
<option value="go.comm.forum">社区版块首页</option>
<option value="go.comm.h5">社区H5</option>
<option value="go.comm.productDetail">社区商品详情页</option>
<option value="go.videolive">直播详情页</option>
<option value="go.videoreplay">重播详情页</option>
<option value="go.newyohood">new YOHOOD</option>
<option value="go.myInstalment">分期</option>
<option value="go.blkbrandcategory">BLK品牌品类页</option>
<option value="go.findgoodgoods">发现好货</option>
</select>
</div>
<div class="col-sm-4">
<input type="text" id="url" name="url" value="[[url]]" class="form-control" placeholder="URL地址"/>
<p style="color:#999;margin-top: 5px;">注:链接中不能有英文单引号</p>
</div>
</div>
<div class="form-group" style="margin-bottom: 40px">
<label class="col-sm-2 control-label">物理类目关联:</label>
<div class="col-sm-8 sort-wrap">
... ...
/**
* Created by zhaojun on 17/3/15.
* 配置管理
*/
var $ = require('jquery');
common = require('../../../common/common');
var ENUM = {
StatusEnum: {
0: '失效',
1: '有效'
},
TypeEnum: {
1: '优惠卷',
2: '有货币'
}
};
//下拉框
new common.dropDown({
el: "#sel-status"
});
var g = new common.grid({
el: '#basicTable',
size: 10,
parms: function () {
return {
eventCode: common.util.__input('sel-eventCode'),
status: common.util.__input('sel-status')
};
},
columns: [
{
display: '配置名称',
name: "comments"
},
{
display: '配置编码',
name: "eventCode"
},
{
display: '配置属性',
name: "eventValue"
},
{
display: '业务类型',
render: function (item) {
return "<p>" + ENUM.TypeEnum[item.type] + "</p>";
}
},
{
display: '消息标题',
name: "msgTitle"
},
{
display: '消息内容',
name: "msgContent"
},
{
display: '状态',
render: function (item) {
return "<p>" + ENUM.StatusEnum[item.status] + "</p>";
}
},
{
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");
return "<p>" + formatted + "</p>";
}
else {
return "";
}
}
},
{
display: '操作',
name: "status",
render: function (items) {
var HtmArr = [];
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-primary btn-xs info-modify">编辑</a>');
return HtmArr.join('');
}
}]
});
g.init('/eventConfig/queryList');
//==================== 按钮点击事件 =====================//
$("#filter-btn").click(function () {
g.reload(1);
});
/**
* 监听输入框变化
*/
$(document).on("change", ".observe", function () {
var $this = $(this);
var name = $this.data("field");
Bll.module = common.util.__buildobj(name, '.', Bll.module, function (obj, name1) {
obj[name1] = $this.val();
});
});
/*验证*/
var edit = new common.edit2(".modal-body");
var Bll = {
module: null,
//弹框
toast: function (module, hint, url) {
Bll.module = module;
var d = new common.dialog({
title: hint + "配置管理",
content: common.util.__template2($("#template").html(), Bll.module),
width: '40%',
button: [
{
value: "保存",
callback: function () {
if (edit.validate()) {
common.util.__ajax({
url: url,
data: Bll.module
}, function (res) {
if (res.code == '200') {
g.reload();
d.close();
}
else {
common.util.__tip(res.message, "warning");
}
}, true);
}
return false;
},
css: "btn-primary"
},
{
"value": "取消",
"css": "btn-info"
}
]
});
Bll.__editRender();
},
__editRender: function () {
edit.init();
}
};
/**
* 编辑--点击事件
*/
$(document).on('click', '.info-modify', function () {
var item = g.rows[$(this).data("index")];
common.util.__ajax({
url: "/eventConfig/queryById",
data: {id: item.id}
}, function (res) {
Bll.toast(res.data, "修改", '/eventConfig/update');
}, true);
});
\ No newline at end of file
... ...