mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-08 02:16:46 +08:00
2022年5月29日 从svn移到git
This commit is contained in:
99
components/author/author.vue
Normal file
99
components/author/author.vue
Normal file
@@ -0,0 +1,99 @@
|
||||
<template>
|
||||
<view class="item-author" style="display: flex;">
|
||||
<view>
|
||||
<u-avatar shape="circle" v-if="data.avatar && data.avatar!=''" :size="25" :src="data.avatar"></u-avatar>
|
||||
<view v-else :size="25" :sex="data.sex" random-bg-color >
|
||||
<view v-if="data.sex == null" class="peo"></view>
|
||||
<view v-else>
|
||||
<view class="peo" v-if="data.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>
|
||||
<!-- <u-avatar v-else :size="25" random-bg-color :text="data.name" shape="square"></u-avatar> -->
|
||||
<!-- <view v-else class="uavatar"><view class="uavatar-scale"> {{avatarText}}</view></view> -->
|
||||
<!-- <u-avatar v-else :size="25" icon="account" shape="square"></u-avatar> -->
|
||||
</view>
|
||||
<view style="padding-left:10upx;padding-top: 4upx;font-size: 26upx;color: #666666;">{{data.name || data.sysCreateBy}}</view>
|
||||
<!-- <view v-if="showCode && data.code!=''" style="padding-left: 10upx;padding-top: 10upx;">({{data.code}})</view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props:{
|
||||
data:{
|
||||
type:Object,
|
||||
default(){
|
||||
return {
|
||||
avatar:'',
|
||||
name:'',
|
||||
info:'',
|
||||
code:'',
|
||||
sex:null,
|
||||
}
|
||||
}
|
||||
},
|
||||
showCode:{
|
||||
type:Boolean,
|
||||
default:true
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
//avatarText:''
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
avatarText(){
|
||||
let text=this.data.name || this.data.sysCreateBy;
|
||||
if(text){
|
||||
let len=text.length;
|
||||
if(len>2){
|
||||
text=text.substring(len-2);
|
||||
}
|
||||
}
|
||||
return text;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods:{
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped >
|
||||
.peo{
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
image{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
.uavatar{
|
||||
border:1px solid #73adfe;
|
||||
background-color: #d9e9ff;
|
||||
color:#73adfe;
|
||||
// text-align: center;
|
||||
font-size: 12px;
|
||||
// line-height: 25px;
|
||||
// vertical-align: middle;
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
.uavatar-scale{
|
||||
transform:scale(0.8);
|
||||
}
|
||||
|
||||
}
|
||||
.item-author{
|
||||
font-size: 14upx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user