Authored by huangyCode

修改商品详情

@@ -136,6 +136,9 @@ function goodsDetail(req, res, next) { @@ -136,6 +136,9 @@ function goodsDetail(req, res, next) {
136 136
137 finalResult.activityGroupDetailList = result.activityGroupDetailList; 137 finalResult.activityGroupDetailList = result.activityGroupDetailList;
138 finalResult.activityIdDetail = result.activityIdDetail; 138 finalResult.activityIdDetail = result.activityIdDetail;
  139 + finalResult.shopInfo = result.shopInfo;
  140 + finalResult.support = result.support;
  141 + finalResult.floor = result.floor;
139 return res.render('group/goodsDetail', { 142 return res.render('group/goodsDetail', {
140 page: 'group-goodsDetail', 143 page: 'group-goodsDetail',
141 nodownload: true, 144 nodownload: true,
@@ -216,7 +216,7 @@ class GroupApi extends global.yoho.BaseModel { @@ -216,7 +216,7 @@ class GroupApi extends global.yoho.BaseModel {
216 shop_id: data.shop_id, 216 shop_id: data.shop_id,
217 }; 217 };
218 218
219 - this.get({data: param}) 219 + return this.get({data: param})
220 .then(res =>{ 220 .then(res =>{
221 let shopList = res.data; 221 let shopList = res.data;
222 222
@@ -225,15 +225,9 @@ class GroupApi extends global.yoho.BaseModel { @@ -225,15 +225,9 @@ class GroupApi extends global.yoho.BaseModel {
225 225
226 shopInfo.brand_ico = shopInfo.brand_ico.replace(/{width}/g, 120) 226 shopInfo.brand_ico = shopInfo.brand_ico.replace(/{width}/g, 120)
227 .replace(/{height}/g, 60).replace('{mode}', 2); 227 .replace(/{height}/g, 60).replace('{mode}', 2);
228 - return {  
229 - shopInfo,  
230 - shopList  
231 - }; 228 + return shopInfo;
232 } else { 229 } else {
233 - return {  
234 - shopInfo: {},  
235 - shopList: []  
236 - }; 230 + return null;
237 } 231 }
238 }); 232 });
239 } 233 }
@@ -270,6 +264,28 @@ class GroupApi extends global.yoho.BaseModel { @@ -270,6 +264,28 @@ class GroupApi extends global.yoho.BaseModel {
270 console.log(error); 264 console.log(error);
271 }); 265 });
272 } 266 }
  267 +
  268 + getSupport(obj) {
  269 + let param = {
  270 + method: 'app.product.supportService',
  271 + product_skn: obj.productSkn,
  272 + coupon_limit_status: 0
  273 + };
  274 +
  275 + return this.get({data: param})
  276 + .then(function(data) {
  277 + let free = [{
  278 + flag: 1,
  279 + title: '免邮',
  280 + desc: '免邮'
  281 + }];
  282 +
  283 + return free.concat(data.data);
  284 + })
  285 + .catch(function(error) {
  286 + console.log(error);
  287 + });
  288 + }
