|
|
/**
|
|
|
* 退换货申请
|
|
|
* @author: yyqing<yanqing.yang@yoho.cn>
|
|
|
* @date: 2016/7/15
|
|
|
*/
|
|
|
var $ = require('yoho-jquery'),
|
|
|
lazyload = require('yoho-jquery-lazyload');
|
|
|
|
|
|
var $colorText = $('.choose-color .color'),
|
|
|
$sizeText = $('.choose-size .size'),
|
|
|
$colorList = $('.color-list'),
|
|
|
$sizeList = $('.size-list'),
|
|
|
$sizeItem = $('.size-list').children();
|
|
|
|
|
|
lazyload($('img.lazy'));
|
|
|
|
|
|
$colorList.on('click', '.round-color', function() {
|
|
|
var $this = $(this),
|
|
|
data = $this.parent().data();
|
|
|
|
|
|
if (!$this.hasClass('cur')) {
|
|
|
$colorList.removeClass('cur');
|
|
|
$colorText.text(data.color ? data.color : '');
|
|
|
$this.addClass('cur');
|
|
|
}
|
|
|
});
|
|
|
|
|
|
$sizeList.on('click', 'li', function() {
|
|
|
var $this = $(this),
|
|
|
data = $this.data();
|
|
|
|
|
|
if (!$this.hasClass('disable') && +data.num) {
|
|
|
$sizeItem.removeClass('cur');
|
|
|
$sizeText.text(data.name ? data.name : '');
|
|
|
$this.addClass('cur');
|
|
|
}
|
|
|
}); |
|
|
\ No newline at end of file |
...
|
...
|
|