微信小程序 open-data更改样式 open-data 显示头像 圆形(转载)

效果一:

代码如下:

复制代码

    <view class='zhubo'>
      <view class='zhuboLeft'>
        <view class='zhubo-avater'>
          <image class='zhuboIcon' src='../../image/video-list/avater.jpg'></image>
        </view>
        <view class='zhuboDes'>
          <view class='zhubo-name'>东辰-寒冰</view>
          <view class='zhubo-from'>来自虎牙直播</view>
        </view>
      </view>
      <view class='zhubo-Right'>关注</view>
    </view>

复制代码

复制代码

/*主播信息  */
.zhubo{
  margin: 0 28rpx 0;
  height: 144rpx;
  display:flex;
  justify-content:space-between;
  align-items: center;
}
.zhuboIcon{
  width:80rpx;
  height: 80rpx;
  border-radius: 50%;
  overflow: hidden;
}
.zhuboLeft{
  display: flex;
}
.zhubo-avater{
  padding-right: 20rpx;
  display: flex;
  align-items: center;
}
.zhubo-name{
  font-weight: 700;
}
.zhubo-from{
  color: #A6A6A6;
}

复制代码

效果二:

复制代码

<view class="userinfo">
  <view class="userinfo-avatar">
    <open-data  type="userAvatarUrl"></open-data>
  </view>
    <open-data type="userNickName"></open-data>
</view>

复制代码

复制代码

.userinfo {  
  position: relative;  
  width: 750rpx;  
  height: 320rpx;  
  color: #fff;  
  display: flex;  
  flex-direction: column;  
  align-items: center;  
}  
  
.userinfo-avatar {  
  overflow:hidden;  
  display: block;  
  width: 160rpx;  
  height: 160rpx;  
  margin: 20rpx;  
  margin-top: 50rpx;  
  border-radius: 50%;  
  border: 2px solid #fff;  
  box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2);  
}  
  
.userinfo{  
  /* color: #fff; */  
  font-size: 14px;  
  background-color: #c0c0c0;  
  border-radius:40%;  
}  

复制代码

猜你喜欢

转载自blog.csdn.net/qq_36935391/article/details/90736572