<template>
  <div class="success">
    <Title
      v-bind:title="title"
      v-on:goback="goback"
      show_back="true"
    ></Title>
    <div class="share_img">
      <img :src="liin_share_image" alt="">
    </div>
  </div>
</template>

<script>
  import Title from "@/components/Title.vue";
  import {
    liinShare
  } from "@/components/axios/api";

  export default {
    name: "Success",
    components: {
      Title,
    },
    data() {
      return {
        shareImgUrl: "",
        title: "每天读书打卡",
        if_follow: false,
        liin_share_image: "",
        is_every: false,
        dailyShare: "",
        isImgLoaded: false,
        isLoading: false,
        isShowRedpack: false
      };
    },
    methods: {
      goback() {
        this.$router.push({name: "Read"})
      },
      queryPayImage() {
        liinShare().then(res => {
          if (res.code == 0) {
            localStorage.setItem("is_follow", res.data.is_follow);
            localStorage.setItem("liin_share_image", res.data.image);
            localStorage.setItem("hb_url", res.data.hb_url);
            localStorage.setItem("open_platform", res.data.open_platform);
            this.liin_share_image = localStorage.getItem("liin_share_image") || "";
          }
        });
      },
    },
    created() {
      this.queryPayImage()
    }
  }
</script>

<style scoped>
  .share_img img {
    width: 100%;
  }
</style>
<style>
  .success .back {
    background-image: url("../assets/ic_back_black.png");
  }

  .success .title_container {
    color: #282828;
    background: #ffffff;
    height: 0.9rem;
    position: fixed;
    top: 0;
    width: 100%;
  }

</style>
