Authored by yyq

fix feature-review by wenxue

... ... @@ -24,6 +24,25 @@ exports.productLst = function(req, res, next) {
order: req.query.order || 'pool_id_desc',
filter_poolId: req.query.filter_poolId || ''
}, req.query));
} else if (req.query.is_ufo === 'Y') {
let keys = ['product_id', 'productPool', 'sort', 'brand', 'series', 'size'];
let params = {
uid: uid,
udid: udid,
limit: 20
};
keys.forEach(function(k) {
if (req.query[k]) {
params[k] = req.query[k];
}
});
if (req.query.limit < 100) {
params.limit = req.query.limit;
}
getProductList = req.ctx(model).ufoProductList(params);
} else {
let keys = ['sort', 'misort', 'msort', 'gender', 'brand'],
params = {
... ...
... ... @@ -475,12 +475,6 @@ class featureModel extends global.yoho.BaseModel {
}
if (componentType === 'productGroup') {
if (f.component[0].defaultSkns) {
componentArr.push(f.component[0]);
f.component[0].newStyle = _.get(f, 'component[0].newStyle');
}
if (f.component[0].favourite_prds_enable === '1') {
f.component[0].searchCondition = Object.assign({
maybeLike: '1',
... ... @@ -499,17 +493,36 @@ class featureModel extends global.yoho.BaseModel {
// 默认为非ufo商品
f.component[0].ufoProduct = f.component[0].ufoProduct || '0';
// 一行一个商品或UFO商品展示销售数量
if (_.get(f, 'component[0].ufoProduct') === '1' || _.get(f, 'component[0].numOfOneRow') === '1') {
let showLastSoldTpl = '';
if (_.get(f, 'component[0].ufoProduct') === '1') {
let searchCondition = f.component[0].searchCondition || {};
searchCondition.is_ufo = 'Y';
if (_.get(f, 'component[0].ufoProduct') === '1') {
showLastSoldTpl = '{{soldNum}}人付款';
} else {
showLastSoldTpl = '累积销售{{soldNum}}件';
if (f.component[0].defaultSkns) {
searchCondition.product_id = f.component[0].defaultSkns;
f.component[0].defaultSkns = '';
}
f.component[0].showLastSoldTpl = showLastSoldTpl;
f.component[0].searchCondition = searchCondition;
if (_.get(f, 'component[0].numOfOneRow') === '1') { // 一行一个商品或UFO商品展示销售数量
let showLastSoldTpl = '';
if (_.get(f, 'component[0].ufoProduct') === '1') {
showLastSoldTpl = '{{soldNum}}人付款';
} else {
showLastSoldTpl = '累积销售{{soldNum}}件';
}
f.component[0].showLastSoldTpl = showLastSoldTpl;
}
}
if (f.component[0].defaultSkns) {
componentArr.push(f.component[0]);
f.component[0].newStyle = _.get(f, 'component[0].newStyle');
}
}
... ...
'use strict';
const _ = require('lodash');
const UfoApi = global.yoho.UfoAPI;
let _getProduct = function(o) {
let plan = o.product_price_plan_list;
... ... @@ -97,6 +98,27 @@ class individuationModel extends global.yoho.BaseModel {
return data;
});
}
ufoProductList(params) {
return this.get({
data: Object.assign({
method: 'ufo.product.search.common.list'
}, params),
api: UfoApi
}).then(res => {
let data = [],
list = (res && res.data && res.data.product_list) || [];
list.forEach(function(o) {
if (o) {
o.sales_price = o.price;
o.market_price = 0;
data.push(_getProduct(o));
}
});
return data;
});
}
getCoupon(params) {
return this.get({
data: Object.assign({
... ...
... ... @@ -120,7 +120,6 @@
{{/list}}
</div>
{{else}}
{{log this}}
<div class="tab-container{{#isEqualOr topFloat '1'}} tab-fix{{/isEqualOr}}{{#isEqualOr anchorTab '1'}} anchor-tab{{/isEqualOr}}" style="width: {{containerWidth}};{{#if bgimg}}background-image: url({{imageslim bgimg}});{{/if}}">
{{#list}}
<a class="anchor {{#isEqualOr ../chooseTab link}}active{{/isEqualOr}}" tab={{link}} style="{{tabStyle @index ../num}}">
... ...
... ... @@ -46,6 +46,10 @@
{{else}}
{{#isEqualOr conf.showSalePrice '1'}}
<div class="price" style="{{#if conf.salePriceBgColor}}background:{{conf.salePriceBgColor}};{{/if}}">
{{#if conf.priceBgImage}}
<img class="one-cell-price-img" src="{{image2 conf.priceBgImage q=85}}">
{{/if}}
<span class="sale-price"{{#if conf.fontColor}} style="color:{{conf.fontColor}};" {{/if}}>¥{{saleprice}}</span>
{{#if marketprice}}
<span class="market-price"{{#if conf.fontColor}} style="color:{{conf.fontColor}};" {{/if}}>¥{{marketprice}}</span>
... ...
... ... @@ -44,6 +44,9 @@
<div class="product-detail-text">
{{#isEqualOr showSalePrice '1'}}
<div class="price" style="{{#if salePriceBgColor}}background:{{salePriceBgColor}};{{/if}}">
{{#if priceBgImage}}
<img class="one-cell-price-img" src="{{image2 priceBgImage q=85}}">
{{/if}}
<span class="sale-price"{{#if fontColor}} style="color:{{fontColor}};" {{/if}}></span>
<span class="market-price"{{#if fontColor}} style="color:{{fontColor}};" {{/if}}></span>
</div>
... ...
... ... @@ -648,7 +648,7 @@ function tabInit() {
function tabFixInit() {
let tabNavFix = $('.tab-fix').closest('.floor');
let curTab = tabNavFix.find('.anchor.active');
let curTab = tabNavFix.find('.anchor').eq(0);
if (tabNavFix.length) {
let doc = $(document);
... ... @@ -656,7 +656,7 @@ function tabFixInit() {
store.tab.cloneTabs = cloneTab.find('a.anchor');
$(window).scroll(function() {
$(window).scroll(() => {
let top = doc.scrollTop();
let top1 = curTab.offset().top;
... ... @@ -763,7 +763,6 @@ function anchorFloorInit() {
});
}
} else {
console.log(store.tab.tabs);
store.tab.tabs.length && tabItemChoose(store.tab.tabs.eq(0), true);
store.tab.cloneTabs.length && tabItemChoose(store.tab.cloneTabs.eq(0), true);
}
... ...
... ... @@ -142,15 +142,23 @@
text-align: left;
display: flex;
align-items: center;
.one-cell-price-img {
width: auto;
height: 32px;
display: inline-block;
margin-right: 10px;
vertical-align: middle;
}
}
.sale-price {
font-size: 26px;
font-size: 30px;
font-weight: 700;
}
.market-price {
font-size: 24px;
font-size: 26px;
margin-left: 12px;
}
... ... @@ -493,6 +501,10 @@
height: 40px;
white-space: nowrap;
text-align: center;
.one-cell-price-img {
display: none;
}
}
.sale-price {
... ... @@ -880,7 +892,7 @@
padding: 0 30px 10px !important;
.market-price {
display: none;
display: none !important;
}
.feature-product-info {
... ... @@ -902,6 +914,10 @@
.product-detail-imgbox {
height: 280px;
overflow: hidden;
img {
height: 100% !important;
}
}
.product-name {
... ...