...
|
...
|
@@ -7,6 +7,7 @@ |
|
|
'use strict';
|
|
|
const api = global.yoho.API;
|
|
|
const userApi = require('./user-api');
|
|
|
const searchApi = global.yoho.SearchAPI;
|
|
|
const Images = require('../../../utils/images');
|
|
|
const headerModel = require('../../../doraemon/models/header');
|
|
|
|
...
|
...
|
@@ -88,49 +89,49 @@ const configData = { |
|
|
// 着装习惯
|
|
|
dressHabits: [{
|
|
|
type: 'checkbox',
|
|
|
key: 'dress[]',
|
|
|
key: 'dress',
|
|
|
index: 'dress-1',
|
|
|
value: '1',
|
|
|
text: '正装'
|
|
|
},
|
|
|
{
|
|
|
type: 'checkbox',
|
|
|
key: 'dress[]',
|
|
|
key: 'dress',
|
|
|
index: 'dress-2',
|
|
|
value: '2',
|
|
|
text: '商务'
|
|
|
},
|
|
|
{
|
|
|
type: 'checkbox',
|
|
|
key: 'dress[]',
|
|
|
key: 'dress',
|
|
|
index: 'dress-3',
|
|
|
value: '3',
|
|
|
text: '街头流行'
|
|
|
},
|
|
|
{
|
|
|
type: 'checkbox',
|
|
|
key: 'dress[]',
|
|
|
key: 'dress',
|
|
|
index: 'dress-4',
|
|
|
value: '4',
|
|
|
text: '运动休闲'
|
|
|
},
|
|
|
{
|
|
|
type: 'checkbox',
|
|
|
key: 'dress[]',
|
|
|
key: 'dress',
|
|
|
index: 'dress-5',
|
|
|
value: '5',
|
|
|
text: '文艺气质'
|
|
|
},
|
|
|
{
|
|
|
type: 'checkbox',
|
|
|
key: 'dress[]',
|
|
|
key: 'dress',
|
|
|
index: 'dress-6',
|
|
|
value: '6',
|
|
|
text: '甜美可爱'
|
|
|
},
|
|
|
{
|
|
|
type: 'checkbox',
|
|
|
key: 'dress[]',
|
|
|
key: 'dress',
|
|
|
index: 'dress-7',
|
|
|
value: '7',
|
|
|
text: '另类'
|
...
|
...
|
@@ -248,7 +249,12 @@ const getUserInfo = (channel, uid) => { |
|
|
]).then(result => {
|
|
|
let finalResult = {},
|
|
|
headerData = {},
|
|
|
userInfo = {};
|
|
|
userInfo = {},
|
|
|
brandList;
|
|
|
|
|
|
brandList = searchApi.get('/brand/list.json', {is_hot: 'Y'}, {
|
|
|
cache: true
|
|
|
});
|
|
|
|
|
|
if (result[0].code === 200) {
|
|
|
headerData = result[0];
|
...
|
...
|
@@ -471,11 +477,10 @@ const getUserInfo = (channel, uid) => { |
|
|
}
|
|
|
|
|
|
if (result[5].code === 200) {
|
|
|
// let brandInfo = result[4].data || '';
|
|
|
// let brandInfo = result[5].data || '';
|
|
|
finalResult.favorite = {
|
|
|
subTitle: '喜爱品牌',
|
|
|
submitId: 'favorite-brand'
|
|
|
|
|
|
// likebrand: (substr($userLikeBrandInfo['likeBrandStr'], 0, 1) == ',') ?
|
|
|
// $userLikeBrandInfo['likeBrandStr'] : ',' . $userLikeBrandInfo['likeBrandStr'],
|
|
|
// favoriteBrands: $userLikeBrandInfo['favBrands'],
|
...
|
...
|
@@ -514,7 +519,39 @@ const editUserInfo = (req, uid) => { |
|
|
return respData;
|
|
|
};
|
|
|
|
|
|
const editUserHabitsInfo = (req, uid) => {
|
|
|
let habitsInfo = {},
|
|
|
dressArr = [],
|
|
|
respData;
|
|
|
|
|
|
habitsInfo.uid = uid;
|
|
|
habitsInfo.shopping = req.body.shopping;
|
|
|
|
|
|
if (req.body.dress) {
|
|
|
dressArr = req.body.dress;
|
|
|
habitsInfo.dress = dressArr.join(',');
|
|
|
}else {
|
|
|
habitsInfo.dress = '';
|
|
|
}
|
|
|
|
|
|
console.info(habitsInfo);
|
|
|
if (!habitsInfo.shopping) {
|
|
|
respData = {
|
|
|
code: 400,
|
|
|
message: '缺失必填项',
|
|
|
data: ''
|
|
|
};
|
|
|
|
|
|
} else {
|
|
|
respData = userApi.editUserHabitsInfo(habitsInfo);
|
|
|
}
|
|
|
|
|
|
console.info(respData);
|
|
|
return respData;
|
|
|
};
|
|
|
|
|
|
module.exports = {
|
|
|
getUserInfo,
|
|
|
editUserInfo
|
|
|
editUserInfo,
|
|
|
editUserHabitsInfo
|
|
|
}; |
...
|
...
|
|