...
|
...
|
@@ -8,7 +8,7 @@ var ENUM = {}; |
|
|
// },function(res){
|
|
|
// ENUM=res.data;
|
|
|
// });
|
|
|
// console.log(ENUM);
|
|
|
console.log(ENUM);
|
|
|
|
|
|
var edit = new common.edit(".modal-body", {
|
|
|
bucket: "goodsimg"
|
...
|
...
|
@@ -33,21 +33,12 @@ var Bll = { |
|
|
Brand[brandAlif].push(item);
|
|
|
Bll.Brands1[item.id] = item;
|
|
|
});
|
|
|
|
|
|
for (var i in Brand) {
|
|
|
Brand[i].sort(function(a, b) {
|
|
|
var aName = a.brand_name.toLowerCase(),
|
|
|
bName = b.brand_name.toLowerCase();
|
|
|
if (aName < bName) return -1;
|
|
|
if (aName > bName) return 1;
|
|
|
return 0;
|
|
|
});
|
|
|
Bll.Brands.push({
|
|
|
name: i,
|
|
|
items: Brand[i]
|
|
|
});
|
|
|
}
|
|
|
|
|
|
});
|
|
|
},
|
|
|
renderBrandPic: function(Brdata) {
|
...
|
...
|
@@ -109,12 +100,17 @@ var Bll = { |
|
|
//获取品牌
|
|
|
Bll.getBrands();
|
|
|
|
|
|
$(document).on('click', '.brand-index', function() {
|
|
|
var brandIndex = $(this).text();
|
|
|
$('.brand-wrap').find('[name="' + brandIndex + '"]').show().siblings().hide();
|
|
|
});
|
|
|
|
|
|
/*渲染页面*/
|
|
|
$("#panel-body").html(common.util.__template2($("#tempalte1").html(), ENUM));
|
|
|
/*渲染品牌*/
|
|
|
// Bll.Brdata=ENUM.brands;
|
|
|
// Bll.renderBrandPic(Bll.Brdata);
|
|
|
/*渲染标签*/
|
|
|
// Bll.Tags=[];
|
|
|
// Bll.__render("#taglist","template4",{tags:Bll.Tags});
|
|
|
/*内容渲染->对象转数组*/
|
|
|
// Bll.contentDatas=ENUM.contentData;
|
|
|
|
|
|
|
|
|
new common.dropDown({
|
|
|
el: "#authorId",
|
...
|
...
|
@@ -161,19 +157,18 @@ $(document).on("click", "#addUrl", function() { |
|
|
|
|
|
$(document).on("click", "#TagsSelectBtn", function() {
|
|
|
common.dialog.confirm("选择标签", "<div id='gird'></div>", function() {
|
|
|
|
|
|
$("#taglist").html(common.util.__template2($("#template4").html(), {
|
|
|
tags: g.selected
|
|
|
}));
|
|
|
Bll.Tags = g.selected;
|
|
|
Bll.__render("#taglist", "template4", {
|
|
|
tags: Bll.Tags
|
|
|
});
|
|
|
});
|
|
|
g.init('/guang/tags/getList');
|
|
|
});
|
|
|
$(document).on("click", ".tag a", function() {
|
|
|
g.selected.splice($(this).data("index"), 1);
|
|
|
|
|
|
$("#taglist").html(common.util.__template2($("#template4").html(), {
|
|
|
tags: g.selected
|
|
|
}));
|
|
|
Bll.Tags.splice($(this).data("index"), 1);
|
|
|
Bll.__render("#taglist", "template4", {
|
|
|
tags: Bll.Tags
|
|
|
});
|
|
|
return false;
|
|
|
});
|
|
|
|
...
|
...
|
@@ -311,7 +306,10 @@ $(document).on("click", ".edit", function() { |
|
|
var goodsgird = new common.grid({
|
|
|
el: '#goodsgird',
|
|
|
parms: function() {
|
|
|
return {};
|
|
|
return {
|
|
|
xxx: "",
|
|
|
xxx1: "",
|
|
|
};
|
|
|
},
|
|
|
columns: [{
|
|
|
display: "选择",
|
...
|
...
|
@@ -342,6 +340,9 @@ var goodsgird = new common.grid({ |
|
|
name: "storage_num"
|
|
|
}]
|
|
|
});
|
|
|
$(document).on("click", "#search", function() {
|
|
|
goodsgird.reload();
|
|
|
});
|
|
|
$(document).on("click", "#goodsSelectBtn", function() {
|
|
|
new common.dialog({
|
|
|
title: "选择商品",
|
...
|
...
|
@@ -438,10 +439,11 @@ $(document).on("click", "#submit", function() { |
|
|
console.log("Bll.contentDatas", Bll.Brdata);
|
|
|
option.data.contentData = JSON.stringify(option.data.contentData);
|
|
|
option.data.brands = JSON.stringify(Bll.Brdata);
|
|
|
g.selected.forEach(function(item, index) {
|
|
|
Bll.Tags.push(item.id);
|
|
|
var Tags = [];
|
|
|
Bll.Tags.forEach(function(item, index) {
|
|
|
Tags.push(item.id);
|
|
|
});
|
|
|
option.data.tag = Bll.Tags.join(',');
|
|
|
option.data.tag = Tags.join(',');
|
|
|
|
|
|
console.log("submit", option.data);
|
|
|
});
|
...
|
...
|
|