<template>
  <div class="home-wrapper">
    <div
        class="j-background"
    ></div>
    <div class="j-button">
      <button class="downbtn" id="downloadButton"></button>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Share',
  components: {},
  data() {
    return {
    }
  },
  created() {
  },
  mounted:function(){
    const s = document.createElement('script');
    s.type = 'text/javascript';
    s.src = '//web.cdn.openinstall.io/openinstall.js';
    s.addEventListener('load',()=>{
      var data = OpenInstall.parseUrlParams();
      console.log(data)
      new OpenInstall({
        appKey : "ro53zd",   //appkey参数配置,需要自行替换对应的appkey
        onready : function() {
          var m = this, button = document.getElementById("downloadButton");
          m.schemeWakeup();
          button.onclick = function() {
            m.wakeupOrInstall();
            return false;
          }
        }
      }, data);
    },false);
    document.head.appendChild(s);
  },
  methods: {
  }
}
</script>

<style scoped>
img {
  width: 100%;
  height: 100%;
}
.share-body {
  height: 100%;
  width: 100%;
  background-size:100% 100%;
  background: url("../assets/back.png") no-repeat fixed center center;
}

.j-background {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("../assets/back.png") no-repeat fixed center center;
  background-size: 100% 100%;
}
.j-button {
  position: fixed;
  left: 0;
  right: 0;
  margin: auto;
  height: 60px;
  bottom: 70px;
  width: 300px;
  background: url("../assets/download.png") no-repeat;
  background-size: 100% 100%;
  overflow: hidden;
}

.downbtn {
  outline: none;
  border: none;
  width: 100%;
  height: 100%;
  background: none;
}
</style>
