Authored by ZhongW

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

@@ -23,7 +23,7 @@ module.exports=function(app) { @@ -23,7 +23,7 @@ module.exports=function(app) {
23 } 23 }
24 }); 24 });
25 25
26 - app.get("/","common.index"); 26 + app.get("/","common.Index");
27 27
28 app.get("/error", "common.Error"); 28 app.get("/error", "common.Error");
29 29
@@ -200,6 +200,7 @@ require("../util/jquery-ui.min"); @@ -200,6 +200,7 @@ require("../util/jquery-ui.min");
200 var json = eval('('+r+')'); 200 var json = eval('('+r+')');
201 201
202 for (var i = 0; i < json.length; i++) { 202 for (var i = 0; i < json.length; i++) {
  203 + json[i].url = json[i].url + "?imageView2/0/w/120/q/75";
203 Base.callback(me.editor, me.dialog, json[i].url, json[i].state); 204 Base.callback(me.editor, me.dialog, json[i].url, json[i].state);
204 } 205 }
205 206
@@ -524,7 +525,10 @@ require("../util/jquery-ui.min"); @@ -524,7 +525,10 @@ require("../util/jquery-ui.min");
524 } 525 }
525 526
526 var list = Base.getAllPic(sel, $w, editor); 527 var list = Base.getAllPic(sel, $w, editor);
527 - 528 + /*$.each(list,function (index,item){
  529 + item.src = item.src + "imageView2/0/q/75";
  530 + item._src = item._src + "imageView2/0/q/75";
  531 + })*/
528 if (index != -1) { 532 if (index != -1) {
529 editor.execCommand('insertimage', list); 533 editor.execCommand('insertimage', list);
530 } 534 }
@@ -20,20 +20,27 @@ if (window.NETSALEDATA && window.NETSALEDATA.baseProductInfo && window.NETSALEDA @@ -20,20 +20,27 @@ if (window.NETSALEDATA && window.NETSALEDATA.baseProductInfo && window.NETSALEDA
20 20
21 21
22 22
23 -  
24 /*商品描述*/ 23 /*商品描述*/
25 window.UMdescriptioner = UM.getEditor('edit-descriptioner'); 24 window.UMdescriptioner = UM.getEditor('edit-descriptioner');
26 if (window.NETSALEDATA && window.NETSALEDATA.productExtBo.productDesc && window.NETSALEDATA.productExtBo.productDesc) { 25 if (window.NETSALEDATA && window.NETSALEDATA.productExtBo.productDesc && window.NETSALEDATA.productExtBo.productDesc) {
  26 + var reg_jpg=new RegExp(".jpg","g");
  27 + var reg_png=new RegExp(".png","g");
  28 + var reg_gif=new RegExp(".gif","g");
  29 + 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');
  30 + window.NETSALEDATA.productExtBo.productDesc = window.NETSALEDATA.productExtBo.productDesc.replace(reg1,'.jpg?imageView2/0/q/75');
27 UMdescriptioner.setContent(window.NETSALEDATA.productExtBo.productDesc) 31 UMdescriptioner.setContent(window.NETSALEDATA.productExtBo.productDesc)
28 }; 32 };
29 33
30 /*保存描述*/ 34 /*保存描述*/
31 $(document).on("click", "#btn-descriptioner", function () { 35 $(document).on("click", "#btn-descriptioner", function () {
  36 + var content = UMdescriptioner.getContent();
  37 + var reg2=new RegExp("\\?imageView2/0/q/75","g");
  38 + content = content.replace(reg2,'');
32 common.util.__ajax({ 39 common.util.__ajax({
33 url:'/product/saveProductDesc', 40 url:'/product/saveProductDesc',
34 data:{ 41 data:{
35 productSkn:productSkn, 42 productSkn:productSkn,
36 - productDesc:UMdescriptioner.getContent() 43 + productDesc:content
37 } 44 }
38 }); 45 });
39 }); 46 });
@@ -274,12 +281,26 @@ if (!count && goodsList[0]) { @@ -274,12 +281,26 @@ if (!count && goodsList[0]) {
274 } 281 }
275 renderGoodList(); 282 renderGoodList();
276 283
277 -function renderGoodList() { 284 +function changeImgQuality(flag){
  285 + $.each(goodsList,function (index,item){
  286 + $.each(item.goodsImagesList, function (_index, _item) {
  287 + if(flag && _item.imageUrl.indexOf('?') == -1){
  288 + _item.imageUrl = _item.imageUrl + '?imageView2/0/q/75';
  289 + }
  290 + if(!flag && _item.imageUrl.indexOf('?') > 0){
  291 + _item.imageUrl = _item.imageUrl.substring(0,_item.imageUrl.indexOf('?'));
  292 + }
  293 + });
  294 + })
  295 +}
  296 +
  297 +function renderGoodList() {
278 var map = { 298 var map = {
279 "男": 1, 299 "男": 1,
280 "女": 2 300 "女": 2
281 }; 301 };
282 var gender = map[window.NETSALEDATA.baseProductInfo.baseProduct.gender]||3; 302 var gender = map[window.NETSALEDATA.baseProductInfo.baseProduct.gender]||3;
  303 + changeImgQuality(true);
283 $("#fenmianWrap").html(common.util.__template2($("#fenmianTemp").html(), { 304 $("#fenmianWrap").html(common.util.__template2($("#fenmianTemp").html(), {
284 goodsList: goodsList, 305 goodsList: goodsList,
285 gender:gender 306 gender:gender
@@ -484,7 +505,7 @@ function getFenManData () { @@ -484,7 +505,7 @@ function getFenManData () {
484 goodsImagesBoList: [] 505 goodsImagesBoList: []
485 }, 506 },
486 msg = ''; 507 msg = '';
487 - 508 + changeImgQuality(false);
488 $.each(goodsList, function (index, item) { 509 $.each(goodsList, function (index, item) {
489 if (item.isDefault == "Y") { 510 if (item.isDefault == "Y") {
490 map.productSkc = item.productSkc; 511 map.productSkc = item.productSkc;