...
|
...
|
@@ -160,7 +160,6 @@ |
|
|
this.max = 9
|
|
|
nowNum = Math.abs(this.uploadLists.length - this.max);
|
|
|
thisNum = (this.chooseNum > nowNum ? nowNum : this.chooseNum) //可选数量
|
|
|
console.log('111111111111111111',nowNum,thisNum)
|
|
|
this.$emit('changeType',1)
|
|
|
this.chooseImage(thisNum)
|
|
|
} else if (res.tapIndex == 1) {
|
...
|
...
|
@@ -178,10 +177,6 @@ |
|
|
this.max = 9
|
|
|
nowNum = Math.abs(this.uploadLists.length - this.max);
|
|
|
thisNum = (this.chooseNum > nowNum ? nowNum : this.chooseNum) //可选数量
|
|
|
console.log('111111111111111111',nowNum,thisNum)
|
|
|
nowNum = Math.abs(this.uploadLists.length - this.max);
|
|
|
thisNum = (this.chooseNum > nowNum ? nowNum : this.chooseNum) //可选数量
|
|
|
console.log('111111111111111111',nowNum,thisNum)
|
|
|
this.uploadType = 'image'
|
|
|
this.chooseImage(thisNum)
|
|
|
}else{
|
...
|
...
|
@@ -192,9 +187,7 @@ |
|
|
uni.chooseVideo({
|
|
|
count: thisNum,
|
|
|
sourceType: this.sourceType,
|
|
|
maxDuration:15,
|
|
|
success: (res) => {
|
|
|
console.log('11111111111111',res.size/(1024*1024))
|
|
|
if(res.size/(1024*1024) > 100){
|
|
|
uni.showToast({
|
|
|
title:'视频大小大于100M,请重新选择',
|
...
|
...
|
@@ -212,26 +205,27 @@ |
|
|
// #ifndef APP-PLUS
|
|
|
let suffix = res.name.substr(res.name.lastIndexOf('.'),res.name.length)
|
|
|
// #endif
|
|
|
console.log('待上传视频的后缀名为',suffix)
|
|
|
//获取七牛云token
|
|
|
uni.request({
|
|
|
url:this.apiUrl + '/common/getQiniuToken',
|
|
|
method:'POST',
|
|
|
success: (qiniuRet) => {
|
|
|
console.log('获取七牛云配置信息',qiniuRet)
|
|
|
uni.uploadFile({
|
|
|
url: 'https://up-z2.qiniup.com',
|
|
|
filePath: filePath,
|
|
|
name: 'file',
|
|
|
formData: {
|
|
|
'key': qiniuRet.data.data.key+suffix,
|
|
|
'token': qiniuRet.data.data.token
|
|
|
'key' : qiniuRet.data.data.key+suffix,
|
|
|
'token' : qiniuRet.data.data.token
|
|
|
},
|
|
|
success: (uploadFileRes) => {
|
|
|
console.log('上传七牛云结果',JSON.parse(uploadFileRes.data))
|
|
|
uni.hideLoading()
|
|
|
this.uploadLists.push('/'+JSON.parse(uploadFileRes.data).key)
|
|
|
this.$emit("changeVideo", this.uploadLists);
|
|
|
},
|
|
|
fail: (err) => {
|
|
|
console.log('上传七牛云报错',err)
|
|
|
}
|
|
|
})
|
|
|
}
|
...
|
...
|
|