<template>
  <div class="as-share-wrapper">
    <Card6 type="2"></Card6>
  </div>
</template>
<script>
import Card6 from "@/components/annual-summary/card-6";
import {
  getWebPageUrl
} from "@/utils"
export default {
  components: {
    Card6
  },
  data() {
    return {
      uuid: '',
      shareUrl: '',
    }
  },
  created() {
    let href = location.href;
    let uuidIndex = href.indexOf("uuid") || 0;
    if (uuidIndex > 0) {
      this.uuid = href.substr(uuidIndex + 5, 32);
    } else {
      this.uuid = "07F9625472D6444EBAE4BF7D2EF83BC4";
    }
    this.shareUrl = location.href;
    if (href.indexOf("singlemessage") >= 0 || href.indexOf("wx_code") >= 0) {
      this.shareUrl = getWebPageUrl(`profexam/#/sharecoop?uuid=${this.uuid}`);
      location.replace(this.shareUrl);
    }
    // 设置二次分享
    this.secondShare();
  },

  methods: {
    secondShare() {
      this.wechatShare(
        {
          link: this.shareUrl,
          title: "云鹊医2020年度个人学习报告",
          friendtitle: "云鹊医2020年度个人学习报告",
          desc: "点击查看我的专属学习报告",
          imgUrl: "https://file.yunqueyi.com/logo.png"
        },
        () => {
          console.log("share success...");
        }
      );
    }
  }
};
</script>
<style lang="less" scoped>
.as-share-wrapper {
}
</style>