shareFileMessage概率性无效?
shareFileMessage使用过程中出现概率性有用,大概率性失效的问题。真机仿真结果如图[图片] 代码如下: dataRowClick: function (e, id){
var model = products_url[id-1].model;
var statue = "已发布";
if (products_url[id-1].url == 'null'){
statue = "在研"
}
console.log(e);
console.log(statue)
var products_head_url ='cloud://cloud1-7gvpe9lfc973e8bc.636c-cloud1-7gvpe9lfc973e8bc-1316841949/CAD/';
let fileID = products_head_url+model+'.dwg';
console.log(fileID); // 打印文件链接
if(statue == "在研"){
wx.showToast({
title: '未发布',
duration:2000,
});
return;
}
wx.showLoading({
title:'下载中',
duration:1000
});
wx.cloud.downloadFile({
fileID: fileID, // 使用文件链接
success: function (res) {
var fileName = fileID.split('/').pop()
// wx.saveFile({
// tempFilePath: res.tempFilePath,
// filePath: wx.env.USER_DATA_PATH + '/' + fileName,
// success: function (res) {
// wx.showToast({
// title: '下载成功',
// icon:'success',
// duration:2000
// })
// }
// })
wx.shareFileMessage({
filePath: res.tempFilePath,
// filePath: wx.env.USER_DATA_PATH + '/' + fileName,
success(data) {
console.log('转发成功!!!',data)
},
fileName:fileName,
fail: console.error,
})
}
})
},
dataRowClick绑定在表格的一行点击事件,用 <view id='{{item[keyName].val}}' style="width:{{dataAreaWidth}}px;height:{{rowHeight}}px;" bindtap="dataRowClick">