<template>
|
<view class="container">
|
<view class="card">
|
<u-cell-group>
|
<u-cell title="昵称" :value="user.nickName">
|
<template #icon>
|
<u-icon name="account" size="18" />
|
</template>
|
</u-cell>
|
<u-cell title="手机号码" :value="user.phonenumber">
|
<template #icon>
|
<u-icon name="phone" size="18" />
|
</template>
|
</u-cell>
|
<u-cell title="邮箱" :value="user.email">
|
<template #icon>
|
<u-icon name="email" size="18" />
|
</template>
|
</u-cell>
|
<u-cell title="岗位" :value="postGroup">
|
<template #icon>
|
<u-icon name="star" size="18" />
|
</template>
|
</u-cell>
|
<u-cell title="角色" :value="roleGroup">
|
<template #icon>
|
<u-icon name="account-circle" size="18" />
|
</template>
|
</u-cell>
|
<u-cell title="创建日期" :value="user.createTime">
|
<template #icon>
|
<u-icon name="calendar" size="18" />
|
</template>
|
</u-cell>
|
</u-cell-group>
|
</view>
|
|
<!-- <u-button @click="register()">绑定微信</u-button> -->
|
</view>
|
</template>
|
|
<script setup>
|
import { getUserProfile } from "@/api/system/user"
|
import { ref } from "vue";
|
import modal from "@/plugins/modal"
|
|
const user = ref({})
|
const roleGroup = ref("")
|
const postGroup = ref("")
|
function getUser() {
|
getUserProfile().then(response => {
|
user.value = response.data
|
roleGroup.value = response.roleGroup
|
postGroup.value = response.postGroup
|
})
|
}
|
getUser()
|
|
import { wxRegister } from "@/api/oauth"
|
import { getWxCode } from "@/utils/geek"
|
function register(){
|
modal.loading('绑定微信中...')
|
getWxCode().then(res=>{
|
wxRegister('miniapp',res).then(res=>{
|
modal.closeLoading()
|
})
|
})
|
|
}
|
|
</script>
|
|
<style lang="scss">
|
/* 背景更柔和,卡片更突出 */
|
page {
|
background-color: #f5f7fb;
|
}
|
|
.container {
|
min-height: 100vh;
|
padding: 0;
|
box-sizing: border-box;
|
}
|
|
/* 列表卡片容器 */
|
.card {
|
background-color: #ffffff;
|
box-shadow: 0 0.375rem 1rem rgba(0, 0, 0, 0.06);
|
overflow: hidden;
|
}
|
|
/* 适配 uview-plus Cell */
|
:deep(.u-cell) {
|
min-height: 3rem;
|
align-items: center;
|
}
|
|
:deep(.u-cell__title) {
|
font-weight: 500;
|
color: #1f2937;
|
}
|
|
:deep(.u-cell__value) {
|
color: #6b7280;
|
}
|
</style>
|