Authored by 郭成尧

'uercenter-bug-fix'

@@ -80,10 +80,14 @@ const _infoNum = (params) => { @@ -80,10 +80,14 @@ const _infoNum = (params) => {
80 * @param params 80 * @param params
81 */ 81 */
82 const _getAddressData = (params) => { 82 const _getAddressData = (params) => {
83 - return api.get('', {  
84 - method: 'app.address.gethidden',  
85 - uid: params.uid  
86 - }, {code: 200}); 83 + if (params.uid) {
  84 + return api.get('', {
  85 + method: 'app.address.gethidden',
  86 + uid: params.uid
  87 + }, {code: 200});
  88 + } else {
  89 + return false;
  90 + }
87 }; 91 };
88 92
89 /** 93 /**
@@ -102,7 +106,8 @@ const index = (params) => { @@ -102,7 +106,8 @@ const index = (params) => {
102 cartUrl: helpers.urlFormat('/cart/index/index'), 106 cartUrl: helpers.urlFormat('/cart/index/index'),
103 signinUrl: helpers.urlFormat('/signin.html', { 107 signinUrl: helpers.urlFormat('/signin.html', {
104 refer: helpers.urlFormat('/home') 108 refer: helpers.urlFormat('/home')
105 - }) 109 + }),
  110 + verifyUrl: helpers.urlFormat('/activity/student/register')
106 }; 111 };
107 112
108 return api.all([ 113 return api.all([
@@ -116,7 +121,8 @@ const index = (params) => { @@ -116,7 +121,8 @@ const index = (params) => {
116 Object.assign(finalResult, { 121 Object.assign(finalResult, {
117 profileName: result[0].data.profile_name, 122 profileName: result[0].data.profile_name,
118 headIco: result[0].data.head_ico, 123 headIco: result[0].data.head_ico,
119 - vipInfo: result[0].data.vip_info 124 + vipInfo: result[0].data.vip_info,
  125 + students: _.get(result[0].data, 'vip_info.is_student', 0) === 1
120 }); 126 });
121 } 127 }
122 128
1 <div class="my-page yoho-page"> 1 <div class="my-page yoho-page">
2 <div class="my-header"> 2 <div class="my-header">
3 {{#isLogin}} 3 {{#isLogin}}
4 - <a class="user-info" href="/home/mydetails">  
5 - <span class="user-avatar" data-avatar="{{image headIco 128 128}}"></span>  
6 - <span class="username">{{profileName}}</span>  
7 - {{#vipInfo}}  
8 - <span class="vip-icon vip-{{cur_level}}"></span>  
9 - {{/vipInfo}}  
10 - <div class="iconfont more-icon tap-hightlight">&#xe604;</div>  
11 - </a>  
12 - {{/isLogin}}  
13 - {{^isLogin}}  
14 - <div class="user-info">  
15 - <a class="login-btn" href="{{signinUrl}}">  
16 - 登录/注册 4 + <a class="user-info" href="/home/mydetails">
  5 + <span class="user-avatar" data-avatar="{{image headIco 128 128}}"></span>
  6 + <span class="username">{{profileName}}</span>
  7 + {{#vipInfo}}
  8 + <span class="vip-icon vip-{{cur_level}}"></span>
  9 + {{/vipInfo}}
  10 +
  11 + {{#if students}}
  12 + <span class="vip-icon students"></span>
  13 + {{/if}}
  14 + <div class="iconfont more-icon tap-hightlight">&#xe604;</div>
17 </a> 15 </a>
18 - </div> 16 + {{#unless students}}
  17 + <a class="students-entry" href="{{verifyUrl}}">学生认证</a>
  18 + {{/unless}}
  19 + {{^}}
  20 + <div class="user-info">
  21 + <a class="login-btn" href="{{signinUrl}}">
  22 + 登录/注册
  23 + </a>
  24 + <a class="students-entry" href="{{verifyUrl}}">学生认证</a>
  25 + </div>
19 {{/isLogin}} 26 {{/isLogin}}
20 </div> 27 </div>
21 <div class="my-link clearfix {{^isLogin}}no-login{{/isLogin}}"> 28 <div class="my-link clearfix {{^isLogin}}no-login{{/isLogin}}">
@@ -6,6 +6,26 @@ @@ -6,6 +6,26 @@
6 color: #444; 6 color: #444;
7 } 7 }
8 8
  9 + .my-header {
  10 + position: relative;
  11 +
  12 + .students-entry {
  13 + display: block;
  14 + width: 120px;
  15 + height: 40px;
  16 + line-height: 40px;
  17 + border-top-left-radius: 40px;
  18 + border-bottom-left-radius: 40px;
  19 + background: #d0021b;
  20 + color: #fff;
  21 + padding-left: 20px;
  22 + position: absolute;
  23 + top: 20px;
  24 + right: 0;
  25 + font-size: 24px;
  26 + }
  27 + }
  28 +
9 .user-info { 29 .user-info {
10 display: block; 30 display: block;
11 position: relative; 31 position: relative;
@@ -67,7 +87,7 @@ @@ -67,7 +87,7 @@
67 text-align: center; 87 text-align: center;
68 88
69 &.highlight { 89 &.highlight {
70 - background: rgba(200, 200, 200, 0.1)!important; 90 + background: rgba(200, 200, 200, 0.1) !important;
71 } 91 }
72 } 92 }
73 } 93 }
@@ -107,13 +127,13 @@ @@ -107,13 +127,13 @@
107 } 127 }
108 128
109 &:after { 129 &:after {
110 - content: ''; 130 + content: "";
111 position: absolute; 131 position: absolute;
112 right: 0; 132 right: 0;
113 top: 24px; 133 top: 24px;
114 width: 0; 134 width: 0;
115 height: 44px; 135 height: 44px;
116 - border-right: 1px solid #fff; 136 + border-right: 4px solid #fff;
117 } 137 }
118 138
119 &:last-of-type:after { 139 &:last-of-type:after {
@@ -250,7 +270,7 @@ @@ -250,7 +270,7 @@
250 } 270 }
251 271
252 &:after { 272 &:after {
253 - content: ''; 273 + content: "";
254 position: absolute; 274 position: absolute;
255 right: 0; 275 right: 0;
256 bottom: 0; 276 bottom: 0;