...
|
...
|
@@ -2,17 +2,43 @@ var $ = require('yoho-jquery'), |
|
|
ellipsis = require('yoho-mlellipsis'),
|
|
|
ListData = require('./installment-goods'),
|
|
|
bp = require('./burying-point'),
|
|
|
PullRefresh = require('../plugin/pull-refresh'),
|
|
|
noticeScroll = require('../plugin/notice-scroll'),
|
|
|
uuid = require('uuid'),
|
|
|
lazyLoad = require('yoho-jquery-lazyload');
|
|
|
|
|
|
var uuidVal = uuid.v4();
|
|
|
var uuidVal = uuid.v4(),
|
|
|
$tab = $('.detail-tab span'),
|
|
|
$isOpen = $('.is-open'),
|
|
|
$installmentCont = $('.installment-cont');
|
|
|
|
|
|
require('../common');
|
|
|
var starIScroll;
|
|
|
|
|
|
require('../common');
|
|
|
|
|
|
noticeScroll('.notice', $('.notice').data('time') * 1000);
|
|
|
lazyLoad($('img.lazy'));
|
|
|
ellipsis.init();
|
|
|
|
|
|
$(window).on('mousewheel', false);
|
|
|
|
|
|
if ($isOpen.val() === 'true') {
|
|
|
// 下拉刷新
|
|
|
starIScroll = new PullRefresh('.installment-main', {
|
|
|
pullDown: function() {
|
|
|
if($('.detail-tab .on').index() === 0) {
|
|
|
location.href = '/home/installment/index?uid=20000184&tab=1';
|
|
|
} else {
|
|
|
location.href = '/home/installment/index?uid=20000184&tab=2';
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
starIScroll.iScroll.on('scroll', function() {
|
|
|
$(window).trigger('scroll');
|
|
|
});
|
|
|
}
|
|
|
|
|
|
// 商品列表翻页加载数据
|
|
|
new ListData({
|
|
|
url: '/home/installment/get-goods',
|
...
|
...
|
@@ -35,12 +61,18 @@ function setDetailText() { |
|
|
|
|
|
setDetailText();
|
|
|
|
|
|
if (window.queryString.tab === '2') {
|
|
|
$tab.eq(1).addClass('on').siblings().removeClass('on');
|
|
|
$installmentCont.hide().eq(1).show();
|
|
|
starIScroll.iScroll.refresh();
|
|
|
}
|
|
|
|
|
|
// 已开通tab 切换
|
|
|
$('.detail-tab span').on('click', function() {
|
|
|
$tab.on('click', function() {
|
|
|
var labId = 1;
|
|
|
|
|
|
$(this).addClass('on').siblings().removeClass('on');
|
|
|
$('.installment-cont').hide().eq($(this).index()).show();
|
|
|
$installmentCont.hide().eq($(this).index()).show();
|
|
|
|
|
|
if ($(this).index() === 1) {
|
|
|
setDetailText();
|
...
|
...
|
@@ -52,6 +84,8 @@ $('.detail-tab span').on('click', function() { |
|
|
bp.setContYas('YB_INST_OPENED_HOME_CLICK', {
|
|
|
LAB_ID: labId
|
|
|
});
|
|
|
|
|
|
starIScroll.iScroll.refresh();
|
|
|
});
|
|
|
|
|
|
// 统计:开通按钮点击时
|
...
|
...
|
@@ -82,7 +116,7 @@ $(window).load(function() { |
|
|
if ($('.installment-only').length > 0) {
|
|
|
// 统计:进入页面时
|
|
|
bp.setContYas('YB_INST_HOME', {
|
|
|
IS_OPEN: $('.is-open').val()
|
|
|
IS_OPEN: $isOpen.val()
|
|
|
});
|
|
|
|
|
|
// 统计:商品第一页加载时
|
...
|
...
|
@@ -93,7 +127,7 @@ $(window).load(function() { |
|
|
REC_ID: uuidVal
|
|
|
});
|
|
|
|
|
|
if ($('.is-open').val() === 'true') {
|
|
|
if ($isOpen.val() === 'true') {
|
|
|
|
|
|
// 统计:待还款金额默认页面加载时
|
|
|
bp.setContYas('YB_INST_OPENED_HOME_LOAD', {
|
...
|
...
|
|