|
@@ -1,30 +1,57 @@
|
1
|
|
-
|
2
|
1
|
import CustomNav from '@/components/CustomNav'
|
3
|
|
-// import { Button } from '@tarojs/components'
|
4
|
2
|
import Taro from '@tarojs/taro'
|
5
|
3
|
import withLayout from '@/layouts'
|
6
|
|
-
|
7
|
|
-import { Button, Text, Textarea } from '@tarojs/components'
|
|
4
|
+import { Button} from '@tarojs/components'
|
8
|
5
|
import './style.less'
|
|
6
|
+import {saveFeedback} from '@/services/mine'
|
9
|
7
|
|
10
|
8
|
|
11
|
9
|
export default withLayout((props) => {
|
12
|
|
- const { router, person } = props
|
13
|
|
-
|
|
10
|
+ const { person } = props
|
|
11
|
+ const {personId}=person
|
14
|
12
|
const back = () => {
|
15
|
13
|
Taro.navigateBack()
|
16
|
14
|
}
|
17
|
|
-
|
|
15
|
+ const submit=()=>{
|
|
16
|
+ var content=document.getElementById('content').value
|
|
17
|
+ if(content!=''){
|
|
18
|
+ saveFeedback({
|
|
19
|
+ personId,
|
|
20
|
+ content
|
|
21
|
+ }).then(()=>{
|
|
22
|
+ // 成功返回一个模态框提醒用户
|
|
23
|
+ wx.showModal({
|
|
24
|
+ title: '提示',
|
|
25
|
+ content: '反馈成功',
|
|
26
|
+ showCancel:false,
|
|
27
|
+ success (res) {
|
|
28
|
+ if (res.confirm) {
|
|
29
|
+ back()
|
|
30
|
+ }
|
|
31
|
+ }
|
|
32
|
+ })
|
|
33
|
+ })
|
|
34
|
+ }
|
|
35
|
+ else{
|
|
36
|
+ wx.showToast({
|
|
37
|
+ title: '请重新输入',
|
|
38
|
+ icon: 'none',
|
|
39
|
+ duration: 2000
|
|
40
|
+ })
|
|
41
|
+ }
|
|
42
|
+ }
|
18
|
43
|
return (
|
19
|
44
|
<view className='box-content'>
|
20
|
45
|
<CustomNav title='联系我们' />
|
|
46
|
+ <view style={{padding:'60rpx 30rpx'}}>
|
21
|
47
|
<view class='section'>
|
22
|
|
- <Textarea placeholder='请输入您的建议或意见!' confirm-type='done' />
|
|
48
|
+ <textarea placeholder='请输入您的建议或意见!' id='content' />
|
23
|
49
|
</view>
|
24
|
50
|
<view className='button-info'>
|
25
|
|
- <Button className='button-box'>提交</Button>
|
|
51
|
+ <Button className='button-box' onClick={submit}>提交</Button>
|
26
|
52
|
<Button className='button-box-Cancel' onClick={back} >取消</Button>
|
27
|
53
|
</view>
|
|
54
|
+ </view>
|
28
|
55
|
</view>
|
29
|
56
|
)
|
30
|
57
|
})
|