edu/app/src/components/widgets/user-info/user-info.vue

52 lines
1.5 KiB
Vue
Raw Normal View History

2022-09-08 08:28:56 +00:00
<template>
2022-09-09 07:59:18 +00:00
<view class="user-info flex px-[50rpx] justify-between py-[50rpx]">
2022-09-08 08:28:56 +00:00
<navigator
v-if="isLogin"
class="flex items-center"
hover-class="none"
2022-09-09 06:44:55 +00:00
url="/pages/user_data/user_data"
2022-09-08 08:28:56 +00:00
>
<u-avatar :src="user.avatar" :size="120"></u-avatar>
2022-09-09 07:59:18 +00:00
<view class="text-white ml-[20rpx]">
<view class="text-2xl">{{ user.nickname }}</view>
<view class="text-xs mt-[18rpx]">账号{{ user.username }}</view>
</view>
2022-09-08 08:28:56 +00:00
</navigator>
<navigator v-else class="flex items-center" hover-class="none" url="/pages/login/login">
<u-avatar src="/static/images/user/default_avatar.png" :size="120"></u-avatar>
2022-09-09 07:59:18 +00:00
<view class="text-white text-3xl ml-[20rpx]">未登录</view>
2022-09-08 08:28:56 +00:00
</navigator>
2022-09-09 06:44:55 +00:00
<navigator v-if="isLogin" hover-class="none" url="/pages/user_set/user_set">
<u-icon name="setting" color="#fff" :size="58"></u-icon>
</navigator>
2022-09-09 07:59:18 +00:00
</view>
2022-09-08 08:28:56 +00:00
</template>
<script lang="ts" setup>
const props = defineProps({
content: {
type: Object,
default: () => ({})
},
styles: {
type: Object,
default: () => ({})
},
user: {
type: Object,
default: () => ({})
},
isLogin: {
type: Boolean
}
})
</script>
<style lang="scss" scoped>
.user-info {
background: url(/static/images/user/my_topbg.png);
height: 115px;
background-position: bottom;
background-size: 100% auto;
}
</style>