index.vue
1.42 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
<!--
* @Author: hookehuyr hookehuyr@gmail.com
* @Date: 2022-05-31 18:32:38
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-07-01 17:58:30
* @FilePath: /tswj/src/components/DonateBar/index.vue
* @Description: 爱心助力底部固定栏
-->
<template>
<div class="fix-btn">
<div class="text" @click="showDonate=true">
<slot />
</div>
</div>
<donate-flower
:show-popup="showDonate"
:item="donateInfo"
@on-close="showDonate=false"
/>
</template>
<script setup>
import { ref, onMounted } from 'vue'
import { DonateFlower } from '@/utils/generateModules'
import { prepareDonateAPI } from '@/api/C/donate.js'
const props = defineProps({
perfId: Number,
kgId: {
type: String,
default: ''
}
})
const donateInfo = ref({})
const showDonate = ref(false);
onMounted(async () => {
const { data } = await prepareDonateAPI({ perf_id: props.perfId, kg_id: props.kgId });
donateInfo.value = data;
})
</script>
<style lang="less" scoped>
.fix-btn {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background-color: white;
box-shadow: 0px -2px 4px 0px rgba(0, 0, 0, 0.07);
.text {
text-align: center;
padding: 0.7rem;
margin: 1.2rem;
font-size: 1rem;
font-weight: bold;
border-radius: 24px;
// border: 1px solid F7F7F7;
color: @base-font-color;
background-color: @base-color;
box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.06);
}
}
</style>