当前位置:网站首页>Apiccloud implements the document download and preview functions
Apiccloud implements the document download and preview functions
2022-06-26 11:14:00 【The broad sea leaps with the fish_ api】
There are a lot of document downloads app, Especially the functions commonly used in enterprise applications . Use APICloud Development app when , have access to api.download Method implementation Download ; Preview the document using superFile modular .superFile The module encapsulates the browsing service based on Tencent TBS, Use X5Webkit kernel , Realize the display function of documents , Support multiple file formats (PDF、Word、Execl、TXT、PPT).
Add... To the project superFile modular :

Then compile the custom loader , Put custom loader Install the installation package on the mobile phone , And then you can use it APICloud Studio3 wifi sync , Synchronize code to custom loader Debugging in . Reference tutorial : APICloud Customize loader explain – mobile phone APP Development 、APP Make 、APP Customized platform
The example code is as follows :
<template>
<safe-area>
<scroll-view class="main" scroll-y>
<view><text onclick='this.downloadDoc_open'> Download and open document </text></view>
</scroll-view>
</safe-area>
</template>
<style>
.main {
width: 100%;
height: 100%;
background-color: #fff;
}
</style>
<script>
export default {
name: 'test',
data() {
return {
}
},
apiready() {
},
methods: {
downloadDoc_open() {
api.download({
url: '', // Fill in the file to download url
savePath: 'fs://myapp/test.doc',
report: true,
cache: true,
allowResume: true
}, function (ret, err) {
if (ret.state == 1) {
// Download successful
console.log(JSON.stringify(ret));
if (api.systemType == 'ios') {
// ios No initialization required , direct open
var superFile = api.require('superFile');
superFile.open({
path: ret.savePath,
})
}
if (api.systemType == 'android') {
console.log(2);
var superFile = api.require('superFile');
superFile.init(function (ret) {
if (ret.eventType == 'onViewInitFinished') {
superFile.open({
path: ret.savePath
})
}
});
}
}
});
}
}
}
</script>边栏推荐
- How does unity prevent other camera positions and rotations from being controlled by steamvrplugin when using steamvrplugin
- 关于印发《深圳市福田区支持战略性新兴产业和未来产业集群发展若干措施》的通知
- Unity使用SteamVRPlugin时如何不让其他Camera位置和旋转收到SteamVRPlugin控制
- 【深度学习理论】(7) 长短时记忆网络 LSTM
- laravel-admin 用 原生JS实现声音提示,及自动播放
- Code specification & explain in detail the functions and uses of husky, prettier, eslint and lint staged
- Cet article présente la moyenne mobile quadratique linéaire et le fonctionnement simple d'Excel pour réaliser la prédiction des séries chronologiques dans la modélisation.
- matlab 编程实例: 如何统计元胞数组中元素的数量
- Uncaught reflectionexception: class view does not exist
- Redux related usage
猜你喜欢

PC qq Hall upload Update Modifying versioninfo

PC QQ hall upload update modify VersionInfo

APICloud 实现文档下载和预览功能

介绍一下实现建模中可能用到的时间序列预测之线性二次移动平均,Excel的简单操作

ACK攻击是什么意思?ACK攻击怎么防御?

Cet article présente la moyenne mobile quadratique linéaire et le fonctionnement simple d'Excel pour réaliser la prédiction des séries chronologiques dans la modélisation.

c语言 --- 运算符和表达式

Machine learning LDA - Experimental Report

Fabric.js 上划线、中划线(删除线)、下划线
![[deep learning theory] (6) recurrent neural network RNN](/img/33/e270b08e7748a6e740eb618ed10c9a.gif)
[deep learning theory] (6) recurrent neural network RNN
随机推荐
关于印发《深圳市福田区支持战略性新兴产业和未来产业集群发展若干措施》的通知
24 个必须掌握的数据库面试问题!
Build document editor based on slate
2020.7.6 interview with fence network technology company
Machine learning LDA - Experimental Report
nacos2.x.x启动报错信息Error creating bean with name ‘grpcClusterServer‘;
mysql性能监控和sql语句
基于slate构建文档编辑器
laravel-admin 非自增ID获取, 及提交隐藏表单
ACK攻击是什么意思?ACK攻击怎么防御?
laravel-admin 用 原生JS实现声音提示,及自动播放
我想知道,十大劵商如何开户?在线开户安全么?
PC QQ hall upload update modify VersionInfo
. Net, the usage of log components NLog, seriallog, log4net
Openresty overview
统计遗传学:第一章,基因组基础概念
MySQL Performance Monitoring and SQL statements
Group by is used in laravel to group and query the quantity
02-Redis数据结构之链表
PC qq Hall upload Update Modifying versioninfo