Authored by wenjiekong

添加userjs

  1 +/**
  2 + * 个人中心---编辑个人资料
  3 + * @author gaohongwei <hongwei.gao@yoho.cn>
  4 + * @date: 2016/8/16
  5 + */
  6 +'use strict';
  7 +
  8 +const mRoot = '../models';
  9 +const user = require(`${mRoot}/user-service`); // user model
  10 +
  11 +/**
  12 + * 个人中心
  13 + * @param {[type]} req [description]
  14 + * @param {[type]} res [description]
  15 + * @return {[type]} [description]
  16 + */
  17 +exports.index = (req,res,next) => {
  18 + let responseData = {
  19 + module: 'home',
  20 + page: 'user',
  21 + footerTop: true
  22 + };
  23 +
  24 + return responseData;
  25 +}
  1 +/**
  2 + * 个人中心 编辑资料api
  3 + * @author: gaohongwei<hongwei.gao@yoho.cn>
  4 + * @date: 2016/8/16
  5 + */
  6 +const api = global.yoho.API;
  7 +
  8 +const getUserInfo = uid => {
  9 + return api.get('', {
  10 + method: 'app.passport.profile',
  11 + uid: uid
  12 + });
  13 +};
  1 +/**
  2 + * 个人中心 编辑资料models
  3 + * @author: gaohongwei<hongwei.gao@yoho.cn>
  4 + * @date: 2016/8/16
  5 + */
  6 +
  7 +'use strict';
  8 +const Promise = require('bluebird');
  9 +const co = Promise.coroutine;
  10 +const userApi = require('./user-api');
  11 +
  12 +const getUserInfo = uid => {
  13 + return co(function *() {
  14 + let result = {};
  15 + let userInfo = userApi.getUserInfo(uid);
  16 + })();
  17 +};
@@ -23,6 +23,7 @@ const RedenvelopesController=require(`${cRoot}/Redenvelopes`); @@ -23,6 +23,7 @@ const RedenvelopesController=require(`${cRoot}/Redenvelopes`);
23 const VipController=require(`${cRoot}/vip`); 23 const VipController=require(`${cRoot}/vip`);
24 const FavoriteController=require(`${cRoot}/Favorite`); 24 const FavoriteController=require(`${cRoot}/Favorite`);
25 const CouponsController=require(`${cRoot}/coupons`); 25 const CouponsController=require(`${cRoot}/coupons`);
  26 +const UserController = require(`${cRoot}/user`);
