Authored by wenjiekong

添加保存基本信息接口

@@ -40,18 +40,10 @@ exports.index = (req, res, next) => { @@ -40,18 +40,10 @@ exports.index = (req, res, next) => {
40 * @return {[type]} [description] 40 * @return {[type]} [description]
41 */ 41 */
42 exports.editUserInfo = (req, res, next) => { 42 exports.editUserInfo = (req, res, next) => {
43 - let channel = req.query.channel || req.cookies._Channel || 'boys';  
44 43
45 let uid = '8039836'; 44 let uid = '8039836';
46 45
47 - let responseData = {  
48 - module: 'home',  
49 - page: 'user'  
50 - };  
51 -  
52 // 真实数据输出 46 // 真实数据输出
53 - userService.editUserInfo(req, uid).then(result => {  
54 -  
55 - }).catch(next); 47 + userService.editUserInfo(req, uid).then().catch(next);
56 48
57 }; 49 };
@@ -63,6 +63,7 @@ const editUserInfo = (userInfo) => { @@ -63,6 +63,7 @@ const editUserInfo = (userInfo) => {
63 63
64 module.exports = { 64 module.exports = {
65 getUserInfo, 65 getUserInfo,
  66 + editUserInfo,
66 getUserContactInfo, 67 getUserContactInfo,
67 getProviceCityInfo, 68 getProviceCityInfo,
68 getUserHabitsInfo, 69 getUserHabitsInfo,
@@ -72,18 +72,18 @@ const configData = { @@ -72,18 +72,18 @@ const configData = {
72 value: '1', 72 value: '1',
73 text: '目的型购物' 73 text: '目的型购物'
74 }, 74 },
75 - {  
76 - type: 'radio',  
77 - key: 'shopping',  
78 - value: '2',  
79 - text: '冲动型购物'  
80 - },  
81 - {  
82 - type: 'radio',  
83 - key: 'shopping',  
84 - value: '3',  
85 - text: '保守型购物'  
86 - }], 75 + {
  76 + type: 'radio',
  77 + key: 'shopping',
  78 + value: '2',
  79 + text: '冲动型购物'
  80 + },
  81 + {
  82 + type: 'radio',
  83 + key: 'shopping',
  84 + value: '3',
  85 + text: '保守型购物'
  86 + }],
87 87
88 // 着装习惯 88 // 着装习惯
89 dressHabits: [{ 89 dressHabits: [{
@@ -93,49 +93,49 @@ const configData = { @@ -93,49 +93,49 @@ const configData = {
93 value: '1', 93 value: '1',
94 text: '正装' 94 text: '正装'
95 }, 95 },
96 - {  
97 - type: 'checkbox',  
98 - key: 'dress[]',  
99 - index: 'dress-2',  
100 - value: '2',  
101 - text: '商务'  
102 - },  
103 - {  
104 - type: 'checkbox',  
105 - key: 'dress[]',  
106 - index: 'dress-3',  
107 - value: '3',  
108 - text: '街头流行'  
109 - },  
110 - {  
111 - type: 'checkbox',  
112 - key: 'dress[]',  
113 - index: 'dress-4',  
114 - value: '4',  
115 - text: '运动休闲'  
116 - },  
117 - {  
118 - type: 'checkbox',  
119 - key: 'dress[]',  
120 - index: 'dress-5',  
121 - value: '5',  
122 - text: '文艺气质'  
123 - },  
124 - {  
125 - type: 'checkbox',  
126 - key: 'dress[]',  
127 - index: 'dress-6',  
128 - value: '6',  
129 - text: '甜美可爱'  
130 - },  
131 - {  
132 - type: 'checkbox',  
133 - key: 'dress[]',  
134 - index: 'dress-7',  
135 - value: '7',  
136 - text: '另类'  
137 - }],  
138 - headDefaultImgIcon: '//img10.static.yhbimg.com/headimg/' + 96 + {
  97 + type: 'checkbox',
  98 + key: 'dress[]',
  99 + index: 'dress-2',
  100 + value: '2',
  101 + text: '商务'
  102 + },
  103 + {
  104 + type: 'checkbox',
  105 + key: 'dress[]',
  106 + index: 'dress-3',
  107 + value: '3',
  108 + text: '街头流行'
  109 + },
  110 + {
  111 + type: 'checkbox',
  112 + key: 'dress[]',
  113 + index: 'dress-4',
  114 + value: '4',
  115 + text: '运动休闲'
  116 + },
  117 + {
  118 + type: 'checkbox',
  119 + key: 'dress[]',
  120 + index: 'dress-5',
  121 + value: '5',
  122 + text: '文艺气质'
  123 + },
  124 + {
  125 + type: 'checkbox',
  126 + key: 'dress[]',
  127 + index: 'dress-6',
  128 + value: '6',
  129 + text: '甜美可爱'
  130 + },
  131 + {
  132 + type: 'checkbox',
  133 + key: 'dress[]',
  134 + index: 'dress-7',
  135 + value: '7',
  136 + text: '另类'
  137 + }],
  138 + headDefaultImgIcon: '//img10.static.yhbimg.com/headimg/' +
139 '2013/11/28/09/01cae078abe5fe320c88cdf4c220212688.gif?imageView/2/w/100/h/100' 139 '2013/11/28/09/01cae078abe5fe320c88cdf4c220212688.gif?imageView/2/w/100/h/100'
140 }; 140 };
141 141
@@ -263,7 +263,7 @@ const getUserInfo = (channel, uid) => { @@ -263,7 +263,7 @@ const getUserInfo = (channel, uid) => {
263 263
264 userInfo = result[1].data || {}; 264 userInfo = result[1].data || {};
265 265
266 - finalResult.userThumb = userInfo.head_ico === '' ? 266 + finalResult.userThumb = userInfo.head_ico === '' ?
267 configData.headDefaultImgIcon : Images.getImageUrl(userInfo.head_ico, 100, 100, 2); 267 configData.headDefaultImgIcon : Images.getImageUrl(userInfo.head_ico, 100, 100, 2);
268 268
269 if (userInfo) { 269 if (userInfo) {
@@ -484,6 +484,9 @@ const getUserInfo = (channel, uid) => { @@ -484,6 +484,9 @@ const getUserInfo = (channel, uid) => {
484 }; 484 };
485 485
486 const editUserInfo = (req, uid) => { 486 const editUserInfo = (req, uid) => {
  487 + let userInfo;
  488 +
  489 + userInfo.uid = uid;
487 console.info(req.body); 490 console.info(req.body);
488 console.info(req.body.nickname); 491 console.info(req.body.nickname);
489 console.info(req.body.username); 492 console.info(req.body.username);