Authored by 沈志敏

个人信息设置

@@ -39,6 +39,12 @@ const component = { @@ -39,6 +39,12 @@ const component = {
39 res.render('index', _.merge(result, data[1])); 39 res.render('index', _.merge(result, data[1]));
40 }).catch(next); 40 }).catch(next);
41 }, 41 },
  42 + mydetails: (req, res) => {
  43 + res.render('mydetails', {
  44 + module: 'home',
  45 + page: 'mydetails'
  46 + });
  47 + },
42 help: (req, res, next) => { 48 help: (req, res, next) => {
43 homeModel.getHelpInfo().then(helpList => { 49 homeModel.getHelpInfo().then(helpList => {
44 res.render('help', { 50 res.render('help', {
@@ -104,8 +110,6 @@ const component = { @@ -104,8 +110,6 @@ const component = {
104 } 110 }
105 }).catch(next); 111 }).catch(next);
106 }, 112 },
107 -  
108 - // 关于我们  
109 aboutUs: (req, res) => { 113 aboutUs: (req, res) => {
110 res.render('about-us', { 114 res.render('about-us', {
111 module: 'home', 115 module: 'home',
@@ -48,6 +48,7 @@ router.post('/save-logistics', refund.saveLogistics); // 退换货 - 添加寄 @@ -48,6 +48,7 @@ router.post('/save-logistics', refund.saveLogistics); // 退换货 - 添加寄
48 router.get('/exchange', exchange.exchange); 48 router.get('/exchange', exchange.exchange);
49 router.get('/exchange/order', exchange.order); 49 router.get('/exchange/order', exchange.order);
50 50
  51 +router.get('/mydetails', home.mydetails); // 个人信息设置
51 router.get('/about-us', home.aboutUs); // 个人中心 - 关于我们 52 router.get('/about-us', home.aboutUs); // 个人中心 - 关于我们
52 53
53 54
  1 +<div class="personal-details" id="details">
  2 + <mydetails gender="women" birthday="1990.07.17"></mydetails>
  3 +</div>
  1 +const Vue = require('yoho-vue');
  2 +const Mydetails = require('home/mydetails.vue');
  3 +
  4 +new Vue({
  5 + el: '#details',
  6 + components: {
  7 + Mydetails
  8 + }
  9 +});
  1 +.personal-details {
  2 + width: 100%;
  3 + height: auto;
  4 + overflow: hidden;
  5 + margin-top: 20px;
  6 + background-color: #fff;
  7 +
  8 + ul {
  9 + width: 95%;
  10 + height: auto;
  11 + overflow: hidden;
  12 + float: right;
  13 +
  14 + li {
  15 + &:first-of-type {
  16 + height: 100px;
  17 + line-height: 100px;
  18 + }
  19 +
  20 + height: 80px;
  21 + border-bottom: 1px solid #e0e0e0;
  22 +
  23 + .details-icon {
  24 + float: right;
  25 + height: 90px;
  26 + margin-right: 15px;
  27 +
  28 + .icon {
  29 + vertical-align: middle;
  30 + color: #b0b0b0;
  31 + }
  32 + }
  33 +
  34 + .user-avatar {
  35 + display: inline-block;
  36 + width: 100%;
  37 + height: 100%;
  38 + background-image: resolve("home/user-icon.png");
  39 + background-size: 100%;
  40 + }
  41 +
  42 + .head-portrait {
  43 + width: 90px;
  44 + height: 90px;
  45 + overflow: hidden;
  46 + border-radius: 50%;
  47 + border: 1px solid #eee;
  48 + vertical-align: middle;
  49 + }
  50 +
  51 + > label {
  52 + width: 100%;
  53 + height: 100%;
  54 + line-height: 80px;
  55 + font-size: 32px;
  56 + margin-right: 8%;
  57 + text-overflow: ellipsis;
  58 + white-space: nowrap;
  59 + overflow: hidden;
  60 + display: inline-block;
  61 +
  62 + .details-nickname,
  63 + .details-gender,
  64 + .details-birthday {
  65 + text-align: right;
  66 + float: right;
  67 + margin-right: 40px;
  68 + color: #b0b0b0;
  69 + }
  70 + }
  71 + }
  72 + }
  73 +}
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 @import "help"; 2 @import "help";
3 @import "feedback"; 3 @import "feedback";
4 @import "fav"; 4 @import "fav";
  5 +@import "details";
5 @import "about-us"; 6 @import "about-us";
6 @import "coin"; 7 @import "coin";
7 @import "logistics"; 8 @import "logistics";
  1 +<template>
  2 + <ul>
  3 + <li>
  4 + <label>头像
  5 + <span class="details-icon">
  6 + <span class="head-portrait user-avatar" data-avatar="{{head_ico}}"></span>
  7 + <span class="icon icon-right"></span>
  8 + </span>
  9 + </label>
  10 + </li>
  11 + <li>
  12 + <label>昵称<input class="details-nickname" v-model='nickname'></label>
  13 + </li>
  14 + <li>
  15 + <label>性别<span class="details-gender">{{ gender }}</span></label>
  16 + </li>
  17 + <li>
  18 + <label>生日<span class="details-birthday">{{ birthday }}</span></label>
  19 + </li>
  20 + </ul>
  21 +</template>
  22 +
  23 +<script>
  24 + module.exports = {
  25 + props: ['head_ico', 'nickname', 'gender', 'birthday'],
  26 + data() {
  27 + return {
  28 + };
  29 + }
  30 + };
  31 +</script>