feat:项目中心和个人中心
This commit is contained in:
173
src/pages/personal-center/feedback/index.vue
Normal file
173
src/pages/personal-center/feedback/index.vue
Normal file
@@ -0,0 +1,173 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue'
|
||||
import { FEEDBACK_DESCRIPTION_MAX_LENGTH } from '@/constants/feedback'
|
||||
import deleteIcon from '@/static/icons/X.png'
|
||||
import pdfIcon from '@/static/icons/PDF.png'
|
||||
import pngIcon from '@/static/icons/PNG.png'
|
||||
import { navigateBackWithFallback } from '@/utils/navigate-back'
|
||||
|
||||
const title = ref('')
|
||||
const description = ref('')
|
||||
|
||||
const attachments = ref([
|
||||
{ id: '1', name: '需求文档.pdf', icon: pdfIcon },
|
||||
{ id: '2', name: '系统....pdf', icon: pdfIcon },
|
||||
{ id: '3', name: '参考图.png', icon: pngIcon },
|
||||
])
|
||||
|
||||
const descLength = computed(() => description.value.length)
|
||||
|
||||
function handleBack() {
|
||||
navigateBackWithFallback('/pages/personal-center/index')
|
||||
}
|
||||
|
||||
function handleRemoveAttachment(id: string) {
|
||||
attachments.value = attachments.value.filter(item => item.id !== id)
|
||||
}
|
||||
|
||||
function handleAddAttachment() {
|
||||
uni.showToast({ title: '附件上传开发中', icon: 'none' })
|
||||
}
|
||||
|
||||
function handleReset() {
|
||||
title.value = ''
|
||||
description.value = ''
|
||||
attachments.value = [
|
||||
{ id: '1', name: '需求文档.pdf', icon: pdfIcon },
|
||||
{ id: '2', name: '系统....pdf', icon: pdfIcon },
|
||||
{ id: '3', name: '参考图.png', icon: pngIcon },
|
||||
]
|
||||
}
|
||||
|
||||
function handleSubmit() {
|
||||
if (!title.value.trim()) {
|
||||
uni.showToast({ title: '请输入反馈标题', icon: 'none' })
|
||||
return
|
||||
}
|
||||
if (!description.value.trim()) {
|
||||
uni.showToast({ title: '请详细描述您的问题', icon: 'none' })
|
||||
return
|
||||
}
|
||||
|
||||
uni.showToast({ title: '提交成功', icon: 'none' })
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 1500)
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="feedback">
|
||||
<view class="feedback__navbar">
|
||||
<view
|
||||
class="feedback__back"
|
||||
@tap="handleBack"
|
||||
>
|
||||
<image
|
||||
class="feedback__back-icon"
|
||||
src="/static/icons/icon-back.svg"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
</view>
|
||||
<text class="feedback__navbar-title">
|
||||
意见反馈
|
||||
</text>
|
||||
<view class="feedback__navbar-placeholder" />
|
||||
</view>
|
||||
|
||||
<scroll-view
|
||||
class="feedback__scroll"
|
||||
scroll-y
|
||||
:show-scrollbar="false"
|
||||
>
|
||||
<view class="feedback__card">
|
||||
<input
|
||||
v-model="title"
|
||||
class="feedback__input feedback__input--title"
|
||||
placeholder="请输入反馈标题"
|
||||
placeholder-class="feedback__placeholder"
|
||||
>
|
||||
|
||||
<view class="feedback__textarea-wrap">
|
||||
<textarea
|
||||
v-model="description"
|
||||
class="feedback__textarea"
|
||||
placeholder="请详细描述您的问题..."
|
||||
placeholder-class="feedback__placeholder"
|
||||
:maxlength="FEEDBACK_DESCRIPTION_MAX_LENGTH"
|
||||
/>
|
||||
<text class="feedback__counter">
|
||||
{{ descLength }}/{{ FEEDBACK_DESCRIPTION_MAX_LENGTH }}字
|
||||
</text>
|
||||
</view>
|
||||
|
||||
<view class="feedback__field">
|
||||
<view class="feedback__label-row">
|
||||
<text class="feedback__label feedback__label--inline">
|
||||
附件上传
|
||||
</text>
|
||||
<text class="feedback__hint">
|
||||
支持图片/文档/压缩包
|
||||
</text>
|
||||
</view>
|
||||
<view class="feedback__attachment-row">
|
||||
<view
|
||||
v-for="file in attachments"
|
||||
:key="file.id"
|
||||
class="feedback__attachment-item"
|
||||
>
|
||||
<view
|
||||
class="feedback__attachment-remove"
|
||||
@tap="handleRemoveAttachment(file.id)"
|
||||
>
|
||||
<image
|
||||
class="feedback__attachment-remove-icon"
|
||||
:src="deleteIcon"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
</view>
|
||||
<image
|
||||
class="feedback__attachment-icon"
|
||||
:src="file.icon"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
<text class="feedback__attachment-name">
|
||||
{{ file.name }}
|
||||
</text>
|
||||
</view>
|
||||
<view
|
||||
class="feedback__attachment-add"
|
||||
@tap="handleAddAttachment"
|
||||
>
|
||||
<text class="feedback__attachment-add-icon">
|
||||
+
|
||||
</text>
|
||||
<text class="feedback__attachment-add-text">
|
||||
添加附件
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<view class="feedback__footer">
|
||||
<view
|
||||
class="feedback__footer-btn feedback__footer-btn--primary"
|
||||
@tap="handleReset"
|
||||
>
|
||||
重置
|
||||
</view>
|
||||
<view
|
||||
class="feedback__footer-btn feedback__footer-btn--primary"
|
||||
@tap="handleSubmit"
|
||||
>
|
||||
提交反馈
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import './index.scss';
|
||||
</style>
|
||||
Reference in New Issue
Block a user