localuploadImg(file:any){
// console.log(file.file,'9张图片上传)
var fileArray:any =[]
fileArray.push(file.file)
//@ts-ignore
let put= async (file:any)=> {
try {
let date = new Date()
let year = date.getFullYear().toString()
let mouth = (date.getMonth() + 1).toString()
let day = date.getDate().toString()
let hour = date.getHours().toString()
let min = date.getMinutes().toString()
let seconds = date.getSeconds().toString()
let tmpArrtwo = year + mouth + day + hour + min + seconds +file.name
let result =await client.put(‘paofu2.0/properties/’ +tmpArrtwo,file)
if(result.res.status==200){
this.
m
e
s
s
a
g
e
(
s
h
o
w
C
l
o
s
e
:
t
r
u
e
,
m
e
s
s
a
g
e
:
′
上
传
成
功
′
,
t
y
p
e
:
′
s
u
c
c
e
s
s
′
)
;
/
/
@
t
s
−
i
g
n
o
r
e
t
h
i
s
.
message({ showClose: true, message: '上传成功', type: 'success' }); //@ts-ignore this.
message(showClose:true,message:′上传成功′,type:′success′);//@ts−ignorethis.refs.imgMutilply.clearFiles()
let trueUrl= client.signatureUrl(‘paofu2.0/properties/’ + tmpArrtwo, {
expires: 315360000,
})
this.paramsFillThree.selfGoodsPictureVOList.push({imageId:null,ossAddress:trueUrl})
}
} catch (e) {
console.log(e);
this.$message('上传错误')
}
}
this.paramsFillThree.selfGoodsPictureVOList=[]
fileArray.forEach((file:any,index:number)=>{
put(file)
})
}