Blame view

pages/workFlow/filePreview/index.vue 484 Bytes
290144e9   易尊强   第一次
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  <template>
  	<view>
  		<web-view :src="fileUrl"></web-view>
  	</view>
  </template>
  
  <script>
  	import {
  		getDownloadUrl
  	} from '@/api/common'
  	export default {
  		data() {
  			return {
  				fileUrl: ''
  			}
  		},
  		onLoad(e) {
  			uni.setNavigationBarTitle({
  				title: e.name
  			})
  			this.getFileUrl(e.fileId)
  		},
  		methods: {
  			getFileUrl(fileId) {
  				getDownloadUrl('workFlow', fileId).then(res => {
  					this.fileUrl = this.define.baseURL + res.data.url;
  				})
  			}
  		}
  	}
  </script>