demingshangjia/pages/user/fans.vue

69 lines
1.3 KiB
Vue
Raw Normal View History

2020-06-12 18:05:39 +08:00
<template>
<view class="fans">
<view class="lately">
<view class="title">最新</view>
<view class="items">
2020-07-29 20:35:33 +08:00
<view v-for="(item, index) in myfans" :key="index">
<FansItem :info="item"></FansItem>
2020-06-12 18:05:39 +08:00
</view>
</view>
</view>
<view class="before">
<view class="title">早前</view>
<view class="items">
2020-07-29 20:35:33 +08:00
<view v-for="(item, index) in newfans" :key="index">
<FansItem :info="item"></FansItem>
2020-06-12 18:05:39 +08:00
</view>
</view>
</view>
</view>
</template>
<script>
import FansItem from '@/components/fans-item/index'
export default {
data() {
2020-07-29 20:35:33 +08:00
return {
myfans:[],
newfans:[]
}
2020-06-12 18:05:39 +08:00
},
components: {
FansItem
2020-07-29 20:35:33 +08:00
},
onLoad() {
this.fans()
},
methods:{
fans(){
let that = this;
this.$u.api.myfanlist({
}).then(res => {
console.log(res);
if (res.errCode != 0) {
this.$refs.uToast.show({
title: res.message,
type: 'error'
});
} else {
that.myfans = res.data.fans
that.newfans = res.data.fansNewest
console.log(that.myfans,that.newfans)
}
});
}
2020-06-12 18:05:39 +08:00
}
};
</script>
<style lang="scss" scoped>
.fans {
min-height: calc(100vh - var(--window-top));
background: #ececec;
.lately, .before {
.title {
font-size: 26rpx;
color:rgba(101,101,101,1);
padding: 20rpx 30rpx;
}
}
}
</style>