index.vue 2.23 KB
<template>
  <div class="collect_container">
    <NafmHeader navClass="nafmii-head-bg3" :title="$t('title.collect')">
      <template #right>
        <div @click="handleClear">{{$t('button.clear')}}</div>
      </template>
    </NafmHeader>
    <div class="collect_content">
      <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
        <van-swipe-cell>
          <div class="list">
            
          </div>
          <template #right>
            <van-button square text="删除" type="danger" class="delete-button" />
          </template>
        </van-swipe-cell>
      </van-list>
    </div>

  </div>

</template>
<script>
export default {
  name: 'Collect',
  data() {
    return {
      loading: false,
      finished: false,
      list: [
        {
          date: '2020-04-11',
          content: [{
            title: '《1中国银行间市场交易商协会会员代表大会会员代表产生办法》(协会公告[2011]10号)',
            type: '自律规则'
          }, {
            title: '《2中国银行间市场交易商协会会员代表大会会员代表产生办法》(协会公告[2011]10号)',
            type: '自律规则'
          }]
        },
        {
          date: '2020-04-10',
          content: [{
            title: '《3中国银行间市场交易商协会会员代表大会会员代表产生办法》(协会公告[2011]10号)',
            type: '自律规则'
          }, {
            title: '《4中国银行间市场交易商协会会员代表大会会员代表产生办法》(协会公告[2011]10号)',
            type: '自律规则'
          }]
        }
      ]
    }
  },
  methods: {
    // 清空收藏
    handleClear() {
      Dialog.confirm({
        title: this.$t('toast.tip'),
        message: this.$t('toast.isEmptyContent'),
        cancelButtonText: this.$t('button.cancel'),
        cancelButtonColor: '#206CB3',
        confirmButtonText: this.$t('button.ok'),
        confirmButtonColor: '#999999'
      })
        .then(() => {
          // todo
        })
        .catch(() => {
        });
    },
    // 页面滚动到底部加载数据
    onLoad() {
      this.loading = false
      console.log('加载数据')
    }
  }
}
</script>