merge bigdata_burying to gray
Showing
28 changed files
with
510 additions
and
414 deletions
@@ -365,8 +365,9 @@ exports.verifystudent = (req, res, next) => { | @@ -365,8 +365,9 @@ exports.verifystudent = (req, res, next) => { | ||
365 | prompt = datas[2].message; | 365 | prompt = datas[2].message; |
366 | } | 366 | } |
367 | } | 367 | } |
368 | - datas[1].data.product_list = datas[1].data.product_list.map(function(value) { | 368 | + datas[1].data.product_list = (datas[1].data.product_list || []).map(function(value) { |
369 | value.goodsId = value.goods_list[0].goods_id; | 369 | value.goodsId = value.goods_list[0].goods_id; |
370 | + value.product_id = value.product_id; | ||
370 | value.url = helpers.urlFormat(`/product/pro_${value.product_id}_${value.goodsId}/${value.cn_alphabet}.html`) + `?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":${value.product_skn}}}`; | 371 | value.url = helpers.urlFormat(`/product/pro_${value.product_id}_${value.goodsId}/${value.cn_alphabet}.html`) + `?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":${value.product_skn}}}`; |
371 | return value; | 372 | return value; |
372 | }); | 373 | }); |
@@ -14,7 +14,7 @@ const getPageInfo = (pageInfo) => { | @@ -14,7 +14,7 @@ const getPageInfo = (pageInfo) => { | ||
14 | dest.shareImg = pageInfo.data.shareImgUrl; | 14 | dest.shareImg = pageInfo.data.shareImgUrl; |
15 | dest.shareLink = pageInfo.data.shareUrl; | 15 | dest.shareLink = pageInfo.data.shareUrl; |
16 | dest.code = pageInfo.code; | 16 | dest.code = pageInfo.code; |
17 | - dest.activityID = pageInfo.id; | 17 | + dest.activityID = pageInfo.data.id; |
18 | dest.title = pageInfo.data.h5Title; | 18 | dest.title = pageInfo.data.h5Title; |
19 | dest.activityDesc = pageInfo.data.activityDesc; | 19 | dest.activityDesc = pageInfo.data.activityDesc; |
20 | dest.formatActivityDesc = pageInfo.data.formatActivityDesc; | 20 | dest.formatActivityDesc = pageInfo.data.formatActivityDesc; |
@@ -43,6 +43,7 @@ const getUserStatus = (param) => { | @@ -43,6 +43,7 @@ const getUserStatus = (param) => { | ||
43 | var dest = {}; | 43 | var dest = {}; |
44 | 44 | ||
45 | dest.code = param.code; | 45 | dest.code = param.code; |
46 | + dest.coupon = param && param.data && param.data.coupon; | ||
46 | dest.returnCode = param && param.data && param.data.returnCode; | 47 | dest.returnCode = param && param.data && param.data.returnCode; |
47 | dest.mobile = param && param.data && param.data.mobile; | 48 | dest.mobile = param && param.data && param.data.mobile; |
48 | if (param && param.data) { | 49 | if (param && param.data) { |
@@ -50,7 +50,7 @@ | @@ -50,7 +50,7 @@ | ||
50 | {{/ tags}} | 50 | {{/ tags}} |
51 | </div> | 51 | </div> |
52 | <div class="good-detail-img"> | 52 | <div class="good-detail-img"> |
53 | - <a class="good-thumb" href="{{url}}"> | 53 | + <a class="good-thumb" href="{{url}}" data-pid="{{product_id}}"> |
54 | <img class="lazy" data-original="{{image default_images 235 314}}"> | 54 | <img class="lazy" data-original="{{image default_images 235 314}}"> |
55 | </a> | 55 | </a> |
56 | </div> | 56 | </div> |
1 | +<script> | ||
2 | + (function(w, d, s, j, f) { | ||
3 | + var a = d.createElement(s); | ||
4 | + var m = d.getElementsByTagName(s)[0]; | ||
5 | + | ||
6 | + w.YohoAcquisitionObject = f; | ||
7 | + | ||
8 | + w[f] = function() { | ||
9 | + w[f].p = arguments; | ||
10 | + }; | ||
11 | + | ||
12 | + a.async = 1; | ||
13 | + a.src = j; | ||
14 | + m.parentNode.insertBefore(a, m); | ||
15 | + }(window, document, 'script', (document.location.protocol === 'https:' ? 'https' : 'http') + '://cdn.yoho.cn/yas-jssdk/2.0.0/yas.js', '_yas')); | ||
16 | + | ||
17 | + (function() { | ||
18 | + function getUid() { | ||
19 | + var uid, | ||
20 | + name = '_UID', | ||
21 | + cookies = (document.cookie && document.cookie.split(';')) || []; | ||
22 | + | ||
23 | + cookies.forEach(function(c) { | ||
24 | + if (c.indexOf(name) > -1) { | ||
25 | + uid = decodeURIComponent(c.replace(name + '=', '').trim()); | ||
26 | + return; | ||
27 | + } | ||
28 | + }); | ||
29 | + | ||
30 | + if (!uid) return 0; | ||
31 | + | ||
32 | + uid = uid.split('::'); | ||
33 | + if (!uid || uid.length < 4) { | ||
34 | + return 0; | ||
35 | + } | ||
36 | + return uid[1]; | ||
37 | + } | ||
38 | + | ||
39 | + function queryString() { | ||
40 | + var vars = [], | ||
41 | + hash, | ||
42 | + i; | ||
43 | + var hashes = window.location.search.slice(1).split('&'); | ||
44 | + | ||
45 | + for (i = 0; i < hashes.length; i++) { | ||
46 | + hash = hashes[i].split('='); | ||
47 | + vars.push(hash[0]); | ||
48 | + vars[hash[0]] = hash[1]; | ||
49 | + } | ||
50 | + return vars; | ||
51 | + } | ||
52 | + | ||
53 | + var uid = getUid() || queryString().uid; | ||
54 | + | ||
55 | + uid = uid === 0 ? '' : uid; | ||
56 | + window._ozuid = uid; // 暴露ozuid | ||
57 | + if (window._yas) { | ||
58 | + window._yas(1 * new Date(), '2.0.0', 'yohobuy_m', uid, '', ''); | ||
59 | + } | ||
60 | + }()); | ||
61 | +</script> | ||
62 | + |
@@ -9,10 +9,6 @@ var $ = require('yoho-jquery'), | @@ -9,10 +9,6 @@ var $ = require('yoho-jquery'), | ||
9 | $tooltip = $('.floor-tooltip'), | 9 | $tooltip = $('.floor-tooltip'), |
10 | tip = require('../plugin/tip'); | 10 | tip = require('../plugin/tip'); |
11 | 11 | ||
12 | -var bannerSwiper; | ||
13 | - | ||
14 | -var C_ID; | ||
15 | - | ||
16 | // 获取url中的参数 | 12 | // 获取url中的参数 |
17 | function getUrlParam(name) { | 13 | function getUrlParam(name) { |
18 | 14 | ||
@@ -59,6 +55,7 @@ function getCouponStatus() { | @@ -59,6 +55,7 @@ function getCouponStatus() { | ||
59 | 55 | ||
60 | cates.forEach(function(obj) { | 56 | cates.forEach(function(obj) { |
61 | var e = document.getElementById(obj.couponID); | 57 | var e = document.getElementById(obj.couponID); |
58 | + | ||
62 | if (!e) { | 59 | if (!e) { |
63 | return; | 60 | return; |
64 | } | 61 | } |
@@ -149,7 +146,7 @@ $('.coupon-floor a, .banner-top a').on('click', function() { | @@ -149,7 +146,7 @@ $('.coupon-floor a, .banner-top a').on('click', function() { | ||
149 | }); | 146 | }); |
150 | 147 | ||
151 | if ($('.banner-swiper').find('li').length > 1) { | 148 | if ($('.banner-swiper').find('li').length > 1) { |
152 | - bannerSwiper = new Swiper('.banner-swiper', { | 149 | + new Swiper('.banner-swiper', { |
153 | lazyLoading: true, | 150 | lazyLoading: true, |
154 | lazyLoadingInPrevNext: true, | 151 | lazyLoadingInPrevNext: true, |
155 | loop: true, | 152 | loop: true, |
@@ -177,8 +174,7 @@ $mask.on('click', function() { | @@ -177,8 +174,7 @@ $mask.on('click', function() { | ||
177 | }); | 174 | }); |
178 | 175 | ||
179 | // 埋点 | 176 | // 埋点 |
180 | - | ||
181 | -C_ID = window._ChannelVary[window.cookie('_Channel')]; | 177 | +var C_ID = window._ChannelVary[window.cookie('_Channel')]; |
182 | 178 | ||
183 | $('.floor-focus').find('li').on('click', function() { | 179 | $('.floor-focus').find('li').on('click', function() { |
184 | // event.preventDefault(); | 180 | // event.preventDefault(); |
@@ -191,6 +187,7 @@ $('.floor-focus').find('li').on('click', function() { | @@ -191,6 +187,7 @@ $('.floor-focus').find('li').on('click', function() { | ||
191 | if (window._yas && window._yas.sendCustomInfo) { | 187 | if (window._yas && window._yas.sendCustomInfo) { |
192 | window._yas.sendCustomInfo({ | 188 | window._yas.sendCustomInfo({ |
193 | op: 'YB_LEADING_CENTER_FLR_C', | 189 | op: 'YB_LEADING_CENTER_FLR_C', |
190 | + appop: 'YB_H5_LEADING_CENTER_FLR_C', | ||
194 | param: JSON.stringify({ | 191 | param: JSON.stringify({ |
195 | C_ID: C_ID, | 192 | C_ID: C_ID, |
196 | F_ID: foId, | 193 | F_ID: foId, |
@@ -214,6 +211,7 @@ $('.floor').on('click', function() { | @@ -214,6 +211,7 @@ $('.floor').on('click', function() { | ||
214 | if (window._yas && window._yas.sendCustomInfo) { | 211 | if (window._yas && window._yas.sendCustomInfo) { |
215 | window._yas.sendCustomInfo({ | 212 | window._yas.sendCustomInfo({ |
216 | op: 'YB_LEADING_CENTER_FLR_C', | 213 | op: 'YB_LEADING_CENTER_FLR_C', |
214 | + appop: 'YB_H5_LEADING_CENTER_FLR_C', | ||
217 | param: JSON.stringify({ | 215 | param: JSON.stringify({ |
218 | C_ID: C_ID, | 216 | C_ID: C_ID, |
219 | F_ID: fId, | 217 | F_ID: fId, |
@@ -154,10 +154,15 @@ $('.phone-input-content div').on('click', function() { | @@ -154,10 +154,15 @@ $('.phone-input-content div').on('click', function() { | ||
154 | }, | 154 | }, |
155 | success: function(data) { | 155 | success: function(data) { |
156 | if (data.result.code === 200) { | 156 | if (data.result.code === 200) { |
157 | - if (window._yas && window._yas.sendCustomInfo) { | 157 | + if (window._yas && window._yas.sendCustomInfo && data.result.coupon) { |
158 | window._yas.sendCustomInfo({ | 158 | window._yas.sendCustomInfo({ |
159 | - activityID: activityID, | ||
160 | - returnCode: data.result.returnCode | 159 | + op: 'YB_GET_COUP', |
160 | + param: JSON.stringify({ | ||
161 | + PAGE_NM: document.title, | ||
162 | + PAGE_URL: location.href, | ||
163 | + COUP_ID: data.result.coupon, | ||
164 | + TEL_ID: $('#phone').val() | ||
165 | + }) | ||
161 | }, true); | 166 | }, true); |
162 | } | 167 | } |
163 | if (!data.result.newUser) { | 168 | if (!data.result.newUser) { |
@@ -235,10 +240,15 @@ $('.vertify-input-content').on('click', '.get', function() { | @@ -235,10 +240,15 @@ $('.vertify-input-content').on('click', '.get', function() { | ||
235 | dataType: 'json', | 240 | dataType: 'json', |
236 | success: function(data) { | 241 | success: function(data) { |
237 | if (data.result.code === 200) { | 242 | if (data.result.code === 200) { |
238 | - if (window._yas && window._yas.sendCustomInfo) { | 243 | + if (window._yas && window._yas.sendCustomInfo && data.result.coupon) { |
239 | window._yas.sendCustomInfo({ | 244 | window._yas.sendCustomInfo({ |
240 | - activityID: activityID, | ||
241 | - returnCode: data.result.returnCode | 245 | + op: 'YB_GET_COUP', |
246 | + param: JSON.stringify({ | ||
247 | + PAGE_NM: document.title, | ||
248 | + PAGE_URL: location.href, | ||
249 | + COUP_ID: data.result.coupon, | ||
250 | + TEL_ID: $('#phone').val() | ||
251 | + }) | ||
242 | }, true); | 252 | }, true); |
243 | } | 253 | } |
244 | if (!data.result.newUser) { | 254 | if (!data.result.newUser) { |
@@ -66,7 +66,6 @@ function isValidate(rules, datas) { | @@ -66,7 +66,6 @@ function isValidate(rules, datas) { | ||
66 | var message = '', | 66 | var message = '', |
67 | data, | 67 | data, |
68 | name, | 68 | name, |
69 | - reg, | ||
70 | rule; | 69 | rule; |
71 | 70 | ||
72 | datas = datas || {}; | 71 | datas = datas || {}; |
@@ -79,13 +78,6 @@ function isValidate(rules, datas) { | @@ -79,13 +78,6 @@ function isValidate(rules, datas) { | ||
79 | break; | 78 | break; |
80 | } | 79 | } |
81 | 80 | ||
82 | - // if (rule.regex) { | ||
83 | - // reg = $.trim(data).match(rule.regex); | ||
84 | - // if (!reg || (reg && !reg.length)) { | ||
85 | - // message = rule.msg; | ||
86 | - // break; | ||
87 | - // } | ||
88 | - // } | ||
89 | if (rule.is !== void(0) && data !== rule.is) { | 81 | if (rule.is !== void(0) && data !== rule.is) { |
90 | message = rule.msg; | 82 | message = rule.msg; |
91 | } | 83 | } |
@@ -441,9 +433,9 @@ $(document).on('click', '.s-submit', function() { | @@ -441,9 +433,9 @@ $(document).on('click', '.s-submit', function() { | ||
441 | if (window._yas && window._yas.sendCustomInfo) { | 433 | if (window._yas && window._yas.sendCustomInfo) { |
442 | window._yas.sendCustomInfo({ | 434 | window._yas.sendCustomInfo({ |
443 | op: 'YB_STUDENT_ATTCT_SUBMIT', | 435 | op: 'YB_STUDENT_ATTCT_SUBMIT', |
436 | + appop: 'YB_H5_STUDENT_ATTCT_SUBMIT_C', | ||
444 | param: JSON.stringify({ | 437 | param: JSON.stringify({ |
445 | C_ID: C_ID, | 438 | C_ID: C_ID, |
446 | - SRC_ID: 5, | ||
447 | SUBMIT_RES: 1 | 439 | SUBMIT_RES: 1 |
448 | }), | 440 | }), |
449 | }, true); | 441 | }, true); |
@@ -453,9 +445,9 @@ $(document).on('click', '.s-submit', function() { | @@ -453,9 +445,9 @@ $(document).on('click', '.s-submit', function() { | ||
453 | if (window._yas && window._yas.sendCustomInfo) { | 445 | if (window._yas && window._yas.sendCustomInfo) { |
454 | window._yas.sendCustomInfo({ | 446 | window._yas.sendCustomInfo({ |
455 | op: 'YB_STUDENT_ATTCT_SUBMIT', | 447 | op: 'YB_STUDENT_ATTCT_SUBMIT', |
448 | + appop: 'YB_H5_STUDENT_ATTCT_SUBMIT_C', | ||
456 | param: JSON.stringify({ | 449 | param: JSON.stringify({ |
457 | C_ID: C_ID, | 450 | C_ID: C_ID, |
458 | - SRC_ID: 5, | ||
459 | SUBMIT_RES: 2, | 451 | SUBMIT_RES: 2, |
460 | FAILURE_CAUSE: 3, | 452 | FAILURE_CAUSE: 3, |
461 | }), | 453 | }), |
@@ -478,9 +470,9 @@ $(document).on('click', '.s-submit', function() { | @@ -478,9 +470,9 @@ $(document).on('click', '.s-submit', function() { | ||
478 | if (window._yas && window._yas.sendCustomInfo) { | 470 | if (window._yas && window._yas.sendCustomInfo) { |
479 | window._yas.sendCustomInfo({ | 471 | window._yas.sendCustomInfo({ |
480 | op: 'YB_STUDENT_ATTCT_SUBMIT', | 472 | op: 'YB_STUDENT_ATTCT_SUBMIT', |
473 | + appop: 'YB_H5_STUDENT_ATTCT_SUBMIT_C', | ||
481 | param: JSON.stringify({ | 474 | param: JSON.stringify({ |
482 | C_ID: C_ID, | 475 | C_ID: C_ID, |
483 | - SRC_ID: 5, | ||
484 | SUBMIT_RES: 2, | 476 | SUBMIT_RES: 2, |
485 | FAILURE_CAUSE: FAILURE_CAUSE | 477 | FAILURE_CAUSE: FAILURE_CAUSE |
486 | }), | 478 | }), |
@@ -237,27 +237,26 @@ if (typeof wx !== 'undefined') { | @@ -237,27 +237,26 @@ if (typeof wx !== 'undefined') { | ||
237 | }); | 237 | }); |
238 | } | 238 | } |
239 | 239 | ||
240 | -setTimeout(function() { | ||
241 | - var len = $('.good-info', '.goods-list').length; | ||
242 | - var ids = []; | 240 | +$(function() { |
241 | + setTimeout(function() { | ||
243 | var check = location.pathname.indexOf('quanyi') === -1; | 242 | var check = location.pathname.indexOf('quanyi') === -1; |
244 | - | 243 | + if (check && window._yas && window._yas.sendCustomInfo) { |
244 | + var ids = []; | ||
245 | $('.good-info', '.goods-list').each(function() { | 245 | $('.good-info', '.goods-list').each(function() { |
246 | - var goodids = $(this).find('.good-thumb').attr('href').match(/"product_skn":([^}]+)/, 'g'); | ||
247 | - var goodid = goodids && goodids.length === 2 ? goodids[1] : ''; | ||
248 | - | ||
249 | - ids.push(goodid); | 246 | + var pid = $(this).find('.good-thumb').data('pid'); |
247 | + pid && ids.push(pid); | ||
250 | }); | 248 | }); |
251 | 249 | ||
252 | - if (check && window._yas && window._yas.sendCustomInfo) { | ||
253 | window._yas.sendCustomInfo({ | 250 | window._yas.sendCustomInfo({ |
254 | op: 'YB_STUDENT_VIP_GDS_LIST', | 251 | op: 'YB_STUDENT_VIP_GDS_LIST', |
252 | + appop: 'YB_H5_STUDENT_VIP_GDS_LIST', | ||
255 | param: JSON.stringify({ | 253 | param: JSON.stringify({ |
256 | C_ID: C_ID, | 254 | C_ID: C_ID, |
257 | - PRD_NUM: len, | 255 | + PRD_NUM: ids.length, |
258 | PRD_ID: ids.join(','), | 256 | PRD_ID: ids.join(','), |
259 | ACTION_ID: 0, | 257 | ACTION_ID: 0, |
260 | SORT_TYPE: 4, | 258 | SORT_TYPE: 4, |
259 | + PAGE_URL: location.href, | ||
261 | REC_ID: uuid(40) + '0000' | 260 | REC_ID: uuid(40) + '0000' |
262 | }) | 261 | }) |
263 | }, true); | 262 | }, true); |
@@ -266,6 +265,7 @@ setTimeout(function() { | @@ -266,6 +265,7 @@ setTimeout(function() { | ||
266 | if (window._yas && window._yas.sendCustomInfo) { | 265 | if (window._yas && window._yas.sendCustomInfo) { |
267 | window._yas.sendCustomInfo({ | 266 | window._yas.sendCustomInfo({ |
268 | op: 'YB_STUDENT_ATTCT_RESULT', | 267 | op: 'YB_STUDENT_ATTCT_RESULT', |
268 | + appop: 'YB_H5_STUDENT_ATTCT_RESULT_L', | ||
269 | param: JSON.stringify({ | 269 | param: JSON.stringify({ |
270 | C_ID: C_ID, | 270 | C_ID: C_ID, |
271 | SRC_ID: 5, | 271 | SRC_ID: 5, |
@@ -278,6 +278,7 @@ setTimeout(function() { | @@ -278,6 +278,7 @@ setTimeout(function() { | ||
278 | if (window._yas && window._yas.sendCustomInfo) { | 278 | if (window._yas && window._yas.sendCustomInfo) { |
279 | window._yas.sendCustomInfo({ | 279 | window._yas.sendCustomInfo({ |
280 | op: 'YB_STUDENT_ATTCT_RESULT', | 280 | op: 'YB_STUDENT_ATTCT_RESULT', |
281 | + appop: 'YB_H5_STUDENT_ATTCT_RESULT_L', | ||
281 | param: JSON.stringify({ | 282 | param: JSON.stringify({ |
282 | C_ID: C_ID, | 283 | C_ID: C_ID, |
283 | SRC_ID: 5, | 284 | SRC_ID: 5, |
@@ -299,11 +300,8 @@ setTimeout(function() { | @@ -299,11 +300,8 @@ setTimeout(function() { | ||
299 | // }, true); | 300 | // }, true); |
300 | // } | 301 | // } |
301 | } | 302 | } |
302 | - | ||
303 | -}, 3000); | ||
304 | - | ||
305 | - | ||
306 | - | 303 | + }, 8000); |
304 | +}); | ||
307 | 305 | ||
308 | 306 | ||
309 | $('.swiper-slide', '.banner-top').click(function() { | 307 | $('.swiper-slide', '.banner-top').click(function() { |
@@ -314,6 +312,7 @@ $('.swiper-slide', '.banner-top').click(function() { | @@ -314,6 +312,7 @@ $('.swiper-slide', '.banner-top').click(function() { | ||
314 | 312 | ||
315 | options = { | 313 | options = { |
316 | op: 'YB_STUDENT_VIP_FLR', | 314 | op: 'YB_STUDENT_VIP_FLR', |
315 | + appop: 'YB_H5_STUDENT_VIP_FLR_C', | ||
317 | param: JSON.stringify({ | 316 | param: JSON.stringify({ |
318 | C_ID: C_ID, | 317 | C_ID: C_ID, |
319 | F_ID: tid || 1, | 318 | F_ID: tid || 1, |
@@ -361,6 +360,7 @@ $('.s-activity, .main-left, .s-quan, .iconfont', '.s-section').click(function() | @@ -361,6 +360,7 @@ $('.s-activity, .main-left, .s-quan, .iconfont', '.s-section').click(function() | ||
361 | 360 | ||
362 | options = { | 361 | options = { |
363 | op: 'YB_STUDENT_VIP_FLR', | 362 | op: 'YB_STUDENT_VIP_FLR', |
363 | + appop: 'YB_H5_STUDENT_VIP_FLR_C', | ||
364 | param: JSON.stringify({ | 364 | param: JSON.stringify({ |
365 | C_ID: C_ID, | 365 | C_ID: C_ID, |
366 | F_ID: tid, | 366 | F_ID: tid, |
@@ -378,16 +378,17 @@ $('.good-info', '.goods-list').click(function() { | @@ -378,16 +378,17 @@ $('.good-info', '.goods-list').click(function() { | ||
378 | var options; | 378 | var options; |
379 | 379 | ||
380 | var index = $(this).index(); | 380 | var index = $(this).index(); |
381 | - var goodids = $(this).find('.good-thumb').attr('href').match(/"product_skn":([^}]+)/, 'g'); | ||
382 | - var goodid = goodids && goodids.length === 2 ? goodids[1] : ''; | 381 | + var pid = $(this).find('.good-thumb').data('pid'); |
383 | 382 | ||
384 | options = { | 383 | options = { |
385 | op: 'YB_STUDENT_VIP_GDS_LIST', | 384 | op: 'YB_STUDENT_VIP_GDS_LIST', |
385 | + appop: 'YB_H5_STUDENT_VIP_GDS_LIST', | ||
386 | param: JSON.stringify({ | 386 | param: JSON.stringify({ |
387 | C_ID: C_ID, | 387 | C_ID: C_ID, |
388 | PRD_NUM: Number(index) + 1, | 388 | PRD_NUM: Number(index) + 1, |
389 | - PRD_ID: goodid, | 389 | + PRD_ID: pid, |
390 | ACTION_ID: 1, | 390 | ACTION_ID: 1, |
391 | + PAGE_URL: location.href, | ||
391 | REC_ID: uuid(40) + '0000' | 392 | REC_ID: uuid(40) + '0000' |
392 | }) | 393 | }) |
393 | }; | 394 | }; |
@@ -395,6 +396,7 @@ $('.good-info', '.goods-list').click(function() { | @@ -395,6 +396,7 @@ $('.good-info', '.goods-list').click(function() { | ||
395 | window._yas.sendCustomInfo(options, true); | 396 | window._yas.sendCustomInfo(options, true); |
396 | } | 397 | } |
397 | }); | 398 | }); |
399 | + | ||
398 | $('.s-renzhen').click(function() { | 400 | $('.s-renzhen').click(function() { |
399 | var options = { | 401 | var options = { |
400 | op: 'YB_STUDENT_ATTCT_INFO', | 402 | op: 'YB_STUDENT_ATTCT_INFO', |
@@ -195,7 +195,7 @@ module.exports = function(specificGender) { | @@ -195,7 +195,7 @@ module.exports = function(specificGender) { | ||
195 | PRD_ID: PRDID.join(','), | 195 | PRD_ID: PRDID.join(','), |
196 | PRD_NUM: $(data).closest('.good-info').length, | 196 | PRD_NUM: $(data).closest('.good-info').length, |
197 | ACTION_ID: 0, | 197 | ACTION_ID: 0, |
198 | - page_num: RECPOSE === 110009 ? 1 : page | 198 | + PAGE_NUM: RECPOSE === 110009 ? 1 : page |
199 | }); | 199 | }); |
200 | 200 | ||
201 | // 为您优选埋点 end | 201 | // 为您优选埋点 end |
@@ -237,7 +237,7 @@ module.exports = function(specificGender) { | @@ -237,7 +237,7 @@ module.exports = function(specificGender) { | ||
237 | PRD_ID: $(this).closest('.good-info').data('id'), | 237 | PRD_ID: $(this).closest('.good-info').data('id'), |
238 | PRD_NUM: index % pageNum === 0 ? pageNum : index % pageNum, | 238 | PRD_NUM: index % pageNum === 0 ? pageNum : index % pageNum, |
239 | ACTION_ID: 1, | 239 | ACTION_ID: 1, |
240 | - page_num: Math.ceil(index / pageNum) | 240 | + PAGE_NUM: Math.ceil(index / pageNum) |
241 | }); | 241 | }); |
242 | return true; | 242 | return true; |
243 | }); | 243 | }); |
@@ -439,7 +439,7 @@ module.exports = function(specificGender) { | @@ -439,7 +439,7 @@ module.exports = function(specificGender) { | ||
439 | // PRD_ID: PRDID.join(','), | 439 | // PRD_ID: PRDID.join(','), |
440 | // PRD_NUM: $(data).closest('.good-info').length, | 440 | // PRD_NUM: $(data).closest('.good-info').length, |
441 | // ACTION_ID: 0, | 441 | // ACTION_ID: 0, |
442 | -// page_num: page | 442 | +// PAGE_NUM: page |
443 | // }); | 443 | // }); |
444 | 444 | ||
445 | // // 为您优选埋点 end | 445 | // // 为您优选埋点 end |
@@ -484,7 +484,7 @@ module.exports = function(specificGender) { | @@ -484,7 +484,7 @@ module.exports = function(specificGender) { | ||
484 | // PRD_ID: $(this).closest('.good-info').data('id'), | 484 | // PRD_ID: $(this).closest('.good-info').data('id'), |
485 | // PRD_NUM: index % pageNum === 0 ? pageNum : index % pageNum, | 485 | // PRD_NUM: index % pageNum === 0 ? pageNum : index % pageNum, |
486 | // ACTION_ID: 1, | 486 | // ACTION_ID: 1, |
487 | -// page_num: Math.ceil(index / pageNum) | 487 | +// PAGE_NUM: Math.ceil(index / pageNum) |
488 | // }); | 488 | // }); |
489 | // return true; | 489 | // return true; |
490 | // }); | 490 | // }); |
@@ -216,35 +216,6 @@ $.extend({ | @@ -216,35 +216,6 @@ $.extend({ | ||
216 | 216 | ||
217 | }()); | 217 | }()); |
218 | 218 | ||
219 | -(function(w, d, s, j, f) { | ||
220 | - var a = d.createElement(s); | ||
221 | - var m = d.getElementsByTagName(s)[0]; | ||
222 | - | ||
223 | - w.YohoAcquisitionObject = f; | ||
224 | - | ||
225 | - w[f] = function() { | ||
226 | - w[f].p = arguments; | ||
227 | - }; | ||
228 | - | ||
229 | - a.async = 1; | ||
230 | - a.src = j; | ||
231 | - setTimeout(function() { | ||
232 | - m.parentNode.insertBefore(a, m); | ||
233 | - }, 50); | ||
234 | -}(window, document, 'script', (document.location.protocol === 'https:' ? 'https' : 'http') + '://cdn.yoho.cn/yas-jssdk/1.0.18/yas.js', '_yas')); | ||
235 | - | ||
236 | -(function() { | ||
237 | - var uid = getUid() || queryString().uid; | ||
238 | - | ||
239 | - uid = uid === 0 ? '' : uid; | ||
240 | - | ||
241 | - window._ozuid = uid; // 暴露ozuid | ||
242 | - | ||
243 | - if (window._yas) { | ||
244 | - window._yas(1 * new Date(), '1.0.18', 'yohobuy_m', uid, '', ''); | ||
245 | - } | ||
246 | -}()); | ||
247 | - | ||
248 | $header.on('touchstart', 'a', function() { | 219 | $header.on('touchstart', 'a', function() { |
249 | $header.find('a').removeClass('highlight'); | 220 | $header.find('a').removeClass('highlight'); |
250 | $(this).addClass('highlight'); | 221 | $(this).addClass('highlight'); |
@@ -346,31 +317,30 @@ function downLoadApp(unionType) { | @@ -346,31 +317,30 @@ function downLoadApp(unionType) { | ||
346 | 317 | ||
347 | // 为您优选埋点 http://redmine.yoho.cn/issues/10117 | 318 | // 为您优选埋点 http://redmine.yoho.cn/issues/10117 |
348 | function givePoint(parameter) { | 319 | function givePoint(parameter) { |
349 | - var CID = 1; | ||
350 | - | ||
351 | if (!window._yas || !window._yas.sendCustomInfo) { | 320 | if (!window._yas || !window._yas.sendCustomInfo) { |
352 | return false; | 321 | return false; |
353 | } | 322 | } |
354 | 323 | ||
324 | + if (!parameter.REC_POSE || !parameter.PRD_ID) { | ||
325 | + return true; | ||
326 | + } | ||
327 | + | ||
355 | // 男:1,女:2,潮童:3,创意生活:4 | 328 | // 男:1,女:2,潮童:3,创意生活:4 |
356 | - CID = _ChannelVary[cookie('_Channel')] || 1; | 329 | + var CID = _ChannelVary[cookie('_Channel')] || 1; |
330 | + var isAppOp = parameter.isAppOp; | ||
357 | 331 | ||
358 | parameter = $.extend({ | 332 | parameter = $.extend({ |
359 | - REC_POSE: '', | ||
360 | REC_ID: RECID, | 333 | REC_ID: RECID, |
361 | - PRD_ID: '', | ||
362 | PRD_NUM: 0, | 334 | PRD_NUM: 0, |
363 | C_ID: CID, | 335 | C_ID: CID, |
364 | ACTION_ID: 0, | 336 | ACTION_ID: 0, |
365 | - page_num: 1 | 337 | + PAGE_NUM: 1 |
366 | }, parameter); | 338 | }, parameter); |
367 | - | ||
368 | - if (parameter.REC_POSE === '' || parameter.PRD_ID === '') { | ||
369 | - return true; | ||
370 | - } | 339 | + delete parameter.isAppOp; |
371 | 340 | ||
372 | window._yas.sendCustomInfo({ | 341 | window._yas.sendCustomInfo({ |
373 | op: 'YB_CHOOSE_FOR_YOU_Y', | 342 | op: 'YB_CHOOSE_FOR_YOU_Y', |
343 | + appop: isAppOp ? 'YB_CHOOSE_FOR_YOU' : '', // app内打开wap的埋点场合 | ||
374 | param: JSON.stringify(parameter) | 344 | param: JSON.stringify(parameter) |
375 | }, true); | 345 | }, true); |
376 | } | 346 | } |
@@ -51,6 +51,10 @@ function massageAJAX(pageData) { | @@ -51,6 +51,10 @@ function massageAJAX(pageData) { | ||
51 | 51 | ||
52 | loading.hideLoadingMask(); | 52 | loading.hideLoadingMask(); |
53 | lazyLoad($('img.lazy')); | 53 | lazyLoad($('img.lazy')); |
54 | + | ||
55 | + if (pageData === 1) { | ||
56 | + $('.buriedpoint').on('click', bpClickHdl); | ||
57 | + } | ||
54 | }, | 58 | }, |
55 | error: function() { | 59 | error: function() { |
56 | tip.show('网络断开连接了~'); | 60 | tip.show('网络断开连接了~'); |
@@ -73,3 +77,38 @@ $(window).scroll(function() { | @@ -73,3 +77,38 @@ $(window).scroll(function() { | ||
73 | if ($('.collocation-list').find('li').length === 0) { | 77 | if ($('.collocation-list').find('li').length === 0) { |
74 | massageAJAX(1); | 78 | massageAJAX(1); |
75 | } | 79 | } |
80 | + | ||
81 | +// app埋点 | ||
82 | +var C_ID = window._ChannelVary[window.cookie('_Channel')]; | ||
83 | +var bpClickHdl = function() { | ||
84 | + if (!window._yas || !window._yas.sendAppLogs) { | ||
85 | + return; | ||
86 | + } | ||
87 | + | ||
88 | + var $this = $(this); | ||
89 | + | ||
90 | + window._yas.sendAppLogs({ | ||
91 | + appop: 'YB_H5_STROLL_STAR_FLR_C', | ||
92 | + param: JSON.stringify({ | ||
93 | + C_ID: C_ID, | ||
94 | + TAB_INDEX: 2, | ||
95 | + TAB_NAME: '星搭配', | ||
96 | + CONTENT_INDEX: $this.index() + 1, | ||
97 | + CONTENT_ID: $this.attr('articleId') | ||
98 | + }) | ||
99 | + }, true); | ||
100 | +}; | ||
101 | + | ||
102 | +setTimeout(function() { | ||
103 | + if (!window._yas || !window._yas.sendAppLogs) { | ||
104 | + return; | ||
105 | + } | ||
106 | + window._yas.sendAppLogs({ | ||
107 | + appop: 'YB_H5_STROLL_STAR_TAB_C', | ||
108 | + param: JSON.stringify({ | ||
109 | + C_ID: C_ID, | ||
110 | + TAB_INDEX: 2, | ||
111 | + TAB_NAME: '星搭配' | ||
112 | + }) | ||
113 | + }, true); | ||
114 | +}, 500); |
@@ -58,3 +58,38 @@ function scrollHandler() { | @@ -58,3 +58,38 @@ function scrollHandler() { | ||
58 | $(window).scroll(function() { | 58 | $(window).scroll(function() { |
59 | window.requestAnimationFrame(scrollHandler); | 59 | window.requestAnimationFrame(scrollHandler); |
60 | }); | 60 | }); |
61 | + | ||
62 | +// app埋点 | ||
63 | +var C_ID = window._ChannelVary[window.cookie('_Channel')]; | ||
64 | + | ||
65 | +$('.info-list').on('click', function(e) { | ||
66 | + if (!window._yas || !window._yas.sendAppLogs) { | ||
67 | + return; | ||
68 | + } | ||
69 | + | ||
70 | + var $this = $(e.target), | ||
71 | + $btn = $this.closest('.like-btn'), | ||
72 | + $info = $this.closest('.guang-info'); | ||
73 | + | ||
74 | + if ($btn.length > 0) { | ||
75 | + // 点赞 | ||
76 | + window._yas.sendAppLogs({ | ||
77 | + appop: 'YB_H5_STROLL_AUTHOR_LIKE_C', | ||
78 | + param: JSON.stringify({ | ||
79 | + C_ID: C_ID, | ||
80 | + TYPE: $btn.hasClass('like') ? 2 : 1, | ||
81 | + CONTENT_ID: $info.data('id') | ||
82 | + }) | ||
83 | + }, true); | ||
84 | + } else if ($info.length > 0) { | ||
85 | + // 点击各楼层 | ||
86 | + window._yas.sendAppLogs({ | ||
87 | + appop: 'YB_H5_STROLL_AUTHOR_FLR_C', | ||
88 | + param: JSON.stringify({ | ||
89 | + C_ID: C_ID, | ||
90 | + CONTENT_INDEX: $('.guang-info').index($info) + 1, | ||
91 | + CONTENT_ID: $info.data('id') | ||
92 | + }) | ||
93 | + }, true); | ||
94 | + } | ||
95 | +}); |
@@ -106,7 +106,7 @@ function initInfosEvt($container) { | @@ -106,7 +106,7 @@ function initInfosEvt($container) { | ||
106 | // 点赞 | 106 | // 点赞 |
107 | $btn = $this.closest('.like-btn'); | 107 | $btn = $this.closest('.like-btn'); |
108 | if ($btn.length > 0 && !isLoading) { | 108 | if ($btn.length > 0 && !isLoading) { |
109 | - e.preventDefault(); | 109 | + // e.preventDefault(); |
110 | if ($btn.hasClass('like')) { | 110 | if ($btn.hasClass('like')) { |
111 | opt = 'cancel'; | 111 | opt = 'cancel'; |
112 | } | 112 | } |
@@ -147,6 +147,7 @@ function initInfosEvt($container) { | @@ -147,6 +147,7 @@ function initInfosEvt($container) { | ||
147 | $btn = $this.closest('.collect-btn'); | 147 | $btn = $this.closest('.collect-btn'); |
148 | if ($btn.length > 0) { | 148 | if ($btn.length > 0) { |
149 | var uid = getUrlParam('uid'); | 149 | var uid = getUrlParam('uid'); |
150 | + | ||
150 | if (uid) { | 151 | if (uid) { |
151 | e.preventDefault(); | 152 | e.preventDefault(); |
152 | if ($btn.hasClass('collected')) { | 153 | if ($btn.hasClass('collected')) { |
@@ -12,11 +12,8 @@ var scrollFn, | @@ -12,11 +12,8 @@ var scrollFn, | ||
12 | RECPOSE, | 12 | RECPOSE, |
13 | isApp, | 13 | isApp, |
14 | searching = false, | 14 | searching = false, |
15 | - speckParamApp = { | ||
16 | - udid: '', | ||
17 | - apt: '', | ||
18 | - sid: '' | ||
19 | - }; | 15 | + resourcesTp = {}, |
16 | + CID; | ||
20 | 17 | ||
21 | require('yoho-jquery-lazyload'); | 18 | require('yoho-jquery-lazyload'); |
22 | require('../common'); | 19 | require('../common'); |
@@ -47,6 +44,10 @@ plusstar = { | @@ -47,6 +44,10 @@ plusstar = { | ||
47 | 44 | ||
48 | // 事情委托机制 | 45 | // 事情委托机制 |
49 | $tabUlDom.bind('click', function(event) { | 46 | $tabUlDom.bind('click', function(event) { |
47 | + if (!window._yas || !window._yas.sendCustomInfo) { | ||
48 | + return; | ||
49 | + } | ||
50 | + | ||
50 | $liDom = $(event.target).closest('li'); | 51 | $liDom = $(event.target).closest('li'); |
51 | 52 | ||
52 | if ($liDom.hasClass('focus')) { | 53 | if ($liDom.hasClass('focus')) { |
@@ -59,21 +60,22 @@ plusstar = { | @@ -59,21 +60,22 @@ plusstar = { | ||
59 | that.tabNav($liDom.data('code')); | 60 | that.tabNav($liDom.data('code')); |
60 | 61 | ||
61 | // 点击潮流优选上方的TAB按钮时 | 62 | // 点击潮流优选上方的TAB按钮时 |
62 | - if (window._yas && window._yas.sendCustomInfo) { | ||
63 | window._yas.sendCustomInfo({ | 63 | window._yas.sendCustomInfo({ |
64 | op: 'YB_FASHION_TAB_C', | 64 | op: 'YB_FASHION_TAB_C', |
65 | - param: JSON.stringify($.extend({ | ||
66 | - TAB_ID: $liDom.index() + 1 | ||
67 | - }, speckParamApp)) | 65 | + appop: 'YB_H5_STROLL_PLUSSTAR_TAB_C', |
66 | + param: JSON.stringify({ | ||
67 | + TAB_ID: $liDom.index() + 1, | ||
68 | + C_ID: CID | ||
69 | + }) | ||
68 | }, true); | 70 | }, true); |
69 | 71 | ||
70 | window._yas.sendCustomInfo({ | 72 | window._yas.sendCustomInfo({ |
71 | op: 'YB_FASHION_HOME_L', | 73 | op: 'YB_FASHION_HOME_L', |
72 | - param: JSON.stringify($.extend({ | ||
73 | - TAB_ID: that.ParentLiDom.index() + 1 | ||
74 | - }, speckParamApp)) | 74 | + param: JSON.stringify({ |
75 | + TAB_ID: that.ParentLiDom.index() + 1, | ||
76 | + C_ID: CID | ||
77 | + }) | ||
75 | }, true); | 78 | }, true); |
76 | - } | ||
77 | }); | 79 | }); |
78 | 80 | ||
79 | // start -- 默认选中 | 81 | // start -- 默认选中 |
@@ -108,28 +110,31 @@ plusstar = { | @@ -108,28 +110,31 @@ plusstar = { | ||
108 | // 商品单击埋点 | 110 | // 商品单击埋点 |
109 | $dom = $(event.target).closest('.good-info'); | 111 | $dom = $(event.target).closest('.good-info'); |
110 | index = $dom.index() + 1; | 112 | index = $dom.index() + 1; |
111 | - window.givePoint($.extend({ | 113 | + window.givePoint({ |
114 | + isAppOp: true, | ||
112 | REC_POSE: RECPOSE, | 115 | REC_POSE: RECPOSE, |
113 | PRD_ID: $dom.data('good-id'), | 116 | PRD_ID: $dom.data('good-id'), |
114 | ORDER_CODE: '', | 117 | ORDER_CODE: '', |
115 | PRD_NUM: index % that.common.pagesize === 0 ? that.common.pagesize : index % that.common.pagesize, | 118 | PRD_NUM: index % that.common.pagesize === 0 ? that.common.pagesize : index % that.common.pagesize, |
116 | ACTION_ID: 1, | 119 | ACTION_ID: 1, |
117 | - page_num: Math.ceil(index / that.common.pagesize) | ||
118 | - }, speckParamApp)); | 120 | + PAGE_NUM: Math.ceil(index / that.common.pagesize) |
121 | + }); | ||
119 | } else if ($(event.target).closest('.banner-top').length > 0) { | 122 | } else if ($(event.target).closest('.banner-top').length > 0) { |
120 | // 头部banner楼层埋点 | 123 | // 头部banner楼层埋点 |
121 | $dom = $(event.target).closest('li'); | 124 | $dom = $(event.target).closest('li'); |
122 | index = $dom.index() + 1; | 125 | index = $dom.index() + 1; |
123 | window._yas.sendCustomInfo({ | 126 | window._yas.sendCustomInfo({ |
124 | op: 'YB_FASHION_FLR_C', | 127 | op: 'YB_FASHION_FLR_C', |
125 | - param: JSON.stringify($.extend({ | 128 | + appop: 'YB_H5_STROLL_PLUSSTAR_FLR_C', |
129 | + param: JSON.stringify({ | ||
130 | + C_ID: CID, | ||
126 | TAB_ID: that.ParentLiDom.index() + 1, | 131 | TAB_ID: that.ParentLiDom.index() + 1, |
127 | F_ID: $dom.closest('ul').data('id'), | 132 | F_ID: $dom.closest('ul').data('id'), |
128 | F_NAME: '焦点图', | 133 | F_NAME: '焦点图', |
129 | F_URL: encodeURIComponent($dom.find('a').attr('href').replace(/\"/g, '\\"')), | 134 | F_URL: encodeURIComponent($dom.find('a').attr('href').replace(/\"/g, '\\"')), |
130 | F_INDEX: 1, | 135 | F_INDEX: 1, |
131 | I_INDEX: index % 2 + 1// banner,li是双倍的 | 136 | I_INDEX: index % 2 + 1// banner,li是双倍的 |
132 | - }, speckParamApp)) | 137 | + }) |
133 | }, true); | 138 | }, true); |
134 | } else if ($(event.target).closest('.speck-title-image a').length > 0) { | 139 | } else if ($(event.target).closest('.speck-title-image a').length > 0) { |
135 | // 各楼层埋点 | 140 | // 各楼层埋点 |
@@ -138,14 +143,16 @@ plusstar = { | @@ -138,14 +143,16 @@ plusstar = { | ||
138 | 143 | ||
139 | window._yas.sendCustomInfo({ | 144 | window._yas.sendCustomInfo({ |
140 | op: 'YB_FASHION_FLR_C', | 145 | op: 'YB_FASHION_FLR_C', |
141 | - param: JSON.stringify($.extend({ | 146 | + appop: 'YB_H5_STROLL_PLUSSTAR_FLR_C', |
147 | + param: JSON.stringify({ | ||
148 | + C_ID: CID, | ||
142 | TAB_ID: that.ParentLiDom.index() + 1, | 149 | TAB_ID: that.ParentLiDom.index() + 1, |
143 | F_ID: $dom.data('fid'), | 150 | F_ID: $dom.data('fid'), |
144 | F_NAME: $dom.data('name'), | 151 | F_NAME: $dom.data('name'), |
145 | F_URL: encodeURIComponent($domA.attr('href').replace(/\"/g, '\\"')), | 152 | F_URL: encodeURIComponent($domA.attr('href').replace(/\"/g, '\\"')), |
146 | F_INDEX: $dom.index() + 1, | 153 | F_INDEX: $dom.index() + 1, |
147 | I_INDEX: $domA.hasClass('more') ? 0 : ($domA.index() + 1) | 154 | I_INDEX: $domA.hasClass('more') ? 0 : ($domA.index() + 1) |
148 | - }, speckParamApp)) | 155 | + }) |
149 | }, true); | 156 | }, true); |
150 | } | 157 | } |
151 | }); | 158 | }); |
@@ -153,29 +160,21 @@ plusstar = { | @@ -153,29 +160,21 @@ plusstar = { | ||
153 | // 潮流优选首页加载时 | 160 | // 潮流优选首页加载时 |
154 | window._yas.sendCustomInfo({ | 161 | window._yas.sendCustomInfo({ |
155 | op: 'YB_FASHION_HOME_L', | 162 | op: 'YB_FASHION_HOME_L', |
156 | - param: JSON.stringify($.extend({ | 163 | + param: JSON.stringify({ |
164 | + C_ID: CID, | ||
157 | TAB_ID: that.ParentLiDom.index() + 1 | 165 | TAB_ID: that.ParentLiDom.index() + 1 |
158 | - }, speckParamApp)) | 166 | + }) |
159 | }, true); | 167 | }, true); |
160 | }, | 168 | }, |
161 | tabNav: function(code) { | 169 | tabNav: function(code) { |
162 | var that = this; | 170 | var that = this; |
171 | + var tabId = that.ParentLiDom.index() + 1; | ||
163 | 172 | ||
164 | this.common.codeDefault = code;// 记住最后一次的tab code | 173 | this.common.codeDefault = code;// 记住最后一次的tab code |
165 | this.common.page = 1;// 商品列表从第一页开始 | 174 | this.common.page = 1;// 商品列表从第一页开始 |
166 | searching = false;// 初始化翻页 | 175 | searching = false;// 初始化翻页 |
167 | 176 | ||
168 | - $.ajax({ | ||
169 | - type: 'GET', | ||
170 | - url: '/guang/plusstar/resources-template', | ||
171 | - data: { | ||
172 | - code: code, | ||
173 | - uid: window.queryString.uid, | ||
174 | - app_version: isApp, | ||
175 | - yh_channel: that.ParentLiDom.index() + 1 | ||
176 | - }, | ||
177 | - dataType: 'html', | ||
178 | - success: function(data) { | 177 | + function execResData(data) { |
179 | var productSkns = ''; | 178 | var productSkns = ''; |
180 | 179 | ||
181 | $('.plusstar-resources').html(data); | 180 | $('.plusstar-resources').html(data); |
@@ -201,11 +200,64 @@ plusstar = { | @@ -201,11 +200,64 @@ plusstar = { | ||
201 | } | 200 | } |
202 | 201 | ||
203 | that.common.pageTotal = Math.ceil(that.common.productSkns.length / that.common.pagesize); | 202 | that.common.pageTotal = Math.ceil(that.common.productSkns.length / that.common.pagesize); |
203 | + } | ||
204 | + | ||
205 | + if (resourcesTp[tabId]) { | ||
206 | + execResData(resourcesTp[tabId]); | ||
207 | + } else { | ||
208 | + $.ajax({ | ||
209 | + type: 'GET', | ||
210 | + url: '/guang/plusstar/resources-template', | ||
211 | + data: { | ||
212 | + code: code, | ||
213 | + uid: window.queryString.uid, | ||
214 | + app_version: isApp, | ||
215 | + yh_channel: tabId | ||
216 | + }, | ||
217 | + dataType: 'html', | ||
218 | + success: function(data) { | ||
219 | + resourcesTp[tabId] = data; | ||
220 | + execResData(data); | ||
221 | + | ||
222 | + // 页面中下拉曝光 | ||
223 | + setTimeout(function() { | ||
224 | + if (window._yas && window._yas.sendAppLogs) { | ||
225 | + var actionUrl = [], | ||
226 | + aDom = $('.plusstar-resources').find('a'); | ||
227 | + | ||
228 | + aDom.each(function() { | ||
229 | + actionUrl.push($(this).attr('href')); | ||
230 | + }); | ||
231 | + | ||
232 | + aDom.on('click', function() { | ||
233 | + window._yas.sendAppLogs({ | ||
234 | + appop: 'YB_H5_PAGE_FLR_C', | ||
235 | + param: JSON.stringify({ | ||
236 | + C_ID: window._ChannelVary[window.cookie('_Channel')] || 1, | ||
237 | + PAGE_URL: window.originUrl, | ||
238 | + PAGE_NAME: window.qs.title || document.title, | ||
239 | + F_URL: $(this).attr('href') | ||
240 | + }) | ||
241 | + }, true); | ||
242 | + }); | ||
243 | + | ||
244 | + window._yas.sendAppLogs({ | ||
245 | + appop: 'YB_H5_SHOW', | ||
246 | + param: JSON.stringify({ | ||
247 | + C_ID: window._ChannelVary[window.cookie('_Channel')] || 1, | ||
248 | + PAGE_URL: window.originUrl, | ||
249 | + PAGE_NAME: window.qs.title || document.title, | ||
250 | + ACTION_URL: actionUrl | ||
251 | + }) | ||
252 | + }, true); | ||
253 | + } | ||
254 | + }, 500); | ||
204 | }, | 255 | }, |
205 | error: function() { | 256 | error: function() { |
206 | tip.show('网络断开连接了~'); | 257 | tip.show('网络断开连接了~'); |
207 | } | 258 | } |
208 | }); | 259 | }); |
260 | + } | ||
209 | }, | 261 | }, |
210 | resInit: function() { | 262 | resInit: function() { |
211 | // 头部banner轮播 | 263 | // 头部banner轮播 |
@@ -260,14 +312,16 @@ plusstar = { | @@ -260,14 +312,16 @@ plusstar = { | ||
260 | skn.push($(this).data('good-id')); | 312 | skn.push($(this).data('good-id')); |
261 | }); | 313 | }); |
262 | 314 | ||
263 | - window.givePoint($.extend({ | 315 | + window.givePoint({ |
316 | + isAppOp: true, | ||
317 | + C_ID: CID, | ||
264 | REC_POSE: RECPOSE, | 318 | REC_POSE: RECPOSE, |
265 | PRD_ID: skn.join(','), | 319 | PRD_ID: skn.join(','), |
266 | ORDER_CODE: '', | 320 | ORDER_CODE: '', |
267 | PRD_NUM: that.common.pagesize, | 321 | PRD_NUM: that.common.pagesize, |
268 | ACTION_ID: 0, | 322 | ACTION_ID: 0, |
269 | - page_num: that.common.page - 1 | ||
270 | - }, speckParamApp)); | 323 | + PAGE_NUM: that.common.page - 1 |
324 | + }); | ||
271 | 325 | ||
272 | $('.plusstar-resources .goods').append(data); | 326 | $('.plusstar-resources .goods').append(data); |
273 | 327 | ||
@@ -300,12 +354,6 @@ $(function() { | @@ -300,12 +354,6 @@ $(function() { | ||
300 | isApp = window.queryString.app_version || window.queryString.appVersion; | 354 | isApp = window.queryString.app_version || window.queryString.appVersion; |
301 | 355 | ||
302 | if (isApp) { | 356 | if (isApp) { |
303 | - speckParamApp = { | ||
304 | - udid: window.queryString.anbiudid || window.queryString.udid || '', | ||
305 | - apt: window.queryString.client_type || '', | ||
306 | - sid: window.queryString.session_id || '', | ||
307 | - }; | ||
308 | - | ||
309 | $('.plusstar-resources').css({'margin-top': $('.tab-nav').height()}); | 357 | $('.plusstar-resources').css({'margin-top': $('.tab-nav').height()}); |
310 | } else { | 358 | } else { |
311 | $('.tab-nav').css({ | 359 | $('.tab-nav').css({ |
@@ -314,7 +362,7 @@ $(function() { | @@ -314,7 +362,7 @@ $(function() { | ||
314 | } | 362 | } |
315 | 363 | ||
316 | // 男:1,女:2,潮童:3,创意生活:4 | 364 | // 男:1,女:2,潮童:3,创意生活:4 |
317 | - speckParamApp.CID = window.queryString.yh_channel || window._ChannelVary[window.cookie('_Channel')] || 1; | 365 | + CID = window.queryString.yh_channel || window._ChannelVary[window.cookie('_Channel')] || 1; |
318 | 366 | ||
319 | plusstar.init(); | 367 | plusstar.init(); |
320 | 368 |
@@ -10,3 +10,39 @@ var $ = require('yoho-jquery'), | @@ -10,3 +10,39 @@ var $ = require('yoho-jquery'), | ||
10 | require('../common'); | 10 | require('../common'); |
11 | 11 | ||
12 | lazyLoad($('img.lazy')); | 12 | lazyLoad($('img.lazy')); |
13 | + | ||
14 | +// app埋点 | ||
15 | +var C_ID = window._ChannelVary[window.cookie('_Channel')]; | ||
16 | + | ||
17 | +$('.buriedpoint').on('click', function() { | ||
18 | + if (!window._yas || !window._yas.sendAppLogs) { | ||
19 | + return; | ||
20 | + } | ||
21 | + | ||
22 | + var $this = $(this); | ||
23 | + | ||
24 | + window._yas.sendAppLogs({ | ||
25 | + appop: 'YB_H5_STROLL_STAR_FLR_C', | ||
26 | + param: JSON.stringify({ | ||
27 | + C_ID: C_ID, | ||
28 | + TAB_INDEX: 1, | ||
29 | + TAB_NAME: '星专题', | ||
30 | + CONTENT_INDEX: $this.index() + 1, | ||
31 | + CONTENT_ID: $this.attr('articleId') | ||
32 | + }) | ||
33 | + }, true); | ||
34 | +}); | ||
35 | + | ||
36 | +setTimeout(function() { | ||
37 | + if (!window._yas || !window._yas.sendAppLogs) { | ||
38 | + return; | ||
39 | + } | ||
40 | + window._yas.sendAppLogs({ | ||
41 | + appop: 'YB_H5_STROLL_STAR_TAB_C', | ||
42 | + param: JSON.stringify({ | ||
43 | + C_ID: C_ID, | ||
44 | + TAB_INDEX: 1, | ||
45 | + TAB_NAME: '星专题' | ||
46 | + }) | ||
47 | + }, true); | ||
48 | +}, 500); |
@@ -6,8 +6,6 @@ | @@ -6,8 +6,6 @@ | ||
6 | 6 | ||
7 | var $ = require('yoho-jquery'), | 7 | var $ = require('yoho-jquery'), |
8 | Swiper = require('yoho-swiper'), | 8 | Swiper = require('yoho-swiper'), |
9 | - | ||
10 | - // inView = require('in-view'), | ||
11 | loading = require('../plugin/loading'), | 9 | loading = require('../plugin/loading'), |
12 | PullRefresh = require('../plugin/pull-refresh'); | 10 | PullRefresh = require('../plugin/pull-refresh'); |
13 | 11 | ||
@@ -18,24 +16,12 @@ var $window = $(window), | @@ -18,24 +16,12 @@ var $window = $(window), | ||
18 | u = navigator.userAgent, | 16 | u = navigator.userAgent, |
19 | isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); | 17 | isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); |
20 | 18 | ||
21 | -/* | ||
22 | - $swiperView = $('.swiper-view'), | ||
23 | - $viewImg = $('.view-img'), | ||
24 | - $body = $('body'), | ||
25 | - imgs = [], | ||
26 | - allImgs = {}; | ||
27 | - | ||
28 | -var mySwiper; | ||
29 | -*/ | ||
30 | - | ||
31 | var avatarKey, bannerLen, res, avatarSwiper, getIndexHtml, bannerSwiper, | 19 | var avatarKey, bannerLen, res, avatarSwiper, getIndexHtml, bannerSwiper, |
32 | $avatarWrap, starIScroll; | 20 | $avatarWrap, starIScroll; |
33 | 21 | ||
34 | var swiperNum = $('.avatar-wrap .swiper-slide').width() / 2, | 22 | var swiperNum = $('.avatar-wrap .swiper-slide').width() / 2, |
35 | topBanner = $('.banner-top'); | 23 | topBanner = $('.banner-top'); |
36 | 24 | ||
37 | -// var $gif = $('img[data-original*="gif"]'); | ||
38 | - | ||
39 | if ($('.star-main').css('height') === '0px') { | 25 | if ($('.star-main').css('height') === '0px') { |
40 | $('.star-main').css('height', $window.height() - $('.head-tab').height()); | 26 | $('.star-main').css('height', $window.height() - $('.head-tab').height()); |
41 | } | 27 | } |
@@ -47,81 +33,22 @@ if ($window.width() === 375 && isiOS) { | @@ -47,81 +33,22 @@ if ($window.width() === 375 && isiOS) { | ||
47 | require('../common'); | 33 | require('../common'); |
48 | require('yoho-jquery-lazyload'); | 34 | require('yoho-jquery-lazyload'); |
49 | 35 | ||
50 | -// require('yoho-jquery-inview'); | ||
51 | - | ||
52 | $window.on('mousewheel', false); | 36 | $window.on('mousewheel', false); |
53 | $('#yoho-header, .head-tab').on('touchmove', function() { | 37 | $('#yoho-header, .head-tab').on('touchmove', function() { |
54 | return false; | 38 | return false; |
55 | }); | 39 | }); |
56 | 40 | ||
57 | - | ||
58 | -// inView(document.querySelectorAll('img[data-original*="gif"]')) | ||
59 | -// .on('enter', function() { | ||
60 | -// console.log(1); | ||
61 | -// }) | ||
62 | -// .on('exit', function() { | ||
63 | -// console.log(2); | ||
64 | -// }); | ||
65 | - | ||
66 | -// $('img[data-original*="gif"]').on('inview', function(event, isInView) { | ||
67 | -// if (isInView) { | ||
68 | -// $(this).css('display', 'block'); | ||
69 | -// } else { | ||
70 | -// $(this).css('display', 'none'); | ||
71 | -// } | ||
72 | -// }); | ||
73 | - | ||
74 | -// 限制标题字数 | ||
75 | -// function txtLimit() { | ||
76 | -// | ||
77 | -// } | ||
78 | - | ||
79 | -// // 设置默认头像 | ||
80 | -// function setAvatar($userAvatar) { | ||
81 | -// var myImage = new Image(), | ||
82 | -// avatar = ''; | ||
83 | -// | ||
84 | -// // 部分老用户没有头像,显示默认头像 | ||
85 | -// avatar = $userAvatar.data('avatar'); | ||
86 | -// | ||
87 | -// // myImage.onload = function() { | ||
88 | -// // $userAvatar.css('background-image', 'url(' + avatar + ')'); | ||
89 | -// // }; | ||
90 | -// // | ||
91 | -// // if (avatar) { | ||
92 | -// // myImage.src = avatar; | ||
93 | -// // } else { | ||
94 | -// // $userAvatar.addClass('default-avater'); | ||
95 | -// // } | ||
96 | -// } | ||
97 | - | ||
98 | - | ||
99 | // 明星头像点击居中显示或跳转 | 41 | // 明星头像点击居中显示或跳转 |
100 | function bindAvatar(dom) { | 42 | function bindAvatar(dom) { |
101 | avatarKey = dom.index(); | 43 | avatarKey = dom.index(); |
102 | 44 | ||
103 | if (!dom.hasClass('swiper-slide-active')) { | 45 | if (!dom.hasClass('swiper-slide-active')) { |
104 | 46 | ||
105 | - // if (avatarKey >= (2 * bannerLen + 1)) { | ||
106 | - // avatarSwiperClone && avatarSwiperClone.slideTo(bannerLen + 1, 0); | ||
107 | - // avatarSwiper.slideTo(bannerLen + 1, 0); | ||
108 | - // } else if (avatarKey <= (bannerLen - 1)) { | ||
109 | - // avatarSwiperClone && avatarSwiperClone.slideTo(2 * bannerLen - 1, 0); | ||
110 | - // avatarSwiper.slideTo(2 * bannerLen - (bannerLen - avatarKey), 0); | ||
111 | - // } else { | ||
112 | - // avatarSwiperClone && avatarSwiperClone.slideTo(avatarKey, 200); | ||
113 | - // avatarSwiper.slideTo(avatarKey, 200); | ||
114 | - // } | ||
115 | - | ||
116 | return false; | 47 | return false; |
117 | } | 48 | } |
118 | } | 49 | } |
119 | 50 | ||
120 | function setIndexAction() { | 51 | function setIndexAction() { |
121 | -// $('.avatar').each(function(key, item) { | ||
122 | -// $(item).addClass('avatar-' + key); | ||
123 | -// }); | ||
124 | - | ||
125 | // 明星头像 swiper 初始化 | 52 | // 明星头像 swiper 初始化 |
126 | if (bannerLen > 1) { | 53 | if (bannerLen > 1) { |
127 | avatarSwiper = new Swiper($avatarWrap.find('.avatar-swiper')[0], { | 54 | avatarSwiper = new Swiper($avatarWrap.find('.avatar-swiper')[0], { |
@@ -146,17 +73,6 @@ function setIndexAction() { | @@ -146,17 +73,6 @@ function setIndexAction() { | ||
146 | }); | 73 | }); |
147 | } | 74 | } |
148 | 75 | ||
149 | - // 明星动态头像左右滑动 | ||
150 | - // if ($('.article-avatar-swiper').find('li').length > 1) { | ||
151 | - // new Swiper('.article-avatar-swiper', { | ||
152 | - // initialSlide: 0, | ||
153 | - // lazyLoading: true, | ||
154 | - // lazyLoadingInPrevNext: true, | ||
155 | - // loop: true, | ||
156 | - // autoplay: 5000 | ||
157 | - // }); | ||
158 | - // } | ||
159 | - | ||
160 | // banner swiper 初始化 | 76 | // banner swiper 初始化 |
161 | if ($('.banner-swiper').find('li').length > 1) { | 77 | if ($('.banner-swiper').find('li').length > 1) { |
162 | bannerSwiper = new Swiper('.banner-swiper', { | 78 | bannerSwiper = new Swiper('.banner-swiper', { |
@@ -170,32 +86,14 @@ function setIndexAction() { | @@ -170,32 +86,14 @@ function setIndexAction() { | ||
170 | pagination: '.banner-top .pagination-inner' | 86 | pagination: '.banner-top .pagination-inner' |
171 | }); | 87 | }); |
172 | } | 88 | } |
173 | - | ||
174 | - // if ($('.star-info').find('li').length > 0) { | ||
175 | - // $starArticle.each(function(key, item) { | ||
176 | - // txtLimit($(item), '.article-title', 'p'); | ||
177 | - // | ||
178 | - // // articleImgAction($(item), key); | ||
179 | - // }); | ||
180 | - // } | ||
181 | - | ||
182 | - // $('.rank-avatar').each(function(key, item) { | ||
183 | - // setAvatar($(item)); | ||
184 | - // }); | ||
185 | } | 89 | } |
186 | 90 | ||
187 | function initAction() { | 91 | function initAction() { |
188 | $avatarWrap = $('.avatar-wrap'); | 92 | $avatarWrap = $('.avatar-wrap'); |
189 | bannerLen = $('.avatar-wrap').find('.swiper-slide').length; | 93 | bannerLen = $('.avatar-wrap').find('.swiper-slide').length; |
190 | 94 | ||
191 | -// if ($avatarClone) { | ||
192 | -// $avatarClone.remove(); | ||
193 | -// } | ||
194 | - | ||
195 | $loadingTip.before($('.avatar-swiper').clone().addClass('avatar-clone').hide()); | 95 | $loadingTip.before($('.avatar-swiper').clone().addClass('avatar-clone').hide()); |
196 | 96 | ||
197 | - // $avatarClone = $('.avatar-clone'); | ||
198 | - | ||
199 | $('img.lazy').lazyload({ | 97 | $('img.lazy').lazyload({ |
200 | effect: 'fadeIn' | 98 | effect: 'fadeIn' |
201 | }); | 99 | }); |
@@ -215,11 +113,6 @@ getIndexHtml = function() { | @@ -215,11 +113,6 @@ getIndexHtml = function() { | ||
215 | }) | 113 | }) |
216 | .done(function(data) { | 114 | .done(function(data) { |
217 | if (data) { | 115 | if (data) { |
218 | -// if (avatarSwiperClone) { | ||
219 | -// avatarSwiperClone.destroy(true, true); | ||
220 | -// avatarSwiperClone = null; | ||
221 | -// } | ||
222 | - | ||
223 | $mainContent.html(data); | 116 | $mainContent.html(data); |
224 | 117 | ||
225 | initAction(); | 118 | initAction(); |
@@ -231,13 +124,6 @@ getIndexHtml = function() { | @@ -231,13 +124,6 @@ getIndexHtml = function() { | ||
231 | }); | 124 | }); |
232 | }; | 125 | }; |
233 | 126 | ||
234 | -// $(window).ready(function() { | ||
235 | -// topBannerH = $('.banner-top').height(); | ||
236 | -// console.log('init'+topBannerH); | ||
237 | -// }); | ||
238 | - | ||
239 | - | ||
240 | - | ||
241 | // 下拉刷新,上拉加载 | 127 | // 下拉刷新,上拉加载 |
242 | starIScroll = new PullRefresh('.star-main', { | 128 | starIScroll = new PullRefresh('.star-main', { |
243 | pullDown: function() { | 129 | pullDown: function() { |
@@ -249,132 +135,92 @@ starIScroll = new PullRefresh('.star-main', { | @@ -249,132 +135,92 @@ starIScroll = new PullRefresh('.star-main', { | ||
249 | }); | 135 | }); |
250 | 136 | ||
251 | starIScroll.iScroll.on('scrollStart', function() { | 137 | starIScroll.iScroll.on('scrollStart', function() { |
252 | - // 下拉 | ||
253 | - // if (this.directionY === -1) { | ||
254 | - // $loadingTip.slideDown(); | ||
255 | - // } | ||
256 | - // $gif.css('display', 'none'); | ||
257 | bannerSwiper && bannerSwiper.stopAutoplay(); | 138 | bannerSwiper && bannerSwiper.stopAutoplay(); |
258 | }); | 139 | }); |
259 | 140 | ||
260 | starIScroll.iScroll.on('scroll', function() { | 141 | starIScroll.iScroll.on('scroll', function() { |
261 | $window.trigger('scroll'); | 142 | $window.trigger('scroll'); |
262 | - | ||
263 | - // var avatarOffsetT; | ||
264 | - // | ||
265 | - // if (this.directionY !== -1) { | ||
266 | - // setTimeout(function() { | ||
267 | - // starIScroll.iScroll.refresh(); | ||
268 | - // }, 0); | ||
269 | - // } | ||
270 | - // | ||
271 | - // avatarOffsetT = $avatarWrap[0].offsetTop; | ||
272 | - // | ||
273 | - // if (-this.y >= avatarOffsetT) { | ||
274 | - // $avatarClone.show(); | ||
275 | - // | ||
276 | - // if (!avatarSwiperClone) { | ||
277 | - // avatarSwiperClone = new Swiper($avatarClone[0], { | ||
278 | - // lazyLoading: true, | ||
279 | - // lazyLoadingInPrevNext: true, | ||
280 | - // | ||
281 | - // // loop: true, | ||
282 | - // initialSlide: $avatarWrap.find('.swiper-slide-active').index() % bannerLen, | ||
283 | - // centeredSlides: true, | ||
284 | - // slidesPerView: 'auto', | ||
285 | - // loopedSlides: bannerLen, | ||
286 | - // spaceBetween: 10, | ||
287 | - // slidesOffsetBefore: -swiperNum, | ||
288 | - // watchSlidesProgress: true, | ||
289 | - // watchSlidesVisibility: true, | ||
290 | - // onInit: function() { | ||
291 | - // $avatarClone.find('li').on('click', function() { | ||
292 | - // res = bindAvatar($(this)); | ||
293 | - // return res; | ||
294 | - // }); | ||
295 | - // } | ||
296 | - // }); | ||
297 | - // | ||
298 | - // avatarSwiperClone.params.control = avatarSwiper; | ||
299 | - // avatarSwiper.params.control = avatarSwiperClone; | ||
300 | - // } | ||
301 | - // } else { | ||
302 | - // $avatarClone.hide(); | ||
303 | - // } | ||
304 | }); | 143 | }); |
305 | 144 | ||
306 | starIScroll.iScroll.on('scrollEnd', function() { | 145 | starIScroll.iScroll.on('scrollEnd', function() { |
307 | - // $loadingTip.slideUp(); | ||
308 | - // $gif.css('display', 'block'); | ||
309 | if (-this.y <= topBanner.height()) { | 146 | if (-this.y <= topBanner.height()) { |
310 | bannerSwiper && bannerSwiper.startAutoplay(); | 147 | bannerSwiper && bannerSwiper.startAutoplay(); |
311 | } | 148 | } |
312 | }); | 149 | }); |
313 | 150 | ||
314 | - | ||
315 | - | ||
316 | window.setCookie('guangStarUid', window.queryString.uid); | 151 | window.setCookie('guangStarUid', window.queryString.uid); |
317 | 152 | ||
318 | -// $('img').on('load', function() { | ||
319 | -// starIScroll && starIScroll.iScroll.refresh(); | ||
320 | -// }); | ||
321 | - | ||
322 | -// 明星动态文章图片相关操作 | ||
323 | -/* | ||
324 | -function articleImgAction(dom, key) { | ||
325 | - var $articeImgs = dom.find('.artice-imgs'), | ||
326 | - $li = $articeImgs.find('li'), | ||
327 | - imgLen = $articeImgs.find('img').length, | ||
328 | - addFlagDom = $li.eq(2); | ||
329 | - | ||
330 | - var i; | ||
331 | - | ||
332 | - imgs = []; | 153 | +// app埋点 |
154 | +var C_ID = window._ChannelVary[window.cookie('_Channel')]; | ||
333 | 155 | ||
334 | - $li.each(function() { | ||
335 | - imgs.push($(this).find('img').attr('src')); | ||
336 | - }); | ||
337 | - | ||
338 | - allImgs[key] = imgs; | 156 | +// 点击星潮教室页面中的banner |
157 | +$('.banner-top').find('li').on('click', function() { | ||
158 | + if (!window._yas || !window._yas.sendAppLogs) { | ||
159 | + return; | ||
160 | + } | ||
161 | + window._yas.sendAppLogs({ | ||
162 | + appop: 'YB_H5_STROLL_STAR_BANNER_C', | ||
163 | + param: JSON.stringify({ | ||
164 | + C_ID: C_ID, | ||
165 | + TAB_INDEX: 0, | ||
166 | + TAB_NAME: '全部', | ||
167 | + POS_ID: 2, // 轮播图 | ||
168 | + TO_URL: $(this).find('a')[0].href | ||
169 | + }) | ||
170 | + }, true); | ||
171 | +}); | ||
339 | 172 | ||
340 | - $li.on('click', function() { | ||
341 | - for (i = 0; i < imgLen; i++) { | ||
342 | - $swiperView.find('ul').append('<li class="swiper-slide">' + | ||
343 | - '<img class="swiper-lazy" data-src="' + allImgs[key][i] + '">' + | ||
344 | - '<div class="swiper-lazy-preloader"></div></li>'); | 173 | +$('.swiper-slide-active').on('click', function() { |
174 | + if (!window._yas || !window._yas.sendAppLogs) { | ||
175 | + return; | ||
345 | } | 176 | } |
346 | - setTimeout(function() { | ||
347 | - mySwiper = new Swiper('.swiper-view', { | ||
348 | - lazyLoading: true, | ||
349 | - lazyLoadingInPrevNext: true, | ||
350 | - slideElement: 'li' | ||
351 | - }); | 177 | + window._yas.sendAppLogs({ |
178 | + appop: 'YB_H5_STROLL_STAR_BANNER_C', | ||
179 | + param: JSON.stringify({ | ||
180 | + C_ID: C_ID, | ||
181 | + TAB_INDEX: 0, | ||
182 | + TAB_NAME: '全部', | ||
183 | + POS_ID: 2, // 轮播图 | ||
184 | + TO_URL: $(this).find('a')[0].href | ||
185 | + }) | ||
186 | + }, true); | ||
187 | +}); | ||
352 | 188 | ||
353 | - $('.swiper-view li').on('click', function(e) { | ||
354 | - if (e.target.nodeName === 'IMG') { | 189 | +// 点击星潮教室页面中的文章时 |
190 | +$('.star-info').on('click', function(e) { | ||
191 | + if (!window._yas || !window._yas.sendAppLogs) { | ||
355 | return; | 192 | return; |
356 | } | 193 | } |
357 | - $viewImg.hide(); | ||
358 | - $body.css({ | ||
359 | - overflow: 'auto' | ||
360 | - }); | ||
361 | - $viewImg.find('li').remove(); | ||
362 | - mySwiper.destroy(false); | ||
363 | - }); | ||
364 | - }, 100); | ||
365 | 194 | ||
366 | - $viewImg.show(); | 195 | + var $this = $(e.target), |
196 | + $a = $this.closest('.star-article'); | ||
367 | 197 | ||
368 | - $body.css({ | ||
369 | - overflow: 'hidden' | ||
370 | - }); | ||
371 | - }); | 198 | + if ($a.length > 0) { |
199 | + var $li = $this.parents('li'); | ||
372 | 200 | ||
373 | - if (imgLen > 3 && addFlagDom.find('.img-size').length < 1) { | ||
374 | - addFlagDom.append('<div class="img-size"><i class="pic-icon"></i>' + imgLen + '</div>'); | 201 | + window._yas.sendAppLogs({ |
202 | + appop: 'YB_H5_STROLL_STAR_FLR_C', | ||
203 | + param: JSON.stringify({ | ||
204 | + C_ID: C_ID, | ||
205 | + TAB_INDEX: 0, | ||
206 | + TAB_NAME: '全部', | ||
207 | + CONTENT_INDEX: $li.index() + 1, | ||
208 | + CONTENT_ID: $li.data('id') | ||
209 | + }) | ||
210 | + }, true); | ||
375 | } | 211 | } |
376 | -} | ||
377 | -*/ | ||
378 | - | ||
379 | - | 212 | +}); |
380 | 213 | ||
214 | +setTimeout(function() { | ||
215 | + if (!window._yas || !window._yas.sendAppLogs) { | ||
216 | + return; | ||
217 | + } | ||
218 | + window._yas.sendAppLogs({ | ||
219 | + appop: 'YB_H5_STROLL_STAR_TAB_C', | ||
220 | + param: JSON.stringify({ | ||
221 | + C_ID: C_ID, | ||
222 | + TAB_INDEX: 0, | ||
223 | + TAB_NAME: '全部' | ||
224 | + }) | ||
225 | + }, true); | ||
226 | +}, 500); |
@@ -3,7 +3,10 @@ var bp = require('./burying-point'); | @@ -3,7 +3,10 @@ var bp = require('./burying-point'); | ||
3 | 3 | ||
4 | $(window).load(function() { | 4 | $(window).load(function() { |
5 | // 统计:分期首页点击账户管理进入账户管理页面时 | 5 | // 统计:分期首页点击账户管理进入账户管理页面时 |
6 | - bp.setContYas('YB_INST_REPAYMENT', { | 6 | + bp.setContYas({ |
7 | + op: 'YB_INST_REPAYMENT', | ||
8 | + appop: 'YB_H5_INST_REPAYMENT_C' | ||
9 | + }, { | ||
7 | POS_ID: $('.account-page').data('posId') | 10 | POS_ID: $('.account-page').data('posId') |
8 | - }); | 11 | + }, true); |
9 | }); | 12 | }); |
1 | require('../common'); | 1 | require('../common'); |
2 | 2 | ||
3 | -function setContYas(op, params, flag) { | 3 | +function setContYas(operid, params, flag) { |
4 | params = $.extend({ | 4 | params = $.extend({ |
5 | C_ID: window.queryString.yh_channel || window.cookie('yhChannel') | 5 | C_ID: window.queryString.yh_channel || window.cookie('yhChannel') |
6 | }, params); | 6 | }, params); |
7 | 7 | ||
8 | - flag = flag === false ? flag : true; | ||
9 | - | ||
10 | if (window._yas && window._yas.sendCustomInfo) { | 8 | if (window._yas && window._yas.sendCustomInfo) { |
9 | + var op, | ||
10 | + appop; | ||
11 | + | ||
12 | + if (typeof operid === 'object') { | ||
13 | + op = operid.op; | ||
14 | + appop = operid.appop; | ||
15 | + } else if (typeof operid === 'string') { | ||
16 | + op = operid; | ||
17 | + } | ||
18 | + | ||
11 | window._yas.sendCustomInfo({ | 19 | window._yas.sendCustomInfo({ |
12 | op: op, | 20 | op: op, |
21 | + appop: appop, | ||
13 | param: JSON.stringify(params) | 22 | param: JSON.stringify(params) |
14 | }, flag); | 23 | }, flag); |
15 | } | 24 | } |
@@ -82,12 +82,15 @@ ListData.prototype.getListData = function(page) { | @@ -82,12 +82,15 @@ ListData.prototype.getListData = function(page) { | ||
82 | 82 | ||
83 | if (!self.opt.noResult) { // 有商品列表 | 83 | if (!self.opt.noResult) { // 有商品列表 |
84 | // 统计:商品翻页时 | 84 | // 统计:商品翻页时 |
85 | - bp.setContYas('YB_INST_HOME_GDS_LIST', { | 85 | + bp.setContYas({ |
86 | + op: 'YB_INST_HOME_GDS_LIST', | ||
87 | + appop: 'YB_H5_INST_HOME_GDS_LIST_C' | ||
88 | + }, { | ||
86 | PRD_NUM: $('.installment-only .good-info').length, | 89 | PRD_NUM: $('.installment-only .good-info').length, |
87 | PRD_ID: bp.countGoodsId(), | 90 | PRD_ID: bp.countGoodsId(), |
88 | ACTION_ID: 0, | 91 | ACTION_ID: 0, |
89 | REC_ID: self.opt.uuid | 92 | REC_ID: self.opt.uuid |
90 | - }); | 93 | + }, true); |
91 | 94 | ||
92 | $('img.lazy').lazyload({ | 95 | $('img.lazy').lazyload({ |
93 | effect: 'fadeIn' | 96 | effect: 'fadeIn' |
@@ -98,14 +98,17 @@ $(window).load(function() { | @@ -98,14 +98,17 @@ $(window).load(function() { | ||
98 | // 统计:进入订单详情页时 | 98 | // 统计:进入订单详情页时 |
99 | bp.setContYas('YB_INST_ORDER_INFO', { | 99 | bp.setContYas('YB_INST_ORDER_INFO', { |
100 | ORDER_CODE: orderCode | 100 | ORDER_CODE: orderCode |
101 | - }); | 101 | + }, true); |
102 | 102 | ||
103 | $('.repayment-btn').on('click', function() { | 103 | $('.repayment-btn').on('click', function() { |
104 | 104 | ||
105 | // 统计:点击立即还款时 | 105 | // 统计:点击立即还款时 |
106 | - bp.setContYas('YB_INST_ORDER_TOPAY', { | 106 | + bp.setContYas({ |
107 | + op: 'YB_INST_ORDER_TOPAY', | ||
108 | + appop: 'YB_H5_INST_ORDER_TOPAY_C' | ||
109 | + }, { | ||
107 | ORDER_CODE: orderCode, | 110 | ORDER_CODE: orderCode, |
108 | PERIODS: $(CHECKBOX_SELECTOR + ':checked').last().data('sortId') | 111 | PERIODS: $(CHECKBOX_SELECTOR + ':checked').last().data('sortId') |
109 | - }); | 112 | + }, true); |
110 | }); | 113 | }); |
111 | }); | 114 | }); |
@@ -93,9 +93,12 @@ $('.header-tab a').click(function() { | @@ -93,9 +93,12 @@ $('.header-tab a').click(function() { | ||
93 | loadOrderList(1, $(this).data('type')); | 93 | loadOrderList(1, $(this).data('type')); |
94 | 94 | ||
95 | // 统计: tab 切换 | 95 | // 统计: tab 切换 |
96 | - bp.setContYas('YB_INST_ORDER_TAB', { | 96 | + bp.setContYas({ |
97 | + op: 'YB_INST_ORDER_TAB', | ||
98 | + appop: 'YB_H5_INST_ORDER_TAB_C' | ||
99 | + }, { | ||
97 | LAB_ID: $(this).parent().index() | 100 | LAB_ID: $(this).parent().index() |
98 | - }); | 101 | + }, true); |
99 | return false; | 102 | return false; |
100 | }); | 103 | }); |
101 | 104 | ||
@@ -131,14 +134,20 @@ $(window).scroll(function() { | @@ -131,14 +134,20 @@ $(window).scroll(function() { | ||
131 | $(window).load(function() { | 134 | $(window).load(function() { |
132 | 135 | ||
133 | // 统计:分期主页点击分期订单进入订单列表页时 | 136 | // 统计:分期主页点击分期订单进入订单列表页时 |
134 | - bp.setContYas('YB_INST_REPAYMENT', { | 137 | + bp.setContYas({ |
138 | + op: 'YB_INST_REPAYMENT', | ||
139 | + appop: 'YB_H5_INST_REPAYMENT_C' | ||
140 | + }, { | ||
135 | POS_ID: $('.installment-order-page').data('posId') | 141 | POS_ID: $('.installment-order-page').data('posId') |
136 | - }); | 142 | + }, true); |
137 | 143 | ||
138 | $(document).on('click', '.order-list a', function() { | 144 | $(document).on('click', '.order-list a', function() { |
139 | 145 | ||
140 | // 统计:点击各个订单时 | 146 | // 统计:点击各个订单时 |
141 | - bp.setContYas('YB_INST_ORDER_CLICK', { | 147 | + bp.setContYas({ |
148 | + op: 'YB_INST_ORDER_CLICK', | ||
149 | + appop: 'YB_H5_INST_ORDER_C' | ||
150 | + }, { | ||
142 | LAB_ID: $('.header-tab .active').index(), | 151 | LAB_ID: $('.header-tab .active').index(), |
143 | ORDER_CODE: $(this).data('code') | 152 | ORDER_CODE: $(this).data('code') |
144 | }, false); | 153 | }, false); |
@@ -60,25 +60,31 @@ var installment = { | @@ -60,25 +60,31 @@ var installment = { | ||
60 | 60 | ||
61 | // 统计:开通按钮点击时 | 61 | // 统计:开通按钮点击时 |
62 | $('.open-btn').on('click', function() { | 62 | $('.open-btn').on('click', function() { |
63 | - bp.setContYas('YB_INST_OPEN', {}); | 63 | + bp.setContYas({ |
64 | + op: 'YB_INST_OPEN', | ||
65 | + appop: 'YB_H5_INST_OPEN_C' | ||
66 | + }, {}, true); | ||
64 | }); | 67 | }); |
65 | 68 | ||
66 | $(document).on('click', '.good-info', function() { | 69 | $(document).on('click', '.good-info', function() { |
67 | 70 | ||
68 | // 统计:商品点击时 | 71 | // 统计:商品点击时 |
69 | - bp.setContYas('YB_INST_HOME_GDS_LIST', { | 72 | + bp.setContYas({ |
73 | + op: 'YB_INST_HOME_GDS_LIST', | ||
74 | + appop: 'YB_H5_INST_HOME_GDS_LIST_C' | ||
75 | + }, { | ||
70 | PRD_NUM: parseInt($(this).index()) + 1, //eslint-disable-line | 76 | PRD_NUM: parseInt($(this).index()) + 1, //eslint-disable-line |
71 | PRD_ID: $(this).data('goodId'), | 77 | PRD_ID: $(this).data('goodId'), |
72 | ACTION_ID: 1, | 78 | ACTION_ID: 1, |
73 | REC_ID: self.uuidVal | 79 | REC_ID: self.uuidVal |
74 | - }); | 80 | + }, true); |
75 | }); | 81 | }); |
76 | 82 | ||
77 | // 统计:开通后模块位点击时 | 83 | // 统计:开通后模块位点击时 |
78 | $('.nav-bit').on('click', function() { | 84 | $('.nav-bit').on('click', function() { |
79 | bp.setContYas('YB_INST_REPAYMENT_CLICK', { | 85 | bp.setContYas('YB_INST_REPAYMENT_CLICK', { |
80 | POS_ID: $(this).data('id') | 86 | POS_ID: $(this).data('id') |
81 | - }); | 87 | + }, true); |
82 | }); | 88 | }); |
83 | 89 | ||
84 | if (window.queryString.status === '2') { | 90 | if (window.queryString.status === '2') { |
@@ -131,9 +137,12 @@ var installment = { | @@ -131,9 +137,12 @@ var installment = { | ||
131 | } | 137 | } |
132 | 138 | ||
133 | // 统计:开通成功后首页头部tab切换 | 139 | // 统计:开通成功后首页头部tab切换 |
134 | - bp.setContYas('YB_INST_OPENED_HOME_CLICK', { | 140 | + bp.setContYas({ |
141 | + op: 'YB_INST_OPENED_HOME_CLICK', | ||
142 | + appop: 'YB_H5_INST_OPENED_HOME_TAB_C' | ||
143 | + }, { | ||
135 | LAB_ID: labId | 144 | LAB_ID: labId |
136 | - }); | 145 | + }, true); |
137 | 146 | ||
138 | self.starIScroll.iScroll.refresh(); | 147 | self.starIScroll.iScroll.refresh(); |
139 | }, | 148 | }, |
@@ -185,22 +194,25 @@ $(window).load(function() { | @@ -185,22 +194,25 @@ $(window).load(function() { | ||
185 | // 统计:进入页面时 | 194 | // 统计:进入页面时 |
186 | bp.setContYas('YB_INST_HOME', { | 195 | bp.setContYas('YB_INST_HOME', { |
187 | IS_OPEN: installment.$isOpen.val() | 196 | IS_OPEN: installment.$isOpen.val() |
188 | - }); | 197 | + }, true); |
189 | 198 | ||
190 | // 统计:商品第一页加载时 | 199 | // 统计:商品第一页加载时 |
191 | - bp.setContYas('YB_INST_HOME_GDS_LIST', { | 200 | + bp.setContYas({ |
201 | + op: 'YB_INST_HOME_GDS_LIST', | ||
202 | + appop: 'YB_H5_INST_HOME_GDS_LIST_C' | ||
203 | + }, { | ||
192 | PRD_NUM: $('.installment-only .good-info').length, | 204 | PRD_NUM: $('.installment-only .good-info').length, |
193 | PRD_ID: bp.countGoodsId(), | 205 | PRD_ID: bp.countGoodsId(), |
194 | ACTION_ID: 0, | 206 | ACTION_ID: 0, |
195 | REC_ID: installment.uuidVal | 207 | REC_ID: installment.uuidVal |
196 | - }); | 208 | + }, true); |
197 | 209 | ||
198 | if (installment.$isOpen.val() === 'true') { | 210 | if (installment.$isOpen.val() === 'true') { |
199 | 211 | ||
200 | // 统计:待还款金额默认页面加载时 | 212 | // 统计:待还款金额默认页面加载时 |
201 | bp.setContYas('YB_INST_OPENED_HOME_LOAD', { | 213 | bp.setContYas('YB_INST_OPENED_HOME_LOAD', { |
202 | LAB_ID: 1 | 214 | LAB_ID: 1 |
203 | - }); | 215 | + }, true); |
204 | } | 216 | } |
205 | } | 217 | } |
206 | }); | 218 | }); |
@@ -214,7 +214,10 @@ $('#apply-button').click(function() { | @@ -214,7 +214,10 @@ $('#apply-button').click(function() { | ||
214 | } | 214 | } |
215 | 215 | ||
216 | // 统计:点击下一步按钮时 | 216 | // 统计:点击下一步按钮时 |
217 | - bp.setContYas('YB_INST_NEXT', {}); | 217 | + bp.setContYas({ |
218 | + op: 'YB_INST_NEXT', | ||
219 | + appop: 'YB_H5_INST_NEXT_C' | ||
220 | + }, {}, true); | ||
218 | 221 | ||
219 | $.ajax({ | 222 | $.ajax({ |
220 | method: 'get', | 223 | method: 'get', |
@@ -256,7 +259,10 @@ $('#apply-button').click(function() { | @@ -256,7 +259,10 @@ $('#apply-button').click(function() { | ||
256 | if (result.data.status === '2') { | 259 | if (result.data.status === '2') { |
257 | 260 | ||
258 | // 统计:开通成功时 | 261 | // 统计:开通成功时 |
259 | - bp.setContYas('YB_INST_OPEN_SUCCESS', {}); | 262 | + bp.setContYas({ |
263 | + op: 'YB_INST_OPEN_SUCCESS', | ||
264 | + appop: 'YB_H5_INST_OPEN_SUCCESS_L' | ||
265 | + }, {}, true); | ||
260 | } | 266 | } |
261 | 267 | ||
262 | // 开通失败 | 268 | // 开通失败 |
@@ -313,5 +319,5 @@ require('./overdue-notice'); | @@ -313,5 +319,5 @@ require('./overdue-notice'); | ||
313 | 319 | ||
314 | $(window).load(function() { | 320 | $(window).load(function() { |
315 | // 统计:进入开通分期表单页面时 | 321 | // 统计:进入开通分期表单页面时 |
316 | - bp.setContYas('YB_INST_OPEN_INFO', {}); | 322 | + bp.setContYas('YB_INST_OPEN_INFO', {}, true); |
317 | }); | 323 | }); |
@@ -5,7 +5,10 @@ $('.repay-list .notice').on('click', function() { | @@ -5,7 +5,10 @@ $('.repay-list .notice').on('click', function() { | ||
5 | $notice.show(); | 5 | $notice.show(); |
6 | 6 | ||
7 | // 统计:点击逾期说明时 | 7 | // 统计:点击逾期说明时 |
8 | - bp.setContYas('YB_INST_OVERDUE_INFO_CLICK', {}); | 8 | + bp.setContYas({ |
9 | + op: 'YB_INST_OVERDUE_INFO_CLICK', | ||
10 | + appop: 'YB_H5_INST_OVERDUE_INFO_C' | ||
11 | + }, {}, true); | ||
9 | return false; | 12 | return false; |
10 | }); | 13 | }); |
11 | 14 |
@@ -31,14 +31,12 @@ $.get('/product/recommend-for-you/userCenter').then(function(html) { | @@ -31,14 +31,12 @@ $.get('/product/recommend-for-you/userCenter').then(function(html) { | ||
31 | $recommendForYou.show(); | 31 | $recommendForYou.show(); |
32 | } | 32 | } |
33 | 33 | ||
34 | - | ||
35 | - | ||
36 | window.givePoint({ | 34 | window.givePoint({ |
37 | REC_POSE: 110004, | 35 | REC_POSE: 110004, |
38 | PRD_ID: PRDID.join(','), | 36 | PRD_ID: PRDID.join(','), |
39 | PRD_NUM: $('.recommend-for-you .good-info').length, | 37 | PRD_NUM: $('.recommend-for-you .good-info').length, |
40 | ACTION_ID: 0, | 38 | ACTION_ID: 0, |
41 | - page_num: 1 | 39 | + PAGE_NUM: 1 |
42 | }); | 40 | }); |
43 | 41 | ||
44 | $recommendForYou.find('.good-info').on('click', 'a', function() { | 42 | $recommendForYou.find('.good-info').on('click', 'a', function() { |
@@ -49,7 +47,7 @@ $.get('/product/recommend-for-you/userCenter').then(function(html) { | @@ -49,7 +47,7 @@ $.get('/product/recommend-for-you/userCenter').then(function(html) { | ||
49 | PRD_ID: $(this).closest('.good-info').data('id'), | 47 | PRD_ID: $(this).closest('.good-info').data('id'), |
50 | PRD_NUM: index, | 48 | PRD_NUM: index, |
51 | ACTION_ID: 1, | 49 | ACTION_ID: 1, |
52 | - page_num: 1 | 50 | + PAGE_NUM: 1 |
53 | }); | 51 | }); |
54 | 52 | ||
55 | return true; | 53 | return true; |
@@ -19,7 +19,10 @@ listData.getListData(0); | @@ -19,7 +19,10 @@ listData.getListData(0); | ||
19 | 19 | ||
20 | $(window).load(function() { | 20 | $(window).load(function() { |
21 | // 统计:分期首页点击还款记录进入落地页时 | 21 | // 统计:分期首页点击还款记录进入落地页时 |
22 | - bp.setContYas('YB_INST_REPAYMENT', { | 22 | + bp.setContYas({ |
23 | + op: 'YB_INST_REPAYMENT', | ||
24 | + appop: 'YB_H5_INST_REPAYMENT_C' | ||
25 | + }, { | ||
23 | POS_ID: $('.repayment-list-page').data('posId') | 26 | POS_ID: $('.repayment-list-page').data('posId') |
24 | - }); | 27 | + }, true); |
25 | }); | 28 | }); |
@@ -83,9 +83,12 @@ repayment.update(); | @@ -83,9 +83,12 @@ repayment.update(); | ||
83 | 83 | ||
84 | $(window).load(function() { | 84 | $(window).load(function() { |
85 | // 统计:各模块的落地页进入时 | 85 | // 统计:各模块的落地页进入时 |
86 | - bp.setContYas('YB_INST_REPAYMENT', { | 86 | + bp.setContYas({ |
87 | + op: 'YB_INST_REPAYMENT', | ||
88 | + appop: 'YB_H5_INST_REPAYMENT_C' | ||
89 | + }, { | ||
87 | POS_ID: $('.repayment-list-page').data('posId') | 90 | POS_ID: $('.repayment-list-page').data('posId') |
88 | - }); | 91 | + }, true); |
89 | }); | 92 | }); |
90 | 93 | ||
91 | // 统计yas 需要传的参数 | 94 | // 统计yas 需要传的参数 |
@@ -114,11 +117,14 @@ function countYasParams() { | @@ -114,11 +117,14 @@ function countYasParams() { | ||
114 | $('.repayment-btn').on('click', function() { | 117 | $('.repayment-btn').on('click', function() { |
115 | var opt = countYasParams(); | 118 | var opt = countYasParams(); |
116 | 119 | ||
117 | - bp.setContYas('YB_INST_TOPAY_CLICK', { | 120 | + bp.setContYas({ |
121 | + op: 'YB_INST_TOPAY_CLICK', | ||
122 | + appop: 'YB_H5_INST_TOPAY_C' | ||
123 | + }, { | ||
118 | POS_ID: $('.repayment-list-page').data('posId'), | 124 | POS_ID: $('.repayment-list-page').data('posId'), |
119 | ORDER_CODE: opt.billNoAll, | 125 | ORDER_CODE: opt.billNoAll, |
120 | INST_STYLE: opt.termNoAll | 126 | INST_STYLE: opt.termNoAll |
121 | - }); | 127 | + }, true); |
122 | }); | 128 | }); |
123 | 129 | ||
124 | 130 | ||
@@ -126,10 +132,13 @@ $('.repayment-btn').on('click', function() { | @@ -126,10 +132,13 @@ $('.repayment-btn').on('click', function() { | ||
126 | $('.list-right a').on('click', function() { | 132 | $('.list-right a').on('click', function() { |
127 | var li = $(this).parents('li'); | 133 | var li = $(this).parents('li'); |
128 | 134 | ||
129 | - bp.setContYas('YB_INST_TOPAY_INFO', { | 135 | + bp.setContYas({ |
136 | + op: 'YB_INST_TOPAY_INFO', | ||
137 | + appop: 'YB_H5_INST_TOPAY_INFO_C' | ||
138 | + }, { | ||
130 | POS_ID: $('.repayment-list-page').data('posId'), | 139 | POS_ID: $('.repayment-list-page').data('posId'), |
131 | ORDER_CODE: li.data('billNo'), | 140 | ORDER_CODE: li.data('billNo'), |
132 | INST_STYLE: curTermNo[li.data('terms')], | 141 | INST_STYLE: curTermNo[li.data('terms')], |
133 | PERIODS: li.data('currterm') | 142 | PERIODS: li.data('currterm') |
134 | - }); | 143 | + }, true); |
135 | }); | 144 | }); |
@@ -17,28 +17,10 @@ var $recommendForYou = $('.recommend-for-you'), | @@ -17,28 +17,10 @@ var $recommendForYou = $('.recommend-for-you'), | ||
17 | var RECID = (new Date().getTime() + '_H5_YOHOBUY_' + Math.floor(Math.random() * 1000000 + 1000000) + | 17 | var RECID = (new Date().getTime() + '_H5_YOHOBUY_' + Math.floor(Math.random() * 1000000 + 1000000) + |
18 | '_' + Math.floor(Math.random() * 1000000 + 1000000)); | 18 | '_' + Math.floor(Math.random() * 1000000 + 1000000)); |
19 | 19 | ||
20 | -var C_ID, goodid, goodIds = [], | 20 | +var goodid, |
21 | + goodIds = [], | ||
21 | prdLoad; | 22 | prdLoad; |
22 | 23 | ||
23 | -C_ID = window._ChannelVary[window.cookie('_Channel')]; | ||
24 | - | ||
25 | -function yasRequest(PRD_ID, PRD_NUM, ACTION_ID) { | ||
26 | - if (window._yas && window._yas.sendCustomInfo) { | ||
27 | - window._yas.sendCustomInfo({ | ||
28 | - op: 'YB_CHOOSE_FOR_YOU_Y', | ||
29 | - param: JSON.stringify({ | ||
30 | - REC_POSE: 100013, | ||
31 | - REC_ID: RECID, | ||
32 | - PRD_ID: PRD_ID, | ||
33 | - PRD_NUM: PRD_NUM, | ||
34 | - C_ID: C_ID, | ||
35 | - ACTION_ID: ACTION_ID, | ||
36 | - PAGE_NUM: 1 | ||
37 | - }) | ||
38 | - }, true); | ||
39 | - } | ||
40 | -} | ||
41 | - | ||
42 | function request() { | 24 | function request() { |
43 | if (requesting || end) { | 25 | if (requesting || end) { |
44 | return; | 26 | return; |
@@ -48,13 +30,14 @@ function request() { | @@ -48,13 +30,14 @@ function request() { | ||
48 | 30 | ||
49 | if (preferenceUrl) { | 31 | if (preferenceUrl) { |
50 | $.get(preferenceUrl).then(function(html) { | 32 | $.get(preferenceUrl).then(function(html) { |
51 | - if (typeof html !== 'string') { return; } | 33 | + if (typeof html !== 'string') { |
34 | + return; | ||
35 | + } | ||
52 | 36 | ||
53 | $recommendForYou.html(html.replace(/https?:/gi, '')).show(); | 37 | $recommendForYou.html(html.replace(/https?:/gi, '')).show(); |
54 | lazyLoad($recommendForYou.find('img.lazy')); | 38 | lazyLoad($recommendForYou.find('img.lazy')); |
55 | 39 | ||
56 | // 为你优选埋点- 加载 | 40 | // 为你优选埋点- 加载 |
57 | - | ||
58 | $('.goods-container').find('.good-info').each(function() { | 41 | $('.goods-container').find('.good-info').each(function() { |
59 | goodid = $(this).data('good-id'); | 42 | goodid = $(this).data('good-id'); |
60 | 43 | ||
@@ -65,14 +48,28 @@ function request() { | @@ -65,14 +48,28 @@ function request() { | ||
65 | 48 | ||
66 | prdLoad = JSON.stringify(goodIds).replace(/\[|\]|/g, ''); | 49 | prdLoad = JSON.stringify(goodIds).replace(/\[|\]|/g, ''); |
67 | 50 | ||
68 | - yasRequest(prdLoad, goodIds.length, 0); | 51 | + window.givePoint({ |
52 | + REC_POSE: 100013, | ||
53 | + REC_ID: RECID, | ||
54 | + PRD_ID: prdLoad, | ||
55 | + PRD_NUM: goodIds.length, | ||
56 | + ACTION_ID: 0, | ||
57 | + PAGE_NUM: 1 | ||
58 | + }); | ||
69 | 59 | ||
70 | // 点击商品 | 60 | // 点击商品 |
71 | $('.good-info').on('click', function() { | 61 | $('.good-info').on('click', function() { |
72 | var PRD_ID = $(this).data('good-id'), | 62 | var PRD_ID = $(this).data('good-id'), |
73 | PRD_NUM = $(this).index(); | 63 | PRD_NUM = $(this).index(); |
74 | 64 | ||
75 | - yasRequest(PRD_ID, PRD_NUM, 1); | 65 | + window.givePoint({ |
66 | + REC_POSE: 100013, | ||
67 | + REC_ID: RECID, | ||
68 | + PRD_ID: PRD_ID, | ||
69 | + PRD_NUM: PRD_NUM, | ||
70 | + ACTION_ID: 1, | ||
71 | + PAGE_NUM: 1 | ||
72 | + }); | ||
76 | 73 | ||
77 | // return false; | 74 | // return false; |
78 | }); | 75 | }); |
-
Please register or login to post a comment