<template>
  <div>
    <div class="h-34px"></div>
    <ui-title-devider :title="$t('我的浏览记录')"></ui-title-devider>
    <div class="px-40px">
      <div class="h-20px"></div>
      <ui-main-article v-for="item in articles" :item="item" class="mb-20px">
<!--        <img @click.stop="handleCancel(item)" v-if="item.like" src="/imgs/like-button-checked.png" slot="right" class="w-28px right-19px bottom-10px absolute"/>-->
        <!--          <img src="/imgs/star-blank.png" slot="right" class="w-28px right-19px bottom-10px absolute"/>-->
      </ui-main-article>
        <ui-empty-tips v-if="!articles.length"></ui-empty-tips>

    </div>
  </div>
</template>

<script>
  export default {
    data(){
      return {
        articles:[]
      }
    },
    methods:{
      handleCancel(){

      },
      async handleLoad(){
        let resp = await this.$http.post(this.$api.cms.myViewArticles,this.$qs.stringify({onPage:false}));
        this.articles = resp.data.data.cmsArticles;

      },
      async handleCancel(item){

        await this.$confirm('您现在正在进行取消点赞操作, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        });

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

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

  };
</script>

<style lang="scss" scoped></style>



