Authored by ccbikai(👎🏻🍜)

Merge branch 'master' into release/5.5

... ... @@ -6,6 +6,9 @@ exports.index = function(req, res, next) {
code: req.params.code,
type: req.query.type
}).then((result) => {
if (!result) {
return next();
}
res.render('feature', {
module: 'activity',
page: 'feature',
... ...
... ... @@ -5,6 +5,7 @@
'use strict';
const mRoot = '../models';
const share = require(`${mRoot}/share`);
const _ = require('lodash');
exports.getShareContent = (req, res, next) => {
if (!req.query.shareId) {
... ... @@ -14,6 +15,13 @@ exports.getShareContent = (req, res, next) => {
});
}
if (!_.isNumber(+req.query.shareId)) {
return res.jsonp({
code: 400,
message: 'shareId is invalid'
});
}
share.getShareContent({
shareId: req.query.shareId
}).then(result => {
... ...
... ... @@ -59,7 +59,7 @@ exports.feature = (req, res) => {
if (req.yoho.isWechat || cover) {
// 微信中,不管是否已经种入cookie,直接覆盖
res.cookie('mkt_code', mktCode, options);
} else if (!req.cookies.mkt_code) {
} else if (!req.cookies.mkt_code || mktCode === '100000000000349') {
// 如果没有种入mtk_code则种入
res.cookie('mkt_code', mktCode, options);
}
... ...
... ... @@ -55,10 +55,9 @@ module.exports = {
cache: true
});
}
if (data.code === 200) {
data = data.data;
}
if (data.floors) {
data = data.data;
if (data && data.floors) {
data.floors.forEach(function(f) {
if (f.component && f.component[0] && f.component[0].type === 'productGroup' && f.component[0].defaultSkns) {
sknsArr.push(_getProductBySkns(f.component[0]));
... ... @@ -69,6 +68,7 @@ module.exports = {
if (sknsArr.length) {
yield Promise.all(sknsArr);
}
return data;
})();
}
... ...
... ... @@ -18,6 +18,9 @@ const _activity = () => {
};
const _user = (params) => {
if (!params.uid) {
return Promise.resolve({});
}
return api.get('', {
method: 'app.passport.profile',
uid: params.uid
... ... @@ -384,6 +387,9 @@ const order = (params) => {
const getOrders = (params) => {
let finalResult = [];
if (!params.uid) {
return Promise.resolve({});
}
return _getOrderData(params).then(result => {
if (result.data && result.data.page_total && params.page <= result.data.page_total && result.data.order_list) {
let count = 0;
... ...
... ... @@ -227,7 +227,7 @@ router.get('/redbag/2017', redbag.index);
router.get('/individuation', individuation.productLst);
// 活动页模版
router.get('/feature/:code', feature.index);
router.get('/feature/:code.html', feature.index);
// 2016 年度账单
router.get('/annual-account', annualAccount.index);
... ...
<div class="feature-page yoho-page">
{{#content.share}}
<input id="shareLink" type="hidden" value="{{shareUrl}}">
<input id="shareDesc" type="hidden" value="{{shareTitleSub}}">
<input id="shareImg" type="hidden" value="{{shareImage}}">
<input id="shareTitle" type="hidden" value="{{shareTitleMain}}">
{{/content.share}}
{{#content.webShare}}
<input id="shareLink" type="hidden" value="{{url}}">
<input id="shareDesc" type="hidden" value="{{content}}">
<input id="shareImg" type="hidden" value="{{pic}}">
<input id="shareTitle" type="hidden" value="{{title}}">
{{/content.webShare}}
{{#content.floors}}
{{#isEqualOr type 'sidebar'}}
{{! 侧悬浮}}
... ... @@ -71,7 +71,7 @@
{{#isEqualOr type 'productGroup'}}
{{! 商品池}}
<div class="product-container item{{numOfOneRow}}" {{#if proBgImg}}style="background:url({{proBgImg}})repeat;"{{/if}}>
<div class="product-container item{{numOfOneRow}}" {{#if proBgImg}}style="background:url({{image2 proBgImg q=60}})repeat;"{{/if}}>
<div class="product-source" {{#unless defaultPros.length}} {{#if searchCondition }}cloneitem="{{searchCondition.limit}}"{{/if}}{{/unless}} condition='{{stringify searchCondition}}' fp="{{getAnalysis ../this @index}}">
<input class="imgwh" type="hidden" value="193x257">
{{#if defaultPros.length}}
... ...
... ... @@ -419,16 +419,19 @@ let setPassword = (req, res, next) => {
RegService.regMobileAes(area, mobile, password, shoppingKey, smsCode, isFromMy).then((result) => {
if (!result.code || result.code !== 200) {
return Promise.reject(result);
return res.send(result);
}
if (!result.data || !result.data.uid) {
return Promise.reject(result);
return res.send(result);
}
resultCopy = result;
return AuthHelper.syncUserSession(result.data.uid, req, res);
}).then(() => {
if (!resultCopy) {
return;
}
// 返回跳转到来源页面
let refer = req.cookies.refer;
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
... ... @@ -131,7 +131,7 @@ const getShopIntro = (shopId, uid) => {
shop_id: shopId
};
if (uid) {
if (uid && uid !== 'undefined') {
params.uid = uid;
}
... ... @@ -582,7 +582,8 @@ const getShopData = (req, shopId, uid, isApp) => {
let seoResult = _getBrandShopSeo(channel, shopInfoResult, req.query);
/* 基础店铺返回程序内的跳转信号,跳转到基础店铺 */
if (shopInfoResult && shopInfoResult.shop_template_type && parseInt(shopInfoResult.shop_template_type, 10) === 1) {
if (shopInfoResult && shopInfoResult.shop_template_type &&
parseInt(shopInfoResult.shop_template_type, 10) === 1) {
return {
goBrand: shopInfoResult
};
... ... @@ -625,12 +626,10 @@ const getShopData = (req, shopId, uid, isApp) => {
if (result[0]) {
shopFilterSearchData.filter = productProcess.processFilter(result[0].filter || []);
shopFilterSearchData.goods = productProcess.processProductList(result[0].product_list || [], {isApp: isApp});
shopFilterSearchData.goods =
productProcess.processProductList(result[0].product_list || [], {isApp: isApp});
}
/* 店铺优惠券 */
let shopCoupons = result[1] || [];
// 店铺分类
return _getShopCategory(shopId, channel).then(shopCategory => {
... ...
... ... @@ -34,6 +34,9 @@ module.exports = () => {
if (req.hostname === 'activity.yoho.cn') {
// 活动模版的活动页
if (req.path === '/') {
return res.redirect('//m.yohobuy.com');
}
req.url = `/activity${req.url}`;
} else if (req.subdomains.length) {
switch (req.subdomains[0]) {
... ...
... ... @@ -12,7 +12,7 @@
a.async = 1;
a.src = j;
m.parentNode.insertBefore(a, m);
}(window, document, 'script', (document.location.protocol === 'https:' ? 'https:' : 'http:') + '//cdn.yoho.cn/yas-jssdk/2.3.3/yas.js', '_yas'));
}(window, document, 'script', (document.location.protocol === 'https:' ? 'https:' : 'http:') + '//cdn.yoho.cn/yas-jssdk/2.3.4/yas.js', '_yas'));
var _hmt = _hmt || [];
... ... @@ -56,7 +56,7 @@
uid = uid === 0 ? '' : uid;
window._ozuid = uid; // 暴露ozuid
if (window._yas) {
window._yas(1 * new Date(), '2.3.3', 'yohobuy_m', uid, '', '');
window._yas(1 * new Date(), '2.3.4', 'yohobuy_m', uid, '', '');
}
setTimeout(function() {
... ...
{
"name": "m-yohobuy-node",
"version": "5.4.29",
"version": "5.4.31",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ... @@ -48,7 +48,7 @@
"xml2js": "^0.4.17",
"yoho-express-session": "^2.0.0",
"yoho-node-lib": "^0.2.8",
"yoho-zookeeper": "^1.0.6"
"yoho-zookeeper": "^1.0.8"
},
"devDependencies": {
"autoprefixer": "^6.7.4",
... ...
... ... @@ -335,7 +335,9 @@ $(window).scroll(function() {
});
// 初始化请求第一页数据
getOrders();
if ($('.order-page').length > 0) {
getOrders();
}
$(function() {
// 适配背景图
... ...
... ... @@ -235,17 +235,47 @@ $.extend({
$footer.removeClass('hide');
// 单击下载按钮 - 接受微信商城或者第三方来源的数据埋点信息
let mktc = queryString().union_type || queryString().mkt_code || '';
let unionType = queryString().union_type || '';
if (mktc) {
setCookie('unionTypeYas', mktc, {
path: '/'
});
setCookie('mkt_code', mktc, {
if (unionType) {
setCookie('unionTypeYas', unionType, {
path: '/'
});
}
/*
关于yas种cookies的逻辑澄清:
1. yas的关于渠道号的cookies的key 是 mkt_code
2. mkt_code 失效时间为7天
3. 如果url后面加union_type,mkt_code 在微信下是覆盖的,其他端不覆盖
4. 如果mkt_code=100000000000349,则直接覆盖成对应的渠道号
5. yas的cookies 种在 .yohobuy.com 根域下
周奇琪
*/
let isWechat = /micromessenger/i.test(navigator.userAgent || '');
let mktc = queryString().mkt_code || queryString().union_type || '';
function saveMktCode() {
if (mktc) {
setCookie('mkt_code', mktc, {
path: '/',
domain: 'yohobuy.com',
expires: 7 // 7天
});
}
}
if (isWechat) {
saveMktCode();
} else {
if (!cookie('mkt_code') || mktc === '100000000000349') {
saveMktCode();
}
}
// 尝试打开 APP
require('./common/open-app');
... ...
... ... @@ -87,7 +87,9 @@ if (canOpenApp()) {
}, 2000);
if (isiOS) {
window.location.href = appPath;
setTimeout(function() {
window.location.href = appPath;
}, 2000);
} else {
ifr = document.createElement('iframe');
ifr.src = appPath;
... ...
... ... @@ -10,7 +10,7 @@ var $ = require('yoho-jquery'),
Hammer = require('yoho-hammer'),
dialog = require('plugin/dialog');
var $input = $('#search-input').find('input[name="query"]');
var $input = $('#search-input input[name="query"]');
var $clear = $('#search-input .clear-input');
... ...
... ... @@ -327,14 +327,14 @@
id: id
}, resultData => {
// /* 结果返回 */
// if (resultData.length < 1) {
// areaCode.val(id);
// let returnTitle = this.returnTitle();
// area.val(returnTitle);
// this.show = false;
// }
/* 结果返回 */
if (resultData.length < 1) {
areaCode.val(id);
let returnTitle = this.returnTitle();
area.val(returnTitle);
this.show = false;
}
/* 数据绑定 */
switch ((id + '').length) {
... ...