web
2025-07-01 c7f03d9e2748f70455a3c705e0c5a174ced4e115
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
<template>
    <view class="user" :style="{paddingTop:topHeight + 'rpx'}">
        <view class="content">
            <view class="userInfo">
                <view class="userImg">
                    <image src="/static/images/login/wx.png" mode="widthFix"></image>
                </view>
                <view class="info">
                    <view class="name">张三</view>
                    <view class="balance">余额:233.5</view>
                </view>
            </view>
            <view class="typeList">
                <view class="typeItem">
                    <view class="name">充值记录</view>
                    <uni-icons type="right" size="20"></uni-icons>
                </view>
            </view>
            <view class="loginOut">
                <button type="primary" plain>退出登录</button>
            </view>
        </view>
    </view>
</template>
 
<script setup>
    import { onMounted, ref } from "vue";
    
    const topHeight = ref(0)
    
    // 获取状态栏高度
    function getTopHeight(){
        if(uni.getMenuButtonBoundingClientRect){
            topHeight.value = uni.getMenuButtonBoundingClientRect().bottom * 2
        }
    }
    
    onMounted(() => {
        getTopHeight()
    })
</script>
 
<style lang="scss" scoped>
    .content{
        padding: 20rpx;
        .userInfo{
            display: flex;
            align-items: center;
            padding: 40rpx;
            background: linear-gradient(90deg, #CCCCCC, #CCFFFF);
            border-radius: 20rpx;
            .userImg{
                flex-shrink: 0;
                width: 100rpx;
                height: 100rpx;
                margin-right: 40rpx;
                image{
                    width: 100%;
                    border-radius: 10rpx;
                }
            }
            .info{
                flex-grow: 1;
                font-size: 36rpx;
                .balance{
                    font-weight: bold;
                }
            }
        }
        .typeList{
            margin-top: 30rpx;
            .typeItem{
                padding: 20rpx 0;
                border-bottom: 1rpx solid #dddddd;
                display: flex;
                justify-content: space-between;
                align-items: center;
            }
        }
        .loginOut{
            margin-top: 400rpx;
            // button{
            //     color: $uni-base-color;
            //     border-color: $uni-base-color;
            // }
        }
    }
</style>