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