Authored by 沈志敏

Merge branch 'release/wap-optim' of git.yoho.cn:fe/yohobuywap-node into release/wap-optim

1 {{# shopIndex}} 1 {{# shopIndex}}
2 - <div class="shop-index yoho-page scroll-wrapper" id="wrapper"> 2 + <div class="shop-index yoho-page scroll-wrapper new-shop" id="wrapper">
3 3
4 <div id="scroller"> 4 <div id="scroller">
5 <div id="nav-top"> 5 <div id="nav-top">
@@ -54,9 +54,7 @@ @@ -54,9 +54,7 @@
54 <div id="home-page" class="main"> 54 <div id="home-page" class="main">
55 <div id="nav-main" class="nav-main"> 55 <div id="nav-main" class="nav-main">
56 <!-- 优惠卷 --> 56 <!-- 优惠卷 -->
57 - {{#if shopCoupons}}  
58 - {{> shop/shop-coupon}}  
59 - {{/if}} 57 + <div class="coupon-group"></div>
60 58
61 <!-- 大导航 --> 59 <!-- 大导航 -->
62 {{#if brandList}} 60 {{#if brandList}}
@@ -115,7 +115,7 @@ var defaultOpt = require('../common/query-param'); @@ -115,7 +115,7 @@ var defaultOpt = require('../common/query-param');
115 channel: defaultOpt.channel 115 channel: defaultOpt.channel
116 }, 116 },
117 success: function(data) { 117 success: function(data) {
118 - $goodsContainer.append(data); 118 + $('.shop-index').after(data);
119 119
120 // 初始化filter&注册filter回调 120 // 初始化filter&注册filter回调
121 filter.initFilter({ 121 filter.initFilter({
@@ -344,10 +344,13 @@ function tabChange(dom, index) { @@ -344,10 +344,13 @@ function tabChange(dom, index) {
344 // 首页导航 344 // 首页导航
345 (function(nav, posNav, main) { 345 (function(nav, posNav, main) {
346 var scrollToNav1 = function() { 346 var scrollToNav1 = function() {
347 - window.scrollTo(0, $('#nav').offset().top + 5); 347 + setTimeout(function(){
  348 + window.scrollTo(0, $('#nav').offset().top + 5);
  349 + }, 100)
348 }; 350 };
349 351
350 $(nav + ' li, ' + posNav + ' li').not('li.all-goods').on('touchstart', function() { 352 $(nav + ' li, ' + posNav + ' li').not('li.all-goods').on('touchstart', function() {
  353 + var isPos = $(this).parent().attr('id') === 'pos-nav';
351 var index = $(this).index(), 354 var index = $(this).index(),
352 activeTab = $(this).attr('tab'); 355 activeTab = $(this).attr('tab');
353 356
@@ -362,17 +365,17 @@ function tabChange(dom, index) { @@ -362,17 +365,17 @@ function tabChange(dom, index) {
362 $('#' + activeTab).fadeIn(); 365 $('#' + activeTab).fadeIn();
363 if (activeTab === 'new-arrival') { 366 if (activeTab === 'new-arrival') {
364 toTop = true; 367 toTop = true;
365 - newData(scrollToNav1); 368 + newData(isPos ? scrollToNav1 : function() {});
366 viewType = 2; 369 viewType = 2;
367 } else if (activeTab === 'popularity') { 370 } else if (activeTab === 'popularity') {
368 toTop = true; 371 toTop = true;
369 - hotData(scrollToNav1); 372 + hotData(isPos ? scrollToNav1 : function() {});
370 viewType = 3; 373 viewType = 3;
371 } else if (activeTab === 'home-page') { 374 } else if (activeTab === 'home-page') {
372 $nav1.removeClass('fixed-top absolute'); 375 $nav1.removeClass('fixed-top absolute');
373 $nav2.removeClass('fixed-top absolute'); 376 $nav2.removeClass('fixed-top absolute');
374 viewType = 1; 377 viewType = 1;
375 - scrollToNav1(); 378 + isPos && scrollToNav1();
376 } 379 }
377 scH = $('#scroller').outerHeight(); 380 scH = $('#scroller').outerHeight();
378 }); 381 });
@@ -742,6 +745,7 @@ $newList.on('touchstart', 'li', function(e) { @@ -742,6 +745,7 @@ $newList.on('touchstart', 'li', function(e) {
742 }, function() { 745 }, function() {
743 }); 746 });
744 } 747 }
  748 + e.stopPropagation();
745 749
746 }); 750 });
747 751
@@ -753,7 +757,9 @@ $(document).on('touchstart', function(e) { @@ -753,7 +757,9 @@ $(document).on('touchstart', function(e) {
753 } 757 }
754 }); 758 });
755 function subNavScrollTo() { 759 function subNavScrollTo() {
756 - window.scrollTo(0, $('#list-nav').offset().top + 5); 760 + setTimeout(function() {
  761 + window.scrollTo(0, $('#list-nav').offset().top + 5);
  762 + }, 100)
757 } 763 }
758 $subNav.on('touchend touchcancel', function(e) { 764 $subNav.on('touchend touchcancel', function(e) {
759 var $this = $(e.target).closest('li'), 765 var $this = $(e.target).closest('li'),
@@ -910,7 +916,6 @@ $subNav.on('touchend touchcancel', function(e) { @@ -910,7 +916,6 @@ $subNav.on('touchend touchcancel', function(e) {
910 url: '/product/search/search', 916 url: '/product/search/search',
911 nextPage: false 917 nextPage: false
912 }, function() { 918 }, function() {
913 - subNavScrollTo();  
914 }); 919 });
915 } 920 }
916 } 921 }
@@ -10,7 +10,7 @@ shopCoupon = { @@ -10,7 +10,7 @@ shopCoupon = {
10 common: { 10 common: {
11 appVersion: window.queryString.app_version || window.queryString.appVersion, 11 appVersion: window.queryString.app_version || window.queryString.appVersion,
12 uid: window.queryString.uid, 12 uid: window.queryString.uid,
13 - shopId: parseInt($('.shop-id').val(), 10) || null, 13 + shopId: parseInt($('.shop-id').val() || $('.shopId').val(), 10) || null,
14 brandId: parseInt($('.brand-header').data('id'), 10) || null, 14 brandId: parseInt($('.brand-header').data('id'), 10) || null,
15 couponTemplate: require('product/shop/coupon.hbs') 15 couponTemplate: require('product/shop/coupon.hbs')
16 }, 16 },
1 .shop-index { 1 .shop-index {
2 - /*position: absolute; 2 + position: absolute;
3 top: 0; 3 top: 0;
4 bottom: 0; 4 bottom: 0;
5 left: 0; 5 left: 0;
6 right: 0; 6 right: 0;
7 - overflow: hidden;*/  
8 - #pos-nav, #pos-list {  
9 - position: fixed;  
10 - left: 0;  
11 - top: 0; 7 + overflow: hidden;
12 8
  9 + &.new-shop {
  10 + position: initial;
  11 + overflow: initial;
  12 + #pos-nav, #pos-list {
  13 + position: fixed;
  14 + left: 0;
  15 + top: 0;
  16 + }
  17 + .nav {
  18 + li {
  19 + height: 100%;
  20 + line-height: 100%;
  21 + margin-top: 0px;
  22 + border-left: none;
  23 + .text {
  24 + display: block;
  25 + width: 100%;
  26 + border-left: 1px solid #e0e0e0;
  27 + margin-top: 30px;
  28 + height: 28px;
  29 + }
  30 + &:first-child {
  31 + .text {
  32 + border-left: none;
  33 + }
  34 + }
  35 + }
  36 + }
  37 + .shop-foot-wrapper {
  38 + position: fixed;
  39 + left: 0;
  40 + }
13 } 41 }
  42 +
  43 +
14 .nav-main { 44 .nav-main {
15 margin-bottom: 30px; 45 margin-bottom: 30px;
16 } 46 }
@@ -90,25 +120,18 @@ @@ -90,25 +120,18 @@
90 120
91 li{ 121 li{
92 display: block; 122 display: block;
93 - height: 100%;  
94 - line-height: 100%; 123 + height: 28px;
95 float: left; 124 float: left;
  125 + line-height: 28px;
96 width: 24.7%; 126 width: 24.7%;
97 text-align: center; 127 text-align: center;
  128 + border-left: 1px solid #e0e0e0;
  129 + margin-top: 30px;
98 border-sizing: border-box; 130 border-sizing: border-box;
99 color: #b0b0b0; 131 color: #b0b0b0;
100 - .text {  
101 - display: block;  
102 - width: 100%;  
103 - border-left: 1px solid #e0e0e0;  
104 - margin-top: 30px;  
105 - height: 28px;  
106 - } 132 +
107 &:first-child { 133 &:first-child {
108 border-left: none; 134 border-left: none;
109 - .text {  
110 - border-left: none;  
111 - }  
112 } 135 }
113 136
114 a { 137 a {
@@ -417,9 +440,8 @@ @@ -417,9 +440,8 @@
417 } 440 }
418 441
419 .shop-foot-wrapper { 442 .shop-foot-wrapper {
420 - position: fixed; 443 + position: absolute;
421 bottom: 0; 444 bottom: 0;
422 - left: 0;  
423 display: table; 445 display: table;
424 width: 100%; 446 width: 100%;
425 height: 88px; 447 height: 88px;
@@ -623,9 +645,9 @@ @@ -623,9 +645,9 @@
623 } 645 }
624 646
625 .shop-index + .filter-mask { 647 .shop-index + .filter-mask {
  648 + margin-top: 1px;
626 649
627 .filter-body { 650 .filter-body {
628 - top: 1px;  
629 overflow: auto; 651 overflow: auto;
630 } 652 }
631 653
@@ -634,8 +656,17 @@ @@ -634,8 +656,17 @@
634 } 656 }
635 657
636 &.call-by-fix { 658 &.call-by-fix {
  659 + top: 78px;
  660 + }
  661 +}
  662 +.new-shop + .filter-mask {
  663 + margin-top: initial;
  664 + position: fixed;
  665 + top: 46px;
  666 +
  667 + &.call-by-fix {
637 top: 80px; 668 top: 80px;
638 position: fixed; 669 position: fixed;
639 left: 0; 670 left: 0;
640 } 671 }
641 -} 672 +}
@@ -22,4 +22,7 @@ @@ -22,4 +22,7 @@
22 @import "product/search/list"; 22 @import "product/search/list";
23 @import "product/sale/sale"; 23 @import "product/sale/sale";
24 @import "product/shop/shop-index"; 24 @import "product/shop/shop-index";
  25 +@import "product/shop/shop-prodfile";
  26 +@import "product/shop/product-category";
  27 +@import "product/shop/shop-index-coupon";
25 @import "home/hot-category"; 28 @import "home/hot-category";