273 } 289 }
274 290
275 module.exports = GroupApi; 291 module.exports = GroupApi;
@@ -199,8 +199,13 @@ class GroupService extends global.yoho.BaseModel { @@ -199,8 +199,13 @@ class GroupService extends global.yoho.BaseModel {
199 async goodsDetail(params) { 199 async goodsDetail(params) {
200 let result = await this.api.getProductData(params); 200 let result = await this.api.getProductData(params);
201 201
  202 + result.shopInfo = await this.api.getShopInfo({brand_id: result.brand_id, shop_id: result.shop_id});
202 result.activityIdDetail = await this.api.getCollageProductInfo(params); 203 result.activityIdDetail = await this.api.getCollageProductInfo(params);
203 result.activityGroupDetailList = await this.api.fetchActivityGroups(params); 204 result.activityGroupDetailList = await this.api.fetchActivityGroups(params);
  205 + result.support = await this.api.getSupport(params);
  206 + result.floor = await this.api._getResourceCode({
  207 + contentCode: '3c3a94fd6c6e19508b6921acd7f6cbad'
  208 + });
204 for (let item of result.activityGroupDetailList) { 209 for (let item of result.activityGroupDetailList) {
205 item.formatLeftTime = this.formatDate(item.leftTime); 210 item.formatLeftTime = this.formatDate(item.leftTime);
206 } 211 }
@@ -43,33 +43,91 @@ @@ -43,33 +43,91 @@
43 {{/if}} 43 {{/if}}
44 </div> 44 </div>
45 </div> 45 </div>
  46 + {{#if activityGroupDetailList}}
  47 + <div class="goods-join">
  48 + <div class="title">选择下面小伙伴,快速加入</div>
  49 + {{#each activityGroupDetailList}}
  50 + <div class="content">
  51 + <img class="avatar" src="{{image2 founderHeadUrl q=60 w=60 h=60}}"/>
  52 + <span class="nick-name">{{founderNickName}}</span>
  53 + <div class="middle">
  54 + <div class="top">
  55 + <span class="text">还差</span>
  56 + <span class="text" style='color:red'>{{lackNum}}</span>
  57 + <span class="text">人成功</span>
  58 + </div>
46 59
47 - <div class="goods-join">  
48 - <div class="title">选择下面小伙伴,快速加入</div>  
49 - {{#each activityGroupDetailList}}  
50 - <div class="content">  
51 - <img class="avatar" src="{{image2 founderHeadUrl q=60 w=60 h=60}}"/>  
52 - <span class="nick-name">{{founderNickName}}</span>  
53 - <div class="middle">  
54 - <div class="top" >  
55 - <span class="text">还差</span>  
56 - <span class="text" style='color:red'>{{lackNum}}</span>  
57 - <span class="text">人成功</span> 60 + <div class="text">剩余<span class="left-time"
  61 + data-value="{{leftTime}}">{{formatLeftTime}}</span></div>
58 </div> 62 </div>
59 63
60 - <div class="text">剩余<span class="left-time" data-value="{{leftTime}}">{{formatLeftTime}}</span></div> 64 + <div class='ibutton'>
  65 + 立即参团
  66 + </div>
61 </div> 67 </div>
  68 + {{/each}}
  69 + </div>
  70 + {{/if}}
  71 + {{#if shopInfo}}
  72 + <div class="shop-info" data-id="{{shopInfo.shop_id}}">
  73 + <img class="shop-icon" src="{{shopInfo.brand_ico}}"/>
  74 + <span class="shop-name">{{shopInfo.brand_name}}</span>
  75 + <span class="shop-detail">进入店铺</span>
  76 + </div>
  77 + {{/if}}
62 78
63 - <div class='ibutton'>  
64 - 立即参团  
65 - </div>  
66 - </div> 79 + <div class="rule-detail" bindtap="detailsRegularTap">
  80 + <span class="cell-name-text">拼团规则说明</span>
  81 + <img src="//img10.static.yhbimg.com/yhb-img01/2019/02/20/14/0141f133c49d96725870ce82328fd2c143.png" class="m-icon"/>
  82 + </div>
  83 + <div class="rule-detail-cell">
  84 + <div class="tree">
  85 + <img src='//img11.static.yhbimg.com/yhb-img01/2019/02/20/14/01f2ab50d7c23882f75a1ff7b790418593.png'/>
  86 + </div>
  87 + <div class="tree-tip-view">
  88 + <span class="tree-tip">{{activityIdDetail.activityDescription}}</span>
  89 + </div>
  90 + </div>
  91 + {{#if support}}
  92 + <div class="support-service">
  93 + {{#each support}}
  94 + <div class="support-service-item">
  95 + {{#if flag}}
  96 + <img src="//img11.static.yhbimg.com/yhb-img01/2019/02/20/15/010f1dcec3c258c0b302e082397f3f8488.png" class="support-service-image"/>
  97 + {{else}}
  98 + <img src="//img11.static.yhbimg.com/yhb-img01/2019/02/20/15/01f4a1c2bd1eed2bdf32ddbcfdee9acfd9.png" class="support-service-image"/>
  99 + {{/if}}
  100 + <span class="support-service-title">{{title}}</span>
  101 + </div>
  102 + {{/each}}
  103 + </div>
  104 + {{/if}}
  105 + <div class="floors">
  106 + {{#each floor}}
  107 + {{#ifcond template_name "==" 'focus'}}
  108 + {{> group/resources/focus}}
  109 + {{/ifcond}}
  110 + {{#ifcond template_name "==" 'newSingleImage'}}
  111 + {{> group/resources/new-single-image}}
  112 + {{/ifcond}}
  113 + {{#ifcond template_name "==" 'twoPicture'}}
  114 + {{> group/resources/two-image}}
  115 + {{/ifcond}}
  116 + {{#ifcond template_name "==" 'image_list'}}
  117 + {{> group/resources/four-image}}
  118 + {{/ifcond}}
  119 + {{#ifcond template_name "==" 'splitJointImg'}}
  120 + {{> group/resources/split-image}}
  121 + {{/ifcond}}
  122 + {{#ifcond template_name "==" 'collageBuyPrdList'}}
  123 + {{> group/resources/collage-buy-prd-list}}
  124 + {{/ifcond}}
67 {{/each}} 125 {{/each}}
68 </div> 126 </div>
69 {{#if periodOfMarket}} 127 {{#if periodOfMarket}}
70 <div class="period-of-market"> 128 <div class="period-of-market">
71 <h1>上市期:</h1> 129 <h1>上市期:</h1>
72 - <h1 >{{periodOfMarket}}</h1> 130 + <h1>{{periodOfMarket}}</h1>
73 </div> 131 </div>
74 {{/if}} 132 {{/if}}
75 133
@@ -110,9 +168,9 @@ @@ -110,9 +168,9 @@
110 </div> 168 </div>
111 169
112 170
113 -  
114 <div class="goods-discount data-bind" id="goodsDiscount"> 171 <div class="goods-discount data-bind" id="goodsDiscount">
115 - <h1 class="first-item short-text tap-hightlight"><span class="icon-down iconfont dropdown">&#xe609;</span></h1> 172 + <h1 class="first-item short-text tap-hightlight"><span class="icon-down iconfont dropdown">&#xe609;</span>
  173 + </h1>
116 <div class="discount-folder"> 174 <div class="discount-folder">
117 <h1 class="folder-item tap-hightlight"></h1> 175 <h1 class="folder-item tap-hightlight"></h1>
118 </div> 176 </div>
@@ -151,7 +209,7 @@ @@ -151,7 +209,7 @@
151 <input type="hidden" id="discount-buy" value="{{num}}"> 209 <input type="hidden" id="discount-buy" value="{{num}}">
152 <input type="hidden" id="promotion-phrase" value="{{promotionPhrase}}"> 210 <input type="hidden" id="promotion-phrase" value="{{promotionPhrase}}">
153 {{/ discountBuy}} 211 {{/ discountBuy}}
154 - <div id="productDesc" {{#if limit}}class="limit"{{/if}}> </div> 212 + <div id="productDesc" {{#if limit}}class="limit"{{/if}}></div>
155 {{> detail/recommend-for-you}} 213 {{> detail/recommend-for-you}}
156 <div class="chose-panel"></div> 214 <div class="chose-panel"></div>
157 215
@@ -85,4 +85,140 @@ @@ -85,4 +85,140 @@
85 } 85 }
86 } 86 }
87 } 87 }
  88 +
  89 + .shop-info {
  90 + height: 120px;
  91 + background-color: #fff;
  92 + margin-top: 14px;
  93 +
  94 + .shop-icon {
  95 + height: 80px;
  96 + width: 150px;
  97 + margin-top: 20px;
  98 + margin-left: 30px;
  99 + display: inline-block;
  100 + }
  101 +
  102 + .shop-name {
  103 + display: inline-block;
  104 + font-family: SanFranciscoText-Regular, sans-serif;
  105 + font-size: 32px;
  106 + color: #4a4a4a;
  107 + letter-spacing: 0;
  108 + line-height: 120px;
  109 + vertical-align: top;
  110 + margin-left: 18px;
  111 + }
  112 +
  113 + .shop-detail {
  114 + float: right;
  115 + margin-top: 30px;
  116 + margin-right: 40px;
  117 + display: inline-block;
  118 + height: 60px;
  119 + border-radius: 60px;
  120 + border: 1px solid #4a4a4a;
  121 + font-family: PingFang-SC-Medium, sans-serif;
  122 + font-size: 26px;
  123 + color: #444;
  124 + letter-spacing: 0;
  125 + font-weight: 500;
  126 + padding: 0 28px;
  127 + line-height: 57px;
  128 + box-sizing: border-box;
  129 + }
  130 + }
  131 +
  132 + .rule-detail {
  133 + width: 100%;
  134 + height: 76px;
  135 + align-items: center;
  136 + display: flex;
  137 + justify-content: space-between;
  138 + background-color: white;
  139 + margin-top: 14px;
  140 +
  141 + .cell-name-text {
  142 + width: 50%;
  143 + color: #444;
  144 + font-size: 28px;
  145 + margin-left: 30px;
  146 + text-align: left;
  147 + }
  148 +
  149 + .m-icon {
  150 + width: 15px;
  151 + height: 26px;
  152 + margin-right: 30px;
  153 + display: inline-block;
  154 + overflow: hidden;
  155 + }
  156 + }
  157 +
  158 + .rule-detail-cell {
  159 + background-color: white;
  160 + width: 100%;
  161 + height: 250px;
  162 + align-items: center;
  163 + display: flex;
  164 + flex-direction: column;
  165 + border-top: 1px solid #e0e0e0;
  166 +
  167 + .tree {
  168 + width: 100%;
  169 + height: 170px;
  170 + align-items: center;
  171 + justify-content: center;
  172 + display: flex;
  173 + flex-direction: row;
  174 +
  175 + img {
  176 + width: 520px;
  177 + }
  178 + }
  179 +
  180 + .tree-tip-view {
  181 + width: 100%;
  182 + height: 80px;
  183 + display: flex;
  184 + flex-direction: row;
  185 + align-items: center;
  186 + justify-content: center;
  187 + color: #b0b0b0;
  188 + font-size: 20px;
  189 + }
  190 + }
  191 +
  192 + .support-service {
  193 + background: #fff;
  194 + margin-top: 14px;
  195 + margin-bottom: 14px;
  196 + flex-direction: row;
  197 + display: flex;
  198 + padding: 20px;
  199 + }
  200 +
  201 + .support-service-item {
  202 + display: flex;
  203 + align-items: center;
  204 + flex-direction: row;
  205 + padding-left: 15px;
  206 + }
  207 +
  208 + .support-service-image {
  209 + width: 30px;
  210 + height: 30px;
  211 + display: inline-block;
  212 + overflow: hidden;
  213 + }
  214 +
  215 + .support-service-title {
  216 + color: #444;
  217 + font-size: 26px;
  218 + padding-left: 5px;
  219 + }
  220 +
  221 + .floors {
  222 + margin-bottom: 14px;
  223 + }
88 } 224 }