退出房间规则修改
This commit is contained in:
@@ -284,7 +284,7 @@ onMounted(() => {
|
|||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
uni.$off("socket-inbox", onReceiveMessage);
|
uni.$off("socket-inbox", onReceiveMessage);
|
||||||
if (owner.value.id !== user.value.id) {
|
if (owner.value.id !== user.value.id && !battleId.value) {
|
||||||
exitRoomAPI(roomNumber.value);
|
exitRoomAPI(roomNumber.value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -433,13 +433,22 @@ onUnmounted(() => {
|
|||||||
</ScreenHint>
|
</ScreenHint>
|
||||||
<SModal :show="showModal" :onClose="() => (showModal = false)">
|
<SModal :show="showModal" :onClose="() => (showModal = false)">
|
||||||
<view class="btns">
|
<view class="btns">
|
||||||
<SButton :onClick="exitRoom" width="200px" :rounded="20">
|
<block v-if="!battleId">
|
||||||
暂时离开
|
<SButton :onClick="exitRoom" width="200px" :rounded="20">
|
||||||
</SButton>
|
暂时离开
|
||||||
<view :style="{ height: '20px' }"></view>
|
</SButton>
|
||||||
<SButton :onClick="destroyRoom" width="200px" :rounded="20">
|
<block v-if="owner.id === user.id">
|
||||||
解散房间
|
<view :style="{ height: '20px' }"></view>
|
||||||
</SButton>
|
<SButton :onClick="destroyRoom" width="200px" :rounded="20">
|
||||||
|
解散房间
|
||||||
|
</SButton>
|
||||||
|
</block>
|
||||||
|
</block>
|
||||||
|
<block v-else>
|
||||||
|
<SButton :onClick="exitRoom" width="200px" :rounded="20">
|
||||||
|
退出比赛
|
||||||
|
</SButton>
|
||||||
|
</block>
|
||||||
</view>
|
</view>
|
||||||
</SModal>
|
</SModal>
|
||||||
</Container>
|
</Container>
|
||||||
@@ -537,13 +546,4 @@ onUnmounted(() => {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
/* .btns > button {
|
|
||||||
color: #000;
|
|
||||||
background-color: #fed847;
|
|
||||||
padding: 10px;
|
|
||||||
width: 200px;
|
|
||||||
border-radius: 20px;
|
|
||||||
font-size: 14px;
|
|
||||||
margin: 10px;
|
|
||||||
} */
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user