list.vue 2.14 KB
<template>
  <div style="height: 100%;">
    <div style="background-color: #f0f0f0;height: 100%;">
      <div class="head"></div>
      <Scroll :data="ufoList" :options="scrollOptions" v-if="ufoList.length">
        <CouponItem :item="item" v-for="(item, index) in ufoList" :key ="index"></CouponItem>
      </Scroll>
      <Empty v-else></Empty>
    </div>
  </div>
</template>

<script>
import {createNamespacedHelpers} from 'vuex';

const {mapState} = createNamespacedHelpers('coupon/yoho');

import CouponItem from '../components/coupon-item';
import Empty from '../components/empty';

import {Scroll} from 'cube-ui';

export default {
  name: 'UfoCouponListPage',
  computed: {
    ...mapState(['ufoList']),
  },
  asyncData({store, router}) {
    return store.dispatch('coupon/yoho/fetchUfoList', {
      limit: 20,
      page: 1
    });
  },
  data() {
    return {
      scrollOptions: {
        directionLockThreshold: 0
      }
    };
  },
  created() {
  },
  mounted() {
  },
  methods: {
  },
  components: {
    Scroll,
    CouponItem,
    Empty
  }
};
</script>

<style lang="scss" scoped>
  .head {
    height: 90px;
  }

  .coupon-wrapper {
    height: 200px;
    padding-top: 20px;
    padding-left: 20px;
    padding-right: 20px;
    background: #f0f0f0;
    box-sizing: content-box;
  }

  .coupon-item {
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 10px;
  }

  .mask {
    width: 100%;
    height: 100%;
    position: absolute;
    background: rgba(0, 0, 0, 0.4);
  }

  .list-wrapper {
    overflow: hidden;

    li {
      padding: 15px 10px;
      background-color: white;
      border-radius: 10px;
    }
  }

  .tab-slide-container {
    /*position: fixed;*/
    /*left: 0;*/
    /*right: 0;*/
    /*bottom: 0;*/
    height: 100%;
  }

  .tab-container {
    height: 90px;
    background-color: white;
    border-bottom: 1px solid #e0e0e0;
  }

  .tab-item {
    line-height: 60px;
    text-align: center;
    font-size: 28px;
    color: #b0b0b0;
  }

  .tab-item + .tab-item {
    border-left: 1px solid #e0e0e0;
  }

  .cube-tab_active {
    color: #444 !important;
  }

  .cube-scroll-wrapper {
    padding-top: 20px;
  }
</style>