Authored by huangyCode

修改商品详情

... ... @@ -136,6 +136,9 @@ function goodsDetail(req, res, next) {
finalResult.activityGroupDetailList = result.activityGroupDetailList;
finalResult.activityIdDetail = result.activityIdDetail;
finalResult.shopInfo = result.shopInfo;
finalResult.support = result.support;
finalResult.floor = result.floor;
return res.render('group/goodsDetail', {
page: 'group-goodsDetail',
nodownload: true,
... ...
... ... @@ -216,7 +216,7 @@ class GroupApi extends global.yoho.BaseModel {
shop_id: data.shop_id,
};
this.get({data: param})
return this.get({data: param})
.then(res =>{
let shopList = res.data;
... ... @@ -225,15 +225,9 @@ class GroupApi extends global.yoho.BaseModel {
shopInfo.brand_ico = shopInfo.brand_ico.replace(/{width}/g, 120)
.replace(/{height}/g, 60).replace('{mode}', 2);
return {
shopInfo,
shopList
};
return shopInfo;
} else {
return {
shopInfo: {},
shopList: []
};
return null;
}
});
}
... ... @@ -270,6 +264,28 @@ class GroupApi extends global.yoho.BaseModel {
console.log(error);
});
}
getSupport(obj) {
let param = {
method: 'app.product.supportService',
product_skn: obj.productSkn,
coupon_limit_status: 0
};
return this.get({data: param})
.then(function(data) {
let free = [{
flag: 1,
title: '免邮',
desc: '免邮'
}];
return free.concat(data.data);
})
.catch(function(error) {
console.log(error);
});
}
}
module.exports = GroupApi;
... ...
... ... @@ -199,8 +199,13 @@ class GroupService extends global.yoho.BaseModel {
async goodsDetail(params) {
let result = await this.api.getProductData(params);
result.shopInfo = await this.api.getShopInfo({brand_id: result.brand_id, shop_id: result.shop_id});
result.activityIdDetail = await this.api.getCollageProductInfo(params);
result.activityGroupDetailList = await this.api.fetchActivityGroups(params);
result.support = await this.api.getSupport(params);
result.floor = await this.api._getResourceCode({
contentCode: '3c3a94fd6c6e19508b6921acd7f6cbad'
});
for (let item of result.activityGroupDetailList) {
item.formatLeftTime = this.formatDate(item.leftTime);
}
... ...
... ... @@ -43,33 +43,91 @@
{{/if}}
</div>
</div>
{{#if activityGroupDetailList}}
<div class="goods-join">
<div class="title">选择下面小伙伴,快速加入</div>
{{#each activityGroupDetailList}}
<div class="content">
<img class="avatar" src="{{image2 founderHeadUrl q=60 w=60 h=60}}"/>
<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>
<div class="goods-join">
<div class="title">选择下面小伙伴,快速加入</div>
{{#each activityGroupDetailList}}
<div class="content">
<img class="avatar" src="{{image2 founderHeadUrl q=60 w=60 h=60}}"/>
<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 class="text">剩余<span class="left-time"
data-value="{{leftTime}}">{{formatLeftTime}}</span></div>
</div>
<div class="text">剩余<span class="left-time" data-value="{{leftTime}}">{{formatLeftTime}}</span></div>
<div class='ibutton'>
立即参团
</div>
</div>
{{/each}}
</div>
{{/if}}
{{#if shopInfo}}
<div class="shop-info" data-id="{{shopInfo.shop_id}}">
<img class="shop-icon" src="{{shopInfo.brand_ico}}"/>
<span class="shop-name">{{shopInfo.brand_name}}</span>
<span class="shop-detail">进入店铺</span>
</div>
{{/if}}
<div class='ibutton'>
立即参团
</div>
</div>
<div class="rule-detail" bindtap="detailsRegularTap">
<span class="cell-name-text">拼团规则说明</span>
<img src="//img10.static.yhbimg.com/yhb-img01/2019/02/20/14/0141f133c49d96725870ce82328fd2c143.png" class="m-icon"/>
</div>
<div class="rule-detail-cell">
<div class="tree">
<img src='//img11.static.yhbimg.com/yhb-img01/2019/02/20/14/01f2ab50d7c23882f75a1ff7b790418593.png'/>
</div>
<div class="tree-tip-view">
<span class="tree-tip">{{activityIdDetail.activityDescription}}</span>
</div>
</div>
{{#if support}}
<div class="support-service">
{{#each support}}
<div class="support-service-item">
{{#if flag}}
<img src="//img11.static.yhbimg.com/yhb-img01/2019/02/20/15/010f1dcec3c258c0b302e082397f3f8488.png" class="support-service-image"/>
{{else}}
<img src="//img11.static.yhbimg.com/yhb-img01/2019/02/20/15/01f4a1c2bd1eed2bdf32ddbcfdee9acfd9.png" class="support-service-image"/>
{{/if}}
<span class="support-service-title">{{title}}</span>
</div>
{{/each}}
</div>
{{/if}}
<div class="floors">
{{#each floor}}
{{#ifcond template_name "==" 'focus'}}
{{> group/resources/focus}}
{{/ifcond}}
{{#ifcond template_name "==" 'newSingleImage'}}
{{> group/resources/new-single-image}}
{{/ifcond}}
{{#ifcond template_name "==" 'twoPicture'}}
{{> group/resources/two-image}}
{{/ifcond}}
{{#ifcond template_name "==" 'image_list'}}
{{> group/resources/four-image}}
{{/ifcond}}
{{#ifcond template_name "==" 'splitJointImg'}}
{{> group/resources/split-image}}
{{/ifcond}}
{{#ifcond template_name "==" 'collageBuyPrdList'}}
{{> group/resources/collage-buy-prd-list}}
{{/ifcond}}
{{/each}}
</div>
{{#if periodOfMarket}}
<div class="period-of-market">
<h1>上市期:</h1>
<h1 >{{periodOfMarket}}</h1>
<h1>{{periodOfMarket}}</h1>
</div>
{{/if}}
... ... @@ -110,9 +168,9 @@
</div>
<div class="goods-discount data-bind" id="goodsDiscount">
<h1 class="first-item short-text tap-hightlight"><span class="icon-down iconfont dropdown">&#xe609;</span></h1>
<h1 class="first-item short-text tap-hightlight"><span class="icon-down iconfont dropdown">&#xe609;</span>
</h1>
<div class="discount-folder">
<h1 class="folder-item tap-hightlight"></h1>
</div>
... ... @@ -151,7 +209,7 @@
<input type="hidden" id="discount-buy" value="{{num}}">
<input type="hidden" id="promotion-phrase" value="{{promotionPhrase}}">
{{/ discountBuy}}
<div id="productDesc" {{#if limit}}class="limit"{{/if}}> </div>
<div id="productDesc" {{#if limit}}class="limit"{{/if}}></div>
{{> detail/recommend-for-you}}
<div class="chose-panel"></div>
... ...
... ... @@ -85,4 +85,140 @@
}
}
}
.shop-info {
height: 120px;
background-color: #fff;
margin-top: 14px;
.shop-icon {
height: 80px;
width: 150px;
margin-top: 20px;
margin-left: 30px;
display: inline-block;
}
.shop-name {
display: inline-block;
font-family: SanFranciscoText-Regular, sans-serif;
font-size: 32px;
color: #4a4a4a;
letter-spacing: 0;
line-height: 120px;
vertical-align: top;
margin-left: 18px;
}
.shop-detail {
float: right;
margin-top: 30px;
margin-right: 40px;
display: inline-block;
height: 60px;
border-radius: 60px;
border: 1px solid #4a4a4a;
font-family: PingFang-SC-Medium, sans-serif;
font-size: 26px;
color: #444;
letter-spacing: 0;
font-weight: 500;
padding: 0 28px;
line-height: 57px;
box-sizing: border-box;
}
}
.rule-detail {
width: 100%;
height: 76px;
align-items: center;
display: flex;
justify-content: space-between;
background-color: white;
margin-top: 14px;
.cell-name-text {
width: 50%;
color: #444;
font-size: 28px;
margin-left: 30px;
text-align: left;
}
.m-icon {
width: 15px;
height: 26px;
margin-right: 30px;
display: inline-block;
overflow: hidden;
}
}
.rule-detail-cell {
background-color: white;
width: 100%;
height: 250px;
align-items: center;
display: flex;
flex-direction: column;
border-top: 1px solid #e0e0e0;
.tree {
width: 100%;
height: 170px;
align-items: center;
justify-content: center;
display: flex;
flex-direction: row;
img {
width: 520px;
}
}
.tree-tip-view {
width: 100%;
height: 80px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
color: #b0b0b0;
font-size: 20px;
}
}
.support-service {
background: #fff;
margin-top: 14px;
margin-bottom: 14px;
flex-direction: row;
display: flex;
padding: 20px;
}
.support-service-item {
display: flex;
align-items: center;
flex-direction: row;
padding-left: 15px;
}
.support-service-image {
width: 30px;
height: 30px;
display: inline-block;
overflow: hidden;
}
.support-service-title {
color: #444;
font-size: 26px;
padding-left: 5px;
}
.floors {
margin-bottom: 14px;
}
}
... ...