<template>
  <ui-page-layout title="浏览历史">
    <div class="p-24rem">
      <ui-main-article v-for="item in articles" :item="item" class="mb-20px"></ui-main-article>
    </div>
  </ui-page-layout>

</template>

<script>
  export default {
    components: {},
    data(){
      return {
        articles:[]
      }
    },
    methods:{
      async handleLoad(){
        let resp = await this.$http.post(this.$api.cms.myCommentArticles,this.$qs.stringify({onPage:false}));
        this.articles = resp.data.data.cmsArticles;

      },
      async handleCancel(item){

        await this.$dialog.confirm( {
          message:'您现在正在进行取消订阅操作, 是否继续?',
          title:'提示',
          confirmButtonText: '确定',
          cancelButtonText: '取消',
        });

        let resp = await  this.$http.post(this.$api.cms.subscribe,this.$qs.stringify({refArticle:item.code}));
        if(resp.data.status === 200){
          this.handleLoad();
        }

      }
    },
    async created() {
      this.handleLoad();
    }

  };
</script>
  
<style lang="scss" scoped>

</style>
  