vip.page.js 1.37 KB

require('scss/product/sale/vip-index.page.scss');

let Swiper = require('yoho-swiper2');
let search = require('./sale/search');

// 获取频道页
let getChannel = function() {
    let name = window.cookie('_Channel');

    return {
        boys: 1,
        girls: 2,
        kids: 3,
        lifestyle: 4
    }[name] || 1;
};

search.start();

$('.goods-container').on('click', '.good-info', function() {
    let C_ID = getChannel(),
        UDID = window.queryString.anbiudid || window.queryString.udid || '',
        SID = window.queryString.session_id || '',
        skn = $(this).attr('data-id');

    if (window._yas && window._yas.sendCustomInfo) {
        window._yas.sendCustomInfo({
            op: 'YB_MEM_DAY_GDS_LIST_C',
            param: JSON.stringify({
                C_ID: C_ID,
                UDID: UDID,
                SID: SID,
                PRD_SKN: skn,
            }),
        }, true);
    }
});

setTimeout(function() {
    if ($('.banner-swiper .swiper-slide').length > 1) {
        new Swiper('.swiper-container', {
            observer: true,
            observeParents: true,
            lazyLoading: true,
            lazyLoadingInPrevNext: true,
            loop: true,
            autoplay: 3000,
            autoplayDisableOnInteraction: true,
            paginationClickable: true,
            pagination: '.banner-top .pagination-inner'
        });
    }
}, 50);