zhengyiming
2025-02-10 0f686ea1fe4700a909a6159efcf1fcb0e1f88a17
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>
  <nut-button class="bole-float-button" plain type="primary" :style="{ bottom: `${bottom}px` }">
    <img :src="icon" class="bole-float-button-icon" />
    <div class="bole-float-button-text">{{ text }}</div>
  </nut-button>
</template>
 
<script setup lang="ts">
import IconAdd from '@/assets/order/icon-note.png';
import { useSystemStore } from '@/stores/modules/system';
 
defineOptions({
  name: 'FloatButton',
});
 
type Props = {
  text?: string;
  icon?: string;
};
 
const props = withDefaults(defineProps<Props>(), {
  icon: IconAdd,
});
 
const systemStore = useSystemStore();
 
const bottom = computed(() => systemStore.bottomNavHeight + systemStore.IPhoneXPadding + 60);
</script>
 
<style lang="scss">
@import '@/styles/common.scss';
 
:root,
page {
  .bole-float-button {
    position: fixed;
    height: 56px;
    right: 20px;
    font-size: 0;
    padding: 0 20px;
    background-color: #484d61 !important;
    border: none;
 
    .nut-button__warp {
      & > div {
        font-size: 0;
      }
    }
 
    .bole-float-button-icon {
      width: 28px;
      height: 28px;
      display: inline-block;
      vertical-align: middle;
      margin-right: 4px;
    }
 
    .bole-float-button-text {
      display: inline-block;
      font-size: 24px;
      line-height: 1;
      vertical-align: middle;
      color: #fff;
    }
  }
}
</style>