Authored by xuhongyun

build project

@@ -86,7 +86,20 @@ webpackJsonp([55],{ @@ -86,7 +86,20 @@ webpackJsonp([55],{
86 }, { 86 }, {
87 display: '品牌名称', 87 display: '品牌名称',
88 name: "brandName" 88 name: "brandName"
89 - }, { 89 + },
  90 + {
  91 + display: '封面图',
  92 + render: function (item) {
  93 + if (item.coverImg) {
  94 + return '<a class="list-img" target="_blank">' +
  95 + '<img src="' + item.coverImg + '"></a>';
  96 + } else {
  97 + return '';
  98 + }
  99 +
  100 + }
  101 + },
  102 + {
90 display: '频道名称', 103 display: '频道名称',
91 name: "categoryName" 104 name: "categoryName"
92 }, { 105 }, {
@@ -15,6 +15,11 @@ webpackJsonp([81],[ @@ -15,6 +15,11 @@ webpackJsonp([81],[
15 var g = new common.grid({ 15 var g = new common.grid({
16 el: '#content-list', 16 el: '#content-list',
17 usepagesize:true, 17 usepagesize:true,
  18 + parms: function () {
  19 + return {
  20 + title: common.util.__input('title'),
  21 + };
  22 + },
18 columns: [ 23 columns: [
19 { 24 {
20 display: "ID", 25 display: "ID",
@@ -67,6 +72,10 @@ webpackJsonp([81],[ @@ -67,6 +72,10 @@ webpackJsonp([81],[
67 g.reload(); 72 g.reload();
68 }); 73 });
69 }); 74 });
  75 + $("#filter-btn").click(function () {
  76 + g.reload();
  77 + });
  78 +
70 79
71 /***/ } 80 /***/ }
72 ]); 81 ]);
@@ -44,6 +44,26 @@ webpackJsonp([82],[ @@ -44,6 +44,26 @@ webpackJsonp([82],[
44 }, 44 },
45 columns: [ 45 columns: [
46 { 46 {
  47 + display: '',
  48 + type: 'checkbox',
  49 + render: function (item) {
  50 + var htmlContent = "";
  51 + if(iList.length == 0 ){
  52 + htmlContent = "<input type='checkbox' class='wqt_checkbox' data-index='"+item.__index+"'>";
  53 + }else{
  54 + $.each(iList,function(n,value) {
  55 + if(item.id == value){
  56 + htmlContent = "<input type='checkbox' checked='checked' class='wqt_checkbox' data-index='"+item.__index+"'>";
  57 + return false
  58 + }else{
  59 + htmlContent = "<input type='checkbox' class='wqt_checkbox'data-index='"+item.__index+"'>";
  60 + }
  61 + })
  62 + }
  63 + return htmlContent;
  64 + }
  65 + },
  66 + {
47 display: "ID", 67 display: "ID",
48 name: "id" 68 name: "id"
49 }, 69 },
@@ -133,6 +153,46 @@ webpackJsonp([82],[ @@ -133,6 +153,46 @@ webpackJsonp([82],[
133 $(document).on("click", "#chooseFile", function () { 153 $(document).on("click", "#chooseFile", function () {
134 $("#uploadBox").click(); 154 $("#uploadBox").click();
135 }); 155 });
  156 + //批量删除
  157 + $(document).on("click","#batchDel",function(){
  158 + var len = iList.length;
  159 + if (len <= 0) {
  160 + common.util.__tip('请选择需要删除的数据', 'warning');
  161 + return;
  162 + }
  163 + var data = {
  164 + ids: iList.join(",")
  165 + };
  166 + common.dialog.confirm("温馨提示","你确定删除吗?",function() {
  167 + common.util.__ajax({
  168 + url: "/activityTemplate/batchDelProducts",
  169 + data: data
  170 + }, function () {
  171 + g.reload();
  172 + });
  173 + });
  174 + });
  175 +
  176 + /*
  177 + *可通用于翻页勾选
  178 + * 将checkbox选中存入一个数组,勾选push,取消remove
  179 + * 进入页面判断id是否在数组中存在,如果存在,checked
  180 + */
  181 + var iList = [];
  182 + $(document).on("change", ".wqt_checkbox,.wqt_all", function () {
  183 + var checked = $(this).prop("checked");
  184 + var index = $(this).data("index");
  185 + var val = g.rows[index];
  186 + var index_;
  187 + if(checked){
  188 + iList.push(val['id']);
  189 + }else{
  190 + index_ = $.inArray(val['id'],iList);
  191 + iList.splice(index_,1);
  192 + }
  193 + console.log("iList:"+iList);
  194 + });
  195 +
136 196
137 /***/ } 197 /***/ }
138 ]); 198 ]);
@@ -99,7 +99,9 @@ webpackJsonp([92],[ @@ -99,7 +99,9 @@ webpackJsonp([92],[
99 name: "platform" 99 name: "platform"
100 }, { 100 }, {
101 display: '显示频道', 101 display: '显示频道',
102 - name: "channel" 102 + render:function(item){
  103 + return getChannelName(item.channel);
  104 + }
103 }, { 105 }, {
104 display: '状态', 106 display: '状态',
105 render: function (item) { 107 render: function (item) {
@@ -198,5 +200,17 @@ webpackJsonp([92],[ @@ -198,5 +200,17 @@ webpackJsonp([92],[
198 Bll.module.platform = Bll.platforms.join(','); 200 Bll.module.platform = Bll.platforms.join(',');
199 }); 201 });
200 202
  203 + function getChannelName(channel){
  204 + if(channel=='1'){
  205 + return "男生";
  206 + }else if (channel=='2'){
  207 + return "女生";
  208 + }else if (channel=='3'){
  209 + return "潮童";
  210 + }else if (channel=='4'){
  211 + return "创意家居";
  212 + }
  213 + }
  214 +
201 /***/ } 215 /***/ }
202 ]); 216 ]);
@@ -5,11 +5,12 @@ webpackJsonp([107],[ @@ -5,11 +5,12 @@ webpackJsonp([107],[
5 var $ = __webpack_require__(1), 5 var $ = __webpack_require__(1),
6 common = __webpack_require__(2), 6 common = __webpack_require__(2),
7 util = __webpack_require__(10); 7 util = __webpack_require__(10);
  8 + datepicker = __webpack_require__(9);
8 9
9 new common.dropDown({el: "#subject-type"}); 10 new common.dropDown({el: "#subject-type"});
10 new common.dropDown({el: "#subject-paltform"}); 11 new common.dropDown({el: "#subject-paltform"});
11 new common.dropDown({el: "#subject-status"}); 12 new common.dropDown({el: "#subject-status"});
12 - 13 + new common.dropDown({el: "#subject-isShow"});
13 var yhChannelArr = ["男生", "女生", "儿童", "创意生活"]; 14 var yhChannelArr = ["男生", "女生", "儿童", "创意生活"];
14 15
15 var g = new common.grid({ 16 var g = new common.grid({
@@ -18,7 +19,11 @@ webpackJsonp([107],[ @@ -18,7 +19,11 @@ webpackJsonp([107],[
18 return { 19 return {
19 sort: common.util.__input('subject-type'), 20 sort: common.util.__input('subject-type'),
20 plateform: common.util.__input('subject-paltform'), 21 plateform: common.util.__input('subject-paltform'),
21 - status: common.util.__input('subject-status') 22 + status: common.util.__input('subject-status'),
  23 + isShow: common.util.__input('subject-isShow'),
  24 + startTimeStr:common.util.__input('subject-startTimeStr'),
  25 + endTimeStr:common.util.__input('subject-endTimeStr'),
  26 + title:common.util.__input('subject-title'),
22 }; 27 };
23 }, 28 },
24 columns: [ 29 columns: [
@@ -77,6 +82,10 @@ webpackJsonp([107],[ @@ -77,6 +82,10 @@ webpackJsonp([107],[
77 item.endTime = common.util.__dateFormat(new Date(item.endTime*1000), "yyyy-MM-dd hh:mm:ss"); 82 item.endTime = common.util.__dateFormat(new Date(item.endTime*1000), "yyyy-MM-dd hh:mm:ss");
78 return item.startTime + "~<br>" + item.endTime; 83 return item.startTime + "~<br>" + item.endTime;
79 }}, 84 }},
  85 + {display: "前端展示",name:"isShow", render: function (item) {
  86 + if(item.isShow == 1) return "是";
  87 + else if(item.isShow == 0) return "否";
  88 + }},
80 { 89 {
81 display: "操作", name: "", render: function (item) { 90 display: "操作", name: "", render: function (item) {
82 var arr = []; 91 var arr = [];
@@ -91,6 +100,13 @@ webpackJsonp([107],[ @@ -91,6 +100,13 @@ webpackJsonp([107],[
91 100
92 ] 101 ]
93 }); 102 });
  103 + /**
  104 + * 日期插件
  105 + */
  106 + $('.hasDatepicker').fdatepicker({
  107 + format: 'yyyy-mm-dd hh:ii:ss',
  108 + pickTime: true
  109 + });
94 110
95 g.init('/runManage/subjectManage/subjectList'); 111 g.init('/runManage/subjectManage/subjectList');
96 112
@@ -75,4 +75,6 @@ module.exports=function(app) { @@ -75,4 +75,6 @@ module.exports=function(app) {
75 75
76 /*删除商品信息接口*/ 76 /*删除商品信息接口*/
77 app.post("/activityTemplate/delOneProduct","activitytemplate_delOneProduct"); 77 app.post("/activityTemplate/delOneProduct","activitytemplate_delOneProduct");
  78 + /*批量删除商品接口*/
  79 + app.post("/activityTemplate/batchDelProducts","activitytemplate_batchDelProducts");
78 } 80 }
@@ -12,8 +12,8 @@ var grayroute = require("./mid/grayrouter"); @@ -12,8 +12,8 @@ var grayroute = require("./mid/grayrouter");
12 /*session 配置*/ 12 /*session 配置*/
13 var options = { 13 var options = {
14 secret: 'yohobuy.portal', //session配置 14 secret: 'yohobuy.portal', //session配置
15 - cookie: {secure: false, maxAge: 7200000},  
16 - // cookie: {secure: false, maxAge: 7200000, domain: '.yohobuy.com'}, 15 + // cookie: {secure: false, maxAge: 7200000},
  16 + cookie: {secure: false, maxAge: 7200000, domain: '.yohobuy.com'},
17 resave: false, 17 resave: false,
18 saveUninitialized: true, 18 saveUninitialized: true,
19 rolling: true 19 rolling: true
@@ -76,13 +76,13 @@ var apiCofig = { @@ -76,13 +76,13 @@ var apiCofig = {
76 }); 76 });
77 } 77 }
78 78
79 - // if(process.env.NODE_ENV==="gray"){  
80 - // options.cookie.domain = '';  
81 - // }  
82 - //  
83 - // if(process.env.NODE_ENV==="production"){  
84 - // options.cookie.domain = '.yohobuy.com';  
85 - // } 79 + if(process.env.NODE_ENV==="gray"){
  80 + options.cookie.domain = '';
  81 + }
  82 +
  83 + if(process.env.NODE_ENV==="production"){
  84 + options.cookie.domain = '.yohobuy.com';
  85 + }
86 86
87 app.use(session(options)); 87 app.use(session(options));
88 }, 88 },
@@ -12,7 +12,8 @@ module.exports={ @@ -12,7 +12,8 @@ module.exports={
12 params: [ 12 params: [
13 {name: "status", type: "number"}, 13 {name: "status", type: "number"},
14 {name: 'page', type: 'Number'}, 14 {name: 'page', type: 'Number'},
15 - {name: 'size', type: 'Number'} 15 + {name: 'size', type: 'Number'},
  16 + {name: 'title', type: 'string'},
16 ] 17 ]
17 }, 18 },
18 addTemplate:{ 19 addTemplate:{
@@ -96,6 +97,13 @@ module.exports={ @@ -96,6 +97,13 @@ module.exports={
96 params: [ 97 params: [
97 {name: "id", type: "number"} 98 {name: "id", type: "number"}
98 ] 99 ]
  100 + },
  101 + batchDelProducts:{
  102 + title: "批量删除商品",
  103 + url: "/activityTemplate/batchDelProducts",
  104 + params: [
  105 + {name: "ids", type: "string"}
  106 + ]
99 } 107 }
100 } 108 }
101 } 109 }
@@ -15,7 +15,10 @@ module.exports={ @@ -15,7 +15,10 @@ module.exports={
15 {name: 'sort', type: 'string'}, 15 {name: 'sort', type: 'string'},
16 {name: 'title', type: 'string'}, 16 {name: 'title', type: 'string'},
17 {name: 'plateform', type: 'string'}, 17 {name: 'plateform', type: 'string'},
18 - {name: 'status', type: 'number'} 18 + {name: 'status', type: 'number'},
  19 + {name: 'isShow', type: 'number'},
  20 + {name:'startTimeStr',type:'string'},
  21 + {name:'endTimeStr',type:'string'}
19 ] 22 ]
20 }, 23 },
21 addSpecialActivity:{ 24 addSpecialActivity:{
@@ -35,7 +38,8 @@ module.exports={ @@ -35,7 +38,8 @@ module.exports={
35 {name: 'webUrl', type: 'string'}, 38 {name: 'webUrl', type: 'string'},
36 {name: 'orderNum', type: 'number'}, 39 {name: 'orderNum', type: 'number'},
37 {name: 'yhChannel', type: 'string'}, 40 {name: 'yhChannel', type: 'string'},
38 - {name: 'webCoverUrl', type: 'string'} 41 + {name: 'webCoverUrl', type: 'string'},
  42 + {name: 'isShow',type:'number'}
39 ] 43 ]
40 }, 44 },
41 updateByPrimaryKey:{ 45 updateByPrimaryKey:{
@@ -56,7 +60,8 @@ module.exports={ @@ -56,7 +60,8 @@ module.exports={
56 {name: 'webUrl', type: 'string'}, 60 {name: 'webUrl', type: 'string'},
57 {name: 'orderNum', type: 'number'}, 61 {name: 'orderNum', type: 'number'},
58 {name: 'yhChannel', type: 'string'}, 62 {name: 'yhChannel', type: 'string'},
59 - {name: 'webCoverUrl', type: 'string'} 63 + {name: 'webCoverUrl', type: 'string'},
  64 + {name: 'isShow', type: 'number'}
60 ] 65 ]
61 }, 66 },
62 deleteSpecialActivity:{ 67 deleteSpecialActivity:{
@@ -5,6 +5,21 @@ @@ -5,6 +5,21 @@
5 <div style="margin-bottom: 20px"> 5 <div style="margin-bottom: 20px">
6 <a href="/operations/activitytemplate/add" class="btn btn-success"><i class="fa fa-plus"></i> 添加活动模板</a> 6 <a href="/operations/activitytemplate/add" class="btn btn-success"><i class="fa fa-plus"></i> 添加活动模板</a>
7 </div> 7 </div>
  8 + <div class="panel panel-default" style="...">
  9 + <div class="panel-body">
  10 + <div class="row">
  11 + <div class="panel-col">
  12 + <input type="text" value="" id="title" placeholder="请输入模板标题"
  13 + class="form-control">
  14 + </div>
  15 +
  16 + <div class="panel-col">
  17 + <a id="filter-btn" href="javascript:;" class="btn btn-info">查询</a>
  18 + <a id="filter-all" href="/operations/activitytemplate/index" class="btn btn-info">全部</a>
  19 + </div>
  20 + </div>
  21 + </div>
  22 + </div>
8 <div class="panel"> 23 <div class="panel">
9 <div class="panel-body nopadding"> 24 <div class="panel-body nopadding">
10 <div class="basicTable_wrapper" id="content-list"></div> 25 <div class="basicTable_wrapper" id="content-list"></div>
@@ -28,6 +28,7 @@ @@ -28,6 +28,7 @@
28 </div> 28 </div>
29 <a id="filter-btn" class="btn btn-info">筛选</a> 29 <a id="filter-btn" class="btn btn-info">筛选</a>
30 <a href="<%url%>" class="btn btn-info">全部</a> 30 <a href="<%url%>" class="btn btn-info">全部</a>
  31 + <a id="batchDel" class="btn btn-info" style="background-color: #d9534f;border-color: #d43f3a">批量删除</a>
31 </div> 32 </div>
32 </div> 33 </div>
33 <div class="panel panel-primary-head" id="product-list"> 34 <div class="panel panel-primary-head" id="product-list">
@@ -38,7 +38,7 @@ @@ -38,7 +38,7 @@
38 </div> 38 </div>
39 <div class="panel-col"> 39 <div class="panel-col">
40 <a id="filter-btn" href="javascript:;" class="btn btn-info">查询</a> 40 <a id="filter-btn" href="javascript:;" class="btn btn-info">查询</a>
41 - <a id="filter-all" href="/hotRankTag/index" class="btn btn-info">全部</a> 41 + <a id="filter-all" href="/operations/hotRankTag/index" class="btn btn-info">全部</a>
42 </div> 42 </div>
43 </div> 43 </div>
44 </div> 44 </div>
@@ -9,6 +9,10 @@ @@ -9,6 +9,10 @@
9 <div class="panel-body"> 9 <div class="panel-body">
10 <div class="row"> 10 <div class="row">
11 <div class="panel-col"> 11 <div class="panel-col">
  12 + <input type="text" id="subject-title" placeholder="标题" name="title"
  13 + class="form-control">
  14 + </div>
  15 + <div class="panel-col">
12 <select name="sort" id="subject-type" tabindex="-1" title="" class="select2-offscreen brandBtn-group"> 16 <select name="sort" id="subject-type" tabindex="-1" title="" class="select2-offscreen brandBtn-group">
13 <option value="" selected="">类型</option> 17 <option value="" selected="">类型</option>
14 <option value="1">奥莱</option> 18 <option value="1">奥莱</option>
@@ -36,6 +40,23 @@ @@ -36,6 +40,23 @@
36 </select> 40 </select>
37 </div> 41 </div>
38 <div class="panel-col"> 42 <div class="panel-col">
  43 + <select name="isShow" id="subject-isShow" tabindex="-1" title=""
  44 + class="select2-offscreen brandBtn-group">
  45 + <option value="" selected="">是否展示</option>
  46 + <option value="1"></option>
  47 + <option value="0"></option>
  48 + </select>
  49 + </div>
  50 + <div class="panel-col">
  51 + <input type="text" id="subject-startTimeStr" class="form-control panel-input hasDatepicker" name="startTimeStr"
  52 + placeholder="开始时间" value="" kl_vkbd_parsed="true" readonly>
  53 + </div>
  54 +
  55 + <div class="panel-col">
  56 + <input type="text" id="subject-endTimeStr" class="form-control panel-input hasDatepicker" name="endTimeStr"
  57 + placeholder="结束时间" value="" kl_vkbd_parsed="true" readonly>
  58 + </div>
  59 + <div class="panel-col">
39 <a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a> 60 <a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a>
40 <a id="filter-all" href="/runManage/subjectManage/index" class="btn btn-info">全部</a> 61 <a id="filter-all" href="/runManage/subjectManage/index" class="btn btn-info">全部</a>
41 </div> 62 </div>
@@ -67,6 +88,14 @@ @@ -67,6 +88,14 @@
67 <input type="hidden" id="sort" value="[[sort]]" for="radio"/> 88 <input type="hidden" id="sort" value="[[sort]]" for="radio"/>
68 </div> 89 </div>
69 <div class="form-group"> 90 <div class="form-group">
  91 + <label class="col-sm-2 control-label">前端展示<font color="#f00">*</font></label>
  92 + <div class="col-sm-10">
  93 + <input name="isShow" type="radio" value="1"/>
  94 + <input name="isShow" type="radio" value="0"/>
  95 + </div>
  96 + <input type="hidden" id="isShow" value="[[isShow||'1']]" for="radio"/>
  97 + </div>
  98 + <div class="form-group">
70 <label class="col-sm-2 control-label" for="title">标题<font color="#f00">*</font></label> 99 <label class="col-sm-2 control-label" for="title">标题<font color="#f00">*</font></label>
71 <div class="col-sm-8"> 100 <div class="col-sm-8">
72 <input type="text" value="[[title]]" class="form-control" id="title" required="required"/> 101 <input type="text" value="[[title]]" class="form-control" id="title" required="required"/>