update api
This commit is contained in:
@@ -3,16 +3,16 @@
|
||||
<view class="lately">
|
||||
<view class="title">最新</view>
|
||||
<view class="items">
|
||||
<view v-for="(item, index) in 3" :key="index">
|
||||
<FansItem></FansItem>
|
||||
<view v-for="(item, index) in myfans" :key="index">
|
||||
<FansItem :info="item"></FansItem>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="before">
|
||||
<view class="title">早前</view>
|
||||
<view class="items">
|
||||
<view v-for="(item, index) in 13" :key="index">
|
||||
<FansItem></FansItem>
|
||||
<view v-for="(item, index) in newfans" :key="index">
|
||||
<FansItem :info="item"></FansItem>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -22,10 +22,35 @@
|
||||
import FansItem from '@/components/fans-item/index'
|
||||
export default {
|
||||
data() {
|
||||
return {}
|
||||
return {
|
||||
myfans:[],
|
||||
newfans:[]
|
||||
}
|
||||
},
|
||||
components: {
|
||||
FansItem
|
||||
},
|
||||
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)
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user