征信小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
zhengxinApplets/pages/user/collect.vue

117 lines
2.3 KiB

3 months ago
<template>
<view class="collect">
3 months ago
<view class="item" v-for="(a,i) in list" :key="i" @click="toGuanzhu(a)">
3 months ago
<view class="a">
3 months ago
<image v-if="a.avatar" :src="baseUrl+a.avatar"></image>
<image v-else src="https://zhengxin.njrenzhou.cn/static/default.png"></image>{{a.nickname}}
3 months ago
</view>
<view class="b">
3 months ago
<image src="https://zhengxin.njrenzhou.cn/static/icon-dui.png"></image>已关注
3 months ago
</view>
</view>
3 months ago
<view class="empty" v-if="isShow">
<image src="https://zhengxin.njrenzhou.cn/static/empty.png"></image>
<view class="txt">暂无数据 ~</view>
</view>
3 months ago
</view>
</template>
<script>
export default {
data() {
return {
3 months ago
list: [],
baseUrl: "",
isShow: false,
3 months ago
};
3 months ago
},
mounted() {
this.baseUrl = this.$baseUrl;
this.getList();
},
methods: {
//关注
3 months ago
async toGuanzhu(a) {
uni.setStorageSync("guanzhuInfo",a);
uni.navigateTo({
url: "/pages/user/mycollect"
})
3 months ago
},
//获取列表
async getList() {
const { code, data } = await this.$api.getguanzhu({
token: uni.getStorageSync("token")
})
if(code == 1){
this.list = data;
this.isShow = (data.length == 0?true:false);
}
},
3 months ago
},
destroyed() {
uni.removeStorageSync("guanzhuInfo")
3 months ago
}
}
</script>
<style scoped lang="scss">
.collect{
padding: 0 25rpx 25rpx;
overflow: hidden;
3 months ago
.empty{
padding: 150rpx 0;
text-align: center;
font-size: 26rpx;
color: #666;
image{
width: 460rpx;
height: 400rpx;
margin-bottom: 30rpx;
}
}
3 months ago
.item{
padding: 30rpx 25rpx;
overflow: hidden;
display: flex;
align-items: center;
justify-content: space-between;
background-color: #FFFFFF;
margin-top: 20rpx;
box-shadow: 0px 3rpx 10rpx 0px rgba(9,44,39,0.05);
border-radius: 20rpx;
.a{
flex: 1;
display: flex;
align-items: center;
font-weight: 500;
font-size: 30rpx;
color: #222222;
image{
width: 80rpx;
height: 80rpx;
border-radius: 50%;
margin-right: 20rpx;
}
}
.b{
width: 130rpx;
height: 50rpx;
line-height: 50rpx;
background: #00C6A9;
border-radius: 4rpx;
font-weight: 500;
font-size: 22rpx;
display: flex;
align-items: center;
justify-content: center;
color: #FFFFFF;
image{
width: 20rpx;
height: 14rpx;
margin-right: 10rpx;
}
}
}
}
</style>