<button class="iconfont icon-fenxiang" @tap="handleShare(item)"></button>
handleShare( val) {
let that = this;
//先下载文档到本地
Taro.downloadFile({
url: val.fileUrl,
success: function (res) {
console.log("成功", res);
var filePath = res.tempFilePath;
var fileName = val.fileName;
//在分享文件
Taro.shareFileMessage({
filePath: filePath,
fileName: fileName,
fail() {
showToast("分享失败");
},
});
},
});
},