...
|
...
|
@@ -32,6 +32,7 @@ var Bll = { |
|
|
selectShops:[],//店铺数据
|
|
|
selectShopIds:[],
|
|
|
selectBrandsName: [],
|
|
|
selectPrdPool:{},
|
|
|
getBrands: function () {//获取品牌数据
|
|
|
var Brand = {};
|
|
|
$.get("/ajax/yohosearch", function (res) {
|
...
|
...
|
@@ -166,6 +167,7 @@ var Bll = { |
|
|
|
|
|
});
|
|
|
}
|
|
|
|
|
|
//isNew
|
|
|
if(couponBean.isNew){
|
|
|
isNew = couponBean.isNew;
|
...
|
...
|
@@ -270,6 +272,10 @@ if (type == 'add') { |
|
|
if(couponBean.productLimit){
|
|
|
couponBean.useRange = 3;
|
|
|
}
|
|
|
if(couponBean.prdPoolLimit){
|
|
|
couponBean.useRange = 4;
|
|
|
Bll.selectPrdPool = {id : couponBean.prdPoolLimit, name : couponBean.prdPoolLimitName}
|
|
|
}
|
|
|
Bll.__render(couponBean, type)
|
|
|
}, true);
|
|
|
}
|
...
|
...
|
@@ -644,3 +650,77 @@ $(document).on("change", "input[name='isUseLimitRule']", function () { |
|
|
couponBean.isUseLimitRule = "";
|
|
|
}
|
|
|
});
|
|
|
|
|
|
var PrdPoolService = {
|
|
|
initPrdPool: function () {//初始化商品池弹框
|
|
|
var data1 = {};
|
|
|
var __self = this;
|
|
|
common.dialog({
|
|
|
title: "选择商品池",
|
|
|
width: "60%",
|
|
|
content: common.util.__template2($('#template_prdPoolLimit').html(), data1),
|
|
|
button: [{
|
|
|
value: "保存",
|
|
|
callback: function () {
|
|
|
//myself
|
|
|
//myselfEnd
|
|
|
Bll.selectPrdPool = {};
|
|
|
|
|
|
if ($(".prdPoolLimit").length > 0) {
|
|
|
$(".prdPoolLimit").each(function(index){
|
|
|
Bll.selectPrdPool.id = $(this).val();
|
|
|
Bll.selectPrdPool.name = $(this).text().replace("选择商品池","").trim()
|
|
|
});
|
|
|
couponBean.prdPoolLimit = Bll.selectPrdPool.id;
|
|
|
couponBean.prdPoolLimitName = Bll.selectPrdPool.name;
|
|
|
Bll.__render(couponBean, type);
|
|
|
}else{
|
|
|
couponBean.prdPoolLimit = "";
|
|
|
|
|
|
Bll.__render(couponBean, type);
|
|
|
}
|
|
|
},
|
|
|
css: "btn btn-primary"
|
|
|
}, {
|
|
|
value: "返回"
|
|
|
}]
|
|
|
});
|
|
|
__self.buildPrdPoolDropDown();
|
|
|
},
|
|
|
//选择商品池
|
|
|
clickHandle : function(){
|
|
|
var __self = this;
|
|
|
if (Bll.selectShops && Bll.selectShops.length > 0) {
|
|
|
//渲染店铺
|
|
|
if (Bll.selectPrdPool.id) {
|
|
|
__self.initPrdPool();
|
|
|
$('.prdPoolLimit-wrap').empty();
|
|
|
var _pool_name = Bll.selectPrdPool.name;
|
|
|
var _pool_id = Bll.selectPrdPool.id;
|
|
|
var Template = {id: _pool_id, text: _pool_name};
|
|
|
var $prdPoolGroup = $(common.util.__template2($("#template_prdPoolLimit").html(), Template));
|
|
|
$prdPoolGroup.appendTo($('.prdPoolLimit-wrap'));
|
|
|
__self.buildPrdPoolDropDown();
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
__self.initPrdPool();
|
|
|
}
|
|
|
__self.buildPrdPoolDropDown();
|
|
|
},
|
|
|
buildPrdPoolDropDown : function(){
|
|
|
return new common.dropDown({
|
|
|
el: '.prdPoolLimit',
|
|
|
ajax: 'productPool',
|
|
|
params : {diffType : 3}
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$(document).on('click', "#addPrdPool", function () {
|
|
|
PrdPoolService.clickHandle();
|
|
|
});
|
|
|
|
|
|
|
...
|
...
|
|