Authored by 郝肖肖

'fix'

... ... @@ -39,13 +39,14 @@ function droitHtml(contents) {
item.content = {
banner: `http://img12.static.yhbimg.com/sort/2018/03/26/13/02402b95df5f0f0f5ef4d4b79edd515577.jpg${imageView2}`,
intros: [
{title: '特权介绍', data: ['会员专享生日礼包,等级越高,礼包价值越高,具体以实际领取为准。']},
{title: '特权介绍', data: ['会员专享生日礼包,等级越高,礼包价值越高,具体以实际发放为准。']},
{title: '权益对象', data: ['银卡及以上会员、且已完善个人生日信息才可领取生日礼包。']},
{title: '领取说明', data: [
'生日礼包在生日前7天至生日后7天可领,领取后生日福利券有效期15天。',
'生日礼包可在会员中心-我的礼包页面领取。',
'生日礼包一年内(365天)仅限领取一次。',
'若在上述时间段内未领取,将无法补发生日礼包。'
'生日礼包一年内(365天)仅发放一次。',
'若在上述时间段内未领取,将无法补发生日礼包。',
'老版本用户需更新至新版本app才可领取生日礼包。'
]},
]
};
... ... @@ -110,12 +111,13 @@ function droitHtml(contents) {
item.content = {
banner: `http://img11.static.yhbimg.com/sort/2018/03/26/13/0100d72b57f8c364e69cdfeb708b5d852a.jpg${imageView2}`,
intros: [
{ title: '特权介绍', data: ['会员专享升级礼包,具体以实际领取为准。'] },
{ title: '特权介绍', data: ['会员专享升级礼包,具体以实际发放为准。'] },
{ title: '领取说明', data: [
'升级礼包在升级当日7天内可领取,领取后优惠券有效期7天。',
'升级礼包可在会员中心-我的礼包页面领取。',
'每个等级的礼包365天仅限领取一次。',
'若在上述时间段内未领取,将无法补发升级礼包。'
'每个等级的礼包365天仅发放一次。',
'若在上述时间段内未领取,将无法补发升级礼包。',
'老版本用户需更新至新版本app才可领取生日礼包。'
]
}
]
... ...
... ... @@ -54,7 +54,7 @@ class BuyNowController {
// 是否需要重新计算
let needReComputer = orderInfo && !_.isEmpty(orderInfo) &&
(orderInfo.yohoCoin || orderInfo.coupon_code);
(orderInfo.yohoCoin || orderInfo.coupon_code || orderInfo.gift_card_code);
let computerPromise = null;
if (needReComputer) {
... ...
... ... @@ -37,7 +37,7 @@ class cartModel extends global.yoho.BaseModel {
// 是否需要重新计算
let needReComputer = orderInfoCookie && !_.isEmpty(orderInfoCookie) &&
(orderInfoCookie.yohoCoin || orderInfoCookie.user_check_coupon === 'Y');
(orderInfoCookie.yohoCoin || orderInfoCookie.user_check_coupon === 'Y' || orderInfoCookie.gift_card_code);
if (needReComputer) {
orderInfoCookie.paymentType = orderInfoCookie.paymentType ? orderInfoCookie.paymentType : '';
... ...
... ... @@ -201,6 +201,9 @@ class DetailModel extends global.yoho.BaseModel {
method: 'app.resources.getSingleTemplate',
module: 'wechat',
key: 'guang_detail_wechat'
},
param: {
cache: true
}
});
}
... ... @@ -455,6 +458,9 @@ class DetailModel extends global.yoho.BaseModel {
page: 1,
limit: 1,
udid: params.udid
},
param: {
cache: true
}
}).then(result => {
return _.get(result, 'data.total', 0);
... ... @@ -473,6 +479,9 @@ class DetailModel extends global.yoho.BaseModel {
uid: params.uid,
id: params.id,
udid: params.udid
},
param: {
cache: true
}
}).then(result => {
return _.get(result, 'data', {});
... ...
... ... @@ -68,11 +68,11 @@
{{/realAmount}}
</ul>
{{/orderAmountInfo}}
{{#if yohoGiveCoin}}
{{#if orderExtInfo.yohoGiveCoin}}
<p class="dollar">
<span class="bg-dollar"></span>
共返YOHO币:
<span>{{yohoGiveCoin}}</span>
<span>{{orderExtInfo.yohoGiveCoin}}</span>
</p>
{{/if}}
... ... @@ -117,7 +117,7 @@
{{> order-detail/refund-change-mask}}
{{#if orderBasicInfo}}
<div class="info-table">
{{#orderBasicInfo}}
<div class="table-item">{{key}}{{value}}</div>
... ...
... ... @@ -190,6 +190,9 @@ class DetailModel extends global.yoho.BaseModel {
method: 'app.resources.getSingleTemplate',
module: 'wechat',
key: 'guang_detail_wechat'
},
param: {
cache: true
}
});
}
... ...
... ... @@ -11,7 +11,6 @@ const passport = require('passport');
const uuid = require('uuid');
const url = require('url');
const moment = require('moment');
const co = Promise.coroutine;
const cookie = global.yoho.cookie;
const helpers = global.yoho.helpers;
const log = global.yoho.logger;
... ... @@ -547,46 +546,6 @@ exports.user = function(req, res, next) {
res.jsonp(result);
};
/**
* 中间件
* 根据用户登录是否成功决定是否展示验证码
*/
exports.loginShowCaptchaByIp = function(req, res, next) {
// 总开关状态
req.yoho.captchaShow = !_.get(req.app.locals.wap, 'close.loginValidation', false);
// 开关打开,不走任何验证逻辑
if (!req.yoho.captchaShow) {
return next();
} else {
req.yoho.captchaShow = false;
}
// 第一次登录要不要展示验证码:后台开关勾选,首次登录不需要展示
let firstLoginShowCaptcha = !_.get(req.app.locals.wap, 'close.firstLoginShowCaptcha', false);
log.info(`firstLoginShowCaptcha status is ${firstLoginShowCaptcha}`);
if (firstLoginShowCaptcha) {
req.yoho.captchaShow = true;
return next();
} else {
co(function* () {
let hasErrorLog = yield cache.get(`loginErrorIp:${req.yoho.clientIp}`);
log.info(`Pagerender clientip ${req.yoho.clientIp} status is ` + hasErrorLog);
if (hasErrorLog) {
req.yoho.captchaShow = true;
}
next();
})().catch(function(e) {
req.yoho.captchaShow = true;
next();
});
}
};
exports.common = common;
exports.local = local;
exports.wechat = wechat;
... ...
... ... @@ -184,7 +184,6 @@ router.get('/login.html',
login.common.clearCookie,
validateCode.load,
login.common.beforeLogin,
login.loginShowCaptchaByIp,
loginNew.international); // 国际账号登录
router.get('/passport/back/mobile', validateCode.load, back.backByMobile); // 通过手机找回密码
... ...
... ... @@ -106,6 +106,11 @@ exports.serverError = () => {
err.code = err.code || err.statusCode || 500;
if (!err.type === 'entity.parse.failed') { // json 解析失败不上报错误
logger.error(`error at path: ${req.url}`);
logger.error(err);
}
if (req.isApmReport && err.code !== 401) {
// 上报服务端错误
sender.addMessage({
... ... @@ -186,9 +191,6 @@ exports.serverError = () => {
return _err510(req, res, 510, err);
}
logger.error(`error at path: ${req.url}`);
logger.error(err);
if (!res.headersSent) {
return _err500(req, res, err.code, err);
}
... ...
... ... @@ -55,48 +55,34 @@
{{#if devEnv}}
{{#if localCss }}
<link rel="preload" as="style" href="//{{devHost}}:{{port}}/common.css?t={{startTime}}">
<link rel="stylesheet" media="all" href="//{{devHost}}:{{port}}/common.css?t={{startTime}}">
{{/if}}
{{#if isFeature}}
<link rel="preload" as="style" href="//{{devHost}}:{{port}}/feature.css?t={{startTime}}">
<link rel="stylesheet" media="all" href="//{{devHost}}:{{port}}/feature.css?t={{startTime}}">
{{else}}
{{#ifor localCss vue}}
<link rel="preload" as="style" href="//{{devHost}}:{{port}}/{{module}}.{{page}}.css?t={{startTime}}">
<link rel="stylesheet" media="all" href="//{{devHost}}:{{port}}/{{module}}.{{page}}.css?t={{startTime}}">
{{^}}
<link rel="preload" as="style" href="//{{devHost}}:{{port}}/index.css?t={{startTime}}">
<link rel="stylesheet" media="all" href="//{{devHost}}:{{port}}/index.css?t={{startTime}}">
{{/ifor}}
{{/if}}
{{else}}
{{#if localCss }}
<link rel="preload" as="style" href="//cdn.yoho.cn/yohobuywap-node/{{version}}/common.css?t={{startTime}}">
<link rel="stylesheet" media="all" href="//cdn.yoho.cn/yohobuywap-node/{{version}}/common.css?t={{startTime}}">
{{/if}}
{{#if isFeature}}
<link rel="preload" as="style" href="//cdn.yoho.cn/yohobuywap-node/{{version}}/feature.css?t={{startTime}}">
<link rel="stylesheet" media="all" href="//cdn.yoho.cn/yohobuywap-node/{{version}}/feature.css?t={{startTime}}">
{{else}}
{{#ifor localCss vue}}
<link rel="preload" as="style" href="//cdn.yoho.cn/yohobuywap-node/{{version}}/{{module}}.{{page}}.css?t={{startTime}}">
<link rel="stylesheet" media="all" href="//cdn.yoho.cn/yohobuywap-node/{{version}}/{{module}}.{{page}}.css?t={{startTime}}">
{{^}}
<link rel="preload" as="style" href="//cdn.yoho.cn/yohobuywap-node/{{version}}/index.css?t={{startTime}}">
<link rel="stylesheet" media="all" href="//cdn.yoho.cn/yohobuywap-node/{{version}}/index.css?t={{startTime}}">
{{/ifor}}
{{/if}}
{{/if}}
{{#if devEnv}}
<link rel="preload" as="script" href="//{{devHost}}:{{port}}/libs.js?t={{startTime}}"/>
<link rel="preload" as="script" href="//{{devHost}}:{{port}}/{{module}}.{{page}}.js?t={{startTime}}"/>
{{else}}
<link rel="preload" as="script" href="//cdn.yoho.cn/yohobuywap-node/{{version}}/libs.js?t={{startTime}}"/>
<link rel="preload" as="script" href="//cdn.yoho.cn/yohobuywap-node/{{version}}/{{module}}.{{page}}.js?t={{startTime}}"/>
{{/if}}
<link rel="apple-touch-icon-precomposed" href="http://static.yohobuy.com/m/v1/img/touch/apple-touch-icon-144x144-precomposed-new.png">
<link rel="apple-touch-startup-image" href="https://cdn.yoho.cn/h5/forios/startup/startup-orange-6p.png" media="screen and (min-device-width: 1126px) and (max-device-width: 1242px)">
<link rel="apple-touch-startup-image" href="https://cdn.yoho.cn/h5/forios/startup/startup-orange-x.png" media="screen and (min-device-width: 751px) and (max-device-width: 1125px)">
... ... @@ -125,10 +111,10 @@
<input type="hidden" id="no-download" value="no-download">
{{/if}}
{{#wechatShare}}
<script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.3.2.js" crossorigin="anonymous"></script>
<script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
{{/wechatShare}}
{{#loadJsBefore}}
<script src="{{src}}" crossorigin="anonymous"></script>
<script src="{{src}}"></script>
{{/loadJsBefore}}
{{#if devEnv}}
<script>
... ... @@ -145,7 +131,9 @@
<script src="//cdn.yoho.cn/yohobuywap-node/{{version}}/libs.js?t={{startTime}}" crossorigin="anonymous"></script>
<script src="//cdn.yoho.cn/yohobuywap-node/{{version}}/{{module}}.{{page}}.js?t={{startTime}}" crossorigin="anonymous"></script>
{{/if}}
{{#loadJs}}
<script src="{{src}}"></script>
{{/loadJs}}
{{#unless devEnv}}
{{> analysis}}
{{/unless}}
... ...
{
"name": "yohobuywap-node",
"version": "96.5.53",
"version": "6.6.1",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ... @@ -151,7 +151,7 @@
"yoho-hammer": "^2.0.8",
"yoho-iscroll": "^5.2.1",
"yoho-jquery": "^2.2.4",
"yoho-jquery-lazyload": "^1.9.12",
"yoho-jquery-lazyload": "^1.9.13",
"yoho-jquery-qrcode": "^0.14.0",
"yoho-qs": "^1.0.1",
"yoho-swiper": "^3.3.2",
... ...
... ... @@ -111,7 +111,9 @@ exports.postcssPlugin = (et) => {
selectorBlackList: [], // 选择器黑名单,可以使用正则
propWhiteList: [] // 属性名称为空,表示替换所有属性的值
}),
autoprefixer(),
autoprefixer({
remove: false
}),
postUse({
modules: ['postcss-clearfix', 'postcss-crip', 'postcss-short', 'postcss-center', 'postcss-position']
})
... ...
... ... @@ -16,8 +16,8 @@
<div class="name eps">{{name}}</div>
<div class="num">
<span class="coin-pic-s"></span>
<span>{{#if points}}{{points}}{{/if}}{{#if point}}{{point}}{{/if}}</span>
<span class="old-price">{{discountPoints}}</span>
<span>{{#if point}}{{point}}{{/if}}{{#if discountPoints}}{{discountPoints}}{{/if}}</span>
<span class="old-price">{{#if points}}{{points}}{{/if}}</span>
{{#if vipDesc}}<span class="discount">{{vipDesc}}</span>{{/if}}
</div>
<div class="remain">仅剩{{#if stock}}{{stock}}{{/if}}{{#if num}}{{num}}{{/if}}</div>
... ... @@ -28,4 +28,4 @@
</div>
</div>
{{/ list}}
</div>
\ No newline at end of file
</div>
... ...
... ... @@ -272,18 +272,19 @@ $(function() {
// tab
tabInit();
if (localStorage) {
if (sessionStorage) {
// 微信中点击之后,返回跳到指定位置
let totalH, scH;
let top = localStorage.changtu1;
let key = `PAGE_SCROLL_TOP_${location.href}`;
let top = sessionStorage.getItem(key);
window.scrollTo(0, top);
localStorage.removeItem('changtu1');
sessionStorage.removeItem(key);
$('a').click(function() {
totalH = event.pageY;
scH = event.clientY;
localStorage.changtu1 = totalH - scH; // 每次点击缓存高度
sessionStorage.setItem(key, totalH - scH); // 每次点击缓存高度
});
}
... ...
... ... @@ -4,6 +4,11 @@ const $ = require('yoho-jquery');
* 检测浏览器是否支持 webp 图片格式
*/
const checkWebpSupport = (feature) => {
// iOS APP 拦截网络请求,支持 webp
if (/yoho/i.test(navigator.userAgent) && /supportWebp/i.test(navigator.userAgent)) {
window.supportWebp = true;
return;
}
let kTestImages = {
lossy: 'UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA',
... ...
... ... @@ -45,7 +45,8 @@ function unregister() {
}
window.addEventListener('load', function() {
if (!yoho.isApp) {
// Android WebView 中 UserAgent 不正确
if (!yoho.isApp && !(yoho.isAndroid && yoho.isWechat)) {
if ('serviceWorker' in navigator && isHttps) {
$.ajax({
url: '//m.yohobuy.com/api/switch',
... ...
... ... @@ -65,7 +65,7 @@
font-size: 22px;
line-height: 48px;
display: flex;
align-items: center;
align-items: flex-start;
font-weight: 300;
.icon-tan {
... ...
... ... @@ -4,6 +4,7 @@
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
}
.tide-title {
... ... @@ -69,6 +70,7 @@
z-index: 3;
padding: 0 5px;
-webkit-line-clamp: 1;
word-break: break-all;
font-weight: bold;
}
}
... ... @@ -126,6 +128,7 @@
.goods-name {
-webkit-line-clamp: 1;
word-break: break-all;
word-wrap: normal;
}
... ...
... ... @@ -450,7 +450,7 @@ exports.processSkusInfo = (origin) => {
let sizeChosed = false;
// 只有一个尺码,默认选中
if (_.get(color, 'size_list.length') === 1) {
if (_.get(color, 'size_list.length') === 1 && _.get(origin, 'goods_list.length') === 1) {
sizeChosed = true;
}
... ...