<template>
|
<view class="container">
|
<view class="card">
|
<van-cell-group inset>
|
<van-cell icon="user" title="昵称" :value="user.nickName" />
|
<van-cell icon="phone" title="手机号码" :value="user.phonenumber" />
|
<van-cell icon="invitation" title="邮箱" :value="user.email" />
|
<van-cell icon="medal" title="岗位" :value="postGroup" />
|
<van-cell icon="friends" title="角色" :value="roleGroup" />
|
<van-cell icon="notes" title="创建日期" :value="user.createTime" />
|
</van-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.75rem; /* 24rpx -> 0.75rem */
|
box-sizing: border-box;
|
}
|
|
/* 列表卡片容器 */
|
.card {
|
background-color: #ffffff;
|
border-radius: 0.625rem; /* 20rpx -> 0.625rem */
|
box-shadow: 0 0.375rem 1rem rgba(0, 0, 0, 0.06); /* 0 12rpx 32rpx -> 0 0.375rem 1rem */
|
overflow: hidden;
|
}
|
|
/* 适配 Vant Cell */
|
:deep(.van-cell) {
|
min-height: 2.875rem; /* 92rpx -> 2.875rem */
|
}
|
|
:deep(.van-cell__title) {
|
font-weight: 500;
|
color: #1f2937; /* 深灰 */
|
}
|
|
:deep(.van-cell__value) {
|
color: #6b7280; /* 次要灰 */
|
}
|
|
/* 移除不再使用的 .cell-icon 样式 */
|
</style>
|