Authored by 郭成尧

Merge branch 'release/4.6' of git.yoho.cn:fe/yohobuy-node into release/4.6

@@ -73,7 +73,7 @@ @@ -73,7 +73,7 @@
73 </p> 73 </p>
74 <div class="goodsList hide"> 74 <div class="goodsList hide">
75 {{#goodsList}} 75 {{#goodsList}}
76 - <div class="list" imgUrl="{{image imagesUrl 220 300}}" url="{{goodsId}}" cover="{{cover1}}"></div> 76 + <li data-src="{{image imagesUrl 235 314}}" data-url="{{../url}}"></li>
77 {{/goodsList}} 77 {{/goodsList}}
78 </div> 78 </div>
79 </div> 79 </div>

2.67 KB | W: | H:

3.62 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
@@ -83,88 +83,12 @@ exports.init = function(num) { @@ -83,88 +83,12 @@ exports.init = function(num) {
83 }); 83 });
84 } 84 }
85 85
86 - // 原来的  
87 - // productList.addHandler('MouseEnter', function(event) {  
88 - // var itemMr = 10, // list的右边距  
89 - // itemMb = 35, // list的下边距  
90 - // ulStr = '',  
91 - // ulNum,  
92 - // wrapperWidth,  
93 - // diffWidth,  
94 - // wrapperX,  
95 - // wrapperY,  
96 - // wrapperPl, // 鼠标移入时弹层的左内边距  
97 - // wrapperPt, // 鼠标移入时弹层的上内边距  
98 - // containerPt, // 商品列表容器的上内边距  
99 - // _from = event.target.attr('data-from') || '';  
100 - //  
101 - // $.ajax({  
102 - // type: 'POST',  
103 - // url: '/product/list/getProductPic',  
104 - // dataType: 'jsonp',  
105 - // jsonp: 'callback',  
106 - // data: {  
107 - // skn: event.target.attr('data-skn'),  
108 - // skc: event.target.attr('data-skc')  
109 - // }  
110 - // }).then(function(res) {  
111 - // var data = res.data,  
112 - // colorList = createColorList(data.pics, _from);  
113 - //  
114 - // removeHtmlFn();  
115 - //  
116 - // ulStr = colorList.colorListStr; // ajax请求的颜色列表  
117 - // ulNum = colorList.ulNum;// ajax请求的颜色的数量  
118 - //  
119 - // $goodInfoMain.append(event.targetDuplicate);  
120 - // $goodSelectColor.append($(ulStr));  
121 - //  
122 - // // 点击收藏商品不需要了  
123 - // // if (data.isFavorite) {  
124 - // // $goodInfoMain.find('.col-btn').addClass('coled');  
125 - // // } else {  
126 - // // $goodInfoMain.find('.col-btn').removeClass('coled');  
127 - // // }  
128 - //  
129 - // wrapperPl = $goodItemWrapper.css('paddingLeft');  
130 - // wrapperPt = $goodItemWrapper.css('paddingTop');  
131 - // containerPt = $goodsContainer.css('paddingTop');  
132 - //  
133 - // wrapperWidth = 10 + (15 + 50) * ulNum + event.targetWidth;  
134 - //  
135 - // // wrapperWidth = $goodItemWrapper.width();  
136 - //  
137 - // wrapperX = (event.targetX - 1) * (event.targetWidth + itemMr) - (parseInt(wrapperPl) + 1);  
138 - // wrapperY = (event.targetY - 1) *  
139 - // (event.targetHeight + itemMb) + parseInt(containerPt) - (parseInt(wrapperPt) + 1);  
140 - //  
141 - // // todo  
142 - // // event.offsetR表示当前列表距离浏览器右侧边缘的距离  
143 - // diffWidth = event.offsetR - ((15 + 50) * ulNum + 25);  
144 - //  
145 - // if (diffWidth <= 0) {  
146 - // wrapperX = wrapperX + diffWidth - 25;  
147 - // }  
148 - // $goodItemWrapper.css({  
149 - // width: wrapperWidth,  
150 - // left: wrapperX,  
151 - // top: wrapperY,  
152 - // display: 'inline-block'  
153 - // });  
154 - //  
155 - // // 鼠标悬浮获取到商品信息后显示第一张图片  
156 - // if (data.pics[0] && data.pics[0].src) {  
157 - // $goodInfoMain.find('.good-thumb img').attr('src', data.pics[0].src);  
158 - // }  
159 - // });  
160 - // });  
161 -  
162 productList.addHandler('MouseEnter', function(event) { 86 productList.addHandler('MouseEnter', function(event) {
163 var itemMr = 10, // list的右边距 87 var itemMr = 10, // list的右边距
164 itemMb = 35, // list的下边距 88 itemMb = 35, // list的下边距
165 - imageList,  
166 colorList, 89 colorList,
167 - pic, pics, 90 + pic,
  91 + pics,
168 ulNum, ulStr, 92 ulNum, ulStr,
169 wrapperWidth, 93 wrapperWidth,
170 diffWidth, 94 diffWidth,
@@ -177,21 +101,13 @@ exports.init = function(num) { @@ -177,21 +101,13 @@ exports.init = function(num) {
177 101
178 102
179 pics = []; 103 pics = [];
180 - event.target.find('.goodsList').find('.list').each(function() {  
181 - pic = {  
182 - url: $(this).attr('url'),  
183 - src: $(this).attr('imgUrl'),  
184 - coverImg: $(this).attr('cover')  
185 - }; 104 + event.target.find('.hideList > li').each(function() {
  105 + pic = $(this).data();
  106 + pic.coverImg = pic.src;
186 pics.push(pic); 107 pics.push(pic);
187 }); 108 });
188 109
189 -  
190 - imageList = {  
191 - pics: pics  
192 - };  
193 -  
194 - colorList = createColorList(imageList.pics, _from); 110 + colorList = createColorList(pics, _from);
195 111
196 removeHtmlFn(); 112 removeHtmlFn();
197 113
@@ -227,8 +143,8 @@ exports.init = function(num) { @@ -227,8 +143,8 @@ exports.init = function(num) {
227 }); 143 });
228 144
229 // 鼠标悬浮获取到商品信息后显示第一张图片 145 // 鼠标悬浮获取到商品信息后显示第一张图片
230 - if (imageList.pics[0] && imageList.pics[0].src) {  
231 - $goodInfoMain.find('.good-thumb img').attr('src', imageList.pics[0].src); 146 + if (pics[0] && pics[0].src) {
  147 + $goodInfoMain.find('.good-thumb img').attr('src', pics[0].src);
232 } 148 }
233 }); 149 });
234 150
@@ -242,11 +158,11 @@ exports.init = function(num) { @@ -242,11 +158,11 @@ exports.init = function(num) {
242 }); 158 });
243 159
244 }; 160 };
245 - 161 +console.log(1111);
246 // 鼠标放在颜色列表上效果 162 // 鼠标放在颜色列表上效果
247 -$(document).on('hover', '.good-select-color li', function() { 163 +$(document).on('mouseenter', '.good-select-color li', function() {
248 var coverImg = $(this).find('img').attr('data-cover'), 164 var coverImg = $(this).find('img').attr('data-cover'),
249 - $coverImg = $(this).closest('.good-item-wrapper').find('.good-detail-img').find('img'); 165 + $coverImg = $(this).closest('.good-item-wrapper').find('.good-detail-img img');
250 166
251 $coverImg.attr('src', coverImg); 167 $coverImg.attr('src', coverImg);
252 }); 168 });
@@ -314,7 +314,7 @@ @@ -314,7 +314,7 @@
314 background: resolve('layout/outlets.png') no-repeat center center; 314 background: resolve('layout/outlets.png') no-repeat center center;
315 width: 200px; 315 width: 200px;
316 height: 34px; 316 height: 34px;
317 - left: 42%; 317 + left: 45%;
318 margin-top: 28px; 318 margin-top: 28px;
319 position: absolute; 319 position: absolute;
320 display: none; 320 display: none;
@@ -437,19 +437,20 @@ @@ -437,19 +437,20 @@
437 top: 30px; 437 top: 30px;
438 right: -14px; 438 right: -14px;
439 width: 378px; 439 width: 378px;
440 - background: #f8f8f8 resolve('layout/empty_car.png') no-repeat 106px 132px;  
441 z-index: 1000; 440 z-index: 1000;
  441 + background: #f8f8f8;
