|
@@ -168,7 +168,17 @@ const index = (req, res, next) => { |
|
@@ -168,7 +168,17 @@ const index = (req, res, next) => { |
168
|
isShare = isWeixin || isqq || isWeibo ? true : false;
|
168
|
isShare = isWeixin || isqq || isWeibo ? true : false;
|
169
|
|
169
|
|
170
|
co(function* () {
|
170
|
co(function* () {
|
171
|
- let ret = yield tdk('article', id, req);
|
171
|
+ let [ret, detail, commentsTotal, praise, wxFooter] = yield Promise.all([
|
|
|
172
|
+ tdk('article', id, req),
|
|
|
173
|
+ req.ctx(DetailModel).packageData(id, isApp, isWeixin, channel, isShare),
|
|
|
174
|
+ req.ctx(DetailModel).commentsTotal({ article_id: id, udid: udid }),
|
|
|
175
|
+ req.ctx(DetailModel).getArticlePraiseAndFavor({
|
|
|
176
|
+ uid: uid,
|
|
|
177
|
+ id: id,
|
|
|
178
|
+ udid: udid
|
|
|
179
|
+ }),
|
|
|
180
|
+ req.ctx(aboutModel).about(req.yoho.isApp)
|
|
|
181
|
+ ]);
|
172
|
|
182
|
|
173
|
if (ret[0]) {
|
183
|
if (ret[0]) {
|
174
|
req.tdk = {
|
184
|
req.tdk = {
|
|
@@ -177,13 +187,7 @@ const index = (req, res, next) => { |
|
@@ -177,13 +187,7 @@ const index = (req, res, next) => { |
177
|
description: ret[3]
|
187
|
description: ret[3]
|
178
|
};
|
188
|
};
|
179
|
}
|
189
|
}
|
180
|
- let detail = yield req.ctx(DetailModel).packageData(id, isApp, isWeixin, channel, isShare);
|
|
|
181
|
- let commentsTotal = yield req.ctx(DetailModel).commentsTotal({article_id: id, udid: udid});
|
|
|
182
|
- let praise = yield req.ctx(DetailModel).getArticlePraiseAndFavor({
|
|
|
183
|
- uid: uid,
|
|
|
184
|
- id: id,
|
|
|
185
|
- udid: udid
|
|
|
186
|
- });
|
190
|
+
|
187
|
let data = {
|
191
|
let data = {
|
188
|
guangDetail: true,
|
192
|
guangDetail: true,
|
189
|
guang: {}
|
193
|
guang: {}
|
|
@@ -275,9 +279,7 @@ const index = (req, res, next) => { |
|
@@ -275,9 +279,7 @@ const index = (req, res, next) => { |
275
|
// 标识有微信分享
|
279
|
// 标识有微信分享
|
276
|
data.hasWxShare = true;
|
280
|
data.hasWxShare = true;
|
277
|
|
281
|
|
278
|
- let resu = yield req.ctx(aboutModel).about(req.yoho.isApp);
|
|
|
279
|
-
|
|
|
280
|
- data.guang.wxFooter = resu;
|
282
|
+ data.guang.wxFooter = wxFooter;
|
281
|
res.render('info/index', Object.assign({
|
283
|
res.render('info/index', Object.assign({
|
282
|
page: 'info-index',
|
284
|
page: 'info-index',
|
283
|
gender: gender,
|
285
|
gender: gender,
|