, ,
,,,,,,...
when I click inside the first floor, the data acquisition is normal. At that time, when I clicked on the room number in the second floor, the data of that room number was stored in the data on the first floor together. How to separate the data? For example, the first layer is the data of the first layer, and the second layer is the data of the second layer. The current code is as follows:
selectRoomNoList = [];
$("-sharpson_house_room_number_btns>.son_house_room_number_area_div>.weui-flex>.weui-flex__item>.placeholder>.weui-btn").click(function() {
var btn_first = $(this).attr("class");
if(btn_first == "weui-btn weui-btn_disabled weui-btn_default") {
$(this).attr("class", "weui-btn weui-btn_plain-primary");
selectRoomNoList.push($(this).text());
console.log(selectRoomNoList)
//
var floor_p=$(this).parent().parent().parent().siblings("p").children("a");
console.log(floor_p.text())
// console.log(typeof(floor_p.text()))
} else {
$(this).attr("class", "weui-btn weui-btn_disabled weui-btn_default");
// , null
// indexOf:
selectRoomNoList[selectRoomNoList.indexOf($(this).text())] = null;
// splice null
// splice(:,/, :,)
selectRoomNoList.splice(selectRoomNoList.indexOf(null), 1);
console.log(selectRoomNoList)
}
});