当前位置:网站首页>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>边栏推荐
- Sqli labs range 1-5
- Redis knowledge mind map
- CEPH operation and maintenance common instructions
- 介紹一下實現建模中可能用到的時間序列預測之線性二次移動平均,Excel的簡單操作
- Cereals Mall - Distributed Advanced
- 代码规范 & 详细解释 husky、prettier、eslint、lint-staged 的作用和使用
- [Beiyou orchard microprocessor design] 10 serial communication serial communication notes
- flannel的host-gw与calico
- QT连接MySql数据查询失败
- What does ack attack mean? How to defend against ack attacks?
猜你喜欢

. Net, the usage of log components NLog, seriallog, log4net

MQTT断开重连
![LeetCode 710 黑名单中的随机数[随机数] HERODING的LeetCode之路](/img/58/2a56c5c9165295c830082f8b05dd98.png)
LeetCode 710 黑名单中的随机数[随机数] HERODING的LeetCode之路

02 linked list of redis data structure

10 years' experience in programmer career - for you who are confused
![Compréhension approfondie de l'expérience de port série stm32 (registre) [Tutoriel de niveau nounou]](/img/b2/f09e220918a85b14a1993aa85f7720.png)
Compréhension approfondie de l'expérience de port série stm32 (registre) [Tutoriel de niveau nounou]

redux相关用法
![[work details] March 18, 2020](/img/24/a72230daac08e7ec5bd57df08071f8.jpg)
[work details] March 18, 2020

JS take the date of the previous month 【 pit filling 】

Easyx----- C language implementation 2048
随机推荐
深度理解STM32的串口實驗(寄存器)【保姆級教程】
Consumer microservice Governance Center stepping on the pit
Machine learning linear regression - Experimental Report
机器学习SVM——实验报告
Nacos2.x.x start error creating bean with name 'grpcclusterserver';
Easyx-----c语言实现2048
ACK攻击是什么意思?ACK攻击怎么防御?
Origin of b+ tree index
10 years' experience in programmer career - for you who are confused
wangEditor 上传本地视频修改
Unity使用SteamVRPlugin时如何不让其他Camera位置和旋转收到SteamVRPlugin控制
Recent work report
QT connection MySQL data query failed
APICloud 实现文档下载和预览功能
Work report (2)
你好!正向代理!
02-Redis数据结构之链表
修改calico网络模式为host-gw
What does ack attack mean? How to defend against ack attacks?
express在nodejs中的基本使用