|
|
|
|
@ -2,6 +2,7 @@
|
|
|
|
|
<div
|
|
|
|
|
ref="button"
|
|
|
|
|
class="draggable-button"
|
|
|
|
|
id="draggable-button"
|
|
|
|
|
@mousedown="dragButton"
|
|
|
|
|
@touchstart="dragButton"
|
|
|
|
|
>
|
|
|
|
|
@ -11,13 +12,13 @@
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
import { ref, onMounted, onBeforeUnmount } from "vue";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const button = ref(null);
|
|
|
|
|
let startX, startY, posX, posY, mouseMoveTracker, mouseUpTracker;
|
|
|
|
|
|
|
|
|
|
const goHome = () => {
|
|
|
|
|
console.log(11);
|
|
|
|
|
uni.reLaunch({ url: '/pages/main/index/index' })
|
|
|
|
|
uni.reLaunch({ url: "/pages/main/index/index" });
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const dragButton = (event) => {
|
|
|
|
|
@ -46,11 +47,15 @@ const dragButton = (event) => {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
document.body.appendChild(button.value);
|
|
|
|
|
if (!button.value) {
|
|
|
|
|
document.body.appendChild(button.value);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
onBeforeUnmount(() => {
|
|
|
|
|
document.body.removeChild(button.value);
|
|
|
|
|
if (button.value) {
|
|
|
|
|
document.body.removeChild(button.value);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|