Authored by ZhongW

压缩图片

... ... @@ -201,6 +201,7 @@ require("../util/jquery-ui.min");
r=r.match(/\[.*\]/g)[0];
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);
}
... ...
... ... @@ -21,7 +21,10 @@ window.UMdescriptioner = UM.getEditor('edit-descriptioner');
descriptionEdit.init();
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');
var reg_jpg=new RegExp(".jpg","g");
var reg_png=new RegExp(".png","g");
var reg_gif=new RegExp(".gif","g");
window.NETSALEDATA.productExtBo.productDesc = window.NETSALEDATA.productExtBo.productDesc.replace(reg_jpg,'.jpg?imageView2/0/q/75').replace(reg_png,'.png?imageView2/0/q/75').replace(reg_gif,'.gif?imageView2/0/q/75');
UMdescriptioner.setContent(window.NETSALEDATA.productExtBo.productDesc)
};
... ... @@ -41,7 +44,7 @@ $(document).on("click", "#btn-descriptioner", function () {
$('#productDesc').val(UMdescriptioner.getContent());
descriptionEdit.submit('/product/saveProductDesc', function (option) {
option.data = GOLABDATA.fire('LYproductDesc');
var reg2=new RegExp("\\?imageView2/0/q/65","g");
var reg2=new RegExp("\\?imageView2/0/q/75","g");
option.data.productDesc = option.data.productDesc.replace(reg2,'');
option.success = function (res) {
if (res.code == '200') {
... ... @@ -321,7 +324,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('?'));
... ...