| | |
| | | <view class="content"> |
| | | <view class="user" @click="setUser"> |
| | | <view class="userImg"> |
| | | <image :src="userInfo?.headImg" mode="widthFix"></image> |
| | | <image :src="userInfo?.headImg ? userInfo.headImg : defaultImg" mode="widthFix"></image> |
| | | </view> |
| | | <view class="info"> |
| | | <text class="name">{{userInfo?.nickName}}</text> |
| | | <text class="name">{{userInfo?.nickName ? userInfo.nickName : '用户'}}</text> |
| | | </view> |
| | | </view> |
| | | <view class="typeList"> |
| | |
| | | |
| | | <script setup> |
| | | import { onMounted, ref } from "vue"; |
| | | import { onShow } from "@dcloudio/uni-app" |
| | | import defaultImg from '../../static/images/default-head.png' |
| | | |
| | | const topHeight = ref(0) |
| | | const userInfo = ref() |
| | |
| | | }) |
| | | } |
| | | |
| | | onShow(() => { |
| | | userInfo.value = JSON.parse(uni.getStorageSync('userInfo')) |
| | | }) |
| | | |
| | | onMounted(() => { |
| | | getTopHeight() |
| | | userInfo.value = JSON.parse(uni.getStorageSync('userInfo')) |
| | | }) |
| | | </script> |
| | | |
| | |
| | | height: 80rpx; |
| | | image{ |
| | | width: 100%; |
| | | height: 100%; |
| | | border-radius: 50%; |
| | | } |
| | | } |