Authored by lijing

个人中心优化

@@ -58,9 +58,9 @@ exports.myDetails = (req, res, next) => { @@ -58,9 +58,9 @@ exports.myDetails = (req, res, next) => {
58 pageFooter: true 58 pageFooter: true
59 }; 59 };
60 60
61 - indexModel.myDetails({ 61 + let uid = req.user.uid;
62 62
63 - }).then(result => { 63 + indexModel.myDetails(uid).then(result => {
64 res.render('personal-details', Object.assign(responseData, result)); 64 res.render('personal-details', Object.assign(responseData, result));
65 }).catch(next); 65 }).catch(next);
66 }; 66 };
@@ -98,12 +98,6 @@ const index = (params) => { @@ -98,12 +98,6 @@ const index = (params) => {
98 }); 98 });
99 } 99 }
100 100
101 - if (result[2] && result[2].data) {  
102 - Object.assign(finalResult, {  
103 - productFavoriteTotal: result[2].data.product_favorite_total  
104 - });  
105 - }  
106 -  
107 if (result[3] && result[3].data) { 101 if (result[3] && result[3].data) {
108 Object.assign(finalResult, { 102 Object.assign(finalResult, {
109 sendCargoNum: result[3].data.send_cargo_num, 103 sendCargoNum: result[3].data.send_cargo_num,
@@ -112,6 +106,7 @@ const index = (params) => { @@ -112,6 +106,7 @@ const index = (params) => {
112 yohoCoinNum: result[3].data.yoho_coin_num, 106 yohoCoinNum: result[3].data.yoho_coin_num,
113 inboxTotal: result[3].data.inbox_total, 107 inboxTotal: result[3].data.inbox_total,
114 couponNum: result[3].data.coupon_num, 108 couponNum: result[3].data.coupon_num,
  109 + productFavoriteTotal: result[3].data.product_favorite_total,
115 brandFavoriteTotal: result[3].data.brand_favorite_total, 110 brandFavoriteTotal: result[3].data.brand_favorite_total,
116 productBrowse: result[3].data.product_browse 111 productBrowse: result[3].data.product_browse
117 }); 112 });
@@ -126,10 +121,10 @@ const index = (params) => { @@ -126,10 +121,10 @@ const index = (params) => {
126 * 个人基本资料 121 * 个人基本资料
127 * @param params 122 * @param params
128 */ 123 */
129 -const myDetails = (params) => { 124 +const myDetails = (uid) => {
130 return api.get('', { 125 return api.get('', {
131 method: 'app.passport.profile', 126 method: 'app.passport.profile',
132 - uid: params.uid 127 + uid: uid
133 }, {code: 200}).then((result) => { 128 }, {code: 200}).then((result) => {
134 result = camelCase(result); 129 result = camelCase(result);
135 if (result.data) { 130 if (result.data) {
@@ -56,7 +56,7 @@ router.get('/mycurrency', currencyController.myCurrency); // yoho币总数 @@ -56,7 +56,7 @@ router.get('/mycurrency', currencyController.myCurrency); // yoho币总数
56 router.get('/currencyDetail', currencyController.currencyDetail); // yoho币列表 56 router.get('/currencyDetail', currencyController.currencyDetail); // yoho币列表
57 router.post('/ajaxCurrencyDetail', currencyController.ajaxCurrencyDetail); // yoho币列表 57 router.post('/ajaxCurrencyDetail', currencyController.ajaxCurrencyDetail); // yoho币列表
58 58
59 -router.get('/record', auth, homeController.record); // 浏览记录 59 +router.get('/record', auth, homeController.record); // 浏览记录
60 router.get('/recordContent', homeController.recordContent); // 浏览记录 60 router.get('/recordContent', homeController.recordContent); // 浏览记录
61 router.get('/delRecord', homeController.delRecord); // 删除浏览记录 61 router.get('/delRecord', homeController.delRecord); // 删除浏览记录
62 62