jquery绑定事件

来源:互联网 发布:软件测试文档包括 编辑:程序博客网 时间:2024/06/10 02:52
$(function(){   //团过券鼠标经过效果   $("#cert_groupon_info_list").on({      mouseover: function(){         if(!$(this).hasClass("cur")){            $(this).stop().animate({"margin-left":"-40px"}, 100);              }      },      mouseleave: function(){         if(!$(this).hasClass("cur")){            $(this).stop().animate({"margin-left":"0"}, 100);           }      },      click: function(){          var me = $(this);         /**********页面效果start*************/         gouponAnimate();                  /**********页面效果end*************/         //获取选中的要支付的影票         var ticketObj = $('#cert_ticket_list_info tr').filter('.cur');         if(ticketObj.length>0){            ticketObj = ticketObj.eq(0);            //获取政策ID            var policyid = ticketObj.find('[policyid]').attr('policyid');            //当支付的列表中已有券支付时,只有现金券可重复用券支付            if(policyid==""||(policyid!=""&&               $(this).attr('ticketcoupontype')=='CASH_COUPON'&&               //可多张使用               $(this).attr('ticketcouponrulevalue')=='2'&&               //必须是同一种政策               //$(this).attr('couponid')==ticketObj.find('[policyid]').attr('policyid')               //必须是同一种政策               ticketObj.find('[policyid]').attr('policyid').indexOf($(this).attr('couponid'))>=0            ))            {                  var conObj = {                        couponid:$(this).attr('couponid'),                         policysnapshotid:$(this).attr('policysnapshotid'),                        name:$(this).attr('name'),                        couponvalue:$(this).attr('couponvalue'),                        ticketcouponrulevalue:$(this).attr('ticketcouponrulevalue')                  };                   //现金                  if($(this).attr('ticketcoupontype')=='CASH_COUPON'){                     cashPay(conObj,ticketObj);                  //打折                  }else if($(this).attr('ticketcoupontype')=='DISCOUNT_COUPON'){                     discountPay(conObj,ticketObj);                  //兑换                  }else if($(this).attr('ticketcoupontype')=='EXCHANGE_COUPON'){                     exchangePay(conObj,ticketObj);                  //vip                  }else if($(this).attr('ticketcoupontype')=='VIP_COUPON'){                     vipPay(conObj,ticketObj);                  }            }else{               new_confirm('您选择的影票已选择支付方式,是否清除原支付方式,进行重新支付?','warn',function(){                  resetTicketPayInfo(ticketObj);                  me.click();               });            }            //修改总价            updateConpoySumPayInfo();         }else{            new_alert("请选择要支付的影票",'error');         }         //<a href="javascript:;" class="delete"></a>      }   },'p');
}
0 0
原创粉丝点击