Commit b225c178 authored by Facius's avatar Facius

分享文件加文件名

parent 782470a1
......@@ -53,7 +53,7 @@
</view>
</template>
<script>
<script>
export default {
data() {
return {
......@@ -147,7 +147,7 @@
this.loadFileLabel('2', label.id) // 获取新合作商对应品牌
} else {// 品牌
this.loadFileList(this.selected['1'].id, this.selected['2'].id) // 获取文件列表
}
}
},
// 跳转到所有标签
handleMore(key) {
......@@ -164,17 +164,11 @@
id: this.vuex_user.id,
url: item.url
});
let block = (filePath) => {
wx.shareFileMessage({
filePath: filePath,
success() {},
fail: console.error,
})
}
let filePath = this.fileList[(item.url || '').split('/').pop()]
if (filePath) { // 有下载记录
wx.shareFileMessage({ // 如果用checkFile检查文件是否存在后再分享,shareFileMess报错:shareFileMessage:fail can only be invoked by user TAP gesture.
filePath: filePath,
fileName: item.name,
success() {},
fail: (error) => {
console.log(error)
......@@ -182,6 +176,7 @@
this.downloadFile(item.url, (result)=> {
wx.shareFileMessage({
filePath: result.tempFilePath,
fileName: item.name,
success() {},
fail: console.error,
})
......@@ -193,6 +188,7 @@
this.downloadFile(item.url, (res)=> { // 下载
wx.shareFileMessage({
filePath: res.tempFilePath,
fileName: item.name,
success() {},
fail: console.error,
})
......@@ -260,14 +256,6 @@
});
}
},
// 分享文件
shareFile(filePath) {
wx.shareFileMessage({
filePath: filePath,
success() {},
fail: console.error,
})
},
// 获取合作商或品牌列表
async loadFileLabel(type, partnerCompanyId) {
let param = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment