Authored by 陈轩

Merge branch 'release/5.3' into gray

... ... @@ -17,14 +17,13 @@ const indexModel = require('../models/brand');
* @param int channel 1表示男生频道, 2表示女生频道, 3表示潮童频道, 4表示创意生活频道
*/
let index = (req, res, next) => {
let genders = req.cookies._Channel || 'boys';
let responseData = {
module: 'channel',
page: 'brand',
// title: '品牌一览 | Yoho!Buy有货 | 潮流购物逛不停',
showFooterTab: footerModel.getUrlData('category', genders)
showFooterTab: footerModel.getUrlData('category')
};
let param = {
... ...
... ... @@ -7,7 +7,6 @@ const footerModel = require('../../../doraemon/models/footer_tab'); // 底部tab
const helpers = global.yoho.helpers;
let index = (req, res, next) => {
let gender = req.cookies._Channel || 'boys';
cateModel.getCateData(req.yoho.channel).then((result) => {
res.render('cate', {
... ... @@ -20,7 +19,7 @@ let index = (req, res, next) => {
list: result.list,
searchUrl: helpers.urlFormat('/search', null, 'search')
},
showFooterTab: footerModel.getUrlData('category', gender)
showFooterTab: footerModel.getUrlData('category')
});
}).catch(next);
};
... ...
... ... @@ -11,19 +11,16 @@ const footerModel = require('../../../doraemon/models/footer_tab'); // 底部tab
const helpers = global.yoho.helpers;
let _renderData = (gender) => {
return {
module: 'channel',
page: 'home',
homeHeader: {
searchUrl: helpers.urlFormat('/search', null, 'search')
},
maybeLike: true,
showFooterTab: footerModel.getUrlData('home', gender),
pageFooter: true
};
}
let _renderData = {
module: 'channel',
page: 'home',
homeHeader: {
searchUrl: helpers.urlFormat('/search', null, 'search')
},
maybeLike: true,
showFooterTab: footerModel.getUrlData('home'),
pageFooter: true
};
/**
* 频道页生成函数
... ... @@ -39,8 +36,7 @@ let _channelPage = (req, res, data) => {
uid: _.toString(req.user.uid),
limit: 6// 首屏先获取前6个楼层,其余用ajax获取
}).then(result => {
let links = _renderData(gender);
links.homeHeader.defaultTerms = result.defaultTerms;
_renderData.homeHeader.defaultTerms = result.defaultTerms;
if (!result.content.length || !result.sideNav.length) {
res.set('Cache-Control', 'no-cache');
... ... @@ -57,7 +53,7 @@ let _channelPage = (req, res, data) => {
// }
// }].concat(result.content);
// console.log(result.content[9]);
res.render('channel', Object.assign({}, links, data, result, {
res.render('channel', Object.assign({}, _renderData, data, result, {
localCss: true
}));
});
... ...
... ... @@ -62,7 +62,7 @@ const tool = {
dest.preferenceUrl = `/product/detail/preference${extra}`;
}
dest.brandId = origin.brand_info.brand_id || 0;
dest.brandId = origin.brand_info && origin.brand_info.brand_id || 0;
dest.productSkn = origin.product_skn;
dest.id = origin.product_id;
... ...
... ... @@ -28,6 +28,7 @@ exports.page = (req, res) => {
width750: true,
localCss: true,
imServer: global.yoho.config.domains.imServer,
imSocket: global.yoho.config.domains.imSocket,
userData: {
uid: req.user.uid,
encrypteduid: req.user.ENCRYPTION_UID || (crypto.encryption(null, req.user.uid + '' || '0')),
... ...
... ... @@ -63,4 +63,10 @@
<input type="hidden" id="js-eid" value="{{encrypteduid}}">
<input type="hidden" id="js-avatar" value="{{avatar}}">
<input type="hidden" id="js-uname" value="{{uname}}">
{{/with}}
\ No newline at end of file
{{/with}}
<script>
var gDomains = {
imSocket: "{{imSocket}}",
imServer: "{{imServer}}",
};
</script>
\ No newline at end of file
... ...
... ... @@ -98,7 +98,7 @@ if (isProduction) {
service: 'http://service.yoho.yohoops.org/',
liveApi: 'http://api.live.yoho.cn/',
singleApi: 'http://single.yoho.cn/',
imSocket: 'wss://imsocket.yohobuy.com:10000',
imSocket: 'wss://imsocket.yohobuy.com:443',
imCs: 'https://imhttp.yohobuy.com/api',
imServer: 'https://imhttp.yohobuy.com/server'
},
... ...
... ... @@ -8,18 +8,11 @@
const helpers = global.yoho.helpers;
let channels = {
boys: '1,3',
girls: '2,3',
kids: '1,2,3',
lifestyle: '1,2,3'
};
exports.getUrlData = function(type, gender) {
exports.getUrlData = function(type) {
const urlData = {
indexUrl: helpers.urlFormat('/?go=1'), // 首页
categoryUrl: helpers.urlFormat('/cate'), // 分类
guangUrl: helpers.urlFormat('', {'gender': channels[gender]}, 'guang'), // 逛首页
guangUrl: helpers.urlFormat('', null, 'guang'), // 逛首页
shoppingCartUrl: helpers.urlFormat('/cart/index/index'), // 购物车
mineUrl: helpers.urlFormat('/home') // 个人中心
};
... ...
... ... @@ -8,7 +8,7 @@
<p class="iconfont tab-icon">&#xe62d;</p>
<p class="tab-name">分类</p>
</a>
<a class="tab-item {{#if guangHome}}current{{/if}}" href="{{guangUrl}}">
<a class="tab-item {{#if guangHome}}current{{/if}}" id="guangUrl" href="{{guangUrl}}">
<p class="iconfont tab-icon">&#xe627;</p>
<p class="tab-name"></p>
</a>
... ...
/* global gAssetURI */
module.exports = function(path) {
return gAssetURI + path;
return window.STATIC_RESOURCE_PATH + path;
};
\ No newline at end of file
... ...
... ... @@ -236,7 +236,7 @@ var chat = {
disconnect() {
var self = this;
this.$netTip.toggleClass('hide', false);
this.$chat.toggleClass('online', false);
this._sysInfo('<p>会话断开,点击<span class="blue">重连</span></p>')
.one('click', function() {
self.connect();
... ...
... ... @@ -9,7 +9,7 @@
var config = {
servers: [gDomains.imSocket],
defaultUserHead: '//img10.static.yhbimg.com/headimg/2013/11/28/09/01cae078abe5fe320c88cdf4c220212688.gif',
rebotUserHead: `${gAssetURI}/img/service/chat/im-robot.png`,
rebotUserHead: `${window.STATIC_RESOURCE_PATH}/img/service/chat/im-robot.png`,
recType: {
ENTER: 1, // 用户进入
LINK_SUCCESS: 2, // 连线人工客服回应
... ...
... ... @@ -9,9 +9,6 @@
const webpack = require('webpack');
const path = require('path');
const _ = require('lodash');
const config = require('../config/common');
const domains = config.domains;
const assetURI = config.assetUrl;
const shelljs = require('shelljs');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
... ... @@ -77,10 +74,6 @@ module.exports = {
$: 'yoho-jquery',
jQuery: 'yoho-jquery',
'window.jQuery': 'yoho-jquery'
}),
new webpack.DefinePlugin({
gDomains: JSON.stringify(domains),
gAssetURI: JSON.stringify(assetURI)
})
]
};
... ...