oil-station/gasStation-uni/pagesMy/feedback/feedback.vue

149 lines
2.9 KiB
Vue
Raw Normal View History

2023-11-28 10:44:18 +08:00
<template>
<view class="content">
<view class="container">
<view class="my-header">
2023-11-28 14:43:36 +08:00
<view class="my-icons" @click="goback"> <uni-icons type="left" color="#ffffff" size="16"></uni-icons>
</view>
2023-11-28 10:44:18 +08:00
<view class="my-text">意见反馈</view>
<view class="my-icons"></view>
</view>
<!-- 顶部区域 -->
2023-11-28 14:43:36 +08:00
<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>
2023-11-28 10:44:18 +08:00
</view>
</view>
</template>
<script>
2023-11-28 14:43:36 +08:00
import upload from '@/utils/upload.js'
2023-11-28 10:44:18 +08:00
export default {
data() {
return {
title: '',
2023-11-28 14:43:36 +08:00
value5: '',
fileList1: [],
2023-11-28 10:44:18 +08:00
}
},
components: {
},
methods: {
2023-11-28 14:43:36 +08:00
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)
})
},
2023-11-28 10:44:18 +08:00
goback() {
uni.navigateBack()
}
}
}
</script>
<style scoped lang="scss">
.content {
2023-11-28 14:43:36 +08:00
background: #ffffff;
2023-11-28 10:44:18 +08:00
}
.container {
width: 100%;
box-sizing: border-box;
padding-top: 88px;
2023-11-28 14:43:36 +08:00
z-index: 999999999;
2023-11-28 10:44:18 +08:00
}
.my-header {
width: 100%;
height: 88px;
2023-11-28 14:43:36 +08:00
background: #1678ff;
2023-11-28 10:44:18 +08:00
display: flex;
align-items: center;
justify-content: space-between;
2023-11-28 14:43:36 +08:00
color: #ffffff;
2023-11-28 10:44:18 +08:00
box-sizing: border-box;
padding: 0px 15px;
padding-top: 40px;
.my-icons {
width: 20px;
}
position: fixed;
top: 0px;
}
2023-11-28 14:43:36 +08:00
.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;
}
2023-11-28 10:44:18 +08:00
</style>