Authored by 陈峰

Merge branch 'gray' into 'master'

Gray



See merge request !334
... ... @@ -6,6 +6,7 @@
'use strict';
const helpers = global.yoho.helpers;
const _ = require('lodash');
const headerModel = require('../../../doraemon/models/header'); // 头部model
const indexModel = require('../models/index');
... ... @@ -153,6 +154,11 @@ const add = (req, res, next) => {
// uid = 20422448;
return indexModel.addToCart(productSku, buyNumber, goodsType, isEdit, promotionId, uid, shoppingKey).then(data => {
if (!shoppingKey && _.has(data, 'data.shopping_key')) {
res.cookie('_SPK', data.data.shopping_key, {
expires: new Date(Date.now() + 86400 * 360)
});
}
data ? res.json(data) : res.status(400).json({
message: '操作失败'
});
... ...
{
"name": "m-yohobuy-node",
"version": "5.4.24",
"version": "5.4.25",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
... ... @@ -20,9 +20,6 @@ var _ChannelVary = {
lifestyle: 4
};
// 尝试打开 APP
require('./common/open-app');
function cookie(name) {
var cookies = document.cookie,
cookieVal;
... ... @@ -222,12 +219,20 @@ $.extend({
$footer.removeClass('hide');
// 单击下载按钮 - 接受微信商城或者第三方来源的数据埋点信息
if (queryString().union_type) {
setCookie('unionTypeYas', queryString().union_type, {
let mktc = queryString().union_type || queryString().mkt_code || '';
if (mktc) {
setCookie('unionTypeYas', mktc, {
path: '/'
});
setCookie('mkt_code', mktc, {
path: '/'
});
}
// 尝试打开 APP
require('./common/open-app');
}());
$header.on('touchstart', 'a', function() {
... ...