Authored by QC-L

修改拼团首页展示列表

... ... @@ -179,11 +179,34 @@ class GroupService extends global.yoho.BaseModel {
return result;
}
async newGroupIndex() {
async newGroupIndex(tabIndex) {
let result = {};
let tabCurrentIndex = tabIndex || 0;
result.index = await this.newIndex();
console.log(result.index);
let filters = [];
result.index.forEach(item => {
if (item.template_name === 'guessLike') {
filters = item.data;
}
});
console.log(filters);
let indexFilter = filters[tabCurrentIndex] || {};
let query = {};
console.log(filters);
console.log(indexFilter);
indexFilter.query.forEach(item => {
query = Object.assign(query, item);
});
result.filterGroupList = await this.filterGroupList({
...query,
joinLimit: null
});
return result;
}
... ... @@ -286,6 +309,7 @@ class GroupService extends global.yoho.BaseModel {
val.sales_price = val.sales_price ? val.sales_price.toFixed(2) : '';
val.market_price = val.market_price ? val.market_price.toFixed(2) : '';
val.collagePrice = val.collagePrice ? val.collagePrice.toFixed(2) : '';
val.joinLimitStr = val.join_limit === 1 ? '邀新团' : '普通团';
});
}
return finalResult;
... ...
... ... @@ -20,9 +20,12 @@
{{#ifcond template_name "==" 'collageBuyPrdList'}}
{{> group/resources/collage-buy-prd-list}}
{{/ifcond}}
{{#ifcond template_name "==" 'guessLike'}}
{{> group/resources/guess-like}}
{{/ifcond}}
{{/each}}
</div>
<div id='fixedTab' class="tab-filter" data-group="{{#if tabs.joinLimit}}{{tabs.joinLimit}}{{/if}}">
{{!-- <div id='fixedTab' class="tab-filter" data-group="{{#if tabs.joinLimit}}{{tabs.joinLimit}}{{/if}}">
{{#if tabs.showTab}}
<div class="tab group-tab">
<div class="tab-item">
... ... @@ -34,13 +37,12 @@
</div>
{{/if}}
{{> group/resources/filter-tab}}
</div>
<div id="goodsContainer">
</div> --}}
<div id="goodsContainer" class="goods-container">
{{#if filterList.length}}
<div class="goods-list">
<div class="new-goods-list">
{{#each filterList}}
{{> group/resources/filter-list-item}}
{{> group/resources/new-index-filter-list-item}}
{{/each}}
</div>
{{/if}}
... ...
<div class="guess-like">
<div class="wapper">
<div class="guess-scroll">
{{#each data}}
<div class="guess-tab">
<img src="{{image2 src w=160 h=80 q=60 mode=3}}" />
</div>
{{/each}}
</div>
</div>
</div>
\ No newline at end of file
... ...
<div class="new-index-filter-list-item" data-activity-id="{{activity_id}}" data-product-skn="{{product_skn}}">
<div class="group-product-header">
{{#ifcond joinLimitStr "==" "邀新团"}}
<div class="new-group-product-left-icon">
<span class="new-group-product-left-icon-number"></span>
</div>
{{/ifcond}}
{{#if @root.lazyLoad}}
<img class="lazy new-group-product-image" data-original="{{image2 default_images w=400 h=390 q=60 mode=3}}" />
{{else}}
<img class="new-group-product-image" src="{{image2 default_images w=400 h=390 q=60 mode=3}}" />
{{/if}}
</div>
<div class="new-group-product-info-bg">
<div class="new-group-product-name">{{product_name}}</div>
<div class="new-group-price">
<div class="group-free-number">
<div class="new-group-free-post"></div>
<div class="new-group-number forcefontsize10">已拼{{joinPeopleNum}}</div>
</div>
<div class="new-group-prict-bg">
<div class="new-group-number-price">
<span class="new-group-people-numer">{{people_num}}人团</span>
<span class="new-group-price-collage">{{collage_price_str}}</span>
</div>
<div class="new-market-button">
<span class="new-group-price-market">单人价{{market_price_str}}</span>
<div class="go-group-product"></div>
</div>
</div>
</div>
</div>
</div>
... ...
.resource-collage-buy-prd-list-c {
margin: 20px;
margin-left: 20px;
margin-right: 20px;
margin-top: 20px;
margin-bottom: 10px;
background: white;
border-radius: 10px;
... ...
.guess-like {
overflow: hidden;
height: 80px;
.wapper {
overflow-x: scroll;
-ms-overflow-style: none;
overflow: -moz-scrollbars-none;
.guess-scroll {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
width: auto;
min-width: 100%;
.guess-tab {
min-width: 160px;
}
}
}
.wapper::-webkit-scrollbar { width: 0 !important; }
}
... ...
... ... @@ -5,8 +5,10 @@
@import "floor/two-image";
@import "floor/split-image";
@import "floor/collage-buy-list";
@import "floor/guess-like";
@import "tabs";
@import "filter-list";
@import "new-filter-list";
.group {
.resources {
... ...
.goods-container {
background: #f0f0f0;
}
.new-goods-list {
display: flex;
flex-direction: column;
margin: 0 20px;
}
.new-index-filter-list-item:first-child {
margin-top: 0;
}
.new-index-filter-list-item {
background: white;
flex: 1;
display: flex;
margin-bottom: 10px;
margin-top: 10px;
.new-group-product-image {
margin: 20px;
width: 162px;
height: 220px;
}
.new-group-product-info-bg {
flex-grow: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
margin-bottom: 20px;
}
.new-group-product-name {
margin-top: 20px;
margin-right: 20px;
font-family: PingFang-SC-Regular, sans-serif;
color: #222;
letter-spacing: 0;
line-height: 36px;
height: 56px;
font-size: 24px;
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
word-wrap: break-word;
white-space: normal !important;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.new-group-free-post {
width: 60px;
height: 38px;
background: url("img/activity/group/group/new-free-post@3x.png") no-repeat;
background-size: contain;
margin-right: 20px;
}
.new-market-button {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: flex-end;
}
.go-group-product {
width: 160px;
height: 60px;
background: url("img/activity/group/group/go-group@3x.png") no-repeat;
background-size: contain;
left: -5px;
}
.group-free-number {
display: flex;
flex-direction: row;
align-items: flex-start;
}
.new-group-number {
font-family: PingFang-SC-Regular, sans-serif;
letter-spacing: 0;
box-sizing: border-box;
height: 30px;
line-height: 30px;
padding-left: 20px;
padding-right: 20px;
border-radius: 15px;
border: 0.5px #222 solid;
color: #222;
}
.forcefontsize10 {
display: inline-block;
font-size: 12px;
-webkit-text-size-adjust: none;
transform: scale(0.83, 0.83);
}
.new-group-prict-bg {
display: flex;
flex-direction: column;
font-size: 22px;
}
.new-group-price {
display: flex;
flex-direction: column;
justify-content: space-between;
flex-grow: 1;
margin-right: 20px;
}
.new-group-number-price {
color: #d0021b;
}
.new-group-price-collage {
margin-left: 20px;
font-size: 36px;
}
.new-group-price-market {
font-family: PingFang-SC-Regular, sans-serif;
font-size: 12px;
color: #b0b0b0;
}
.new-group-product-left-icon {
position: absolute;
top: 40px;
width: 88px;
height: 40px;
left: 0;
font-size: 22px;
background: url("img/activity/group/group/Rectangle@3x.png") no-repeat;
background-size: contain;
}
.new-group-product-left-icon-number {
display: inline-block;
color: #fff;
font-size: 22px;
margin-left: 12px;
margin-top: 5px;
}
}
... ...