- wx.navigateTo使用报错?
tapCell: function (event) { try{ var index = event.currentTarget.id; var data = this.data.list[index]; getApp().globalData.currentCase = data; // common.reportAnalytics('main_detail'); // console.log(appServiceSDKScriptError) console.log( '/pages/bid/biddetail/biddetail?id=' + data['id'],typeof(data['id'])) wx.navigateTo({ url: '../biddetail/biddetail', complete:function(res){ console.log('这是路由',res) } }) }catch(error){ console.log(error) } }, 其他页面的跳转都正常使用,在这里确实是报错了,但是找不到问题点在哪里。或者有没有知道,产生这个报错的原因的
09-01 - wx.openDocument打不开除了pdf外的其他常用文件如:doc、docx、xls?
api:wx.openDocument 开发者工具版本:1.06.2405020win32-x64 wx.openDocument打不开除了pdf外的其他常用文件如:doc、docx、xls、xlsx、ppt、pptx
2024-07-09 - 小程序同样安卓手机,有的打不开附件,有的就可以打开附件。这是怎么回事?
previewFileAction: function (e) { console.log(e.currentTarget.dataset.item.file_name) wx.showLoading({ title: '正在加载预览', }) this.setData({ showFileDialog: false }) var that = this // that.toH5Page(that.data.obj.file_path) // wx.hideLoading() let file = decodeURIComponent(that.data.obj.file_path); // 解码(注意:涉及到文件名中有中文需要转码) console.log(file) file = this.getFilePathName(file); // 将文件路径过滤,格式为【文件名+.后缀名】 console.log(file) wx.downloadFile({ // 示例 url,并非真实存在 url: that.data.obj.file_path, header: { 'content-type': 'application/json', }, filePath: wx.env.USER_DATA_PATH + '/' + that.data.obj.file_name, success: function (res) { console.log(res) const filePath = res.filePath wx.openDocument({ filePath:filePath, // fileType:'docx', showMenu: true, success: function (res) { wx.hideLoading() console.log(res) }, fail: function(res) { console.log(res) } }) }, fail:function(res){ console.log(res) } }) },
2023-06-07