| | |
| | | // 应用全局配置 |
| | | const config = { |
| | | baseUrl: 'http://114.132.189.42:9048', // 闽兴石材 |
| | | javaApi: 'http://114.132.189.42:9048', |
| | | // 应用信息 |
| | | appInfo: { |
| | | // 应用名称 |
| | |
| | | <view v-for="(file, index) in getCurrentViewAttachments()" :key="index" class="attachment-item" |
| | | @click="previewAttachment(file)"> |
| | | <view class="attachment-preview-container"> |
| | | <image v-if="file.type === 'image' || isImageFile(file)" :src="file.url || file.downloadUrl" |
| | | <image v-if="file.type === 'image' || isImageFile(file)" :src="getAttachmentImageUrl(file)" |
| | | class="attachment-preview" mode="aspectFill" /> |
| | | <view v-else class="attachment-video-preview"> |
| | | <u-icon name="video" size="24" color="#409eff"></u-icon> |
| | |
| | | return ['jpg', 'jpeg', 'png', 'gif', 'webp'].includes(ext) |
| | | } |
| | | |
| | | // 获取查看附件图片的完整URL(javaApi + url) |
| | | const getAttachmentImageUrl = (file) => { |
| | | return file.url |
| | | } |
| | | |
| | | // 文件访问基础域(后端要求前缀) |
| | | const filePreviewBase = 'http://1181ybjh99334.vicp.fun' |
| | | const filePreviewBase = config.javaApi |
| | | |
| | | // 将后端返回的文件地址规范成可访问URL |
| | | // 兼容场景: |