Browse Source

模板下载

v3
蟑螂恶霸 2 years ago
parent
commit
dbd735c12a
  1. 71
      src/views/enforce/enforcementPlanAdd.vue

71
src/views/enforce/enforcementPlanAdd.vue

@ -384,40 +384,43 @@
} }
const downloadFile = async () => { const downloadFile = async () => {
var url = 'http://192.168.110.41:3301/#/pdfView?url=/profile/upload/2024/09/09/df8d2b5a9615603bdff8cf7fe0e2d836.pdf'; // var url = 'http://127.0.0.1:85/profile//EnforcementInspectionPlanTemplate.xlsx';
console.log(url); var url = 'http://jdm.szssfj.cn/jdmApi/profile//EnforcementInspectionPlanTemplate.xlsx';
szyptGetToken(param, success => { // var url = 'http://10.132.108.3:85/profile//EnforcementInspectionPlanTemplate.xlsx';
let resMsg = success.data; window.location.href = url;
console.log(resMsg); // console.log(url);
wx.config({ // szyptGetToken(param, success => {
// 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 // let resMsg = success.data;
debug: false, // console.log(resMsg);
// 必填,公众号的唯一标识 // wx.config({
appId: resMsg.corpid, // // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
// 必填,生成签名的时间戳 // debug: false,
timestamp: resMsg.timestamp, // // 必填,公众号的唯一标识
// 必填,生成签名的随机串 // appId: resMsg.corpid,
nonceStr: resMsg.nonceStr, // // 必填,生成签名的时间戳
// 必填,签名,见附录1 // timestamp: resMsg.timestamp,
signature: resMsg.signature, // // 必填,生成签名的随机串
// 必填,需要使用的JS接口列表,所有JS接口列表见附录2 // nonceStr: resMsg.nonceStr,
jsApiList: ["scanQRCode"], // // 必填,签名,见附录1
}); // signature: resMsg.signature,
wx.ready(() => { // // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
//微信扫一扫请求操作 // jsApiList: ["scanQRCode"],
wx.downloadImage({ // });
serverId: '', // 需要下载的图片的服务器端ID,由uploadImage接口获得 // wx.ready(() => {
isShowProgressTips: 1, // 默认为1,显示进度提示 // //微信扫一扫请求操作
success: function (res) { // wx.downloadImage({
var localId = res.localId; // 返回图片下载后的本地ID // serverId: '', // 需要下载的图片的服务器端ID,由uploadImage接口获得
} // isShowProgressTips: 1, // 默认为1,显示进度提示
}); // success: function (res) {
}); // var localId = res.localId; // 返回图片下载后的本地ID
wx.error((res) => { // }
console.log("获取失败"); // });
}); // });
}, error => { // wx.error((res) => {
}); // console.log("获取失败");
// });
// }, error => {
// });
} }
const uploadFiles = (file) => { const uploadFiles = (file) => {
uploadFile(file, (res) => { uploadFile(file, (res) => {

Loading…
Cancel
Save