小程序上传视频-打卡小程序无法上传视频-微信小程序视频上传
wxmlviewclass"page-body-info"blockwx:if"{{src''}}"viewclass"image-plusimage-plus-nb"bindtap"chooseVideo"viewclass"image-plus-horizontal"/viewviewclass"image-plus-vertical"/view/viewviewclass"image-plus-text"添加视频/view/blockblockwx:if"{{src!''}}"videosrc"{{src}}"class"video"/video/block/view1.
js
//jsPage({data:{src:''},//选择视频chooseVideo:function(){varthatthiswx.chooseVideo({success:function(res){that.setData({src:res.tempFilePath,})}})},//上传视频目前后台限制最大100M,以后如果视频太大可以在选择视频的时候进行压缩uploadvideo:function(){varsrcthis.data.src;wx.uploadFile({url:'http://172.16.98.36:8080/upanddown/upload2',//服务器接口method:'POST',filePath:src,header:{'content-type':'multipart/form-data'},name:'files',//服务器定义的Key值success:function(){console.log('视频上传成功')},fail:function(){console.log('接口调用失败')}})}})TAG标签: 小程序上传视频打卡小程序无法上传视频微信小程序视频上传
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。

