Authored by bevishuang

公告列表

<template>
<div>
<Scroll ref="recyclelist" class="list" :on-fetch="onFetch">
<div >
<NoticeItem v-for="(item, index) in noticeList" :key="index" :data="item"></NoticeItem>
</div>
</Scroll>
</div>
</template>
<script>
import { createNamespacedHelpers } from 'vuex';
const { mapState, mapActions } = createNamespacedHelpers('gain');
import NoticeItem from './noticeItem';
import {
Style,
Scroll,
RecycleList
} from 'cube-ui';
// import { resolve } from 'dns';
export default {
components: {
NoticeItem,
Scroll,
RecycleList,
Style
},
data(){
return {
scrollOptions: {
bounce: {
top: false
},
pullUpLoad: true
},
fixed: false
};
},
mounted(){
// this.fetchList
},
methods:{
// async onPullingUp() {
// const result = await this.fetchList();
// if (!result) {
// this.$refs.scroll.$forceUpdate();
// }
// },
onFetch(){
let items = []
return new Promise((resolve) => {
setTimeout(() => {
for(let i = 0; i < 50; i++){
items.push({
id:i,
contents:'【税率调整】您的商品AIR JORDAN 4 RESET PUSH NONEKJG 2017已经被用户下单,请及时发货'+i,
time:'2018.08.08 17:20'
})
}
resolve(items)
}, 1000)
})
}
},
// async fetchList({ commit, state }) {
// let page = state.page;
// const result = await this.$api.get('/api/union/inviteList', {
// page: page,
// size: state.size
// });
// if (result.code === 200) {
// commit('addList', { list: result.data.list });
// commit('changePage', { page: ++page });
// }
// return result.data ? result.data.length : 0;
// }
}
</script>
\ No newline at end of file
... ...
<template>
<div class="notice-root">
<p class="notice-content">【税率调整】您的商品AIR JORDAN 4 RESET PUSH NONEKJG 2017已经被用户下单,请及时发货</p>
<div class="time">
<time> 2018.08.08 17:20</time>
</div>
</div>
</template>
<script>
// export default {
// data(){
// },
// props:[
// ]
// };
// methods: {
// onGo()
// };
</script>
<style>
.notice-root{
margin-left: 40px;
margin-right: 40px;
}
.notice-content{
font-family: 'PingFang-SC-Regular';
font-size: 28px;
color: #000000;
}
.time {
font-size: 28px;
color: #999999;
}
</style>
\ No newline at end of file
... ...
<template>
<LayoutApp :show-back="true">
<div class="body" ref="body">
<List>
</List>
</div>
</LayoutApp>
</template>
<script>
import List from './components/list';
export default {
components: {
List
}
};
</script>
<style>
.body {
height: 100%;
overflow-y: auto;
}
</style>
\ No newline at end of file
... ...
import * as Types from './types'
import { get } from 'lodash';
export default {
async fetchTopicList({ commit, state }, { page, limit }) {
if (state.fetchTopicList) {
return {};
}
page = page || state.fetchTopicPage || 1;
commit(Types.FETCH_NOTICE_LIST_REQUEST, { page });
const result = await this.$api.post('/api/grass/getGrassTopicList', {
page,
limit: limit || 10,
filter: 'Y',
lastedTime: state.fetchTopicLastedTime || void 0
});
if (result && result.code === 200) {
commit(Types.FETCH_NOTICE_LIST_SUCCESS, {
data: result.data,
page
});
} else {
commit(Types.FETCH_NOTICE_LIST_FAILD);
}
return result;
},
}
\ No newline at end of file
... ...
export const FETCH_NOTICE_LIST_REQUEST = 'FETCH_NOTICE_LIST_REQUEST';
export const FETCH_NOTICE_LIST_FAILD = 'FETCH_NOTICE_LIST_FAILD';
export const FETCH_NOTICE_LIST_SUCCESS = 'FETCH_NOTICE_LIST_SUCCESS';
\ No newline at end of file
... ...