Authored by shuaiguo

Merge remote-tracking branch 'refs/remotes/origin/feature/group-6.9.17' into release/6.9.17

@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 <div class="guess-scroll"> 3 <div class="guess-scroll">
4 {{#each data}} 4 {{#each data}}
5 {{#ifcond @index '==' 0}} 5 {{#ifcond @index '==' 0}}
6 - <div id="tab-{{@index}}" data-template-name="{{../template_name}}" data-tab-name="{{tab_name}}" data-template-id="{{../template_id}}" data-index="{{@index}}" data-index-idx="{{@../index}}" data-item-idx="{{@index}}" class="guess-tab first" data-query="{{queryString}}" data-code="{{resources_code}}"> 6 + <div id="tab-{{@index}}" data-template-name="{{../template_name}}" data-tab-name="{{tab_name}}" data-template-id="{{../template_id}}" data-index="{{@index}}" data-index-idx="{{@index}}" data-item-idx="{{@index}}" class="guess-tab first" data-query="{{queryString}}" data-code="{{resources_code}}">
7 {{#if src}} 7 {{#if src}}
8 <img class="guess-img" src="{{image2 src w=200 h=160 q=60 mode=3}}" /> 8 <img class="guess-img" src="{{image2 src w=200 h=160 q=60 mode=3}}" />
9 <div class=""></div> 9 <div class=""></div>
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 <img src="{{image2 src w=../image_width h=../image_height q=60 mode=3}}"></img> 3 <img src="{{image2 src w=../image_width h=../image_height q=60 mode=3}}"></img>
4 <div class='url-content'> 4 <div class='url-content'>
5 {{#each urls}} 5 {{#each urls}}
6 - <div class="split-item" data-item-idx="{{@index}}" data-template-name="{{../../template_name}}" data-template-id="{{../../template_id}}" data-index-idx="{{@../../index}}" data-href="{{this}}" > 6 + <div class="split-item" data-item-idx="{{@index}}" data-template-name="{{../../template_name}}" data-template-id="{{../../template_id}}" data-index-idx="{{@../index}}" data-href="{{this}}" >
7 {{!-- <a id="{{../../template_id}}" name="{{../../template_intro}}"> --}} 7 {{!-- <a id="{{../../template_id}}" name="{{../../template_intro}}"> --}}
8 <div class='placeholder'></div> 8 <div class='placeholder'></div>
9 {{!-- </a> --}} 9 {{!-- </a> --}}
@@ -5,8 +5,8 @@ @@ -5,8 +5,8 @@
5 <span class="new-group-product-left-icon-number"></span> 5 <span class="new-group-product-left-icon-number"></span>
6 </div> 6 </div>
7 {{/ifcond}} --}} 7 {{/ifcond}} --}}
8 - {{#if cover_info}}  
9 - <img src="{{cover_info.list_bg_img}}" class="list-bg-icon" alt="list_icon"> 8 + {{#if icon}}
  9 + <img src="{{icon}}" class="list-bg-icon" alt="list_icon">
10 {{/if}} 10 {{/if}}
11 {{#if @root.lazyLoad}} 11 {{#if @root.lazyLoad}}
12 <img class="lazy new-group-product-image" data-original="{{image2 default_images w=400 h=390 q=60 mode=3}}" /> 12 <img class="lazy new-group-product-image" data-original="{{image2 default_images w=400 h=390 q=60 mode=3}}" />
@@ -67,15 +67,22 @@ class ResourceShowYasRpter { @@ -67,15 +67,22 @@ class ResourceShowYasRpter {
67 67
68 report() { 68 report() {
69 let cacheTheShowSkns = []; // 暂存此次上报的楼层,上报后复制给 lastReportSkns 69 let cacheTheShowSkns = []; // 暂存此次上报的楼层,上报后复制给 lastReportSkns
  70 + let tabParams = {};
  71 +
  72 + tabParams.TAB_NAME = $('.guess-like-tab-active').parent().data('tab-name');
  73 + tabParams.TAB_ID = $('.guess-like-tab-active').parent().data('item-idx') + 1;
  74 + tabParams.P_PARAM = $('.guess-like-tab-active').parent().data('code');
70 75
71 $('.templates').each((floorIndex, theFloor) => { 76 $('.templates').each((floorIndex, theFloor) => {
72 let $theFloor = $(theFloor); 77 let $theFloor = $(theFloor);
73 let F_INDEX = $theFloor.data('id') + 1; 78 let F_INDEX = $theFloor.data('id') + 1;
74 let floorsRawArr = []; // 当前展示楼层 79 let floorsRawArr = []; // 当前展示楼层
75 - let F_ID = $theFloor.data('f-id');  
76 - let F_NAME = $theFloor.data('f-name');  
77 - 80 + let F_ID = $theFloor.data('f-id') || $theFloor.data('template-id');
  81 + let F_NAME = $theFloor.data('f-name') || $theFloor.data('template-name');
78 82
  83 + if (F_NAME === 'guessLike') {
  84 + return;
  85 + }
79 if ($.inviewport($theFloor, { threshold: 0 })) { 86 if ($.inviewport($theFloor, { threshold: 0 })) {
80 // 楼层可见 87 // 楼层可见
81 $theFloor.find('ul > li').each((aIndex, theA) => { 88 $theFloor.find('ul > li').each((aIndex, theA) => {
@@ -144,7 +151,8 @@ class ResourceShowYasRpter { @@ -144,7 +151,8 @@ class ResourceShowYasRpter {
144 F_INDEX: goodsRawObj.F_INDEX, 151 F_INDEX: goodsRawObj.F_INDEX,
145 I_INDEX: goodsRawObj.I_INDEX, 152 I_INDEX: goodsRawObj.I_INDEX,
146 F_ID: goodsRawObj.F_ID, 153 F_ID: goodsRawObj.F_ID,
147 - F_NAME: goodsRawObj.F_NAME 154 + F_NAME: goodsRawObj.F_NAME,
  155 + ...tabParams
148 }; 156 };
149 157
150 if (goodsRawObj.PRD_SKN) { 158 if (goodsRawObj.PRD_SKN) {
@@ -201,7 +209,8 @@ class ResourceShowYasRpter { @@ -201,7 +209,8 @@ class ResourceShowYasRpter {
201 F_NAME: goodsRawObj.F_NAME, 209 F_NAME: goodsRawObj.F_NAME,
202 TAB_NAME: goodsRawObj.TAB_NAME, 210 TAB_NAME: goodsRawObj.TAB_NAME,
203 PRD_SKN: goodsRawObj.PRD_SKN, 211 PRD_SKN: goodsRawObj.PRD_SKN,
204 - ACTION_URL: '' 212 + ACTION_URL: '',
  213 + ...tabParams
205 }; 214 };
206 215
207 this.reportParams.DATA.push(newParams); 216 this.reportParams.DATA.push(newParams);
@@ -209,16 +209,11 @@ class Group extends Page { @@ -209,16 +209,11 @@ class Group extends Page {
209 } 209 }
210 } 210 }
211 } 211 }
212 -  
213 - checkDetail(e) {  
214 - let $this = $(e.currentTarget);  
215 - let productSkn = $this.data('product-skn');  
216 - let activityId = $this.data('activity-id');  
217 - let templateId = $this.data('template-id');  
218 - let isApp = $('.group').data('is-App'); 212 + getPname() {
219 let isiOS = yoho.isiOS; 213 let isiOS = yoho.isiOS;
220 let isAndroid = yoho.isAndroid; 214 let isAndroid = yoho.isAndroid;
221 - let P_NAME = 'hFP_CollageHome'; 215 +
  216 + let P_NAME = 'h5FP_CollageHome';
222 217
223 if (isAndroid) { 218 if (isAndroid) {
224 P_NAME = 'aFP_CollageHome'; 219 P_NAME = 'aFP_CollageHome';
@@ -226,20 +221,30 @@ class Group extends Page { @@ -226,20 +221,30 @@ class Group extends Page {
226 if (isiOS) { 221 if (isiOS) {
227 P_NAME = 'iFP_CollageHome'; 222 P_NAME = 'iFP_CollageHome';
228 } 223 }
  224 +
  225 + return P_NAME;
  226 + }
  227 + checkDetail(e) {
  228 + this.setDefaultTabParams();
  229 + let $this = $(e.currentTarget);
  230 + let productSkn = $this.data('product-skn');
  231 + let activityId = $this.data('activity-id');
  232 + let templateId = $this.data('template-id');
  233 + let isApp = $('.group').data('is-App');
  234 + let P_NAME = this.getPname();
  235 +
229 if (templateId) { 236 if (templateId) {
230 this.sendCustomInfo($this, {PRD_SKN: productSkn}); 237 this.sendCustomInfo($this, {PRD_SKN: productSkn});
231 } else { 238 } else {
232 this.sendCustomInfo($this, { 239 this.sendCustomInfo($this, {
233 F_ID: this.templateId, 240 F_ID: this.templateId,
234 F_NAME: this.templateName, 241 F_NAME: this.templateName,
235 - TAB_ID: this.tabName, 242 + TAB_ID: this.tabId,
236 TAB_NAME: this.tabName, 243 TAB_NAME: this.tabName,
237 F_INDEX: this.indexIdx 244 F_INDEX: this.indexIdx
238 }); 245 });
239 } 246 }
240 247
241 - console.log(this.indexIdx);  
242 -  
243 if (isApp) { 248 if (isApp) {
244 let param = { 249 let param = {
245 action: 'go.productDetail', 250 action: 'go.productDetail',
@@ -277,7 +282,8 @@ class Group extends Page { @@ -277,7 +282,8 @@ class Group extends Page {
277 this.tabName = tabName; 282 this.tabName = tabName;
278 this.templateId = templateId; 283 this.templateId = templateId;
279 this.templateName = templateName; 284 this.templateName = templateName;
280 - this.indexIdx = indexIdx; 285 + this.tabId = indexIdx;
  286 + this.contentCode = code;
281 let stateObj = { 287 let stateObj = {
282 tab_name: this.tabName, 288 tab_name: this.tabName,
283 index_idx: this.indexIdx, 289 index_idx: this.indexIdx,
@@ -289,7 +295,9 @@ class Group extends Page { @@ -289,7 +295,9 @@ class Group extends Page {
289 295
290 window.history.replaceState(stateObj, 'page', valiable); 296 window.history.replaceState(stateObj, 'page', valiable);
291 297
292 - this.sendCustomInfo($this, {}); 298 + this.sendTabInfo($this, {});
  299 +
  300 + // this.sendCustomInfo($this, {});
293 query.forEach(item => { 301 query.forEach(item => {
294 queryObject = Object.assign(queryObject, item); 302 queryObject = Object.assign(queryObject, item);
295 }); 303 });
@@ -299,7 +307,8 @@ class Group extends Page { @@ -299,7 +307,8 @@ class Group extends Page {
299 let lastDom = document.getElementById(`tab-${index - 2}`); 307 let lastDom = document.getElementById(`tab-${index - 2}`);
300 308
301 $('.wapper').animate({scrollLeft: lastDom && lastDom.offsetLeft || 0}); 309 $('.wapper').animate({scrollLeft: lastDom && lastDom.offsetLeft || 0});
302 - this.scrollSmoothTo(document.getElementById('resources').offsetTop); 310 +
  311 + // this.scrollSmoothTo(document.getElementById('resources').offsetTop);
303 312
304 // if (document.getElementById('fixedTab').offsetTop) { 313 // if (document.getElementById('fixedTab').offsetTop) {
305 // this.scrollSmoothTo(document.getElementById('fixedTab').offsetTop); 314 // this.scrollSmoothTo(document.getElementById('fixedTab').offsetTop);
@@ -316,9 +325,11 @@ class Group extends Page { @@ -316,9 +325,11 @@ class Group extends Page {
316 code: code 325 code: code
317 }).then(res => { 326 }).then(res => {
318 that.renderFloor(res); 327 that.renderFloor(res);
  328 + this.scrollSmoothTo(document.getElementById('resources').offsetTop); // 保证新资源位渲染再滚动,防止上报数据错误
319 }); 329 });
320 } else { 330 } else {
321 $('.floors').html(''); 331 $('.floors').html('');
  332 + this.scrollSmoothTo(document.getElementById('resources').offsetTop);
322 } 333 }
323 334
324 this.fetchGoodsList(queryObject).then(data => { 335 this.fetchGoodsList(queryObject).then(data => {
@@ -349,29 +360,56 @@ class Group extends Page { @@ -349,29 +360,56 @@ class Group extends Page {
349 } 360 }
350 step(); 361 step();
351 } 362 }
352 - 363 + setDefaultTabParams() {
  364 + // 默认tab
  365 + if (typeof this.tabId === 'undefined' || typeof this.tabName === 'undefined') {
  366 + this.tabName = this.selector.guessLike.first().data('tab-name');
  367 + this.tabId = this.selector.guessLike.first().data('item-idx');
  368 + this.contentCode = this.selector.guessLike.first().data('code');
  369 + }
  370 + }
353 jumpToUrl(e) { 371 jumpToUrl(e) {
354 let $this = $(e.currentTarget); 372 let $this = $(e.currentTarget);
355 373
  374 + this.setDefaultTabParams();
356 this.sendCustomInfo($this, {ACTION_URL: $this.data('href')}); 375 this.sendCustomInfo($this, {ACTION_URL: $this.data('href')});
  376 +
357 window.location.href = $this.data('href'); 377 window.location.href = $this.data('href');
358 } 378 }
  379 + sendTabInfo($this, custom_params) {
  380 + let itemIdx = $this.data('item-idx');
  381 + let tabName = $this.data('tab-name');
359 382
  383 + let params = {
  384 + TAB_ID: itemIdx + 1,
  385 + TAB_NAME: tabName || '',
  386 + ...custom_params
  387 + };
  388 +
  389 + window._yas && window._yas.sendCustomInfo && window._yas.sendCustomInfo({
  390 + op: 'YB_GROUP_TAB_C',
  391 + appop: 'YB_GROUP_TAB_C',
  392 + param: JSON.stringify(params)
  393 + }, true);
  394 + }
360 sendCustomInfo($this, custom_params) { 395 sendCustomInfo($this, custom_params) {
361 let templateName = $this.data('template-name'); 396 let templateName = $this.data('template-name');
362 let templateId = $this.data('template-id'); 397 let templateId = $this.data('template-id');
363 let itemIdx = $this.data('item-idx'); 398 let itemIdx = $this.data('item-idx');
364 let indexIdx = $this.data('index-idx'); 399 let indexIdx = $this.data('index-idx');
365 - let tabName = $this.data('tab-name'); 400 +
  401 + // let tabName = $this.data('tab-name');
366 402
367 let params = { 403 let params = {
  404 + P_NAME: this.getPname(),
368 F_ID: templateId, 405 F_ID: templateId,
369 F_NAME: templateName, 406 F_NAME: templateName,
370 F_INDEX: indexIdx + 1, 407 F_INDEX: indexIdx + 1,
371 I_INDEX: itemIdx + 1, 408 I_INDEX: itemIdx + 1,
372 ACTION_URL: '', // 拼团不传 409 ACTION_URL: '', // 拼团不传
373 - TAB_ID: '',  
374 - TAB_NAME: tabName || '', 410 + TAB_ID: this.tabId + 1,
  411 + TAB_NAME: this.tabName,
  412 + P_PARAM: this.contentCode,
375 ...custom_params 413 ...custom_params
376 }; 414 };
377 415
@@ -189,8 +189,9 @@ @@ -189,8 +189,9 @@
189 189
190 .list-bg-icon { 190 .list-bg-icon {
191 position: absolute; 191 position: absolute;
192 - top: 40px; 192 + top: 20px;
193 left: 30px; 193 left: 30px;
194 - height: 26px; 194 + height: 60px;
  195 + width: 60px;
195 } 196 }
196 } 197 }