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

学美工难吗东莞seo排名外包

学美工难吗,东莞seo排名外包,国内重大新闻10条2022,云巅seo云点播是专门应对上传大视频文件的。 腾讯云点播文档:https://cloud.tencent.com/document/product/266/18177 这个文档比较简单,实在不行,把demo下载下来,一看就明白了,然后再揉一下挪到自己的项目里。完事。 getSign…

云点播是专门应对上传大视频文件的。
腾讯云点播文档:https://cloud.tencent.com/document/product/266/18177
这个文档比较简单,实在不行,把demo下载下来,一看就明白了,然后再揉一下挪到自己的项目里。完事。
getSignature: function(callback) {
uni.request({
url: ‘https://www.xxx.com/mnp/zsapi/getSignature.php’,
method: ‘POST’,
data: {
mid: uni.getStorageSync(‘mid’),
token: uni.getStorageSync(‘token’)
},
header: {
‘content-type’: ‘application/x-www-form-urlencoded’
},
success: function(res) {
if (res.data.signature) {
callback(
res.data.signature
);
} else {
return ‘获取签名失败’;
}
}
});
},
ChooseImage(e) {
console.log(e)
let that = this
// 选择多张图片
uni.chooseMedia({
count: 15, // 最多可以选择的图片张数
mediaType: [‘image’, ‘video’],
sizeType: [‘compressed’], // 可以指定是原图还是压缩图
sourceType: [‘album’], // 可以指定来源是相册还是相机
// maxDuration: 30,
// camera: ‘back’,
success: function(res) {
console.log(res, res.tempFiles[0], ‘???’)
if (res.type == ‘video’) {
if (e == ‘0’) {
uni.showToast({
title: ‘第一张必须上次图片’,
duration: 2000,
icon: ‘none’
})
return
}
//选择视频
that.videoFile = res.tempFiles[0]
setTimeout(() => {
that.startUpload(e)
}, 500)

					} else {// 选择图片成功,res.tempFiles 包含选择的图片路径列表uni.showLoading({title: '上传中...'})// console.log(res.tempFiles)that.uploadDIY( res.tempFiles, 0, 0, 0,  res.tempFiles.length,e);returnfor (let i = 0; i < res.tempFiles.length; i++) {uni.uploadFile({url: 'https://www.xxx.com/mnp/zsapi/gongdi_upload.php',filePath: res.tempFiles[i].tempFilePath,name: 'file',formData: {'mid': uni.getStorageSync('mid'),'token': uni.getStorageSync('token'),},success(res) {const data = JSON.parse(res.data.replace('\uFEFF',''))console.log(data)if (data.bs == 'success') {uni.showToast({title: data.errmsg,duration: 2000,icon: 'success'})that.infolist[e].imglist.push(data.img)} else if (data.bs == 'guoqi') {uni.showToast({title: data.errmsg,duration: 2000,icon: 'error'})setTimeout(function() {uni.redirectTo({url: '../../pagesD/login/login'})}, 500)} else {uni.showToast({title: data.errmsg,duration: 2000,icon: 'error'})}},fail() {uni.showToast({title: '服务器繁忙,请稍后再试',duration: 2000,icon: 'error'})}})}}}})},startUpload(e) {let that = thisuni.showLoading({title: '上传中...',mask: true,})const self = this;const uploader = VodUploader.start({mediaFile: self.videoFile, //必填,把chooseVideo回调的参数(file)传进来getSignature: self.getSignature, //必填,获取签名的函数error: function(result) {console.log("error");console.log(result);// uni.hideLoading();uni.showModal({title: "上传失败",content: JSON.stringify(result),showCancel: false});},progress: function(result) {console.log("progress");console.log(result);// uni.hideLoading();self.progress = parseInt(result.percent * 100)},finish: function(result) {console.log("finish");console.log(result);let brr = []let obj = {}obj.url = result.videoUrlbrr.push(`myvideo${e}`)that.videoarr = brrobj.id =  `myvideo${e}`self.infolist[e].videolist.push(obj)uni.showToast({title: '上传成功',duration: 2000,icon: 'success'})self.reset();}});this.uploader = uploader},uploadDIY(filePaths, successUp, failUp, i, length,e) {let that = thisuni.uploadFile({url: 'https://www.xxxx.com/mnp/zsapi/gongdi_upload.php',filePath: filePaths[i].tempFilePath,name: 'file',formData: {'mid': uni.getStorageSync('mid'),'token': uni.getStorageSync('token'),},success: (res) => {const data = JSON.parse(res.data.replace('\uFEFF',''))if (data.bs == 'success') {uni.showToast({title: data.errmsg,duration: 2000,icon: 'success'})successUp++;// console.log('上传图片成功:', JSON.parse(res.data));// var data = JSON.parse(res.data);// console.log(data)// 把获取到的路径存入imagesurl字符串中that.infolist[e].imglist.push(data.img)// console.log(this.data.imagesurl)} else if (data.bs == 'guoqi') {uni.showToast({title: data.errmsg,duration: 2000,icon: 'error'})setTimeout(function() {uni.redirectTo({url: '../../pagesD/login/login'})}, 500)} else {uni.showToast({title: data.errmsg,duration: 2000,icon: 'error'})}},fail: (res) => {failUp++;},complete: () => {i++;if (i == length) {// Toast('总共' + successUp + '张上传成功,' + failUp + '张上传失败!');} else { //递归调用uploadDIY函数that.uploadDIY(filePaths, successUp, failUp, i, length,e);}},});},
http://www.ritt.cn/news/9633.html

相关文章:

  • 长沙做网站排名杭州余杭区抖音seo质量高
  • 扁平化风格 网站seo关键词选择及优化
  • 网站平台选择百度下载安装
  • 百度 特定网站搜索企业seo如何优化
  • 羊肉口报关做网站南宁网络推广有限公司
  • php做网站的技术难点山东济南seo整站优化费用
  • wordpress 仿糗百seo公司怎么样
  • 怎么做网站文件验证宁波网络推广平台
  • 4399小游戏网页版在线玩江北seo页面优化公司
  • 成都php网站建设百度推广的定义
  • 网站建设优化佛山河南网站推广电话
  • 尉氏网站建设网页推广方案
  • 徐州网站建设哪家好刷外链
  • 家装设计网页版qq群排名优化软件
  • 广州专业网站设计当前疫情十大热点
  • 江北区城乡建设部网站首页提高网站排名
  • 内蒙古自治区党风廉政建设网站深圳龙岗区优化防控措施
  • 网站开发计划书范文百度在线识别图片
  • 在线购物网站的设计宁波seo整站优化软件
  • 网站用oracle做数据库开展网络营销的企业
  • 创造与魔法官方网站做自己友情链接可以随便找链接加吗
  • 万维网的网站数字营销策略有哪些
  • 棋牌游戏在哪做网站上海发布最新情况
  • wordpress搭建的网站能干什么新闻头条最新消息
  • 旅游网站的功能有哪些如何做好推广引流
  • 中天建设集团有限公司西南分公司二十条优化疫情措施
  • 网站域名使用怎么做分录今日国际军事新闻最新消息
  • 一个大网站需要多少钱seo技术分享免费咨询
  • 青岛网站建设价格网站制作策划书
  • 有关网站建设的视频全国最新疫情最新消息