<template>
  <div class="container">
    <!-- <van-pull-refresh v-model="isLoading" @refresh="onRefresh"> -->
      <div class="rooms" v-for="(item, index) in rooms" :key="index" @click="handleRoom(item)">
        {{ item.name }}
      </div>
    <!-- </van-pull-refresh> -->
  </div>
</template>

<script>
export default {
  name: "selMetRoom",
  components: {

  },
  props: {
    participants: {
      type: Array,
    }
  },
  data() {
    return {
      rooms: [],
      isLoading: false,
      page: 1,
    }
  },
  computed: {},
  filters: {},
  watch: {},
  mounted(){
    window.scrollTo(0,0);
  },
  created() {
    this.loadData(1)
  },
  methods: {
    loadData(page) {
      let url = `${window.context.xqhk}/bizMeetingPlaceName/v1/getJson`
      this.$http.post(url, {
        groupRelation: "AND",
        groupTree: {},
        pageBean: {
          "page": 1,
          "pageSize": 100,
          "showTotal": true
        },
        params: {},
        querys: [

        ],
        sorter: [
        ]
      }).then(res => {
        console.log(res, 'res')
        if (res.status == 200) {
          let Arr = res.data.value
          Arr.forEach(e => {
            this.rooms.push(e)
          });
          // this.page++;
          // console.log(res.data.rows, 'res.data.value.row')
          // this.metDataList.forEach(e => {
          //   this.users.push(e.name)
          // })
        } else {
          Message.error(res.data.message)
        }

      })
    },
    handleRoom(item) {
      let roomArr = []
      roomArr.push(item)
      let jsonStr = JSON.stringify(roomArr)
      console.log(jsonStr,'jsonStr')
      localStorage.setItem('room2', jsonStr)
      this.$router.push({
        name: 'order2',
        params: {
          room: jsonStr
        }
      })
    },
    onRefresh() {
      this.loadData(this.page)
      this.isLoading = false;
    },
  }
}
</script>

<style lang="scss" scoped>
.container {
  width:390PX;
  height: 100%;
  margin: 0 auto;
  margin-top: 50PX !important;
}

.rooms {
  border-bottom: 1px rgb(177, 176, 176) solid;
  width: 100%;
  height: 55PX;
  line-height: 55PX;
  margin-left: 3vw;
  font-weight: 600;
  padding-left: 3vw;
}
</style>
