<template>
  <div id="share">
    <el-row>
      <el-col :span="24" class="vshare"><vshare :vshareConfig="config"></vshare></el-col>
    </el-row>
  </div>
</template>

<script>
import vshare from 'vshare';
export default {
  name: 'share',
  props: {},
  components: {
    vshare,
  },
  data: () => ({
    config: {
      common: {
        bdUrl: window.location.href.replace('/www', '/mobile'),
      },
    },
  }),
  created() {
    let scheme = window.location.protocol;
    // console.log(scheme);
    let host = window.location.host;
    // console.log(host);
    let uri = window.location.pathname;
    let type;
    if (uri.includes('jobfair')) type = 'jobfair.html#/';
    else if (uri.includes('talk')) type = 'talk.html#/';
    else if (uri.includes('jobinfo')) type = 'jobinfo.html#/';
    else if (uri.includes('jobs')) type = 'jobs.html#/';
    else type = 'news.html#/';
    // console.log(uri);
    let query = window.location.search;
    // console.log(query);
    let url = `${scheme}//${host}/mobile/${type}${query}`;
    // console.log(url);
    this.$set(this.config.common, `bdUrl`, url);
  },
  computed: {},
  methods: {},
};
</script>

<style lang="less" scoped>
.vshare {
  height: 30px;
  line-height: 30px;
}
.bdshare-button-style0-24 {
  height: 30px;
}
</style>
