float-yellow-btn.vue
1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<template>
<!-- 纯固定黄色圆形悬浮按钮 -->
<view class="float-btn" @click="openAddTrainPopup">
<view class="column" hover-class="none" hover-stop-propagation="false">
<view class="add" hover-class="none">+</view>
<view class="btn-text">训练</view>
</view>
<AddTrainPopup v-model:visible="showAddTrainPopup" />
</view>
</template>
<script setup>
import { ref, onMounted, watch, computed, nextTick } from 'vue';
import AddTrainPopup from '@/pages/xunji/components/rili-components/add-train-popup.vue'
const showAddTrainPopup = ref(false);
const emit = defineEmits(['click'])
const onClick = () => {
emit('click')
}
// 弹窗控制
const openAddTrainPopup = () => {
showAddTrainPopup.value = true;
};
const closeAddTrainPopup = () => {
showAddTrainPopup.value = false;
};
</script>
<style lang="scss" scoped>
.float-btn {
position: fixed;
right: 11rpx;
bottom: 169rpx;
width: 100rpx;
height: 100rpx;
background-color: #ffcc00;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 8rpx 16rpx rgba(255, 204, 0, 0.3);
z-index: 999;
.column {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.add {
font-size: 32rpx;
font-weight: bold;
}
.btn-text {
font-size: 28rpx;
font-weight: 200;
line-height: 1;
margin-top: 4rpx;
}
}
</style>