deming/components/index/daren-item/index.vue
zmr900709 2a62b100fb v
2020-07-20 17:14:18 +08:00

85 lines
1.9 KiB
Vue

<template>
<view class="daren-item" @click="toDetailsPage">
<image class="head" :src="info.member_avatar"></image>
<text class="name">{{ info.member_nickname }}</text>
<text class="zhuangtai">状态: {{ info.live_status == 1 ? '正在直播' : '未开播' }}</text>
<view class="guanzhu" @tap="changeType(info.member_id)" v-if="info.is_attention == 1">关注</view>
<view class="guanzhu action" @tap="changeType(info.member_id)" v-else >未关注</view>
</view>
</template>
<script>
export default {
name:"daren-item",
props: {
info: Object,
},
methods: {
toDetailsPage() {
// 判断是否登录
const toke = uni.getStorageSync('token');
if (toke) {
console.log(toke);
}else{
uni.navigateTo({
url: '/pageA/login/login'
})
}
// this.$u.route({
// url: '',
// params: {
// name: 'lisa'
// }
// })
},
changeType:function(type){
console.log("111")
this.$emit("pChangeType",type)
},
},
}
</script>
<style lang="scss" scoped>
.daren-item{
width: 215rpx;
height: 282rpx;
display: flex;
flex-direction: column;
align-items: center;
background-color: #fff;
border-radius: 10rpx;
overflow: hidden;
.head{
width: 80rpx;
height: 80rpx;
border-radius: 50%;
margin-top: 24rpx;
background-color: #0f0;
}
.name{
font-size: 26rpx;
color: #333;
font-weight: 400;
margin-top: 23rpx;
}
.zhuangtai{
font-size:22rpx;
color: #999;
margin-top: 19rpx;
}
.guanzhu{
width: 130rpx;
height: 50rpx;
background-color: #FF780F;
font-size: 26rpx;
line-height: 50rpx;
color: #fff;
text-align: center;
margin-top: 19rpx;
border-radius: 25rpx;
}
.action{
background: #f3f3f3;
}
}
</style>