|
@@ -4,6 +4,7 @@ import request, { apis } from '@/utils/request'
|
4
|
4
|
import { useModel } from '@/store'
|
5
|
5
|
import toolclass from '@/utils/toolclass.js'
|
6
|
6
|
import SlidePopup from '@/components/SlidePopup/index'
|
|
7
|
+import { Textarea } from '@tarojs/components'
|
7
|
8
|
import Page from '@/layouts'
|
8
|
9
|
import { getShareObject } from '@/utils/share.js'
|
9
|
10
|
import '@/assets/css/reset.less'
|
|
@@ -19,6 +20,8 @@ export default function BaoXiuDetail () {
|
19
|
20
|
const [ShowPopup, setShowPopup] = useState(false)
|
20
|
21
|
const [ShowPingJiaPopup, setShowPingJiaPopup] = useState(false)
|
21
|
22
|
const [StarIndex, setStarIndex] = useState(0)
|
|
23
|
+ const [Comment, setComment] = useState(null)
|
|
24
|
+ const [DataLock, setDataLock] = useState(false)
|
22
|
25
|
|
23
|
26
|
Taro.useShareAppMessage(() => {
|
24
|
27
|
return getShareObject({
|
|
@@ -47,6 +50,24 @@ export default function BaoXiuDetail () {
|
47
|
50
|
}
|
48
|
51
|
}
|
49
|
52
|
|
|
53
|
+ const CommentChange = (e) => {
|
|
54
|
+ setComment(e.detail.value)
|
|
55
|
+ }
|
|
56
|
+
|
|
57
|
+ const ToPingJia = () => {
|
|
58
|
+ if (DataLock) return
|
|
59
|
+ setDataLock(true)
|
|
60
|
+ request({ ...apis.PostGongDanPingJia, args: { orgId: user.orgId }, params: { ticketId: CurrnetBaoXiuId }, data: { score: StarIndex - 0 + 1, comment: Comment } }).then((res) => { // 获取工单详情
|
|
61
|
+ Taro.showToast({ title: '评价成功', icon: 'none' })
|
|
62
|
+ setDetailInfo({ ...DetailInfo, status: 5 })
|
|
63
|
+ setDataLock(false)
|
|
64
|
+ setShowPingJiaPopup(false)
|
|
65
|
+ }).catch((res) => {
|
|
66
|
+ Taro.showToast({ title: res, icon: 'none' })
|
|
67
|
+ setDataLock(false)
|
|
68
|
+ })
|
|
69
|
+ }
|
|
70
|
+
|
50
|
71
|
return (
|
51
|
72
|
<Page>
|
52
|
73
|
<view className='BaoXiuDetail'>
|
|
@@ -111,7 +132,10 @@ export default function BaoXiuDetail () {
|
111
|
132
|
|
112
|
133
|
{/* 更多操作 */}
|
113
|
134
|
<view className='BottomBtn active'>
|
114
|
|
- <text onClick={() => { setShowPingJiaPopup(true) }}>评价</text>
|
|
135
|
+ {
|
|
136
|
+ DetailInfo !== null && DetailInfo.status - 0 === 4 &&
|
|
137
|
+ <text onClick={() => { setShowPingJiaPopup(true) }}>评价</text>
|
|
138
|
+ }
|
115
|
139
|
</view>
|
116
|
140
|
|
117
|
141
|
{/* 更多操作 */}
|
|
@@ -130,7 +154,8 @@ export default function BaoXiuDetail () {
|
130
|
154
|
))
|
131
|
155
|
}
|
132
|
156
|
</view>
|
133
|
|
- <text className='Btn'>提交</text>
|
|
157
|
+ <Textarea placeholder='请输入您的评价' onInput={CommentChange} value={Comment}></Textarea>
|
|
158
|
+ <text className='Btn' onClick={ToPingJia}>提交</text>
|
134
|
159
|
</view>
|
135
|
160
|
</SlidePopup>
|
136
|
161
|
|