26 27
27 const homeNav = [ 28 const homeNav = [
28 { 29 {
@@ -142,6 +143,8 @@ router.get('/redenvelopes',RedenvelopesController.index); @@ -142,6 +143,8 @@ router.get('/redenvelopes',RedenvelopesController.index);
142 /*我的VIP*/ 143 /*我的VIP*/
143 router.get('/vip',VipController.index); 144 router.get('/vip',VipController.index);
144 145
  146 +router.get('/user',UserController.index);
  147 +
145 router.get('/favorite',FavoriteController.index); 148 router.get('/favorite',FavoriteController.index);
146 149
147 router.get('/coupons',CouponsController.index); 150 router.get('/coupons',CouponsController.index);
@@ -261,6 +261,7 @@ @@ -261,6 +261,7 @@
261 @import "my-vip"; 261 @import "my-vip";
262 @import "coupons"; 262 @import "coupons";
263 @import "favorite"; 263 @import "favorite";
  264 +@import "user-info";
264 /* 265 /*
265 266
266 @import "user-info"; 267 @import "user-info";
@@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
27 display: none; 27 display: none;
28 } 28 }
29 h2.title { 29 h2.title {
30 - background-image:resolve(/home/edit/title-informations.png); 30 + background-image:resolve(home/edit/title-informations.png);
31 } 31 }
32 } 32 }
33 33
@@ -84,7 +84,7 @@ @@ -84,7 +84,7 @@
84 .title h2{ 84 .title h2{
85 width: 66px; 85 width: 66px;
86 height: 16px; 86 height: 16px;
87 - background: resolve(/home/edit/title-address.png) no-repeat; 87 + background: resolve(home/edit/title-address.png) no-repeat;
88 text-indent: -999em; 88 text-indent: -999em;
89 float: left; 89 float: left;
90 position: absolute; 90 position: absolute;
@@ -131,14 +131,14 @@ @@ -131,14 +131,14 @@
131 131
132 .btn-c3 { 132 .btn-c3 {
133 height: 22px; 133 height: 22px;
134 - background: resolve(/home/edit/btn_hs.png) no-repeat left -66px; 134 + background: resolve(home/edit/btn_hs.png) no-repeat left -66px;
135 padding-left: 8px; 135 padding-left: 8px;
136 display: inline-block; 136 display: inline-block;
137 137
138 span { 138 span {
139 height: 22px; 139 height: 22px;
140 line-height: 21px; 140 line-height: 21px;
141 - background: resolve(/home/edit/btn_hs.png) no-repeat right -66px; 141 + background: resolve(home/edit/btn_hs.png) no-repeat right -66px;
142 padding-right: 10px; 142 padding-right: 10px;
143 display: inline-block; 143 display: inline-block;
144 cursor: pointer; 144 cursor: pointer;
@@ -148,7 +148,7 @@ @@ -148,7 +148,7 @@
148 148
149 .btn-c2 { 149 .btn-c2 {
150 height: 22px; 150 height: 22px;
151 - background: resolve(/home/edit/btn_hs.png) no-repeat left -44px; 151 + background: resolve(home/edit/btn_hs.png) no-repeat left -44px;
152 padding-left: 8px; 152 padding-left: 8px;
153 display: inline-block; 153 display: inline-block;
154 } 154 }
@@ -156,7 +156,7 @@ @@ -156,7 +156,7 @@
156 .btn-c2 span { 156 .btn-c2 span {
157 height: 22px; 157 height: 22px;
158 line-height: 21px; 158 line-height: 21px;
159 - background: resolve(/home/edit/btn_hs.png) no-repeat right -44px; 159 + background: resolve(home/edit/btn_hs.png) no-repeat right -44px;
160 padding-right: 10px; 160 padding-right: 10px;
161 display: inline-block; 161 display: inline-block;
162 cursor: pointer; 162 cursor: pointer;
@@ -236,7 +236,7 @@ @@ -236,7 +236,7 @@
236 line-height: 20px; 236 line-height: 20px;
237 color: #333; 237 color: #333;
238 border: 1px #c9c9c9 solid; 238 border: 1px #c9c9c9 solid;
239 - background: resolve(/home/edit/input_1.png) repeat-x #fff; 239 + background: resolve(home/edit/input_1.png) repeat-x #fff;
240 vertical-align: top; 240 vertical-align: top;
241 } 241 }
242 242
@@ -244,7 +244,7 @@ @@ -244,7 +244,7 @@
244 width: 118px; 244 width: 118px;
245 height: 34px; 245 height: 34px;
246 border: 0px; 246 border: 0px;
247 - background: resolve(/home/edit/btn_b1.png) no-repeat; 247 + background: resolve(home/edit/btn_b1.png) no-repeat;
248 color: #fff; 248 color: #fff;
249 font-size: 14px; 249 font-size: 14px;
250 font-weight: bold; 250 font-weight: bold;
@@ -278,7 +278,7 @@ @@ -278,7 +278,7 @@
278 height: 21px; 278 height: 21px;
279 line-height: 21px; 279 line-height: 21px;
280 padding-left: 23px; 280 padding-left: 23px;
281 - background: resolve(/home/edit/ico_arrow2.png) no-repeat 5px 5px #efefef; 281 + background: resolve(home/edit/ico_arrow2.png) no-repeat 5px 5px #efefef;
282 border: 1px #e6e6e6 solid; 282 border: 1px #e6e6e6 solid;
283 font-size: 12px; 283 font-size: 12px;
284 color: #333; 284 color: #333;
@@ -294,7 +294,7 @@ @@ -294,7 +294,7 @@
294 .btn-edit { 294 .btn-edit {
295 width: 37px; 295 width: 37px;
296 height: 17px; 296 height: 17px;
297 - background: resolve(/home/edit/btn_edit.png) no-repeat; 297 + background: resolve(home/edit/btn_edit.png) no-repeat;
298 display: inline-block; 298 display: inline-block;
299 overflow: hidden; 299 overflow: hidden;
300 border: 0px; 300 border: 0px;
@@ -364,7 +364,7 @@ @@ -364,7 +364,7 @@
364 line-height: 20px; 364 line-height: 20px;
365 border: 0px; 365 border: 0px;
366 padding-left: 18px; 366 padding-left: 18px;
367 - background: resolve(/home/edit/ico_del.png) no-repeat 0px 2px; 367 + background: resolve(home/edit/ico_del.png) no-repeat 0px 2px;
368 color: #468fa2; 368 color: #468fa2;
369 display: inline-block; 369 display: inline-block;
370 overflow: hidden; 370 overflow: hidden;
@@ -381,7 +381,7 @@ @@ -381,7 +381,7 @@
381 line-height: 20px; 381 line-height: 20px;
382 padding: 0px; 382 padding: 0px;
383 margin: 0px; 383 margin: 0px;
384 - background: resolve(/home/edit/btn_s1_z2.png) repeat-x; 384 + background: resolve(home/edit/btn_s1_z2.png) repeat-x;
385 text-align: center; 385 text-align: center;
386 display: inline-block; 386 display: inline-block;
387 cursor: pointer; 387 cursor: pointer;
@@ -459,10 +459,10 @@ @@ -459,10 +459,10 @@
459 } 459 }
460 460
461 .icon-ok { 461 .icon-ok {
462 - background: resolve(/home/edit/icon-32.png) no-repeat 0 0; 462 + background: resolve(home/edit/icon-32.png) no-repeat 0 0;
463 } 463 }
464 .icon-warning { 464 .icon-warning {
465 - background: resolve(/home/edit/icon-32.png) no-repeat 0 -32px; 465 + background: resolve(home/edit/icon-32.png) no-repeat 0 -32px;
466 } 466 }
467 467
468 .account-type { 468 .account-type {
@@ -475,14 +475,14 @@ @@ -475,14 +475,14 @@
475 475
476 .button-icon20 { 476 .button-icon20 {
477 padding-left: 5px; 477 padding-left: 5px;
478 - background: resolve(/home/edit/btn_bg_20.png) no-repeat left 0px; 478 + background: resolve(home/edit/btn_bg_20.png) no-repeat left 0px;
479 display: inline-block; 479 display: inline-block;
480 cursor: pointer; 480 cursor: pointer;
481 } 481 }
482 482
483 .button-icon20 i { 483 .button-icon20 i {
484 font-style: normal; 484 font-style: normal;
485 - background: resolve(/home/edit/btn_bg_20.png) repeat-x left -20px; 485 + background: resolve(home/edit/btn_bg_20.png) repeat-x left -20px;
486 display: inline-block; 486 display: inline-block;
487 height: 20px; 487 height: 20px;
488 line-height: 20px; 488 line-height: 20px;
@@ -494,7 +494,7 @@ @@ -494,7 +494,7 @@
494 width: 52px; 494 width: 52px;
495 } 495 }
496 .button-icon20 span { 496 .button-icon20 span {
497 - background: resolve(/home/edit/btn_bg_20.png) no-repeat right -40px; 497 + background: resolve(home/edit/btn_bg_20.png) no-repeat right -40px;
498 display: inline-block; 498 display: inline-block;
499 padding-right: 5px; 499 padding-right: 5px;
500 } 500 }
@@ -528,7 +528,7 @@ @@ -528,7 +528,7 @@
528 line-height: 20px; 528 line-height: 20px;
529 color: #333; 529 color: #333;
530 border: 1px #c9c9c9 solid; 530 border: 1px #c9c9c9 solid;
531 - background: resolve(/home/edit/input_1.png) repeat-x #fff; 531 + background: resolve(home/edit/input_1.png) repeat-x #fff;
532 } 532 }
533 533
534 .gift-error { 534 .gift-error {
@@ -554,7 +554,7 @@ @@ -554,7 +554,7 @@
554 } 554 }
555 555
556 .form-error { 556 .form-error {
557 - background: resolve(/home/onError.png) no-repeat 5px 9px #fff2e8; 557 + background: resolve(home/onError.png) no-repeat 5px 9px #fff2e8;
558 padding-left: 25px; 558 padding-left: 25px;
559 padding-right: 5px; 559 padding-right: 5px;
560 font-size: 12px; 560 font-size: 12px;
@@ -566,7 +566,7 @@ @@ -566,7 +566,7 @@
566 } 566 }
567 567
568 .form-success { 568 .form-success {
569 - background: resolve(/home/onCorrect.png) no-repeat 5px 9px #E9FFEB; 569 + background: resolve(home/onCorrect.png) no-repeat 5px 9px #E9FFEB;
570 padding-left: 25px; 570 padding-left: 25px;
571 padding-right: 5px; 571 padding-right: 5px;
572 font-size: 12px; 572 font-size: 12px;
@@ -578,7 +578,7 @@ @@ -578,7 +578,7 @@
578 } 578 }
579 579
580 .form-prompt,.form-focus { 580 .form-prompt,.form-focus {
581 - background: resolve(/home/onShow.png) no-repeat 5px 9px; 581 + background: resolve(home/onShow.png) no-repeat 5px 9px;
582 padding-left: 25px; 582 padding-left: 25px;
583 font-size: 12px; 583 font-size: 12px;
584 line-height: 30px; 584 line-height: 30px;
@@ -588,7 +588,7 @@ @@ -588,7 +588,7 @@
588 } 588 }
589 589
590 .form-focus { 590 .form-focus {
591 - background: resolve(/home/onShow.png) no-repeat 5px 9px #E9F0FF; 591 + background: resolve(home/onShow.png) no-repeat 5px 9px #E9F0FF;
592 color: #666; 592 color: #666;
593 } 593 }
594 594
@@ -602,7 +602,7 @@ @@ -602,7 +602,7 @@
602 line-height: 21px; 602 line-height: 21px;
603 padding-left: 23px; 603 padding-left: 23px;
604 margin-left: 10px; 604 margin-left: 10px;
605 - background: resolve(/home/edit/ico_arrow2.png) no-repeat 5px 5px #efefef; 605 + background: resolve(home/edit/ico_arrow2.png) no-repeat 5px 5px #efefef;
606 border: 1px #e6e6e6 solid; 606 border: 1px #e6e6e6 solid;
607 font-size: 12px; 607 font-size: 12px;
608 color: #333; 608 color: #333;
@@ -640,7 +640,7 @@ @@ -640,7 +640,7 @@
640 line-height: 25px; 640 line-height: 25px;
641 padding-left: 25px; 641 padding-left: 25px;
642 color: #000; 642 color: #000;
643 - background: resolve(/home/edit/ico_i_sf.png) no-repeat; 643 + background: resolve(home/edit/ico_i_sf.png) no-repeat;
644 } 644 }
645 645
646 .fail { 646 .fail {
@@ -689,7 +689,7 @@ @@ -689,7 +689,7 @@
689 overflow: hidden; 689 overflow: hidden;
690 690
691 .form-success { 691 .form-success {
692 - background: resolve(/home/onCorrect.png) no-repeat 5px 9px; 692 + background: resolve(home/onCorrect.png) no-repeat 5px 9px;
693 } 693 }
694 694
695 .progress-bar { 695 .progress-bar {
@@ -711,15 +711,15 @@ @@ -711,15 +711,15 @@
711 } 711 }
712 712
713 .progress1 { 713 .progress1 {
714 - background: resolve(/home/edit/icon-bar.png) no-repeat; 714 + background: resolve(home/edit/icon-bar.png) no-repeat;
715 } 715 }
716 716
717 .progress2 { 717 .progress2 {
718 - background: resolve(/home/edit/icon-bar.png) no-repeat 0 -24px; 718 + background: resolve(home/edit/icon-bar.png) no-repeat 0 -24px;
719 } 719 }
720 720
721 .progress3 { 721 .progress3 {
722 - background: resolve(/home/edit/icon-bar.png) no-repeat 0 -48px; 722 + background: resolve(home/edit/icon-bar.png) no-repeat 0 -48px;
723 } 723 }
724 724
725 input[type=text],input[type=password] { 725 input[type=text],input[type=password] {
@@ -808,7 +808,7 @@ @@ -808,7 +808,7 @@
808 dt { 808 dt {
809 height: 20px; 809 height: 20px;
810 line-height: 20px; 810 line-height: 20px;
811 - background: resolve(/home/suggest-icon.png) no-repeat 2px 3px; 811 + background: resolve(home/suggest-icon.png) no-repeat 2px 3px;
812 padding: 0px 0px 0px 20px; 812 padding: 0px 0px 0px 20px;
813 float: left; 813 float: left;
814 font-family: arial,"Microsoft YaHei"; 814 font-family: arial,"Microsoft YaHei";
@@ -831,7 +831,7 @@ @@ -831,7 +831,7 @@
831 line-height: 21px; 831 line-height: 21px;
832 border: 0px; 832 border: 0px;
833 text-align: center; 833 text-align: center;
834 - background: resolve(/home/btn_top.png) no-repeat; 834 + background: resolve(home/btn_top.png) no-repeat;
835 color: #666; 835 color: #666;
836 font-size: 12px; 836 font-size: 12px;
837 cursor: pointer; 837 cursor: pointer;
@@ -934,10 +934,10 @@ @@ -934,10 +934,10 @@
934 } 934 }
935 935
936 .res-success { 936 .res-success {
937 - background: resolve(/home/icon-24.png) no-repeat; 937 + background: resolve(home/icon-24.png) no-repeat;
938 } 938 }
939 .res-error { 939 .res-error {
940 - background: resolve(/home/icon-24.png) no-repeat 0 -24px; 940 + background: resolve(home/icon-24.png) no-repeat 0 -24px;
941 color: red; 941 color: red;
942 } 942 }
943 } 943 }