|
|
<template>
|
|
|
<Layout>
|
|
|
<LayoutHeader slot='header' title="推荐" :share="shareData"></LayoutHeader>
|
|
|
<div class="article-content">
|
|
|
page-content
|
|
|
</div>
|
|
|
<LayoutScroll :infinite="true" :on-fetch="onFetch">
|
|
|
<div class="article-item" slot="item" slot-scope="{ data }">
|
|
|
<div :id="data.id" class="item">
|
|
|
<div class="avatar" :style="{backgroundImage: 'url(' + (data.avatar || '') + ')'}"></div>
|
|
|
<div class="bubble">
|
|
|
<p>{{ data.name }}</p>
|
|
|
<div class="meta">
|
|
|
<time class="posted-date">{{ data.time }}</time>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</LayoutScroll>
|
|
|
</Layout>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import {createNamespacedHelpers} from 'vuex';
|
|
|
import {Scroll, Loading} from 'cube-ui';
|
|
|
const {mapState, mapActions, mapMutations} = createNamespacedHelpers('article');
|
|
|
|
|
|
export default {
|
|
|
name: 'ArticlePage',
|
...
|
...
|
@@ -20,12 +31,28 @@ export default { |
|
|
data() {
|
|
|
return {
|
|
|
list: [],
|
|
|
shareData: {},
|
|
|
scrollOptions: {
|
|
|
bounce: false
|
|
|
}
|
|
|
},
|
|
|
inx: 0
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['articleList']),
|
|
|
},
|
|
|
methods: {
|
|
|
onFetch() {
|
|
|
const items = Array.from({length: 50}).map((v, i) => {
|
|
|
return {
|
|
|
name: 'chenfeng' + (i + 50 * this.inx)
|
|
|
}
|
|
|
})
|
|
|
|
|
|
this.inx++;
|
|
|
|
|
|
return Promise.resolve(items);
|
|
|
},
|
|
|
click() {
|
|
|
this.$refs.actionSheet.show();
|
|
|
setTimeout(() => {
|
...
|
...
|
@@ -46,31 +73,8 @@ export default { |
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style>
|
|
|
.page {
|
|
|
position: absolute;
|
|
|
top: 0;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
bottom: 0;
|
|
|
background-color: gray;
|
|
|
}
|
|
|
|
|
|
.content {
|
|
|
width: 100%;
|
|
|
height: 100vh;
|
|
|
background-color: white;
|
|
|
}
|
|
|
|
|
|
.item {
|
|
|
background-color: white;
|
|
|
}
|
|
|
|
|
|
.loading {
|
|
|
position: absolute;
|
|
|
left: 50%;
|
|
|
top: 50%;
|
|
|
transform: translate(-50%, -50%);
|
|
|
}
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
.article-item {
|
|
|
height: 100px;
|
|
|
}
|
|
|
</style> |
...
|
...
|
|