Authored by ZhongW

Merge branch 'hotfix_网销页面图片下载大小' into gray

... ... @@ -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);
}
... ...
... ... @@ -20,6 +20,11 @@ var descriptionEdit = new common.edit('#descriptionerWrap');
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");
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)
};
... ... @@ -37,8 +42,10 @@ GOLABDATA.on("LYproductDesc", function () {
$(document).on("click", "#btn-descriptioner", function () {
$('#productDesc').val(UMdescriptioner.getContent());
descriptionEdit.submit('/product/saveProductDesc', function (option) {
descriptionEdit.submit('/product/saveProductDesc', function (option) {
option.data = GOLABDATA.fire('LYproductDesc');
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') {
descriptionEdit.$tip(res.message, function () {
... ... @@ -313,12 +320,26 @@ if (!count && goodsList[0]) {
}
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/75';
}
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
... ... @@ -515,7 +536,7 @@ GOLABDATA.on("fenmian", function () {
goodsImagesBoList: []
},
errorMsg = '';
changeImgQuality(false);
$.each(goodsList, function (index, item) {
if (item.isDefault == "Y") {
map.productSkc = item.productSkc;
... ...