|
@@ -21,7 +21,10 @@ export default function BaoXiuDetail () {
|
21
|
21
|
const [ShowPingJiaPopup, setShowPingJiaPopup] = useState(false)
|
22
|
22
|
const [StarIndex, setStarIndex] = useState(0)
|
23
|
23
|
const [Comment, setComment] = useState(null)
|
|
24
|
+ const [ReplyContent, setReplyContent] = useState(null)
|
24
|
25
|
const [DataLock, setDataLock] = useState(false)
|
|
26
|
+ const [ShowReplyPopup, setShowReplyPopup] = useState(false)
|
|
27
|
+ const [CurrentReplyId, setCurrentReplyId] = useState(null)
|
25
|
28
|
|
26
|
29
|
Taro.useShareAppMessage(() => {
|
27
|
30
|
return getShareObject({
|
|
@@ -35,6 +38,13 @@ export default function BaoXiuDetail () {
|
35
|
38
|
Init()
|
36
|
39
|
}, [])
|
37
|
40
|
|
|
41
|
+ useEffect(() => {
|
|
42
|
+ if (CurrentReplyId !== null) {
|
|
43
|
+ setReplyContent(null)
|
|
44
|
+ setShowReplyPopup(true)
|
|
45
|
+ }
|
|
46
|
+ }, [CurrentReplyId])
|
|
47
|
+
|
38
|
48
|
const Init = () => {
|
39
|
49
|
request({ ...apis.getGongDanDetail, args: { orgId: user.orgId }, params: { ticketId: CurrnetBaoXiuId } }).then((res) => { // 获取工单详情
|
40
|
50
|
setDetailInfo(res)
|
|
@@ -50,10 +60,28 @@ export default function BaoXiuDetail () {
|
50
|
60
|
}
|
51
|
61
|
}
|
52
|
62
|
|
|
63
|
+ const ReplyChange = (e) => {
|
|
64
|
+ setReplyContent(e.detail.value)
|
|
65
|
+ }
|
|
66
|
+
|
53
|
67
|
const CommentChange = (e) => {
|
54
|
68
|
setComment(e.detail.value)
|
55
|
69
|
}
|
56
|
70
|
|
|
71
|
+ const ToReply = () => {
|
|
72
|
+ if (DataLock) return
|
|
73
|
+ setDataLock(true)
|
|
74
|
+ request({ ...apis.ReplyTicket, args: { orgId: user.orgId }, data: { ticketId: CurrnetBaoXiuId, content: ReplyContent, ticketRecordCommentId: CurrentReplyId } }).then((res) => { // 获取工单详情
|
|
75
|
+ Taro.showToast({ title: '回复成功', icon: 'none' })
|
|
76
|
+ Init()
|
|
77
|
+ setDataLock(false)
|
|
78
|
+ setShowReplyPopup(false)
|
|
79
|
+ }).catch((res) => {
|
|
80
|
+ Taro.showToast({ title: res, icon: 'none' })
|
|
81
|
+ setDataLock(false)
|
|
82
|
+ })
|
|
83
|
+ }
|
|
84
|
+
|
57
|
85
|
const ToPingJia = () => {
|
58
|
86
|
if (DataLock) return
|
59
|
87
|
setDataLock(true)
|
|
@@ -68,6 +96,14 @@ export default function BaoXiuDetail () {
|
68
|
96
|
})
|
69
|
97
|
}
|
70
|
98
|
|
|
99
|
+ const StepClick = (item) => {
|
|
100
|
+ return () => {
|
|
101
|
+ if (DetailInfo.status - 0 < 4) {
|
|
102
|
+ setCurrentReplyId(item.id)
|
|
103
|
+ }
|
|
104
|
+ }
|
|
105
|
+ }
|
|
106
|
+
|
71
|
107
|
return (
|
72
|
108
|
<Page>
|
73
|
109
|
<view className='BaoXiuDetail'>
|
|
@@ -100,12 +136,32 @@ export default function BaoXiuDetail () {
|
100
|
136
|
{
|
101
|
137
|
DetailInfo !== null && DetailInfo.ticketRecordList !== null &&
|
102
|
138
|
DetailInfo.ticketRecordList.map((item, index) => (
|
103
|
|
- <view className='StepList' key={`StepList-${index}`}>
|
|
139
|
+ <view className='StepList' key={`StepList-${index}`} onClick={StepClick(item)}>
|
104
|
140
|
<view className='Title flex-h'>
|
105
|
141
|
<text className='flex-item Red'>{item.ticketStatusName}</text>
|
106
|
142
|
<text>{toolclass.FormatDate(item.createDate)}</text>
|
107
|
143
|
</view>
|
108
|
144
|
<view className='Text'>{item.content}</view>
|
|
145
|
+ {
|
|
146
|
+ item.ticketRecordCommentList.map((subItem, subIndex) => (
|
|
147
|
+ <view className='ReplyList' key={`Reply-${subIndex}`}>
|
|
148
|
+ <view className='flex-h'>
|
|
149
|
+ <view>
|
|
150
|
+ <text>{subItem.userName}</text>
|
|
151
|
+ </view>
|
|
152
|
+ <view className='flex-item'>
|
|
153
|
+ <text>回复:</text>
|
|
154
|
+ </view>
|
|
155
|
+ <view>
|
|
156
|
+ <text>{toolclass.FormatDate(subItem.createDate)}</text>
|
|
157
|
+ </view>
|
|
158
|
+ </view>
|
|
159
|
+ <view className='ReplyContent'>
|
|
160
|
+ <text>{subItem.content}</text>
|
|
161
|
+ </view>
|
|
162
|
+ </view>
|
|
163
|
+ ))
|
|
164
|
+ }
|
109
|
165
|
{/* <view className='Text'>您的报修正在分配物业处理人员,若长时间无人处理,请联系物业。<text className='Blue'>物业电话薄</text><text className='Blue iconfont iconjiantouright'></text></view> */}
|
110
|
166
|
{/* <view className='ImgList'>
|
111
|
167
|
<view></view>
|
|
@@ -133,7 +189,7 @@ export default function BaoXiuDetail () {
|
133
|
189
|
{/* 更多操作 */}
|
134
|
190
|
<view className='BottomBtn active'>
|
135
|
191
|
{
|
136
|
|
- DetailInfo !== null && DetailInfo.status - 0 === 4 &&
|
|
192
|
+ DetailInfo !== null && DetailInfo.status - 0 === 4 && user && user.personType !== PERSON_TYPE.LIFE_CONSULTANT &&
|
137
|
193
|
<text onClick={() => { setShowPingJiaPopup(true) }}>评价</text>
|
138
|
194
|
}
|
139
|
195
|
</view>
|
|
@@ -144,6 +200,13 @@ export default function BaoXiuDetail () {
|
144
|
200
|
</view>
|
145
|
201
|
</view>
|
146
|
202
|
|
|
203
|
+ <SlidePopup Close={() => { setShowReplyPopup(false) }} Show={ShowReplyPopup}>
|
|
204
|
+ <view className='ReplyPopup'>
|
|
205
|
+ <Textarea placeholder='请输入您的回复' onInput={ReplyChange} value={ReplyContent}></Textarea>
|
|
206
|
+ <text className='Btn' onClick={ToReply}>回复</text>
|
|
207
|
+ </view>
|
|
208
|
+ </SlidePopup>
|
|
209
|
+
|
147
|
210
|
<SlidePopup Close={() => { setShowPingJiaPopup(false) }} Show={ShowPingJiaPopup}>
|
148
|
211
|
<view className='PinJiaPopup'>
|
149
|
212
|
<text className='Title'>请对此次服务进行评分</text>
|