mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-07 01:46:44 +08:00
排行榜接口对接
This commit is contained in:
105
components/author-img/author-img.vue
Normal file
105
components/author-img/author-img.vue
Normal file
@@ -0,0 +1,105 @@
|
||||
<template>
|
||||
<view class="item-author">
|
||||
<view>
|
||||
<u-avatar v-if="avatar && avatar!=''" shape="circle" :size="40" :src="fileBaseUrl + avatar" ></u-avatar>
|
||||
<view v-else>
|
||||
<view v-if="sex == null" class="peo"></view>
|
||||
<view v-else>
|
||||
<view class="peo" v-if="sex === 1 "><image src="../../static/images/man.png" alt=""></view>
|
||||
<view class="peo" v-else><image src="../../static/images/woman.png" alt=""></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props:{
|
||||
avatar:{
|
||||
type:String,
|
||||
default:''
|
||||
},
|
||||
name:{
|
||||
type:String,
|
||||
default:''
|
||||
},
|
||||
showInfo:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
},
|
||||
showCode:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
},
|
||||
info:{
|
||||
type:String,
|
||||
default:''
|
||||
},
|
||||
sex:{
|
||||
type:Number,
|
||||
default:null
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
fileBaseUrl:this.$config.fileUrl,
|
||||
userAvatar:'',
|
||||
// sex:null,
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
avatarText(){
|
||||
let text=this.name;
|
||||
if(text){
|
||||
let len=text.length;
|
||||
if(text.length>2){
|
||||
text=text.substring(len-2);
|
||||
}
|
||||
}
|
||||
return text;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.userAvatar=this.avatar;
|
||||
},
|
||||
watch:{
|
||||
|
||||
},
|
||||
methods:{
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.peo{
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
image{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
.uavatar{
|
||||
border:1px solid #73adfe;
|
||||
background-color: #d9e9ff;
|
||||
color:#73adfe;
|
||||
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
.uavatar-scale{
|
||||
transform:scale(0.8);
|
||||
}
|
||||
}
|
||||
.item-author{
|
||||
font-size: 14upx;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user