IntegralHeader.vue
3.5 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<script lang="ts" setup name="IntegralHeader">
// $import
import { ref, onMounted, defineProps } from "vue";
import { useStore } from "vuex";
import { useRouter, useRoute } from "vue-router";
import { default as _ } from "lodash";
import { events } from "@/until/eventBus";
// $import
// $props
const props = withDefaults(
defineProps<{
pointsInfo: any;
callback?: (data: any) => void;
}>(),
{
pointsInfo: () => ({}),
callback: () => {},
}
);
// $props
// $data
const route = useRoute();
const router = useRouter();
const store = useStore();
const bus = events;
const common_data = ref(store.state.common_data);
const page_width = ref(769);
// $data
// $methods
const backRoute = () => {
router.back();
};
// $methods
// $lifecycle
onMounted(async () => {
page_width.value = document.querySelector('.integral-header-component')?.clientWidth || 769;
});
// $lifecycle
</script>
<template>
<div
class="integral-header-component"
:style="`padding-top:${common_data.appHeight}px;`"
>
<div :style="`height:${common_data.appHeight}px; max-width: ${page_width}px`" class="temp-box"></div>
<div
id="integral-header"
:style="`margin-top:${common_data.appHeight}px; max-width: ${page_width}px`"
>
<div class="tool-left">
<span class="back" @click="backRoute"
><svg-icon iconName="back"></svg-icon
></span>
</div>
<div class="center-content">
<div
class="logo"
:style="`background-image: url(${props.pointsInfo.logo});`"
></div>
<h3 class="title">
{{ props.pointsInfo.competition_name || "无数据" }}
</h3>
<h5 class="title-en">
{{ props.pointsInfo.competition_name_en || "no data" }}
</h5>
</div>
</div>
<div
class="reserve-box"
:class="!['/live_attention'].includes(route.path) ? '' : 'attention-box'"
></div>
</div>
</template>
<style lang="scss">
.integral-header-component {
position: relative;
background-color: #ebf4fe;
overflow: hidden;
max-width: 100%;
#integral-header,.temp-box {
z-index: 9998;
position: fixed;
top: 0;
width: 100%;
min-width: 320px !important;
overflow: hidden;
color: #000;
background-color: #eaf4fe;
}
#integral-header {
height: 58px;
display: flex;
align-items: center;
justify-content: center;
.tool-left {
display: flex;
cursor: pointer;
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
span {
padding: 12px;
display: flex;
justify-content: center;
align-items: center;
font-size: 14px;
line-height: 20px;
svg {
display: inline-block;
}
}
}
.center-content {
position: relative;
text-align: center;
padding-left: 50px;
.title {
height: 26px;
line-height: 26px;
font-size: 18px;
font-weight: 500;
}
.title-en {
font-weight: 500;
}
.logo {
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 44px;
height: 44px;
flex-grow: 0;
flex-shrink: 0;
background-repeat: no-repeat;
background-size: contain;
background-position: 50%;
}
}
}
.reserve-box {
width: 100%;
min-height: 58px;
background-color: #eaf4fe;
}
.attention-box {
width: 100%;
height: 160px;
}
}
</style>