|
@@ -0,0 +1,62 @@
|
|
1
|
+import { useState } from "react"
|
|
2
|
+import Taro from "@tarojs/taro"
|
|
3
|
+import { View, Image, Textarea } from "@tarojs/components"
|
|
4
|
+import withLayout from '@/layouts'
|
|
5
|
+import CustomNav from "@/components/CustomNav"
|
|
6
|
+import MyButton from "@/components/MyButton"
|
|
7
|
+import editImg from '@/assets/user/edit.png'
|
|
8
|
+import './style.less'
|
|
9
|
+
|
|
10
|
+export default withLayout((props) => {
|
|
11
|
+ const [value, setValue] = useState()
|
|
12
|
+ const [show, setShow] = useState(true)
|
|
13
|
+ const onChange=(e)=>{
|
|
14
|
+ if (e.detail.value) {
|
|
15
|
+ setValue(e.detail.value)
|
|
16
|
+ }else{
|
|
17
|
+ setShow(true)
|
|
18
|
+ }
|
|
19
|
+ }
|
|
20
|
+ const handleSumbit = () => {
|
|
21
|
+ if (show) {
|
|
22
|
+ Taro.showToast({
|
|
23
|
+ title: '请输入您的建议',
|
|
24
|
+ icon: 'none',
|
|
25
|
+ })
|
|
26
|
+ } else{
|
|
27
|
+ Taro.showToast({
|
|
28
|
+ title: '已反馈',
|
|
29
|
+ icon: 'none',
|
|
30
|
+ })
|
|
31
|
+ Taro.navigateBack({delta:1})
|
|
32
|
+ }
|
|
33
|
+ }
|
|
34
|
+ return (
|
|
35
|
+ <View className='page-index'>
|
|
36
|
+ <View className='index-navbar'>
|
|
37
|
+ <CustomNav title='意见反馈' />
|
|
38
|
+ </View>
|
|
39
|
+ <View className='index-container feedback'>
|
|
40
|
+ <View className='content'>
|
|
41
|
+ <Textarea
|
|
42
|
+ value={value}
|
|
43
|
+ onFocus={()=>setShow(false)}
|
|
44
|
+ onBlur={onChange}
|
|
45
|
+ className='value'
|
|
46
|
+ />
|
|
47
|
+ {
|
|
48
|
+ show &&
|
|
49
|
+ <View className='defaultValue'>
|
|
50
|
+ <Image src={editImg} className='edit' />
|
|
51
|
+ 请留下您宝贵的意见和建议!
|
|
52
|
+ </View>
|
|
53
|
+ }
|
|
54
|
+
|
|
55
|
+ </View>
|
|
56
|
+ <View className='bottomBtn'>
|
|
57
|
+ <MyButton value='提交' onClick={handleSumbit} />
|
|
58
|
+ </View>
|
|
59
|
+ </View>
|
|
60
|
+ </View>
|
|
61
|
+ )
|
|
62
|
+})
|