|
@@ -1,13 +1,23 @@
|
|
|
<template>
|
|
|
<div ref="headerRef" class="header">
|
|
|
- <div style="display: flex; flex-direction: row">
|
|
|
+ <div style="display: flex; flex-direction: row" class="header-title-tab">
|
|
|
<a-button type="text" @click="roomStore.setRoomStatus(1)">
|
|
|
<h3>{{ t('room.myRoom') }}({{ roomStore.list.length }})</h3>
|
|
|
</a-button>
|
|
|
|
|
|
- <a-button type="text" @click="roomStore.setRoomStatus(2)">
|
|
|
+ <a-radio-group
|
|
|
+ v-model:value="roomType"
|
|
|
+ button-style="solid"
|
|
|
+ class="select-group"
|
|
|
+ >
|
|
|
+ <a-radio-button :value="0">{{ t('base.all') }}</a-radio-button>
|
|
|
+ <a-radio-button :value="1">{{ t('base.using') }}</a-radio-button>
|
|
|
+ <a-radio-button :value="2">{{ t('base.end') }}</a-radio-button>
|
|
|
+ </a-radio-group>
|
|
|
+
|
|
|
+ <!-- <a-button type="text" @click="roomStore.setRoomStatus(2)">
|
|
|
<h3>{{ t('room.myEndRoom') }} ({{ roomStore.endlist.length }})</h3>
|
|
|
- </a-button>
|
|
|
+ </a-button> -->
|
|
|
</div>
|
|
|
|
|
|
<a-input
|
|
@@ -40,6 +50,7 @@
|
|
|
<RoomSign
|
|
|
v-if="item !== addMarked"
|
|
|
:room="item"
|
|
|
+ :disabled="isRoomEnd"
|
|
|
@web-sync="webSyncRoom(item)"
|
|
|
@delete="deleteRoom(item)"
|
|
|
@share="shareRoom(item)"
|
|
@@ -79,7 +90,7 @@
|
|
|
<script setup lang="ts">
|
|
|
import { useRoomStore } from '@/store/modules/room'
|
|
|
import { useUserStore } from '@/store/modules/user'
|
|
|
-import { ref, computed, createVNode, unref } from 'vue'
|
|
|
+import { ref, computed, createVNode, unref, watch } from 'vue'
|
|
|
import { message, Modal } from 'ant-design-vue'
|
|
|
import { copyText } from '@/shared'
|
|
|
import { renderModal } from '@/helper'
|
|
@@ -102,14 +113,37 @@ const isMiniApp = ref(import.meta.env.VITE_IS_MINIAPP)
|
|
|
|
|
|
const addMarked = Symbol('add-room')
|
|
|
const roomStore = useRoomStore()
|
|
|
-roomStore.fetchList()
|
|
|
-roomStore.fetchEndList()
|
|
|
-
|
|
|
const { t } = useI18n()
|
|
|
|
|
|
const keyword = ref('')
|
|
|
+const roomType = ref(roomStore.roomStatus)
|
|
|
+
|
|
|
+watch(
|
|
|
+ () => roomType,
|
|
|
+ val => {
|
|
|
+ console.log('roomType', unref(val))
|
|
|
+ switch (unref(val)) {
|
|
|
+ case 0:
|
|
|
+ roomStore.setRoomStatus(0)
|
|
|
+ break
|
|
|
+ case 1:
|
|
|
+ roomStore.setRoomStatus(1)
|
|
|
+ break
|
|
|
+ case 2:
|
|
|
+ roomStore.setRoomStatus(2)
|
|
|
+ break
|
|
|
+ default:
|
|
|
+ roomStore.setRoomStatus(0)
|
|
|
+ break
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ deep: true,
|
|
|
+ immediate: true
|
|
|
+ }
|
|
|
+)
|
|
|
const roomList = computed(() =>
|
|
|
- roomStore.roomStatus === 1
|
|
|
+ roomStore.roomStatus !== 2
|
|
|
? [addMarked, ...roomStore.filter(keyword.value)]
|
|
|
: roomStore.filter(keyword.value)
|
|
|
)
|
|
@@ -305,11 +339,30 @@ const headerVisible = useVisible({
|
|
|
opacity: 1;
|
|
|
}
|
|
|
}
|
|
|
+.header-title-tab {
|
|
|
+ display: flex;
|
|
|
+ flex: 1;
|
|
|
+ flex-direction: row;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding-right: 30px;
|
|
|
+}
|
|
|
</style>
|
|
|
|
|
|
-<style>
|
|
|
+<style lang="scss">
|
|
|
.room-search,
|
|
|
.room-search input {
|
|
|
background: #f7f8fa;
|
|
|
}
|
|
|
+.select-group {
|
|
|
+ .ant-radio-button-wrapper {
|
|
|
+ &:nth-child(1) {
|
|
|
+ border-top-left-radius: 15px;
|
|
|
+ border-bottom-left-radius: 15px;
|
|
|
+ }
|
|
|
+ &:nth-child(3) {
|
|
|
+ border-top-right-radius: 15px;
|
|
|
+ border-bottom-right-radius: 15px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|