You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
git/scr/miniprogram-2/pages/usercenter/components/user-center-card/index.wxml

36 lines
1.6 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<view class="user-center-card">
<!-- 未登录的情况 -->
<block wx:if="{{currAuthStep === AuthStepType.ONE}}">
<view class="user-center-card__header" bind:tap="gotoUserEditPage">
<t-avatar image="{{userInfo.avatarUrl || defaultAvatarUrl}}" class="user-center-card__header__avatar" />
<view class="user-center-card__header__name">{{'请登录'}}</view>
</view>
</block>
<!-- 已登录但未授权用户信息情况 -->
<block wx:if="{{currAuthStep === AuthStepType.TWO}}">
<view class="user-center-card__header">
<t-avatar image="{{userInfo.avatarUrl || defaultAvatarUrl}}" class="user-center-card__header__avatar" />
<view class="user-center-card__header__name">{{userInfo.nickName || '微信用户'}}</view>
<!-- 需要授权用户信息通过slot添加弹窗 -->
<view class="user-center-card__header__transparent" wx:if="{{isNeedGetUserInfo}}">
<slot name="getUserInfo" />
</view>
<!-- 不需要授权用户信息仍然触发gotoUserEditPage事件 -->
<view class="user-center-card__header__transparent" bind:tap="gotoUserEditPage" wx:else></view>
</view>
</block>
<!-- 已登录且已经授权用户信息的情况 -->
<block wx:if="{{currAuthStep === AuthStepType.THREE}}">
<view class="user-center-card__header" bind:tap="gotoUserEditPage">
<t-avatar
t-class="avatar"
mode="aspectFill"
class="user-center-card__header__avatar"
image="{{userInfo.avatarUrl || defaultAvatarUrl}}"
/>
<view class="user-center-card__header__name">{{userInfo.nickName || '微信用户'}}</view>
</view>
</block>
</view>