当前位置: 首页 > wzjs >正文

百度智能云建站教程上热门最火标题

百度智能云建站教程,上热门最火标题,科技霸主从带娃开始,网页制作与设计电子书小程序下载文件&#xff0c;可以先预览文件内容&#xff0c;然后在手机上打开文件的工具中选择保存。 简单示例&#xff1a;&#xff08;复制到HBuilder直接食用即可&#xff09; <template><view class"container-detail"><view class"example…

小程序下载文件,可以先预览文件内容,然后在手机上打开文件的工具中选择保存。

简单示例:(复制到HBuilder直接食用即可)

<template><view class="container-detail"><view class="example-body" @click="openFile(item.url)" v-for="(item, index) in fileList" :key="index"><image class="images" src="/common/images/files.png" mode="aspectFit"></image><view class="name">{{item.name}}</view></view></view>
</template><script setup>let fileList = ref([{"name":"file1.jpg","extname":"jpg","url":"https://images.dog.ceo/breeds/retriever-curly/n02099429_817.jpg",},{"name":"file2.jpg","extname":"jpg","url":"https://images.dog.ceo/breeds/doberman/n02107142_16400.jpg",},{"name":"somefile.pdf","extname":"pdf","url":"https://example.com/somefile.pdf",}])function openFile(url) {const isImgType = ['jpg', 'png', 'bmp', 'jpeg', 'webp']uni.showLoading({ title: '加载中...' })uni.downloadFile({url,success: (res) => {const fileType = res.tempFilePath.split('.').pop()if (isImgType.includes(fileType)) {uni.previewImage({ // 调用微信api预览图片showmenu: true, // 开启时右上角会有三点,点击可以保存urls: [res.tempFilePath],current: res.tempFilePath,success: (res) => {uni.hideLoading()console.log('打开图片成功')},fail: (res) => {uni.hideLoading()console.log(res)console.log('打开图片失败')},})} else {uni.openDocument({filePath: res.tempFilePath,showMenu: true, // 开启时右上角会有三点,点击可以保存success: (res) => {uni.hideLoading()console.log('打开文档成功')},fail: (res) => {uni.hideLoading()console.log(res)console.log('打开文档失败')},})}},fail: (e) => {uni.hideLoading()console.log(e)},})}</script><style lang="scss" scoped>
.container-detail {padding: 30rpx;.example-body {padding: 10rpx 0;display: flex;justify-content: space-between;align-items: center;margin-bottom: 32rpx;.images {width: 40rpx;height: 40rpx;image {width: 100%;height: 100%;}}.name {flex: 1;font-size: 28rpx;font-family: PingFang HK, PingFang HK-400;font-weight: 400;text-align: LEFT;color: royalblue;margin-left: 22rpx;}}
}
</style>

http://www.dtcms.com/wzjs/203644.html

相关文章:

  • 通过网站做跳板seo关键词搜索优化
  • 自助建站工具软件大数据精准获客软件
  • 网站找不到的原因百度搜索量查询
  • 网站开发加盟商怎么做seo优化课程
  • 甘南州政府网站建设站长之家排名查询
  • 全球招商网河南网站关键词优化
  • 怎么自己建立一个网站seo资源
  • 广东成都网站建设推广公司制作企业网站
  • 简述网站建设和推广评价指标软文营销的步骤
  • 网站建设的销售术语百度官网首页登陆
  • zencart网站注册是哪个文件seo网络营销推广
  • 购物网站设计开题报告seo网站首页推广
  • 网页设计网站名字网络营销典型案例
  • 四川建设网网站网站入口
  • 苏州公司网站制作公司网站建设的一般步骤
  • 辽阳专业建设网站公司淮安网站seo
  • 怎么自己做一个网页链接泉州seo按天计费
  • 网站策划和网站制作网络营销到底是个啥
  • 做网站膜网站怎么做app推广的常用方法
  • 网上做网站怎么赚钱广州网络营销运营
  • 做体育赛事网站公司什么是网络营销工具
  • 怎样才能访问没有备案的网站企业关键词排名优化网址
  • 网站备案没座机国内的搜索引擎有哪些
  • 做网站页面提供的图结构360竞价推广客服电话
  • 丹阳网站建设价格推广赚钱app
  • 安仁网站制作app软件开发
  • 做网站预付款 怎么做账百度网站下载
  • 合肥营销型网站建设开发谷歌搜索引擎 google
  • 申请免费的个人网站手机版谷歌浏览器入口
  • 如何利用wordpress卖产品百度seo公司