Authored by huangyCode

修改商品详情

@@ -144,6 +144,7 @@ function goodsDetail(req, res, next) { @@ -144,6 +144,7 @@ function goodsDetail(req, res, next) {
144 finalResult.groupNo = param.groupNo; 144 finalResult.groupNo = param.groupNo;
145 finalResult.activityId = param.activityId; 145 finalResult.activityId = param.activityId;
146 finalResult.isShowPop = result.activityIdDetail.joinLimit === 1 ? true : false; 146 finalResult.isShowPop = result.activityIdDetail.joinLimit === 1 ? true : false;
  147 + finalResult.storeUrl = result.storeUrl;
147 return res.render('group/goodsDetail', { 148 return res.render('group/goodsDetail', {
148 page: 'group-goodsDetail', 149 page: 'group-goodsDetail',
149 nodownload: true, 150 nodownload: true,
@@ -199,6 +199,9 @@ class GroupService extends global.yoho.BaseModel { @@ -199,6 +199,9 @@ 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 + if (result.shop_id) {
  203 + result.storeUrl = `/shop/${_.get(result, 'brand_info.brand_domain')}-${_.get(result, 'shop_id')}.html`;
  204 + }
202 result.shopInfo = await this.api.getShopInfo({brand_id: result.brand_id, shop_id: result.shop_id}); 205 result.shopInfo = await this.api.getShopInfo({brand_id: result.brand_id, shop_id: result.shop_id});
203 result.activityIdDetail = await this.api.getCollageProductInfo(params); 206 result.activityIdDetail = await this.api.getCollageProductInfo(params);
204 result.activityGroupDetailList = await this.api.fetchActivityGroups(params); 207 result.activityGroupDetailList = await this.api.fetchActivityGroups(params);
@@ -44,6 +44,7 @@ @@ -44,6 +44,7 @@
44 </div> 44 </div>
45 </div> 45 </div>
46 {{#if activityGroupDetailList}} 46 {{#if activityGroupDetailList}}
  47 + {{#if groupNo}}
47 <div class="goods-join"> 48 <div class="goods-join">
48 <div class="title">选择下面小伙伴,快速加入</div> 49 <div class="title">选择下面小伙伴,快速加入</div>
49 {{#each activityGroupDetailList}} 50 {{#each activityGroupDetailList}}
@@ -61,18 +62,19 @@ @@ -61,18 +62,19 @@
61 data-value="{{leftTime}}">{{formatLeftTime}}</span></div> 62 data-value="{{leftTime}}">{{formatLeftTime}}</span></div>
62 </div> 63 </div>
63 64
64 - <div class='ibutton' data-value="{{groupNo}}"> 65 + <a href="/activity/group/progress?activity={{activityId}}&groupNo={{groupNo}}" class='ibutton' data-value="{{groupNo}}">
65 立即参团 66 立即参团
66 - </div> 67 + </a>
67 </div> 68 </div>
68 {{/each}} 69 {{/each}}
69 </div> 70 </div>
  71 + {{/if}}
70 {{/if}} 72 {{/if}}
71 {{#if shopInfo}} 73 {{#if shopInfo}}
72 <div class="shop-info" data-id="{{shopInfo.shop_id}}"> 74 <div class="shop-info" data-id="{{shopInfo.shop_id}}">
73 <img class="shop-icon" src="{{shopInfo.brand_ico}}"/> 75 <img class="shop-icon" src="{{shopInfo.brand_ico}}"/>
74 <span class="shop-name">{{shopInfo.brand_name}}</span> 76 <span class="shop-name">{{shopInfo.brand_name}}</span>
75 - <span class="shop-detail">进入店铺</span> 77 + <a class="shop-detail" href="{{storeUrl}}">进入店铺</a>
76 </div> 78 </div>
77 {{/if}} 79 {{/if}}
78 80
@@ -124,6 +126,7 @@ @@ -124,6 +126,7 @@
124 {{/ifcond}} 126 {{/ifcond}}
125 {{/each}} 127 {{/each}}
126 </div> 128 </div>
  129 +
127 <div id="productDesc" {{#if limit}}class="limit"{{/if}}> </div> 130 <div id="productDesc" {{#if limit}}class="limit"{{/if}}> </div>
128 131
129 <div class="bottom"> 132 <div class="bottom">
@@ -143,24 +146,26 @@ @@ -143,24 +146,26 @@
143 {{/if}} 146 {{/if}}
144 </div> 147 </div>
145 {{#unless groupNo}} 148 {{#unless groupNo}}
146 - <div class='shoppint-cart-icon'> 149 + <a href="/activity/group" class='shoppint-cart-icon'>
147 <img src="//img10.static.yhbimg.com/yhb-img01/2019/02/21/01/016b3f1cbc1b946fa0acbb1523f6386435.png" 150 <img src="//img10.static.yhbimg.com/yhb-img01/2019/02/21/01/016b3f1cbc1b946fa0acbb1523f6386435.png"
148 class="shoppint-cart-icon-image"/> 151 class="shoppint-cart-icon-image"/>
149 - </div> 152 + </a>
150 {{/unless}} 153 {{/unless}}
  154 + {{#if groupNo}}
151 {{#if isShowPop}} 155 {{#if isShowPop}}
152 <div class='old-customer-tips' id="isShowPop"> 156 <div class='old-customer-tips' id="isShowPop">
153 - <img style='width:100%;height:100%' src='/static/images/group/PT_tip@3x.png'/> 157 + <img src='//img11.static.yhbimg.com/yhb-img01/2019/02/21/23/019f4a96c8d18ab77f21548c4a18baa337.png'/>
154 </div> 158 </div>
155 {{/if}} 159 {{/if}}
  160 + {{/if}}
156 {{#if storage_sum}} 161 {{#if storage_sum}}
157 - <button class='shoppint-cart-add'  
158 - bindtap="selfBuy" style='border-radius: 0;'> 162 + <button class='shoppint-cart-add' id="selfBuy"
  163 + style='border-radius: 0;'>
159 {{#if groupNo}} 164 {{#if groupNo}}
160 <span class="bottom-title">{{activityIdDetail.formatCollagePrice}}</span> 165 <span class="bottom-title">{{activityIdDetail.formatCollagePrice}}</span>
161 <span class="bottom-title">自己开团</span> 166 <span class="bottom-title">自己开团</span>
162 {{else}} 167 {{else}}
163 - <span class="bottom-title">{{realPrice}}</span> 168 + <span class="bottom-title">{{goodsPrice.currentPrice}}</span>
164 <span class="bottom-title">单人购买</span> 169 <span class="bottom-title">单人购买</span>
165 {{/if}} 170 {{/if}}
166 </button> 171 </button>
@@ -199,7 +204,7 @@ @@ -199,7 +204,7 @@
199 <input id="brand-id" type="hidden" value="{{brandId}}"> 204 <input id="brand-id" type="hidden" value="{{brandId}}">
200 <input id="product-limit" type="hidden" value="{{isLimitBuy}}"> 205 <input id="product-limit" type="hidden" value="{{isLimitBuy}}">
201 <input id="product-coupon-switch" type="hidden" value="{{showCoupon}}"> 206 <input id="product-coupon-switch" type="hidden" value="{{showCoupon}}">
202 - 207 + <input id="groupNo" type="hidden" value="{{groupNo}}"/>
203 <input type="hidden" class="data-bind" name="loginUrl" id="loginUrl" value=""> 208 <input type="hidden" class="data-bind" name="loginUrl" id="loginUrl" value="">
204 209
205 <form id="buyNowForm" class="data-bind" method="post" action=""> 210 <form id="buyNowForm" class="data-bind" method="post" action="">
  1 +/* eslint-disable max-len */
1 import 'scss/activity/group/group-goodsDetail.page.scss'; 2 import 'scss/activity/group/group-goodsDetail.page.scss';
2 import Swiper from 'yoho-swiper'; 3 import Swiper from 'yoho-swiper';
3 import $ from 'yoho-jquery'; 4 import $ from 'yoho-jquery';
@@ -65,6 +66,7 @@ class Detail extends Page { @@ -65,6 +66,7 @@ class Detail extends Page {
65 this.toTop(); 66 this.toTop();
66 this.startTimer(); 67 this.startTimer();
67 this.actTimer(); 68 this.actTimer();
  69 + this.bindClick();
68 } 70 }
69 71
70 getIntro() { 72 getIntro() {
@@ -114,6 +116,7 @@ class Detail extends Page { @@ -114,6 +116,7 @@ class Detail extends Page {
114 } 116 }
115 }); 117 });
116 } 118 }
  119 +
117 goSwiper() { 120 goSwiper() {
118 setTimeout(() => { 121 setTimeout(() => {
119 // 顶部swiper 122 // 顶部swiper
@@ -138,6 +141,7 @@ class Detail extends Page { @@ -138,6 +141,7 @@ class Detail extends Page {
138 }); 141 });
139 }, 500); 142 }, 500);
140 } 143 }
  144 +
141 toTop() { 145 toTop() {
142 if ($('.good-detail-page').length > 0) { 146 if ($('.good-detail-page').length > 0) {
143 $('#yoho-footer').css('border-top', '1px solid #e0e0e0'); 147 $('#yoho-footer').css('border-top', '1px solid #e0e0e0');
@@ -174,6 +178,7 @@ class Detail extends Page { @@ -174,6 +178,7 @@ class Detail extends Page {
174 } 178 }
175 }); 179 });
176 } 180 }
  181 +
177 startTimer() { 182 startTimer() {
178 let list = []; 183 let list = [];
179 let activityGroupDetailList = document.querySelectorAll('.left-time'); 184 let activityGroupDetailList = document.querySelectorAll('.left-time');
@@ -188,7 +193,7 @@ class Detail extends Page { @@ -188,7 +193,7 @@ class Detail extends Page {
188 activityGroupDetailList[i].innerText = formatDate(list[i]); 193 activityGroupDetailList[i].innerText = formatDate(list[i]);
189 } else { 194 } else {
190 clearInterval(timer); 195 clearInterval(timer);
191 - window.reload(); 196 + window.location.reload();
192 } 197 }
193 } 198 }
194 }, 1000); 199 }, 1000);
@@ -222,11 +227,35 @@ class Detail extends Page { @@ -222,11 +227,35 @@ class Detail extends Page {
222 --diff; 227 --diff;
223 if (diff < 0) { 228 if (diff < 0) {
224 clearInterval(time); 229 clearInterval(time);
225 - window.reload(); 230 + window.location.reload();
226 } 231 }
227 }, 1000); 232 }, 1000);
228 } 233 }
  234 +
  235 + bindClick() {
  236 + let selfBuyDom = document.getElementById('selfBuy');
  237 + let groupNo = document.getElementById('groupNo').value;
  238 + let activityId = document.getElementById('activityId').value;
  239 + let productSkn = document.getElementById('productSkn').value;
  240 + let isShowPop = document.getElementById('isShowPop');
  241 +
  242 + if (isShowPop) {
  243 + setTimeout(function() {
  244 + isShowPop.style.display = 'none';
  245 + }, 10000);
  246 + }
  247 + if (groupNo) {
  248 + selfBuyDom.onclick = function() {
  249 + location.href = '/activity/group/progress?activity=' + activityId + '&groupNo=' + groupNo;
  250 + };
  251 + } else {
  252 + selfBuyDom.onclick = function() {
  253 + location.href = '/product/' + productSkn + '.html';
  254 + };
  255 + }
  256 + }
229 } 257 }
  258 +
230 $(() => { 259 $(() => {
231 new Detail(); 260 new Detail();
232 }); 261 });
@@ -102,7 +102,6 @@ @@ -102,7 +102,6 @@
102 .shop-name { 102 .shop-name {
103 display: inline-block; 103 display: inline-block;
104 font-family: SanFranciscoText-Regular, sans-serif; 104 font-family: SanFranciscoText-Regular, sans-serif;
105 - font-size: 32px;  
106 color: #4a4a4a; 105 color: #4a4a4a;
107 letter-spacing: 0; 106 letter-spacing: 0;
108 line-height: 120px; 107 line-height: 120px;
@@ -233,6 +232,14 @@ @@ -233,6 +232,14 @@
233 border-top: 1px solid rgb(242, 242, 242); 232 border-top: 1px solid rgb(242, 242, 242);
234 z-index: 1000; 233 z-index: 1000;
235 234
  235 + .old-customer-tips {
  236 + width: 164px;
  237 + height: 60px;
  238 + position: absolute;
  239 + left: 104px;
  240 + bottom: 100px;
  241 + }
  242 +
236 .count-down { 243 .count-down {
237 position: absolute; 244 position: absolute;
238 top: -88px; 245 top: -88px;