|
@@ -13,6 +13,7 @@ export default withLayout((props) => {
|
13
|
13
|
const { person } = useModel('person')
|
14
|
14
|
const [value, setValue] = useState()
|
15
|
15
|
const [show, setShow] = useState(true)
|
|
16
|
+ const [loading, setLoading] = useState(false)
|
16
|
17
|
const onChange = (e) => {
|
17
|
18
|
if (e.detail.value) {
|
18
|
19
|
setValue(e.detail.value)
|
|
@@ -27,18 +28,22 @@ export default withLayout((props) => {
|
27
|
28
|
icon: 'none',
|
28
|
29
|
})
|
29
|
30
|
} else {
|
30
|
|
- console.log(value)
|
|
31
|
+ setLoading(true)
|
31
|
32
|
addFeedback({ ...person, content: value }).then((res) => {
|
32
|
33
|
Taro.showToast({
|
33
|
34
|
title: '反馈已收到!',
|
34
|
|
- icon: 'success',
|
35
|
|
- duration: 2000
|
|
35
|
+ icon: 'success'
|
36
|
36
|
})
|
37
|
37
|
setTimeout(() => {
|
38
|
38
|
Taro.navigateBack({
|
39
|
39
|
delta: 1
|
40
|
40
|
})
|
41
|
|
- }, 1500)
|
|
41
|
+ }, 1000)
|
|
42
|
+ }).catch(err => {
|
|
43
|
+ Taro.showToast({
|
|
44
|
+ title: '网络异常, 请刷新小程序重试',
|
|
45
|
+ icon: 'none',
|
|
46
|
+ })
|
42
|
47
|
})
|
43
|
48
|
}
|
44
|
49
|
}
|
|
@@ -65,7 +70,7 @@ export default withLayout((props) => {
|
65
|
70
|
|
66
|
71
|
</View>
|
67
|
72
|
<View className='bottomBtn'>
|
68
|
|
- <MyButton value='提交' onClick={handleSumbit} />
|
|
73
|
+ <MyButton value='提交' loading={loading} onClick={handleSumbit} />
|
69
|
74
|
</View>
|
70
|
75
|
</View>
|
71
|
76
|
</View>
|