Authored by 陈峰

Merge branch 'feature/activity-product-group' into 'release/6.8.3'

Feature/activity product group

活动模版优化

See merge request !1602
... ... @@ -82,12 +82,34 @@ class featureModel extends global.yoho.BaseModel {
vipBgColor: value.vipBgColor,
showVipPrice: value.showVipPrice,
brandImg: value.brandImg,
showBrandUrl: value.showBrandUrl
showBrandUrl: value.showBrandUrl,
isAdvance: value.isAdvance,
advanceBgImg: value.advanceBgImg,
leftDownImg: value.leftDownImg
};
value._defaultSkns && value._defaultSkns.forEach(val => {
let pro = resList[val];
if (baseConf.isAdvance === '1') {
let plan = pro.product_price_plan_list;
if (plan.length) {
let time = Math.round(new Date() / 1000);
let effectPlan = [];
plan.forEach(planItem => {
if (planItem.effect_time > time) {
effectPlan.push(planItem);
}
});
if (effectPlan.length && time > effectPlan[0].show_begin_time && effectPlan[0].show_status === '1') { // eslint-disable-line
pro.curPlanPrice = effectPlan[0].current_saleprice;
}
}
}
if (pro) {
defaultPros.push(Object.assign({conf: baseConf}, pro));
}
... ...
'use strict';
const _ = require('lodash');
let _getProduct = function(o) {
return {
let plan = o.product_price_plan_list;
let res = {
small_sort_id: o.small_sort_id,
middle_sort_id: o.middle_sort_id,
max_sort_id: o.max_sort_id,
... ... @@ -21,6 +23,29 @@ let _getProduct = function(o) {
default_images: o.default_images,
goods_id: Array.isArray(o.goods_list) && o.goods_list.length ? o.goods_list[0].goods_id : void 0
};
plan = _.sortBy(plan, item => {
return +item.show_begin_time;
});
if (plan.length) {
let time = Math.round(new Date() / 1000);
let effectPlan = [];
plan.forEach(planItem => {
if (planItem.effect_time > time) {
effectPlan.push(planItem);
}
});
if (effectPlan.length && time > effectPlan[0].show_begin_time && effectPlan[0].show_status === '1') { // eslint-disable-line
o.curPlanPrice = effectPlan[0].current_saleprice;
_.assign(res, {curPlanPrice: effectPlan[0].current_saleprice});
}
}
return res;
};
const gender = {
... ...
... ... @@ -151,6 +151,10 @@
{{> feature/timed-cut-product}}
{{/isEqualOr}}
{{#isEqualOr type 'redPacket'}}
{{! 红包领取}}
{{> feature/red-packet}}
{{/isEqualOr}}
{{#isEqualOr type 'likedActivity'}}
{{! 点赞楼层}}
{{> feature/liked-activity}}
... ...
... ... @@ -22,6 +22,17 @@
<a class="new-brand-name {{#isEqualOr showBrandUrl '1'}}product-brand{{else}}product-detail{{/isEqualOr}}" href="">
<span class="brand-name" {{#if fontColor}} style="color:{{fontColor}};" {{/if}}></span>
</a>
<div class="sales-imgs-new">
{{#isEqualOr isAdvance '1'}}
<div class="advance" style="background-image: url({{advanceBgImg}});">
<img src="{{advanceBgImg}}" class="img-seat">
<span class="advance-price"></span>
</div>
{{/isEqualOr}}
{{#if leftDownImg}}
<img class="leftdownimg lazy" data-original="{{image2 leftDownImg q=85}}">
{{/if}}
</div>
</div>
</a>
{{#if brandImg}}
... ...
... ... @@ -8,6 +8,19 @@
<img class="rigtopimg lazy" data-original="{{image2 conf.rigTopImg q=85}}">
{{/if}}
<img class="product-detail-img lazy" data-original="{{image2 productimg q=85}}">
<div class="sales-imgs-old">
{{#isEqualOr conf.isAdvance '1'}}
{{#if curPlanPrice}}
<div class="advance" style="background-image: url({{conf.advanceBgImg}});">
<img src="{{conf.advanceBgImg}}" class="img-seat">
<span class="advance-price">¥{{curPlanPrice}}</span>
</div>
{{/if}}
{{/isEqualOr}}
{{#if conf.leftDownImg}}
<img class="leftdownimg lazy" data-original="{{image2 conf.leftDownImg q=85}}">
{{/if}}
</div>
</div>
{{#isEqualOr conf.showPrdName '1'}}
<p class="product-name">{{productname}}</p>
... ...
... ... @@ -19,6 +19,17 @@
<img class="rigtopimg" src="{{image2 rigTopImg q=85}}">
{{/if}}
<img class="product-detail-img lazy" src="">
<div class="sales-imgs-old sales-product-pool">
{{#isEqualOr isAdvance '1'}}
<div class="advance" style="background-image: url({{advanceBgImg}});">
<img src="{{advanceBgImg}}" class="img-seat">
<span class="advance-price"></span>
</div>
{{/isEqualOr}}
{{#if leftDownImg}}
<img class="leftdownimg lazy" data-original="{{image2 leftDownImg q=85}}">
{{/if}}
</div>
</div>
{{#isEqualOr showPrdName '1'}}
<p class="product-name"></p>
... ...
<a class="redenvelope yoho-redenvelope" href="javascript:;" data-token="{{redPacketToken}}">
</a>
... ...
<div class="shop-container{{#isEqualOr numOfOneRow '2'}} shop-two{{^}} shop-three{{/isEqualOr}}">
{{#renderData}}
{{#isEqualOr ../numOfOneRow '2'}}
<a{{#isEqualOr ../jump2Shop '1'}} href="{{href}}"{{/isEqualOr}}class="pull-left shop-box">
<a{{#isEqualOr ../jump2Shop '1'}} href="{{href}}"{{/isEqualOr}} class="pull-left shop-box">
<div class="shop-img">
{{#if ../lefTopImg}}
<img class="left-icon lazy" data-original="{{image2 ../lefTopImg q=85}}" alt="">
{{/if}}
<img class="lazy" data-original="{{image2 picture w=284 h=320 q=85}}" alt="">
<img class="lazy" data-original="{{image2 picture w=268 h=224 q=85}}" alt="">
</div>
<div class="shop-bottom-bar" style="background-image: url({{image2 ../brandImg w=290 h=60 q=85}})">
<span class="shop-name">{{shop_name}}</span>
<div class="shop-bottom-bar" style="background-image: url({{image2 ../brandImg w=268 h=60 q=85}})">
<span class="shop-name" style="{{#if ../shopNameFontColor}}color: {{../shopNameFontColor}}{{/if}}">{{shop_name}}</span>
</div>
</a>
{{^}}
<a{{#isEqualOr ../jump2Shop '1'}} href="{{href}}"{{/isEqualOr}}class="pull-left shop-box">
<a{{#isEqualOr ../jump2Shop '1'}} href="{{href}}"{{/isEqualOr}} class="pull-left shop-box">
<div class="shop-img">
<img class="left-icon lazy" data-original="{{image2 ../lefTopImg q=85}}" alt="">
<img class="lazy" data-original="{{image2 picture w=188 h=210 q=85}}" alt="">
{{#if ../lefTopImg}}
<img class="left-icon lazy" data-original="{{image2 ../lefTopImg q=85}}" alt="">
{{/if}}
<img class="lazy" data-original="{{image2 picture w=186 h=156 q=85}}" alt="">
</div>
<div class="shop-bottom-bar" style="background-image: url({{image2 ../brandImg w=290 h=60 q=85}});">
<span class="shop-name">{{shop_name}}</span>
<div class="shop-bottom-bar" style="background-image: url({{image2 ../brandImg w=186 h=40 q=85}});">
<span class="shop-name" style="{{#if ../shopNameFontColor}}color: {{../shopNameFontColor}}{{/if}}">{{shop_name}}</span>
</div>
</a>
{{/isEqualOr}}
... ...
... ... @@ -3,21 +3,25 @@
{{#is-equal-or ../numOfOneRow '2'}}
<a href="{{href}}" class="pull-left shop-box">
<div class="shop-img">
<img class="left-icon lazy" data-original="{{image2 ../lefTopImg q=85}}" alt="">
<img class="lazy" data-original="{{image2 shop_logo w=187 h=275 q=85}}" alt="">
{{#if ../lefTopImg}}
<img class="left-icon lazy" data-original="{{image2 ../lefTopImg q=85}}" alt="">
{{/if}}
<img class="lazy" data-original="{{image2 shop_logo w=268 h=224 q=85}}" alt="">
</div>
<div class="shop-bottom-bar" style="background-image: url({{image2 ../brandImg w=290 h=60 q=85}})">
<div class="shop-bottom-bar" style="background-image: url({{image2 ../brandImg w=268 h=60 q=85}})">
<span class="shop-name" style="{{#if ../shopNameFontColor}}color: {{../shopNameFontColor}}{{/if}}">{{shop_name}}</span>
</div>
</a>
{{^}}
<a href="{{href}}" class="pull-left shop-box {{#is-equal-or ../displayStyle '0'}}shop-logo{{/is-equal-or}}">
<div class="shop-img">
<img class="left-icon lazy" data-original="{{image2 ../lefTopImg q=85}}" alt="">
<img class="lazy" data-original="{{image2 shop_logo w=156 h=106 q=85}}" {{#is-equal-or ../displayStyle '0'}}class="shop-logo-img lazy"{{/is-equal-or}} alt="">
{{#if ../lefTopImg}}
<img class="left-icon lazy" data-original="{{image2 ../lefTopImg q=85}}" alt="">
{{/if}}
<img class="lazy" data-original="{{image2 shop_logo w=186 h=156 q=85}}" {{#is-equal-or ../displayStyle '0'}}class="shop-logo-img lazy"{{/is-equal-or}} alt="">
<span class="shop-name" style="{{#if ../shopNameFontColor}}color: {{../shopNameFontColor}}{{/if}}">{{shop_name}}</span>
</div>
<div class="shop-bottom-bar" style="background-image: url({{image2 ../brandImg w=290 h=60 q=85}});">
<div class="shop-bottom-bar" style="background-image: url({{image2 ../brandImg w=186 h=40 q=85}});">
</div>
</a>
{{/is-equal-or}}
... ...
... ... @@ -6,6 +6,7 @@
@import "scss/feature/shop";
@import "scss/feature/bottom";
@import "scss/feature/timed-cut";
@import "scss/feature/redenvelope";
@import "scss/feature/liked-activity";
/* stylelint-disable */
... ...
... ... @@ -167,6 +167,69 @@
color: #000;
}
.sales-imgs-old {
position: absolute;
right: 0;
bottom: 28px;
width: 100%;
height: auto;
z-index: 1;
}
.sales-imgs-new {
position: absolute;
right: 0;
bottom: 55px;
width: 100%;
height: auto;
z-index: 1;
.advance {
display: none;
}
}
.sales-product-pool {
.advance {
display: none;
}
}
.leftdownimg {
width: auto;
max-width: 100%;
height: 26px;
margin-top: 10px;
}
.advance {
width: auto;
height: 35px;
max-width: 100%;
background-size: contain;
background-repeat: no-repeat;
text-align: right;
display: inline-block;
position: relative;
.img-seat {
visibility: hidden;
height: 35px;
display: inline-block;
width: auto;
}
.advance-price {
position: absolute;
right: 10px;
top: 0;
line-height: 35px;
font-size: 27px;
font-weight: bold;
color: #fff;
}
}
.vip-price-text {
margin-right: 10px;
font-weight: 500;
... ...
.redenvelope {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
... ...
$margin-top: 42px;
$margin-left-2: 20px;
$margin-left-3: 19.75px;
$floor-height-2: 432px;
$floor-height-3: 335px;
$shop-width-2: 285px;
$shop-width-3: 187px;
$margin-left-2: 15px;
$padding-left-2: 45px;
$margin-left-3: 34px;
$floor-height-2: 281px;
$floor-height-3: 196px;
$shop-width-2: 268px;
$shop-width-3: 186px;
$margin-right-3: 7px;
.shop-container {
width: 100%;
... ... @@ -54,19 +56,19 @@ $shop-width-3: 187px;
}
&.shop-two {
padding-left: $margin-left-2;
padding-left: $padding-left-2;
margin-top: $margin-top;
.shop-box {
width: $shop-width-2;
height: $floor-height-2;
margin-right: $margin-left-2;
margin-bottom: 40px;
margin-bottom: 26px;
display: inline-block;
.shop-img {
width: $shop-width-2;
height: 372px;
height: 224px;
}
.shop-bottom-bar {
... ... @@ -87,19 +89,19 @@ $shop-width-3: 187px;
.shop-box {
width: $shop-width-3;
height: $floor-height-3;
margin-right: $margin-left-3;
margin-bottom: 40px;
margin-right: $margin-right-3;
margin-bottom: 16px;
display: inline-block;
.shop-img {
width: $shop-width-3;
height: 275px;
height: 156px;
}
.shop-bottom-bar {
width: 187px;
height: 60px;
line-height: 60px;
width: 186px;
height: 40px;
line-height: 40px;
color: #fff;
background-size: 100% 100%;
background-repeat: no-repeat;
... ... @@ -137,7 +139,7 @@ $shop-width-3: 187px;
height: auto;
.shop-img {
height: 320px;
height: 224px;
}
}
}
... ... @@ -146,17 +148,17 @@ $shop-width-3: 187px;
padding-left: 32px;
.shop-box {
width: 184px;
width: 186px;
height: auto;
margin-right: 8px;
margin-bottom: 20px;
margin-right: 7px;
margin-bottom: 16px;
.shop-bottom-bar {
height: 40px;
}
.shop-img {
height: 210px;
height: 156px;
}
}
... ... @@ -176,9 +178,9 @@ $shop-width-3: 187px;
.shop-logo-img {
position: relative;
width: 132px;
height: 88px;
height: 92px;
left: 26px;
top: 20px;
top: 17px;
}
}
}
... ...