Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
ccbikai
9 years ago
Commit
d4a77a6da3d59de7b65194c5de3505d03f36b77d
1 parent
33a7ec24
product intro 替换
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
11 deletions
apps/product/controllers/detail.js
apps/product/models/intro.js
config/common.js
package.json
apps/product/controllers/detail.js
View file @
d4a77a6
...
...
@@ -94,14 +94,20 @@ exports.intro = (req, res, next) => {
return
next
();
}
introModel
.
getintro
Data
({
introModel
.
getintro
Intro
({
productskn
:
req
.
params
.
productskn
},
req
).
then
((
result
)
=>
{
res
.
render
(
'detail/intro'
,
{
result
:
result
,
layout
:
false
});
}).
catch
(
next
);
},
req
).
then
(
html
=>
{
res
.
send
(
html
);
});
// introModel.getintroData({
// productskn: req.params.productskn
// }, req).then((result) => {
// res.render('detail/intro', {
// result: result,
// layout: false
// });
// }).catch(next);
};
/**
...
...
apps/product/models/intro.js
View file @
d4a77a6
...
...
@@ -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
};
...
...
config/common.js
View file @
d4a77a6
...
...
@@ -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'
,
...
...
package.json
View file @
d4a77a6
...
...
@@ -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"
,
...
...
Please
register
or
login
to post a comment