Authored by 王水玲

活动页

@@ -6,8 +6,47 @@ @@ -6,8 +6,47 @@
6 6
7 'use strict'; 7 'use strict';
8 8
  9 +const headerModel = require('../../../doraemon/models/header');
  10 +const specialModel = require('../models/special');
  11 +const log = require(`${global.library}/logger`);
  12 +const _ = require('lodash');
  13 +
  14 +const saleLogger = (err, res) => {
  15 + log.error('sale页面渲染错误:' + JSON.stringify(err));
  16 + res.send('error');
  17 +};
  18 +
9 exports.special = (req, res) => { 19 exports.special = (req, res) => {
10 let id = req.params[0] || 0; 20 let id = req.params[0] || 0;
11 21
12 - res.send(id); 22 + // headerModel.requestHeaderData()
  23 + // .then(response => {
  24 + // let data = headerModel.setHeaderData(response.data, 'girls');
  25 +
  26 + // data.module = 'index';
  27 + // data.page = 'index';
  28 + // data.footerTop = true;
  29 +
  30 + // res.render('girls', data);
  31 + // })
  32 + // .catch(() => {
  33 + // // res.render('error', {devEnv: true, pageErr: true});
  34 + // });
  35 +
  36 + Promise.all([headerModel.requestHeaderData(), specialModel.getSpecialData(id)]).then((result) => {
  37 + let saleDate = _.assign(result);
  38 + res.send(saleDate);
  39 +
  40 + });
  41 +
  42 +
  43 + // specialModel.getSpecialData(id).then((result) => {
  44 + // result.module = 'index';
  45 + // result.page = 'index';
  46 + // result.footerTop = true;
  47 +
  48 + // res.render('special', result);
  49 + // }).catch((err) => {
  50 + // saleLogger(err, res);
  51 + // });
13 }; 52 };
  1 +/**
  2 + * activity model
  3 + * @author: wsl<shuiling.wang@yoho.cn>
  4 + * @date: 2016/05/18
  5 + */
  6 +'use strict';
  7 +
  8 +const ServiceAPI = require(`${global.library}/api`).ServiceAPI;
  9 +const sign = require(`${global.library}/sign`);
  10 +const _ = require('lodash');
  11 +
  12 +var api = new ServiceAPI();
  13 +
  14 +exports.getSpecialData = (id) => {
  15 + return api.get('activity/staticFileManage/queryById', sign.apiSign({
  16 + id: id
  17 + })).then(result => {
  18 + if (result && result.code === 200) {
  19 + return result.data
  20 + } else {
  21 + return Promise.reject('error');
  22 + }
  23 + });
  24 +}
1 -<div class="yoho-page center-content">  
2 - <p>body</p>  
3 -</div>  
  1 +{{log this}}
  2 +{{{content}}}