Authored by weiqingting

资源位

... ... @@ -375,6 +375,7 @@ $(document).on("mouseleave", ".dragItem1", function () {
*/
var g = new common.grid({
el: "#gird",
hash:false,
columns: [{
display: "选择",
"type": "checkbox"
... ... @@ -529,6 +530,7 @@ $(document).on("keyup", "#brandsearch", function () {
/*选择商品表格*/
var goodsgird = new common.grid({
el: '#goodsgird',
hash:false,
parms: function () {
var price = "";
if (common.util.__input('beginPrice')&&common.util.__input('endPrice')) {
... ...
... ... @@ -190,6 +190,24 @@ for(var i = 0; i < resources.length; i++) {
}
}
/**
* 过滤函数
* @param Array
* @param key
* @returns {Array}
* @constructor
*/
function Unique(Array,key) {
var res = [], hash = {};
for (var i = 0, elem; (elem = Array[i]) != null; i++) {
if (!hash[elem[key]]) {
res.push(elem);
hash[elem[key]] = true;
}
}
return res;
}
/*第一步,基础模板*/
Bll.__render("#content-list", "content-template", resources[currIndex]);
Bll.__render(".contents", "template_content_btns", {btns: Button});
... ... @@ -541,6 +559,7 @@ var addSuffix = function (contentData) {
/*选择商品表格*/
var goodsgird = new common.grid({
el: '#goodsgird',
hash:false,
parms: function () {
var beginPrice = 0, endPrice = 1000000;
if (common.util.__input('beginPrice')) {
... ... @@ -596,10 +615,6 @@ var goodsgird = new common.grid({
});
//搜索按钮
$(document).on("click", "#search", function () {
if($.trim($("#skns").val()).length<5){
common.util.__tip("请输入超过5个字符后再搜索","warning");
return;
}
if(goodsgird.grid){
goodsgird.reload(1);
}else{
... ... @@ -615,13 +630,16 @@ $(document).on("click", "#goodsSelectBtn", function () {
button: [{
value: "确定",
callback: function () {
Bll.module.contentData.data = goodsgird.selected.map(function (item, index) {
var gs=goodsgird.selected.map(function (item, index) {
return {
src: item.images_url,
id: item.product_skn
id: item.product_skn,
product_skc: item.product_skc
}
});
// Bll.module.data=goodsgird.selected;
})
Bll.module.contentData.data=Bll.module.contentData.data.concat(gs);
Bll.module.contentData.data=Unique(Bll.module.contentData.data,"product_skc")
console.log(Bll.module.contentData);
Bll.__render("#goodspic", "template_dialog_goodsimgs", {
datas: Bll.module.contentData.data
});
... ... @@ -634,7 +652,7 @@ $(document).on("click", "#goodsSelectBtn", function () {
});
//点击“添加组”按钮(添加商品组)
$(document).on("click", "#goodsaddBtn", function () {
var item = $.extend(true, {}, Button[5].data[0]);
var item = $.extend(true, {}, Button[4].data[0]);
if (Bll.module.contentData.data[0].list.length) {
Bll.module.contentData.data.push(item);
}
... ... @@ -650,24 +668,33 @@ $(document).on("click", ".goodsSelectBtn", function () {
button: [{
value: "确定",
callback: function () {
goodsgird.selected.forEach(function (item, i) {
Bll.module.contentData.data[index].list[i] = {
src: item.images_url,
id: item.product_skn,
maxSortId: item.max_sort_id
};
if (!i) {
Bll.module.contentData.data[index].cover = {
cover: item.images_url,
if(goodsgird.selected){
goodsgird.selected.forEach(function (item, i) {
if(Object.prototype.toString.call(Bll.module.contentData.data[index].list)!=="[object Array]"){
Bll.module.contentData.data[index].list=[];
}
Bll.module.contentData.data[index].list.push({
src: item.images_url,//+'?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/90'
id: item.product_skn,
product_skc: item.product_skc,
maxSortId: item.max_sort_id
};
}
});
});
});
Bll.module.contentData.data[index].list=Unique(Bll.module.contentData.data[index].list,"product_skc");
Bll.module.contentData.data[index].cover = {
cover: Bll.module.contentData.data[index].list[0].src,
maxSortId: Bll.module.contentData.data[index].list[0].maxSortId
};
}
console.log(Bll.module.contentData);
Bll.__render("#groupsgoods", "template_dialog_remgoodsgroup", Bll.module);
},
css: "btn-primary"
}]
});
//goodsgird.init('/yohosearch/search');
goodsgird.grid=null;
});
//删除图片按钮
... ...
... ... @@ -22,10 +22,10 @@ var config = {
// domain: 'http://172.16.6.146:8088/platform', //玛丽
//domain:'http://172.16.6.157:8080/yohobuy-platform-web',//葛超
// domain: 'http://192.168.102.216:8086/platform',
domain: 'http://192.168.102.202:8088/platform',
// domain: 'http://192.168.102.202:8088/platform',
//domain: 'http://172.16.6.146:8088/platform',
//domain:'http://172.16.6.120:8088/platform',//曹艳
//domain:'http://172.16.6.231:8080/platform',//王伟
domain:'http://172.16.6.225:8080/platform',//王伟
//domain: 'http://172.16.6.239:8080', //孙杰翔
//domain:'http://172.16.6.189:8088/platform', //李健1
//domain:'http://192.168.102.216:8180/platform', //李健2
... ...