Authored by ZhongW

图片压缩

... ... @@ -200,6 +200,7 @@ require("../util/jquery-ui.min");
var json = eval('('+r+')');
for (var i = 0; i < json.length; i++) {
json[i].url = json[i].url + "?imageView2/0/w/120/q/75";
Base.callback(me.editor, me.dialog, json[i].url, json[i].state);
}
... ... @@ -524,7 +525,10 @@ require("../util/jquery-ui.min");
}
var list = Base.getAllPic(sel, $w, editor);
/*$.each(list,function (index,item){
item.src = item.src + "imageView2/0/q/75";
item._src = item._src + "imageView2/0/q/75";
})*/
if (index != -1) {
editor.execCommand('insertimage', list);
}
... ...
... ... @@ -24,14 +24,14 @@ 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) {
var reg1=new RegExp(".jpg","g");
window.NETSALEDATA.productExtBo.productDesc = window.NETSALEDATA.productExtBo.productDesc.replace(reg1,'.jpg?imageView2/0/q/65');
window.NETSALEDATA.productExtBo.productDesc = window.NETSALEDATA.productExtBo.productDesc.replace(reg1,'.jpg?imageView2/0/q/75');
UMdescriptioner.setContent(window.NETSALEDATA.productExtBo.productDesc)
};
/*保存描述*/
$(document).on("click", "#btn-descriptioner", function () {
var content = UMdescriptioner.getContent();
var reg2=new RegExp("\\?imageView2/0/q/65","g");
var reg2=new RegExp("\\?imageView2/0/q/75","g");
content = content.replace(reg2,'');
common.util.__ajax({
url:'/product/saveProductDesc',
... ... @@ -282,7 +282,7 @@ 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';
_item.imageUrl = _item.imageUrl + '?imageView2/0/q/75';
}
if(!flag && _item.imageUrl.indexOf('?') > 0){
_item.imageUrl = _item.imageUrl.substring(0,_item.imageUrl.indexOf('?'));
... ...