Authored by lijing

市场推广

... ... @@ -6,7 +6,8 @@
var express = require('express'),
path = require('path'),
hbs = require('express-handlebars');
hbs = require('express-handlebars'),
helpers = require(path.join(global.utils, 'helpers'));
var app = express();
... ... @@ -23,7 +24,7 @@ app.engine('.hbs', hbs({
defaultLayout: 'layout',
layoutsDir: doraemon,
partialsDir: ['./views/partial', `${doraemon}/partial`],
helpers: global.yoho.helpers
helpers: Object.assign({}, global.yoho.helpers, helpers)
}));
// router
... ...
... ... @@ -18,7 +18,7 @@
</div>
{{# floorAdListTitle}}
<div class="floor-top">
<img src="../img/activity/market/floor-top-1.jpg" />
<img src="{{imgSrc '/img/activity/market/floor-top-1.jpg'}}" />
</div>
{{/ floorAdListTitle}}
<ul class="floor-ul">
... ... @@ -33,7 +33,7 @@
</ul>
{{# newsList}}
<div class="floor-top">
<img src="../img/activity/market/floor-top-2.jpg" />
<img src="{{imgSrc '/img/activity/market/floor-top-2.jpg'}}" />
</div>
<div class="floor-c">
<a href="{{url}}">
... ...
... ... @@ -13,6 +13,7 @@ module.exports = {
app: 'h5',
port: 6001,
siteUrl: '//m.yohobuy.com',
assetUrl: '//localhost:5001',
domains: {
// api: 'http://devapi.yoho.cn:58078/',
// service: 'http://devservice.yoho.cn:58077/'
... ... @@ -88,6 +89,7 @@ module.exports = {
if (isProduction) {
Object.assign(module.exports, {
appName: 'm.yohobuy.com',
assetUrl: '//cdn.yoho.cn/m-yohobuy-node/assets',
domains: {
api: 'http://api.yoho.yohoops.org/',
service: 'http://service.yoho.yohoops.org/',
... ... @@ -117,6 +119,7 @@ if (isProduction) {
} else if (isTest) {
Object.assign(module.exports, {
appName: 'm.yohobuy.com for test',
assetUrl: '//cdn.yoho.cn/m-yohobuy-node/assets',
domains: {
api: 'http://api-test3.yohops.com:9999/',
service: 'http://service-test3.yohops.com:9999/',
... ...
const url = require('url');
const config = require('../config/common');
const assetUrl = config.assetUrl;
module.exports = {
imgSrc: function(imgSrc) {
return url.resolve(assetUrl, imgSrc);
}
};
\ No newline at end of file
... ...