// JavaScript Document $(function(){ //用户中心弹出框效果 $("*[data-dialog='goods_collect_dialog']").live('click',function(){ var ok_title, cl_title; var url = $(this).data('url'); //删除连接地址 var title = $(this).data('title'); var width = $(this).data('width'); var height = $(this).data('height'); var padding = $(this).data('padding'); var divId = $(this).data('divid'); var id = $(this).data('goodsid'); var hrefCont = ''; var foot = true; if(id > 0){ Ajax.call(url, 'id=' + id, function(data){ if(divId == 'goods_collect'){ if(data.error > 0){ if(data.error == 2){ ok_title = "登录账号"; hrefCont = "user.php"; }else if(data.error == 1){ foot = false; } var content = '
' + '
' + '' + '
' + '

' + data.message + '

' + '
' + '
' + '
'; ok_title = "确定"; }else{ $(".choose-btn-coll").addClass('selected'); $("#collect_count").html(data.collect_count); ok_title = "查看我的收藏"; var content = $("#dialog_goods_collect").html(); hrefCont = "user.php?act=collection_list"; } } pb({ id:divId, title:title, width:width, height:height, ok_title:ok_title, //按钮名称 content:content, //调取内容 drag:false, foot:foot, cl_cBtn:false, onOk:function(){ location.href = hrefCont; } }); $('#' + divId + ' .pb-ft .pb-ok').addClass('color_df3134'); }, 'GET', 'JSON'); }else{ if(divId == 'delete_goods_collect'){ ok_title = "确定"; cl_title = "取消"; var content = $("#delete_goods_collect").html(); } pb({ id:divId, title:title, width:width, height:height, ok_title:ok_title, //按钮名称 cl_title:cl_title, //按钮名称 content:content, //调取内容 drag:false, foot:foot, onOk:function(){ location.href = url; } }); $('#' + divId + ' .pb-ft .pb-ok').addClass('color_df3134'); } }); //用户中心弹出框效果 $("*[data-dialog='goods_del_booking']").live('click',function(){ var url = $(this).data('url'); //删除连接地址 var confirmtitle = $(this).data('confirmtitle'); var width = $(this).data('width'); var height = $(this).data('height'); var divId = $(this).data('divid'); var content = '
' + '
' + '' + '
' + '

' + confirmtitle + '

' + '
' + '
' + '
'; pb({ id:divId, title:'提示', width:width, height:height, ok_title:'确定', //按钮名称 cl_title:'取消', //按钮名称 content:content, //调取内容 drag:false, foot:true, onOk:function(){ location.href = url; } }); $('#' + divId + ' .pb-ft .pb-ok').addClass('color_df3134'); }); });