list.vue 1.9 KB
<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>