<template>
  <view>
    <web-view :src="path" />
  </view>
</template>

<script>
import { mapState } from "vuex";

export default {
  data() {
    return {
      path: "",
    };
  },
  computed: {
    ...mapState("user", ["userInfo"]),
  },
  onShow() {
    this.downloadAndSavePDF();
  },
  methods: {
    downloadAndSavePDF() {
      let downUrl = uni.getStorageSync("contractDownloadUrl");

      this.path = `/static/pdf/web/viewer.html?file=${encodeURIComponent(
        downUrl
      )}`;
    },
  },
};
</script>

<style>
</style>