deming/pageE/mine/MineConcerns.vue

111 lines
2.4 KiB
Vue
Raw Normal View History

2020-06-08 07:23:23 +00:00
<template>
<view class="concerns">
2020-08-03 12:59:24 +00:00
<view class="concerns-container">
2020-08-03 10:38:04 +00:00
<view v-for="(info, index) in list" :key="index">
2020-08-04 13:13:47 +00:00
<view class="daren-item">
2020-08-12 10:38:14 +00:00
<image class="head" :src="info.friend_tomavatar" @click="viewDetails({ id: info.friend_tomid, type: info.role })"></image>
<text class="name" @click="viewDetails({ id: info.friend_tomid, type: info.role })">{{ info.friend_tomname || '' }}</text>
2020-08-04 13:13:47 +00:00
<view class="guanzhu" @click="changeType(info.friend_tomid)" v-if="info.friend_followstate == 1">取消关注</view>
2020-06-08 07:23:23 +00:00
</view>
</view>
2020-08-03 10:38:04 +00:00
</view>
2020-08-04 13:13:47 +00:00
<u-empty mode="list" v-if="!list.length" color="#000" img-width="200" font-size="30" margin-top="120"></u-empty>
2020-06-08 07:23:23 +00:00
</view>
</template>
<script>
export default {
data() {
return {
2020-08-03 12:59:24 +00:00
list: []
}
},
onShow() {
this.attentionMemberList();
},
2020-08-04 13:13:47 +00:00
// 下拉刷新
onPullDownRefresh() {
this.attentionMemberList();
},
2020-08-03 12:59:24 +00:00
methods: {
attentionMemberList() {
this.$u.api.attentionMemberList().then(res => {
2020-08-04 13:13:47 +00:00
uni.stopPullDownRefresh();
2020-08-03 12:59:24 +00:00
if(res.errCode == 0) {
2020-08-12 10:38:14 +00:00
this.list = res.data.data;
2020-08-03 12:59:24 +00:00
} else {
this.list = [];
2020-08-03 10:38:04 +00:00
}
2020-08-03 12:59:24 +00:00
})
2020-08-04 13:13:47 +00:00
},
2020-08-12 10:38:14 +00:00
viewDetails({ id, type }) {
let src = type == 3 ? 'pageB/details/index' : 'pageC/merchant/index';
this.$u.route(src, {
2020-08-11 02:06:51 +00:00
id: id
});
},
2020-08-04 13:13:47 +00:00
changeType(id) {
console.log(id);
this.$u.api.attentionMember({
member_id: id
}).then(res => {
this.$u.toast(res.message);
this.attentionMemberList();
})
},
2020-06-08 07:23:23 +00:00
},
};
</script>
<style lang="scss" scoped>
.concerns {
2020-08-03 12:59:24 +00:00
.concerns-container {
padding: 30rpx;
2020-06-08 07:23:23 +00:00
display: flex;
2020-08-03 12:59:24 +00:00
flex-wrap: wrap;
2020-08-04 11:08:04 +00:00
&:not(:nth-child(3n)) {
margin-right: 20rpx;
}
2020-08-03 12:59:24 +00:00
.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;
2020-08-04 13:13:47 +00:00
background-color: #EDEDED;
2020-08-03 12:59:24 +00:00
font-size: 26rpx;
line-height: 50rpx;
color: #fff;
text-align: center;
margin-top: 19rpx;
border-radius: 25rpx;
}
.action{
background: #f3f3f3;
}
2020-06-08 07:23:23 +00:00
}
}
}
</style>