index.vue 766 B

12345678910111213141516171819202122232425262728293031323334
  1. <template>
  2. <view class="box">
  3. <ss-preview :fileUrl="fileUrl" :fileType="fileType"></ss-preview>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. components:{},
  9. data() {
  10. return {
  11. fileUrl: '',
  12. fileType: '2',
  13. fileMap: {
  14. '1': '/static/pdf/2.pdf', //银通汽车4s管理系统
  15. '2': '/static/pdf/3.pdf', //银通汽车租赁管理系统
  16. '3': '/static/pdf/1.pdf', // 银通云越管理系统
  17. }
  18. };
  19. },
  20. onLoad(options) {
  21. console.log(options)
  22. const fileIndex = options.file || '1';
  23. const baseUrl = this.fileMap[fileIndex] || this.fileMap['1'];
  24. this.fileUrl = baseUrl + '?t=' + Date.now();
  25. console.log(this.fileUrl);
  26. }
  27. };
  28. </script>
  29. <style lang="scss" scoped>
  30. .box {
  31. padding: 0;
  32. }
  33. </style>