当前位置: 首页 > news >正文

北京北站如何在微信创建公众号

北京北站,如何在微信创建公众号,wordpress收发邮件功能,网站域名注册证书微信小程序中pdf的上传、下载及excel导出 pdf上传上传1#xff1a;上传2#xff1a; pdf下载导出excel pdf上传 上传两种方法#xff1a; 上传1#xff1a; 1.用vant weapp组件#xff1a; //pdf上传--vant weapp组件 view classcontentvan-u… 微信小程序中pdf的上传、下载及excel导出 pdf上传上传1上传2 pdf下载导出excel pdf上传 上传两种方法 上传1 1.用vant weapp组件 //pdf上传--vant weapp组件 view classcontentvan-uploaderfile-list{{ fileList }} bind:after-readafterReadFile acceptfile upload-iconpluspreview-size30pxmax-count1deletable{{deletableFile}}/van-uploader /view page({data:{fileList:[],//pdf上传} })afterReadFile: function (e) {let that this;const { file } e.detail;let myId that.data.myId; //console.log(file,1000);wx.uploadFile({url: api.hhh?filefile.urlschedulingIdmyId,//服务器上的pdf地址filePath: file.url,name: file,// formData: { // file: file.url,// schedulingId:myId// },success(res) {// 上传完成需要更新 fileListconst { fileList [] } that.data;fileList.push({ ...file });that.setData({ fileList });},}); },上传2 view classcontent bindtapuploadFileTap上传 /view//pdf上传--原生组件 uploadFileTap:function(e){let that this;let myId that.data.myId; wx.chooseMessageFile({count: 1,type: file,success (res) {// tempFilePath可以作为img标签的src属性显示图片const tempFilePaths res.tempFileswx.uploadFile({url: url,//服务器上的pdf地址 filePath: tempFilePaths[0].path,name: file,formData: {file: tempFilePaths[0].path,schedulingId:myId},success (res){const data res.data//do somethingwx.showToast({title: 数据上传成功,icon: none,duration: 3000})}})}}) }, pdf下载 参考https://blog.csdn.net/weixin_38566069/article/details/110229404 //下载pdf downloadPDF:function(e){let that this;let myId that.data.myId; wx.showLoading({title: 加载中...,mask: true});//获取pdf地址app.get(api.xxxx, {schedulingId: myId, //}).then(res {if (res.code 200) {wx.hideLoading()let pdfUrlres.data ? (res.data.pdfUrl ? res.data.pdfUrl : null) : nullif(pdfUrl){const fileExtName .pdf;const randfile new Date().getTime() fileExtName;const newPath ${wx.env.USER_DATA_PATH}/${randfile};that.deletContract();//下载wx.downloadFile({url: pdfUrl,filePath: newPath,success: function (res) {const filePath res.tempFilePath;wx.openDocument({filePath: newPath,showMenu: true,fileType: pdf,success: function (res) {}})},fail: function (res) {wx.hideLoading();}})}else{wx.showToast({title: 请先上传pdf数据,icon: none,duration: 3000})}} else {wx.hideLoading()wx.showToast({title: 获取数据失败,icon: none,duration: 3000})}}).catch((err) {wx.hideLoading()wx.showToast({title: err,icon: none,duration: 3000})}); },// 删除本地文件 deletContract() {try {let file wx.getFileSystemManager();file.readdir({dirPath: ${wx.env.USER_DATA_PATH},success: res {console.log(res);if (res.files.length 2) {file.unlink({filePath: ${wx.env.USER_DATA_PATH}/${res.files[0]},complete: res {}})}}})} catch (error) {} },导出excel //导出ExceldownloadExcel:function(e){let that this;let myId that.data.myId; wx.showLoading({title: 加载中...,mask: true});app.get(api.xxxExcel, {schedulingId: myId, }).then(res {if (res.code 200) {let excelUrlres.data ? res.data : nullif(excelUrl){let typeexcelUrl.split(.).pop();let fileExtName ;if(type){//空wx.showToast({title: 导入的非Excel文件,icon: none,duration: 3000})return false}else if(typexls){fileExtName.xls}else if(typexlsx){fileExtName.xlsx}const randfile new Date().getTime() fileExtName;const newPath ${wx.env.USER_DATA_PATH}/${randfile};that.deletContract();wx.downloadFile({url: excelUrl,filePath: newPath,success: function (res) {wx.hideLoading()const filePath res.filePath;wx.openDocument({filePath: newPath,showMenu: true,fileType: type,success: function (res) {}})},fail: function (res) {wx.hideLoading();}})}else{wx.showToast({title: 请先上导入Excel数据,icon: none,duration: 3000})}} else {wx.hideLoading()wx.showToast({title: 获取Excel数据失败,icon: none,duration: 3000})}}).catch((err) {wx.hideLoading()wx.showToast({title: err,icon: none,duration: 3000})});},提示突然冒出一个报错wx.chooseMessageFile点击很多次后就突然无效了 昨天上传功能在【微信开发工具和移动端】都可以用早上突然实现了。 查了下是官方给出的解释是 2023年9月15日之前此功能逻辑只对开发版/体验版生效开发者请尽快进行隐私弹窗适配、发版。2023年9月15日之后将对正式版生效详情可见《关于小程序隐私保护指引设置的公告》。 具体见 https://developers.weixin.qq.com/community/develop/doc/0002aa86b6ccb056ff20a04e96bc00?jumptocomment https://developers.weixin.qq.com/community/develop/doc/00042e3ef54940ce8520e38db61801
http://www.hkea.cn/news/14478014/

相关文章:

  • 关于做公司网站建设你应该知道的织梦本地做的网站内网访问不
  • 邢台做网站的那好建设部网站录入业绩
  • 开发区网站建设工作职责专业软件开发培训机构
  • 什么网站可以自学ps做贵宾卡wordpress 登录菜单
  • 好的html5网站模板下载应用市场
  • 网站开发市场人员的招聘大港手机网站建设
  • 域名做网站名职业培训机构需要什么资质
  • 固安建设局网站被通知公司网站域名到期
  • 网站显示结算京东app下载安装
  • 网站推广网站关键词排名怎么做最新国际消息
  • 竞价排名的优缺点seo搜索引擎推广什么意思
  • 服装电子商务网站建设建设网站初步目标咋写
  • 新品销售网站建设做年报的网站
  • 做网站用宋体有版权问题吗wordpress 发布时
  • 0460网站之家东莞阳光网上投诉
  • 织梦做视频网站租远程服务器
  • 手机版企业网站php域名空间网站
  • 在西部数码上再备案一个网站ftp百色网站建设
  • 广州部队网站建设费用wordpress主题ftp
  • 网站怎么做内链接地址建设行业门户网站
  • 网站建设哪儿济南兴田德润什么活动网站建设 客户需求
  • 家具网站模版重庆中国建设监理协会网站
  • 网站关键词怎么设置下载拼多多app免费下载
  • 龙江网站建设前端开发工程师培训哪里有
  • 东莞常平汽车站时刻表太月星网站建设程序开发网页设计
  • 亿省心网站托管网站开发需要掌握哪些技术
  • 珠海横琴天聚建设工程有限公司网站如何做国际网站首页
  • 电子商务网站主要功能怎样购买起名软件自己做网站
  • 教学平台网站建设合同网站建设的招标文件
  • led灯 东莞网站建设广东网站设计推荐