Authored by 毕凯

Merge branch 'release/5.7.1' into 'master'

Release/5.7.1



See merge request !617
... ... @@ -2,9 +2,6 @@
const model = require('../models/feature');
exports.index = function(req, res, next) {
// 唤起 APP 的路径
res.locals.appPath = `yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.h5","params":{"param":{"share_id":"${req.query.share_id}"},"share":"/operations/api/v5/webshare/getShare","shareparam":{"share_id":"${req.query.share_id}"},"url":"https://activity.yoho.cn/feature/${req.params.code}.html"}}`;
model.index({
code: req.params.code,
type: req.query.type
... ... @@ -12,13 +9,21 @@ exports.index = function(req, res, next) {
if (!result) {
return next();
}
let title = req.query.title || result.name || '专题活动';
// 唤起 APP 的路径
res.locals.appPath = `yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.h5","params":{"param":{"share_id":"${req.query.share_id}","title":"${title}"},"share":"/operations/api/v5/webshare/getShare","shareparam":{"share_id":"${req.query.share_id}"},"title":"${title}","url":"https://activity.yoho.cn/feature/${req.params.code}.html"}}`;
res.render('feature/index', {
module: 'activity',
page: 'feature',
title: result.name || 'Yoho!Buy有货',
title: title,
content: result,
activity_id: req.params.code,
isFeature: true
isFeature: true,
loadJs: [{
src: global.yoho.config.jsSdk
}]
});
}).catch(next);
};
... ...
... ... @@ -17,7 +17,8 @@ exports.productLst = function(req, res, next) {
uid: uid,
udid: udid,
yh_channel: req.query.yh_channel || (req.cookies._Channel && channels[req.cookies._Channel]) || 1,
limit: req.query.limit
limit: req.query.limit,
gender: req.query.gender
}, req.query));
} else {
let keys = ['sort', 'misort', 'msort', 'gender', 'brand'],
... ...
... ... @@ -24,6 +24,11 @@ let _getProduct = function(o) {
};
};
const gender = {
1: '1,3',
2: '2,3'
};
module.exports = {
productLst: function(params) {
return api.get('', Object.assign({
... ... @@ -47,7 +52,9 @@ module.exports = {
udid: params.udid || 0,
yh_channel: params.yh_channel,
limit: params.limit,
need_filter: 'null'
need_filter: 'null',
rec_pos: '100008',
gender: params.gender || gender[params.yh_channel]
}, {
cache: true
}).then(res => {
... ...
... ... @@ -71,9 +71,10 @@ exports.orderEnsure = (req, res, next) => {
];
/* tar note 170426 品众去除 */
// if (_.isUndefined(req.cookies._isNewUser)) {
// allPromise.push(orderModel.isNewUser(uid));
// }
/* tar note 170601 品众代码恢复 */
if (_.isUndefined(req.cookies._isNewUser)) {
allPromise.push(orderModel.isNewUser(uid));
}
return Promise.all(allPromise).then(result => {
let order = result[0];
... ... @@ -81,15 +82,16 @@ exports.orderEnsure = (req, res, next) => {
let address = result[2];
/* tar note 170426 品众去除 */
// let isNewUser = result[3];
// if (!_.isUndefined(isNewUser)) {
// if (isNewUser) {
// res.cookie('_isNewUser', true, actCkOpthn);
// } else {
// res.cookie('_isNewUser', false, actCkOpthn);
// }
// }
/* tar note 170601 品众代码恢复 */
let isNewUser = result[3];
if (!_.isUndefined(isNewUser)) {
if (isNewUser) {
res.cookie('_isNewUser', true, actCkOpthn);
} else {
res.cookie('_isNewUser', false, actCkOpthn);
}
}
if (order.cartUrl) {
logger.info(`orderEnsure: order cartUrl has value:${order.cartUrl}, order data is null`);
... ...
... ... @@ -107,7 +107,7 @@ const tools = {
nonce_str: common.nonceStr(),
body: '有货订单号:' + params.orderCode,
out_trade_no: 'YOHOBuy_' + params.orderCode,
total_fee: _.parseInt(params.totalFee * 100),
total_fee: Math.round(params.totalFee * 100),
trade_type: 'JSAPI',
time_start: moment().format('YYYYMMDDHHmmss'),
time_expire: moment().add(2, 'hours').format('YYYYMMDDHHmmss'),
... ...
... ... @@ -39,7 +39,6 @@
{{/ goodsSubtitle}}
<div class="price-date">
<div class="goods-price data-bind">
<h1 class="current-price"></h1>
<h1 class="previous-price"></h1>
... ... @@ -47,13 +46,13 @@
<button class="limit-sale data-can-get-limit-code data-bind" id='limit-sale'>获取限购码</button>
<button class="got-limit-sale data-code-empty data-bind">限购码已被抢光</button>
<button class="got-limit-sale data-got-code data-bind">已获取限购码</button>
{{#if periodOfMarket}}
<div class="period-of-market">
<h1>上市期:</h1>
<h1 >{{periodOfMarket}}</h1>
</div>
{{/if}}
</div>
{{#if periodOfMarket}}
<div class="period-of-market">
<h1>上市期:</h1>
<h1 >{{periodOfMarket}}</h1>
</div>
{{/if}}
<div class="price-date data-bind">
<div class="student-price">
... ...
... ... @@ -52,14 +52,13 @@
<button class="limit-sale data-can-get-limit-code data-bind" id='limit-sale'>获取限购码</button>
<button class="got-limit-sale data-code-empty data-bind">限购码已被抢光</button>
<button class="got-limit-sale data-got-code data-bind">已获取限购码</button>
{{#if periodOfMarket}}
<div class="period-of-market">
<h1>上市期:</h1>
<h1 >{{periodOfMarket}}</h1>
</div>
{{/if}}
</div>
{{#if periodOfMarket}}
<div class="period-of-market">
<h1>上市期:</h1>
<h1 >{{periodOfMarket}}</h1>
</div>
{{/if}}
{{!--占位: 学生价/会员价--}}
<div id="placeholder-pricedata"></div>
... ...
... ... @@ -16,14 +16,16 @@
{{/within}}
{{/if}}
</a>
{{#ifor isGood four}}
{{#if showProductInfo}}
<div class="item-info">
<div class="text">{{text}}</div>
<div class="name">{{name}}</div>
<div class="price">{{salesPrice}}</div>
</div>
{{/if}}
{{/ifor}}
{{#if showProductInfo}}
{{#ifor isGood four}}
{{#unless parent.noShowProductInfo}}
<div class="item-info">
<div class="text">{{text}}</div>
<div class="name">{{name}}</div>
<div class="price">{{salesPrice}}</div>
</div>
{{/unless}}
{{/ifor}}
{{/if}}
</div>
... ...
... ... @@ -51,7 +51,7 @@
{{#isEqual module_type 'SingleImage'}}
<div class="items-s1 clearfix">
{{#each ../pics}}
{{> reds-shop/item index=@../index single=true}}
{{> reds-shop/item index=@../index single=true parent=../..}}
{{/each}}
</div>
{{#if ../isModuleMargin}}
... ... @@ -61,7 +61,7 @@
{{#isEqual module_type 'DoubleImage'}}
<div class="items-s2 clearfix">
{{#each ../pics}}
{{> reds-shop/item index=@../index double=true}}
{{> reds-shop/item index=@../index double=true parent=../..}}
{{/each}}
</div>
{{#if ../isModuleMargin}}
... ... @@ -71,7 +71,7 @@
{{#isEqual module_type 'TripleImage'}}
<div class="{{#isEqual ../displayType 1}}items-3-3{{/isEqual}}{{#isEqual ../displayType 2}}items-3-3 items-small{{/isEqual}}{{#isEqual ../displayType 3}}items-3-2 items-3-2-right{{/isEqual}}{{#isEqual ../displayType 4}}items-3-2 items-3-2-left{{/isEqual}} clearfix">
{{#each ../pics}}
{{> reds-shop/item index=@../index triple=true}}
{{> reds-shop/item index=@../index triple=true parent=../..}}
{{/each}}
</div>
{{#if ../isModuleMargin}}
... ...
... ... @@ -22,7 +22,7 @@ const domains = {
module.exports = {
app: 'h5',
appVersion: '5.7.0', // 调用api的版本
appVersion: '5.7.1', // 调用api的版本
port: 6001,
siteUrl: '//m.yohobuy.com',
assetUrl: '//127.0.0.1:5001',
... ...
... ... @@ -124,9 +124,6 @@
{{#loadJs}}
<script type="text/javascript" src="{{src}}"></script>
{{/loadJs}}
{{#isFeature}}
<script type="text/javascript" src="//cdn.yoho.cn/js-sdk/1.2.2/jssdk.js"></script>
{{/isFeature}}
{{#unless devEnv}}
{{> analysis}}
{{/unless}}
... ...
... ... @@ -76,7 +76,8 @@
}());
{{!--/* tar add 170426 品众代码去除 */--}}
{{!--window._fxcmd = window._fxcmd || [];
{{!--/* tar add 170601 品众代码恢复 */--}}
window._fxcmd = window._fxcmd || [];
_fxcmd.sid = 'bb3b16fa1106a6ab8619da0095755f32';
_fxcmd.trackAll = false;
// 参数配置(可选)...
... ... @@ -89,7 +90,7 @@
_pzfx.src = '//static.w3t.cn/fx/1/1/fx.js';
var sc = document.getElementsByTagName('script')[0];
sc.parentNode.insertBefore(_pzfx,sc);
}, 1000);--}}
}, 1000);
</script>
... ...
{
"name": "m-yohobuy-node",
"version": "5.7.4",
"version": "5.7.10",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
... ... @@ -327,14 +327,15 @@ function submitOrder() {
}
/* tar add 170426 品众代码去除 */
// if (window._fxcmd) {
// window._fxcmd.push(['trackOrder', {
// oid: res.data.order_code,
// otp: res.data.order_amount,
// u_info: cookie.get('_UID'),
// u_type: cookie.get('_isNewUser') ? 1 : 0
// }, []]);
// }
/* tar note 170601 品众代码恢复 */
if (window._fxcmd) {
window._fxcmd.push(['trackOrder', {
oid: res.data.order_code,
otp: res.data.order_amount,
u_info: cookie.get('_UID'),
u_type: cookie.get('_isNewUser') ? 1 : 0
}, []]);
}
cookie.remove(['order-info', 'activity-info']);
window.location.href = url;
... ...
... ... @@ -568,9 +568,12 @@ $basicBtnC: #eb0313;
}
.period-of-market {
float: right;
color: #d0021b;
padding: 0 30px;
background-color: #fff;
line-height: 54px;
color: #b0b0b0;
font-size: 24px;
border-bottom: 1px solid #e0e0e0;
h1 {
display: inline-block;
... ...
... ... @@ -2,7 +2,7 @@
* @Author: Targaryen
* @Date: 2017-03-23 11:02:31
* @Last Modified by: Targaryen
* @Last Modified time: 2017-05-02 11:09:37
* @Last Modified time: 2017-05-26 16:42:29
*/
/* 红人店铺数据处理 */
... ... @@ -34,7 +34,8 @@ const _linkhandle = (linkParent) => {
switch (parseInt(linkParent.linkType, 10)) {
case 0:
return helpers.urlFormat('', {
filter_poolId: linkParent.resource
filter_poolId: linkParent.resource,
title: linkParent.text
}, 'list');
case 1:
return helpers.urlFormat('/product/' + linkParent.resource + '.html');
... ... @@ -56,7 +57,7 @@ const _picsHandle = (moduleData) => {
let pics = [];
_.forEach(_.get(moduleData, 'data', []), value => {
let showProductInfo = false;
let showProductInfo = true;
if (_.has(value, 'showProductInfo')) {
showProductInfo = value.showProductInfo;
... ... @@ -325,12 +326,18 @@ const pushGoodsInfo = (decorators, goodsList) => {
_.forEach(_.get(value, 'pics', []), (subValue, subKey) => {
let hasGoods = _.get(goodsObj, `${subValue.skn}.default_images`, false);
if (!hasGoods) {
decorators[key].noShowProductInfo = true;
}
if (subValue.skn && hasGoods) {
let salesPrice = _.get(goodsObj, `${subValue.skn}.sales_price`, '');
let marketPrice = _.get(goodsObj, `${subValue.skn}.market_price`, '');
let imageSrc = _.get(goodsObj, `${subValue.skn}.default_images`, '');
decorators[key].pics[subKey].showProductInfo = salesPrice !== 0;
if (salesPrice === 0) {
decorators[key].noShowProductInfo = true;
}
decorators[key].pics[subKey].name = _.get(goodsObj, `${subValue.skn}.product_name`, '');
decorators[key].pics[subKey].salesPrice = salesPrice ? '¥' + salesPrice : '';
decorators[key].pics[subKey].marketPrice = marketPrice ? '¥' + marketPrice : '';
... ...