49 lines
1.4 KiB
Vue
49 lines
1.4 KiB
Vue
<template>
|
|
<div class="buddha-activity">
|
|
<van-nav-bar left-arrow v-if="$route.meta.showNavBar" :title="$route.meta.title" @click-left="$router.back()" :style="{backgroundColor: $route.meta.navBarBackgroundColor}" />
|
|
<div class="process-container">
|
|
<scroll-view :height="height - 50" ref="scrollView">
|
|
<buddha-process v-for="(p, i) in list" :key="i" :data="p" :show-goods-btn="!query.goods_id"></buddha-process>
|
|
<div v-if="total === list.length && list.length > 3" class="no-more">没有更多了</div>
|
|
</scroll-view>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { getDynamicData } from "@/api"
|
|
|
|
export default {
|
|
props: ['data'],
|
|
data(){
|
|
const { query } = this.$route;
|
|
return {
|
|
query,
|
|
size: 10,
|
|
page: 1,
|
|
total: 0,
|
|
list: [],
|
|
height: window.innerHeight
|
|
}
|
|
},
|
|
mounted(){
|
|
this.getDynamicData();
|
|
},
|
|
methods: {
|
|
async getDynamicData(){
|
|
const res = await getDynamicData(this.page, this.query.goods_id, this.size)
|
|
this.total = res.total;
|
|
this.list = res.results;
|
|
this.$nextTick(() => {
|
|
this.$refs.scrollView.refresh();
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.process-container{
|
|
padding: .4rem 0;
|
|
}
|
|
</style> |