|
@@ -1,7 +1,8 @@
|
|
|
<template>
|
|
|
<view class="content">
|
|
|
<view class="one">
|
|
|
- <upload :list="file" name="file" :count="6" @uplSuc="uplSuc" @uplDel="uplDel"></upload>
|
|
|
+ <upload :list="form.file" name="file" :count="1" @uplSuc="uplSuc" @uplDel="uplDel"></upload>
|
|
|
+ <button @tap="toSubmit()">提交</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
@@ -14,17 +15,9 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- file: [],
|
|
|
- logo: [ //
|
|
|
- {
|
|
|
- id: "20230216100918",
|
|
|
- name: "头像.jpg",
|
|
|
- status: "success",
|
|
|
- uid: 1676513358695,
|
|
|
- uri: "/files/projectadmin/imgurl/20230216100918.jpg",
|
|
|
- url: "http://47.93.34.200/files/projectadmin/imgurl/20230216100918.jpg"
|
|
|
- }
|
|
|
- ]
|
|
|
+ form: {
|
|
|
+ file: [],
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
onLoad() {},
|
|
@@ -32,15 +25,18 @@
|
|
|
// 图片上传
|
|
|
uplSuc(e) {
|
|
|
const that = this;
|
|
|
- that.$set(that, `${e.name}`, [...that[e.name], e.data]);
|
|
|
+ that.$set(that.form, `${e.name}`, [...that.form[e.name], e.data]);
|
|
|
},
|
|
|
// 图片删除
|
|
|
uplDel(e) {
|
|
|
const that = this;
|
|
|
- let data = that[e.name];
|
|
|
+ let data = that.form[e.name];
|
|
|
let arr = data.filter((i, index) => index != e.data.index);
|
|
|
- that.$set(that, `${e.name}`, arr);
|
|
|
+ that.$set(that.form, `${e.name}`, arr);
|
|
|
},
|
|
|
+ toSubmit(){
|
|
|
+ console.log(this.form);
|
|
|
+ }
|
|
|
|
|
|
},
|
|
|
};
|