Authored by lijing

vipinfo

@@ -11,6 +11,7 @@ @@ -11,6 +11,7 @@
11 const favApi = global.yoho.FavAPI; 11 const favApi = global.yoho.FavAPI;
12 const api = global.yoho.API; 12 const api = global.yoho.API;
13 const helpers = global.yoho.helpers; 13 const helpers = global.yoho.helpers;
  14 +const camelCase = global.yoho.camelCase;
14 15
15 /** 16 /**
16 * 个人详情数据 17 * 个人详情数据
@@ -81,7 +82,6 @@ const index = (params) => { @@ -81,7 +82,6 @@ const index = (params) => {
81 Object.assign(finalResult, { 82 Object.assign(finalResult, {
82 profileName: result[0].data.profile_name, 83 profileName: result[0].data.profile_name,
83 headIco: result[0].data.head_ico, 84 headIco: result[0].data.head_ico,
84 - curLevel: result[0].data.cur_level,  
85 vipInfo: result[0].data.vip_info 85 vipInfo: result[0].data.vip_info
86 }); 86 });
87 } 87 }
@@ -112,7 +112,7 @@ const index = (params) => { @@ -112,7 +112,7 @@ const index = (params) => {
112 } 112 }
113 113
114 114
115 - return finalResult; 115 + return camelCase(finalResult);
116 }); 116 });
117 }; 117 };
118 118
  1 +
  2 +require('./recommend-for-you-user-center');
  3 +
  4 +/**
  5 + * 个人中心首页
  6 + * @author: bikai<kai.bi@yoho.cn>
  7 + * @date: 2015/11/12
  8 + */
  9 +var $ = require('yoho-jquery'),
  10 + noticeScroll = require('../plugin/notice-scroll');
  11 +
  12 +var $userAvatar = $('.user-avatar'),
  13 + $listItem = $('.list-item');
  14 +var myImage = new Image(),
  15 + avatar;
1 require('../common'); 16 require('../common');
2 require('./recommend-for-you-user-center'); 17 require('./recommend-for-you-user-center');
  18 +require('../product/suspend-cart.js');
  19 +
  20 +// 部分老用户没有头像,显示默认头像
  21 +avatar = $userAvatar.data('avatar');
  22 +myImage.src = avatar;
  23 +myImage.onload = function() {
  24 + $userAvatar.css('background-image', 'url(' + avatar + ')');
  25 +};
  26 +
  27 +noticeScroll('.notice', $('.notice').data('time') * 1000);
  28 +
  29 +$('.yoho-page').on('touchstart', '.list-item, .type-item, .order-title', function() {
  30 + $listItem.removeClass('highlight');
  31 + $(this).addClass('highlight');
  32 +}).on('touchend touchcancel', '.list-item, .type-item, .order-title', function() {
  33 + $(this).removeClass('highlight');
  34 +});
  35 +
  1 +/**
  2 + * 悬浮购物车
  3 + * @author: xuqi<qi.xu@yoho.cn>
  4 + * @date: 2015/11/1
  5 + */
  6 +
  7 +var $ = require('yoho-jquery');
  8 +
  9 +var $cart = $('#suspend-cart');
  10 +
  11 +$.ajax({
  12 + type: 'GET',
  13 + url: '/cart/index/count',
  14 + success: function(data) {
  15 + var count;
  16 +
  17 + if (data.code === 200) {
  18 + count = data.data.cart_goods_count;
  19 + if (count > 99) {
  20 + count = '99+';
  21 + }
  22 + if (count === 0) {
  23 + $('.cart-count').remove();
  24 + }
  25 + $cart.find('.cart-count').html(count).removeClass('hide');
  26 + }
  27 + }
  28 +});
@@ -89,7 +89,7 @@ @@ -89,7 +89,7 @@
89 padding: 6px 0; 89 padding: 6px 0;
90 text-align: center; 90 text-align: center;
91 background: rgba(0,0,0,0.8); 91 background: rgba(0,0,0,0.8);
92 - height: 76px; 92 + height: 89px;
93 93
94 .link-item { 94 .link-item {
95 position: relative; 95 position: relative;