xuruiqian
2025-02-25 e85ab165147c37b571ea67ce6f6ae9ae55a96070
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
<template>
    <view class="content">
        <view class="my-info">
            <view class="avatar">
                <up-avatar :src="userStore.userinfo.avatarurl" size="70" @click="userProfileShow = true"></up-avatar>
            </view>
            <view class="user-name">
                <view>
                    <text>{{ userStore.userinfo.nickname }}</text>
                </view>
                <!-- <view>
                    <text class="info-text">{{ userStore.schoolName }}</text>
                </view> -->
                <!-- <view>
                    <text class="info-text">{{ userStore.collegeName }}</text>
                </view>
                <view>
                    <text class="info-text">{{ userStore.majorName }}</text>
                </view> -->
            </view>
            <!--             
            <view class="name">
                
            </view> -->
 
        </view>
        <view class="menu">
            <u-cell-group>
                <u-cell iconStyle="color:#52ba9d" icon="file-text-fill" title="我的题库" isLink
                    url="/pages/my/myquestion"></u-cell>
                <!-- <u-cell iconStyle="color:#1684fc" icon="integral-fill" title="VIP" isLink :value="vipTerm"
                        url="/pages/my/vip"></u-cell> -->
                <u-cell iconStyle="color:#52ba9d" icon="rmb-circle-fill" title="充值" :value="balance" isLink
                    url="/pages/my/recharge"></u-cell>
                <!-- <u-cell iconStyle="color:#1684fc" icon="phone-fill" title="手机绑定" :value="phone" isLink
                        url="/pages/my/phnoe"></u-cell> -->
                <u-cell iconStyle="color:#52ba9d" icon="setting-fill" title="设置" isLink url="/pages/my/setting"></u-cell>
                <u-cell iconStyle="color:#52ba9d" icon="share-square" title="分享" isLink url="/pages/my/share"></u-cell>
            </u-cell-group>
        </view>
        <u-popup :show="userProfileShow" @close="userProfileShow = false">
            <view class="info">
                <UserProfile @saveCB="userProfileCB" />
            </view>
        </u-popup>
    </view>
</template>
 
<script>
import { ref, reactive, toRefs, onMounted } from "vue";
import { useBasicInfoStore } from "../../store/basicInfo"
import UserProfile from "../../components/userProfile/userProfile.vue"
 
export default {
    components: { UserProfile },
    setup() {
        const userStore = useBasicInfoStore()
        const state = reactive({
            // vipTerm: '未开通',
            balance: '',
            phone: '',
            userProfileShow: false,
        })
 
        onMounted(() => {
            Init();
        });
 
        const Init = () => {
            // if (userStore.vip) {
            //     state.vipTerm = "有效期 " + userStore.vipTerm
            // }
            // state.balance = "余额 " + userStore.balance
            // if (userStore.phone) {
            //     state.phone = userStore.phone.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2");
            // } else {
            //     state.phone = "未绑定 "
            // }
        }
 
        const userProfileCB = () => {
            console.log('成功999')
            // uni.navigateTo({
            //     url: '/pages/index/index'
            // });
            state.userProfileShow = false
        }
 
 
        return { ...toRefs(state), userStore, userProfileCB }
    }
}
 
</script>
 
<style scoped lang="scss">
.center {
    display: flex;
    flex-direction: column;
    align-items: center;
    //justify-content: center;
}
 
.content {
    @extend .center;
    //background-color: #f5efd9;
    height: 100vh;
    width: 100%;
}
 
.my-info {
    // @extend .center;
    height: 15vh;
    width: 100%;
    background-color: #52ba9d;
    padding-top: 5vh;
    display: flex;
    justify-content: flex-start;
 
    .avatar {
        width: 70px;
        height: 70px;
        margin-left: 35rpx;
    }
 
    .user-name {
        line-height: 70px;
        color: #fff;
        margin-left: 35rpx;
    }
 
    .info-text {
        font-size: 12px;
        color: gray;
    }
}
 
.menu {
    @extend .center;
    height: 50vh;
    width: 100%;
    margin-top: 3vh;
 
    ::v-deep .u-cell-group {
        width: 90%;
        margin: 0 rpx auto;
    }
}
 
.info {
    width: 100%;
    //height: 15vh;
    overflow: auto;
    border-radius: 10px;
    background-color: #fff;
    margin-top: 5vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
</style>