442 display: none; 442 display: none;
443 443
444 .empty-cart { 444 .empty-cart {
445 padding: 280px 0 200px; 445 padding: 280px 0 200px;
446 text-align: center; 446 text-align: center;
  447 + background: resolve('layout/empty_car.png') no-repeat 106px 132px;
447 } 448 }
448 449
449 .loading-cart { 450 .loading-cart {
450 padding: 200px 0; 451 padding: 200px 0;
451 text-align: center; 452 text-align: center;
452 - background: #f8f8f8 reslove('layout/loading.gif') no-repeat center 170px; 453 + background: resolve('layout/loading.gif') no-repeat center 170px;
453 } 454 }
454 455
455 .rich-cart { 456 .rich-cart {
@@ -744,7 +745,6 @@ @@ -744,7 +745,6 @@
744 } 745 }
745 746
746 .sub-nav-list { 747 .sub-nav-list {
747 - padding-left: 15%;  
748 748
749 a { 749 a {
750 color: #222; 750 color: #222;
@@ -760,6 +760,10 @@ @@ -760,6 +760,10 @@
760 li:hover a { 760 li:hover a {
761 border-color: #555; 761 border-color: #555;
762 } 762 }
  763 +
  764 + li:first-child {
  765 + margin-left: 15%;
  766 + }
763 } 767 }
764 } 768 }
765 769
@@ -57,4 +57,8 @@ @@ -57,4 +57,8 @@
57 57
58 } 58 }
59 } 59 }
  60 +
  61 + .brand .attr-content {
  62 + max-width: 730px;
  63 + }
60 } 64 }