Authored by 陶雨

运营管理 -> 优惠券活动、Top100、公告管理、销售类目、app版本升级提醒

Showing 30 changed files with 1742 additions and 14 deletions
/**
* Created by ty on 2016/6/23.
* 优惠券活动
*/
module.exports=function(app) {
/*优惠券活动主界面*/
app.get("/couponActivity/index","operations.couponActivity.Index", function () {
this.$extend = {
moduleName: "优惠券活动管理",
pageName: "活动列表"
}
});
/*优惠券活动编辑界面*/
app.get("/couponActivity/index/update/:id","operations.couponActivity.Edit", function () {
this.$extend = {
moduleName: "优惠券活动管理",
pageName: "编辑活动"
}
});
/*优惠券活动添加界面*/
app.get("/couponActivity/index/add","operations.couponActivity.Add", function () {
this.$extend = {
moduleName: "优惠券活动管理",
pageName: "添加活动"
}
});
/*api请求数据*/
app.post("/couponActivity/queryList","couponActivity_queryList");
/*修改优惠券活动*/
app.post("/couponActivity/update","couponActivity_update");
/*单个优惠券活动查询*/
app.post("/couponActivity/queryById","couponActivity_queryById");
/*新增优惠券活动*/
app.post("/couponActivity/add","couponActivity_add");
}
\ No newline at end of file
... ...
/**
* Created by ty on 2016/6/23.
* Top100标签
*/
module.exports=function(app) {
/*公告管理首页*/
app.get("/hotRankTag/index","operations.hotRankTag.Index", function () {
this.$extend = {
moduleName: "运营管理",
pageName: "Top 100标签"
}
});
/*搜索词列表*/
app.post("/hotRankTag/selectTagList","hotRankTag_selectTagList");
/*添加搜索词*/
app.post("/hotRankTag/addTag","hotRankTag_addTag");
/*修改搜索词*/
app.post("/hotRankTag/updateTag","hotRankTag_updateTag");
/*发布搜索词*/
app.post("/hotRankTag/publishTag","hotRankTag_publishTag");
/*关闭搜索词*/
app.post("/hotRankTag/closeTag","hotRankTag_closeTag");
}
\ No newline at end of file
... ...
/**
* Created by ty on 2016/6/23.
* 公告管理
*/
module.exports=function(app) {
/*公告管理首页*/
app.get("/operations/notice/index","operations.notice.Index", function () {
this.$extend = {
moduleName: "公告管理",
pageName: "公告管理列表"
}
});
/*列表*/
app.post("/operations/notice/getList","notice_getList");
/*添加公告*/
app.post("/operations/notice/addNotice","notice_addNotice");
/*更改公告状态*/
app.post("/operations/notice/setStatus","notice_setStatus");
/*更新公告*/
app.post("/operations/notice/updateNotice","notice_updateNotice");
/*删除公告*/
app.post("/operations/notice/delNotice","notice_delNotice");
}
\ No newline at end of file
... ...
/**
* Created by ty on 2016/6/23.
* 销售类目
*/
module.exports=function(app) {
/*销售类目主页*/
app.get("/sale/category/index","operations.salecategory.Index", function () {
this.$extend = {
moduleName: "运营管理",
pageName: "销售类目管理",
gridurl: '/sale/salesCategory/querySCList'
}
});
/*标签管理页面*/
app.get("/sale/category/tag/:categoryId","operations.salecategory.TagMgmt", "salecategory_querySCById", function () {
this.$extend = {
moduleName: "运营管理",
pageName: "标签管理"
}
});
/*销售类目列表*/
app.post("/sale/salesCategory/querySCList","salecategory_querySCList");
/*根据id获取单个销售类目*/
app.post("/sale/salesCategory/querySCById","salecategory_querySCById");
/*标签管理列表数据接口*/
app.post("/sale/salesCategoryLabel/querySCLabelList","salecategory_querySCLabelList");
/*更新标签接口*/
app.post("/sale/salesCategoryLabel/updateSCLabel","salecategory_updateSCLabel");
/*更新销售类目接口*/
app.post("/sale/salesCategory/updateSC","salecategory_updateSC");
/*添加销售类目接口*/
app.post("/sale/salesCategory/addSC","salecategory_addSC");
/*开关销售类目*/
app.post("/sale/salesCategory/updateSCStatus","salecategory_updateSCStatus");
/*批量添加标签接口*/
app.post("/sale/salesCategoryLabel/addSCLabel","salecategory_addSCLabel");
}
\ No newline at end of file
... ...
/**
* Created by ty on 2016/6/23.
* APP版本更新管理
*/
module.exports=function(app) {
/*优惠券活动主界面*/
app.get("/operations/version/index","operations.version.Index", function () {
this.$extend = {
moduleName: "运营管理",
pageName: "APP版本更新管理"
}
});
/*APP版本升级提醒列表*/
app.post("/operations/version/appVersionList","version_appVersionList");
/*新增APP版本提醒*/
app.post("/operations/version/addAppVersion","version_addAppVersion");
/*修改APP版本提醒*/
app.post("/operations/version/editAppVersion","version_editAppVersion");
/*改变状态*/
app.post("/operations/version/publishAppVersion","version_publishAppVersion");
}
\ No newline at end of file
... ...
/**
* Created by ty on 2016/6/23.
* 优惠券活动
*/
module.exports={
namespace:"couponActivity",
apis:{
queryList:{
title: "优惠券活动列表",
url: '/couponActivity/queryList',
params: [
{name: 'page', type: 'Number'},
{name: 'size', type: 'Number'}
]
},
update:{
title: "修改优惠券活动",
url: '/couponActivity/update',
params: [
{name: 'id', type: 'Number'},//主键
{name: 'actName', type: 'string'},//
{name: 'activityType', type: 'Number'},//
{name: 'actUrl', type: 'string'},
{name: 'startTime', type: 'Number'},//
{name: 'endTime', type: 'Number'},//
{name: 'bgImageUrl', type: 'string'},//
{name: 'shareTitle', type: 'string'},//
{name: 'shareDescribe', type: 'string'},//
{name: 'sharePic', type: 'string'},//
{name: 'shareUrl', type: 'string'},//
{name: 'isVerify', type: 'string'},//
{name: 'instructions', type: 'string'},//
{name: 'isNewUser', type: 'Number'},//
{name: 'couponId', type: 'string'},//
{name: 'status', type: 'Number'}//
]
},
add:{
title: "新增优惠券活动",
url: '/couponActivity/add',
params: [
{name: 'actName', type: 'string'},//
{name: 'activityType', type: 'Number'},//
{name: 'actUrl', type: 'string'},
{name: 'startTime', type: 'Number'},//
{name: 'endTime', type: 'Number'},//
{name: 'bgImageUrl', type: 'string'},//
{name: 'shareTitle', type: 'string'},//
{name: 'shareDescribe', type: 'string'},//
{name: 'sharePic', type: 'string'},//
{name: 'shareUrl', type: 'string'},//
{name: 'isVerify', type: 'string'},//
{name: 'instructions', type: 'string'},//
{name: 'isNewUser', type: 'Number'},//
{name: 'couponId', type: 'string'}//
]
},
queryById:{
title: "单个优惠券活动查询",
url: '/couponActivity/queryById',
params: [
{name: 'id', type: 'Number'}
]
}
}
}
\ No newline at end of file
... ...
/**
* Created by ty on 2016/6/23.
* Top100标签
*/
module.exports={
namespace:"hotRankTag",
apis:{
selectTagList:{
title: "搜索词列表",
url: '/hotRankTag/selectTagList',
params: [
{name: 'page', type: 'Number', def: '1'},
{name: 'size', type: 'Number', def: '10'},
{name: 'platform', type: 'String'},//平台
{name: 'channel', type: 'String'},//频道
{name: 'status', type: 'Number'}
]
},
addTag:{
title: "添加搜索词",
url: '/hotRankTag/addTag',
params: [
{name: 'tagName', type: 'String'},
{name: 'categoryId', type: 'String'},
{name: 'platform', type: 'String'},
{name: 'channel', type: 'String'},
{name: 'orderBy', type: 'Number'}
]
},
updateTag:{
title: "修改搜索词",
url: '/hotRankTag/updateTag',
params: [
{name: 'id', type: 'Number'},
{name: 'tagName', type: 'String'},
{name: 'categoryId', type: 'String'},
{name: 'platform', type: 'String'},
{name: 'channel', type: 'String'},
{name: 'orderBy', type: 'Number'}
]
},
publishTag:{
title: "发布搜索词",
url: '/hotRankTag/publishTag',
params: [
{name: 'id', type: 'Number'}
]
},
closeTag:{
title: "关闭搜索词",
url: '/hotRankTag/closeTag',
params: [
{name: 'id', type: 'Number'}
]
}
}
}
\ No newline at end of file
... ...
/**
* Created by ty on 2016/6/23.
* 公告管理
*/
module.exports={
namespace:"notice",
apis:{
getList:{
title: "获取公告列表",
url: '/notice/getList',
params: [
{name: 'page', type: 'number'},
{name: 'size', type: 'number'},
{name: 'title', type: 'string'},
{name: 'position', type: 'Number'},
{name: 'showChannel', type: 'string'}
]
},
addNotice:{
title: "添加公告",
url: '/notice/addNotice',
params: [
{name: 'title', type: 'string'},
{name: 'position', type: 'Number'},
{name: 'showChannels', type: 'string'},
{name: 'url', type: 'string'},
{name: 'img', type: 'string'},
{name: 'startTime', type: 'Number'},
{name: 'endTime', type: 'Number'}
]
},
setStatus:{
title: "更改公告状态",
url: '/notice/setStatus',
params: [
{name: 'id', type: 'Number'},
{name: 'status', type: 'Number'}
]
},
updateNotice:{
title: "更新公告",
url: '/notice/updateNotice',
params: [
{name: 'id', type: 'Number'},
{name: 'title', type: 'string'},
{name: 'position', type: 'Number'},
{name: 'showChannels', type: 'string'},
{name: 'url', type: 'string'},
{name: 'img', type: 'string'},
{name: 'startTime', type: 'Number'},
{name: 'endTime', type: 'Number'}
]
},
delNotice:{
title: "删除公告",
url: '/notice/delNotice',
params: [
{name: 'id', type: 'Number'}
]
}
}
}
\ No newline at end of file
... ...
/**
* Created by ty on 2016/6/23.
* 销售类目
*/
module.exports={
namespace:"salecategory",
apis:{
querySCList:{
title: "销售类目列表",
url: '/salesCategory/querySCList',
params: [
{name: 'state', type: 'string'}
]
},
querySCById:{
title: "根据id获取单个销售类目",
url: '/salesCategory/querySCById',
params:[
{name: 'categoryId', type: 'number'}
]
},
querySCLabelList:{
title: "标签管理列表数据接口",
url: '/salesCategoryLabel/querySCLabelList',
params: [
{name: 'categoryId', type: 'string'},
{name: 'status', type: 'string'}
]
},
updateSCLabel:{
title: "更新标签接口",
url: '/salesCategoryLabel/updateSCLabel',
params: [
{name: 'labelId', type: 'string'},
{name: 'labelName', type: 'string'},
{name: 'categoryId', type: 'string'},
{name: 'orderBy', type: 'string'},
{name: 'status', type: 'string'},
{name: 'id', type: 'string'}
]
},
addSC:{
title: "添加销售类目接口",
url: '/salesCategory/addSC',
params: [
{name: 'categoryName', type: 'string'},
{name: 'relationParameter', type: 'string'},
{name: 'relationUrl', type: 'string'},
{name: 'parentId', type: 'string'},
{name: 'orderBy', type: 'string'},
{name: 'icon', type: 'string'}
]
},
updateSC:{
title: "更新销售类目接口",
url: '/salesCategory/updateSC',
params: [
{name: 'categoryId', type: 'string'},
{name: 'categoryName', type: 'string'},
{name: 'relationParameter', type: 'string'},
{name: 'relationUrl', type: 'string'},
{name: 'parentId', type: 'string'},
{name: 'orderBy', type: 'string'},
{name: 'icon', type: 'string'},
{name: 'state', type: 'string'}
]
},
updateSCStatus:{
title: "开关销售类目",
url: '/salesCategory/updateSCStatus',
params: [
{name: 'categoryId', type: 'string'},
{name: 'state', type: 'string'}
]
},
addSCLabel:{
title: "批量添加标签接口",
url: '/salesCategoryLabel/addSCLabel',
params: [
{name: 'labelName', type: 'string'},
{name: 'categoryId', type: 'string'},
{name: 'parentId', type: 'string'},
{name: 'orderBy', type: 'string'},
{name: 'labelLevel', type: 'string'},
{name: 'status', type: 'string'}
]
}
}
}
\ No newline at end of file
... ...
/**
* Created by ty on 2016/6/23.
* APP版本更新管理
*/
module.exports={
namespace:"version",
apis:{
appVersionList:{
title: "APP版本升级提醒列表",
url: '/version/appVersionList',
params: [
{name: "page", type: "number"}
]
},
addAppVersion:{
title: "新增APP版本提醒",
url: '/version/addAppVersion',
params: [
{name: "version", type: "string"},
{name: "clientType", type: "string"},
{name: "content", type: "string"},
{name: "url", type: "string"}
]
},
editAppVersion:{
title: "修改APP版本提醒",
url: '/version/editAppVersion',
params: [
{name: "id", type: "number"},
{name: "version", type: "string"},
{name: "clientType", type: "string"},
{name: "content", type: "string"},
{name: "url", type: "string"}
]
},
publishAppVersion:{
title: "改变状态",
url: '/version/publishAppVersion',
params: [
{name: "id", type: "number"},
{name: "status", type: "number"}
]
}
}
}
\ No newline at end of file
... ...
<%include '../../../common/views/__ui/header'%>
<%include '../../../common/views/__partail/ListHeader'%>
<div class="contentpanel">
<div class="row">
<div class="col-md-12">
<div id="basicForm" class="form-horizontal form-bordered">
</div>
</div>
</div>
</div>
<script type="text/template" id="couponListAdd-template">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">添加活动</h4>
</div>
<div class="panel-body">
<div class="row">
<div class="form-group">
<label class="col-sm-2 control-label">活动名称 <span class="red">*</span></label>
<div class="col-sm-8">
<input type="text" placeholder="活动名称" prompt="活动名称" class="form-control observe"
data-field="actName" required maxlength="30" value="[[actName]]">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">活动类型 </label>
<div class="col-sm-8">
<select id="filter-activityType" tabindex="-1" class="select2-offscreen brandBtn-group observe"
value="[[activityType]]" data-field="activityType" >
<option value="-1">活动类型</option>
<option value="1">普通活动</option>
<option value="2">APP活动</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">活动地址</label>
<div class="col-sm-8">
<input type="text" placeholder="活动地址" class="form-control observe number" data-field="actUrl"
value="[[actUrl]]">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">活动时间</label>
<div class="col-sm-6">
<div class="col-sm-6">
<input type="text" class="form-control observe" data-field="startTime" id="startTime"
placeholder="开始时间" value="[[startTime]]" readonly >
</div>
<div class="col-sm-6">
<input type="text" class="form-control observe" data-field="endTime" id="endTime"
placeholder="结束时间" value="[[endTime]]" readonly >
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">背景图片</label>
<div class="col-sm-8">
<input type="file" bucket="couponBgImg" placeholder="背景图片" class="form-control"
data-field="bgImageUrl" value="[[bgImageUrl]]" name="couponBgImg">
<p>图片不是必选项 ,活动类型为APP活动时添加</p>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">分享标题</label>
<div class="col-sm-8">
<input type="text" placeholder="分享标题" prompt="名称" class="form-control observe"
data-field="shareTitle" maxlength="30" value="[[shareTitle]]">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">分享描述</label>
<div class="col-sm-8">
<textarea class="form-control observe" prompt="分享描述" data-field="shareDescribe" maxlength="100"
placeholder="分享描述" style="resize: none">[[shareDescribe]]</textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">分享图片</label>
<div class="col-sm-8">
<input type="file" bucket="couponImage" class="form-control"
data-field="sharePic" value="[[sharePic]]" name="couponImage">
<p>支持jpg/png/gif,建议尺寸:640 x 1038,图片不是必选项</p>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">分享地址</label>
<div class="col-sm-8">
<input type="text" placeholder="分享地址" class="form-control observe number" data-field="shareUrl"
value="[[shareUrl]]">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">是否授权</label>
<div class="col-sm-8">
<label style="cursor: pointer;"><input type="radio" name="isVerify" value="Y" class="observe" data-field="isVerify"></label>
<label style="cursor: pointer;"><input type="radio" name="isVerify" value="N" class="observe" data-field="isVerify"></label>
</div>
<input type="hidden" id="isVerify" value="[[isVerify]]" for="radio" data-field="isVerify">
</div>
<div class="form-group">
<label class="col-sm-2 control-label">活动说明</label>
<div class="col-sm-8">
<textarea class="form-control observe" prompt="分享描述" data-field="instructions" maxlength="100"
placeholder="分享描述" style="resize: none">[[instructions]]</textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">限制新老客户</label>
<div class="col-sm-8">
<label style="cursor: pointer;"><input type="radio" name="isNewUser" value="0" class="observe" data-field="isNewUser">不限制</label>
<label style="cursor: pointer;"><input type="radio" name="isNewUser" value="1" class="observe" data-field="isNewUser">限制新用户</label>
</div>
<input type="hidden" id="isNewUser" value="[[isNewUser]]" for="radio" data-field="isNewUser">
</div>
[[each couponIds as item index]]
<div class="form-group">
<label class="col-sm-2 control-label">优惠券</label>
<div class="col-sm-2">
<input type="text" id="couponId" class="form-control observe" value="[[item.id]]"
placeholder="ID" data-field="couponIds.[[index]].id">
</div>
<div class="col-sm-2">
<a class="col-sm-4 btn btn-primary addBtn" data-index="[[index]]">+</a>
<a class="col-sm-4 col-sm-offset-2 btn btn-danger delBtn" data-index="[[index]]">-</a>
</div>
</div>
[[/each]]
</div>
</div>
<div class="panel-footer">
<div class="row">
<div class="col-sm-8 col-sm-offset-2">
<a href="javascript:;" onclick="history.go(-1);" class="btn btn-default">取消</a>
<button id="save_brand" type="button" data-loading-text="保存中..." class="btn btn-primary">保存</button>
</div>
</div>
</div>
</div>
</script>
... ...
<%include '../../../common/views/__ui/header'%>
<%include '../../../common/views/__partail/ListHeader'%>
<div class="contentpanel">
<div class="row">
<div class="col-md-12">
<div id="basicForm" class="form-horizontal form-bordered">
</div>
</div>
</div>
</div>
<script type="text/template" id="couponListAdd-template">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">添加活动</h4>
</div>
<div class="panel-body">
<div class="row">
<div class="form-group">
<label class="col-sm-2 control-label">活动名称 <span class="red">*</span></label>
<div class="col-sm-8">
<input type="text" placeholder="活动名称" prompt="活动名称" class="form-control observe"
data-field="actName" required maxlength="30" value="[[actName]]">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">活动类型 </label>
<div class="col-sm-8">
<select id="filter-activityType" tabindex="-1" class="select2-offscreen brandBtn-group observe"
value="[[activityType]]" data-field="activityType" >
<option value="-1">活动类型</option>
<option value="1">普通活动</option>
<option value="2">APP活动</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">活动地址</label>
<div class="col-sm-8">
<input type="text" placeholder="活动地址" class="form-control observe number" data-field="actUrl"
value="[[actUrl]]">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">活动时间</label>
<div class="col-sm-6">
<div class="col-sm-6">
<input type="text" class="form-control observe" data-field="startTime" id="startTime"
placeholder="开始时间" value="[[startTime]]" readonly >
</div>
<div class="col-sm-6">
<input type="text" class="form-control observe" data-field="endTime" id="endTime"
placeholder="结束时间" value="[[endTime]]" readonly >
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">背景图片</label>
<div class="col-sm-8">
<input type="file" bucket="couponBgImg" placeholder="背景图片" class="form-control observe"
data-field="bgImageUrl" value="[[bgImageUrl]]" name="couponBgImg">
<p>图片不是必选项 ,活动类型为APP活动时添加</p>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">分享标题</label>
<div class="col-sm-8">
<input type="text" placeholder="分享标题" prompt="名称" class="form-control observe"
data-field="shareTitle" maxlength="30" value="[[shareTitle]]">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">分享描述</label>
<div class="col-sm-8">
<textarea class="form-control observe" prompt="分享描述" data-field="shareDescribe" maxlength="100"
placeholder="分享描述" style="resize: none">[[shareDescribe]]</textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">分享图片</label>
<div class="col-sm-8">
<input type="file" bucket="couponImage" class="form-control observe"
data-field="sharePic" value="[[sharePic]]" name="couponImage">
<p>支持jpg/png/gif,建议尺寸:640 x 1038,图片不是必选项</p>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">分享地址</label>
<div class="col-sm-8">
<input type="text" placeholder="分享地址" class="form-control observe number" data-field="shareUrl"
value="[[shareUrl]]">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">是否授权</label>
<div class="col-sm-8">
<label style="cursor: pointer;"><input type="radio" name="isVerify" value="Y" class="observe" data-field="isVerify"></label>
<label style="cursor: pointer;"><input type="radio" name="isVerify" value="N" class="observe" data-field="isVerify"></label>
</div>
<input type="hidden" id="isVerify" value="[[isVerify]]" for="radio" data-field="isVerify">
</div>
<div class="form-group">
<label class="col-sm-2 control-label">活动说明</label>
<div class="col-sm-8">
<textarea class="form-control observe" prompt="分享描述" data-field="instructions" maxlength="100"
placeholder="分享描述" style="resize: none">[[instructions]]</textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">限制新老客户</label>
<div class="col-sm-8">
<label style="cursor: pointer;"><input type="radio" name="isNewUser" value="0" class="observe" data-field="isNewUser">不限制</label>
<label style="cursor: pointer;"><input type="radio" name="isNewUser" value="1" class="observe" data-field="isNewUser">限制新用户</label>
</div>
<input type="hidden" id="isNewUser" value="[[isNewUser]]" for="radio" data-field="isNewUser">
</div>
[[each couponIds as item index]]
<div class="form-group">
<label class="col-sm-2 control-label">优惠券</label>
<div class="col-sm-2">
<input type="text" id="couponId" class="form-control observe" value="[[item.id]]"
placeholder="ID" data-field="couponIds.[[index]].id">
</div>
<div class="col-sm-2">
<a class="col-sm-4 btn btn-primary addBtn" data-index="[[index]]">+</a>
<a class="col-sm-4 col-sm-offset-2 btn btn-danger delBtn" data-index="[[index]]">-</a>
</div>
</div>
[[/each]]
</div>
</div>
<div class="panel-footer">
<div class="row">
<div class="col-sm-8 col-sm-offset-2">
<a href="javascript:;" onclick="history.go(-1);" class="btn btn-default">取消</a>
<button id="save_brand" type="button" data-loading-text="保存中..." class="btn btn-primary">保存</button>
</div>
</div>
</div>
</div>
</script>
... ...
<%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">
<a id="add-btn" href="/couponActivity/index/add" class="btn btn-info">添加活动</a>
</div>
<div id="content-list">
</div>
</div>
</div>
... ...
<%include '../../../common/views/__ui/header'%>
<%include '../../../common/views/__partail/ListHeader'%>
<div class="contentpanel">
<div class="panel panel-default" style="...">
<div class="panel-body">
<a id="add-btn" href="javascript:;" class="btn btn-info">添加</a>
</div>
<div class="panel-body">
<div class="row">
<div class="panel-col">
<select id="status-filter" class="select2-offscreen form-control">
<option value="">选择状态</option>
<option value="0">关闭</option>
<option value="1">开启</option>
</select>
</div>
<div class="panel-col">
<select id="platform-filter" class="select2-offscreen form-control">
<option value="">选择平台</option>
<option value="iphone">IOS手机</option>
<option value="ipad">IOS Pad</option>
<option value="android">安卓手机</option>
<option value="androidpad">安卓Pad</option>
<option value="h5">手机网站</option>
<option value="web">网站</option>
<option value="platform">平台</option>
</select>
</div>
<div class="panel-col">
<select id="channel-filter" class="select2-offscreen form-control">
<option value="">选择频道</option>
<option value="1">男生</option>
<option value="2">女生</option>
<option value=" 3"> 潮童</option>
<option value="4">创意家居</option>
</select>
</div>
<div class="panel-col">
<a id="filter-btn" href="javascript:;" class="btn btn-info">查询</a>
<a id="filter-all" href="/hotRankTag/index" class="btn btn-info">全部</a>
</div>
</div>
</div>
</div>
<div id="content-list"></div>
</div>
<!--编辑模态-->
<script type="text/template" id="template">
<div class="rows" id="baseform">
<div class="form-group">
<label class="col-sm-2 control-label">标签名称<i class="red">*</i></label>
<div class="col-sm-10">
<input type="text" value="[[tagName]]" class="form-control observe" data-field="tagName"
placeholder="标签名称" required="required"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">分类ID</label>
<div class="col-sm-10">
<input type="text" value="[[categoryId]]" class="form-control observe" data-field="categoryId"
placeholder="分类ID"/>
<p class="red">注:多个ID用“,”隔开</p>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">显示平台<i class="red">*</i></label>
<div class="col-sm-10">
<input type="checkbox" name="platform" data-field="platform" value="iphone"/>IOS手机
<input type="checkbox" name="platform" data-field="platform" value="ipad"/>IOS Pad
<input type="checkbox" name="platform" data-field="platform" value="android"/>安卓手机
<input type="checkbox" name="platform" data-field="platform" value="androidpad"/>安卓Pad
<input type="checkbox" name="platform" data-field="platform" value="h5"/>手机网站
<input type="checkbox" name="platform" data-field="platform" value="web"/>网站
<input type="checkbox" name="platform" data-field="platform" value="platform"/>平台
</div>
<input type="hidden" id="platform" class="observe" value="[[platform]]" for="checkbox" data-field="platform"
placeholder="显示平台">
</div>
<div class="form-group">
<label class="col-sm-2 control-label">显示频道<i class="red">*</i></label>
<div class="col-sm-8 ">
<input type="radio" name="channel" class="observe" data-field="channel" value="1">男生
<input type="radio" name="channel" class="observe" data-field="channel" value="2">女生
<input type="radio" name="channel" class="observe" data-field="channel" value="3">潮童
<input type="radio" name="channel" class="observe" data-field="channel" value="4">创意家居
</div>
<input type="hidden" id="channel" value="[[channel]]" for="radio" class="observe" data-field="channel"
placeholder="显示频道" required/>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">排序</label>
<div class="col-sm-10">
<input type="text" value="[[orderBy]]" class="form-control observe" data-field="orderBy"
placeholder="排序" required/>
</div>
</div>
</div>
</script>
... ...
<%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-heading">
<a href="/limit/product/add" class="btn btn-success "><i class="fa fa-plus"></i> 添加</a>
</div>
<div class="panel-body">
<div class="row">
<div class="panel-col2">
<input id="product-name" class="form-control panel-input" type="text" placeholder="请输入名称">
</div>
<div class="panel-col2">
<input id="skn" class="form-control panel-input" type="text" placeholder="请输入SKN">
</div>
<div class="panel-col">
<label class="control-label pull-left">是否开启:</label>
<div class="label-leading pull-left">
<label class="radio-inline"><input type="radio" name="showFlag" value="1"></label>
<label class="radio-inline"><input type="radio" name="showFlag" value="0"></label>
</div>
</div>
<!-- <div class="panel-col">
<label class="control-label pull-left">热门:</label>
<div class="label-leading pull-left">
<label class="radio-inline"><input type="radio" name="hotFlag" value="1">是</label>
<label class="radio-inline"><input type="radio" name="hotFlag" value="0">否</label>
</div>
</div>
<div class="panel-col">
<label class="control-label pull-left">是否发售:</label>
<div class="label-leading pull-left">
<label class="radio-inline"><input type="radio" name="saleFlag" value="1">是</label>
<label class="radio-inline"><input type="radio" name="saleFlag" value="0">否</label>
</div>
</div> -->
<a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a>
<a id="all-btn" href="" class="btn btn-info">全部</a>
<a id="export-btn" href="javascript:;" class="btn btn-info">导出</a>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12 mt20">
<div class="dataTab_wrapper" id="basicTab"></div>
<div id="limit-table-box" class="table-responsive"></div>
</div>
</div>
</div>
... ...
<%include '../../../common/views/__ui/header'%>
<%include '../../../common/views/__partail/ListHeader'%>
<div class="panel panel-default" style="margin-bottom:10px;">
<div class="panel-heading">
<a class="btn btn-success " id="add-notice"><i class="fa fa-plus"></i> 创建公告</a>
</div>
<div class="panel-body">
<div class="row">
<div class="panel-col">
<input type="text" placeholder="公告标题" id="notice-title" class="form-control" />
</div>
<div class="panel-col">
<select name="position" id="notice-position" tabindex="-1" title="" class="select2-offscreen brandBtn-group">
<option value="" selected="">位置</option>
<option value="1">首页</option>
<option value="2">个人中心</option>
</select>
</div>
<a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a>
<a id="filter-all" href="/operations/notice/index" class="btn btn-info">全部</a>
</div>
</div>
<div id="notice-list"></div>
</div>
<script type="text/template" id="template">
<div class="rows" id="baseform">
<div class="form-group">
<label class="col-sm-2 control-label" for="title">公告标题</label>
<input type="hidden" value="{id}" id="id" />
<div class="col-sm-10">
<input type="text" value="{title}" class="form-control" id="title" required="required" placeholder="公告标题" required="required" />
<p style="color:#999;margin-top: 5px;">注:请控制在15个字之内,多余15个字,5s等手机屏幕前台会显示不全。</p>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="position">公告位置</label>
<div class="col-sm-5">
<select name="position" id="position" tabindex="-1" title="" class="select2-offscreen brandBtn-group" value="{position}" required="required">
<option value="" selected="">请选择</option>
<option value="1">首页</option>
<option value="2">个人中心</option>
</select>
</div>
<div id="showchannel" class="col-sm-5">
<label style="cursor: pointer;"><input type="checkbox" name="showChannels" value="1">男首</label>
<label style="cursor: pointer;"><input type="checkbox" name="showChannels" value="2">女首</label>
<label style="cursor: pointer;"><input type="checkbox" name="showChannels" value="3">潮童</label>
<label style="cursor: pointer;"><input type="checkbox" name="showChannels" value="4">创意生活</label>
</div>
<input type="hidden" id="showChannels" value="{showChannels}" for="checkbox">
</div>
<div class="form-group">
<label class="col-sm-2 control-label">url地址</label>
<div class="col-sm-4">
<select id="intent" name="goTo" class="form-control" >
<option value="">选择跳转目的</option>
<option value="brand">品牌列表页</option>
<option value="productDetail">商品详情页</option>
<option value="coupon">优惠券页</option>
<option value="fav">收藏列表页</option>
<option value="mine">我的页面</option>
<option value="list">列表或搜索页</option>
<option value="attention">关注页</option>
<option value="plus">plus</option>
<option value="star">star</option>
<option value="new">新品到着页</option>
<option value="sale">折扣页</option>
<option value="h5">h5网页</option>
<option value="guangchannel">逛频道</option>
<option value="gender">男女首页</option>
<option value="activity">app活动页</option>
<option value="home">频道首页</option>
<option value="yohood">YOHOOD</option>
<option value="top100">热销排行</option>
<option value="activitytemplate">活动模板</option>
<option value="globalpurchase">全球购</option>
<option value="subchannel">二级频道</option>
<option value="guangchannel">逛频道或SHOW晒单页</option>
<option value="showgoods">去晒单</option>
<option value="limitpurchase">尖货频道</option>
<option value="vippro">会员商品</option>
<option value="shortsize">断码页</option>
<option value="discountmarket">折扣专区</option>
<option value="discountmarketpro">折扣专区详情页</option>
</select>
</div>
<div class="col-sm-4">
<input id="url" value="{url}" class="form-control" placeholder="URL地址" />
<p style="color:#999;margin-top: 5px;">注:链接中不能有英文单引号</p>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">图片</label>
<div class="col-sm-10">
<input type="file" id="img" name="img" value="{img}" />
</div>
</div>
<div class="form-group col-sm-100">
<label class="col-sm-2 control-label">活动时间</label>
<div class="panel-col1 col-sm-4">
<input type="text" id="startTime" jsaction="time:end:endTime" readonly class="form-control panel-input hasDatepicker " name="start_time" placeholder="开始时间" value="{startTime}">
</div>
<div class="panel-col1 col-sm-4">
<input type="text" id="endTime" jsaction="time:start:startTime" readonly class="form-control panel-input hasDatepicker" name="end_time" placeholder="结束时间" value="{endTime}">
</div>
</div>
</div>
</script>
\ No newline at end of file
... ...
<%include '../../../common/views/__ui/header'%>
<%include '../../../common/views/__partail/ListHeader'%>
<div class="contentpanel">
<div class="panel panel-default">
<div class="panel-body nopadding">
<div class="state-select" style="position: relative">
<strong>状态:</strong>
<label><input type="radio" name="state" value="">全部</label>
<label class="current"><input type="radio" name="state" value="1">开启</label>
<label><input type="radio" name="state" value="0">关闭</label>
<button type="button" class="btn btn-primary" onclick="location.href='/sale/category/index'" style="position: absolute; top: 2px; right: 20px"> 返回 </button>
</div>
</div>
</div>
<div class="panel">
<div class="panel-body nopadding">
<div class="dataTables_wrapper no-footer" id="basicTable"></div>
<%if data%>
<input id="categoryId" type="hidden" value="<%categoryId%>">
<%/if%>
</div>
</div>
</div>
... ...
<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>
<h4>销售类目编辑</h4>
</div>
</div>
</div>
<div class="contentpanel">
<div class="panel panel-default">
<div class="panel-heading">
<h2 class="panel-title">销售类目编辑</h2>
</div>
<div class="panel-body">
<form id="basicForm" role="form" action="{{action}}" class="form-horizontal form-bordered">
{{# data}}
{{#unless addRootCategory}}
<div class="form-group">
<label class="col-sm-2 control-label">父分类</label>
<div class="col-sm-8 height40">{{# parentSC}}{{categoryName}}{{# items}}-{{categoryName}}{{/ items}}{{/ parentSC}}</div>
</div>
{{/unless}}
<div class="form-group">
<label class="col-sm-2 control-label">分类名称</label>
<div class="col-sm-8"><input type="text" id="categoryName" name="categoryName" class="form-control" placeholder="分类名称" value="{{categoryName}}"></div>
</div>
<div class="form-group">
<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">物理类目关联</label>
<div class="col-sm-8 sort-wrap">
<div class="row">
<div class="col-sm-4">
<div class="sortTree"></div>
</div>
<div class="col-sm-2 height40">
<a class="btn btn-danger btn-xs del-sort-btn" style="display: none;" href="javascript:;">-</a>
<a class="btn btn-info btn-xs add-sort-btn" href="javascript:;">+</a>
</div>
</div>
</div>
</div>
<input id="parentId" type="hidden" value="{{parentId}}">
{{/ data}}
</form>
</div>
<div class="panel-footer">
<div class="col-sm-8 col-sm-offset-2">
<a id="save_brand" data-loading-text="保存中..." class="btn btn-primary" href="javascript:;">保存</a>
<a href="javascript:;" onclick="history.go(-1);" class="btn btn-danger">取消</a>
</div>
</div>
</div>
</div>
<script type="text/template" id="sortWrap">
<div class="row">
<div class="col-sm-6">
<div class="sortTree"></div>
</div>
<div class="col-sm-2 height40">
<a class="btn btn-danger btn-xs del-sort-btn" href="javascript:;">-</a>
<a class="btn btn-info btn-xs add-sort-btn" href="javascript:;">+</a>
</div>
</div>
</script>
\ 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:10px 0; display: none">
<div class="panel-body nopadding">
<div class="state-select">
<strong>状态:</strong>
<label><input type="radio" name="state" value="">全部</label>
<label class="current"><input type="radio" name="state" value="1">开启</label>
<label><input type="radio" name="state" value="0">关闭</label>
</div>
</div>
</div>
<a href="javascript:;" id="add-root-category" class="btn btn-success" style="margin:10px 0;"><i class="fa fa-plus"></i> 添加根分类</a>
<div class="panel">
<div class="panel-body nopadding">
<div class="sale-category-table dataTables_wrapper no-footer" id="basicTable"></div>
</div>
</div>
</div>
<input type="hidden" id="gridurl" value="<%gridurl%>">
<script type="text/template" id="editTemp">
<div class="panel">
<div class="panel-body nopadding">
<form id="basicForm" role="form" action="[[action]]" class="form-horizontal form-bordered">
<div class="form-group" style="padding-top: 0">
<label class="col-sm-2 control-label">父分类:</label>
<div class="col-sm-8 height40">[[parentName]]</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">分类名称:</label>
<div class="col-sm-8">
<div class="form-inline">
<input type="text" id="categoryName" name="categoryName" class="form-control" placeholder="分类名称" value="[[categoryName]]" style="width: 450px">
<label style="color: #ff0000; line-height: 40px; margin-left: 15px"> * 必填</label>
</div>
</div>
</div>
<div class="form-group">
<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" style="margin-bottom: 40px">
<label class="col-sm-2 control-label">物理类目关联:</label>
<div class="col-sm-8 sort-wrap">
<div class="row">
<div class="col-sm-10">
<div class="sortTree"></div>
</div>
<div class="col-sm-2 height40">
<a class="btn btn-danger btn-xs del-sort-btn" href="javascript:;">-</a>
<a class="btn btn-info btn-xs add-sort-btn" href="javascript:;">+</a>
</div>
</div>
</div>
</div>
<input id="categoryId" type="hidden" value="[[categoryId]]">
<input id="parentId" type="hidden" value="[[parentId]]">
<input id="orderBy" type="hidden" value="[[orderBy]]">
</form>
</div>
</div>
</script>
<script type="text/template" id="sortWrap">
<div class="row">
<div class="col-sm-10">
<div class="sortTree"></div>
</div>
<div class="col-sm-2 height40">
<a class="btn btn-danger btn-xs del-sort-btn" href="javascript:;">-</a>
<a class="btn btn-info btn-xs add-sort-btn" href="javascript:;">+</a>
</div>
</div>
</script>
<script type="text/template" id="tableHdTemp">
<div class="level-hd clearfix">
<span class="folder"></span>
<span style="width: 5%">ID</span>
<span style="width: 20%">品类名称</span>
<span>所属分类</span>
<span>分类图标</span>
<span class="orderby">排序</span>
<span class="status">状态</span>
<span class="operate">操作</span>
</div>
</script>
<script type="text/template" id="tableTemp">
<div class="level-1-wrap">
<div class="level-wrap clearfix">
<span class="folder"></span>
<span>[[categoryId]]</span>
<span>[[categoryName]]</span>
<span>一级分类</span>
<span><img src="[[icon]]" alt=""></span>
<span class="orderby"> <input type="text" class="form-control saleCategoryNumInput" value="[[orderBy]]" categoryId="[[categoryId]]" /></span>
<span class="status">
[[if state=="1"]]
开启
[[/if]]
[[if state=="0"]]
关闭
[[/if]]
</span>
<span class="operate" data-id="[[categoryId]]" data-name="[[categoryName]]">
<a class="btn btn-info btn-xs edit-btn" href="javascript:;">编辑</a>
<a class="btn btn-success btn-xs tagmgmt-btn" href="/sale/category/tag/[[categoryId]]">标签管理</a>
<a class="btn btn-info btn-xs add-sub-category" href="javascript:;">添加子分类</a>
[[if state=="1"]]
<a class="btn btn-danger btn-xs close-category" href="javascript:;">关闭</a>
[[/if]]
[[if state=="0"]]
<a class="btn btn-warning btn-xs open-category" href="javascript:;">开启</a>
[[/if]]
</span>
[[if items]]
<div class="level-2-wrap">
[[each items as a index]]
<div class="level-wrap clearfix">
<span class="folder"></span>
<span>[[a.categoryId]]</span>
<span>[[a.categoryName]]</span>
<span>二级分类</span>
<span><img src="[[a.icon]]" alt=""></span>
<span class="orderby"><input type="text" class="form-control saleCategoryNumInput" value="[[a.orderBy]]" categoryId="[[a.categoryId]]" /></span>
<span class="status">
[[if a.state=="1"]]
开启
[[/if]]
[[if a.state=="0"]]
关闭
[[/if]]
</span>
<span class="operate" data-id="[[a.categoryId]]" data-name="[[a.categoryName]]">
<a class="btn btn-info btn-xs edit-btn" href="javascript:;">编辑</a>
<a class="btn btn-success btn-xs tagmgmt-btn" href="/sale/category/tag/[[a.categoryId]]">标签管理</a>
<a class="btn btn-info btn-xs add-sub-category" href="javascript:;">添加子分类</a>
[[if a.state=="1"]]
<a class="btn btn-danger btn-xs close-category" href="javascript:;">关闭</a>
[[/if]]
[[if a.state=="0"]]
<a class="btn btn-warning btn-xs open-category" href="javascript:;">开启</a>
[[/if]]
</span>
[[if a.items]]
<div class="level-3-wrap">
[[each a.items as b index]]
<div class="level-wrap clearfix">
<span class="folder"></span>
<span>[[b.categoryId]]</span>
<span>[[b.categoryName]]</span>
<span>三级分类</span>
<span><img src="[[b.icon]]" alt=""></span>
<span class="orderby"><input type="text" class="form-control saleCategoryNumInput" value="[[b.orderBy]]" categoryId="[[b.categoryId]]" /></span>
<span class="status">
[[if b.state=="1"]]
开启
[[/if]]
[[if b.state=="0"]]
关闭
[[/if]]
</span>
<span class="operate" data-id="[[b.categoryId]]" data-name="[[b.categoryName]]">
<a class="btn btn-info btn-xs edit-btn" href="javascript:;">编辑</a>
<a class="btn btn-success btn-xs tagmgmt-btn" href="/sale/category/tag/[[b.categoryId]]">标签管理</a>
<a class="btn btn-info btn-xs add-sub-category" href="javascript:;">添加子分类</a>
[[if b.state=="1"]]
<a class="btn btn-danger btn-xs close-category" href="javascript:;">关闭</a>
[[/if]]
[[if b.state=="0"]]
<a class="btn btn-warning btn-xs open-category" href="javascript:;">开启</a>
[[/if]]
</span>
</div>
[[/each]]
</div>
[[/if]]
</div>
[[/each]]
</div>
[[/if]]
</div>
</div>
</script>
<script type="text/template" id="tableTemp2">
<span class="folder"></span>
<span style="width: 5%">[[categoryId]]</span>
<span style="width: 20%">[[categoryName]]</span>
<span>[[levelNumber]]级分类</span>
<span><img src="[[icon]]" alt=""></span>
<span class="orderby"> <input type="text" class="form-control saleCategoryNumInput" value="[[orderBy]]" categoryId="[[categoryId]]" /></span>
<span class="status">[[if state=="1"]]<b style="color: #449d44">开启</b>[[/if]][[if state=="0"]]<b style="color: #d9534f">关闭</b>[[/if]]</span>
<span class="operate" data-id="[[categoryId]]" data-name="[[categoryName]]">
<a class="btn btn-info btn-xs edit-btn" href="javascript:;">编辑</a>
<a class="btn btn-success btn-xs tagmgmt-btn" href="/sale/category/tag/[[categoryId]]">标签管理</a>
<a class="btn btn-primary btn-xs add-sub-category" href="javascript:;">添加子分类</a>
<b class="openAndClose" data-id="[[categoryId]]" data-name="[[categoryName]]">
[[if state=="1"]]<a class="btn btn-danger btn-xs close-category" href="javascript:;">关闭</a>[[/if]]
[[if state=="0"]]<a class="btn btn-warning btn-xs open-category" href="javascript:;">开启</a>[[/if]]
</b>
</span>
</script>
... ...
<%include '../../../common/views/__ui/header'%>
<%include '../../../common/views/__partail/ListHeader'%>
<div class="panel panel-default" style="margin-bottom:10px;">
<div class="panel-heading">
<a class="btn btn-success " id="addAppVersion"><i class="fa fa-plus"></i> 添加</a>
</div>
<div id="appVersionList"></div>
</div>
<script type="text/template" id="template">
<div class="row" id="base-form">
<div class="form-group">
<label class="col-sm-2 control-label">版本号</label>
<div class="col-sm-8">
<input type="text" id="version" value="[[version]]" class="form-control">
<input type="hidden" id="id" value="[[id]]" class="form-control">
</div>
</div><!-- form-group -->
<div class="form-group">
<label class="col-sm-2 control-label">提醒内容</label>
<div class="col-sm-8">
<textarea id="content" name="content" class="form-control">[[content]]</textarea>
</div>
</div><!-- form-group -->
<div class="form-group">
<label class="col-sm-2 control-label">链接</label>
<div class="col-sm-8">
<input type="text" id="url" class="form-control" value="[[url]]" required="required">
</div>
</div><!-- form-group -->
<div class="form-group">
<label class="col-sm-2 control-label">客户端类型</label>
<div class="col-sm-8">
<label style="cursor: pointer;"><input type="checkbox" name="clientType" value="iphone">IOS手机</label>
<label style="cursor: pointer;"><input type="checkbox" name="clientType" value="ipad">IOS Pad</label>
<label style="cursor: pointer;"><input type="checkbox" name="clientType" value="android">安卓手机</label>
<label style="cursor: pointer;"><input type="checkbox" name="clientType" value="androidpad">安卓Pad</label>
</div>
<input type="hidden" id="clientType" value="[[clientType]]" for="checkbox" />
</div><!-- form-group -->
</div>
</script>
\ No newline at end of file
... ...
... ... @@ -4,8 +4,8 @@
*/
var $ = require('jquery');
common = require('../common/common');
var activity = require('./partials/activity');
common = require('../../../common/common');
var activity = require('./../partials/activity');
var startTimeObj;
var endTimeObj;
... ...
/**
* Created by jiangmin on 16/5/26.
* 品牌发券管理
*/
var $ = require('jquery');
common = require('../../../common/common');
var e1 = new common.edit2("#basicForm");
var activity = {};
var activityId = location.href.substring(location.href.lastIndexOf("/") + 1);
/**
* 监听输入值的变化
*/
$(document).on("change", ".observe", function () {
var $this = $(this);
var name = $this.data("field");
activity = common.util.__buildobj(name, '.', activity, function (obj, name) {
obj[name] = $this.val();
});
});
//通用对象
var Bll = {
//获取数据,并转换相应格式
getData: function () {
common.util.__ajax({
url: "/couponActivity/queryById",
data: {id: activityId},
async: false
}, function (res) {
activity = res.data;
}, true);
var ids=[];
activity.couponIds=[];
if(activity.couponId){
ids = activity.couponId.split(",");
}
if(ids.length==0){
activity.couponIds.push({id: ""});
}else{
for (var i = 0; i < ids.length; i++) {
activity.couponIds.push({id: ids[i]});
}
}
if(activity.startTime){
activity.startTime=Bll.getTime(activity.startTime);
}
if(activity.endTime){
activity.endTime=Bll.getTime(activity.endTime);
}
},
//渲染界面
render: function () {
console.log("activity",activity);
$("#basicForm").html(common.util.__template2($("#couponListAdd-template").html(), activity));
Bll.__editRender();
},
//转换时间格式
getTime: function (time) {
var t = new Date(time * 1000);
return common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss");
},
//验证
__editRender: function () {
e1.init();
new common.dropDown({
el: "#filter-activityType"
});
startTimeObj = $("#startTime").fdatepicker({
format: 'yyyy-mm-dd hh:ii:ss',
pickTime: true
}).data("datepicker");
endTimeObj = $("#endTime").fdatepicker({
format: 'yyyy-mm-dd hh:ii:ss',
pickTime: true
}).data("datepicker");
e1.on("file_onComplete", function (obj) {
var names = obj.field;
activity = common.util.__buildobj(names, '.', activity, function (o, name) {
o[name] = obj.data;
});
});
}
};
Bll.getData();
Bll.render();
/*添加一行*/
$(document).on("click", ".addBtn", function () {
activity.couponIds.push({
"id": ""
});
Bll.render();
});
/**
* 删除行
*/
$(document).on("click", ".delBtn", function () {
var index = $(this).data("index");
if (activity.couponIds.length <= 1) {
common.util.__tip("至少有一张优惠券", "warning")
}
else {
activity.couponIds.splice(index, 1);
Bll.render();
}
});
/**
* 保存
*/
$(document).on('click', "#save_brand", function () {
var ids = [];
if (activity.couponIds.length > 0) {
for (var index in activity.couponIds) {
ids.push(activity.couponIds[index].id)
}
}
if (ids.length > 0) {
activity.couponId = ids.join(",");
}
activity.startTime=((new Date(activity.startTime).getTime()))/1000||"";
activity.endTime=((new Date(activity.endTime).getTime()))/1000||"";
if(e1.validate()){
common.util.__ajax({
url:"/couponActivity/update",
data:activity
}, function (){
location.href = "/couponActivity/index";
} )
}
});
... ...
... ... @@ -4,7 +4,7 @@
*/
var $ = require('jquery');
common = require('../common/common');
common = require('../../../common/common');
var activityTypes = ["普通活动", "APP活动"];
var status=["关闭","开启"];
var Bll={
... ...
... ... @@ -146,7 +146,7 @@ $(document).on('click', '.change-status', function() {
$(document).on('click', '#add-entry', function() {
module = {};
module.platform = 1;
module.platform = "1,3";
module.gender = "1,3";
Bll.toast("/operations/entrance/insertEntrance", module, "添加入口信息");
});
... ...
... ... @@ -2,7 +2,7 @@
* Created by yoho on 2016/6/17.
*/
var $ = require('jquery');
common = require('../common/common');
common = require('../../../common/common');
var list = [];
var status = ["关闭", "开启"];
new common.dropDown({el: "#platform-filter"});
... ...
var $ = require('jquery'),
common = require('../common/common');
common = require('../../../common/common');
new common.dropDown({el: "#notice-position"});
... ...
'use strict';
var $ = require('jquery'),
common = require('../../../common/common');
var EMUN = {
status: {
0: '关闭',
1: '开启'
}
}
var g = new common.grid({
el: "#basicTable",
parms: function() {
return {
categoryId: $('#categoryId').val(),
status: $('.state-select').find('.current').find('input').val()
}
},
columns: [{
display: '标签名',
name: 'labelName'
}, {
display: '状态',
name: 'status',
render: function(item) {
return EMUN.status[item.status];
}
}, {
display: '排序',
name: 'position',
render: function(item) {
return "<input class='form-control saleCategoryNumInput' type=text name='position' value='"+ item.orderBy +"' _id='"+ item.id +"' />";
}
}, {
display: '操作',
name: '',
render: function(item) {
if (item.status == 1) {
return '<a class="btn btn-xs btn-danger close-btn" data-title="' + item.labelName + '" _id="' + item.id + '" href="javascript:;">关闭</a>';
} else {
return '<a class="btn btn-xs btn-warning open-btn" data-title="' + item.labelName + '" _id="' + item.id + '" href="javascript:;">开启</a>';
}
}
}]
});
g.init('/sale/salesCategoryLabel/querySCLabelList');
//编辑排序
$(document).on('change', '.saleCategoryNumInput', function() {
if(checkNumInput($(this))){
$(this).removeClass("errorNumInput");
var id = $(this).attr("_id");
var orderBy = $(this).val();
savePosition(id,orderBy);
}
});
//排序框校验
function checkNumInput(inputObj){
if(inputObj.val()){
if(!isNaN(inputObj.val())){
if(inputObj.val() < 0){
inputObj.focus().select().addClass("errorNumInput");
common.util.__tip("排序数字请大于等于0!");
return false;
}
}else{
inputObj.focus().select().addClass("errorNumInput");
common.util.__tip("排序必须为数字!");
return false;
}
}else{
inputObj.focus().addClass("errorNumInput");
common.util.__tip("排序不能为空!");
return false;
}
return true;
}
//排序实时保存
function savePosition(id, orderBy){
common.util.__ajax({
url:'/sale/salesCategoryLabel/updateSCLabel',
data: {
"id": id,
"orderBy": orderBy
}
},function(rs){
common.util.__tip("排序保存成功!","success");
},true);
}
$('input[name="state"]').on('change', function() {
$(this).parent().addClass('current').siblings().removeClass('current');
g.reload();
});
$(document).on('click', '.close-btn', function() {
var id = $(this).attr('_id');
common.dialog.confirm("温馨提示", "确定&nbsp;&nbsp<b><font color='#ff0000'>关闭&nbsp;&nbsp;</font>【" + $(this).data('title') + "】</b>&nbsp;&nbsp;标签吗?", function() {
common.util.__ajax({
url: '/sale/salesCategoryLabel/updateSCLabel',
data: {
id: id,
status: 0
}
}, function(res){
if (res.code == 200) {
g.reload();
}
})
});
});
$(document).on('click', '.open-btn', function() {
var id = $(this).attr('_id');
common.dialog.confirm("温馨提示", "确定&nbsp;&nbsp<b><font color='#449d44'>开启&nbsp;&nbsp;</font>【" + $(this).data('title') + "】</b>&nbsp;&nbsp;标签吗?", function() {
common.util.__ajax({
url: '/sale/salesCategoryLabel/updateSCLabel',
data: {
id: id,
status: 1
}
}, function(res){
if (res.code == 200) {
g.reload();
}
})
});
});
... ...
'use strict';
var $ = require('jquery'),
common = require('../common/common');
common = require('../../../common/common');
var e = new common.edit('#basicForm', {
bucket: 'taobaocms'
... ...
'use strict';
var $ = require('jquery'),
common = require('../common/common');
common = require('../../../common/common');
var renderHd = false;
var g = new common.grid({
... ...
... ... @@ -4,8 +4,8 @@
*/
var $ = require('jquery'),
common = require('../common/common'),
util = require('../common/util');
common = require('../../../common/common'),
util = require('../../../common/util');
var g = new common.grid({
el: "#appVersionList",
... ... @@ -58,15 +58,15 @@ var Bll = {
e.submit(url, function (option) {
option.data.clientType = option.data.clientType.replace(/\|/g, ",");
option.success=function(res) {
if(res.data.code == 200) {
util.__tip(res.data.message, "success");
if(res.code == 200) {
util.__tip(res.message, "success");
} else {
util.__tip(res.data.message);
util.__tip(res.message);
}
g.reload();
};
option.error=function(res){
util.__tip(res.data.message);
util.__tip(res.message);
};
});
});
... ...