diff --git a/pages/tabBar/xjPage/xj.vue b/pages/tabBar/xjPage/xj.vue index dfb0982..20d6d95 100644 --- a/pages/tabBar/xjPage/xj.vue +++ b/pages/tabBar/xjPage/xj.vue @@ -35,7 +35,7 @@ :deletable="true" :show-upload-list="true" :file-list="fileList" - accept="image" + accept="image,video" @after-read="afterRead" @delete="onDelete" > @@ -144,7 +144,7 @@ export default { var arry = []; this.fileList.filter((v, i) => { arry.push({ - name: '', + name: v.name || '', format: v.type, url:v.url }); @@ -156,7 +156,7 @@ export default { var arry = []; this.fileList.filter((v, i) => { arry.push({ - name: '', + name: v.name || '', format: v.type, url:v.url }); @@ -193,42 +193,8 @@ export default { }); }); }, - - uploadFile(file){ - let that = this - console.log('uploadFile',file); - uni.uploadFile({ - url: this.uploadUlr, - filePath: file.url, - name: 'file', //对应后台接口参数名 - method: 'post', - header: { - "Authorization": uni.getStorageSync('token') - }, - formData: { - //要上传的文件 - file: file - }, - success(res) { - let data = JSON.parse(res.data) - // console.log(data); - if (data.url) { - that.form.imageList.push({ - url: data.url, - name: '', - format: file.type - }) - } - }, - fail(res) { - uni.showToast({ - icon: 'error', - title: '图片上传失败!' - }) - } - }) - }, handleBtn () { + console.log(this.form); if(!this.form.apartmentId){ uni.showToast({ icon: 'none',