This commit is contained in:
2020-07-07 17:47:00 +08:00
parent 77083c0404
commit 5ede514a02
8 changed files with 230 additions and 90 deletions

View File

@@ -3,8 +3,7 @@
<view class="main-container">
<textarea auto-height placeholder="发表您的意见吧,我们会做得更好." maxlength="200" v-model="text" />
<u-upload
ref="uUpload"
@on-uploaded="onUploaded"
ref="uUpload"
:custom-btn="true"
:max-count="count"
:auto-upload="false"
@@ -21,6 +20,7 @@
export default {
data() {
return {
action: $u.http.baseUrl + 'Upload/uploadfile',
count: 4, // 最大图片数量
text: '',
imageList: []
@@ -28,11 +28,33 @@ export default {
},
methods: {
submit() {
this.$refs.uUpload.upload();
console.log(this.action);
console.log(this.imageList);
// this.$refs.uUpload.upload();
let promise = [];
this.imageList.forEach(url => {
// this.uploadImage(url);
})
Promise.all(promise).then(() => {
})
},
async uploadImage(file) {
this.$u.api.uploadfile({
file: file,
}).then(res => {
if(res.errCode == 0) {}
})
},
writeFeedback() {
this.$u.api.writeFeedback({
fb_content: this.text,
fb_images: '',
}).then(res => {
if(res.errCode == 0) {}
})
},
onUploaded(list) {
console.log(this.text, list)
}
},
}
</script>