model.vue 796 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <template>
  2. <view>
  3. <web-view v-if="webViewUrl" :src="webViewUrl"></web-view>
  4. </view>
  5. </template>
  6. <script>
  7. import config from "@/config";
  8. import {
  9. getBimViewToken
  10. } from '@/request/api/bim.js'
  11. export default {
  12. data() {
  13. return {
  14. webViewUrl: null,
  15. option: {
  16. type: 'model',
  17. fileId: 10000898047083,
  18. showType: '1',
  19. title: '模型'
  20. }
  21. }
  22. },
  23. onShow() {
  24. this.initBadge();
  25. },
  26. onLoad(body) {
  27. this.initModel();
  28. },
  29. methods: {
  30. initModel() {
  31. getBimViewToken(this.option.fileId).then(res => {
  32. this.webViewUrl =
  33. `${config.baseUrl}/webview/bim/preview.html?viewToken=${res.data}&title=${this.option.title}&showType=${this.option.showType}`;
  34. })
  35. }
  36. }
  37. }
  38. </script>
  39. <style>
  40. </style>