Authored by ccbikai

product intro 替换

... ... @@ -94,14 +94,20 @@ exports.intro = (req, res, next) => {
return next();
}
introModel.getintroData({
introModel.getintroIntro({
productskn: req.params.productskn
}, req).then((result) => {
res.render('detail/intro', {
result: result,
layout: false
}, req).then(html => {
res.send(html);
});
}).catch(next);
// introModel.getintroData({
// productskn: req.params.productskn
// }, req).then((result) => {
// res.render('detail/intro', {
// result: result,
// layout: false
// });
// }).catch(next);
};
/**
... ...
... ... @@ -6,7 +6,7 @@
*/
'use strict';
const $ = require('cheerio');
const _ = require('lodash');
// const log = require(`${library}/logger`);
... ... @@ -339,6 +339,20 @@ let getintroData = (data, req) => {
});
};
let getintroIntro = (data) => {
return api.get('', {
method: 'app.product.intro',
product_skn: data.productskn
}).then(result => {
result = $.load(result);
result = result('#productDesc');
return result.html();
});
};
module.exports = {
getintroData
getintroData,
getintroIntro
};
... ...
... ... @@ -17,8 +17,8 @@ module.exports = {
// api: 'http://devapi.yoho.cn:58078/',
// service: 'http://devservice.yoho.cn:58077/'
api: 'http://testapi.yoho.cn:28078/',
service: 'http://testservice.yoho.cn:28077/'
api: 'http://api.yoho.cn/',
service: 'http://service.yoho.cn/'
},
subDomains: {
host: '.m.yohobuy.com',
... ...
... ... @@ -33,6 +33,7 @@
"dependencies": {
"bluebird": "^3.4.1",
"body-parser": "^1.15.2",
"cheerio": "^0.22.0",
"connect-memcached": "^0.2.0",
"cookie-parser": "^1.4.3",
"express": "^4.14.0",
... ...