<template name="login">
  <block wx:if="{{!userInfo.isLogin}}">

    <view class="login-inner">
      <image class="avatar" src="../../images/gravatar.png"></image>
      <view class="username">
        <text>立即登录，体验更多功能</text>
      </view>
    </view>

    <view class="login-btn-box">
      <button class="login-btn" bindtap="closeLoginPopup">取消</button>
      <button class="login-btn" open-type="getUserInfo" bindgetuserinfo="agreeGetUser">确定</button>
    </view>

  </block>
  <block wx:else>
    <view class="login-inner">
      <image class="avatar" src="{{userInfo.avatarUrl}}"></image>
      <view class="username">
        <text>{{userInfo.nickName}}</text>
      </view>
    </view>
  </block>
</template>