|
|
@@ -373,6 +373,38 @@ Page({
|
|
|
this.filterFunction();
|
|
|
// 查询常用功能
|
|
|
this.getComMenu();
|
|
|
+ const filename = 'down'
|
|
|
+ const fileExtName = ".pdf";
|
|
|
+ const randfile = filename + fileExtName;
|
|
|
+ //wx.env.USER_DATA_PATH 是微信提供了一个用户文件目录给开发者,开发者对这个目录有完全自由的读写权限
|
|
|
+ const newPath = `${wx.env.USER_DATA_PATH}/${randfile}`;
|
|
|
+
|
|
|
+ console.log('eee',newPath);
|
|
|
+ wx.downloadFile({
|
|
|
+ // 示例 url,并非真实存在
|
|
|
+ url: 'http://192.168.0.57:8080/wx-print?svc_code=dkic_b1&doc=sa&layout_id=6caa8bc8-6ad8-45af-8e80-881e4081d27b&data_id=10112024-0412-0000-0000-00002fd1d7b4',
|
|
|
+ filePath: newPath,
|
|
|
+ // fileType:'pdf',
|
|
|
+ success: function (resd) {
|
|
|
+ console.log('resd',resd);
|
|
|
+ const filePath = resd.filePath || resd.tempFilePath
|
|
|
+ wx.openDocument({
|
|
|
+ filePath: filePath,
|
|
|
+ showMenu: true,
|
|
|
+ // fileType:'pdf',
|
|
|
+ success: function (reso) {
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },fail(err){
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // wx.navigateTo({
|
|
|
+ // url: '/package-base-select/pages/web-view-select/web-view-select',
|
|
|
+ // success: function (res) {
|
|
|
+ // res.eventChannel.emit('url', 'http://192.168.0.57:8080/wx-print?svc_code=dkic_b1&doc=sa&layout_id=6caa8bc8-6ad8-45af-8e80-881e4081d27b&data_id=10112024-0412-0000-0000-00002fd1d7b4');
|
|
|
+ // }
|
|
|
+ // })
|
|
|
},
|
|
|
|
|
|
/* 点击icon事件 */
|