|
@@ -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
|
|