Files
oa_app/pages/preview/file.vue
T
2026-09-23 16:52:48 +08:00

37 lines
919 B
Vue

<template>
<view class="page">
<fy-header title="附件预览" back />
<view class="body">
<text class="name">{{ name || '附件' }}</text>
<view class="btn-primary" @click="open">打开 / 预览</view>
</view>
</view>
</template>
<script>
import FyHeader from '../../components/fy-header.vue'
import { store } from '../../utils/store.js'
import { openFile } from '../../utils/files.js'
export default {
components: { FyHeader },
data() { return { id: '', name: '' } },
onLoad(q) {
this.id = decodeURIComponent(q.id || '')
this.name = decodeURIComponent(q.name || '附件')
this.open()
},
methods: {
open() {
if (!this.id) return
openFile({ id: this.id, name: this.name }, store.token)
}
}
}
</script>
<style scoped>
.body { padding: 48rpx 32rpx; }
.name { display: block; font-size: 28rpx; margin-bottom: 32rpx; text-align: center; }
</style>