西藏巴青项目

index.vue 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <web-view v-if="previewUrl" class="file-preview-web" :src="previewUrl" />
  3. <view v-else class="file-preview-empty">
  4. <text class="text-body">{{ $t('filePreviewPage.empty') }}</text>
  5. </view>
  6. </template>
  7. <script>
  8. import tabPage from '@/mixins/tabPage'
  9. export default {
  10. mixins: [tabPage],
  11. data() {
  12. return {
  13. navTitleKey: 'filePreviewPage.navTitle',
  14. previewUrl: ''
  15. }
  16. },
  17. onLoad(query) {
  18. if (query.url) {
  19. try {
  20. this.previewUrl = decodeURIComponent(query.url)
  21. } catch (e) {
  22. this.previewUrl = query.url
  23. }
  24. }
  25. if (query.title) {
  26. try {
  27. const title = decodeURIComponent(query.title)
  28. uni.setNavigationBarTitle({ title })
  29. } catch (e) {
  30. /* noop */
  31. }
  32. }
  33. }
  34. }
  35. </script>
  36. <style lang="scss" scoped>
  37. @import '@/styles/morandi.scss';
  38. .file-preview-web {
  39. width: 100%;
  40. height: 100vh;
  41. }
  42. .file-preview-empty {
  43. display: flex;
  44. align-items: center;
  45. justify-content: center;
  46. min-height: 100vh;
  47. padding: 48rpx;
  48. box-sizing: border-box;
  49. background: $morandi-bg-page;
  50. }
  51. .file-preview-empty .text-body {
  52. color: $morandi-text-muted;
  53. text-align: center;
  54. }
  55. </style>