Files
temple-h5/src/pages/user/focus/index.vue
T
2021-11-11 17:35:55 +08:00

49 lines
1.3 KiB
Vue

<template>
<div class="focus">
<div class="topbar" ref="topbar">
<van-nav-bar left-arrow v-if="$route.meta.showNavBar" :title="$route.meta.title" @click-left="$router.back()" :style="{backgroundColor: $route.meta.navBarBackgroundColor}" />
</div>
<div class="focus-list-container">
<div class="no-more" v-if="list.length === 0">暂无数据</div>
<buddha-process v-for="li in list" :key="li.id" :data="li" @collection="onCancelCollection"></buddha-process>
</div>
</div>
</template>
<script>
import { getMyCollectionList } from '@/api'
export default {
data(){
return {
containerHeight: 0,
keyword: '',
activeName: '',
list: [],
page: 1,
}
},
inject: ['root', 'tabbar'],
mounted(){
this.getMyCollectionList();
},
methods: {
async getMyCollectionList(){
const res = await getMyCollectionList(this.page)
this.list = this.list.concat(res.results);
},
onCancelCollection(id){
const index = this.list.map(item => item.id).indexOf(id);
this.list.splice(index, 1)
}
}
}
</script>
<style lang="scss">
.focus{
.focus-list-container{
margin-top: .4rem;
}
}
</style>