Quellcode durchsuchen

Merge branch 'master' of http://git.ycjcjy.com/xiangsong/miniapp

张延森 vor 4 Jahren
Ursprung
Commit
7e5a51091a

+ 5
- 2
src/pages/WoDe/YeZhuBaoXiu/components/Item/index.jsx Datei anzeigen

@@ -1,4 +1,6 @@
1 1
 import React, { useState } from 'react'
2
+import { PERSON_TYPE } from '@/utils/constants'
3
+import { useModel } from '@/store'
2 4
 import Taro from '@tarojs/taro'
3 5
 import toolclass from '@/utils/toolclass.js'
4 6
 import '@/assets/css/reset.less'
@@ -7,6 +9,7 @@ import './index.less'
7 9
 
8 10
 export default function Item (props) {
9 11
 
12
+  const { user } = useModel('user')
10 13
   const { Data } = props
11 14
 
12 15
   // 随便一条
@@ -30,9 +33,9 @@ export default function Item (props) {
30 33
         <text className='Time'>{toolclass.FormatDate(Data.createDate)}</text>
31 34
       </view>
32 35
       <view className='Name flex-h'>
33
-        <view style={{flex: 1}}><text className='flex-item'>{Data.ticketTitle}</text></view>
36
+        <view className='flex-item'><text>{Data.ticketTitle}</text></view>
34 37
         {
35
-          Data.status === '3' && <view className="Name-action" onClick={props.onAction}>完成</view>    
38
+          Data.status - 0 === 3 && user && user.personType === PERSON_TYPE.LIFE_CONSULTANT && <view className="Name-action" onClick={props.onAction}>完成</view>    
36 39
         }
37 40
       </view>
38 41
       <view className='Detail flex-h'>

+ 2
- 2
src/pages/WoDe/index.jsx Datei anzeigen

@@ -17,9 +17,9 @@ const menuGroup = [
17 17
     { icon: 'iconrenzheng1', name: '业主认证', id: 1, router: '/pages/WoDe/WoDeRenZheng/index' },
18 18
     { icon: 'iconjifenguize', name: '积分明细', id: 2, router: '/pages/FuLi/JiFenMingXi/index' },
19 19
     { icon: 'iconjiaofei', name: '物业缴费', id: 3, router: '/pages/WoDe/WoDeJiaoFei/index' },
20
-    { icon: 'iconfuwu1', name: '业报修', id: 4, router: '/pages/WoDe/WoDeGongDan/index' },
20
+    { icon: 'iconfuwu1', name: '业报修', id: 4, router: '/pages/WoDe/WoDeGongDan/index' },
21 21
     // { icon: 'iconfuwu1', name: '业主工单', id: 4, router: '/pages/WoDe/YeZhuBaoXiu/index', personTypes: [PERSON_TYPE.LIFE_CONSULTANT] },
22
-    { icon: 'iconfuwu1', name: '业报修', id: 4, router: '/pages/WoDe/YeZhuBaoXiu/index' },
22
+    { icon: 'iconfuwu1', name: '业报修', id: 4, router: '/pages/WoDe/YeZhuBaoXiu/index' },
23 23
   ],
24 24
   [
25 25
     { icon: 'iconerweima', name: '推荐二维码', id: 5, router: '/pages/WoDe/TuiJianErWeiMa/index' },

+ 65
- 2
src/pages/WuYe/BaoXiuDetail/index.jsx Datei anzeigen

@@ -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>

+ 42
- 1
src/pages/WuYe/BaoXiuDetail/index.less Datei anzeigen

@@ -159,6 +159,38 @@
159 159
               }
160 160
             }
161 161
 
162
+            >.ReplyList {
163
+              margin-top: 20px;
164
+
165
+              >.flex-h {
166
+                align-items: center;
167
+
168
+                >view {
169
+                  margin-left: 10px;
170
+                  &:first-child {
171
+                    margin-left: 0;
172
+                    >text {
173
+                      color: #14DC05;
174
+                    }
175
+                  }
176
+
177
+                  >text {
178
+                    font-size: 24px;
179
+                    color: #666;
180
+                    line-height: 40px;
181
+                  }
182
+                }
183
+              }
184
+
185
+              >.ReplyContent {
186
+                >text {
187
+                  font-size: 24px;
188
+                  color: #333;
189
+                  line-height: 40px;
190
+                }
191
+              }
192
+            }
193
+
162 194
             >.ImgList {
163 195
               font-size: 0;
164 196
 
@@ -249,16 +281,20 @@
249 281
       }
250 282
     }
251 283
   }
252
-  .PinJiaPopup {
284
+
285
+  .PinJiaPopup,
286
+  .ReplyPopup {
253 287
     padding: 0 30px;
254 288
     position: relative;
255 289
     overflow: hidden;
290
+
256 291
     >.Title {
257 292
       display: block;
258 293
       font-size: 26px;
259 294
       color: #666;
260 295
       line-height: 40px;
261 296
     }
297
+
262 298
     textarea {
263 299
       font-size: 26px;
264 300
       line-height: 40px;
@@ -268,25 +304,30 @@
268 304
       border: 2px solid rgba(0, 0, 0, 0.08);
269 305
       margin-top: 60px;
270 306
     }
307
+
271 308
     >.StarLine {
272 309
       font-size: 0;
273 310
       white-space: nowrap;
274 311
       text-align: center;
275 312
       margin-top: 20px;
313
+
276 314
       text {
277 315
         display: inline-block;
278 316
         vertical-align: middle;
279 317
         font-size: 40px;
280 318
         color: #666;
281 319
         margin-left: 20px;
320
+
282 321
         &:first-child {
283 322
           margin-left: 0;
284 323
         }
324
+
285 325
         &.active {
286 326
           color: #fcdc1e;
287 327
         }
288 328
       }
289 329
     }
330
+
290 331
     >.Btn {
291 332
       font-size: 28px;
292 333
       line-height: 80px;

+ 1
- 0
src/pages/WuYe/BaoXiuFeiYong/index.jsx Datei anzeigen

@@ -84,6 +84,7 @@ export default function BaoXiuFeiYong () {
84 84
       success: res => {
85 85
         if (res.confirm) {
86 86
           WechatPay([BillInfo.id - 0]).then(() => {
87
+            setShowPopup(false)
87 88
             Taro.showToast({
88 89
               title: '缴费成功',
89 90
               icon: 'success'

+ 4
- 0
src/utils/api.js Datei anzeigen

@@ -1,6 +1,10 @@
1 1
 const prefix = `${HOST}/api/wx`
2 2
 
3 3
 const $api = {
4
+  ReplyTicket: { // 工单回复
5
+    method: 'post',
6
+    url: `${prefix}/ticket/reply/:orgId`
7
+  },
4 8
   PostGongDanPingJia: { // 工单评价
5 9
     method: 'post',
6 10
     url: `${prefix}/accessTicket/:orgId`