installment.page.js
1008 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
var $ = require('yoho-jquery'),
ellipsis = require('yoho-mlellipsis'),
ListData = require('./installment-goods'),
lazyLoad = require('yoho-jquery-lazyload');
require('../common');
lazyLoad($('img.lazy'));
ellipsis.init();
new ListData({
url: '/home/installment/get-goods',
page: 1,
boxArea: $('#goods-list')
});
function setDetailText() {
var $this, $title;
$('.good-detail-text .name').each(function() {
$this = $(this);
$title = $this.find('a');
$title[0].mlellipsis(2);
});
}
setDetailText();
$('.detail-tab span').on('click', function() {
$(this).addClass('on').siblings().removeClass('on');
$('.installment-cont').hide().eq($(this).index()).show();
if ($(this).index() === 1) {
setDetailText();
lazyLoad($('img.lazy'));
}
});
window.setCookie('installmentUid', window.queryString.uid);
window.setCookie('udid', window.queryString.udid);
window.setCookie('clientType', window.queryString.client_type);