信达小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
830 B

2 weeks ago
const _app = getApp<IAppOption>();
Page({
data: {
doc: '1',
2 weeks ago
fileIcon: {
pdf: 'file-icon1',
doc: 'file-icon2',
docx: 'file-icon3',
pptx: 'file-icon4',
xls: 'file-icon5',
xlsx: 'file-icon6',
ppt: 'file-icon7',
none: 'file-icon8',
},
2 weeks ago
},
onLoad() {},
2 weeks ago
handleDownload() {
wx.downloadFile({
url: '',
success: (res) => {
if (res.statusCode === 200) {
wx.openDocument({
filePath: res.tempFilePath,
success: () => {
console.log('打开文档成功');
},
fail: (err) => {
console.error('打开文档失败', err);
},
});
} else {
console.error('下载文件失败', res);
}
},
});
},
2 weeks ago
});
export {};