<!--index.wxml-->
<view class="container">
    <view class="userinfo">
        <block wx:if="{{canIUseOpenData}}">
            <view class="userinfo-avatar" bindtap="bindViewTap">
                <open-data type="userAvatarUrl"></open-data>
            </view>
            <open-data type="userNickName"></open-data>
        </block>
        <block wx:elif="{{!hasUserInfo}}">
            <button wx:if="{{canIUseGetUserProfile}}" bindtap="getUserProfile"> 获取头像昵称 </button>
            <button wx:elif="{{canIUse}}" open-type="getUserInfo" bindgetuserinfo="getUserInfo"> 获取头像昵称 </button>
            <view wx:else> 请使用1.4.4及以上版本基础库 </view>
        </block>
        <block wx:else>
            <image bindtap="bindViewTap" class="userinfo-avatar" src="{{userInfo.avatarUrl}}" mode="cover"></image>
            <text class="userinfo-nickname">{{userInfo.nickName}}</text>
        </block>

    </view>
    <!--个人设置-->
    <view>
        <view style="margin-top: 120rpx;">
            <van-cell icon="friends-o" title="浏览历史" url='/pages/joinedPage/index' size='large' is-link />
        </view>
        <view style="margin-top: 60rpx;">
            <van-cell icon="browsing-history-o" url='/pages/carePage/index' title="我的关注" size='large' is-link />
        </view>
        <view style="margin-top: 60rpx;">
            <van-cell icon="home-o" title="我的发布" url='/pages/postPage/index' size='large' is-link />
        </view>
    </view>

</view>