Authored by 李奇

Merge branch 'gray' into feature/cps-optimize

... ... @@ -59,50 +59,22 @@ const index = (req, res, next) => {
logger.info(`installment index info: client_type=${req.query.client_type},req.user.uid=${req.user.uid},req.query.uid=${req.query.uid},cookies=${JSON.stringify(req.cookies)}`); // eslint-disable-line
Promise.all([
req.ctx(installmentModel).getStauts(uid),
req.ctx(installmentModel).getSearchIntallment({
uid: uid
})
req.ctx(installmentModel).getStauts(uid)
]).then((result) => {
if (req.yoho.isApp) {
_.forEach(result[1], goods => {
goods.url = yasProcess.addParamsToGoodsHref({
href: goods.url,
fromPageName: yasProcess.getPname(req),
fromPageParam: req.originalUrl
});
});
}
// openStatus:0 未申请 1审核中 2已开通 3 审核未通过
let openStatus = result[0];
let installmentOnly = {
title: {
title: '分期专享',
more_url: helpers.appUrlFormat(req.originalUrl, 'go.instalmentlist', {
title: '分期专享'
})
},
goods: result[1]
};
if (openStatus === '0') {
return Promise.all([
req.ctx(installmentModel).getResources('openN'),
req.ctx(installmentModel).getNotices()
]).then(data => {
_.forEach(data[0], (item) => {
if (item.singleOne) {
item.data[0].url = 'javascript:void(0)'; //eslint-disable-line
}
});
return {
content: data[0],
notice: data[1],
notOpen: true,
installmentOnly: installmentOnly
goHomePath: req.yoho.isApp ? 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.home","params":{"channel":"1"}}' : '//m.yohobuy.com/boys'
};
});
} else if (openStatus === '2') {
... ... @@ -114,17 +86,10 @@ const index = (req, res, next) => {
]).then((data) => {
let params = _.assign({
isOverdue: false,
installmentOnly: installmentOnly,
content: data[2],
notice: data[3]
}, data[0], data[1]);
if (installmentOnly.goods.length > 0) {
params.installmentOnly = _.assign({
showMore: true
}, installmentOnly);
}
// status: 1 正常 2 逾期 3 不可用 4 未开通
if (data[0].status === '2') {
params.replayStatus = '逾期';
... ...
... ... @@ -14,7 +14,7 @@ const logger = global.yoho.logger;
const stringProcess = require(`${global.utils}/string-process`);
const API_TIMEOUT = 10000;
const codeContent = {
openN: '0876085ff46bed27f1a1eb6ee8b68987',
openN: 'f53b7228f38994200491692b1f4ac54c',
openY: 'c233ad4ca91fef45ed7d0b26d9953e61',
advertisement: 'f3fe0793a7d59479542a14b15359c47d'
};
... ...
<div class="installment-page installment-bg yoho-page">
<div class="loading-tip">下拉刷新</div>
{{#unless notOpen}}
<div class="loading-tip">下拉刷新</div>
{{/unless}}
<div class="installment-main">
<div class="main-content">
{{#if notOpen}}
<input type="hidden" value="false" class="is-open">
{{# content}}
{{#if singleImage}}
{{> resources/banner}}
{{/if}}
{{/ content}}
{{#notice}}
{{> installment/installment-notice}}
{{/notice}}
<div class="open-index">
<ul class="open-info">
<li>
<span class="open-icon-1"></span>
<span>先消费<br>后还款</span>
</li>
<li>
<span class="open-icon-2"></span>
<span> 0元首付<br>随心分期</span>
</li>
<li>
<span class="open-icon-3"></span>
<span>指定商品<br>立享优惠</span>
</li>
</ul>
<a href="/home/installment/starting-service" class="open-btn">立即开通</a>
<div class="close-pic"></div>
<p class="close-installment-desc">很抱歉,来晚了<br>有货分期申请服务已暂停</p>
<a href="{{goHomePath}}" class="go-yoho-index">去逛逛</a>
<div class="installment-banner">
{{# content}}
{{#if newSingleImage}}
{{> resources/new-single-image}}
{{/if}}
{{/ content}}
</div>
{{else}}
<input type="hidden" value="true" class="is-open">
<div class="detail-tab">
<span class="on is-repay">待还款金额</span>
<span class="is-usable">可用额度</span>
</div>
<div class="repay installment-cont">
<div class="repay-area detail-bg">
<p class="detail-txt1">近7日待还款</p>
... ...
... ... @@ -21,7 +21,7 @@
<div data-userverify="{{captchaShow}}" data-geetest="{{useGeetest}}" id="js-img-check" {{#unless useGeetest}} class="full-img-verify" {{/unless}}></div>
<button id="loginBtn" class="login-btn disable" type="button">登录</button>
<div class="other-info">
<a href="{{internationalUrl}}">海外账号登录</a>
{{!-- <a href="{{internationalUrl}}">海外账号登录</a> --}}
<a href="{{smsLoginUrl}}">手机验证码登录</a>
<a id="getPswrdBtn" href="javascript:void(0);">忘记密码?</a>
</div>
... ...
... ... @@ -29,7 +29,7 @@
<button id="smsLoginBtn" class="sms-login-btn" type="button">登录</button>
<div class="other-info">
{{#if openPassword}}
<a href="{{internationalUrl}}">海外账号登录</a>
{{!-- <a href="{{internationalUrl}}">海外账号登录</a> --}}
<a href="{{loginUrl}}">账号密码登录</a>
{{/if}}
<a id="getPswrdBtn" href="javascript:void(0);">忘记密码?</a>
... ...
... ... @@ -97,7 +97,7 @@
<link rel="apple-touch-startup-image" href="https://cdn.yoho.cn/h5/forios/startup/startup-orange-6.png" media="screen and (min-device-width: 641px) and (max-device-width: 750px)">
<link rel="apple-touch-startup-image" href="https://cdn.yoho.cn/h5/forios/startup/startup-orange-5.png" media="screen and (max-device-width: 640px)">
</head>
<body class="{{pageStyle}}{{#if isWechat}} wechat-body{{/if}}{{#if width750}} width750{{/if}}{{#if isPassportPage}} passport-body{{/if}}{{#if isStarIndexPage}} star-index-bg{{/if}}{{#if isStarDetailPage}} star-class-body{{/if}}{{#if isInstallmentPage}} installment-body{{/if}}{{#if @root.isMarsApp}} is-mars-app{{/if}}{{#if @root.isNowApp}} is-now-app{{/if}}">
<body class="{{pageStyle}}{{#if isWechat}} wechat-body{{/if}}{{#if width750}} width750{{/if}}{{#if isPassportPage}} passport-body{{/if}}{{#if isStarIndexPage}} star-index-bg{{/if}}{{#if isStarDetailPage}} star-class-body{{/if}}{{#if isInstallmentPage}}{{#unless notOpen}} installment-body{{/unless}}{{/if}}{{#if @root.isMarsApp}} is-mars-app{{/if}}{{#if @root.isNowApp}} is-now-app{{/if}}">
<div class="main-wrap" id="main-wrap" {{#if appPath}}data-apppath='{{{appPath}}}'{{/if}} {{#if miniPath}}data-miniPath='{{{miniPath}}}'{{/if}} {{#if @root.wap.wechat.backDownload}}data-backDownload='{{@root.wap.wechat.backDownload}}'{{/if}}>
{{#if systemUpdate}}
{{> updata}}
... ...
{{#if singleOne}}
{{#data}}
<div class="banner-list">
<a href="{{url}}" id="{{../template_id}}" name="{{../template_intro}}" rel="nofollow">
<img src="{{image2 src w=imageWidth h=imageHeight q=60 mode=3}}" alt="活动图片">
</a>
</div>
{{/data}}
{{else}}
{{#data}}
<div class="banner-center banner-center-swiper">
<ul class="banner-list swiper-wrapper clearfix">
{{#list}}
<li class="swiper-slide">
<a href="{{url}}" id="{{../../template_id}}" name="{{../../template_intro}}" rel="nofollow">111
<img src="{{image2 src w=../imageWidth h=../imageWidth q=60 mode=3}}" alt="活动图片">
</a>
</li>
{{/list}}
</ul>
<div class="swiper-pagination" {{#unless singleOne}}style="display:block"{{/unless}}>
<div class="pagination-inner">
</div>
</div>
</div>
{{/data}}
{{/if}}
... ...
{
"name": "yohobuywap-node",
"version": "6.6.23",
"version": "6.6.24",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
... ... @@ -237,11 +237,10 @@ function loadMore($container, opt, url) {
if (opt.page === 1) {
loading.hideLoadingMask();
getDynamicData.getDynamicData();
window.rePosFooter();// 插入内容后重新计算底部位置
}
getDynamicData.getDynamicData();
opt.page++;
searching = false;
... ...
... ... @@ -3,7 +3,7 @@ let Repayment = require('./repayment');
let CHECKBOX_SELECTOR = 'input.installment-term';
let tip = require('plugin/tip');
let bp = require('./burying-point');
let orderCode = $('.info-box h4').html().replace('订单编号: ', '');
let orderCode = ($('.info-box h4').html() || '').replace('订单编号: ', '');
let repayment = new Repayment({
onGetSelection: function() {
let ret = [];
... ...
... ... @@ -98,6 +98,22 @@ let installment = {
}
self.setCookies();
$('.banner-center-swiper').each(function() {
if ($(this).find('li').length > 1) {
new Swiper(this, {
preloadImages: false,
lazyLoading: true,
lazyLoadingInPrevNext: true,
lazyLoadingOnTransitionStart: true,
loop: true,
autoplay: 3000,
autoplayDisableOnInteraction: false,
slideElement: 'li',
paginationHide: true
});
}
});
},
noticeScroll: function(selecter, time) {
new Swiper(selecter, {
... ...
... ... @@ -71,6 +71,12 @@ exports.showDialog = function(data, callback, callbackForLeft, fullWithBtn) {
$dialogWrapper.fadeOut();
} else if ($(event.target).hasClass('dialog-right-btn')) {
return callback();
} else if ($(event.target).hasClass('dialog-center-btn')) {
$('.dialog-wrapper').remove();
$('body').css({
overflow: '',
position: '',
});
} else if ($(event.target).closest('.dialog-box').length) {
return true;
} else {
... ...
... ... @@ -168,10 +168,16 @@ require('./detail/page-render')(function() {
$(document).scroll(function() {
if ($(document).scrollTop() >= $(document).height() - $(window).height() - 20) {
if (!$('.float-top').hasClass('animation')) {
let top = $('.back-to-top').offset().top -
let offset = $('.back-to-top').offset();
if (!offset) {
return;
}
let top = offset.top -
$('.float-top').offset().top +
($('.back-to-top').height() - $('.float-top').height()) / 2;
let left = $('.back-to-top').offset().left - $('.float-top').offset().left;
let left = offset.left - $('.float-top').offset().left;
$('.float-top').addClass('animation').css({
transform: 'translate(' + left + 'px, ' + top + 'px) scale(0, 0)',
... ...
... ... @@ -23,6 +23,37 @@
height: calc(100vh);
}
.close-pic {
width: 360px;
height: 359px;
background: resolve("home/installment-close.png") no-repeat;
background-size: contain;
margin: 128px auto 0;
}
.go-yoho-index {
width: 410px;
height: 69px;
background: #444;
border-radius: 6px;
color: #fff;
text-align: center;
line-height: 69px;
display: block;
margin: 0 auto;
}
.close-installment-desc {
line-height: 46px;
text-align: center;
font-size: 24px;
margin: 40px 0;
}
.installment-banner {
margin-top: 110px;
}
.loading-tip {
position: absolute;
width: 100%;
... ...
... ... @@ -75,6 +75,16 @@ module.exports = (list) => {
floor.data.length === 1 &&
(floor.singleOne = true);
if (floor.newSingleImage && floor.data.list.length === 1) {
floor.singleOne = true;
floor.data = {
imageWidth: floor.data.imageWidth,
imageHeight: floor.data.imageHeight,
src: floor.data.list[0].src,
url: floor.data.list[0].url
};
}
// 处理价格两位小数
if ((floor.vipUse || floor.popularSingleProduct || floor.newUserFloor) && floor.data) {
for (let item of floor.data.list) {
... ...