myHeader.vue
3.6 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
<template>
<view class="header_box">
<!-- 未登录用户信息 -->
<view v-if="!token" class="userInfo">
<u-avatar src="" size="120rpx"></u-avatar>
<view class="right" @click="goRouter('/pages/login/index')">
<view class="username">登录/注册</view>
</view>
</view>
<!-- 用户信息 -->
<view v-else class="userInfo">
<u-avatar :src="userInfo.avatar" size="120rpx"></u-avatar>
<view class="right">
<view class="username" @click="goRouter('/pages_my/editUserInfo/editUserInfo')">
<text class="col-3d f-28 l-h-38 my-20 m-r-10">猎人事务所</text>
<u-icon name="arrow-right" size="10" color="#333"></u-icon>
</view>
<view class="intro">
<image style="width: 32rpx;" src="@/static/homeImg/QRCode.png" mode="widthFix" @click="showQRcode = true"></image>
</view>
</view>
</view>
<!-- 场地管理 -->
<view class="pay_pitch" @click="goRouter('/pages_my/arenaControl/arenaControl')">
<text>{{ isPay ? '续费门店' : '激活门店' }}</text>
</view>
<text v-show="isPay" class="tip">【剧本杀】2025-06-20到期</text>
<!-- 出示二维码 -->
<u-popup :show="showQRcode" round="20" mode="center" closeable overlayOpacity="0" @close="showQRcode = false">
<view class="QRcode_box">
<view class="QRCoce_img">
<image style="width: 270rpx;height: 270rpx;" src="@/static/homeImg/big_QRCode.png" mode="widthFix"></image>
</view>
<view class="btn">保存二维码</view>
</view>
</u-popup>
</view>
</template>
<script>
import { getUserInfo } from '@/api/user.js'
import { mapGetters } from 'vuex'
export default {
props: {
userInfo: {
type: Object,
require: true
}
},
data() {
return {
isPay: false,
showQRcode: false,
}
},
computed: { ...mapGetters(['token']) },
methods: {
goRouter(path){
uni.navigateTo({
url: path
})
}
}
}
</script>
<style scoped lang="scss">
// 头部盒子
.header_box{
position: relative;
height: 376rpx;
box-sizing: border-box;
background-size: cover;
// 用户信息
.userInfo{
position: absolute;
top: 216rpx;
left: 30rpx;
display: flex;
align-items: center;
z-index: 10;
.right{
display: flex;
flex-direction: column;
justify-content: space-between;
flex: 1;
margin-left: 20rpx;
height: 100%;
font-size: 24rpx;
color: #fff;
.username{
display: flex;
align-items: center;
font-size: 32rpx;
line-height: 48rpx;
font-weight: 500;
}
.intro{
display: flex;
align-items: center;
gap: 4rpx;
}
}
}
// 购买场地
.pay_pitch{
position: absolute;
top: 248rpx;
right: 30rpx;
display: flex;
align-items: center;
justify-content: center;
width: 140rpx;
height: 56rpx;
color: #fff;
font-size: 28rpx;
line-height: 38rpx;
background: linear-gradient( 270deg, #001020 0%, #4A4E64 100%);
border-radius: 8rpx;
clip-path: polygon(0% 0%, 100% 0%, 100% 94%, 50% 100%, 0% 94%);
}
.tip{
position: absolute;
top: 306rpx;
right: 30rpx;
font-size: 20rpx;
line-height: 26rpx;
color: #3d3d3d;
}
// 显示二维码
.QRcode_box{
width: 500rpx;
height: 550rpx;
background: #FFFFFF;
box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(0,0,0,0.2);
border-radius: 20rpx;
padding: 40rpx;
.QRCoce_img{
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto;
width: 360rpx;
height: 360rpx;
}
.btn{
width: 280rpx;
height: 60rpx;
line-height: 60rpx;
background: #FFB336;
border-radius: 12rpx;
text-align: center;
color: #fff;
font-size: 28rpx;
margin: 0 auto;
}
}
}
</style>