退出房间优化
This commit is contained in:
@@ -7,11 +7,15 @@ const store = useStore();
|
||||
const { device } = storeToRefs(store);
|
||||
const isIos = ref(true);
|
||||
|
||||
defineProps({
|
||||
const props = defineProps({
|
||||
title: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
onBack: {
|
||||
type: Function,
|
||||
default: null,
|
||||
},
|
||||
});
|
||||
|
||||
const simulShoot = async () => {
|
||||
@@ -20,6 +24,11 @@ const simulShoot = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
const onClick = () => {
|
||||
if (props.onBack) props.onBack();
|
||||
else uni.navigateBack();
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
const deviceInfo = uni.getDeviceInfo();
|
||||
isIos.value = deviceInfo.osName === "ios";
|
||||
@@ -28,9 +37,9 @@ onMounted(() => {
|
||||
|
||||
<template>
|
||||
<view class="container" :style="{ paddingTop: isIos ? '35px' : '25px' }">
|
||||
<navigator open-type="navigateBack" class="back-btn">
|
||||
<view class="back-btn" @click="onClick">
|
||||
<image src="../static/back.png" mode="widthFix" />
|
||||
</navigator>
|
||||
</view>
|
||||
<text>{{ title }}</text>
|
||||
<view class="simul" @click="simulShoot">模拟射箭</view>
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user