厚膜电阻
1812 2.4KΩ ±5% 3/4W
电阻类型:厚膜电阻器 阻值 2.4KΩ 精度: ±5% 功率:
-
").click(function () {
var this_obj = $(this);
clearTimeout(pretime);
pretime = setTimeout(function () {
oright(this_obj);
}, 300)
});
//点击往后
function oright(this_obj) {
this_obj.siblings("ul").find("li:last").insertBefore(this_obj.siblings("ul").find("li:first"));
this_obj.siblings("ul").animate({"left": "-165px"});
this_obj.siblings("ul").animate({"left": 0}, 1000, "backOut");
nowIndex--;
if (nowIndex < 0) {
nowIndex = this_obj.siblings("ul").find("li").length - 1;
}
}
//点击往前
function oleft(this_obj) {
this_obj.siblings("ul").animate({"left": "-165px"}, 1000, "backIn", function () {
this_obj.siblings("ul").find("li:first").appendTo(this_obj.siblings("ul"));
this_obj.siblings("ul").animate({"left": "0"}, 0);
});
nowIndex++;
if (nowIndex > this_obj.siblings("ul").find("li").length - 1) {
nowIndex = 0;
}
}
// 导航切换
$(".set-meal-cont").eq(0).show();
CombinationPrice = $('.original_price_one').eq(0).find('span').text();//默认主商品的市场价
PriceSaving = $('.original_price_one_collocations').eq(0).find('span').text();//默认主商品的优惠价
$('.Price-saving').eq(0).find('span').text(PriceSaving);//默认主商品的优惠价
eachIput($('.at-que').eq(0).find('input[type=checkbox]'));
$('.Combination-price').eq(0).find('i').text(CombinationPrice);
$('.Price-saving').eq(0).find('span').text(PriceSaving);
$('.set-meal-slect').eq(0).find('span').text(num);
$(".set-meal-nav li").click(function () {
var index = $(this).index();
CombinationPrice = $('.original_price_one').eq(index).find('span').text();
PriceSaving = $('.original_price_one_collocations').eq(index).find('span').text();
$('.Price-saving').eq(index).find('span').text(PriceSaving);
eachIput($('.at-que').eq(index).find('input[type=checkbox]'));
$('.Combination-price').eq(index).find('i').text(CombinationPrice);
$('.Price-saving').eq(index).find('span').text(PriceSaving);
$('.set-meal-slect').eq(index).find('span').text(num);
$(".set-meal-nav li").removeClass("meal-nav-li");
$(this).addClass("meal-nav-li");
$(".set-meal-cont").hide();
$(".set-meal-cont").eq(index).show()
})
})();
}
//遍历默认选中的
function eachIput(data) {
num = 1;
data.each(function (i) {
var checked = $(this).context.checked;
if (checked) {
var val = $(this).parents(".meal-price").find('span').text();
var saving = $(this).parents(".meal-price").next().find('span').text();
CombinationPrice = (CombinationPrice - 0) + (val - 0);
PriceSaving = (PriceSaving - 0) + (saving - 0);
num++;
}
});
}
//选中获取价格
function clickGetPrice(e, price, saving) {
var parents = $(e).parents(".set-meal-cont");
var CombinationCount = parents.find('.Combination-price').find('i').text();
var PriceCount = parents.find('.Price-saving').find('span').text();
if ($(e).attr('checked')) {
$(e).removeAttr('checked')
parents.find('.Combination-price').find('i').text((CombinationCount - price).toFixed(2));
parents.find('.Price-saving').find('span').text((PriceCount - saving).toFixed(2));
num--
parents.find('.set-meal-slect').find('span').text(num);
} else {
$(e).attr('checked', 'checked')
parents.find('.Combination-price').find('i').text((CombinationCount - 0 + price).toFixed(2));
parents.find('.Price-saving').find('span').text((PriceCount - 0 + saving).toFixed(2));
num++
parents.find('.set-meal-slect').find('span').text(num);
}
}
function addCombinationShop(e,t) {
var a = $(e).parents('.set-meal-cont').find('.at-que').find('input[type=checkbox]');
var n = 0;
var arr = new Array();
var address = $('#dispatching_msg').attr('region_id');
var combination = {goods_id:$(e).parents('.set-meal-cont').find('.combination_goods_ids').val(),item_id:$(e).parents('.set-meal-cont').find('.combination_item_id').val(),'region_id':address};
arr.push(combination) ;
var combination_id = $(e).parents('.set-meal-cont').find('.combination_id').val();
$.each(a,function (i,o) {
var checked = $(this).context.checked;
if (checked) {
var combination_goods_ids = {goods_id:$(this).attr('data-id'),item_id:$(this).attr('data-item'),'region_id':address};
arr.push(combination_goods_ids) ;
n++;
}
});
if(n==0){
alert('请至少勾选一个商品');
return false;
}else{
$.ajax({
type: "Post",
url: "/Home/Cart/addCombination.html",
data: {combination_id: combination_id, combination_goods: arr,num:1},
dataType: "json",
success: function (data) {
if (data.status == 1) {
if(t==1){
location.href = "/index.php?m=Home&c=Cart&a=index";
return false;
}else{
layer.open({
type: 2,
title: '温馨提示',
skin: 'layui-layer-rim', //加上边框
area: ['490px', '386px'], //宽高
content: "/index.php?m=Home&c=Goods&a=open_add_cart"
});
}
}else{
layer.msg(data.msg, {icon: 2});
}
}
});
}
}