Authored by ZhongW

降低图片质量

... ... @@ -20,20 +20,22 @@ if (window.NETSALEDATA && window.NETSALEDATA.baseProductInfo && window.NETSALEDA
/*商品描述*/
window.UMdescriptioner = UM.getEditor('edit-descriptioner');
if (window.NETSALEDATA && window.NETSALEDATA.productExtBo.productDesc && window.NETSALEDATA.productExtBo.productDesc) {
window.NETSALEDATA.productExtBo.productDesc = window.NETSALEDATA.productExtBo.productDesc.replace(".jpg",'.jpg?imageView2/0/q/10');
UMdescriptioner.setContent(window.NETSALEDATA.productExtBo.productDesc)
};
/*保存描述*/
$(document).on("click", "#btn-descriptioner", function () {
var content = UMdescriptioner.getContent();
content = content.replace("?imageView2/0/q/10",'');
common.util.__ajax({
url:'/product/saveProductDesc',
data:{
productSkn:productSkn,
productDesc:UMdescriptioner.getContent()
productDesc:content
}
});
});
... ... @@ -274,12 +276,26 @@ if (!count && goodsList[0]) {
}
renderGoodList();
function renderGoodList() {
function changeImgQuality(flag){
$.each(goodsList,function (index,item){
$.each(item.goodsImagesList, function (_index, _item) {
if(flag && _item.imageUrl.indexOf('?') == -1){
_item.imageUrl = _item.imageUrl + '?imageView2/0/q/10';
}
if(!flag && _item.imageUrl.indexOf('?') > 0){
_item.imageUrl = _item.imageUrl.substring(0,_item.imageUrl.indexOf('?'));
}
});
})
}
function renderGoodList() {
var map = {
"男": 1,
"女": 2
};
var gender = map[window.NETSALEDATA.baseProductInfo.baseProduct.gender]||3;
changeImgQuality(true);
$("#fenmianWrap").html(common.util.__template2($("#fenmianTemp").html(), {
goodsList: goodsList,
gender:gender
... ... @@ -484,7 +500,7 @@ function getFenManData () {
goodsImagesBoList: []
},
msg = '';
changeImgQuality(false);
$.each(goodsList, function (index, item) {
if (item.isDefault == "Y") {
map.productSkc = item.productSkc;
... ...