...
|
...
|
@@ -8,6 +8,8 @@ const homeModel = require('../models/index'); |
|
|
const _ = require('lodash');
|
|
|
const helpers = global.yoho.helpers;
|
|
|
|
|
|
// const model_order = require('../models/order')
|
|
|
|
|
|
/**
|
|
|
* 个人中心主页
|
|
|
*/
|
...
|
...
|
@@ -133,11 +135,11 @@ const component = { |
|
|
data.brand_list.forEach(function(d) {
|
|
|
result.push({
|
|
|
fav_id: d.brand_id,
|
|
|
link: "", // todo
|
|
|
link: '', // todo
|
|
|
imgUrl: d.brand_ico ? helpers.image(d.brand_ico, 160, 125) : '',
|
|
|
brandName: d.brand_name,
|
|
|
down: d.status == 0
|
|
|
})
|
|
|
});
|
|
|
});
|
|
|
|
|
|
if (page < data.page_total) {
|
...
|
...
|
@@ -171,7 +173,7 @@ const component = { |
|
|
discountPrice: (Number(d.market_price) - Number(d.sales_price) > 0) ? '¥' + Number(d.sales_price).toFixed(2) : false,
|
|
|
sellOut: d.storage < 0,
|
|
|
invalidGoods: d.status == 0
|
|
|
})
|
|
|
});
|
|
|
});
|
|
|
|
|
|
if (page < data.page_total) {
|
...
|
...
|
@@ -193,15 +195,44 @@ const component = { |
|
|
const type = req.body.type;
|
|
|
homeModel.favoriteDelete(uid, favId, type).then(data => {
|
|
|
return res.json(data);
|
|
|
})
|
|
|
});
|
|
|
},
|
|
|
|
|
|
// 关于我们
|
|
|
aboutUs: (req, res, next) => {
|
|
|
aboutUs: (req, res) => {
|
|
|
res.render('about-us', {
|
|
|
module: 'home',
|
|
|
page: 'index'
|
|
|
});
|
|
|
},
|
|
|
order: (req, res) => {
|
|
|
let type = req.query.type;
|
|
|
|
|
|
res.render('order', {
|
|
|
module: 'home',
|
|
|
page: 'order',
|
|
|
type: type
|
|
|
});
|
|
|
},
|
|
|
orderDetail: (req, res) => {
|
|
|
let orderCode = req.query.ordercode;
|
|
|
|
|
|
res.render('order-detail', {
|
|
|
module: 'home',
|
|
|
page: 'order',
|
|
|
orderCode: orderCode
|
|
|
});
|
|
|
},
|
|
|
getOrderData: (req, res) => {
|
|
|
// let param = Object.assign({uid: req.user.uid}, req.query);
|
|
|
res.json({});
|
|
|
},
|
|
|
coin: (req, res) => {
|
|
|
res.render('coin', {
|
|
|
module: 'home',
|
|
|
page: 'order'
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
|
|
|
module.exports = component; |
|
|
\ No newline at end of file |
|
|
module.exports = component; |
...
|
...
|
|