Authored by 郭成尧

base-flux-done

... ... @@ -614,7 +614,7 @@ module.exports = class extends global.yoho.BaseModel {
dest = this._procShowStatus(dest, showStatus, isBeginSale);
dest.cartInfo.limitProductCode = origin.limitProductCode;
dest.cartInfo.limitCodeUrl = this._getLimitCodeUrl(origin.limitProductCode, origin.product_skn, ua); // eslint-disable-line
dest.cartInfo.limitCodeUrl = this._getLimitCodeUrl(origin.limitProductCode, origin.product_skn, ua); // eslint-disable-line
dest.cartInfo.limitProductPay = helpers.urlFormat('/cart/index/orderEnsure');
return resolve(dest);
} else {
... ... @@ -775,6 +775,11 @@ module.exports = class extends global.yoho.BaseModel {
};
}
finalResult.promYohoCoinText =
productProcess.procPromYohoCoin(_.get(result,
'vip_return_coin.max_return_coin_info', []),
params.current_vip_level);
// 2017电子门票不显示区域
// let ticketsProps = finalResult.cartInfo.props;
... ...
... ... @@ -78,6 +78,7 @@ module.exports = class extends global.yoho.BaseModel {
});
finalResult.recommendKeywords = recomdKeywords;
finalResult.vip_return_coin_info = _.get(result, 'data.vip_return_coin.vip_return_coin_info', []);
return finalResult;
});
... ... @@ -114,7 +115,6 @@ module.exports = class extends global.yoho.BaseModel {
}
return Promise.all(apiArray).then(info => {
// console.log(info);
let finalResult = {
promotion: null,
enterStore: null,
... ... @@ -168,14 +168,12 @@ module.exports = class extends global.yoho.BaseModel {
return this.get({
data: params,
param: cacheConf
})
.then(result => {
// console.log(result);
if (result && result.code === 200) {
return detailProcess.processShopsInfo(result.data);
}
return [];
}, () => []);
}).then(result => {
if (result && result.code === 200) {
return detailProcess.processShopsInfo(result.data);
}
return [];
}, () => []);
}
/**
... ... @@ -194,14 +192,12 @@ module.exports = class extends global.yoho.BaseModel {
return this.get({
data: params,
param: cacheConf
})
.then(result => {
// console.log(result);
if (result && result.code === 200) {
return result.data;
}
}).then(result => {
if (result && result.code === 200) {
return result.data;
}
return {};
});
return {};
});
}
};
... ...
... ... @@ -74,6 +74,9 @@
<div id="placeholder-promotion" style="height:100px;background-color:#fff;">
</div>
{{!--占位: 有货币促销--}}
<div id="placeholder-promotion-yohocoin"></div>
{{!-- 占位: 用户反馈, 店铺入口 --}}
<div id="placeholder-feedback-store"></div>
... ... @@ -139,7 +142,7 @@
{{> common/suspend-home}}
</div>
{{# vip_return_coin}}
{{#if vip_return_coin_info}}
<div class="coin-intro-box hide">
<div class="coin-intro">
<ul class="coin-ul">
... ... @@ -151,5 +154,5 @@
<div class="tip">页面展示有货币为预计结果,因为页面缓存等原因可能有出入,最终返还结果以结算提示为准</div>
</div>
</div>
{{/vip_return_coin}}
{{/if}}
{{/ result}}
... ...
{{#if promYohoCoinText}}
<div class="goods-discount" id="goodsDiscountYohoCoin">
<h2 class="coin-item short-text tap-hightlight">
<span class="promotion-icon"></span>{{promYohoCoinText}}
<span class="icon-down iconfont">&#xe609;</span>
</h2>
</div>
{{/if}}
... ...
... ... @@ -10,9 +10,5 @@
</div>
{{/if}}
{{/each}}
<h2 class="coin-item short-text tap-hightlight">
<span class="promotion-icon"></span>{{returnYohoCoinText}}
<span class="icon-down iconfont">&#xe609;</span>
</h2>
</div>
{{/if}}
... ...
... ... @@ -122,6 +122,9 @@ setTimeout(() => {
}
if (productId && (goodsId || productSkn)) {
let $promotionYohoCoin = $('#placeholder-promotion-yohocoin');
let promotionYohoCoinT = require('product/detail/promotion-yoho-coin.hbs');
setTimeout(() => {
$.ajax({
type: 'GET',
... ... @@ -140,6 +143,23 @@ setTimeout(() => {
let regPro = /\/product\/pro_([\d]+)_([\d]+)/;
let regSeckill = /\/product\/seckill/;
$promotionYohoCoin.replaceWith(promotionYohoCoinT({
promYohoCoinText: data.promYohoCoinText
}));
let $coinItem = $('#goodsDiscountYohoCoin');
let $coinIntroBox = $('.coin-intro-box');
// 返有货币促销模块点击事件
$coinItem.on('click', function() {
$coinIntroBox.removeClass('hide');
});
// 关闭有货币促销展示面板
$coinIntroBox.on('click', function() {
$coinIntroBox.addClass('hide');
});
// let regProSeckill = /\/product\/seckill\/pro_([\d]+)_([\d]+)/;
let thisHref = window.location.href;
let thisRefer = document.referrer;
... ... @@ -295,7 +315,7 @@ setTimeout(() => {
/*
* 获取商品 相关数据: 1. 促销 2. feedback 3. 店铺, 并初始化
*/
+ (function(skn, productId, brandId) { // eslint-disable-line
(function(skn, productId, brandId) { // eslint-disable-line
// 模版: 促销, feedback, 店铺
let promotionT = require('product/detail/promotion.hbs');
let feedbackT = require('product/detail/feedbacks.hbs');
... ... @@ -345,8 +365,6 @@ setTimeout(() => {
function promotionInit() {
let $goodsDiscount = $('#goodsDiscount');
let $discountFirstItem = $goodsDiscount.find('.first-item');
let $coinItem = $goodsDiscount.find('.coin-item');
let $coinIntroBox = $('.coin-intro-box');
let $discountFolder = $goodsDiscount.find('.discount-folder');
let $discountArrow = $goodsDiscount.find('.first-item .iconfont');
... ... @@ -370,15 +388,6 @@ setTimeout(() => {
}
});
}
// 返有货币点击事件
$coinItem.on('click', function() {
$coinIntroBox.removeClass('hide');
});
$coinIntroBox.on('click', function() {
$coinIntroBox.addClass('hide');
});
}
// boot
... ...
... ... @@ -715,7 +715,6 @@ $basicBtnC: #eb0313;
}
.goods-discount {
margin-bottom: 20px;
padding-top: 0;
display: block;
width: 100%;
... ... @@ -815,6 +814,7 @@ $basicBtnC: #eb0313;
}
.feedback-list {
margin-top: 20px;
margin-bottom: 20px;
background-color: #f0f0f0;
... ...
... ... @@ -654,3 +654,19 @@ exports.processSizeInfo = (origin) => {
}
return cartInfo;
};
/**
* 处理有货币的促销信息
*/
exports.procPromYohoCoin = (promotionYohoCoinData, vipLevel) => {
let showText = '';
_.forEach(promotionYohoCoinData, levelInfo => {
if (_.get(levelInfo, 'vip_level', -1) === vipLevel) {
showText = levelInfo.title;
return;
}
});
return showText;
};
... ...