Authored by 陶雨

Merge branch 'develop' of http://git.dev.yoho.cn/platform/yohobuy-portal-fe into develop

... ... @@ -7,8 +7,46 @@ require('../util/custom.js');
*/
window.NETSALEDATA = require('./partials/data.js');
// console.log(NETSALEDATA);
// window.NETSALEEDIT = new common.edit('#netsaleAllInfo', {
// bucket: 'goodsimg'
// });
window.GOLABDATA={
on:function(key,callback){
var that=this;
if(!that.registerEvent){
that.registerEvent={};
}
if(!that.registerEvent[key]){
that.registerEvent[key]=[];
}
if(!~Util.Array.indexOf(that.registerEvent,key)){
that.registerEvent[key].push(callback);
}
},
fire:function(key){
var that=this;
if (!this.registerEvent || !this.registerEvent[key]) return;
var listeners=that.registerEvent[key];
var args=[].slice.call(arguments,1);
for(var i in listeners){
listeners[i].apply(this,args);
}
}
};
//获取skn
$('#productSkn').val(NETSALEDATA.baseProductInfo.baseProduct.productSkn);
if(NETSALEDATA&&NETSALEDATA.baseProductInfo&&NETSALEDATA.baseProductInfo.baseProduct){
$('#productSkn').val(NETSALEDATA.baseProductInfo.baseProduct.productSkn);
}else{
common.util.__tip("SKN不存在");
return;
}
console.log(NETSALEDATA);
... ...
... ... @@ -206,8 +206,8 @@ common.edit.ajaxfileupload("#fenmianfile",{
"genderCover": 0,
"imageUrl": response.data,
"orderBy": item.length,
"productSkc": goodsImagesList.productSkc,
"productSkn": goodsImagesList.productSkn,
"productSkc": goodsImagesList[$(this).data("index")].productSkc,
"productSkn": goodsImagesList[$(this).data("index")].productSkn,
"__index":item.length,
"index":$(this).data("index")
};
... ... @@ -244,6 +244,30 @@ $(document).on("click",".goods-color a",function(){
item.isDefault=$(this).hasClass("info")?"Y":"N";
});
$(document).on("click","#fenMainSave",function(){
var map={
goodsImagesBoList:[]
};
$.each(goodsImagesList,function(index,item){
if(item.isDefault=="Y"){
map.productSkc=item.productSkc;
map.productSkn=item.productSkn;
}
$.each(item.goodsImagesList,function(_index,_item){
_item.orderBy=_index;
map.goodsImagesBoList.push(_item);
});
});
map.goodsImagesBoList=JSON.stringify(map.goodsImagesBoList);
common.util.__ajax({
url:'/netSale/manageProductImg',
data:{"goodsImagesReq":JSON.stringify(map)}
},function(data){
console.log(data);
});
return false;
});
GOLABDATA.on("weiqingting",function(){
});
... ...
... ... @@ -69,5 +69,13 @@ exports.res = [
params: [
{name: 'param', type: 'Number'}
]
},
{//单独维护封面信息
route:'/netSale/manageProductImg',
method:'POST',
url: '/product/manageProductImg',
params: [
{name: 'goodsImagesReq', type: 'String'}
]
}
];
\ No newline at end of file
... ...