|
@@ -0,0 +1,88 @@
|
|
|
+<template>
|
|
|
+ <div
|
|
|
+ v-show="isShow"
|
|
|
+ class="operation-tip"
|
|
|
+ :class="{
|
|
|
+ 'animation-show-hide': isShow,
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ v-if="props.text"
|
|
|
+ class="text"
|
|
|
+ >
|
|
|
+ {{ props.text }}
|
|
|
+ </div>
|
|
|
+ <img
|
|
|
+ class=""
|
|
|
+ :src="require(`@/assets/images/icon_operation_${props.direction}_${props.color}.png`)"
|
|
|
+ alt=""
|
|
|
+ draggable="false"
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import useSizeAdapt from "@/useFunctions/useSizeAdapt"
|
|
|
+import { ref, computed, watch, onMounted, inject } from "vue"
|
|
|
+import { useRoute, useRouter } from "vue-router"
|
|
|
+import { useStore } from "vuex"
|
|
|
+
|
|
|
+const route = useRoute()
|
|
|
+const router = useRouter()
|
|
|
+const store = useStore()
|
|
|
+
|
|
|
+const $env = inject('$env')
|
|
|
+
|
|
|
+const {
|
|
|
+ windowSizeInCssForRef,
|
|
|
+ windowSizeWhenDesignForRef,
|
|
|
+} = useSizeAdapt()
|
|
|
+
|
|
|
+const props = defineProps({
|
|
|
+ direction: {
|
|
|
+ type: String,
|
|
|
+ default: 'v', // h
|
|
|
+ },
|
|
|
+ color: {
|
|
|
+ type: String,
|
|
|
+ default: 'white', // 'green'
|
|
|
+ },
|
|
|
+ text: {
|
|
|
+ type: String,
|
|
|
+ default: '',
|
|
|
+ },
|
|
|
+ isShow: {
|
|
|
+ type: Boolean,
|
|
|
+ default: true,
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+const isShow = ref(true)
|
|
|
+let blinkCount = 0
|
|
|
+const intervalId = setInterval(() => {
|
|
|
+ blinkCount++
|
|
|
+ if (blinkCount >= 3 || !props.isShow) {
|
|
|
+ isShow.value = false
|
|
|
+ clearInterval(intervalId)
|
|
|
+ }
|
|
|
+}, 1500)
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+.operation-tip{
|
|
|
+ position: fixed;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ >.text{
|
|
|
+ color: v-bind('props.color');
|
|
|
+ margin-right: calc(5 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
|
|
|
+ font-family: KaiTi, KaiTi;
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: calc(16 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
|
|
|
+ }
|
|
|
+ >img{
|
|
|
+ width: calc(40 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
|
|
|
+ height: calc(41 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|