wx.opendocument 程序文件,opendocument怎么打開
新開頁面打開文檔,支持格式:doc, xls, ppt, pdf, docx, xlsx, pptx
OBJECT參數(shù)說明:
| 參數(shù) | 說明 | 必填 | 說明 | 最低版本 |
|---|---|---|---|---|
| filePath | String | 是 | 文件路徑,可通過 downFile 獲得 | |
| fileType | String | 否 | 文件類型,指定文件類型打開文件,有效值 doc, xls, ppt, pdf, docx, xlsx, pptx | 1.4.0 |
| success | Function | 否 | 接口調(diào)用成功的回調(diào)函數(shù) | |
| fail | Function | 否 | 接口調(diào)用失敗的回調(diào)函數(shù) | |
| complete | Function | 否 | 接口調(diào)用結(jié)束的回調(diào)函數(shù)(調(diào)用成功、失敗都會執(zhí)行) |
示例代碼
wx.downloadFile({
url: 'http://example.com/somefile.pdf',
success: function (res) {
var filePath = res.tempFilePath
wx.openDocument({
filePath: filePath,
success: function (res) {
console.log('打開文檔成功')
}
})
}
})
第二部分:如何開通一個(gè)小商店

立即掃碼關(guān)注

多門店/直營/加盟連鎖管理系統(tǒng)