Authored by 2586703@qq.com

Merge branch 'develop' of http://git.dev.yoho.cn/ued/yohogirls-frontend into develop

冲突调试
Conflicts:
	web/js/public.js
	web/package.json
@@ -8,8 +8,14 @@ window.tmp$ = null; @@ -8,8 +8,14 @@ window.tmp$ = null;
8 var $ = require('jquery'), 8 var $ = require('jquery'),
9 Swiper = require("yoho-idangerous.swiper"); 9 Swiper = require("yoho-idangerous.swiper");
10 require("lazyload"); 10 require("lazyload");
  11 +
11 $(".lazy").lazyload(); 12 $(".lazy").lazyload();
12 13
  14 +//菜单初始化所使用变量
  15 +var menuTmpl = $("#menuItemTmpl").html(),
  16 + dataKey = null,
  17 + mustache = require("mustache");
  18 +
13 $.fn.top = function() { 19 $.fn.top = function() {
14 if (arguments.length > 0) { 20 if (arguments.length > 0) {
15 $(this).css("top", arguments[0]); 21 $(this).css("top", arguments[0]);
@@ -28,8 +34,6 @@ $.fn.left = function() { @@ -28,8 +34,6 @@ $.fn.left = function() {
28 } 34 }
29 }; 35 };
30 36
31 -  
32 -  
33 $(".lazy").lazyload(); 37 $(".lazy").lazyload();
34 38
35 //扩展jquery================================================================= 39 //扩展jquery=================================================================
@@ -130,16 +134,9 @@ $(window).scroll(function() { @@ -130,16 +134,9 @@ $(window).scroll(function() {
130 }).show(); 134 }).show();
131 minMenuHasShow = true; 135 minMenuHasShow = true;
132 $(".enterprise-header-fixed").show(); 136 $(".enterprise-header-fixed").show();
133 - $(".search-input-box").hide();  
134 - $(".home-search-button").hide();  
135 window.isSearching = false; 137 window.isSearching = false;
136 138
137 - //$(".search-text").width(73);  
138 - $(".search-text").find(".search-text-content").html("Search...");  
139 - $(".search-input-box").val("").hide().trigger("blur");  
140 - $(".search-area").find(".icons").show();  
141 - $(".home-search-button").hide();  
142 - window.isSearching = false; 139 + $(document.body).trigger("click");
143 } else if (scrollTop < 177 && minMenuHasShow === true) { 140 } else if (scrollTop < 177 && minMenuHasShow === true) {
144 $(".search-input-box").trigger("blur"); 141 $(".search-input-box").trigger("blur");
145 $("#maxEnterprise").css({ 142 $("#maxEnterprise").css({
@@ -147,16 +144,10 @@ $(window).scroll(function() { @@ -147,16 +144,10 @@ $(window).scroll(function() {
147 }); 144 });
148 $(".enterprise-header-fixed").hide(); 145 $(".enterprise-header-fixed").hide();
149 $("#minEnterprise").hide(); 146 $("#minEnterprise").hide();
150 - $(".search-input-box").hide();  
151 - $(".home-search-button").hide();  
152 window.isSearching = false; 147 window.isSearching = false;
153 minMenuHasShow = false; 148 minMenuHasShow = false;
154 //搜索归位 149 //搜索归位
155 - $(".search-text").find(".search-text-content").html("Search...");  
156 - $(".search-input-box").val("").hide().trigger("blur");  
157 - $(".search-area").find(".icons").show();  
158 - $(".home-search-button").hide();  
159 - window.isSearching = false; 150 + $(document.body).trigger("click");
160 } 151 }
161 152
162 if (scrollTop > 0 && isTop === true) { 153 if (scrollTop > 0 && isTop === true) {
@@ -282,13 +273,13 @@ function getBrowType() { @@ -282,13 +273,13 @@ function getBrowType() {
282 var info = {}; 273 var info = {};
283 var sUserAgent = navigator.userAgent.toLowerCase(); 274 var sUserAgent = navigator.userAgent.toLowerCase();
284 info.bIsIpad = sUserAgent.match(/ipad/i) == "ipad"; 275 info.bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
285 - // info.bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";  
286 - // info.bIsMidp = sUserAgent.match(/midp/i) == "midp";  
287 - // info.bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";  
288 - // info.bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";  
289 - // info.bIsAndroid = sUserAgent.match(/android/i) == "android";  
290 - // info.bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";  
291 - // info.bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile"; 276 + // info.bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
  277 + // info.bIsMidp = sUserAgent.match(/midp/i) == "midp";
  278 + // info.bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
  279 + // info.bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
  280 + // info.bIsAndroid = sUserAgent.match(/android/i) == "android";
  281 + // info.bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
  282 + // info.bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
292 return info; 283 return info;
293 } 284 }
294 285
@@ -301,7 +292,7 @@ if (!isIpad && $(".share").size() > 0) { @@ -301,7 +292,7 @@ if (!isIpad && $(".share").size() > 0) {
301 if (shareOffsetTop - scrollTop - navHeight <= 0) { 292 if (shareOffsetTop - scrollTop - navHeight <= 0) {
302 $(".share").css({ 293 $(".share").css({
303 "position": "fixed", 294 "position": "fixed",
304 - "top": navHeight + 10 295 + "top": navHeight
305 }); 296 });
306 } else { 297 } else {
307 $(".share").css({ 298 $(".share").css({
@@ -312,18 +303,6 @@ if (!isIpad && $(".share").size() > 0) { @@ -312,18 +303,6 @@ if (!isIpad && $(".share").size() > 0) {
312 }); 303 });
313 } 304 }
314 305
315 -window.scrollWindow = function() {  
316 - if (document.body.clientWidth >= 1190) {  
317 - //document.body.scrollTop=850;  
318 - window.tmp$(window).scrollTop(850);  
319 -  
320 - } else if (document.body.clientWidth < 1190 && document.body.clientWidth > 768) {  
321 - window.tmp$(window).scrollTop(700);  
322 -  
323 - } else if (document.body.clientWidth <= 768) {  
324 - window.tmp$(window).scrollTop(600);  
325 - }  
326 -};  
327 //搜索按钮=========================================================================== 306 //搜索按钮===========================================================================
328 var clientWidth = $(window).width(); 307 var clientWidth = $(window).width();
329 $(".search-input-box").keypress(function(event) { 308 $(".search-input-box").keypress(function(event) {
@@ -354,7 +333,7 @@ $(document.body).click(function() { @@ -354,7 +333,7 @@ $(document.body).click(function() {
354 if (clientWidth <= 768) { 333 if (clientWidth <= 768) {
355 target.parent().removeAttr("style"); 334 target.parent().removeAttr("style");
356 target.css({ 335 target.css({
357 - width: "auto" 336 + width: "65px"
358 }); 337 });
359 } else { 338 } else {
360 target.animate({ 339 target.animate({
@@ -369,26 +348,28 @@ $(".search-text").click(function() { @@ -369,26 +348,28 @@ $(".search-text").click(function() {
369 }); 348 });
370 349
371 $(".search-text").click(function() { 350 $(".search-text").click(function() {
  351 + var clientWidth = document.body.clientWidth,
  352 + parent = null;
372 $(this).find(".search-text-content").hide(); 353 $(this).find(".search-text-content").hide();
373 - 354 + parent = $(this).parent();
374 if (clientWidth <= 768) { 355 if (clientWidth <= 768) {
375 - $(this).parent().width(131);  
376 - $(this).find(".home-search-button").show();  
377 - $(this).find(".search-input-box").width(80).val("").show();  
378 - $(this).find(".search-input-box").focus(); 356 + parent.width(131);
  357 + parent.find(".home-search-button").show();
  358 + parent.find(".search-input-box").width(80).val("").show();
  359 + parent.find(".search-input-box").focus();
379 $(this).width(120); 360 $(this).width(120);
380 - } else if (clientWidth >= 924 && clientWidth < 1080) {  
381 - $(this).parent().width(198);  
382 - $(this).find(".search-input-box").width(150).val("").show(); 361 + } else if (clientWidth >= 924 && clientWidth < 1190) {
  362 + parent.width(198);
  363 + parent.find(".search-input-box").width(150).val("").show();
383 $(this).animate({ 364 $(this).animate({
384 width: 190 365 width: 190
385 }, 500, function() { 366 }, 500, function() {
386 $(this).find(".home-search-button").show(); 367 $(this).find(".home-search-button").show();
387 $(this).find(".search-input-box").focus(); 368 $(this).find(".search-input-box").focus();
388 }); 369 });
389 - } else {  
390 - $(this).parent().width(218);  
391 - $(this).find(".search-input-box").width(150).val("").show(); 370 + } else if (clientWidth >= 1190) {
  371 + parent.width(218);
  372 + parent.find(".search-input-box").width(150).val("").show();
392 $(this).animate({ 373 $(this).animate({
393 width: 190 374 width: 190
394 }, 500, function() { 375 }, 500, function() {
@@ -402,7 +383,6 @@ $(".search-text").click(function() { @@ -402,7 +383,6 @@ $(".search-text").click(function() {
402 383
403 window.scrollWindow = function() { 384 window.scrollWindow = function() {
404 if (document.body.clientWidth >= 1190) { 385 if (document.body.clientWidth >= 1190) {
405 - //document.body.scrollTop=850;  
406 window.tmp$(window).scrollTop(850); 386 window.tmp$(window).scrollTop(850);
407 387
408 } else if (document.body.clientWidth < 1190 && document.body.clientWidth > 768) { 388 } else if (document.body.clientWidth < 1190 && document.body.clientWidth > 768) {
@@ -411,4 +391,26 @@ window.scrollWindow = function() { @@ -411,4 +391,26 @@ window.scrollWindow = function() {
411 } else if (document.body.clientWidth <= 768) { 391 } else if (document.body.clientWidth <= 768) {
412 window.tmp$(window).scrollTop(600); 392 window.tmp$(window).scrollTop(600);
413 } 393 }
414 -};  
  394 +};
  395 +
  396 +//初始化菜单============================================================================
  397 +
  398 +$.ajax({
  399 + url: "http://newgirls.test.yoho.cn/default/default/getnewest",
  400 + dataType: "jsonp",
  401 + jsonp: "callback",
  402 + success: function(tmp) {
  403 + var data = tmp.data,
  404 + dataKey = null,
  405 + mustacheHtml = null,
  406 + _html = null;
  407 + for (dataKey in data) {
  408 + mustacheHtml = mustache.render(menuTmpl, data);
  409 + _html = $(".submenu-" + dataKey).html();
  410 + $(".submenu-" + dataKey).html(mustacheHtml + _html);
  411 + }
  412 +
  413 +
  414 + }
  415 +});
  416 +//====================================================================================
@@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
26 "yoho-tips": "0.0.1", 26 "yoho-tips": "0.0.1",
27 "mustache": "2.0.0", 27 "mustache": "2.0.0",
28 "jquery.autocomplete": "~0.0.2", 28 "jquery.autocomplete": "~0.0.2",
29 - "mlellipsis": "0.0.3", 29 + "mlellipsis": "~0.0.3",
30 "jquery.rotate2d": "0.0.3" 30 "jquery.rotate2d": "0.0.3"
31 }, 31 },
32 "devDependencies": { 32 "devDependencies": {
@@ -103,7 +103,7 @@ @@ -103,7 +103,7 @@
103 float:left; 103 float:left;
104 position:relative; 104 position:relative;
105 105
106 - .link{ 106 + .menu-link{
107 @include blockwh(100%,100%); 107 @include blockwh(100%,100%);
108 cursor:pointer; 108 cursor:pointer;
109 position:absolute; 109 position:absolute;
@@ -127,7 +127,7 @@ @@ -127,7 +127,7 @@
127 height:100%; 127 height:100%;
128 } 128 }
129 } 129 }
130 - .text{ 130 + .menu-text{
131 @include blockwh(298px,auto); 131 @include blockwh(298px,auto);
132 font-size:18px; 132 font-size:18px;
133 line-height:22px; 133 line-height:22px;
@@ -141,7 +141,7 @@ @@ -141,7 +141,7 @@
141 color:#000; 141 color:#000;
142 } 142 }
143 } 143 }
144 - .detail{margin-top:10px;} 144 + .menu-detail{margin-top:10px;}
145 } 145 }
146 } 146 }
147 .menu-item{ 147 .menu-item{
@@ -1276,20 +1276,20 @@ @@ -1276,20 +1276,20 @@
1276 1276
1277 1277
1278 .submenu-fashion { 1278 .submenu-fashion {
1279 - left:-1px; 1279 + left:0px;
1280 1280
1281 } 1281 }
1282 .submenu-sports { 1282 .submenu-sports {
1283 - left:-288px; 1283 + left:-287px;
1284 } 1284 }
1285 .submenu-lifestyle { 1285 .submenu-lifestyle {
1286 - left:-419px; 1286 + left:-418px;
1287 } 1287 }
1288 .submenu-video { 1288 .submenu-video {
1289 - left:-568px; 1289 + left:-567px;
1290 } 1290 }
1291 .submenu-beauty { 1291 .submenu-beauty {
1292 - left:-147px; 1292 + left:-146px;
1293 } 1293 }
1294 1294
1295 1295
@@ -57,7 +57,7 @@ @@ -57,7 +57,7 @@
57 margin:0 auto; 57 margin:0 auto;
58 position:relative; 58 position:relative;
59 .submenu{ 59 .submenu{
60 - width:668px; 60 + width:628px;
61 height:395px; 61 height:395px;
62 background:url(../assets/images/submenubackground.png); 62 background:url(../assets/images/submenubackground.png);
63 position:absolute; 63 position:absolute;
@@ -1151,16 +1151,16 @@ @@ -1151,16 +1151,16 @@
1151 1151
1152 } 1152 }
1153 .submenu-sports { 1153 .submenu-sports {
1154 - left:--213px; 1154 + left:-177px;
1155 } 1155 }
1156 .submenu-lifestyle { 1156 .submenu-lifestyle {
1157 - left:--286px; 1157 + left:-254px;
1158 } 1158 }
1159 .submenu-video { 1159 .submenu-video {
1160 - left:-369px; 1160 + left:-329px;
1161 } 1161 }
1162 .submenu-beauty { 1162 .submenu-beauty {
1163 - left:-124px; 1163 + left:-88px;
1164 } 1164 }
1165 1165
1166 1166
@@ -814,7 +814,7 @@ @@ -814,7 +814,7 @@
814 width:295px; 814 width:295px;
815 height:176px; 815 height:176px;
816 background:url(../assets/images/followusbackground.png) 0 -190px; 816 background:url(../assets/images/followusbackground.png) 0 -190px;
817 - margin-top:32px; 817 + margin:32px 0 20px 0;
818 .title{ 818 .title{
819 @include blockwh(100%,70px); 819 @include blockwh(100%,70px);
820 line-height:90px; 820 line-height:90px;