jquery.seat-charts.1.1.15 选座座位插件的方法介绍

孔阳炎
2023-12-01

jquery.seat-charts.1.1.15

/**
 *  几个方法
 *
 *  node       无参数 整个座位DOM对象   创建一个CSS查询,通过其DOM ID获取所有座位,
    each       参数是 函数  ,每个座位都调用一遍( 座位对象,座位号)
    get        根据id,返回 seatSet
    find
    set
    push       push(id, seat)    增加id(seatIds),和座位 (seats)
    status     参数 状态,设置座位的状态,几个数值 unavailable available selected

    blur
    char
    click
    data        返回 Object { price: 300, classes: "piao3-class", category: "三级票" }
    focus
    setting()   "$node"
                     length: 1
                     character: "c"
                     column: 1
                 data: Object { price: 300, classes: "piao3-class", category: "三级票" }
                 category: "三级票"
                 classes: "piao3-class"
                 price: 300
                 id: "3_11"
                 label: 11
                 row: 2
                 status: "available"
                 style: "available"

 *
* */
//设置已售出的座位
//sc.get(['1_3', '1_4', '4_4', '4_5', '4_6', '4_7', '4_8']).status('unavailable');
sc.get(seats_sold).status('unavailable');
//sc.each(function(seatId, seat){});

//所有座位对象
//console.log(sc.seats)
//座位id
//console.log(sc.seatIds)

// 1  这样的格式
for(var seatId  in sc.seatIds ){
    //console.log(seatId);
    //console.log(sc.get(seats_sold))
}

 



// 9_8 这样的格式, 对象的循环
for(var seat  in sc.seats ){
    //console.log(seat);
    //console.log(sc.seats[seat]);
    //console.log(sc.seats[seat].data().classes);
    if(sc.seats[seat].data().classes == 'weixiu-class' || sc.seats[seat].data().classes == 'baoliu-class' ||  sc.seats[seat].data().classes == 'zhuxi-class'){
        //console.log('维修');
        sc.seats[seat].status('unavailable');
    }
}



//对象的循环
// $.each(sc.seats,function(index,value){   //其中index是指数组的下标,value指相对应的值;
//     console.log(index +" : " + value + "<br>");
// })

//

//sc.each();
 类似资料: