Index.js
1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
'use strict';
const Promise = require('bluebird');
const co = Promise.coroutine;
const OrderData = require('../models/OrderData');
const IndexModel = require('../models/Index');
const helpers = global.yoho.helpers;
const index=(req,res,next)=>{
let $uid= '8041246';//req.user.uid;
let $udid= 'abcdrf';//req.sessionID;
co(function * (){
let pall= yield Promise.all([OrderData.closeReasons(),IndexModel.getInfoNumData($uid, $udid)]);
let $cancelReason=pall[0].data?pall[0].data:'';
console.log(pall[2]);
res.render("home/index/index",{
cancelReason:$cancelReason,
content:[
{messages:pall[1]},
{
latestOrders:{},
favBrand:{
more:'/brands',
brands:'brand'
},
newArrival:'new'
}
],
helpUsUrl:''
});
})().catch(next);
}
module.exports = {
index
};