Authored by zhangxiaoru

plustar

@@ -114,7 +114,7 @@ const favoriteBrand = (req, res, next) => { @@ -114,7 +114,7 @@ const favoriteBrand = (req, res, next) => {
114 114
115 // 执行收藏或取消操作 115 // 执行收藏或取消操作
116 return brandModel.favoriteBrand(uid, id, opt).then(data => { 116 return brandModel.favoriteBrand(uid, id, opt).then(data => {
117 - console.log(data) 117 + console.log(data);
118 if (!data) { 118 if (!data) {
119 res.json({ 119 res.json({
120 code: 400, 120 code: 400,
@@ -46,7 +46,7 @@ const collectArticle = (uid, id, opt) => { @@ -46,7 +46,7 @@ const collectArticle = (uid, id, opt) => {
46 } 46 }
47 }; 47 };
48 48
49 -//品牌收藏 49 +// 品牌收藏
50 50
51 const favoriteBrand = (uid, id, opt) => { 51 const favoriteBrand = (uid, id, opt) => {
52 52
@@ -63,7 +63,7 @@ const favoriteBrand = (uid, id, opt) => { @@ -63,7 +63,7 @@ const favoriteBrand = (uid, id, opt) => {
63 type: 'brand' 63 type: 'brand'
64 }; 64 };
65 } 65 }
66 - 66 +
67 67
68 if (opt === 'ok') { 68 if (opt === 'ok') {
69 return api.get('app.favorite.add', param); 69 return api.get('app.favorite.add', param);
@@ -87,7 +87,7 @@ const getNewProduct = (brandId, gender, url) => { @@ -87,7 +87,7 @@ const getNewProduct = (brandId, gender, url) => {
87 }).then((result) => { 87 }).then((result) => {
88 88
89 if (result && result.code === 200) { 89 if (result && result.code === 200) {
90 - //console.log(result.data.product_list) 90 + // console.log(result.data.product_list)
91 // let naList = []; 91 // let naList = [];
92 let newArrival = { 92 let newArrival = {
93 naList: [] 93 naList: []
@@ -96,7 +96,8 @@ const getNewProduct = (brandId, gender, url) => { @@ -96,7 +96,8 @@ const getNewProduct = (brandId, gender, url) => {
96 if (result.data.product_list) { 96 if (result.data.product_list) {
97 _.forEach(result.data.product_list, function(list, index) { 97 _.forEach(result.data.product_list, function(list, index) {
98 let obj = {}; 98 let obj = {};
99 - let price 99 + let price;
  100 +
100 // console.log(list) 101 // console.log(list)
101 if (index <= 5) { 102 if (index <= 5) {
102 let tag = []; 103 let tag = [];
@@ -129,10 +130,10 @@ const getNewProduct = (brandId, gender, url) => { @@ -129,10 +130,10 @@ const getNewProduct = (brandId, gender, url) => {
129 }); 130 });
130 131
131 if (list.market_price && list.market_price !== false) { 132 if (list.market_price && list.market_price !== false) {
132 - price = list.market_price + '.00'  
133 - console.log(price) 133 + price = list.market_price + '.00';
  134 + console.log(price);
134 } 135 }
135 - console.log(price) 136 + console.log(price);
136 137
137 newArrival.moreUrl = url; 138 newArrival.moreUrl = url;
138 139
@@ -148,7 +149,7 @@ const getNewProduct = (brandId, gender, url) => { @@ -148,7 +149,7 @@ const getNewProduct = (brandId, gender, url) => {
148 url: '/product/pro_' + list.product_id + '_' + 149 url: '/product/pro_' + list.product_id + '_' +
149 list.goods_list[0].goods_id + '/' + list.cn_alphabet + '.html', 150 list.goods_list[0].goods_id + '/' + list.cn_alphabet + '.html',
150 tags: tag 151 tags: tag
151 - }) 152 + });
152 153
153 if (price) { 154 if (price) {
154 obj = _.assign(obj, { 155 obj = _.assign(obj, {
@@ -162,7 +163,7 @@ const getNewProduct = (brandId, gender, url) => { @@ -162,7 +163,7 @@ const getNewProduct = (brandId, gender, url) => {
162 }); 163 });
163 } 164 }
164 165
165 - console.log(newArrival) 166 + console.log(newArrival);
166 return newArrival; 167 return newArrival;
167 } else { 168 } else {
168 logger.error('new data return code is not 200'); 169 logger.error('new data return code is not 200');
@@ -38,7 +38,7 @@ router.get('/author/list', index.editor); // 编辑简介 @@ -38,7 +38,7 @@ router.get('/author/list', index.editor); // 编辑简介
38 router.get('/index/page', index.pageData); // 逛列表页面的资讯分页 38 router.get('/index/page', index.pageData); // 逛列表页面的资讯分页
39 39
40 router.post('/opt/praiseArticle', opt.praiseArticle); // 资讯文章点赞 (H5里显示点赞) 40 router.post('/opt/praiseArticle', opt.praiseArticle); // 资讯文章点赞 (H5里显示点赞)
41 -router.post('/opt/favoriteBrand', opt.favoriteBrand); // 品牌收藏 41 +router.post('/opt/favoriteBrand', opt.favoriteBrand); // 品牌收藏
42 42
43 router.get('/info/index', info.index); // 逛详情页 43 router.get('/info/index', info.index); // 逛详情页
44 router.get('/info/mini', info.mini); // 逛mini内容页 44 router.get('/info/mini', info.mini); // 逛mini内容页