模拟射箭添加环境判断
This commit is contained in:
@@ -20,6 +20,7 @@ const arrow = ref({});
|
||||
const power = ref(0);
|
||||
const distance = ref(0);
|
||||
const debugInfo = ref("");
|
||||
const showsimul = ref(false);
|
||||
|
||||
async function onReceiveMessage(messages = []) {
|
||||
messages.forEach((msg) => {
|
||||
@@ -39,6 +40,9 @@ const simulShoot = async () => {
|
||||
onMounted(() => {
|
||||
checkConnection();
|
||||
uni.$on("socket-inbox", onReceiveMessage);
|
||||
const accountInfo = uni.getAccountInfoSync();
|
||||
const envVersion = accountInfo.miniProgram.envVersion;
|
||||
if (envVersion !== "release") showsimul.value = true;
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
@@ -84,7 +88,12 @@ onUnmounted(() => {
|
||||
</view>
|
||||
<!-- <view class="debug-text">{{ debugInfo }}</view> -->
|
||||
<view>
|
||||
<view class="simul" @click="simulShoot" :style="{ color: '#fff' }">
|
||||
<view
|
||||
class="simul"
|
||||
@click="simulShoot"
|
||||
:style="{ color: '#fff' }"
|
||||
v-if="showsimul"
|
||||
>
|
||||
模拟射箭
|
||||
</view>
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user