...
|
...
|
@@ -10,8 +10,8 @@ |
|
|
const api = global.yoho.API;
|
|
|
const singleAPI = global.yoho.SingleAPI;
|
|
|
const helpers = global.yoho.helpers;
|
|
|
const camelCase = global.yoho.camelCase;
|
|
|
const _ = require('lodash');
|
|
|
const crypto = global.yoho.crypto;
|
|
|
|
|
|
/**
|
|
|
* 个人详情数据
|
...
|
...
|
@@ -126,6 +126,12 @@ const index = (params) => { |
|
|
});
|
|
|
}
|
|
|
|
|
|
if (result[2] && result[2].data) {
|
|
|
Object.assign(finalResult, {
|
|
|
productFavoriteTotal: result[2].data.product_favorite_total
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if (result[3] && result[3].data) {
|
|
|
Object.assign(finalResult, {
|
|
|
sendCargoNum: result[3].data.send_cargo_num,
|
...
|
...
|
@@ -134,7 +140,6 @@ const index = (params) => { |
|
|
yohoCoinNum: result[3].data.yoho_coin_num,
|
|
|
inboxTotal: result[3].data.inbox_total,
|
|
|
couponNum: result[3].data.coupon_num,
|
|
|
productFavoriteTotal: result[3].data.product_favorite_total,
|
|
|
brandFavoriteTotal: result[3].data.brand_favorite_total,
|
|
|
productBrowse: result[3].data.product_browse
|
|
|
});
|
...
|
...
|
@@ -146,7 +151,7 @@ const index = (params) => { |
|
|
});
|
|
|
}
|
|
|
|
|
|
return camelCase(finalResult);
|
|
|
return finalResult;
|
|
|
});
|
|
|
};
|
|
|
|
...
|
...
|
@@ -162,9 +167,16 @@ const myDetails = (uid) => { |
|
|
}, {
|
|
|
code: 200
|
|
|
}).then((result) => {
|
|
|
result = camelCase(result);
|
|
|
|
|
|
if (result.data) {
|
|
|
result.data.gender = (result.data.gender === '1' ? '男' : '女');
|
|
|
result.data.qrcodeLink = helpers.urlFormat('/home/user/qrcode', {
|
|
|
token: _.get(result, 'data.uid', null) ?
|
|
|
crypto.encryption('yoho9646yoho9646', _.get(result, 'data.uid', null) + '') : '',
|
|
|
icon: _.get(result, 'data.head_ico', ''),
|
|
|
uname: _.get(result, 'data.nickname', ''),
|
|
|
vip: _.get(result, 'data.vip_info.cur_level')
|
|
|
});
|
|
|
return result.data;
|
|
|
|
|
|
// {
|
...
|
...
|
@@ -345,7 +357,7 @@ const getGrade = (param) => { |
|
|
obj = _.assign(obj, {
|
|
|
costOfThisYear: result[0].data.current_year_cost,
|
|
|
sumCost: result[0].data.current_total_cost,
|
|
|
allUrl: helpers.urlFormat('/home/preferential'),
|
|
|
allUrl: helpers.urlFormat('/home/privilege'),
|
|
|
costGap: upg
|
|
|
});
|
|
|
|
...
|
...
|
@@ -386,12 +398,12 @@ const getGrade = (param) => { |
|
|
* @param params
|
|
|
*/
|
|
|
|
|
|
const getPreferential = (uid, channel) => {
|
|
|
const getPreferential = (params) => {
|
|
|
|
|
|
return api.get('', {
|
|
|
method: 'app.passport.getPrivilege',
|
|
|
uid: uid,
|
|
|
channel: channel || 1
|
|
|
uid: params.uid,
|
|
|
channel: params.channel || 1
|
|
|
}, {
|
|
|
code: 200
|
|
|
}).then((result) => {
|
...
|
...
|
|