Authored by huangyCode

修改商品详情

... ... @@ -102,7 +102,8 @@ function goodsDetail(req, res, next) {
}
let finalResult = detailProcess.prodessDetailData(result);
console.log(result);
finalResult.activityGroupDetailList = result.activityGroupDetailList;
finalResult.activityIdDetail = result.activityIdDetail;
return res.render('group/goodsDetail', {
page: 'group-goodsDetail',
nodownload: true,
... ... @@ -116,7 +117,7 @@ function goodsDetail(req, res, next) {
canonical: {
currentHref: result.canonical
},
result: finalResult
result: finalResult,
});
}).catch(next);
}
... ...
... ... @@ -230,7 +230,7 @@ class GroupApi extends global.yoho.BaseModel {
activityId: obj.activityId
};
this.get({data: param})
return this.get({data: param})
.then(data => {
return data.data;
})
... ... @@ -247,12 +247,11 @@ class GroupApi extends global.yoho.BaseModel {
productSkn: obj.productSkn
};
this.get({data: param})
return this.get({data: param})
.then(function(data) {
if (!data || !data.data) {
return;
}
return data.data;
}).catch(function(error) {
console.log(error);
});
}
}
... ...
... ... @@ -179,10 +179,16 @@ class GroupService extends global.yoho.BaseModel {
async goodsDetail(params) {
let result = await this.api.getProductData(params);
result.activityIdDetail = await this.api.getCollageProductInfo(params);
result.activityGroupDetailList = await this.api.fetchActivityGroups(params);
result.introUrl = '/product/detail/intro/' + params.productSkn;
return result;
}
getJoinList(params) {
return this.api.fetchActivityGroups(params);
}
async order({
type,
page,
... ...
... ... @@ -34,18 +34,37 @@
<h2 class="goods-name"><span>{{.}}</span></h2>
{{/ goodsName}}
{{# goodsSubtitle}}
<h1 class="goods-subtitle"><span>{{.}}</span></h1>
{{/ goodsSubtitle}}
<div class="price-date">
<div class="goods-price data-bind">
<h1 class="current-price"></h1>
<h1 class="previous-price"></h1>
<div class="goods-price">
<h1 class="current-price">{{activityIdDetail.formatCollagePrice}}</h1>
<h1 class="previous-price">{{goodsPrice.previousPrice}}</h1>
{{#if activityIdDetail.joinPeopleNum}}
<div class="join-num">已有{{activityIdDetail.joinPeopleNum}}人拼团</div>
{{/if}}
</div>
</div>
<div class="goods-join">
<div class="title">选择下面小伙伴,快速加入</div>
{{#each activityGroupDetailList}}
<div class="content">
<img class="avatar" src="{{founderHeadUrl}}"/>
<span class="nick-name">{{founderNickName}}</span>
<div class="middle">
<div class="top" >
<span class="text">还差</span>
<span class="text" style='color:red'>{{lackNum}}</span>
<span class="text">人成功</span>
</div>
<span class="text">剩余{{formatLeftTime}}</span>
</div>
<div class='ibutton'>
立即参团
</div>
</div>
<button class="limit-sale data-can-get-limit-code data-bind" id='limit-sale'>获取限购码</button>
<button class="got-limit-sale data-code-empty data-bind">限购码已被抢光</button>
<button class="got-limit-sale data-got-code data-bind">已获取限购码</button>
{{/each}}
</div>
{{#if periodOfMarket}}
<div class="period-of-market">
... ...
.good-detail-page {
.goods-price {
float: none;
h1 {
display: inline-block;
line-height: 2.2rem;
}
.join-num {
line-height: 2.2rem;
float: right;
font-size: 14px;
}
}
.goods-join {
background: #fff;
margin-top: 14px;
.title {
color: #b0b0b0;
height: 76px;
line-height: 76px;
padding-left: 30px;
}
.content {
width: 100%;
height: 100px;
display: flex;
flex-direction: row;
align-items: center;
.ibutton {
width: 160px;
height: 60px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 30px;
font-size: 24px;
color: white;
text-align: center;
background: #000;
line-height: 60px;
border-radius: 35px;
}
.avatar {
width: 60px;
height: 60px;
border-radius: 30px;
margin-left: 30px;
border: 1px solid #e0e0e0;
margin-right: 0;
}
.nick-name {
font-size: 24px;
width: 280px;
color: #444;
margin-left: 20px;
}
.middle {
width: 150px;
height: 100px;
display: flex;
align-items: flex-start;
flex-direction: column;
justify-content: center;
margin-right: 20px;
.top {
display: flex;
flex-direction: row;
align-items: center;
}
.text {
font-size: 20px;
color: #b0b0b0;
}
}
}
}
}
... ...
@import "../../../scss/product/detail/detail";
@import "../../../scss/layout/swiper";
@import "../../../scss/product/detail/product-description";
@import "./group-detail";
... ...