Authored by weiqingting

Merge branch 'release/release' into release/pre

... ... @@ -45,7 +45,7 @@ tab.prototype = {
g.active = $(this).find("a").attr("columnname");
g.key = $(this).find("a").attr("key");
g.value = $(this).find("a").attr("value");
g.__index__ = $(this).index();
this._init = p._init;
callback && callback.call(this);
});
... ... @@ -87,14 +87,22 @@ tab.prototype = {
li.append(a);
g.tab.append(li);
});
g.__tab = g.tab.html();
g.tab.html(util.__template(g.tab.html(), data || {}));
},
load: function(data) {
var g = this,
p = this.options;
g.tab.html(util.__template(g.tab.html(), data || {}));
g.tab.html(util.__template(g.__tab, data || {}));
if (g.__index__ != undefined) {
$('li',p.el).removeClass('active');
$('li',p.el).eq(g.__index__).addClass('active');
}
}
}
... ...
... ... @@ -23,8 +23,9 @@ var ENUM = {
"2": 300,
"all": 400
}
}
};
var currentTab;
/*下拉选择*/
common.dropDown({
... ... @@ -44,29 +45,8 @@ var t = new common.tab({
el: "#basicTab",
click: function() {
var columnname = $(this).find('a').attr('columnname');
if (columnname == 'all') {
g.options.columns[1].hidden = false;
g.options.columns[2].hidden = true;
g.options.columns[3].hidden = true;
g.options.columns[4].hidden = true;
g.options.columns[5].hidden = false;
g.options.columns[6].hidden = true;
} else if(columnname == 1) {
g.options.columns[1].hidden = true;
g.options.columns[2].hidden = false;
g.options.columns[3].hidden = false;
g.options.columns[4].hidden = true;
g.options.columns[5].hidden = true;
g.options.columns[6].hidden = false;
} else {
g.options.columns[1].hidden = true;
g.options.columns[2].hidden = false;
g.options.columns[3].hidden = false;
g.options.columns[4].hidden = false;
g.options.columns[5].hidden = true;
g.options.columns[6].hidden = true;
}
currentTab = ENUM.tab[columnname];
layoutGridCloum(columnname);
g.init('/payDelivery/queryTotalBrandPayDelivery');
},
columns: [{
... ... @@ -90,7 +70,7 @@ var g = new common.grid({
return {
brandId: common.util.__input("brandId"),
isPayDelivery: common.util.__input("isPayDelivery"),
checkStatus: ENUM.tab[t.active] //(t.active && t.active!='all') ? t.active : 400
checkStatus: (currentTab && currentTab != 'all') ? currentTab : 400//ENUM.tab[t.active] //(t.active && t.active!='all') ? t.active : 400
};
},
columns: [{
... ... @@ -157,6 +137,32 @@ var g = new common.grid({
});
g.init('/payDelivery/queryTotalBrandPayDelivery');
function layoutGridCloum(tabname) {
if (tabname == 'all') {
g.options.columns[1].hidden = false;
g.options.columns[2].hidden = true;
g.options.columns[3].hidden = true;
g.options.columns[4].hidden = true;
g.options.columns[5].hidden = false;
g.options.columns[6].hidden = true;
} else if(tabname == 1) {
g.options.columns[1].hidden = true;
g.options.columns[2].hidden = false;
g.options.columns[3].hidden = false;
g.options.columns[4].hidden = true;
g.options.columns[5].hidden = true;
g.options.columns[6].hidden = false;
} else {
g.options.columns[1].hidden = true;
g.options.columns[2].hidden = false;
g.options.columns[3].hidden = false;
g.options.columns[4].hidden = false;
g.options.columns[5].hidden = true;
g.options.columns[6].hidden = true;
}
}
// tab初始化
var loadTab = function() {
t.active = undefined;
... ... @@ -171,16 +177,30 @@ var loadTab = function() {
}, 800);
};
var reloadTab = function() {
t.active = undefined;
setTimeout(function() {
common.util.__ajax({
url: "/payDelivery/queryCountBrandPayDelivery",
data: g.options.parms()
}, function(res) {
var __dt = $.extend({}, ENUM.tips, res.data);
t.load(__dt);
}, true);
}, 800);
};
loadTab();
// 筛选
$(document).on('click', "#filter-btn", function() {
loadTab();
g.options.columns[1].hidden = false;
g.options.columns[2].hidden = true;
g.options.columns[3].hidden = true;
g.options.columns[4].hidden = true;
g.options.columns[5].hidden = false;
g.options.columns[6].hidden = true;
reloadTab();
//g.options.columns[1].hidden = false;
//g.options.columns[2].hidden = true;
//g.options.columns[3].hidden = true;
//g.options.columns[4].hidden = true;
//g.options.columns[5].hidden = false;
//g.options.columns[6].hidden = true;
layoutGridCloum(currentTab);
g.reload();
});
... ...
... ... @@ -18,7 +18,7 @@ var ENUM = {
}
};
var currentSelItem;
var currentSelItem, currentTab;
/*下拉选择*/
common.dropDown({
... ... @@ -40,28 +40,8 @@ var t = new common.tab({
el: "#basicTab",
click: function () {
var columnname = $(this).find('a').attr('columnname');
if (columnname == 'all') {
g.options.columns[2].hidden = false;
g.options.columns[3].hidden = true;
g.options.columns[4].hidden = true;
g.options.columns[5].hidden = true;
g.options.columns[6].hidden = false;
g.options.columns[7].hidden = true;
} else if (columnname == 100) {
g.options.columns[2].hidden = true;
g.options.columns[3].hidden = false;
g.options.columns[4].hidden = false;
g.options.columns[5].hidden = true;
g.options.columns[6].hidden = true;
g.options.columns[7].hidden = false;
} else {
g.options.columns[2].hidden = true;
g.options.columns[3].hidden = false;
g.options.columns[4].hidden = false;
g.options.columns[5].hidden = false;
g.options.columns[6].hidden = true;
g.options.columns[7].hidden = true;
}
currentTab = columnname;
layoutGridCloum(columnname);
g.init('/payDelivery/queryPayDeliveryList');
},
columns: [{
... ... @@ -86,7 +66,7 @@ var g = new common.grid({
brandId: common.util.__input("brandId"),
isPayDelivery: common.util.__input("isPayDelivery"),
productSkn: common.util.__input("productSkn"),
status: (t.active && t.active != 'all') ? t.active : 400
status: (currentTab && currentTab != 'all') ? currentTab : 400
};
},
columns: [{
... ... @@ -158,6 +138,31 @@ var g = new common.grid({
});
g.init('/payDelivery/queryPayDeliveryList');
function layoutGridCloum(tabname) {
if (tabname == 'all') {
g.options.columns[2].hidden = false;
g.options.columns[3].hidden = true;
g.options.columns[4].hidden = true;
g.options.columns[5].hidden = true;
g.options.columns[6].hidden = false;
g.options.columns[7].hidden = true;
} else if (tabname == 100) {
g.options.columns[2].hidden = true;
g.options.columns[3].hidden = false;
g.options.columns[4].hidden = false;
g.options.columns[5].hidden = true;
g.options.columns[6].hidden = true;
g.options.columns[7].hidden = false;
} else {
g.options.columns[2].hidden = true;
g.options.columns[3].hidden = false;
g.options.columns[4].hidden = false;
g.options.columns[5].hidden = false;
g.options.columns[6].hidden = true;
g.options.columns[7].hidden = true;
}
}
// tab初始化
var loadTab = function () {
t.active = undefined;
... ... @@ -172,17 +177,33 @@ var loadTab = function () {
}, 800);
};
var reloadTab = function () {
t.active = undefined;
setTimeout(function () {
common.util.__ajax({
url: "/payDelivery/queryCountProductPayDelivery",
data: g.options.parms()
}, function (res) {
var __dt = $.extend({}, ENUM.tips, res.data);
t.load(__dt);
}, true);
}, 800);
};
loadTab();
// 筛选
$(document).on('click', "#filter-btn", function () {
loadTab();
g.options.columns[2].hidden = false;
g.options.columns[3].hidden = true;
g.options.columns[4].hidden = true;
g.options.columns[5].hidden = true;
g.options.columns[6].hidden = false;
g.options.columns[7].hidden = true;
//loadTab();
reloadTab();
//g.options.columns[2].hidden = false;
//g.options.columns[3].hidden = true;
//g.options.columns[4].hidden = true;
//g.options.columns[5].hidden = true;
//g.options.columns[6].hidden = false;
//g.options.columns[7].hidden = true;
layoutGridCloum(currentTab);
g.reload();
//g.init('/payDelivery/queryPayDeliveryList');
});
$(document).on('click', ".edit-class-btn", function () {
... ...
... ... @@ -243,16 +243,7 @@ var Button = [
"title": ""
},
"is_show_name": "N",
"list": [],
"image":{
"src": "",
"alt": "",
"url":{
"action":"",
"url":""
}
}
"list": []
}
},
{
... ...
... ... @@ -69,34 +69,7 @@
<input type="hidden" id="is_show_name_brand" value="[[contentData.data.is_show_name]]" for="radio"/>
</div>
</div>
<div class="form-group">
<table class="table table-hover table-bordered responsive dataTable no-footer">
<tbody>
<tr>
<td>
<input type="file" name="file" value="[[contentData.data.image.src]]" class="observe" data-field="image.src"/>
</td>
<td>
<div class="form-group ">
<select name="goTo" class="form-control observe" value="[[contentData.data.image.url.action]]" data-field="image.url.action">
[[layout action_template]]
</select>
</div>
<div class="form-group ">
<input value="[[contentData.data.image.url.url]]" class="form-control observe"
data-field="image.url.url" placeholder="图片链接"/>
<p style="color:#999;margin-top: 5px;">链接中不能有英文单引号</p>
</div>
<div class="form-group ">
<input value="[[contentData.data.image.alt]]" class="form-control observe"
data-field="image.alt" placeholder="图片描述"/>
</div>
</td>
</tr>
</tbody>
</table>
</div>
[[/if]]
[[if contentData.template_name=='customBrands']]
... ...