Authored by 沈志敏

fix bug

@@ -14,20 +14,25 @@ var $footer = $('#yoho-footer'), @@ -14,20 +14,25 @@ var $footer = $('#yoho-footer'),
14 var RECID = (new Date().getTime() + '_H5_YOHOBUY_' + Math.floor(Math.random() * 1000000 + 1000000) + 14 var RECID = (new Date().getTime() + '_H5_YOHOBUY_' + Math.floor(Math.random() * 1000000 + 1000000) +
15 '_' + Math.floor(Math.random() * 1000000 + 1000000)); 15 '_' + Math.floor(Math.random() * 1000000 + 1000000));
16 16
17 -var _ChannelVary = {boys: 1, girls: 2, kids: 3, lifestyle: 4}; 17 +var _ChannelVary = {
  18 + boys: 1,
  19 + girls: 2,
  20 + kids: 3,
  21 + lifestyle: 4
  22 +};
18 23
19 function cookie(name) { 24 function cookie(name) {
20 var cookies = document.cookie, 25 var cookies = document.cookie,
21 - cookieVal,  
22 - offset;  
23 -  
24 - if (document.cookie && document.cookie !== '') {  
25 - offset = cookies.indexOf(name + '=');  
26 - if (offset > -1) {  
27 - offset += name.length + 1;  
28 -  
29 - cookieVal = decodeURIComponent($.trim(cookies.substring(offset, cookies.indexOf(';', offset))));  
30 - } 26 + cookieVal;
  27 +
  28 + if (cookies) {
  29 + cookies = cookies.split(';');
  30 + cookies.forEach(function(c) {
  31 + if (c.indexOf(name) > -1) {
  32 + cookieVal = decodeURIComponent($.trim(c.replace(name + '=', '')));
  33 + return;
  34 + }
  35 + });
31 } 36 }
32 37
33 return cookieVal; 38 return cookieVal;
@@ -204,7 +209,9 @@ $.extend({ @@ -204,7 +209,9 @@ $.extend({
204 209
205 // 单击下载按钮 - 接受微信商城或者第三方来源的数据埋点信息 210 // 单击下载按钮 - 接受微信商城或者第三方来源的数据埋点信息
206 if (queryString().union_type) { 211 if (queryString().union_type) {
207 - setCookie('unionTypeYas', queryString().union_type, {path: '/'}); 212 + setCookie('unionTypeYas', queryString().union_type, {
  213 + path: '/'
  214 + });
208 } 215 }
209 216
210 }()); 217 }());
@@ -229,7 +236,7 @@ $.extend({ @@ -229,7 +236,7 @@ $.extend({
229 236
230 uid = uid === 0 ? '' : uid; 237 uid = uid === 0 ? '' : uid;
231 238
232 - window._ozuid = uid;// 暴露ozuid 239 + window._ozuid = uid; // 暴露ozuid
233 240
234 if (window._yas) { 241 if (window._yas) {
235 window._yas(1 * new Date(), '1.0.18', 'yohobuy_m', uid, '', ''); 242 window._yas(1 * new Date(), '1.0.18', 'yohobuy_m', uid, '', '');
@@ -323,7 +330,10 @@ function downLoadApp() { @@ -323,7 +330,10 @@ function downLoadApp() {
323 if (window._yas && window._yas.sendCustomInfo) { 330 if (window._yas && window._yas.sendCustomInfo) {
324 window._yas.sendCustomInfo({ 331 window._yas.sendCustomInfo({
325 op: 'YB_DOWNLOAD_C', 332 op: 'YB_DOWNLOAD_C',
326 - param: JSON.stringify({C_ID: _ChannelVary[cookie('_Channel')] || 1, TO_URL: appUrl}) 333 + param: JSON.stringify({
  334 + C_ID: _ChannelVary[cookie('_Channel')] || 1,
  335 + TO_URL: appUrl
  336 + })
327 }, true); 337 }, true);
328 } 338 }
329 339
@@ -369,6 +379,7 @@ function givePoint(parameter) { @@ -369,6 +379,7 @@ function givePoint(parameter) {
369 (function() { 379 (function() {
370 var channel = cookie('_Channel'); 380 var channel = cookie('_Channel');
371 var header = $('#yoho-header, .homebuttom'); 381 var header = $('#yoho-header, .homebuttom');
  382 + var footer = $('.footer-tab .tab-item.current');
372 383
373 if (!/^\/home/.test(location.pathname)) { 384 if (!/^\/home/.test(location.pathname)) {
374 switch (channel) { 385 switch (channel) {
@@ -399,6 +410,34 @@ function givePoint(parameter) { @@ -399,6 +410,34 @@ function givePoint(parameter) {
399 break; 410 break;
400 } 411 }
401 } 412 }
  413 +
  414 + switch (channel) {
  415 + case 'boys':
  416 + if (footer) {
  417 + footer.addClass('boys');
  418 + }
  419 + break;
  420 + case 'girls':
  421 + if (footer) {
  422 + footer.addClass('girls');
  423 + }
  424 + break;
  425 + case 'lifestyle':
  426 + if (footer) {
  427 + footer.addClass('life-style');
  428 + }
  429 + break;
  430 + case 'kids':
  431 + if (footer) {
  432 + footer.addClass('kids');
  433 + }
  434 + break;
  435 + default:
  436 + if (footer) {
  437 + footer.addClass('boys');
  438 + }
  439 + break;
  440 + }
402 }()); 441 }());
403 442
404 // 暴露公共接口 443 // 暴露公共接口
@@ -23,10 +23,12 @@ window.reMarginFooter('.footer-tab'); @@ -23,10 +23,12 @@ window.reMarginFooter('.footer-tab');
23 23
24 // 部分老用户没有头像,显示默认头像 24 // 部分老用户没有头像,显示默认头像
25 avatar = $userAvatar.data('avatar'); 25 avatar = $userAvatar.data('avatar');
26 -myImage.src = avatar;  
27 -myImage.onload = function() {  
28 - $userAvatar.css('background-image', 'url(' + avatar + ')');  
29 -}; 26 +if (avatar) {
  27 + myImage.src = avatar;
  28 + myImage.onload = function() {
  29 + $userAvatar.css('background-image', 'url(' + avatar + ')');
  30 + };
  31 +}
30 32
31 noticeScroll('.notice', $('.notice').data('time') * 1000); 33 noticeScroll('.notice', $('.notice').data('time') * 1000);
32 34
@@ -36,4 +38,3 @@ $('.yoho-page').on('touchstart', '.list-item, .type-item, .order-title', functio @@ -36,4 +38,3 @@ $('.yoho-page').on('touchstart', '.list-item, .type-item, .order-title', functio
36 }).on('touchend touchcancel', '.list-item, .type-item, .order-title', function() { 38 }).on('touchend touchcancel', '.list-item, .type-item, .order-title', function() {
37 $(this).removeClass('highlight'); 39 $(this).removeClass('highlight');
38 }); 40 });
39 -  
@@ -16,9 +16,18 @@ @@ -16,9 +16,18 @@
16 width: 20%; 16 width: 20%;
17 text-align: center; 17 text-align: center;
18 color: #b0b0b0; 18 color: #b0b0b0;
19 - &.current { 19 + &.current.boys {
20 color: #414141; 20 color: #414141;
21 } 21 }
  22 + &.current.girls {
  23 + color: #ff88ae;
  24 + }
  25 + &.current.kids {
  26 + color: #7ad9f9;
  27 + }
  28 + &.current.lifestyle {
  29 + color: #4f4138;
  30 + }
22 } 31 }
23 .tab-icon { 32 .tab-icon {
24 font-size: 40px; 33 font-size: 40px;