Authored by 王水玲

商品列表页标题修改

@@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
6 6
7 var $ = require('jquery'), 7 var $ = require('jquery'),
8 Hammer = require('yoho.hammer'), 8 Hammer = require('yoho.hammer'),
  9 + ellipsis = require('mlellipsis'),
9 lazyLoad = require('yoho.lazyload'); 10 lazyLoad = require('yoho.lazyload');
10 11
11 12
@@ -63,6 +64,8 @@ var $listNav = $('#list-nav'), @@ -63,6 +64,8 @@ var $listNav = $('#list-nav'),
63 introHammer, 64 introHammer,
64 brandColHammer; 65 brandColHammer;
65 66
  67 +ellipsis.init();
  68 +
66 $input.on('input', function() { 69 $input.on('input', function() {
67 if ($input.val() === '') { 70 if ($input.val() === '') {
68 $icon.css('color', '#b2b2b2'); 71 $icon.css('color', '#b2b2b2');
@@ -95,7 +98,9 @@ function search(opt) { @@ -95,7 +98,9 @@ function search(opt) {
95 ext, 98 ext,
96 att, 99 att,
97 nav, navType, 100 nav, navType,
98 - page; 101 + page,
  102 + $this,
  103 + $title;
99 104
100 if (searching) { 105 if (searching) {
101 return; 106 return;
@@ -233,6 +238,12 @@ function search(opt) { @@ -233,6 +238,12 @@ function search(opt) {
233 238
234 window.rePosFooter(); 239 window.rePosFooter();
235 240
  241 + $('.good-detail-text .name').each(function() {
  242 + $this = $(this);
  243 + $title = $this.find('a');
  244 +
  245 + $title[0].mlellipsis(2);
  246 + });
236 247
237 // 用于统计点击了商品列表的第几个商品,序号从1开始计算。 248 // 用于统计点击了商品列表的第几个商品,序号从1开始计算。
238 if (window._yas) { 249 if (window._yas) {
@@ -263,7 +274,7 @@ $.ajax({ @@ -263,7 +274,7 @@ $.ajax({
263 url: '/search/filter', 274 url: '/search/filter',
264 data: defaultOpt, 275 data: defaultOpt,
265 success: function(data) { 276 success: function(data) {
266 - $goodsContainer.append(data); 277 + $goodsContainer.append(data);
267 278
268 //初始化filter&注册filter回调 279 //初始化filter&注册filter回调
269 filter.initFilter({ 280 filter.initFilter({
1 .good-info { 1 .good-info {
2 float: left; 2 float: left;
3 width: 276px; 3 width: 276px;
4 - height: 486px;  
5 - margin: 0 15px 15px; 4 + height: 506px;
  5 + margin: 10px 15px 40px 15px;
6 6
7 .tag-container { 7 .tag-container {
8 height: 28px; 8 height: 28px;
@@ -96,13 +96,15 @@ @@ -96,13 +96,15 @@
96 .good-detail-text { 96 .good-detail-text {
97 .name a { 97 .name a {
98 display: block; 98 display: block;
99 - line-height: 56px;  
100 - overflow: hidden;  
101 - white-space: nowrap; 99 + min-height: 60px;
  100 +/* line-height: 29px;*/
  101 + /*overflow: hidden;*/
  102 +/* white-space: nowrap;
102 text-overflow: ellipsis; 103 text-overflow: ellipsis;
103 - text-decoration: none; 104 + text-decoration: none;*/
104 font-size: 22px; 105 font-size: 22px;
105 color: #444; 106 color: #444;
  107 + margin: 20px 0;
106 } 108 }
107 .price { 109 .price {
108 line-height: 22px; 110 line-height: 22px;