149 lines
2.9 KiB
Vue
149 lines
2.9 KiB
Vue
<template>
|
|
<view class="content">
|
|
<view class="container">
|
|
<view class="my-header">
|
|
<view class="my-icons" @click="goback"> <uni-icons type="left" color="#ffffff" size="16"></uni-icons>
|
|
</view>
|
|
<view class="my-text">意见反馈</view>
|
|
<view class="my-icons"></view>
|
|
</view>
|
|
<!-- 顶部区域 -->
|
|
<view class="box-top">
|
|
<view class="top-title">
|
|
反馈内容
|
|
</view>
|
|
<u--textarea v-model="value5" placeholder="请填写您的反馈和建议" border="bottom"></u--textarea>
|
|
<view class="top-title" style="border-bottom: none;">
|
|
相关截图(选填)
|
|
</view>
|
|
<u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple
|
|
:maxCount="5"></u-upload>
|
|
<view class="anniu">
|
|
<text>提交反馈</text>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import upload from '@/utils/upload.js'
|
|
export default {
|
|
data() {
|
|
return {
|
|
title: '',
|
|
value5: '',
|
|
fileList1: [],
|
|
|
|
}
|
|
},
|
|
|
|
components: {
|
|
|
|
},
|
|
methods: {
|
|
deletePic(event) {
|
|
this[`fileList${event.name}`].splice(event.index, 1)
|
|
},
|
|
// 新增图片
|
|
async afterRead(event) {
|
|
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
|
|
let lists = [].concat(event.file)
|
|
let fileListLen = this[`fileList${event.name}`].length
|
|
lists.map((item) => {
|
|
this[`fileList${event.name}`].push({
|
|
...item,
|
|
|
|
})
|
|
})
|
|
for (let i = 0; i < lists.length; i++) {
|
|
const result = await this.uploadFilePromise(lists[i].url)
|
|
let item = this[`fileList${event.name}`][fileListLen]
|
|
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
|
|
status: 'success',
|
|
message: '',
|
|
url: result
|
|
}))
|
|
fileListLen++
|
|
}
|
|
},
|
|
uploadFilePromise(url) {
|
|
upload({
|
|
url: '/common/upload',
|
|
filePath: url,
|
|
}).then((res) => {
|
|
// console.log('images', res.fileName);
|
|
// this.images.push(res.fileName)
|
|
})
|
|
|
|
},
|
|
goback() {
|
|
uni.navigateBack()
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
.content {
|
|
background: #ffffff;
|
|
}
|
|
|
|
.container {
|
|
width: 100%;
|
|
box-sizing: border-box;
|
|
padding-top: 88px;
|
|
z-index: 999999999;
|
|
}
|
|
|
|
.my-header {
|
|
width: 100%;
|
|
height: 88px;
|
|
background: #1678ff;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
color: #ffffff;
|
|
box-sizing: border-box;
|
|
padding: 0px 15px;
|
|
padding-top: 40px;
|
|
|
|
.my-icons {
|
|
width: 20px;
|
|
|
|
}
|
|
|
|
position: fixed;
|
|
top: 0px;
|
|
}
|
|
|
|
.box-top {
|
|
width: 100%;
|
|
|
|
box-sizing: border-box;
|
|
padding: 10px;
|
|
}
|
|
|
|
.top-title {
|
|
width: 100%;
|
|
box-sizing: border-box;
|
|
padding: 10px 0px;
|
|
border-bottom: 1px solid #e6e6e6;
|
|
}
|
|
|
|
.anniu {
|
|
width: 95%;
|
|
background: #1678ff;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
color: white;
|
|
margin: 10px auto;
|
|
border-radius: 50px;
|
|
box-sizing: border-box;
|
|
padding: 10px 0px;
|
|
|
|
}
|
|
</style> |