Browse Source

上传图片回显修改

wyx
fp 1 month ago
parent
commit
12f17e1666
  1. 4
      .gitignore
  2. 2
      pages/tabBar/sdPage/sfReport.vue
  3. 12
      pages/tabBar/xjPage/xj.vue

4
.gitignore

@ -1,2 +1,4 @@
/unpackage/ /unpackage/
.history .history
uni_modules/
node_modules/

2
pages/tabBar/sdPage/sfReport.vue

@ -136,14 +136,12 @@ export default {
padding-bottom: 40rpx; padding-bottom: 40rpx;
} }
.bg-box { .bg-box {
/* padding-top: 40rpx; */
width: 100vw; width: 100vw;
height: 280rpx; height: 280rpx;
object-fit: cover; object-fit: cover;
display: block; display: block;
position: relative; position: relative;
display: flex; display: flex;
/* align-items: center; */
} }
.bg-img{ .bg-img{
position: absolute; position: absolute;

12
pages/tabBar/xjPage/xj.vue

@ -116,11 +116,11 @@ export default {
}, },
methods: { methods: {
afterRead(event) { afterRead(event) {
let files = Array.isArray(event) ? event.file : [event.file] // let files = Array.isArray(event) ? event : [event]
this.fileList = this.fileList.concat(files) this.fileList = this.fileList.concat(event.file)
// console.log(this.fileList); // console.log(this.fileList);
this.fileList.forEach( item => { this.fileList.forEach( file => {
this.uploadFile(item[0]) this.uploadFile(file)
}); });
}, },
onDelete(event) { onDelete(event) {
@ -175,10 +175,10 @@ export default {
}, },
success(res) { success(res) {
let data = JSON.parse(res.data) let data = JSON.parse(res.data)
console.log(data); // console.log(data);
if (data.url) { if (data.url) {
that.form.imageList.push({ that.form.imageList.push({
url:data.url, url: data.url,
name: '', name: '',
format: file.type format: file.type
}) })

Loading…
Cancel
Save