|
@@ -3,10 +3,10 @@
|
|
|
<!-- 头部 -->
|
|
|
<view class="user-head">
|
|
|
<view class="user-photo">
|
|
|
- <u-image width="90rpx" shape="circle" height="90rpx" :src="src"></u-image>
|
|
|
+ <u-image width="90rpx" shape="circle" height="90rpx" :src="userInfo&&userInfo.avatarUrl"></u-image>
|
|
|
</view>
|
|
|
<view class="user-info">
|
|
|
- 李磊
|
|
|
+ {{userInfo&&userInfo.nickName}}
|
|
|
</view>
|
|
|
</view>
|
|
|
<!-- 列表 -->
|
|
@@ -29,9 +29,21 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- src: 'https://cdn.uviewui.com/uview/example/fade.jpg'
|
|
|
+ userInfo: {
|
|
|
+ avatarUrl:'',
|
|
|
+ nickName:''
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
+ onLoad() {
|
|
|
+ let _this = this
|
|
|
+ uni.getUserInfo({
|
|
|
+ success(e) {
|
|
|
+ console.log(e)
|
|
|
+ _this.userInfo = e.userInfo
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
methods:{
|
|
|
// 打开对应的页面
|
|
|
toPage(index){
|