Showing
10 changed files
with
157 additions
and
8 deletions
@@ -116,8 +116,11 @@ webpackJsonp([29],{ | @@ -116,8 +116,11 @@ webpackJsonp([29],{ | ||
116 | if(items.isDel==="N"){ | 116 | if(items.isDel==="N"){ |
117 | HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-danger btn-xs del-promotion">删除</a>'); | 117 | HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-danger btn-xs del-promotion">删除</a>'); |
118 | } | 118 | } |
119 | + if(items.status===0){ | ||
120 | + HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-info btn-xs open-promotion">开启</a>'); | ||
121 | + } | ||
119 | if(items.noticeStatus===0){ | 122 | if(items.noticeStatus===0){ |
120 | - HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-info btn-xs open-promotion">开启预告</a>'); | 123 | + HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-info btn-xs open-promotion-notice">开启预告</a>'); |
121 | } | 124 | } |
122 | return HtmArr.join(''); | 125 | return HtmArr.join(''); |
123 | } | 126 | } |
@@ -152,7 +155,7 @@ webpackJsonp([29],{ | @@ -152,7 +155,7 @@ webpackJsonp([29],{ | ||
152 | }); | 155 | }); |
153 | 156 | ||
154 | //开启预告 | 157 | //开启预告 |
155 | - $('tbody').on('click', '.open-promotion', function() { | 158 | + $('tbody').on('click', '.open-promotion-notice', function() { |
156 | var item = g.rows[$(this).data("index")]; | 159 | var item = g.rows[$(this).data("index")]; |
157 | 160 | ||
158 | common.dialog.confirm("温馨提示", "你确定要开启预告吗?", function () { | 161 | common.dialog.confirm("温馨提示", "你确定要开启预告吗?", function () { |
@@ -172,7 +175,57 @@ webpackJsonp([29],{ | @@ -172,7 +175,57 @@ webpackJsonp([29],{ | ||
172 | }, true); | 175 | }, true); |
173 | }); | 176 | }); |
174 | }); | 177 | }); |
178 | + // 开启促销 | ||
179 | + $('tbody').on('click', '.open-promotion', function() { | ||
180 | + var item = g.rows[$(this).data("index")]; | ||
181 | + | ||
182 | + common.dialog.confirm("温馨提示", "你确定要开启促销吗?", function () { | ||
183 | + common.util.__ajax({ | ||
184 | + url: '/promotionInfo/updatePromotionStatus', | ||
185 | + data: { | ||
186 | + id: item.id, | ||
187 | + status: 1 | ||
188 | + } | ||
189 | + }, function(res) { | ||
190 | + if (res.code == 200) { | ||
191 | + common.util.__tip('开启成功', 'success'); | ||
192 | + g.reload(); | ||
193 | + } else { | ||
194 | + common.util.__tip(res.message); | ||
195 | + } | ||
196 | + }, true); | ||
197 | + }); | ||
198 | + }); | ||
199 | + | ||
200 | + /***********************批量导出***********************/ | ||
201 | + $("#batchExportPromotion").click(function(){ | ||
202 | + var count = 0, | ||
203 | + data = g.options.parms(); | ||
204 | + | ||
205 | + var filter=$(".wqt_all").prop("checked"); | ||
175 | 206 | ||
207 | + $.each(data, function(key, value) { | ||
208 | + if (value && value != '') { | ||
209 | + count++; | ||
210 | + } | ||
211 | + }); | ||
212 | + | ||
213 | + if (count > 0) { | ||
214 | + var getResult=function(){ | ||
215 | + var result={}; | ||
216 | + for(var name in data){ | ||
217 | + if(data.hasOwnProperty(name)&&data[name]){ | ||
218 | + result[name]=data[name]; | ||
219 | + } | ||
220 | + } | ||
221 | + return result | ||
222 | + } | ||
223 | + window.open("/ajax/down?queryConf=" + JSON.stringify(getResult()) + "&type=promotionExport"); | ||
224 | + }else{ | ||
225 | + common.util.__tip('请选择导出促销的条件', 'warning'); | ||
226 | + return; | ||
227 | + } | ||
228 | + }); | ||
176 | 229 | ||
177 | /***/ }, | 230 | /***/ }, |
178 | 231 |
@@ -16,6 +16,7 @@ webpackJsonp([75],{ | @@ -16,6 +16,7 @@ webpackJsonp([75],{ | ||
16 | var endTimeObj; | 16 | var endTimeObj; |
17 | 17 | ||
18 | var customType = []; | 18 | var customType = []; |
19 | + var showScope = []; | ||
19 | var shopPriceLimits = []; | 20 | var shopPriceLimits = []; |
20 | var isNew; | 21 | var isNew; |
21 | var publicCouponType; | 22 | var publicCouponType; |
@@ -135,6 +136,7 @@ webpackJsonp([75],{ | @@ -135,6 +136,7 @@ webpackJsonp([75],{ | ||
135 | 136 | ||
136 | 137 | ||
137 | if (type == 'update') { | 138 | if (type == 'update') { |
139 | + | ||
138 | if (couponBean.customType) { | 140 | if (couponBean.customType) { |
139 | customType = couponBean.customType.split(','); | 141 | customType = couponBean.customType.split(','); |
140 | for (var i = 0; i < customType.length; i++) { | 142 | for (var i = 0; i < customType.length; i++) { |
@@ -142,7 +144,17 @@ webpackJsonp([75],{ | @@ -142,7 +144,17 @@ webpackJsonp([75],{ | ||
142 | $("input ." + custom).attr("checked", "checked"); | 144 | $("input ." + custom).attr("checked", "checked"); |
143 | } | 145 | } |
144 | } | 146 | } |
145 | - | 147 | + console.log("showScope detail:" + couponBean.showScope); |
148 | + /*$("input.showScope-1").prop("checked",false); | ||
149 | + $("input.showScope-2").prop("checked",false); | ||
150 | + $("input.showScope-3").prop("checked",false);*/ | ||
151 | + if (couponBean.showScope) { | ||
152 | + showScope = couponBean.showScope.split(','); | ||
153 | + for(var i = 0; i <showScope.length; i++) { | ||
154 | + var checkBoxName = "showScope-" + showScope[i]; | ||
155 | + $("input ." + checkBoxName).attr("checked", "checked"); | ||
156 | + } | ||
157 | + } | ||
146 | if (couponBean.shopPriceLimits) { | 158 | if (couponBean.shopPriceLimits) { |
147 | shopPriceLimits = couponBean.shopPriceLimits.split(','); | 159 | shopPriceLimits = couponBean.shopPriceLimits.split(','); |
148 | for (var i = 0; i < shopPriceLimits.length; i++) { | 160 | for (var i = 0; i < shopPriceLimits.length; i++) { |
@@ -337,6 +349,15 @@ webpackJsonp([75],{ | @@ -337,6 +349,15 @@ webpackJsonp([75],{ | ||
337 | } else if (couponTypeVal == 6) { | 349 | } else if (couponTypeVal == 6) { |
338 | couponBean.feeSharingType = 2; | 350 | couponBean.feeSharingType = 2; |
339 | } | 351 | } |
352 | + | ||
353 | + if (couponTypeVal == 1){ | ||
354 | + couponBean.showScope = "1,2"; | ||
355 | + } else if (couponTypeVal == 6) { | ||
356 | + couponBean.showScope = "1,2,3"; | ||
357 | + } else { | ||
358 | + couponBean.showScope = "2"; | ||
359 | + } | ||
360 | + | ||
340 | $.extend(window.ViewModel, couponBean); | 361 | $.extend(window.ViewModel, couponBean); |
341 | Bll.__render(couponBean, type); | 362 | Bll.__render(couponBean, type); |
342 | }); | 363 | }); |
@@ -356,6 +377,7 @@ webpackJsonp([75],{ | @@ -356,6 +377,7 @@ webpackJsonp([75],{ | ||
356 | couponBean.customType = customType.join(","); | 377 | couponBean.customType = customType.join(","); |
357 | }); | 378 | }); |
358 | 379 | ||
380 | + | ||
359 | $(document).on("click", "input[name='publicCouponType']", function () { | 381 | $(document).on("click", "input[name='publicCouponType']", function () { |
360 | publicCouponType = $(this).val(); | 382 | publicCouponType = $(this).val(); |
361 | console.log("publicCouponType", publicCouponType); | 383 | console.log("publicCouponType", publicCouponType); |
@@ -535,6 +557,15 @@ webpackJsonp([75],{ | @@ -535,6 +557,15 @@ webpackJsonp([75],{ | ||
535 | } | 557 | } |
536 | } | 558 | } |
537 | }); | 559 | }); |
560 | + | ||
561 | + showScope = []; | ||
562 | + $('input:checkbox[name="showScope"]:checked').each(function () { | ||
563 | + showScope.push($(this).val()); | ||
564 | + }); | ||
565 | + couponBean.showScope = showScope.join(","); | ||
566 | + console.log("showScope: " + couponBean.showScope); | ||
567 | + | ||
568 | + | ||
538 | if (jsonDataChannel.length === 0) { | 569 | if (jsonDataChannel.length === 0) { |
539 | common.util.__tip('渠道限制不能为空!', 'warning'); | 570 | common.util.__tip('渠道限制不能为空!', 'warning'); |
540 | return false; | 571 | return false; |
@@ -543,7 +574,7 @@ webpackJsonp([75],{ | @@ -543,7 +574,7 @@ webpackJsonp([75],{ | ||
543 | * 该属性值给校验未通过回显用 校验通过重新赋值 | 574 | * 该属性值给校验未通过回显用 校验通过重新赋值 |
544 | * @type {Array} | 575 | * @type {Array} |
545 | */ | 576 | */ |
546 | - couponBean.channel = jsonDataChannel | 577 | + couponBean.channel = jsonDataChannel; |
547 | 578 | ||
548 | 579 | ||
549 | //新增时如果,如果没有选定,赋予1(我司承担) | 580 | //新增时如果,如果没有选定,赋予1(我司承担) |
@@ -1124,7 +1155,8 @@ webpackJsonp([75],{ | @@ -1124,7 +1155,8 @@ webpackJsonp([75],{ | ||
1124 | cusPublicCouponName: "", | 1155 | cusPublicCouponName: "", |
1125 | publicCouponType: "", | 1156 | publicCouponType: "", |
1126 | couponAvailableChannels: "", // 可用渠道 | 1157 | couponAvailableChannels: "", // 可用渠道 |
1127 | - channel: "" // 可用渠道勾选状态 | 1158 | + channel: "", // 可用渠道勾选状态 |
1159 | + showScope: ""//展示范围 | ||
1128 | }; | 1160 | }; |
1129 | 1161 | ||
1130 | module.exports = couponBean; | 1162 | module.exports = couponBean; |
@@ -24,8 +24,8 @@ webpackJsonp([77],[ | @@ -24,8 +24,8 @@ webpackJsonp([77],[ | ||
24 | 24 | ||
25 | var couponTypes = ["活动券", "B券", "券码", "生日券", "免邮券", "店铺券", "分享券", "会员营销券"]; | 25 | var couponTypes = ["活动券", "B券", "券码", "生日券", "免邮券", "店铺券", "分享券", "会员营销券"]; |
26 | var useLimitTypes = ["无限制", "货物件数限制", "订单金额限制"]; | 26 | var useLimitTypes = ["无限制", "货物件数限制", "订单金额限制"]; |
27 | - // var customTypes = ["新客户", "银卡会员", "金卡会员", "白金卡会员", "普通用户(不含新客)"]; | ||
28 | var customTypes = {1: "新客户", 2: "银卡会员", 3: "金卡会员", 4: "白金卡会员", 5: "普通用户(不含新客)", 9: "学生"}; | 27 | var customTypes = {1: "新客户", 2: "银卡会员", 3: "金卡会员", 4: "白金卡会员", 5: "普通用户(不含新客)", 9: "学生"}; |
28 | + var showScopes = {1: "购物车展示", 2: "详情页展示", 3:"店铺展示"} | ||
29 | var shopPriceLimitsTable = {1: "成交价低于吊牌价三折", 2: "限量商品"}; | 29 | var shopPriceLimitsTable = {1: "成交价低于吊牌价三折", 2: "限量商品"}; |
30 | var thirdTypeEnum = {1: "微信", 2: "支付宝", 3: "微薄"}; | 30 | var thirdTypeEnum = {1: "微信", 2: "支付宝", 3: "微薄"}; |
31 | 31 | ||
@@ -383,6 +383,20 @@ webpackJsonp([77],[ | @@ -383,6 +383,20 @@ webpackJsonp([77],[ | ||
383 | item1.customType = "无"; | 383 | item1.customType = "无"; |
384 | } | 384 | } |
385 | 385 | ||
386 | + //优惠券展示范围 | ||
387 | + if (item1.showScope) { | ||
388 | + console.info("showScope:" + item1.showScope); | ||
389 | + item1.showScope = item1.showScope.split(","); | ||
390 | + var scopeLen = item1.showScope.length; | ||
391 | + var scopes = []; | ||
392 | + for(var i = 0; i < scopeLen; i++){ | ||
393 | + scopes.push(showScopes[item1.showScope[i]]); | ||
394 | + } | ||
395 | + item1.showScope = scopes.join(",") | ||
396 | + }else { | ||
397 | + item1.showScope = "无" | ||
398 | + } | ||
399 | + | ||
386 | // shopPriceLimitsTable | 400 | // shopPriceLimitsTable |
387 | if (item1.shopPriceLimits) { | 401 | if (item1.shopPriceLimits) { |
388 | item1.shopPriceLimits = item1.shopPriceLimits.split(","); | 402 | item1.shopPriceLimits = item1.shopPriceLimits.split(","); |
@@ -36,6 +36,8 @@ module.exports = function (app){ | @@ -36,6 +36,8 @@ module.exports = function (app){ | ||
36 | app.post("/promotionInfo/delete","promotion_deletePromotionInfo"); | 36 | app.post("/promotionInfo/delete","promotion_deletePromotionInfo"); |
37 | //开启促销预告 | 37 | //开启促销预告 |
38 | app.post("/promotionInfo/updatePromotionNoticeStatus","promotion_updatePromotionNoticeStatus"); | 38 | app.post("/promotionInfo/updatePromotionNoticeStatus","promotion_updatePromotionNoticeStatus"); |
39 | + //开启促销 | ||
40 | + app.post("/promotionInfo/updatePromotionStatus","promotion_updatePromotionStatus"); | ||
39 | 41 | ||
40 | //参数-促销条件 | 42 | //参数-促销条件 |
41 | app.post("/promotion/setCondition","promotion_setCondition"); | 43 | app.post("/promotion/setCondition","promotion_setCondition"); |
@@ -60,6 +60,14 @@ module.exports={ | @@ -60,6 +60,14 @@ module.exports={ | ||
60 | {name: 'noticeStatus', type: 'Number'} | 60 | {name: 'noticeStatus', type: 'Number'} |
61 | ] | 61 | ] |
62 | }, | 62 | }, |
63 | + updatePromotionStatus:{ | ||
64 | + title:"开启促销", | ||
65 | + url:"/promotion/updatePromotionStatus", | ||
66 | + params:[ | ||
67 | + {name: 'id', type: 'Number'}, | ||
68 | + {name: 'status', type: 'Number'} | ||
69 | + ] | ||
70 | + }, | ||
63 | getPromotionInfoList:{ | 71 | getPromotionInfoList:{ |
64 | title:"查询列表", | 72 | title:"查询列表", |
65 | url:"/promotion/getPromotionInfoList", | 73 | url:"/promotion/getPromotionInfoList", |
@@ -63,7 +63,8 @@ module.exports = { | @@ -63,7 +63,8 @@ module.exports = { | ||
63 | prdPoolLimit: {type: String}, | 63 | prdPoolLimit: {type: String}, |
64 | cusPublicCouponName: {type: String}, | 64 | cusPublicCouponName: {type: String}, |
65 | publicCouponType: {type: Number}, | 65 | publicCouponType: {type: Number}, |
66 | - channel: {type: String} | 66 | + channel: {type: String}, |
67 | + showScope : {type: String} | ||
67 | } | 68 | } |
68 | }, | 69 | }, |
69 | reject: { | 70 | reject: { |
@@ -350,6 +350,8 @@ function __sendRequest(options, success, fail, wlen, i, args) { | @@ -350,6 +350,8 @@ function __sendRequest(options, success, fail, wlen, i, args) { | ||
350 | } | 350 | } |
351 | 351 | ||
352 | Request(options, function (error, response, body) { | 352 | Request(options, function (error, response, body) { |
353 | + //console.error("request-options=> ",options, "body=>" ,body); | ||
354 | + //console.error("request-error =>", error, 'status=>', response.statusCode ) | ||
353 | if (!wlen.len) { | 355 | if (!wlen.len) { |
354 | return; | 356 | return; |
355 | } | 357 | } |
@@ -44,9 +44,10 @@ | @@ -44,9 +44,10 @@ | ||
44 | <div class="panel-col"> | 44 | <div class="panel-col"> |
45 | <input name="description" id="description" placeholder="输入描述的关键信息" class="form-control" /> | 45 | <input name="description" id="description" placeholder="输入描述的关键信息" class="form-control" /> |
46 | </div> | 46 | </div> |
47 | - <div class="panel-col"> | 47 | + <div style="float: left; height: 40px; margin: 0 10px 10px;"> |
48 | <a id="filter-btn" href="javascript:void(0);" class="btn btn-info">筛选</a> | 48 | <a id="filter-btn" href="javascript:void(0);" class="btn btn-info">筛选</a> |
49 | <a id="filter-all" href="/promotionInfo/index" class="btn btn-info">全部</a> | 49 | <a id="filter-all" href="/promotionInfo/index" class="btn btn-info">全部</a> |
50 | + <a id="batchExportPromotion" href="javascript:void(0);" class="btn btn-info">导出</a> | ||
50 | </div> | 51 | </div> |
51 | </div> | 52 | </div> |
52 | </div> | 53 | </div> |
@@ -412,6 +412,27 @@ | @@ -412,6 +412,27 @@ | ||
412 | 412 | ||
413 | <div> | 413 | <div> |
414 | 414 | ||
415 | + <div class="panel-heading"> | ||
416 | + <h4 class="panel-title">展示范围</h4> | ||
417 | + </div> | ||
418 | + <div class="panel-body"> | ||
419 | + <div class="row"> | ||
420 | + <div class="form-group"> | ||
421 | + <label class="col-sm-2 control-label"></label> | ||
422 | + <div class="col-sm-10"> | ||
423 | + <label class="checkbox-inline"> | ||
424 | + <input type="checkbox" value="1" name="showScope" class="showScope-1" [[if couponType==3||couponType==4||couponType==5||couponType==7||couponType==8]]disabled[[/if]]> 购物车展示 | ||
425 | + </label> | ||
426 | + <label class="checkbox-inline"> | ||
427 | + <input type="checkbox" value="2" name="showScope" class="showScope-2" [[if couponType==-1]]disabled[[/if]]> 详情页展示 | ||
428 | + </label> | ||
429 | + <label class="checkbox-inline"> | ||
430 | + <input type="checkbox" value="3" name="showScope" class="showScope-3" [[if couponType==1||couponType==3||couponType==4||couponType==5||couponType==7||couponType==8]]disabled[[/if]] > 店铺展示 | ||
431 | + </label> | ||
432 | + </div> | ||
433 | + <input type="hidden" value="[[showScope]]" id="showScope" for="checkbox" placeholder="展示范围"> | ||
434 | + </div> | ||
435 | + </div> | ||
415 | </div> | 436 | </div> |
416 | <div class="panel-heading"> | 437 | <div class="panel-heading"> |
417 | <h4 class="panel-title">费用承担</h4> | 438 | <h4 class="panel-title">费用承担</h4> |
@@ -383,7 +383,22 @@ | @@ -383,7 +383,22 @@ | ||
383 | </div> | 383 | </div> |
384 | </div> | 384 | </div> |
385 | </div> | 385 | </div> |
386 | + </div> | ||
387 | + | ||
388 | + <div class="panel-heading"> | ||
389 | + <h4 class="panel-title">展示范围</h4> | ||
390 | + </div> | ||
391 | + <div class="panel-body"> | ||
392 | + <div class="row"> | ||
393 | + <div class="form-group"> | ||
394 | + | ||
395 | + <label class="col-sm-2 control-label">展示范围</label> | ||
386 | 396 | ||
397 | + <div class="col-sm-8"> | ||
398 | + <p>[[showScope]]</p> | ||
399 | + </div> | ||
400 | + </div> | ||
401 | + </div> | ||
387 | </div> | 402 | </div> |
388 | </div> | 403 | </div> |
389 | </script> | 404 | </script> |
-
Please register or login to post a comment